@learncard/sss-key-manager 0.1.20 → 0.1.22

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.
Files changed (39) hide show
  1. package/README.md +157 -16
  2. package/dist/api-client.d.ts +49 -0
  3. package/dist/api-client.d.ts.map +1 -0
  4. package/dist/atomic-operations.d.ts +101 -0
  5. package/dist/atomic-operations.d.ts.map +1 -0
  6. package/dist/auth-coordinator.d.ts +10 -0
  7. package/dist/auth-coordinator.d.ts.map +1 -0
  8. package/dist/crypto.d.ts +31 -0
  9. package/dist/crypto.d.ts.map +1 -0
  10. package/dist/index.d.ts +26 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/key-manager.d.ts +30 -0
  13. package/dist/key-manager.d.ts.map +1 -0
  14. package/dist/passkey.d.ts +23 -0
  15. package/dist/passkey.d.ts.map +1 -0
  16. package/dist/qr-crypto.d.ts +56 -0
  17. package/dist/qr-crypto.d.ts.map +1 -0
  18. package/dist/qr-login.d.ts +122 -0
  19. package/dist/qr-login.d.ts.map +1 -0
  20. package/dist/recovery-phrase.d.ts +14 -0
  21. package/dist/recovery-phrase.d.ts.map +1 -0
  22. package/dist/sss-key-manager.cjs.development.js +230 -6
  23. package/dist/sss-key-manager.cjs.development.js.map +2 -2
  24. package/dist/sss-key-manager.cjs.production.min.js +6 -6
  25. package/dist/sss-key-manager.cjs.production.min.js.map +3 -3
  26. package/dist/sss-key-manager.esm.js +230 -6
  27. package/dist/sss-key-manager.esm.js.map +2 -2
  28. package/dist/sss-strategy.d.ts +82 -0
  29. package/dist/sss-strategy.d.ts.map +1 -0
  30. package/dist/sss.d.ts +15 -0
  31. package/dist/sss.d.ts.map +1 -0
  32. package/dist/storage.d.ts +46 -0
  33. package/dist/storage.d.ts.map +1 -0
  34. package/dist/types.d.ts +155 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/package.json +5 -6
  37. package/src/crypto.ts +9 -14
  38. package/src/recovery-phrase.ts +7 -4
  39. package/dist/sss-key-manager.d.ts +0 -898
@@ -60,6 +60,8 @@ var require_types_cjs_development = __commonJS({
60
60
  AgeRatingValidator: /* @__PURE__ */ __name(() => AgeRatingValidator, "AgeRatingValidator"),
61
61
  AlignmentTargetTypeValidator: /* @__PURE__ */ __name(() => AlignmentTargetTypeValidator, "AlignmentTargetTypeValidator"),
62
62
  AlignmentValidator: /* @__PURE__ */ __name(() => AlignmentValidator, "AlignmentValidator"),
63
+ AllocateCredentialRefreshInputValidator: /* @__PURE__ */ __name(() => AllocateCredentialRefreshInputValidator, "AllocateCredentialRefreshInputValidator"),
64
+ AllocateCredentialRefreshResultValidator: /* @__PURE__ */ __name(() => AllocateCredentialRefreshResultValidator, "AllocateCredentialRefreshResultValidator"),
63
65
  AllocateCredentialStatusInputValidator: /* @__PURE__ */ __name(() => AllocateCredentialStatusInputValidator, "AllocateCredentialStatusInputValidator"),
64
66
  AllocatedBitstringStatusListEntryValidator: /* @__PURE__ */ __name(() => AllocatedBitstringStatusListEntryValidator, "AllocatedBitstringStatusListEntryValidator"),
65
67
  AllowConnectionRequestsEnum: /* @__PURE__ */ __name(() => AllowConnectionRequestsEnum, "AllowConnectionRequestsEnum"),
@@ -141,6 +143,16 @@ var require_types_cjs_development = __commonJS({
141
143
  CredentialInfoValidator: /* @__PURE__ */ __name(() => CredentialInfoValidator, "CredentialInfoValidator"),
142
144
  CredentialNameRefValidator: /* @__PURE__ */ __name(() => CredentialNameRefValidator, "CredentialNameRefValidator"),
143
145
  CredentialRecordValidator: /* @__PURE__ */ __name(() => CredentialRecordValidator, "CredentialRecordValidator"),
146
+ CredentialRefreshChallengeValidator: /* @__PURE__ */ __name(() => CredentialRefreshChallengeValidator, "CredentialRefreshChallengeValidator"),
147
+ CredentialRefreshFailedResultValidator: /* @__PURE__ */ __name(() => CredentialRefreshFailedResultValidator, "CredentialRefreshFailedResultValidator"),
148
+ CredentialRefreshFailureCodeValidator: /* @__PURE__ */ __name(() => CredentialRefreshFailureCodeValidator, "CredentialRefreshFailureCodeValidator"),
149
+ CredentialRefreshResponseEnvelopeValidator: /* @__PURE__ */ __name(() => CredentialRefreshResponseEnvelopeValidator, "CredentialRefreshResponseEnvelopeValidator"),
150
+ CredentialRefreshResultValidator: /* @__PURE__ */ __name(() => CredentialRefreshResultValidator, "CredentialRefreshResultValidator"),
151
+ CredentialRefreshSigningModeValidator: /* @__PURE__ */ __name(() => CredentialRefreshSigningModeValidator, "CredentialRefreshSigningModeValidator"),
152
+ CredentialRefreshUnchangedResultValidator: /* @__PURE__ */ __name(() => CredentialRefreshUnchangedResultValidator, "CredentialRefreshUnchangedResultValidator"),
153
+ CredentialRefreshUnsupportedResultValidator: /* @__PURE__ */ __name(() => CredentialRefreshUnsupportedResultValidator, "CredentialRefreshUnsupportedResultValidator"),
154
+ CredentialRefreshUpdatedResultValidator: /* @__PURE__ */ __name(() => CredentialRefreshUpdatedResultValidator, "CredentialRefreshUpdatedResultValidator"),
155
+ CredentialRefreshVersionMetadataValidator: /* @__PURE__ */ __name(() => CredentialRefreshVersionMetadataValidator, "CredentialRefreshVersionMetadataValidator"),
144
156
  CredentialSchemaValidator: /* @__PURE__ */ __name(() => CredentialSchemaValidator, "CredentialSchemaValidator"),
145
157
  CredentialStatusValidator: /* @__PURE__ */ __name(() => CredentialStatusValidator, "CredentialStatusValidator"),
146
158
  CredentialSubjectValidator: /* @__PURE__ */ __name(() => CredentialSubjectValidator, "CredentialSubjectValidator"),
@@ -161,6 +173,8 @@ var require_types_cjs_development = __commonJS({
161
173
  GeoCoordinatesValidator: /* @__PURE__ */ __name(() => GeoCoordinatesValidator, "GeoCoordinatesValidator"),
162
174
  GetCounterEventValidator: /* @__PURE__ */ __name(() => GetCounterEventValidator, "GetCounterEventValidator"),
163
175
  GetCountersEventValidator: /* @__PURE__ */ __name(() => GetCountersEventValidator, "GetCountersEventValidator"),
176
+ GetCredentialRefreshHistoryInputValidator: /* @__PURE__ */ __name(() => GetCredentialRefreshHistoryInputValidator, "GetCredentialRefreshHistoryInputValidator"),
177
+ GetCredentialRefreshHistoryResultValidator: /* @__PURE__ */ __name(() => GetCredentialRefreshHistoryResultValidator, "GetCredentialRefreshHistoryResultValidator"),
164
178
  GetFullSkillTreeInputValidator: /* @__PURE__ */ __name(() => GetFullSkillTreeInputValidator, "GetFullSkillTreeInputValidator"),
165
179
  GetFullSkillTreeResultValidator: /* @__PURE__ */ __name(() => GetFullSkillTreeResultValidator, "GetFullSkillTreeResultValidator"),
166
180
  GetSkillPathInputValidator: /* @__PURE__ */ __name(() => GetSkillPathInputValidator, "GetSkillPathInputValidator"),
@@ -185,6 +199,7 @@ var require_types_cjs_development = __commonJS({
185
199
  JWEValidator: /* @__PURE__ */ __name(() => JWEValidator, "JWEValidator"),
186
200
  JWKValidator: /* @__PURE__ */ __name(() => JWKValidator, "JWKValidator"),
187
201
  JWKWithPrivateKeyValidator: /* @__PURE__ */ __name(() => JWKWithPrivateKeyValidator, "JWKWithPrivateKeyValidator"),
202
+ JweCredentialRefreshEnvelopeValidator: /* @__PURE__ */ __name(() => JweCredentialRefreshEnvelopeValidator, "JweCredentialRefreshEnvelopeValidator"),
188
203
  KnownAchievementTypeValidator: /* @__PURE__ */ __name(() => KnownAchievementTypeValidator, "KnownAchievementTypeValidator"),
189
204
  LCNAuthedProfileValidator: /* @__PURE__ */ __name(() => LCNAuthedProfileValidator, "LCNAuthedProfileValidator"),
190
205
  LCNBoostClaimLinkOptionsValidator: /* @__PURE__ */ __name(() => LCNBoostClaimLinkOptionsValidator, "LCNBoostClaimLinkOptionsValidator"),
@@ -222,7 +237,9 @@ var require_types_cjs_development = __commonJS({
222
237
  LCNSigningAuthorityValidator: /* @__PURE__ */ __name(() => LCNSigningAuthorityValidator, "LCNSigningAuthorityValidator"),
223
238
  LCNVisibleProfileValidator: /* @__PURE__ */ __name(() => LCNVisibleProfileValidator, "LCNVisibleProfileValidator"),
224
239
  LaunchTypeValidator: /* @__PURE__ */ __name(() => LaunchTypeValidator, "LaunchTypeValidator"),
240
+ LearnCardRefreshAuthorizationValidator: /* @__PURE__ */ __name(() => LearnCardRefreshAuthorizationValidator, "LearnCardRefreshAuthorizationValidator"),
225
241
  LinkProviderFrameworkInputValidator: /* @__PURE__ */ __name(() => LinkProviderFrameworkInputValidator, "LinkProviderFrameworkInputValidator"),
242
+ ManagedCredentialRefreshServiceValidator: /* @__PURE__ */ __name(() => ManagedCredentialRefreshServiceValidator, "ManagedCredentialRefreshServiceValidator"),
226
243
  PaginatedAppStoreListingsValidator: /* @__PURE__ */ __name(() => PaginatedAppStoreListingsValidator, "PaginatedAppStoreListingsValidator"),
227
244
  PaginatedBoostRecipientsValidator: /* @__PURE__ */ __name(() => PaginatedBoostRecipientsValidator, "PaginatedBoostRecipientsValidator"),
228
245
  PaginatedBoostRecipientsWithChildrenValidator: /* @__PURE__ */ __name(() => PaginatedBoostRecipientsWithChildrenValidator, "PaginatedBoostRecipientsWithChildrenValidator"),
@@ -252,6 +269,12 @@ var require_types_cjs_development = __commonJS({
252
269
  ProfileVisibilityEnum: /* @__PURE__ */ __name(() => ProfileVisibilityEnum, "ProfileVisibilityEnum"),
253
270
  PromotionLevelValidator: /* @__PURE__ */ __name(() => PromotionLevelValidator, "PromotionLevelValidator"),
254
271
  ProofValidator: /* @__PURE__ */ __name(() => ProofValidator, "ProofValidator"),
272
+ PublicCredentialRefreshEnvelopeValidator: /* @__PURE__ */ __name(() => PublicCredentialRefreshEnvelopeValidator, "PublicCredentialRefreshEnvelopeValidator"),
273
+ PublishCredentialRefreshInputValidator: /* @__PURE__ */ __name(() => PublishCredentialRefreshInputValidator, "PublishCredentialRefreshInputValidator"),
274
+ PublishCredentialRefreshNotificationValidator: /* @__PURE__ */ __name(() => PublishCredentialRefreshNotificationValidator, "PublishCredentialRefreshNotificationValidator"),
275
+ PublishCredentialRefreshResultValidator: /* @__PURE__ */ __name(() => PublishCredentialRefreshResultValidator, "PublishCredentialRefreshResultValidator"),
276
+ PublishIssuerSignedRefreshValidator: /* @__PURE__ */ __name(() => PublishIssuerSignedRefreshValidator, "PublishIssuerSignedRefreshValidator"),
277
+ PublishSigningAuthorityRefreshValidator: /* @__PURE__ */ __name(() => PublishSigningAuthorityRefreshValidator, "PublishSigningAuthorityRefreshValidator"),
255
278
  RefreshServiceValidator: /* @__PURE__ */ __name(() => RefreshServiceValidator, "RefreshServiceValidator"),
256
279
  RegExpValidator: /* @__PURE__ */ __name(() => RegExpValidator, "RegExpValidator"),
257
280
  RelatedValidator: /* @__PURE__ */ __name(() => RelatedValidator, "RelatedValidator"),
@@ -292,11 +315,13 @@ var require_types_cjs_development = __commonJS({
292
315
  SkillTreeNodeInputValidator: /* @__PURE__ */ __name(() => SkillTreeNodeInputValidator, "SkillTreeNodeInputValidator"),
293
316
  SkillTreeNodeValidator: /* @__PURE__ */ __name(() => SkillTreeNodeValidator, "SkillTreeNodeValidator"),
294
317
  SkillValidator: /* @__PURE__ */ __name(() => SkillValidator, "SkillValidator"),
318
+ StandardCredentialRefreshServiceValidator: /* @__PURE__ */ __name(() => StandardCredentialRefreshServiceValidator, "StandardCredentialRefreshServiceValidator"),
295
319
  StatusCheckEntryValidator: /* @__PURE__ */ __name(() => StatusCheckEntryValidator, "StatusCheckEntryValidator"),
296
320
  StoredCredentialEnvelopeValidator: /* @__PURE__ */ __name(() => StoredCredentialEnvelopeValidator, "StoredCredentialEnvelopeValidator"),
297
321
  StringQuery: /* @__PURE__ */ __name(() => StringQuery, "StringQuery"),
298
322
  SummaryCredentialDataValidator: /* @__PURE__ */ __name(() => SummaryCredentialDataValidator, "SummaryCredentialDataValidator"),
299
323
  SummaryCredentialKeywordValidator: /* @__PURE__ */ __name(() => SummaryCredentialKeywordValidator, "SummaryCredentialKeywordValidator"),
324
+ SupportedCredentialRefreshServiceValidator: /* @__PURE__ */ __name(() => SupportedCredentialRefreshServiceValidator, "SupportedCredentialRefreshServiceValidator"),
300
325
  SyncFrameworkInputValidator: /* @__PURE__ */ __name(() => SyncFrameworkInputValidator, "SyncFrameworkInputValidator"),
301
326
  TagValidator: /* @__PURE__ */ __name(() => TagValidator, "TagValidator"),
302
327
  TemplateRenderMethodValidator: /* @__PURE__ */ __name(() => TemplateRenderMethodValidator, "TemplateRenderMethodValidator"),
@@ -16266,7 +16291,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16266
16291
  did: LCNProfileValidator.shape.did
16267
16292
  });
16268
16293
  var LCNConnectionProfileValidator = LCNAuthedProfileValidator.extend({
16269
- email: LCNProfileValidator.shape.email
16294
+ email: LCNProfileValidator.shape.email,
16295
+ connectedAt: external_exports.iso.datetime().optional().describe("When the viewer and this profile became connected.")
16270
16296
  });
16271
16297
  var LCNVisibleProfileValidator = external_exports.union([
16272
16298
  LCNConnectionProfileValidator.strict(),
@@ -16499,7 +16525,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16499
16525
  webhookUrl: external_exports.string().url().optional().describe("Webhook URL to receive claim notifications"),
16500
16526
  suppressDelivery: external_exports.boolean().optional().describe("If true, returns claimUrl without sending email/SMS"),
16501
16527
  branding: SendBrandingOptionsValidator.optional().describe("Branding for email/SMS delivery"),
16502
- guardianEmail: external_exports.string().email().optional().describe("Guardian email that must approve before student can claim")
16528
+ guardianEmail: external_exports.string().email().optional().describe("Guardian email that must approve before student can claim"),
16529
+ expiresInDays: external_exports.number().int().min(1).max(720).optional().describe(
16530
+ "How many days the credential stays claimable in the Universal Inbox (default 30). Does not change the credential validity period."
16531
+ )
16503
16532
  });
16504
16533
  var SendBoostInputValidator = external_exports.object({
16505
16534
  type: external_exports.literal("boost"),
@@ -16794,7 +16823,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16794
16823
  "APP_NOTIFICATION",
16795
16824
  "CREDENTIAL_REVOKED",
16796
16825
  "CREDENTIAL_SUSPENDED",
16797
- "CREDENTIAL_UNSUSPENDED"
16826
+ "CREDENTIAL_UNSUSPENDED",
16827
+ "CREDENTIAL_REFRESHED"
16798
16828
  ]);
16799
16829
  var LCNNotificationMessageValidator = external_exports.object({
16800
16830
  title: external_exports.string().optional(),
@@ -16926,12 +16956,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16926
16956
  });
16927
16957
  var InboxCredentialValidator = external_exports.object({
16928
16958
  id: external_exports.string(),
16929
- credential: external_exports.string(),
16959
+ credential: external_exports.string().optional(),
16930
16960
  isSigned: external_exports.boolean(),
16931
16961
  currentStatus: LCNInboxStatusEnumValidator,
16932
16962
  isAccepted: external_exports.boolean().optional(),
16933
16963
  expiresAt: external_exports.string(),
16934
16964
  createdAt: external_exports.string(),
16965
+ finalizedAt: external_exports.string().optional(),
16966
+ expiredAt: external_exports.string().optional(),
16967
+ credentialName: external_exports.string().optional(),
16968
+ achievementType: external_exports.string().optional(),
16935
16969
  issuerDid: external_exports.string(),
16936
16970
  webhookUrl: external_exports.string().optional(),
16937
16971
  boostUri: external_exports.string().optional(),
@@ -16985,7 +17019,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16985
17019
  "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."
16986
17020
  ),
16987
17021
  webhookUrl: external_exports.string().url().optional().describe("The webhook URL to receive credential issuance events."),
16988
- expiresInDays: external_exports.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
17022
+ expiresInDays: external_exports.number().int().min(1).max(720).optional().describe(
17023
+ "How many days the encrypted inbox payload remains claimable. This does not change the credential validity period."
17024
+ ),
16989
17025
  templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe(
16990
17026
  "Template data to render into the boost credential template using Mustache syntax. Only used when boostUri is provided."
16991
17027
  ),
@@ -17048,6 +17084,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17048
17084
  credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
17049
17085
  configuration: external_exports.object({
17050
17086
  publishableKey: external_exports.string(),
17087
+ expiresInDays: external_exports.number().int().min(1).max(720).optional().describe(
17088
+ "Inbox claim window in days. Defaults to 720; use a shorter window for sensitive records."
17089
+ ),
17051
17090
  signingAuthorityName: external_exports.string().optional(),
17052
17091
  listingId: external_exports.string().optional(),
17053
17092
  listingSlug: external_exports.string().optional()
@@ -17685,6 +17724,191 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17685
17724
  const result = inAppMessagesFlagValidator.safeParse(raw);
17686
17725
  return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
17687
17726
  }, "parseInAppMessagesFlag");
17727
+ var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
17728
+ var ManagedCredentialRefreshServiceValidator = external_exports.object({
17729
+ id: external_exports.string().min(1),
17730
+ type: external_exports.literal("LearnCardCredentialRefresh2026"),
17731
+ authorization: LearnCardRefreshAuthorizationValidator.optional()
17732
+ }).catchall(external_exports.any());
17733
+ var StandardCredentialRefreshServiceValidator = external_exports.object({
17734
+ id: external_exports.string().min(1),
17735
+ type: external_exports.literal("1EdTechCredentialRefresh")
17736
+ }).catchall(external_exports.any());
17737
+ var SupportedCredentialRefreshServiceValidator = external_exports.union([
17738
+ ManagedCredentialRefreshServiceValidator,
17739
+ StandardCredentialRefreshServiceValidator
17740
+ ]);
17741
+ var AllocateCredentialRefreshInputValidator = external_exports.object({
17742
+ holder: external_exports.object({
17743
+ profileId: external_exports.string().optional(),
17744
+ did: external_exports.string().min(1)
17745
+ }),
17746
+ credentialId: external_exports.string().min(1)
17747
+ });
17748
+ var AllocateCredentialRefreshResultValidator = external_exports.object({
17749
+ refreshId: external_exports.string().min(1),
17750
+ refreshService: ManagedCredentialRefreshServiceValidator.extend({
17751
+ authorization: LearnCardRefreshAuthorizationValidator
17752
+ })
17753
+ });
17754
+ var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
17755
+ var PublishCredentialRefreshBaseFields = {
17756
+ refreshId: external_exports.string().min(1),
17757
+ notifyHolder: external_exports.boolean().optional(),
17758
+ updateSummary: external_exports.string().optional(),
17759
+ idempotencyKey: external_exports.string().optional()
17760
+ };
17761
+ var PublishIssuerSignedRefreshValidator = external_exports.object({
17762
+ ...PublishCredentialRefreshBaseFields,
17763
+ mode: external_exports.literal("issuer-signed"),
17764
+ signedCredential: VCValidator
17765
+ });
17766
+ var PublishSigningAuthorityRefreshValidator = external_exports.object({
17767
+ ...PublishCredentialRefreshBaseFields,
17768
+ mode: external_exports.literal("signing-authority"),
17769
+ credential: UnsignedVCValidator,
17770
+ signingAuthority: external_exports.object({
17771
+ type: external_exports.string().min(1)
17772
+ }).catchall(external_exports.any())
17773
+ });
17774
+ var PublishCredentialRefreshInputValidator = external_exports.object({
17775
+ ...PublishCredentialRefreshBaseFields,
17776
+ mode: CredentialRefreshSigningModeValidator,
17777
+ signedCredential: VCValidator.optional(),
17778
+ credential: UnsignedVCValidator.optional(),
17779
+ signingAuthority: external_exports.object({
17780
+ type: external_exports.string().min(1)
17781
+ }).catchall(external_exports.any()).optional()
17782
+ }).superRefine((input, ctx) => {
17783
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
17784
+ ctx.addIssue({
17785
+ code: "custom",
17786
+ path: ["signedCredential"],
17787
+ message: "signedCredential is required for issuer-signed publication"
17788
+ });
17789
+ }
17790
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
17791
+ ctx.addIssue({
17792
+ code: "custom",
17793
+ path: ["mode"],
17794
+ message: "issuer-signed publication cannot include signing-authority fields"
17795
+ });
17796
+ }
17797
+ if (input.mode === "signing-authority") {
17798
+ if (input.signedCredential !== void 0) {
17799
+ ctx.addIssue({
17800
+ code: "custom",
17801
+ path: ["signedCredential"],
17802
+ message: "signing-authority publication cannot include signedCredential"
17803
+ });
17804
+ }
17805
+ if (!input.credential) {
17806
+ ctx.addIssue({
17807
+ code: "custom",
17808
+ path: ["credential"],
17809
+ message: "credential is required for signing-authority publication"
17810
+ });
17811
+ }
17812
+ if (!input.signingAuthority) {
17813
+ ctx.addIssue({
17814
+ code: "custom",
17815
+ path: ["signingAuthority"],
17816
+ message: "signingAuthority is required for signing-authority publication"
17817
+ });
17818
+ }
17819
+ }
17820
+ });
17821
+ var PublishCredentialRefreshNotificationValidator = external_exports.enum([
17822
+ "queued",
17823
+ "suppressed",
17824
+ "not-applicable",
17825
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
17826
+ "delivery-failed"
17827
+ ]);
17828
+ var PublishCredentialRefreshResultValidator = external_exports.object({
17829
+ refreshId: external_exports.string().min(1),
17830
+ version: external_exports.number().int().positive(),
17831
+ publishedAt: external_exports.string().min(1),
17832
+ notification: PublishCredentialRefreshNotificationValidator
17833
+ });
17834
+ var CredentialRefreshVersionMetadataValidator = external_exports.object({
17835
+ version: external_exports.number().int().positive(),
17836
+ publishedAt: external_exports.string().min(1),
17837
+ effectiveAt: external_exports.string().optional(),
17838
+ etag: external_exports.string().optional(),
17839
+ signingMode: CredentialRefreshSigningModeValidator.optional(),
17840
+ updateSummary: external_exports.string().optional()
17841
+ });
17842
+ var GetCredentialRefreshHistoryInputValidator = external_exports.object({
17843
+ refreshId: external_exports.string().min(1),
17844
+ cursor: external_exports.string().optional(),
17845
+ limit: external_exports.number().int().positive().optional()
17846
+ });
17847
+ var GetCredentialRefreshHistoryResultValidator = external_exports.object({
17848
+ records: CredentialRefreshVersionMetadataValidator.array(),
17849
+ hasMore: external_exports.boolean(),
17850
+ cursor: external_exports.string().optional()
17851
+ });
17852
+ var CredentialRefreshChallengeValidator = external_exports.object({
17853
+ challenge: external_exports.string().min(1),
17854
+ expiresAt: external_exports.string().min(1),
17855
+ domain: external_exports.string().optional(),
17856
+ scheme: external_exports.literal("LearnCardDIDAuth").optional()
17857
+ });
17858
+ var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
17859
+ format: external_exports.literal("vc"),
17860
+ credential: VCValidator,
17861
+ etag: external_exports.string().optional()
17862
+ });
17863
+ var JweCredentialRefreshEnvelopeValidator = external_exports.object({
17864
+ format: external_exports.literal("jwe"),
17865
+ jwe: JWEValidator,
17866
+ etag: external_exports.string().optional(),
17867
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
17868
+ version: external_exports.number().int().positive().optional()
17869
+ });
17870
+ var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
17871
+ PublicCredentialRefreshEnvelopeValidator,
17872
+ JweCredentialRefreshEnvelopeValidator
17873
+ ]);
17874
+ var CredentialRefreshFailureCodeValidator = external_exports.enum([
17875
+ "UNAVAILABLE",
17876
+ "TIMEOUT",
17877
+ "UNSUPPORTED_SERVICE",
17878
+ "UNAUTHORIZED",
17879
+ "MALFORMED_RESPONSE",
17880
+ "INVALID_PROOF",
17881
+ "ISSUER_MISMATCH",
17882
+ "ID_MISMATCH",
17883
+ "ROLLBACK",
17884
+ "REVOKED",
17885
+ "UNSAFE_ENDPOINT"
17886
+ ]);
17887
+ var CredentialRefreshUpdatedResultValidator = external_exports.object({
17888
+ status: external_exports.literal("updated"),
17889
+ credential: VCValidator,
17890
+ etag: external_exports.string().optional(),
17891
+ managedVersion: external_exports.number().int().positive().optional()
17892
+ });
17893
+ var CredentialRefreshUnchangedResultValidator = external_exports.object({
17894
+ status: external_exports.literal("unchanged"),
17895
+ checkedAt: external_exports.string().min(1),
17896
+ etag: external_exports.string().optional()
17897
+ });
17898
+ var CredentialRefreshUnsupportedResultValidator = external_exports.object({
17899
+ status: external_exports.literal("unsupported")
17900
+ });
17901
+ var CredentialRefreshFailedResultValidator = external_exports.object({
17902
+ status: external_exports.literal("failed"),
17903
+ code: CredentialRefreshFailureCodeValidator,
17904
+ retryable: external_exports.boolean()
17905
+ });
17906
+ var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
17907
+ CredentialRefreshUpdatedResultValidator,
17908
+ CredentialRefreshUnchangedResultValidator,
17909
+ CredentialRefreshUnsupportedResultValidator,
17910
+ CredentialRefreshFailedResultValidator
17911
+ ]);
17688
17912
  }
17689
17913
  });
17690
17914
 
@@ -17931,7 +18155,7 @@ async function deriveKeyFromPassword(password, salt, params = DEFAULT_KDF_PARAMS
17931
18155
  hashLength: ARGON2_HASH_LENGTH,
17932
18156
  outputType: "binary"
17933
18157
  });
17934
- return new Uint8Array(hash);
18158
+ return Uint8Array.from(hash);
17935
18159
  }
17936
18160
  __name(deriveKeyFromPassword, "deriveKeyFromPassword");
17937
18161
  async function encryptWithPassword(plaintext, password) {