@learncard/helpers 1.5.1 → 1.6.1

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.
@@ -53,12 +53,15 @@ var require_types_cjs_development = __commonJS({
53
53
  var __toCommonJS = /* @__PURE__ */ __name((mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod), "__toCommonJS");
54
54
  var index_exports = {};
55
55
  __export2(index_exports, {
56
+ ACT_AS_HEADER: /* @__PURE__ */ __name(() => ACT_AS_HEADER, "ACT_AS_HEADER"),
56
57
  AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: /* @__PURE__ */ __name(() => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX, "AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX"),
57
58
  AchievementCredentialValidator: /* @__PURE__ */ __name(() => AchievementCredentialValidator, "AchievementCredentialValidator"),
58
59
  AchievementCriteriaValidator: /* @__PURE__ */ __name(() => AchievementCriteriaValidator, "AchievementCriteriaValidator"),
59
60
  AchievementSubjectValidator: /* @__PURE__ */ __name(() => AchievementSubjectValidator, "AchievementSubjectValidator"),
60
61
  AchievementTypeValidator: /* @__PURE__ */ __name(() => AchievementTypeValidator, "AchievementTypeValidator"),
61
62
  AchievementValidator: /* @__PURE__ */ __name(() => AchievementValidator, "AchievementValidator"),
63
+ AcknowledgeViewInputValidator: /* @__PURE__ */ __name(() => AcknowledgeViewInputValidator, "AcknowledgeViewInputValidator"),
64
+ AcknowledgeViewOutputValidator: /* @__PURE__ */ __name(() => AcknowledgeViewOutputValidator, "AcknowledgeViewOutputValidator"),
62
65
  AddTagInputValidator: /* @__PURE__ */ __name(() => AddTagInputValidator, "AddTagInputValidator"),
63
66
  AddressValidator: /* @__PURE__ */ __name(() => AddressValidator, "AddressValidator"),
64
67
  AgeRatingValidator: /* @__PURE__ */ __name(() => AgeRatingValidator, "AgeRatingValidator"),
@@ -136,6 +139,7 @@ var require_types_cjs_development = __commonJS({
136
139
  CreateContactMethodSessionValidator: /* @__PURE__ */ __name(() => CreateContactMethodSessionValidator, "CreateContactMethodSessionValidator"),
137
140
  CreateManagedFrameworkBatchInputValidator: /* @__PURE__ */ __name(() => CreateManagedFrameworkBatchInputValidator, "CreateManagedFrameworkBatchInputValidator"),
138
141
  CreateManagedFrameworkInputValidator: /* @__PURE__ */ __name(() => CreateManagedFrameworkInputValidator, "CreateManagedFrameworkInputValidator"),
142
+ CreateShareLinkInputValidator: /* @__PURE__ */ __name(() => CreateShareLinkInputValidator, "CreateShareLinkInputValidator"),
139
143
  CreateSkillInputValidator: /* @__PURE__ */ __name(() => CreateSkillInputValidator, "CreateSkillInputValidator"),
140
144
  CreateSkillsBatchInputValidator: /* @__PURE__ */ __name(() => CreateSkillsBatchInputValidator, "CreateSkillsBatchInputValidator"),
141
145
  CredentialActivityEventTypeValidator: /* @__PURE__ */ __name(() => CredentialActivityEventTypeValidator, "CredentialActivityEventTypeValidator"),
@@ -167,10 +171,14 @@ var require_types_cjs_development = __commonJS({
167
171
  DeleteSkillInputValidator: /* @__PURE__ */ __name(() => DeleteSkillInputValidator, "DeleteSkillInputValidator"),
168
172
  DidDocumentValidator: /* @__PURE__ */ __name(() => DidDocumentValidator, "DidDocumentValidator"),
169
173
  EMPTY_IN_APP_MESSAGES_FLAG: /* @__PURE__ */ __name(() => EMPTY_IN_APP_MESSAGES_FLAG, "EMPTY_IN_APP_MESSAGES_FLAG"),
174
+ ESCROW_PIN_LOCKED_MESSAGE: /* @__PURE__ */ __name(() => ESCROW_PIN_LOCKED_MESSAGE, "ESCROW_PIN_LOCKED_MESSAGE"),
175
+ ESCROW_PIN_MISMATCH_PATTERN: /* @__PURE__ */ __name(() => ESCROW_PIN_MISMATCH_PATTERN, "ESCROW_PIN_MISMATCH_PATTERN"),
176
+ ESCROW_PIN_UNAVAILABLE_MESSAGE: /* @__PURE__ */ __name(() => ESCROW_PIN_UNAVAILABLE_MESSAGE, "ESCROW_PIN_UNAVAILABLE_MESSAGE"),
170
177
  EncryptedCredentialRecordValidator: /* @__PURE__ */ __name(() => EncryptedCredentialRecordValidator, "EncryptedCredentialRecordValidator"),
171
178
  EncryptedRecordValidator: /* @__PURE__ */ __name(() => EncryptedRecordValidator, "EncryptedRecordValidator"),
172
179
  EndorsementCredentialValidator: /* @__PURE__ */ __name(() => EndorsementCredentialValidator, "EndorsementCredentialValidator"),
173
180
  EndorsementSubjectValidator: /* @__PURE__ */ __name(() => EndorsementSubjectValidator, "EndorsementSubjectValidator"),
181
+ EscrowPinStatusValidator: /* @__PURE__ */ __name(() => EscrowPinStatusValidator, "EscrowPinStatusValidator"),
174
182
  EvidenceValidator: /* @__PURE__ */ __name(() => EvidenceValidator, "EvidenceValidator"),
175
183
  FlatAuthGrantValidator: /* @__PURE__ */ __name(() => FlatAuthGrantValidator, "FlatAuthGrantValidator"),
176
184
  FrameworkWithSkillsValidator: /* @__PURE__ */ __name(() => FrameworkWithSkillsValidator, "FrameworkWithSkillsValidator"),
@@ -192,10 +200,18 @@ var require_types_cjs_development = __commonJS({
192
200
  IdentifierTypeValidator: /* @__PURE__ */ __name(() => IdentifierTypeValidator, "IdentifierTypeValidator"),
193
201
  IdentityObjectValidator: /* @__PURE__ */ __name(() => IdentityObjectValidator, "IdentityObjectValidator"),
194
202
  ImageValidator: /* @__PURE__ */ __name(() => ImageValidator, "ImageValidator"),
203
+ InboxBatchErrorReasonValidator: /* @__PURE__ */ __name(() => InboxBatchErrorReasonValidator, "InboxBatchErrorReasonValidator"),
204
+ InboxBatchReceiptValidator: /* @__PURE__ */ __name(() => InboxBatchReceiptValidator, "InboxBatchReceiptValidator"),
205
+ InboxBatchStatusValidator: /* @__PURE__ */ __name(() => InboxBatchStatusValidator, "InboxBatchStatusValidator"),
195
206
  InboxCredentialQueryValidator: /* @__PURE__ */ __name(() => InboxCredentialQueryValidator, "InboxCredentialQueryValidator"),
207
+ InboxCredentialRefreshReceiptValidator: /* @__PURE__ */ __name(() => InboxCredentialRefreshReceiptValidator, "InboxCredentialRefreshReceiptValidator"),
196
208
  InboxCredentialValidator: /* @__PURE__ */ __name(() => InboxCredentialValidator, "InboxCredentialValidator"),
197
209
  IncrementCounterEventValidator: /* @__PURE__ */ __name(() => IncrementCounterEventValidator, "IncrementCounterEventValidator"),
198
210
  InstalledAppValidator: /* @__PURE__ */ __name(() => InstalledAppValidator, "InstalledAppValidator"),
211
+ IssueInboxCredentialBatchItemResultValidator: /* @__PURE__ */ __name(() => IssueInboxCredentialBatchItemResultValidator, "IssueInboxCredentialBatchItemResultValidator"),
212
+ IssueInboxCredentialBatchItemValidator: /* @__PURE__ */ __name(() => IssueInboxCredentialBatchItemValidator, "IssueInboxCredentialBatchItemValidator"),
213
+ IssueInboxCredentialBatchResponseValidator: /* @__PURE__ */ __name(() => IssueInboxCredentialBatchResponseValidator, "IssueInboxCredentialBatchResponseValidator"),
214
+ IssueInboxCredentialBatchValidator: /* @__PURE__ */ __name(() => IssueInboxCredentialBatchValidator, "IssueInboxCredentialBatchValidator"),
199
215
  IssueInboxCredentialResponseValidator: /* @__PURE__ */ __name(() => IssueInboxCredentialResponseValidator, "IssueInboxCredentialResponseValidator"),
200
216
  IssueInboxCredentialValidator: /* @__PURE__ */ __name(() => IssueInboxCredentialValidator, "IssueInboxCredentialValidator"),
201
217
  IssueInboxSigningAuthorityValidator: /* @__PURE__ */ __name(() => IssueInboxSigningAuthorityValidator, "IssueInboxSigningAuthorityValidator"),
@@ -244,7 +260,16 @@ var require_types_cjs_development = __commonJS({
244
260
  LaunchTypeValidator: /* @__PURE__ */ __name(() => LaunchTypeValidator, "LaunchTypeValidator"),
245
261
  LearnCardRefreshAuthorizationValidator: /* @__PURE__ */ __name(() => LearnCardRefreshAuthorizationValidator, "LearnCardRefreshAuthorizationValidator"),
246
262
  LinkProviderFrameworkInputValidator: /* @__PURE__ */ __name(() => LinkProviderFrameworkInputValidator, "LinkProviderFrameworkInputValidator"),
247
- ManagedCredentialRefreshServiceValidator: /* @__PURE__ */ __name(() => ManagedCredentialRefreshServiceValidator, "ManagedCredentialRefreshServiceValidator"),
263
+ ListShareLinksInputValidator: /* @__PURE__ */ __name(() => ListShareLinksInputValidator, "ListShareLinksInputValidator"),
264
+ MAX_ENDORSEMENTS: /* @__PURE__ */ __name(() => MAX_ENDORSEMENTS, "MAX_ENDORSEMENTS"),
265
+ MAX_SELECTED_CREDENTIALS: /* @__PURE__ */ __name(() => MAX_SELECTED_CREDENTIALS, "MAX_SELECTED_CREDENTIALS"),
266
+ MAX_SHARE_CIPHERTEXT_BYTES: /* @__PURE__ */ __name(() => MAX_SHARE_CIPHERTEXT_BYTES, "MAX_SHARE_CIPHERTEXT_BYTES"),
267
+ MAX_SHARE_LINK_REQUEST_BYTES: /* @__PURE__ */ __name(() => MAX_SHARE_LINK_REQUEST_BYTES, "MAX_SHARE_LINK_REQUEST_BYTES"),
268
+ MAX_SHARE_RECOVERY_JWE_BYTES: /* @__PURE__ */ __name(() => MAX_SHARE_RECOVERY_JWE_BYTES, "MAX_SHARE_RECOVERY_JWE_BYTES"),
269
+ MAX_SHARE_SOURCE_URI_CHARS: /* @__PURE__ */ __name(() => MAX_SHARE_SOURCE_URI_CHARS, "MAX_SHARE_SOURCE_URI_CHARS"),
270
+ MAX_VP_MEMBERS: /* @__PURE__ */ __name(() => MAX_VP_MEMBERS, "MAX_VP_MEMBERS"),
271
+ ManagedCredentialRefreshReceiptValidator: /* @__PURE__ */ __name(() => ManagedCredentialRefreshReceiptValidator, "ManagedCredentialRefreshReceiptValidator"),
272
+ ManagedCredentialRefreshServiceValidator: /* @__PURE__ */ __name(() => ManagedCredentialRefreshServiceValidator2, "ManagedCredentialRefreshServiceValidator"),
248
273
  PaginatedAppStoreListingsValidator: /* @__PURE__ */ __name(() => PaginatedAppStoreListingsValidator, "PaginatedAppStoreListingsValidator"),
249
274
  PaginatedBoostRecipientsValidator: /* @__PURE__ */ __name(() => PaginatedBoostRecipientsValidator, "PaginatedBoostRecipientsValidator"),
250
275
  PaginatedBoostRecipientsWithChildrenValidator: /* @__PURE__ */ __name(() => PaginatedBoostRecipientsWithChildrenValidator, "PaginatedBoostRecipientsWithChildrenValidator"),
@@ -265,11 +290,14 @@ var require_types_cjs_development = __commonJS({
265
290
  PaginatedLCNProfileManagersValidator: /* @__PURE__ */ __name(() => PaginatedLCNProfileManagersValidator, "PaginatedLCNProfileManagersValidator"),
266
291
  PaginatedLCNProfilesAndManagersValidator: /* @__PURE__ */ __name(() => PaginatedLCNProfilesAndManagersValidator, "PaginatedLCNProfilesAndManagersValidator"),
267
292
  PaginatedLCNProfilesValidator: /* @__PURE__ */ __name(() => PaginatedLCNProfilesValidator, "PaginatedLCNProfilesValidator"),
293
+ PaginatedShareLinksValidator: /* @__PURE__ */ __name(() => PaginatedShareLinksValidator, "PaginatedShareLinksValidator"),
268
294
  PaginatedSkillFrameworksValidator: /* @__PURE__ */ __name(() => PaginatedSkillFrameworksValidator, "PaginatedSkillFrameworksValidator"),
269
295
  PaginatedSkillTreeValidator: /* @__PURE__ */ __name(() => PaginatedSkillTreeValidator, "PaginatedSkillTreeValidator"),
270
296
  PaginatedVisibleLCNProfilesValidator: /* @__PURE__ */ __name(() => PaginatedVisibleLCNProfilesValidator, "PaginatedVisibleLCNProfilesValidator"),
271
297
  PaginationOptionsValidator: /* @__PURE__ */ __name(() => PaginationOptionsValidator, "PaginationOptionsValidator"),
272
298
  PaginationResponseValidator: /* @__PURE__ */ __name(() => PaginationResponseValidator, "PaginationResponseValidator"),
299
+ PrepareRefreshableSendInputValidator: /* @__PURE__ */ __name(() => PrepareRefreshableSendInputValidator, "PrepareRefreshableSendInputValidator"),
300
+ PrepareRefreshableSendResultValidator: /* @__PURE__ */ __name(() => PrepareRefreshableSendResultValidator, "PrepareRefreshableSendResultValidator"),
273
301
  ProfileValidator: /* @__PURE__ */ __name(() => ProfileValidator, "ProfileValidator"),
274
302
  ProfileVisibilityEnum: /* @__PURE__ */ __name(() => ProfileVisibilityEnum, "ProfileVisibilityEnum"),
275
303
  PromotionLevelValidator: /* @__PURE__ */ __name(() => PromotionLevelValidator, "PromotionLevelValidator"),
@@ -287,14 +315,24 @@ var require_types_cjs_development = __commonJS({
287
315
  ReplaceSkillFrameworkSkillsInputValidator: /* @__PURE__ */ __name(() => ReplaceSkillFrameworkSkillsInputValidator, "ReplaceSkillFrameworkSkillsInputValidator"),
288
316
  ReplaceSkillFrameworkSkillsResultValidator: /* @__PURE__ */ __name(() => ReplaceSkillFrameworkSkillsResultValidator, "ReplaceSkillFrameworkSkillsResultValidator"),
289
317
  RequestLearnerContextEventValidator: /* @__PURE__ */ __name(() => RequestLearnerContextEventValidator, "RequestLearnerContextEventValidator"),
318
+ ResolveShareLinkInputValidator: /* @__PURE__ */ __name(() => ResolveShareLinkInputValidator, "ResolveShareLinkInputValidator"),
290
319
  ResultDescriptionValidator: /* @__PURE__ */ __name(() => ResultDescriptionValidator, "ResultDescriptionValidator"),
291
320
  ResultStatusTypeValidator: /* @__PURE__ */ __name(() => ResultStatusTypeValidator, "ResultStatusTypeValidator"),
292
321
  ResultTypeValidator: /* @__PURE__ */ __name(() => ResultTypeValidator, "ResultTypeValidator"),
293
322
  ResultValidator: /* @__PURE__ */ __name(() => ResultValidator, "ResultValidator"),
294
323
  RubricCriterionValidator: /* @__PURE__ */ __name(() => RubricCriterionValidator, "RubricCriterionValidator"),
324
+ SHARE_AAD_PREFIX: /* @__PURE__ */ __name(() => SHARE_AAD_PREFIX, "SHARE_AAD_PREFIX"),
325
+ SHARE_CONTENT_KEY_BYTES: /* @__PURE__ */ __name(() => SHARE_CONTENT_KEY_BYTES, "SHARE_CONTENT_KEY_BYTES"),
326
+ SHARE_IV_BYTES: /* @__PURE__ */ __name(() => SHARE_IV_BYTES, "SHARE_IV_BYTES"),
327
+ SHARE_LINK_ID_BYTES: /* @__PURE__ */ __name(() => SHARE_LINK_ID_BYTES, "SHARE_LINK_ID_BYTES"),
328
+ SHARE_LINK_PROTOCOL: /* @__PURE__ */ __name(() => SHARE_LINK_PROTOCOL, "SHARE_LINK_PROTOCOL"),
329
+ SHARE_RECOVERY_PROTOCOL: /* @__PURE__ */ __name(() => SHARE_RECOVERY_PROTOCOL, "SHARE_RECOVERY_PROTOCOL"),
330
+ SHARE_TAG_BYTES: /* @__PURE__ */ __name(() => SHARE_TAG_BYTES, "SHARE_TAG_BYTES"),
331
+ SHARE_VIEW_RECEIPT_TTL_SECONDS: /* @__PURE__ */ __name(() => SHARE_VIEW_RECEIPT_TTL_SECONDS, "SHARE_VIEW_RECEIPT_TTL_SECONDS"),
295
332
  SendAiSessionCredentialEventValidator: /* @__PURE__ */ __name(() => SendAiSessionCredentialEventValidator, "SendAiSessionCredentialEventValidator"),
296
333
  SendBoostInputValidator: /* @__PURE__ */ __name(() => SendBoostInputValidator, "SendBoostInputValidator"),
297
334
  SendBoostResponseValidator: /* @__PURE__ */ __name(() => SendBoostResponseValidator, "SendBoostResponseValidator"),
335
+ SendBoostTemplateValidator: /* @__PURE__ */ __name(() => SendBoostTemplateValidator, "SendBoostTemplateValidator"),
298
336
  SendBrandingOptionsValidator: /* @__PURE__ */ __name(() => SendBrandingOptionsValidator, "SendBrandingOptionsValidator"),
299
337
  SendCredentialEventValidator: /* @__PURE__ */ __name(() => SendCredentialEventValidator, "SendCredentialEventValidator"),
300
338
  SendInboxResponseValidator: /* @__PURE__ */ __name(() => SendInboxResponseValidator, "SendInboxResponseValidator"),
@@ -305,6 +343,32 @@ var require_types_cjs_development = __commonJS({
305
343
  SentCredentialInfoValidator: /* @__PURE__ */ __name(() => SentCredentialInfoValidator, "SentCredentialInfoValidator"),
306
344
  ServiceValidator: /* @__PURE__ */ __name(() => ServiceValidator, "ServiceValidator"),
307
345
  SetPrimaryContactMethodValidator: /* @__PURE__ */ __name(() => SetPrimaryContactMethodValidator, "SetPrimaryContactMethodValidator"),
346
+ ShareCiphertextValidator: /* @__PURE__ */ __name(() => ShareCiphertextValidator, "ShareCiphertextValidator"),
347
+ ShareContentKeyValidator: /* @__PURE__ */ __name(() => ShareContentKeyValidator, "ShareContentKeyValidator"),
348
+ ShareContentStateValidator: /* @__PURE__ */ __name(() => ShareContentStateValidator, "ShareContentStateValidator"),
349
+ ShareEndorsementEntryValidator: /* @__PURE__ */ __name(() => ShareEndorsementEntryValidator, "ShareEndorsementEntryValidator"),
350
+ ShareEnvelopeValidator: /* @__PURE__ */ __name(() => ShareEnvelopeValidator, "ShareEnvelopeValidator"),
351
+ ShareIvValidator: /* @__PURE__ */ __name(() => ShareIvValidator, "ShareIvValidator"),
352
+ ShareLinkIdInputValidator: /* @__PURE__ */ __name(() => ShareLinkIdInputValidator, "ShareLinkIdInputValidator"),
353
+ ShareLinkIdValidator: /* @__PURE__ */ __name(() => ShareLinkIdValidator, "ShareLinkIdValidator"),
354
+ ShareLinkOperationKeyInputValidator: /* @__PURE__ */ __name(() => ShareLinkOperationKeyInputValidator, "ShareLinkOperationKeyInputValidator"),
355
+ ShareLinkOwnerCommitOutputValidator: /* @__PURE__ */ __name(() => ShareLinkOwnerCommitOutputValidator, "ShareLinkOwnerCommitOutputValidator"),
356
+ ShareLinkOwnerContentOutputValidator: /* @__PURE__ */ __name(() => ShareLinkOwnerContentOutputValidator, "ShareLinkOwnerContentOutputValidator"),
357
+ ShareLinkOwnerRecoveryOutputValidator: /* @__PURE__ */ __name(() => ShareLinkOwnerRecoveryOutputValidator, "ShareLinkOwnerRecoveryOutputValidator"),
358
+ ShareLinkOwnerStatusOutputValidator: /* @__PURE__ */ __name(() => ShareLinkOwnerStatusOutputValidator, "ShareLinkOwnerStatusOutputValidator"),
359
+ ShareLinkPublicContentViewValidator: /* @__PURE__ */ __name(() => ShareLinkPublicContentViewValidator, "ShareLinkPublicContentViewValidator"),
360
+ ShareLinkPublicStateValidator: /* @__PURE__ */ __name(() => ShareLinkPublicStateValidator, "ShareLinkPublicStateValidator"),
361
+ ShareLinkStatusValidator: /* @__PURE__ */ __name(() => ShareLinkStatusValidator, "ShareLinkStatusValidator"),
362
+ ShareLinkValidator: /* @__PURE__ */ __name(() => ShareLinkValidator, "ShareLinkValidator"),
363
+ ShareManifestPresentationValidator: /* @__PURE__ */ __name(() => ShareManifestPresentationValidator, "ShareManifestPresentationValidator"),
364
+ ShareOwnerRecoveryValidator: /* @__PURE__ */ __name(() => ShareOwnerRecoveryValidator, "ShareOwnerRecoveryValidator"),
365
+ SharePayloadValidator: /* @__PURE__ */ __name(() => SharePayloadValidator, "SharePayloadValidator"),
366
+ SharePayloadValidatorShape: /* @__PURE__ */ __name(() => SharePayloadValidatorShape, "SharePayloadValidatorShape"),
367
+ ShareRecoveryEndorsementValidator: /* @__PURE__ */ __name(() => ShareRecoveryEndorsementValidator, "ShareRecoveryEndorsementValidator"),
368
+ ShareRecoveryPlaintextValidator: /* @__PURE__ */ __name(() => ShareRecoveryPlaintextValidator, "ShareRecoveryPlaintextValidator"),
369
+ ShareRecoverySelectionValidator: /* @__PURE__ */ __name(() => ShareRecoverySelectionValidator, "ShareRecoverySelectionValidator"),
370
+ ShareSelectionEntryValidator: /* @__PURE__ */ __name(() => ShareSelectionEntryValidator, "ShareSelectionEntryValidator"),
371
+ ShareSharerValidator: /* @__PURE__ */ __name(() => ShareSharerValidator, "ShareSharerValidator"),
308
372
  SkillDeletionStrategyValidator: /* @__PURE__ */ __name(() => SkillDeletionStrategyValidator, "SkillDeletionStrategyValidator"),
309
373
  SkillFrameworkAdminInputValidator: /* @__PURE__ */ __name(() => SkillFrameworkAdminInputValidator, "SkillFrameworkAdminInputValidator"),
310
374
  SkillFrameworkAdminsValidator: /* @__PURE__ */ __name(() => SkillFrameworkAdminsValidator, "SkillFrameworkAdminsValidator"),
@@ -336,6 +400,7 @@ var require_types_cjs_development = __commonJS({
336
400
  UnsignedVCValidator: /* @__PURE__ */ __name(() => UnsignedVCValidator, "UnsignedVCValidator"),
337
401
  UnsignedVPValidator: /* @__PURE__ */ __name(() => UnsignedVPValidator, "UnsignedVPValidator"),
338
402
  UpdateFrameworkInputValidator: /* @__PURE__ */ __name(() => UpdateFrameworkInputValidator, "UpdateFrameworkInputValidator"),
403
+ UpdateShareLinkInputValidator: /* @__PURE__ */ __name(() => UpdateShareLinkInputValidator, "UpdateShareLinkInputValidator"),
339
404
  UpdateSkillInputValidator: /* @__PURE__ */ __name(() => UpdateSkillInputValidator, "UpdateSkillInputValidator"),
340
405
  VC2EvidenceValidator: /* @__PURE__ */ __name(() => VC2EvidenceValidator, "VC2EvidenceValidator"),
341
406
  VCValidator: /* @__PURE__ */ __name(() => VCValidator, "VCValidator"),
@@ -347,7 +412,12 @@ var require_types_cjs_development = __commonJS({
347
412
  VerificationStatusValidator: /* @__PURE__ */ __name(() => VerificationStatusValidator, "VerificationStatusValidator"),
348
413
  appStoreActionValidator: /* @__PURE__ */ __name(() => appStoreActionValidator, "appStoreActionValidator"),
349
414
  capgoUpdateActionValidator: /* @__PURE__ */ __name(() => capgoUpdateActionValidator, "capgoUpdateActionValidator"),
415
+ classifyShareManifest: /* @__PURE__ */ __name(() => classifyShareManifest, "classifyShareManifest"),
416
+ decodeBase64Url: /* @__PURE__ */ __name(() => decodeBase64Url, "decodeBase64Url"),
417
+ decodedBase64UrlByteLength: /* @__PURE__ */ __name(() => decodedBase64UrlByteLength, "decodedBase64UrlByteLength"),
350
418
  dismissActionValidator: /* @__PURE__ */ __name(() => dismissActionValidator, "dismissActionValidator"),
419
+ encodeBase64Url: /* @__PURE__ */ __name(() => encodeBase64Url, "encodeBase64Url"),
420
+ escrowPinMismatchMessage: /* @__PURE__ */ __name(() => escrowPinMismatchMessage, "escrowPinMismatchMessage"),
351
421
  externalLinkActionValidator: /* @__PURE__ */ __name(() => externalLinkActionValidator, "externalLinkActionValidator"),
352
422
  inAppMessageActionStyleValidator: /* @__PURE__ */ __name(() => inAppMessageActionStyleValidator, "inAppMessageActionStyleValidator"),
353
423
  inAppMessageActionTargetValidator: /* @__PURE__ */ __name(() => inAppMessageActionTargetValidator, "inAppMessageActionTargetValidator"),
@@ -362,10 +432,12 @@ var require_types_cjs_development = __commonJS({
362
432
  inAppMessageVersionSourceValidator: /* @__PURE__ */ __name(() => inAppMessageVersionSourceValidator, "inAppMessageVersionSourceValidator"),
363
433
  inAppMessagesFlagValidator: /* @__PURE__ */ __name(() => inAppMessagesFlagValidator, "inAppMessagesFlagValidator"),
364
434
  internalLinkActionValidator: /* @__PURE__ */ __name(() => internalLinkActionValidator, "internalLinkActionValidator"),
435
+ isCanonicalBase64Url: /* @__PURE__ */ __name(() => isCanonicalBase64Url, "isCanonicalBase64Url"),
365
436
  isStoredCredentialEnvelope: /* @__PURE__ */ __name(() => isStoredCredentialEnvelope2, "isStoredCredentialEnvelope"),
366
437
  parseInAppMessagesFlag: /* @__PURE__ */ __name(() => parseInAppMessagesFlag, "parseInAppMessagesFlag"),
367
438
  platformPredicateValidator: /* @__PURE__ */ __name(() => platformPredicateValidator, "platformPredicateValidator"),
368
439
  rolePredicateValidator: /* @__PURE__ */ __name(() => rolePredicateValidator, "rolePredicateValidator"),
440
+ utf8ByteLength: /* @__PURE__ */ __name(() => utf8ByteLength, "utf8ByteLength"),
369
441
  versionPredicateValidator: /* @__PURE__ */ __name(() => versionPredicateValidator, "versionPredicateValidator")
370
442
  });
371
443
  module.exports = __toCommonJS(index_exports);
@@ -1024,7 +1096,7 @@ var require_types_cjs_development = __commonJS({
1024
1096
  getSizableOrigin: /* @__PURE__ */ __name(() => getSizableOrigin, "getSizableOrigin"),
1025
1097
  hexToUint8Array: /* @__PURE__ */ __name(() => hexToUint8Array, "hexToUint8Array"),
1026
1098
  isObject: /* @__PURE__ */ __name(() => isObject, "isObject"),
1027
- isPlainObject: /* @__PURE__ */ __name(() => isPlainObject, "isPlainObject"),
1099
+ isPlainObject: /* @__PURE__ */ __name(() => isPlainObject2, "isPlainObject"),
1028
1100
  issue: /* @__PURE__ */ __name(() => issue, "issue"),
1029
1101
  joinValues: /* @__PURE__ */ __name(() => joinValues, "joinValues"),
1030
1102
  jsonStringifyReplacer: /* @__PURE__ */ __name(() => jsonStringifyReplacer, "jsonStringifyReplacer"),
@@ -1250,7 +1322,7 @@ var require_types_cjs_development = __commonJS({
1250
1322
  return false;
1251
1323
  }
1252
1324
  });
1253
- function isPlainObject(o) {
1325
+ function isPlainObject2(o) {
1254
1326
  if (isObject(o) === false)
1255
1327
  return false;
1256
1328
  const ctor = o.constructor;
@@ -1266,10 +1338,10 @@ var require_types_cjs_development = __commonJS({
1266
1338
  }
1267
1339
  return true;
1268
1340
  }
1269
- __name(isPlainObject, "isPlainObject");
1270
- __name2(isPlainObject, "isPlainObject");
1341
+ __name(isPlainObject2, "isPlainObject");
1342
+ __name2(isPlainObject2, "isPlainObject");
1271
1343
  function shallowClone(o) {
1272
- if (isPlainObject(o))
1344
+ if (isPlainObject2(o))
1273
1345
  return { ...o };
1274
1346
  if (Array.isArray(o))
1275
1347
  return [...o];
@@ -1493,7 +1565,7 @@ var require_types_cjs_development = __commonJS({
1493
1565
  __name(omit, "omit");
1494
1566
  __name2(omit, "omit");
1495
1567
  function extend(schema, shape) {
1496
- if (!isPlainObject(shape)) {
1568
+ if (!isPlainObject2(shape)) {
1497
1569
  throw new Error("Invalid input to extend: expected a plain object");
1498
1570
  }
1499
1571
  const checks = schema._zod.def.checks;
@@ -1518,7 +1590,7 @@ var require_types_cjs_development = __commonJS({
1518
1590
  __name(extend, "extend");
1519
1591
  __name2(extend, "extend");
1520
1592
  function safeExtend(schema, shape) {
1521
- if (!isPlainObject(shape)) {
1593
+ if (!isPlainObject2(shape)) {
1522
1594
  throw new Error("Invalid input to safeExtend: expected a plain object");
1523
1595
  }
1524
1596
  const def = mergeDefs(schema._zod.def, {
@@ -3945,7 +4017,7 @@ var require_types_cjs_development = __commonJS({
3945
4017
  if (a instanceof Date && b instanceof Date && +a === +b) {
3946
4018
  return { valid: true, data: a };
3947
4019
  }
3948
- if (isPlainObject(a) && isPlainObject(b)) {
4020
+ if (isPlainObject2(a) && isPlainObject2(b)) {
3949
4021
  const bKeys = Object.keys(b);
3950
4022
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
3951
4023
  const newObj = { ...a, ...b };
@@ -4141,7 +4213,7 @@ var require_types_cjs_development = __commonJS({
4141
4213
  $ZodType.init(inst, def);
4142
4214
  inst._zod.parse = (payload, ctx) => {
4143
4215
  const input = payload.value;
4144
- if (!isPlainObject(input)) {
4216
+ if (!isPlainObject2(input)) {
4145
4217
  payload.issues.push({
4146
4218
  expected: "record",
4147
4219
  code: "invalid_type",
@@ -16219,6 +16291,204 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16219
16291
  $or: BaseStringQuery.array()
16220
16292
  })
16221
16293
  ]);
16294
+ var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
16295
+ var ManagedCredentialRefreshServiceValidator2 = external_exports.object({
16296
+ id: external_exports.string().min(1),
16297
+ type: external_exports.literal("LearnCardCredentialRefresh2026"),
16298
+ authorization: LearnCardRefreshAuthorizationValidator.optional()
16299
+ }).catchall(external_exports.any());
16300
+ var StandardCredentialRefreshServiceValidator = external_exports.object({
16301
+ id: external_exports.string().min(1),
16302
+ type: external_exports.literal("1EdTechCredentialRefresh")
16303
+ }).catchall(external_exports.any());
16304
+ var SupportedCredentialRefreshServiceValidator2 = external_exports.union([
16305
+ ManagedCredentialRefreshServiceValidator2,
16306
+ StandardCredentialRefreshServiceValidator
16307
+ ]);
16308
+ var AllocateCredentialRefreshInputValidator = external_exports.object({
16309
+ holder: external_exports.object({
16310
+ profileId: external_exports.string().optional(),
16311
+ did: external_exports.string().min(1)
16312
+ }),
16313
+ credentialId: external_exports.string().min(1)
16314
+ });
16315
+ var AllocateCredentialRefreshResultValidator = external_exports.object({
16316
+ refreshId: external_exports.string().min(1),
16317
+ refreshService: ManagedCredentialRefreshServiceValidator2.extend({
16318
+ authorization: LearnCardRefreshAuthorizationValidator
16319
+ })
16320
+ });
16321
+ var ManagedCredentialRefreshReceiptValidator = external_exports.object({
16322
+ refreshId: external_exports.string().min(1),
16323
+ refreshService: ManagedCredentialRefreshServiceValidator2,
16324
+ credentialId: external_exports.string().min(1),
16325
+ issuerDid: external_exports.string().min(1),
16326
+ holderDid: external_exports.string().min(1),
16327
+ credentialStatus: CredentialStatusValidator.or(
16328
+ CredentialStatusValidator.array()
16329
+ ).optional()
16330
+ }).strip();
16331
+ var InboxCredentialRefreshReceiptValidator = ManagedCredentialRefreshReceiptValidator.omit(
16332
+ { holderDid: true }
16333
+ ).extend({ holderDid: external_exports.string().min(1).optional() });
16334
+ var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
16335
+ var PublishCredentialRefreshBaseFields = {
16336
+ refreshId: external_exports.string().min(1),
16337
+ notifyHolder: external_exports.boolean().optional(),
16338
+ updateSummary: external_exports.string().optional(),
16339
+ idempotencyKey: external_exports.string().optional()
16340
+ };
16341
+ var PublishIssuerSignedRefreshValidator = external_exports.object({
16342
+ ...PublishCredentialRefreshBaseFields,
16343
+ mode: external_exports.literal("issuer-signed"),
16344
+ signedCredential: VCValidator
16345
+ });
16346
+ var PublishSigningAuthorityRefreshValidator = external_exports.object({
16347
+ ...PublishCredentialRefreshBaseFields,
16348
+ mode: external_exports.literal("signing-authority"),
16349
+ credential: UnsignedVCValidator,
16350
+ signingAuthority: external_exports.object({
16351
+ type: external_exports.string().min(1)
16352
+ }).catchall(external_exports.any())
16353
+ });
16354
+ var PublishCredentialRefreshInputValidator = external_exports.object({
16355
+ ...PublishCredentialRefreshBaseFields,
16356
+ mode: CredentialRefreshSigningModeValidator,
16357
+ signedCredential: VCValidator.optional(),
16358
+ credential: UnsignedVCValidator.optional(),
16359
+ signingAuthority: external_exports.object({
16360
+ type: external_exports.string().min(1)
16361
+ }).catchall(external_exports.any()).optional()
16362
+ }).superRefine((input, ctx) => {
16363
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
16364
+ ctx.addIssue({
16365
+ code: "custom",
16366
+ path: ["signedCredential"],
16367
+ message: "signedCredential is required for issuer-signed publication"
16368
+ });
16369
+ }
16370
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
16371
+ ctx.addIssue({
16372
+ code: "custom",
16373
+ path: ["mode"],
16374
+ message: "issuer-signed publication cannot include signing-authority fields"
16375
+ });
16376
+ }
16377
+ if (input.mode === "signing-authority") {
16378
+ if (input.signedCredential !== void 0) {
16379
+ ctx.addIssue({
16380
+ code: "custom",
16381
+ path: ["signedCredential"],
16382
+ message: "signing-authority publication cannot include signedCredential"
16383
+ });
16384
+ }
16385
+ if (!input.credential) {
16386
+ ctx.addIssue({
16387
+ code: "custom",
16388
+ path: ["credential"],
16389
+ message: "credential is required for signing-authority publication"
16390
+ });
16391
+ }
16392
+ if (!input.signingAuthority) {
16393
+ ctx.addIssue({
16394
+ code: "custom",
16395
+ path: ["signingAuthority"],
16396
+ message: "signingAuthority is required for signing-authority publication"
16397
+ });
16398
+ }
16399
+ }
16400
+ });
16401
+ var PublishCredentialRefreshNotificationValidator = external_exports.enum([
16402
+ "queued",
16403
+ "suppressed",
16404
+ "not-applicable",
16405
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
16406
+ "delivery-failed"
16407
+ ]);
16408
+ var PublishCredentialRefreshResultValidator = external_exports.object({
16409
+ refreshId: external_exports.string().min(1),
16410
+ version: external_exports.number().int().positive(),
16411
+ publishedAt: external_exports.string().min(1),
16412
+ notification: PublishCredentialRefreshNotificationValidator
16413
+ });
16414
+ var CredentialRefreshVersionMetadataValidator = external_exports.object({
16415
+ version: external_exports.number().int().positive(),
16416
+ publishedAt: external_exports.string().min(1),
16417
+ effectiveAt: external_exports.string().optional(),
16418
+ etag: external_exports.string().optional(),
16419
+ signingMode: CredentialRefreshSigningModeValidator.optional(),
16420
+ updateSummary: external_exports.string().optional()
16421
+ });
16422
+ var GetCredentialRefreshHistoryInputValidator = external_exports.object({
16423
+ refreshId: external_exports.string().min(1),
16424
+ cursor: external_exports.string().optional(),
16425
+ limit: external_exports.number().int().positive().optional()
16426
+ });
16427
+ var GetCredentialRefreshHistoryResultValidator = external_exports.object({
16428
+ records: CredentialRefreshVersionMetadataValidator.array(),
16429
+ hasMore: external_exports.boolean(),
16430
+ cursor: external_exports.string().optional()
16431
+ });
16432
+ var CredentialRefreshChallengeValidator = external_exports.object({
16433
+ challenge: external_exports.string().min(1),
16434
+ expiresAt: external_exports.string().min(1),
16435
+ domain: external_exports.string().optional(),
16436
+ scheme: external_exports.literal("LearnCardDIDAuth").optional()
16437
+ });
16438
+ var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
16439
+ format: external_exports.literal("vc"),
16440
+ credential: VCValidator,
16441
+ etag: external_exports.string().optional()
16442
+ });
16443
+ var JweCredentialRefreshEnvelopeValidator = external_exports.object({
16444
+ format: external_exports.literal("jwe"),
16445
+ jwe: JWEValidator2,
16446
+ etag: external_exports.string().optional(),
16447
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
16448
+ version: external_exports.number().int().positive().optional()
16449
+ });
16450
+ var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
16451
+ PublicCredentialRefreshEnvelopeValidator,
16452
+ JweCredentialRefreshEnvelopeValidator
16453
+ ]);
16454
+ var CredentialRefreshFailureCodeValidator = external_exports.enum([
16455
+ "UNAVAILABLE",
16456
+ "TIMEOUT",
16457
+ "UNSUPPORTED_SERVICE",
16458
+ "UNAUTHORIZED",
16459
+ "MALFORMED_RESPONSE",
16460
+ "INVALID_PROOF",
16461
+ "ISSUER_MISMATCH",
16462
+ "ID_MISMATCH",
16463
+ "ROLLBACK",
16464
+ "REVOKED",
16465
+ "UNSAFE_ENDPOINT"
16466
+ ]);
16467
+ var CredentialRefreshUpdatedResultValidator = external_exports.object({
16468
+ status: external_exports.literal("updated"),
16469
+ credential: VCValidator,
16470
+ etag: external_exports.string().optional(),
16471
+ managedVersion: external_exports.number().int().positive().optional()
16472
+ });
16473
+ var CredentialRefreshUnchangedResultValidator = external_exports.object({
16474
+ status: external_exports.literal("unchanged"),
16475
+ checkedAt: external_exports.string().min(1),
16476
+ etag: external_exports.string().optional()
16477
+ });
16478
+ var CredentialRefreshUnsupportedResultValidator = external_exports.object({
16479
+ status: external_exports.literal("unsupported")
16480
+ });
16481
+ var CredentialRefreshFailedResultValidator = external_exports.object({
16482
+ status: external_exports.literal("failed"),
16483
+ code: CredentialRefreshFailureCodeValidator,
16484
+ retryable: external_exports.boolean()
16485
+ });
16486
+ var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
16487
+ CredentialRefreshUpdatedResultValidator,
16488
+ CredentialRefreshUnchangedResultValidator,
16489
+ CredentialRefreshUnsupportedResultValidator,
16490
+ CredentialRefreshFailedResultValidator
16491
+ ]);
16222
16492
  var LCNProfileDisplayValidator = external_exports.object({
16223
16493
  backgroundColor: external_exports.string().optional(),
16224
16494
  backgroundImage: external_exports.string().optional(),
@@ -16554,7 +16824,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16554
16824
  "Options for email/phone recipients (Universal Inbox)"
16555
16825
  ),
16556
16826
  templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
16557
- integrationId: external_exports.string().optional().describe("Integration ID for activity tracking")
16827
+ integrationId: external_exports.string().optional().describe("Integration ID for activity tracking"),
16828
+ refresh: external_exports.boolean().optional().describe(
16829
+ "Request managed credential refresh for this send. Profile/DID recipients use immediate issuance; email/phone recipients use deferred Universal Inbox signing and bind the holder at claim."
16830
+ ),
16831
+ idempotencyKey: external_exports.string().min(1).max(200).optional().describe(
16832
+ "Caller-chosen key that makes a managed refresh send (refresh: true) safe to retry as a whole: retries with the same key reuse the same boost, refresh allocation and result. Reusing a key for a different request is rejected. With signedCredential, requires prior tRPC prepareRefreshableSend; direct REST callers omit the key and retry the exact signed credential and templateUri."
16833
+ )
16558
16834
  }).refine((data) => data.templateUri || data.template || data.signedCredential, {
16559
16835
  message: "Either templateUri, template, or signedCredential must be provided.",
16560
16836
  path: ["templateUri"]
@@ -16569,8 +16845,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16569
16845
  message: "guardianEmail must differ from recipient (self-approval not allowed)",
16570
16846
  path: ["options", "guardianEmail"]
16571
16847
  }
16572
- );
16848
+ ).refine((data) => !data.idempotencyKey || data.refresh === true, {
16849
+ message: "idempotencyKey is only supported with refresh: true.",
16850
+ path: ["idempotencyKey"]
16851
+ });
16573
16852
  var SendInboxResponseValidator = external_exports.object({
16853
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
16574
16854
  issuanceId: external_exports.string(),
16575
16855
  status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
16576
16856
  claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
@@ -16585,8 +16865,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16585
16865
  activityId: external_exports.string().describe("Links to the activity lifecycle for this issuance"),
16586
16866
  inbox: SendInboxResponseValidator.optional().describe(
16587
16867
  "Present when sent via email/phone (Universal Inbox)"
16868
+ ),
16869
+ refresh: ManagedCredentialRefreshReceiptValidator.optional().describe(
16870
+ "Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
16588
16871
  )
16589
16872
  });
16873
+ var PrepareRefreshableSendInputValidator = external_exports.object({
16874
+ recipient: external_exports.string(),
16875
+ templateUri: external_exports.string().optional(),
16876
+ template: SendBoostTemplateValidator.optional(),
16877
+ contractUri: external_exports.string().optional(),
16878
+ templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
16879
+ integrationId: external_exports.string().optional(),
16880
+ /** Credential ID to allocate for; generated server-side when omitted. */
16881
+ credentialId: external_exports.string().min(1).optional(),
16882
+ idempotencyKey: external_exports.string().min(1).max(200).optional()
16883
+ }).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
16884
+ message: "Provide exactly one of templateUri or template."
16885
+ });
16886
+ var PrepareRefreshableSendResultValidator = external_exports.object({
16887
+ boostUri: external_exports.string(),
16888
+ credentialId: external_exports.string(),
16889
+ refreshId: external_exports.string(),
16890
+ refreshService: ManagedCredentialRefreshServiceValidator2,
16891
+ /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
16892
+ holderDid: external_exports.string(),
16893
+ /** Present when this idempotencyKey already completed: return it without signing. */
16894
+ completed: SendBoostResponseValidator.optional()
16895
+ });
16590
16896
  var SendInputValidator = external_exports.discriminatedUnion("type", [SendBoostInputValidator]);
16591
16897
  var SendResponseValidator = external_exports.discriminatedUnion("type", [SendBoostResponseValidator]);
16592
16898
  var ConsentFlowTermsStatusValidator = external_exports.enum(["live", "stale", "withdrawn"]);
@@ -16905,6 +17211,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16905
17211
  webhookUrl: external_exports.string().optional()
16906
17212
  });
16907
17213
  var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
17214
+ var ACT_AS_HEADER = "X-LearnCard-Act-As";
16908
17215
  var AuthGrantValidator = external_exports.object({
16909
17216
  id: external_exports.string(),
16910
17217
  name: external_exports.string(),
@@ -16917,6 +17224,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16917
17224
  }, "error")
16918
17225
  }),
16919
17226
  scope: external_exports.string(),
17227
+ actAs: external_exports.string().optional(),
16920
17228
  createdAt: external_exports.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
16921
17229
  expiresAt: external_exports.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
16922
17230
  });
@@ -16988,6 +17296,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16988
17296
  sessionJwt: external_exports.string()
16989
17297
  });
16990
17298
  var InboxCredentialValidator = external_exports.object({
17299
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
17300
+ refreshId: external_exports.string().optional(),
16991
17301
  id: external_exports.string(),
16992
17302
  credential: external_exports.string().optional(),
16993
17303
  isSigned: external_exports.boolean(),
@@ -17042,12 +17352,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17042
17352
  templateUri: external_exports.string().optional().describe(
17043
17353
  "URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
17044
17354
  ),
17355
+ refresh: external_exports.boolean().optional().describe(
17356
+ "Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
17357
+ ),
17358
+ idempotencyKey: external_exports.string().min(1).max(200).optional(),
17045
17359
  // === OPTIONAL FEATURES ===
17046
17360
  // Add major, distinct features at the top level.
17047
17361
  //consentRequest: ConsentRequestValidator.optional(),
17048
17362
  // === PROCESS CONFIGURATION (Optional) ===
17049
17363
  // HOW should this issuance be handled?
17050
17364
  configuration: external_exports.object({
17365
+ guardianEmail: external_exports.string().email().optional().describe(
17366
+ "Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
17367
+ ),
17051
17368
  signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
17052
17369
  "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."
17053
17370
  ),
@@ -17101,17 +17418,130 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17101
17418
  }).optional().describe(
17102
17419
  "Configuration for the credential issuance. If not provided, the default configuration will be used."
17103
17420
  )
17421
+ }).refine((data) => !data.idempotencyKey || data.refresh === true, {
17422
+ message: "idempotencyKey requires refresh: true."
17104
17423
  }).refine((data) => data.credential || data.templateUri, {
17105
17424
  message: "Either credential or templateUri must be provided.",
17106
17425
  path: ["credential"]
17107
- });
17426
+ }).refine(
17427
+ (data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
17428
+ {
17429
+ message: "guardianEmail must differ from recipient (self-approval not allowed)",
17430
+ path: ["configuration", "guardianEmail"]
17431
+ }
17432
+ );
17108
17433
  var IssueInboxCredentialResponseValidator = external_exports.object({
17434
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
17109
17435
  issuanceId: external_exports.string(),
17110
17436
  status: LCNInboxStatusEnumValidator,
17111
17437
  recipient: ContactMethodQueryValidator,
17112
17438
  claimUrl: external_exports.string().url().optional(),
17113
17439
  recipientDid: external_exports.string().optional()
17114
17440
  });
17441
+ var InboxBatchConfigurationValidator = IssueInboxCredentialValidator.shape.configuration.unwrap().extend({
17442
+ refresh: IssueInboxCredentialValidator.shape.refresh.describe(
17443
+ "Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
17444
+ ),
17445
+ delivery: IssueInboxCredentialValidator.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports.boolean().optional() }).optional()
17446
+ });
17447
+ var InboxBatchItemConfigurationValidator = InboxBatchConfigurationValidator.extend({
17448
+ guardianEmail: InboxBatchConfigurationValidator.shape.guardianEmail.nullable().describe(
17449
+ "Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
17450
+ )
17451
+ });
17452
+ var IssueInboxCredentialBatchItemValidator = external_exports.object({
17453
+ ...IssueInboxCredentialValidator.shape,
17454
+ configuration: InboxBatchItemConfigurationValidator.optional(),
17455
+ idempotencyKey: external_exports.string().max(256).optional()
17456
+ }).refine((data) => data.credential || data.templateUri, {
17457
+ message: "Either credential or templateUri must be provided.",
17458
+ path: ["credential"]
17459
+ }).describe(
17460
+ "One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
17461
+ );
17462
+ var IssueInboxCredentialBatchValidator = external_exports.object({
17463
+ requestId: external_exports.string().min(1).max(256).optional(),
17464
+ items: external_exports.array(IssueInboxCredentialBatchItemValidator).min(1).max(100),
17465
+ configuration: InboxBatchConfigurationValidator.optional()
17466
+ }).superRefine((batch, ctx) => {
17467
+ batch.items.forEach((item, index) => {
17468
+ const itemGuardian = item.configuration?.guardianEmail;
17469
+ const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
17470
+ if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
17471
+ ctx.addIssue({
17472
+ code: "custom",
17473
+ path: ["items", index, "configuration", "guardianEmail"],
17474
+ message: "guardianEmail must differ from recipient (self-approval not allowed)"
17475
+ });
17476
+ }
17477
+ });
17478
+ });
17479
+ var InboxBatchErrorReasonValidator = external_exports.enum([
17480
+ "DUPLICATE_KEY",
17481
+ "IDEMPOTENCY_MISMATCH",
17482
+ "IN_PROGRESS",
17483
+ "UNCONFIRMED"
17484
+ ]);
17485
+ var IssueInboxCredentialBatchItemResultValidator = external_exports.discriminatedUnion("success", [
17486
+ IssueInboxCredentialResponseValidator.extend({
17487
+ success: external_exports.literal(true),
17488
+ index: external_exports.number().int().nonnegative(),
17489
+ deduplicated: external_exports.boolean().optional(),
17490
+ guardianStatus: GuardianStatusValidator.optional(),
17491
+ idempotencyKey: external_exports.string().optional()
17492
+ }),
17493
+ external_exports.object({
17494
+ success: external_exports.literal(false),
17495
+ index: external_exports.number().int().nonnegative(),
17496
+ idempotencyKey: external_exports.string().optional(),
17497
+ recipient: ContactMethodQueryValidator.optional(),
17498
+ error: external_exports.object({
17499
+ code: external_exports.string(),
17500
+ message: external_exports.string(),
17501
+ reason: InboxBatchErrorReasonValidator.optional()
17502
+ }),
17503
+ issuanceId: external_exports.string().optional().describe(
17504
+ "Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
17505
+ ),
17506
+ claimUrl: external_exports.string().url().optional().describe(
17507
+ "Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
17508
+ )
17509
+ })
17510
+ ]);
17511
+ var IssueInboxCredentialBatchResponseValidator = external_exports.object({
17512
+ results: external_exports.array(IssueInboxCredentialBatchItemResultValidator),
17513
+ summary: external_exports.object({
17514
+ total: external_exports.number(),
17515
+ succeeded: external_exports.number(),
17516
+ failed: external_exports.number(),
17517
+ deduplicated: external_exports.number()
17518
+ })
17519
+ });
17520
+ var InboxBatchReceiptValidator = external_exports.object({
17521
+ batchId: external_exports.string(),
17522
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
17523
+ createdAt: external_exports.string()
17524
+ });
17525
+ var InboxBatchStatusValidator = external_exports.object({
17526
+ batchId: external_exports.string(),
17527
+ createdAt: external_exports.string(),
17528
+ done: external_exports.boolean().describe(
17529
+ "True when no queued or processing items remain, including unconfirmed outcomes."
17530
+ ),
17531
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
17532
+ items: external_exports.array(
17533
+ external_exports.object({
17534
+ index: external_exports.number().int().nonnegative(),
17535
+ state: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
17536
+ result: IssueInboxCredentialBatchItemResultValidator.optional()
17537
+ })
17538
+ ),
17539
+ summary: IssueInboxCredentialBatchResponseValidator.shape.summary.extend({
17540
+ completed: external_exports.number(),
17541
+ pending: external_exports.number(),
17542
+ unconfirmed: external_exports.number()
17543
+ })
17544
+ });
17115
17545
  var CredentialNameRefValidator = external_exports.object({ name: external_exports.string() }).passthrough();
17116
17546
  var ClaimInboxCredentialValidator = external_exports.object({
17117
17547
  credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
@@ -17597,6 +18027,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17597
18027
  eventType: CredentialActivityEventTypeValidator,
17598
18028
  timestamp: external_exports.string(),
17599
18029
  actorProfileId: external_exports.string().optional(),
18030
+ onBehalfOf: external_exports.string().optional(),
17600
18031
  recipientType: CredentialActivityRecipientTypeValidator,
17601
18032
  recipientIdentifier: external_exports.string(),
17602
18033
  boostUri: external_exports.string().optional(),
@@ -17643,6 +18074,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17643
18074
  __name2(this, "AuthSessionError");
17644
18075
  }
17645
18076
  };
18077
+ var ESCROW_PIN_LOCKED_MESSAGE = "Too many incorrect PIN attempts. You can still recover by waiting.";
18078
+ var ESCROW_PIN_UNAVAILABLE_MESSAGE = "PIN recovery is not available for this account.";
18079
+ var ESCROW_PIN_MISMATCH_PATTERN = /^Incorrect PIN\. (\d+) attempts left\.$/;
18080
+ var escrowPinMismatchMessage = /* @__PURE__ */ __name2((attemptsRemaining) => `Incorrect PIN. ${attemptsRemaining} attempts left.`, "escrowPinMismatchMessage");
18081
+ var EscrowPinStatusValidator = external_exports.object({
18082
+ state: external_exports.enum(["none", "enabled", "locked", "stale"]),
18083
+ enabled: external_exports.boolean(),
18084
+ attemptsRemaining: external_exports.number().int().nonnegative(),
18085
+ salt: external_exports.string().optional()
18086
+ });
17646
18087
  var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
17647
18088
  var DEFAULT_BITSTRING_STATUS_LIST_SIZE = 131072;
17648
18089
  var BitstringStatusPurposeValidator = external_exports.enum(BITSTRING_STATUS_PURPOSES);
@@ -17757,191 +18198,458 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17757
18198
  const result = inAppMessagesFlagValidator.safeParse(raw);
17758
18199
  return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
17759
18200
  }, "parseInAppMessagesFlag");
17760
- var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
17761
- var ManagedCredentialRefreshServiceValidator = external_exports.object({
17762
- id: external_exports.string().min(1),
17763
- type: external_exports.literal("LearnCardCredentialRefresh2026"),
17764
- authorization: LearnCardRefreshAuthorizationValidator.optional()
17765
- }).catchall(external_exports.any());
17766
- var StandardCredentialRefreshServiceValidator = external_exports.object({
17767
- id: external_exports.string().min(1),
17768
- type: external_exports.literal("1EdTechCredentialRefresh")
17769
- }).catchall(external_exports.any());
17770
- var SupportedCredentialRefreshServiceValidator2 = external_exports.union([
17771
- ManagedCredentialRefreshServiceValidator,
17772
- StandardCredentialRefreshServiceValidator
17773
- ]);
17774
- var AllocateCredentialRefreshInputValidator = external_exports.object({
17775
- holder: external_exports.object({
17776
- profileId: external_exports.string().optional(),
17777
- did: external_exports.string().min(1)
17778
- }),
17779
- credentialId: external_exports.string().min(1)
17780
- });
17781
- var AllocateCredentialRefreshResultValidator = external_exports.object({
17782
- refreshId: external_exports.string().min(1),
17783
- refreshService: ManagedCredentialRefreshServiceValidator.extend({
17784
- authorization: LearnCardRefreshAuthorizationValidator
17785
- })
17786
- });
17787
- var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
17788
- var PublishCredentialRefreshBaseFields = {
17789
- refreshId: external_exports.string().min(1),
17790
- notifyHolder: external_exports.boolean().optional(),
17791
- updateSummary: external_exports.string().optional(),
17792
- idempotencyKey: external_exports.string().optional()
17793
- };
17794
- var PublishIssuerSignedRefreshValidator = external_exports.object({
17795
- ...PublishCredentialRefreshBaseFields,
17796
- mode: external_exports.literal("issuer-signed"),
17797
- signedCredential: VCValidator
17798
- });
17799
- var PublishSigningAuthorityRefreshValidator = external_exports.object({
17800
- ...PublishCredentialRefreshBaseFields,
17801
- mode: external_exports.literal("signing-authority"),
17802
- credential: UnsignedVCValidator,
17803
- signingAuthority: external_exports.object({
17804
- type: external_exports.string().min(1)
17805
- }).catchall(external_exports.any())
17806
- });
17807
- var PublishCredentialRefreshInputValidator = external_exports.object({
17808
- ...PublishCredentialRefreshBaseFields,
17809
- mode: CredentialRefreshSigningModeValidator,
17810
- signedCredential: VCValidator.optional(),
17811
- credential: UnsignedVCValidator.optional(),
17812
- signingAuthority: external_exports.object({
17813
- type: external_exports.string().min(1)
17814
- }).catchall(external_exports.any()).optional()
17815
- }).superRefine((input, ctx) => {
17816
- if (input.mode === "issuer-signed" && !input.signedCredential) {
17817
- ctx.addIssue({
17818
- code: "custom",
17819
- path: ["signedCredential"],
17820
- message: "signedCredential is required for issuer-signed publication"
17821
- });
18201
+ var SHARE_LINK_ID_BYTES = 16;
18202
+ var SHARE_CONTENT_KEY_BYTES = 32;
18203
+ var SHARE_IV_BYTES = 12;
18204
+ var SHARE_TAG_BYTES = 16;
18205
+ var MAX_SHARE_CIPHERTEXT_BYTES = 512 * 1024;
18206
+ var MAX_SHARE_RECOVERY_JWE_BYTES = 64 * 1024;
18207
+ var MAX_SELECTED_CREDENTIALS = 50;
18208
+ var MAX_ENDORSEMENTS = 200;
18209
+ var MAX_VP_MEMBERS = MAX_SELECTED_CREDENTIALS + MAX_ENDORSEMENTS;
18210
+ var MAX_SHARE_SOURCE_URI_CHARS = 2048;
18211
+ var MAX_SHARE_LINK_REQUEST_BYTES = 1024 * 1024;
18212
+ var SHARE_LINK_PROTOCOL = "lc-share/v1";
18213
+ var SHARE_RECOVERY_PROTOCOL = "lc-share-recovery/v1";
18214
+ var SHARE_AAD_PREFIX = "lc-share:v1";
18215
+ var BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
18216
+ var BASE64URL_LOOKUP = (() => {
18217
+ const table = new Int16Array(128).fill(-1);
18218
+ for (let index = 0; index < BASE64URL_ALPHABET.length; index += 1) {
18219
+ table[BASE64URL_ALPHABET.charCodeAt(index)] = index;
18220
+ }
18221
+ return table;
18222
+ })();
18223
+ var encodeBase64Url = /* @__PURE__ */ __name2((bytes) => {
18224
+ let output = "";
18225
+ for (let index = 0; index < bytes.length; index += 3) {
18226
+ const first = bytes[index];
18227
+ const second = bytes[index + 1];
18228
+ const third = bytes[index + 2];
18229
+ output += BASE64URL_ALPHABET[first >> 2];
18230
+ output += BASE64URL_ALPHABET[(first & 3) << 4 | (second ?? 0) >> 4];
18231
+ if (second === void 0) break;
18232
+ output += BASE64URL_ALPHABET[(second & 15) << 2 | (third ?? 0) >> 6];
18233
+ if (third === void 0) break;
18234
+ output += BASE64URL_ALPHABET[third & 63];
18235
+ }
18236
+ return output;
18237
+ }, "encodeBase64Url");
18238
+ var decodeBase64Url = /* @__PURE__ */ __name2((value) => {
18239
+ if (typeof value !== "string") return null;
18240
+ const output = new Uint8Array(Math.floor(value.length * 6 / 8));
18241
+ let bits = 0;
18242
+ let bitCount = 0;
18243
+ let outputIndex = 0;
18244
+ for (let index = 0; index < value.length; index += 1) {
18245
+ const code = value.charCodeAt(index);
18246
+ const digit = code < 128 ? BASE64URL_LOOKUP[code] : -1;
18247
+ if (digit < 0) return null;
18248
+ bits = bits << 6 | digit;
18249
+ bitCount += 6;
18250
+ if (bitCount >= 8) {
18251
+ bitCount -= 8;
18252
+ output[outputIndex] = bits >> bitCount & 255;
18253
+ outputIndex += 1;
18254
+ }
18255
+ }
18256
+ return output;
18257
+ }, "decodeBase64Url");
18258
+ var isCanonicalBase64Url = /* @__PURE__ */ __name2((value, expectedBytes) => {
18259
+ if (typeof value !== "string") return false;
18260
+ if (expectedBytes !== void 0 && value.length !== Math.ceil(expectedBytes * 4 / 3))
18261
+ return false;
18262
+ const decoded = decodeBase64Url(value);
18263
+ if (decoded === null) return false;
18264
+ if (expectedBytes !== void 0 && decoded.length !== expectedBytes) return false;
18265
+ return encodeBase64Url(decoded) === value;
18266
+ }, "isCanonicalBase64Url");
18267
+ var decodedBase64UrlByteLength = /* @__PURE__ */ __name2((value) => decodeBase64Url(value)?.length ?? null, "decodedBase64UrlByteLength");
18268
+ var utf8ByteLength = /* @__PURE__ */ __name2((value) => new TextEncoder().encode(value).length, "utf8ByteLength");
18269
+ var canonicalBase64Url = /* @__PURE__ */ __name2((bytes) => external_exports.string().refine((value) => isCanonicalBase64Url(value, bytes), {
18270
+ message: `must be canonical base64url for exactly ${bytes} bytes`
18271
+ }), "canonicalBase64Url");
18272
+ var ShareLinkIdValidator = canonicalBase64Url(SHARE_LINK_ID_BYTES);
18273
+ var ShareContentKeyValidator = canonicalBase64Url(SHARE_CONTENT_KEY_BYTES);
18274
+ var ShareIvValidator = canonicalBase64Url(SHARE_IV_BYTES);
18275
+ var ShareCiphertextValidator = external_exports.string().refine(
18276
+ (value) => {
18277
+ if (value.length > Math.ceil(MAX_SHARE_CIPHERTEXT_BYTES * 4 / 3)) return false;
18278
+ const decoded = decodeBase64Url(value);
18279
+ if (decoded === null) return false;
18280
+ if (encodeBase64Url(decoded) !== value) return false;
18281
+ return decoded.length >= SHARE_TAG_BYTES && decoded.length <= MAX_SHARE_CIPHERTEXT_BYTES;
18282
+ },
18283
+ {
18284
+ message: `must be canonical base64url decoding to ${SHARE_TAG_BYTES}..${MAX_SHARE_CIPHERTEXT_BYTES} bytes`
17822
18285
  }
17823
- if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
18286
+ );
18287
+ var ShareEnvelopeValidator = external_exports.object({
18288
+ v: external_exports.literal(1),
18289
+ alg: external_exports.literal("A256GCM"),
18290
+ iv: ShareIvValidator,
18291
+ ct: ShareCiphertextValidator
18292
+ }).strict();
18293
+ var safeVersion = external_exports.number().int().min(1).max(2 ** 31 - 1);
18294
+ var safeCredentialIndex = external_exports.number().int().min(0).max(MAX_VP_MEMBERS - 1);
18295
+ var ShareSelectionEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex }).strict();
18296
+ var ShareEndorsementEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex, targetCredentialIndex: safeCredentialIndex }).strict();
18297
+ var ShareSharerValidator = external_exports.object({
18298
+ profileId: external_exports.string().min(1).max(128),
18299
+ displayName: external_exports.string().min(1).max(120),
18300
+ avatar: external_exports.string().max(2048).optional()
18301
+ }).strict();
18302
+ var presentationShape = VPValidator.extend({
18303
+ verifiableCredential: VCValidator.array().min(1).max(MAX_VP_MEMBERS)
18304
+ });
18305
+ var hasBoundedPresentation = /* @__PURE__ */ __name2((value) => {
18306
+ let credentialCount = 0;
18307
+ const ancestors = /* @__PURE__ */ new Set();
18308
+ const visit = /* @__PURE__ */ __name2((node, depth) => {
18309
+ if (node === null || typeof node !== "object") return true;
18310
+ if (depth > 32 || ancestors.has(node)) return false;
18311
+ ancestors.add(node);
18312
+ try {
18313
+ for (const [key, child] of Object.entries(node)) {
18314
+ if (key === "verifiableCredential") {
18315
+ credentialCount += Array.isArray(child) ? child.length : 1;
18316
+ if (credentialCount > MAX_VP_MEMBERS) return false;
18317
+ }
18318
+ if (!visit(child, depth + 1)) return false;
18319
+ }
18320
+ return true;
18321
+ } finally {
18322
+ ancestors.delete(node);
18323
+ }
18324
+ }, "visit");
18325
+ return visit(value, 0);
18326
+ }, "hasBoundedPresentation");
18327
+ var ShareManifestPresentationValidator = external_exports.custom(
18328
+ (value) => hasBoundedPresentation(value) && presentationShape.safeParse(value).success,
18329
+ { message: "invalid share presentation" }
18330
+ );
18331
+ var SharePayloadValidatorShape = external_exports.object({
18332
+ protocol: external_exports.literal(SHARE_LINK_PROTOCOL),
18333
+ shareId: ShareLinkIdValidator,
18334
+ contentVersion: safeVersion,
18335
+ createdAt: external_exports.iso.datetime(),
18336
+ sharer: ShareSharerValidator,
18337
+ presentation: ShareManifestPresentationValidator,
18338
+ selection: ShareSelectionEntryValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
18339
+ endorsements: ShareEndorsementEntryValidator.array().max(MAX_ENDORSEMENTS).default([])
18340
+ }).strict();
18341
+ var classificationFailure = /* @__PURE__ */ __name2((code, message, path = []) => ({ ok: false, code, message, path }), "classificationFailure");
18342
+ var readSignedClaimId = /* @__PURE__ */ __name2((member) => {
18343
+ if (member === null || typeof member !== "object") return void 0;
18344
+ const record2 = member;
18345
+ const claim = record2.credentialSubject ?? record2.endorsement;
18346
+ if (claim === null || typeof claim !== "object") return void 0;
18347
+ const claimRecord = claim;
18348
+ const nested = claimRecord.endorsement;
18349
+ const nestedId = nested !== null && typeof nested === "object" ? nested.id : void 0;
18350
+ return claimRecord.id ?? nestedId;
18351
+ }, "readSignedClaimId");
18352
+ var classifyShareManifest = /* @__PURE__ */ __name2((payload) => {
18353
+ const members = payload.presentation?.verifiableCredential;
18354
+ if (!Array.isArray(members) || members.length === 0) {
18355
+ return classificationFailure("NO_PRESENTATION_MEMBERS", "presentation has no credentials");
18356
+ }
18357
+ if (members.length > MAX_VP_MEMBERS) {
18358
+ return classificationFailure(
18359
+ "TOO_MANY_VP_MEMBERS",
18360
+ `presentation has ${members.length} members, over the ${MAX_VP_MEMBERS} bound`
18361
+ );
18362
+ }
18363
+ const selection = payload.selection;
18364
+ const endorsements = payload.endorsements ?? [];
18365
+ if (!Array.isArray(selection) || selection.length < 1 || selection.length > MAX_SELECTED_CREDENTIALS) {
18366
+ return classificationFailure("BAD_SELECTION", "selection must contain 1..50 entries");
18367
+ }
18368
+ if (!Array.isArray(endorsements) || endorsements.length > MAX_ENDORSEMENTS) {
18369
+ return classificationFailure(
18370
+ "BAD_ENDORSEMENTS",
18371
+ "endorsements must contain at most 200 entries"
18372
+ );
18373
+ }
18374
+ const selectedIndices = [];
18375
+ const selected = /* @__PURE__ */ new Set();
18376
+ for (let index = 0; index < selection.length; index += 1) {
18377
+ const entry = selection[index];
18378
+ const credentialIndex = entry?.credentialIndex;
18379
+ if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
18380
+ return classificationFailure(
18381
+ "SELECTION_INDEX_OUT_OF_BOUNDS",
18382
+ `selection[${index}].credentialIndex is out of bounds`,
18383
+ ["selection", index, "credentialIndex"]
18384
+ );
18385
+ }
18386
+ if (selected.has(credentialIndex)) {
18387
+ return classificationFailure(
18388
+ "SELECTION_INDEX_DUPLICATE",
18389
+ `selection[${index}].credentialIndex is duplicated`,
18390
+ ["selection", index, "credentialIndex"]
18391
+ );
18392
+ }
18393
+ selected.add(credentialIndex);
18394
+ selectedIndices.push(credentialIndex);
18395
+ }
18396
+ const classified = new Set(selected);
18397
+ const endorsementIndices = [];
18398
+ for (let index = 0; index < endorsements.length; index += 1) {
18399
+ const entry = endorsements[index];
18400
+ const credentialIndex = entry?.credentialIndex;
18401
+ const targetIndex = entry?.targetCredentialIndex;
18402
+ if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
18403
+ return classificationFailure(
18404
+ "ENDORSEMENT_INDEX_OUT_OF_BOUNDS",
18405
+ `endorsements[${index}].credentialIndex is out of bounds`,
18406
+ ["endorsements", index, "credentialIndex"]
18407
+ );
18408
+ }
18409
+ if (classified.has(credentialIndex)) {
18410
+ return classificationFailure(
18411
+ "VP_MEMBER_CLASSIFIED_TWICE",
18412
+ `endorsements[${index}].credentialIndex was already classified`,
18413
+ ["endorsements", index, "credentialIndex"]
18414
+ );
18415
+ }
18416
+ if (!selected.has(targetIndex)) {
18417
+ return classificationFailure(
18418
+ "ENDORSEMENT_TARGET_NOT_SELECTED",
18419
+ `endorsements[${index}].targetCredentialIndex must reference a selected credential`,
18420
+ ["endorsements", index, "targetCredentialIndex"]
18421
+ );
18422
+ }
18423
+ const referenced = readSignedClaimId(members[credentialIndex]);
18424
+ const target = members[targetIndex];
18425
+ const targetId = target !== null && typeof target === "object" ? target.id : void 0;
18426
+ if (typeof referenced !== "string" || typeof targetId !== "string" || referenced !== targetId) {
18427
+ return classificationFailure(
18428
+ "ENDORSEMENT_TARGET_UNBOUND",
18429
+ `endorsements[${index}] claim does not reference the target credential id`,
18430
+ ["endorsements", index]
18431
+ );
18432
+ }
18433
+ classified.add(credentialIndex);
18434
+ endorsementIndices.push(credentialIndex);
18435
+ }
18436
+ if (classified.size !== members.length) {
18437
+ return classificationFailure(
18438
+ "UNCLASSIFIED_VP_MEMBER",
18439
+ "every presentation member must be classified exactly once",
18440
+ ["presentation", "verifiableCredential"]
18441
+ );
18442
+ }
18443
+ return {
18444
+ ok: true,
18445
+ classification: { selectedIndices, endorsementIndices, memberCount: members.length }
18446
+ };
18447
+ }, "classifyShareManifest");
18448
+ var SharePayloadValidator = SharePayloadValidatorShape.superRefine((payload, ctx) => {
18449
+ const result = classifyShareManifest(payload);
18450
+ if (!result.ok) {
17824
18451
  ctx.addIssue({
17825
18452
  code: "custom",
17826
- path: ["mode"],
17827
- message: "issuer-signed publication cannot include signing-authority fields"
18453
+ message: result.message,
18454
+ path: result.path,
18455
+ params: { shareLinkCode: result.code }
17828
18456
  });
17829
18457
  }
17830
- if (input.mode === "signing-authority") {
17831
- if (input.signedCredential !== void 0) {
17832
- ctx.addIssue({
17833
- code: "custom",
17834
- path: ["signedCredential"],
17835
- message: "signing-authority publication cannot include signedCredential"
17836
- });
17837
- }
17838
- if (!input.credential) {
18458
+ });
18459
+ var ShareRecoverySelectionValidator = external_exports.object({
18460
+ ref: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS),
18461
+ order: external_exports.number().int().min(0).max(MAX_SELECTED_CREDENTIALS - 1)
18462
+ }).strict();
18463
+ var ShareRecoveryEndorsementValidator = external_exports.object({ targetRef: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS) }).strict();
18464
+ var ShareRecoveryPlaintextValidator = external_exports.object({
18465
+ protocol: external_exports.literal(SHARE_RECOVERY_PROTOCOL),
18466
+ shareId: ShareLinkIdValidator,
18467
+ ownerProfileId: external_exports.string().min(1).max(128),
18468
+ createdAt: external_exports.iso.datetime(),
18469
+ latest: external_exports.object({ contentVersion: safeVersion, key: ShareContentKeyValidator }).strict(),
18470
+ selection: ShareRecoverySelectionValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
18471
+ endorsements: ShareRecoveryEndorsementValidator.array().max(MAX_ENDORSEMENTS).default([])
18472
+ }).strict().superRefine((recovery, ctx) => {
18473
+ const orders = /* @__PURE__ */ new Set();
18474
+ recovery.selection.forEach((entry, index) => {
18475
+ if (entry.order >= recovery.selection.length) {
17839
18476
  ctx.addIssue({
17840
18477
  code: "custom",
17841
- path: ["credential"],
17842
- message: "credential is required for signing-authority publication"
18478
+ message: "order must be within the selection bounds",
18479
+ path: ["selection", index, "order"]
17843
18480
  });
17844
18481
  }
17845
- if (!input.signingAuthority) {
18482
+ if (orders.has(entry.order)) {
17846
18483
  ctx.addIssue({
17847
18484
  code: "custom",
17848
- path: ["signingAuthority"],
17849
- message: "signingAuthority is required for signing-authority publication"
18485
+ message: "order must be unique within the selection",
18486
+ path: ["selection", index, "order"]
17850
18487
  });
17851
18488
  }
18489
+ orders.add(entry.order);
18490
+ });
18491
+ });
18492
+ var ShareOwnerRecoveryValidator = JWEValidator2.refine(
18493
+ (value) => utf8ByteLength(JSON.stringify(value)) <= MAX_SHARE_RECOVERY_JWE_BYTES,
18494
+ { message: `serialized recovery JWE must be at most ${MAX_SHARE_RECOVERY_JWE_BYTES} bytes` }
18495
+ );
18496
+ var ShareLinkStatusValidator = external_exports.enum(["pending", "active", "stopped"]);
18497
+ var ShareContentStateValidator = external_exports.enum(["staging", "finalized", "content_missing"]);
18498
+ var ShareLinkValidator = external_exports.object({
18499
+ id: ShareLinkIdValidator,
18500
+ title: external_exports.string().min(1).max(120),
18501
+ note: external_exports.string().max(500).optional(),
18502
+ selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
18503
+ version: safeVersion,
18504
+ contentVersion: safeVersion,
18505
+ status: ShareLinkStatusValidator,
18506
+ contentState: ShareContentStateValidator,
18507
+ createdAt: external_exports.iso.datetime(),
18508
+ updatedAt: external_exports.iso.datetime(),
18509
+ expiresAt: external_exports.iso.datetime().nullable(),
18510
+ stoppedAt: external_exports.iso.datetime().nullable(),
18511
+ lastViewedAt: external_exports.iso.datetime().nullable(),
18512
+ viewCount: external_exports.number().int().min(0).optional(),
18513
+ passcodeProtected: external_exports.boolean(),
18514
+ notifyOnView: external_exports.boolean(),
18515
+ minorPolicy: external_exports.object({
18516
+ isMinor: external_exports.boolean().nullable(),
18517
+ policyResolved: external_exports.boolean(),
18518
+ defaultExpiryDays: external_exports.union([external_exports.literal(30), external_exports.literal(365)]),
18519
+ viewCountingEnabled: external_exports.boolean()
18520
+ }),
18521
+ /**
18522
+ * Guarded application/API URL for the content. Optional because owner APIs in
18523
+ * D1 have no public resolve/content endpoint yet; it must never be a
18524
+ * LearnCloud object URL or carry a fabricated decryption key.
18525
+ */
18526
+ contentUrl: external_exports.string().optional()
18527
+ });
18528
+ var clientRequestId = external_exports.string().uuid();
18529
+ var CreateShareLinkInputValidator = external_exports.object({
18530
+ id: ShareLinkIdValidator,
18531
+ clientRequestId,
18532
+ title: external_exports.string().min(1).max(120),
18533
+ note: external_exports.string().max(500).optional(),
18534
+ expiresAt: external_exports.iso.datetime().nullable().optional(),
18535
+ passcode: external_exports.string().min(8).max(64).optional(),
18536
+ notifyOnView: external_exports.boolean().default(false),
18537
+ selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
18538
+ contentVersion: external_exports.literal(1),
18539
+ envelope: ShareEnvelopeValidator,
18540
+ ownerEncryptedRecovery: ShareOwnerRecoveryValidator
18541
+ }).strict();
18542
+ var UpdateShareLinkInputValidator = external_exports.object({
18543
+ id: ShareLinkIdValidator,
18544
+ expectedVersion: safeVersion,
18545
+ clientRequestId,
18546
+ title: external_exports.string().min(1).max(120).optional(),
18547
+ note: external_exports.string().max(500).nullable().optional(),
18548
+ expiresAt: external_exports.iso.datetime().nullable().optional(),
18549
+ /** Omitted preserves the current passcode, null removes it, and a string replaces it. */
18550
+ passcode: external_exports.string().min(8).max(64).nullable().optional(),
18551
+ notifyOnView: external_exports.boolean().optional(),
18552
+ contentVersion: safeVersion.optional(),
18553
+ selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS).optional(),
18554
+ envelope: ShareEnvelopeValidator.optional(),
18555
+ ownerEncryptedRecovery: ShareOwnerRecoveryValidator.optional()
18556
+ }).strict().superRefine((value, ctx) => {
18557
+ const provided = [
18558
+ value.contentVersion,
18559
+ value.selectedCount,
18560
+ value.envelope,
18561
+ value.ownerEncryptedRecovery
18562
+ ].filter((field) => field !== void 0).length;
18563
+ if (provided !== 0 && provided !== 4) {
18564
+ ctx.addIssue({
18565
+ code: "custom",
18566
+ message: "content replacement requires contentVersion, selectedCount, envelope and ownerEncryptedRecovery together"
18567
+ });
17852
18568
  }
17853
18569
  });
17854
- var PublishCredentialRefreshNotificationValidator = external_exports.enum([
17855
- "queued",
17856
- "suppressed",
17857
- "not-applicable",
17858
- /** Publication succeeded, but the post-commit notification enqueue must be retried. */
17859
- "delivery-failed"
18570
+ var ShareLinkIdInputValidator = external_exports.object({ id: ShareLinkIdValidator }).strict();
18571
+ var ShareLinkOperationKeyInputValidator = external_exports.object({ id: ShareLinkIdValidator, operationId: external_exports.string().uuid() }).strict();
18572
+ var ShareLinkOwnerCommitOutputValidator = external_exports.discriminatedUnion("status", [
18573
+ external_exports.object({ status: external_exports.literal("completed"), share: ShareLinkValidator }).strict(),
18574
+ external_exports.object({
18575
+ status: external_exports.literal("pending"),
18576
+ id: ShareLinkIdValidator,
18577
+ operationId: external_exports.string().uuid()
18578
+ }).strict()
17860
18579
  ]);
17861
- var PublishCredentialRefreshResultValidator = external_exports.object({
17862
- refreshId: external_exports.string().min(1),
17863
- version: external_exports.number().int().positive(),
17864
- publishedAt: external_exports.string().min(1),
17865
- notification: PublishCredentialRefreshNotificationValidator
17866
- });
17867
- var CredentialRefreshVersionMetadataValidator = external_exports.object({
17868
- version: external_exports.number().int().positive(),
17869
- publishedAt: external_exports.string().min(1),
17870
- effectiveAt: external_exports.string().optional(),
17871
- etag: external_exports.string().optional(),
17872
- signingMode: CredentialRefreshSigningModeValidator.optional(),
17873
- updateSummary: external_exports.string().optional()
17874
- });
17875
- var GetCredentialRefreshHistoryInputValidator = external_exports.object({
17876
- refreshId: external_exports.string().min(1),
17877
- cursor: external_exports.string().optional(),
17878
- limit: external_exports.number().int().positive().optional()
17879
- });
17880
- var GetCredentialRefreshHistoryResultValidator = external_exports.object({
17881
- records: CredentialRefreshVersionMetadataValidator.array(),
17882
- hasMore: external_exports.boolean(),
17883
- cursor: external_exports.string().optional()
17884
- });
17885
- var CredentialRefreshChallengeValidator = external_exports.object({
17886
- challenge: external_exports.string().min(1),
17887
- expiresAt: external_exports.string().min(1),
17888
- domain: external_exports.string().optional(),
17889
- scheme: external_exports.literal("LearnCardDIDAuth").optional()
17890
- });
17891
- var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
17892
- format: external_exports.literal("vc"),
17893
- credential: VCValidator,
17894
- etag: external_exports.string().optional()
17895
- });
17896
- var JweCredentialRefreshEnvelopeValidator = external_exports.object({
17897
- format: external_exports.literal("jwe"),
17898
- jwe: JWEValidator2,
17899
- etag: external_exports.string().optional(),
17900
- /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
17901
- version: external_exports.number().int().positive().optional()
17902
- });
17903
- var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
17904
- PublicCredentialRefreshEnvelopeValidator,
17905
- JweCredentialRefreshEnvelopeValidator
18580
+ var ShareLinkOwnerStatusOutputValidator = external_exports.discriminatedUnion("status", [
18581
+ external_exports.object({ status: external_exports.literal("found"), share: ShareLinkValidator }).strict(),
18582
+ external_exports.object({
18583
+ status: external_exports.literal("pending"),
18584
+ id: ShareLinkIdValidator,
18585
+ operationId: external_exports.string().uuid()
18586
+ }).strict(),
18587
+ external_exports.object({ status: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
17906
18588
  ]);
17907
- var CredentialRefreshFailureCodeValidator = external_exports.enum([
17908
- "UNAVAILABLE",
17909
- "TIMEOUT",
17910
- "UNSUPPORTED_SERVICE",
17911
- "UNAUTHORIZED",
17912
- "MALFORMED_RESPONSE",
17913
- "INVALID_PROOF",
17914
- "ISSUER_MISMATCH",
17915
- "ID_MISMATCH",
17916
- "ROLLBACK",
17917
- "REVOKED",
17918
- "UNSAFE_ENDPOINT"
18589
+ var ShareLinkOwnerRecoveryOutputValidator = external_exports.object({ recovery: ShareOwnerRecoveryValidator }).strict();
18590
+ var ShareLinkOwnerContentOutputValidator = external_exports.object({
18591
+ id: ShareLinkIdValidator,
18592
+ contentVersion: safeVersion,
18593
+ envelope: ShareEnvelopeValidator
18594
+ }).strict();
18595
+ var ResolveShareLinkInputValidator = external_exports.object({
18596
+ id: ShareLinkIdValidator,
18597
+ /** Sent only in a POST body; it must never be placed in a share URL. */
18598
+ passcode: external_exports.string().min(4).max(64).optional()
18599
+ }).strict();
18600
+ var ShareLinkPublicStateValidator = external_exports.discriminatedUnion("state", [
18601
+ external_exports.object({
18602
+ state: external_exports.literal("passcode_required"),
18603
+ id: ShareLinkIdValidator
18604
+ }).strict(),
18605
+ external_exports.object({ state: external_exports.literal("try_later"), id: ShareLinkIdValidator }).strict(),
18606
+ external_exports.object({
18607
+ state: external_exports.literal("active"),
18608
+ id: ShareLinkIdValidator,
18609
+ title: external_exports.string().max(120),
18610
+ note: external_exports.string().max(500).optional(),
18611
+ selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
18612
+ contentVersion: safeVersion,
18613
+ contentUrl: external_exports.string(),
18614
+ sharer: external_exports.object({
18615
+ displayName: external_exports.string().max(120),
18616
+ avatar: external_exports.string().max(2048).optional()
18617
+ }),
18618
+ createdAt: external_exports.iso.datetime(),
18619
+ updatedAt: external_exports.iso.datetime(),
18620
+ expiresAt: external_exports.iso.datetime().nullable()
18621
+ }).strict(),
18622
+ external_exports.object({
18623
+ state: external_exports.literal("expired"),
18624
+ id: ShareLinkIdValidator,
18625
+ expiresAt: external_exports.iso.datetime()
18626
+ }).strict(),
18627
+ external_exports.object({
18628
+ state: external_exports.literal("stopped"),
18629
+ id: ShareLinkIdValidator,
18630
+ stoppedAt: external_exports.iso.datetime()
18631
+ }).strict(),
18632
+ external_exports.object({ state: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
17919
18633
  ]);
17920
- var CredentialRefreshUpdatedResultValidator = external_exports.object({
17921
- status: external_exports.literal("updated"),
17922
- credential: VCValidator,
17923
- etag: external_exports.string().optional(),
17924
- managedVersion: external_exports.number().int().positive().optional()
17925
- });
17926
- var CredentialRefreshUnchangedResultValidator = external_exports.object({
17927
- status: external_exports.literal("unchanged"),
17928
- checkedAt: external_exports.string().min(1),
17929
- etag: external_exports.string().optional()
17930
- });
17931
- var CredentialRefreshUnsupportedResultValidator = external_exports.object({
17932
- status: external_exports.literal("unsupported")
17933
- });
17934
- var CredentialRefreshFailedResultValidator = external_exports.object({
17935
- status: external_exports.literal("failed"),
17936
- code: CredentialRefreshFailureCodeValidator,
17937
- retryable: external_exports.boolean()
18634
+ var ListShareLinksInputValidator = external_exports.object({
18635
+ limit: external_exports.number().int().min(1).max(50).default(25),
18636
+ cursor: external_exports.string().max(512).optional()
18637
+ }).strict();
18638
+ var PaginatedShareLinksValidator = PaginationResponseValidator.extend({
18639
+ records: ShareLinkValidator.array()
17938
18640
  });
17939
- var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
17940
- CredentialRefreshUpdatedResultValidator,
17941
- CredentialRefreshUnchangedResultValidator,
17942
- CredentialRefreshUnsupportedResultValidator,
17943
- CredentialRefreshFailedResultValidator
17944
- ]);
18641
+ var AcknowledgeViewInputValidator = external_exports.object({
18642
+ receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
18643
+ }).strict();
18644
+ var AcknowledgeViewOutputValidator = external_exports.object({ ok: external_exports.literal(true) }).strict();
18645
+ var SHARE_VIEW_RECEIPT_TTL_SECONDS = 10 * 60;
18646
+ var ShareLinkPublicContentViewValidator = external_exports.object({
18647
+ id: ShareLinkIdValidator,
18648
+ contentVersion: safeVersion,
18649
+ envelope: ShareEnvelopeValidator,
18650
+ contentUrl: external_exports.string(),
18651
+ receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
18652
+ }).strict();
17945
18653
  }
17946
18654
  });
17947
18655
 
@@ -18843,6 +19551,134 @@ var canonicalizeCredentialContent = /* @__PURE__ */ __name((value) => {
18843
19551
  return value;
18844
19552
  }, "canonicalizeCredentialContent");
18845
19553
  var canonicalizeCredentialJson = /* @__PURE__ */ __name((value) => JSON.stringify(canonicalizeCredentialContent(value)), "canonicalizeCredentialJson");
19554
+ var MANAGED_REFRESH_TYPE_TERM = "LearnCardCredentialRefresh2026";
19555
+ var MANAGED_REFRESH_DID_AUTH_TERM = "LearnCardDIDAuth";
19556
+ var MANAGED_REFRESH_TYPE_IRI = "https://learncard.com/refresh#LearnCardCredentialRefresh2026";
19557
+ var MANAGED_REFRESH_AUTHORIZATION_IRI = "https://purl.imsglobal.org/spec/ob/v3p0#authorization";
19558
+ var MANAGED_REFRESH_DID_AUTH_IRI = "https://docs.learncard.com/definitions#LearnCardDIDAuth";
19559
+ var MANAGED_REFRESH_SERVICE_CONTEXT = {
19560
+ [MANAGED_REFRESH_TYPE_TERM]: MANAGED_REFRESH_TYPE_IRI,
19561
+ authorization: {
19562
+ "@id": MANAGED_REFRESH_AUTHORIZATION_IRI,
19563
+ "@context": { [MANAGED_REFRESH_DID_AUTH_TERM]: MANAGED_REFRESH_DID_AUTH_IRI }
19564
+ }
19565
+ };
19566
+ var isPlainObject = /* @__PURE__ */ __name((value) => !!value && typeof value === "object" && !Array.isArray(value), "isPlainObject");
19567
+ var toIdForm = /* @__PURE__ */ __name((definition) => typeof definition === "string" ? { "@id": definition } : definition, "toIdForm");
19568
+ var definitionId = /* @__PURE__ */ __name((definition) => {
19569
+ const idForm = toIdForm(definition);
19570
+ return isPlainObject(idForm) ? idForm["@id"] : void 0;
19571
+ }, "definitionId");
19572
+ var findTopLevelDefinition = /* @__PURE__ */ __name((contextObjects, term) => {
19573
+ let found;
19574
+ for (const contextObject of contextObjects) {
19575
+ if (term in contextObject) found = contextObject[term];
19576
+ }
19577
+ return found;
19578
+ }, "findTopLevelDefinition");
19579
+ var assertDefinitionMatchesIri = /* @__PURE__ */ __name((term, definition, expectedIri) => {
19580
+ const actualIri = definitionId(definition);
19581
+ if (actualIri !== expectedIri) {
19582
+ throw new Error(
19583
+ `Conflicting JSON-LD definition for term "${term}": expected "${expectedIri}" but the credential already defines it as ${JSON.stringify(
19584
+ definition
19585
+ )}. Remove or correct the existing definition before signing.`
19586
+ );
19587
+ }
19588
+ }, "assertDefinitionMatchesIri");
19589
+ var getManagedRefreshServices = /* @__PURE__ */ __name((vc) => {
19590
+ const refreshService = vc?.refreshService;
19591
+ if (!refreshService) return [];
19592
+ const services = Array.isArray(refreshService) ? refreshService : [refreshService];
19593
+ return services.flatMap((service) => {
19594
+ const parsed = import_types2.ManagedCredentialRefreshServiceValidator.safeParse(service);
19595
+ return parsed.success ? [parsed.data] : [];
19596
+ });
19597
+ }, "getManagedRefreshServices");
19598
+ var prepareManagedRefreshContext = /* @__PURE__ */ __name((credential) => {
19599
+ const source = credential;
19600
+ if (getManagedRefreshServices(source).length === 0) return credential;
19601
+ const existingContext = credential["@context"];
19602
+ const contextList = existingContext === void 0 || existingContext === null ? [] : Array.isArray(existingContext) ? [...existingContext] : [existingContext];
19603
+ const inlineObjects = contextList.filter(isPlainObject);
19604
+ const fragment = {};
19605
+ const typeDefinition = findTopLevelDefinition(inlineObjects, MANAGED_REFRESH_TYPE_TERM);
19606
+ if (typeDefinition === void 0) {
19607
+ fragment[MANAGED_REFRESH_TYPE_TERM] = MANAGED_REFRESH_TYPE_IRI;
19608
+ } else {
19609
+ assertDefinitionMatchesIri(
19610
+ MANAGED_REFRESH_TYPE_TERM,
19611
+ typeDefinition,
19612
+ MANAGED_REFRESH_TYPE_IRI
19613
+ );
19614
+ }
19615
+ const authorizationDefinition = findTopLevelDefinition(inlineObjects, "authorization");
19616
+ let didAuthCovered = false;
19617
+ if (authorizationDefinition === void 0) {
19618
+ fragment["authorization"] = MANAGED_REFRESH_SERVICE_CONTEXT.authorization;
19619
+ didAuthCovered = true;
19620
+ } else {
19621
+ assertDefinitionMatchesIri(
19622
+ "authorization",
19623
+ authorizationDefinition,
19624
+ MANAGED_REFRESH_AUTHORIZATION_IRI
19625
+ );
19626
+ if (isPlainObject(authorizationDefinition) && isPlainObject(authorizationDefinition["@context"])) {
19627
+ const scopedContext = authorizationDefinition["@context"];
19628
+ if (MANAGED_REFRESH_DID_AUTH_TERM in scopedContext) {
19629
+ assertDefinitionMatchesIri(
19630
+ MANAGED_REFRESH_DID_AUTH_TERM,
19631
+ scopedContext[MANAGED_REFRESH_DID_AUTH_TERM],
19632
+ MANAGED_REFRESH_DID_AUTH_IRI
19633
+ );
19634
+ didAuthCovered = true;
19635
+ }
19636
+ }
19637
+ }
19638
+ if (!didAuthCovered) {
19639
+ const didAuthDefinition = findTopLevelDefinition(
19640
+ inlineObjects,
19641
+ MANAGED_REFRESH_DID_AUTH_TERM
19642
+ );
19643
+ if (didAuthDefinition === void 0) {
19644
+ fragment[MANAGED_REFRESH_DID_AUTH_TERM] = MANAGED_REFRESH_DID_AUTH_IRI;
19645
+ } else {
19646
+ assertDefinitionMatchesIri(
19647
+ MANAGED_REFRESH_DID_AUTH_TERM,
19648
+ didAuthDefinition,
19649
+ MANAGED_REFRESH_DID_AUTH_IRI
19650
+ );
19651
+ }
19652
+ }
19653
+ if (Object.keys(fragment).length === 0) return credential;
19654
+ return {
19655
+ ...credential,
19656
+ "@context": [...contextList, fragment]
19657
+ };
19658
+ }, "prepareManagedRefreshContext");
19659
+ var injectManagedRefreshService = /* @__PURE__ */ __name((credential, refreshService) => {
19660
+ const service = import_types2.ManagedCredentialRefreshServiceValidator.parse(refreshService);
19661
+ const source = credential;
19662
+ const existing = source["refreshService"];
19663
+ const existingServices = existing === void 0 || existing === null ? [] : Array.isArray(existing) ? [...existing] : [existing];
19664
+ const existingManaged = getManagedRefreshServices({ refreshService: existingServices });
19665
+ if (existingManaged.some((entry) => entry.id !== service.id)) {
19666
+ throw new Error(
19667
+ "Credential already carries a different managed refresh service; a credential can only reference one managed refresh service."
19668
+ );
19669
+ }
19670
+ const nonManagedEntries = existingServices.filter(
19671
+ (entry) => !import_types2.ManagedCredentialRefreshServiceValidator.safeParse(entry).success
19672
+ );
19673
+ const mergedRefreshService = existingServices.length === 0 ? service : !Array.isArray(existing) && existingManaged.length > 0 ? (
19674
+ // Re-injecting the same managed service: keep object form (idempotent)
19675
+ service
19676
+ ) : [service, ...nonManagedEntries];
19677
+ return prepareManagedRefreshContext({
19678
+ ...credential,
19679
+ refreshService: mergedRefreshService
19680
+ });
19681
+ }, "injectManagedRefreshService");
18846
19682
  var credentialContentsEqual = /* @__PURE__ */ __name((first, second) => {
18847
19683
  const stripProof = /* @__PURE__ */ __name((vc) => {
18848
19684
  const { proof: _proof, ...rest } = vc ?? {};
@@ -18911,6 +19747,101 @@ var parseEnvironment = /* @__PURE__ */ __name((schema, raw, context) => {
18911
19747
  );
18912
19748
  }, "parseEnvironment");
18913
19749
 
19750
+ // src/share-content-canonical.ts
19751
+ var DEFAULT_MAX_CANONICAL_BYTES = 2 * 1024 * 1024;
19752
+ var DEFAULT_MAX_CANONICAL_DEPTH = 32;
19753
+ var LONE_SURROGATE_RE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
19754
+ var ShareContentCanonicalizationError = class extends Error {
19755
+ constructor(message) {
19756
+ super(message);
19757
+ this.code = "UNSUPPORTED_REQUEST_VALUE";
19758
+ this.name = "ShareContentCanonicalizationError";
19759
+ }
19760
+ static {
19761
+ __name(this, "ShareContentCanonicalizationError");
19762
+ }
19763
+ };
19764
+ var serializeCanonical = /* @__PURE__ */ __name((value, seen, depth, maxDepth) => {
19765
+ if (value === null) return "null";
19766
+ switch (typeof value) {
19767
+ case "boolean":
19768
+ return value ? "true" : "false";
19769
+ case "string": {
19770
+ if (LONE_SURROGATE_RE.test(value)) {
19771
+ throw new ShareContentCanonicalizationError(
19772
+ "string contains an unpaired surrogate"
19773
+ );
19774
+ }
19775
+ return JSON.stringify(value);
19776
+ }
19777
+ case "number": {
19778
+ if (!Number.isSafeInteger(value) || Object.is(value, -0)) {
19779
+ throw new ShareContentCanonicalizationError(
19780
+ "numbers must be safe integers without a negative-zero sign"
19781
+ );
19782
+ }
19783
+ return String(value);
19784
+ }
19785
+ case "object": {
19786
+ if (depth >= maxDepth) {
19787
+ throw new ShareContentCanonicalizationError(
19788
+ "value exceeds the maximum nesting depth"
19789
+ );
19790
+ }
19791
+ if (seen.has(value)) {
19792
+ throw new ShareContentCanonicalizationError("cyclic value is not supported");
19793
+ }
19794
+ seen.add(value);
19795
+ try {
19796
+ if (Array.isArray(value)) {
19797
+ const items = [];
19798
+ for (let index = 0; index < value.length; index += 1) {
19799
+ if (!(index in value)) {
19800
+ throw new ShareContentCanonicalizationError(
19801
+ "sparse arrays are not supported"
19802
+ );
19803
+ }
19804
+ items.push(serializeCanonical(value[index], seen, depth + 1, maxDepth));
19805
+ }
19806
+ return `[${items.join(",")}]`;
19807
+ }
19808
+ const prototype = Object.getPrototypeOf(value);
19809
+ if (prototype !== Object.prototype && prototype !== null) {
19810
+ throw new ShareContentCanonicalizationError("only plain objects are supported");
19811
+ }
19812
+ const record = value;
19813
+ const entries = Object.keys(record).sort().map((key) => {
19814
+ if (LONE_SURROGATE_RE.test(key)) {
19815
+ throw new ShareContentCanonicalizationError(
19816
+ "object key contains an unpaired surrogate"
19817
+ );
19818
+ }
19819
+ return `${JSON.stringify(key)}:${serializeCanonical(
19820
+ record[key],
19821
+ seen,
19822
+ depth + 1,
19823
+ maxDepth
19824
+ )}`;
19825
+ });
19826
+ return `{${entries.join(",")}}`;
19827
+ } finally {
19828
+ seen.delete(value);
19829
+ }
19830
+ }
19831
+ default:
19832
+ throw new ShareContentCanonicalizationError(`unsupported value type: ${typeof value}`);
19833
+ }
19834
+ }, "serializeCanonical");
19835
+ var canonicalizeShareContentRequestBody = /* @__PURE__ */ __name((body, options = {}) => {
19836
+ const maxBytes = options.maxBytes ?? DEFAULT_MAX_CANONICAL_BYTES;
19837
+ const maxDepth = options.maxDepth ?? DEFAULT_MAX_CANONICAL_DEPTH;
19838
+ const serialized = serializeCanonical(body, /* @__PURE__ */ new Set(), 0, maxDepth);
19839
+ if (new TextEncoder().encode(serialized).byteLength > maxBytes) {
19840
+ throw new ShareContentCanonicalizationError("canonical request exceeds the maximum size");
19841
+ }
19842
+ return serialized;
19843
+ }, "canonicalizeShareContentRequestBody");
19844
+
18914
19845
  // src/index.ts
18915
19846
  var isHex = /* @__PURE__ */ __name((str) => /^[0-9a-f]+$/i.test(str), "isHex");
18916
19847
  var isEncrypted = /* @__PURE__ */ __name((item) => {
@@ -18960,15 +19891,23 @@ var isAppDidWeb = /* @__PURE__ */ __name((did) => {
18960
19891
  }, "isAppDidWeb");
18961
19892
  export {
18962
19893
  AGE_RATING_TO_MIN_AGE,
19894
+ DEFAULT_MAX_CANONICAL_BYTES,
19895
+ DEFAULT_MAX_CANONICAL_DEPTH,
18963
19896
  DEFAULT_RESOLUTIONS,
18964
19897
  EnvironmentConfigurationError,
18965
19898
  ImageResizingValidator,
18966
19899
  ImageUploadingValidator,
18967
19900
  ImageWithLoadingStateValdator,
19901
+ MANAGED_REFRESH_AUTHORIZATION_IRI,
19902
+ MANAGED_REFRESH_DID_AUTH_IRI,
19903
+ MANAGED_REFRESH_SERVICE_CONTEXT,
19904
+ MANAGED_REFRESH_TYPE_IRI,
18968
19905
  RegExpTransformer,
19906
+ ShareContentCanonicalizationError,
18969
19907
  calculateAgeFromDob,
18970
19908
  canonicalizeCredentialContent,
18971
19909
  canonicalizeCredentialJson,
19910
+ canonicalizeShareContentRequestBody,
18972
19911
  capitalizeFirstLetter,
18973
19912
  changeQuality4 as changeQuality,
18974
19913
  checkAppInstallEligibility,
@@ -18997,10 +19936,12 @@ export {
18997
19936
  getCredentialIssuerId,
18998
19937
  getCredentialStatusArray,
18999
19938
  getDidWeb,
19939
+ getManagedRefreshServices,
19000
19940
  getProvider,
19001
19941
  getSupportedRefreshService,
19002
19942
  getUrlsFromSrcSet,
19003
19943
  immerArraySlice,
19944
+ injectManagedRefreshService,
19004
19945
  innerImmerOuterImmer,
19005
19946
  innerImmerOuterReact,
19006
19947
  innerReactOuterImmer,
@@ -19017,6 +19958,7 @@ export {
19017
19958
  optionalEnvironmentString,
19018
19959
  optionalEnvironmentUrl,
19019
19960
  parseEnvironment,
19961
+ prepareManagedRefreshContext,
19020
19962
  projectEnvelopeToDisplayVc,
19021
19963
  quantizeValue,
19022
19964
  requiredEnvironmentString,