@learncard/learn-cloud-plugin 2.3.41 → 2.3.42

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.
@@ -21683,6 +21683,204 @@ var StringQuery = external_exports.union([
21683
21683
  $or: BaseStringQuery.array()
21684
21684
  })
21685
21685
  ]);
21686
+ var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
21687
+ var ManagedCredentialRefreshServiceValidator = external_exports.object({
21688
+ id: external_exports.string().min(1),
21689
+ type: external_exports.literal("LearnCardCredentialRefresh2026"),
21690
+ authorization: LearnCardRefreshAuthorizationValidator.optional()
21691
+ }).catchall(external_exports.any());
21692
+ var StandardCredentialRefreshServiceValidator = external_exports.object({
21693
+ id: external_exports.string().min(1),
21694
+ type: external_exports.literal("1EdTechCredentialRefresh")
21695
+ }).catchall(external_exports.any());
21696
+ var SupportedCredentialRefreshServiceValidator = external_exports.union([
21697
+ ManagedCredentialRefreshServiceValidator,
21698
+ StandardCredentialRefreshServiceValidator
21699
+ ]);
21700
+ var AllocateCredentialRefreshInputValidator = external_exports.object({
21701
+ holder: external_exports.object({
21702
+ profileId: external_exports.string().optional(),
21703
+ did: external_exports.string().min(1)
21704
+ }),
21705
+ credentialId: external_exports.string().min(1)
21706
+ });
21707
+ var AllocateCredentialRefreshResultValidator = external_exports.object({
21708
+ refreshId: external_exports.string().min(1),
21709
+ refreshService: ManagedCredentialRefreshServiceValidator.extend({
21710
+ authorization: LearnCardRefreshAuthorizationValidator
21711
+ })
21712
+ });
21713
+ var ManagedCredentialRefreshReceiptValidator = external_exports.object({
21714
+ refreshId: external_exports.string().min(1),
21715
+ refreshService: ManagedCredentialRefreshServiceValidator,
21716
+ credentialId: external_exports.string().min(1),
21717
+ issuerDid: external_exports.string().min(1),
21718
+ holderDid: external_exports.string().min(1),
21719
+ credentialStatus: CredentialStatusValidator.or(
21720
+ CredentialStatusValidator.array()
21721
+ ).optional()
21722
+ }).strip();
21723
+ var InboxCredentialRefreshReceiptValidator = ManagedCredentialRefreshReceiptValidator.omit(
21724
+ { holderDid: true }
21725
+ ).extend({ holderDid: external_exports.string().min(1).optional() });
21726
+ var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
21727
+ var PublishCredentialRefreshBaseFields = {
21728
+ refreshId: external_exports.string().min(1),
21729
+ notifyHolder: external_exports.boolean().optional(),
21730
+ updateSummary: external_exports.string().optional(),
21731
+ idempotencyKey: external_exports.string().optional()
21732
+ };
21733
+ var PublishIssuerSignedRefreshValidator = external_exports.object({
21734
+ ...PublishCredentialRefreshBaseFields,
21735
+ mode: external_exports.literal("issuer-signed"),
21736
+ signedCredential: VCValidator
21737
+ });
21738
+ var PublishSigningAuthorityRefreshValidator = external_exports.object({
21739
+ ...PublishCredentialRefreshBaseFields,
21740
+ mode: external_exports.literal("signing-authority"),
21741
+ credential: UnsignedVCValidator,
21742
+ signingAuthority: external_exports.object({
21743
+ type: external_exports.string().min(1)
21744
+ }).catchall(external_exports.any())
21745
+ });
21746
+ var PublishCredentialRefreshInputValidator = external_exports.object({
21747
+ ...PublishCredentialRefreshBaseFields,
21748
+ mode: CredentialRefreshSigningModeValidator,
21749
+ signedCredential: VCValidator.optional(),
21750
+ credential: UnsignedVCValidator.optional(),
21751
+ signingAuthority: external_exports.object({
21752
+ type: external_exports.string().min(1)
21753
+ }).catchall(external_exports.any()).optional()
21754
+ }).superRefine((input, ctx) => {
21755
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
21756
+ ctx.addIssue({
21757
+ code: "custom",
21758
+ path: ["signedCredential"],
21759
+ message: "signedCredential is required for issuer-signed publication"
21760
+ });
21761
+ }
21762
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
21763
+ ctx.addIssue({
21764
+ code: "custom",
21765
+ path: ["mode"],
21766
+ message: "issuer-signed publication cannot include signing-authority fields"
21767
+ });
21768
+ }
21769
+ if (input.mode === "signing-authority") {
21770
+ if (input.signedCredential !== void 0) {
21771
+ ctx.addIssue({
21772
+ code: "custom",
21773
+ path: ["signedCredential"],
21774
+ message: "signing-authority publication cannot include signedCredential"
21775
+ });
21776
+ }
21777
+ if (!input.credential) {
21778
+ ctx.addIssue({
21779
+ code: "custom",
21780
+ path: ["credential"],
21781
+ message: "credential is required for signing-authority publication"
21782
+ });
21783
+ }
21784
+ if (!input.signingAuthority) {
21785
+ ctx.addIssue({
21786
+ code: "custom",
21787
+ path: ["signingAuthority"],
21788
+ message: "signingAuthority is required for signing-authority publication"
21789
+ });
21790
+ }
21791
+ }
21792
+ });
21793
+ var PublishCredentialRefreshNotificationValidator = external_exports.enum([
21794
+ "queued",
21795
+ "suppressed",
21796
+ "not-applicable",
21797
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
21798
+ "delivery-failed"
21799
+ ]);
21800
+ var PublishCredentialRefreshResultValidator = external_exports.object({
21801
+ refreshId: external_exports.string().min(1),
21802
+ version: external_exports.number().int().positive(),
21803
+ publishedAt: external_exports.string().min(1),
21804
+ notification: PublishCredentialRefreshNotificationValidator
21805
+ });
21806
+ var CredentialRefreshVersionMetadataValidator = external_exports.object({
21807
+ version: external_exports.number().int().positive(),
21808
+ publishedAt: external_exports.string().min(1),
21809
+ effectiveAt: external_exports.string().optional(),
21810
+ etag: external_exports.string().optional(),
21811
+ signingMode: CredentialRefreshSigningModeValidator.optional(),
21812
+ updateSummary: external_exports.string().optional()
21813
+ });
21814
+ var GetCredentialRefreshHistoryInputValidator = external_exports.object({
21815
+ refreshId: external_exports.string().min(1),
21816
+ cursor: external_exports.string().optional(),
21817
+ limit: external_exports.number().int().positive().optional()
21818
+ });
21819
+ var GetCredentialRefreshHistoryResultValidator = external_exports.object({
21820
+ records: CredentialRefreshVersionMetadataValidator.array(),
21821
+ hasMore: external_exports.boolean(),
21822
+ cursor: external_exports.string().optional()
21823
+ });
21824
+ var CredentialRefreshChallengeValidator = external_exports.object({
21825
+ challenge: external_exports.string().min(1),
21826
+ expiresAt: external_exports.string().min(1),
21827
+ domain: external_exports.string().optional(),
21828
+ scheme: external_exports.literal("LearnCardDIDAuth").optional()
21829
+ });
21830
+ var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
21831
+ format: external_exports.literal("vc"),
21832
+ credential: VCValidator,
21833
+ etag: external_exports.string().optional()
21834
+ });
21835
+ var JweCredentialRefreshEnvelopeValidator = external_exports.object({
21836
+ format: external_exports.literal("jwe"),
21837
+ jwe: JWEValidator,
21838
+ etag: external_exports.string().optional(),
21839
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
21840
+ version: external_exports.number().int().positive().optional()
21841
+ });
21842
+ var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
21843
+ PublicCredentialRefreshEnvelopeValidator,
21844
+ JweCredentialRefreshEnvelopeValidator
21845
+ ]);
21846
+ var CredentialRefreshFailureCodeValidator = external_exports.enum([
21847
+ "UNAVAILABLE",
21848
+ "TIMEOUT",
21849
+ "UNSUPPORTED_SERVICE",
21850
+ "UNAUTHORIZED",
21851
+ "MALFORMED_RESPONSE",
21852
+ "INVALID_PROOF",
21853
+ "ISSUER_MISMATCH",
21854
+ "ID_MISMATCH",
21855
+ "ROLLBACK",
21856
+ "REVOKED",
21857
+ "UNSAFE_ENDPOINT"
21858
+ ]);
21859
+ var CredentialRefreshUpdatedResultValidator = external_exports.object({
21860
+ status: external_exports.literal("updated"),
21861
+ credential: VCValidator,
21862
+ etag: external_exports.string().optional(),
21863
+ managedVersion: external_exports.number().int().positive().optional()
21864
+ });
21865
+ var CredentialRefreshUnchangedResultValidator = external_exports.object({
21866
+ status: external_exports.literal("unchanged"),
21867
+ checkedAt: external_exports.string().min(1),
21868
+ etag: external_exports.string().optional()
21869
+ });
21870
+ var CredentialRefreshUnsupportedResultValidator = external_exports.object({
21871
+ status: external_exports.literal("unsupported")
21872
+ });
21873
+ var CredentialRefreshFailedResultValidator = external_exports.object({
21874
+ status: external_exports.literal("failed"),
21875
+ code: CredentialRefreshFailureCodeValidator,
21876
+ retryable: external_exports.boolean()
21877
+ });
21878
+ var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
21879
+ CredentialRefreshUpdatedResultValidator,
21880
+ CredentialRefreshUnchangedResultValidator,
21881
+ CredentialRefreshUnsupportedResultValidator,
21882
+ CredentialRefreshFailedResultValidator
21883
+ ]);
21686
21884
  var LCNProfileDisplayValidator = external_exports.object({
21687
21885
  backgroundColor: external_exports.string().optional(),
21688
21886
  backgroundImage: external_exports.string().optional(),
@@ -22018,7 +22216,13 @@ var SendBoostInputValidator = external_exports.object({
22018
22216
  "Options for email/phone recipients (Universal Inbox)"
22019
22217
  ),
22020
22218
  templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
22021
- integrationId: external_exports.string().optional().describe("Integration ID for activity tracking")
22219
+ integrationId: external_exports.string().optional().describe("Integration ID for activity tracking"),
22220
+ refresh: external_exports.boolean().optional().describe(
22221
+ "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."
22222
+ ),
22223
+ idempotencyKey: external_exports.string().min(1).max(200).optional().describe(
22224
+ "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."
22225
+ )
22022
22226
  }).refine((data) => data.templateUri || data.template || data.signedCredential, {
22023
22227
  message: "Either templateUri, template, or signedCredential must be provided.",
22024
22228
  path: ["templateUri"]
@@ -22033,8 +22237,12 @@ var SendBoostInputValidator = external_exports.object({
22033
22237
  message: "guardianEmail must differ from recipient (self-approval not allowed)",
22034
22238
  path: ["options", "guardianEmail"]
22035
22239
  }
22036
- );
22240
+ ).refine((data) => !data.idempotencyKey || data.refresh === true, {
22241
+ message: "idempotencyKey is only supported with refresh: true.",
22242
+ path: ["idempotencyKey"]
22243
+ });
22037
22244
  var SendInboxResponseValidator = external_exports.object({
22245
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
22038
22246
  issuanceId: external_exports.string(),
22039
22247
  status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
22040
22248
  claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
@@ -22049,8 +22257,34 @@ var SendBoostResponseValidator = external_exports.object({
22049
22257
  activityId: external_exports.string().describe("Links to the activity lifecycle for this issuance"),
22050
22258
  inbox: SendInboxResponseValidator.optional().describe(
22051
22259
  "Present when sent via email/phone (Universal Inbox)"
22260
+ ),
22261
+ refresh: ManagedCredentialRefreshReceiptValidator.optional().describe(
22262
+ "Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
22052
22263
  )
22053
22264
  });
22265
+ var PrepareRefreshableSendInputValidator = external_exports.object({
22266
+ recipient: external_exports.string(),
22267
+ templateUri: external_exports.string().optional(),
22268
+ template: SendBoostTemplateValidator.optional(),
22269
+ contractUri: external_exports.string().optional(),
22270
+ templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
22271
+ integrationId: external_exports.string().optional(),
22272
+ /** Credential ID to allocate for; generated server-side when omitted. */
22273
+ credentialId: external_exports.string().min(1).optional(),
22274
+ idempotencyKey: external_exports.string().min(1).max(200).optional()
22275
+ }).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
22276
+ message: "Provide exactly one of templateUri or template."
22277
+ });
22278
+ var PrepareRefreshableSendResultValidator = external_exports.object({
22279
+ boostUri: external_exports.string(),
22280
+ credentialId: external_exports.string(),
22281
+ refreshId: external_exports.string(),
22282
+ refreshService: ManagedCredentialRefreshServiceValidator,
22283
+ /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
22284
+ holderDid: external_exports.string(),
22285
+ /** Present when this idempotencyKey already completed: return it without signing. */
22286
+ completed: SendBoostResponseValidator.optional()
22287
+ });
22054
22288
  var SendInputValidator = external_exports.discriminatedUnion("type", [SendBoostInputValidator]);
22055
22289
  var SendResponseValidator = external_exports.discriminatedUnion("type", [SendBoostResponseValidator]);
22056
22290
  var ConsentFlowTermsStatusValidator = external_exports.enum(["live", "stale", "withdrawn"]);
@@ -22381,6 +22615,7 @@ var AuthGrantValidator = external_exports.object({
22381
22615
  }, "error")
22382
22616
  }),
22383
22617
  scope: external_exports.string(),
22618
+ actAs: external_exports.string().optional(),
22384
22619
  createdAt: external_exports.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
22385
22620
  expiresAt: external_exports.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
22386
22621
  });
@@ -22452,6 +22687,8 @@ var CreateContactMethodSessionResponseValidator = external_exports.object({
22452
22687
  sessionJwt: external_exports.string()
22453
22688
  });
22454
22689
  var InboxCredentialValidator = external_exports.object({
22690
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
22691
+ refreshId: external_exports.string().optional(),
22455
22692
  id: external_exports.string(),
22456
22693
  credential: external_exports.string().optional(),
22457
22694
  isSigned: external_exports.boolean(),
@@ -22506,12 +22743,19 @@ var IssueInboxCredentialValidator = external_exports.object({
22506
22743
  templateUri: external_exports.string().optional().describe(
22507
22744
  "URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
22508
22745
  ),
22746
+ refresh: external_exports.boolean().optional().describe(
22747
+ "Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
22748
+ ),
22749
+ idempotencyKey: external_exports.string().min(1).max(200).optional(),
22509
22750
  // === OPTIONAL FEATURES ===
22510
22751
  // Add major, distinct features at the top level.
22511
22752
  //consentRequest: ConsentRequestValidator.optional(),
22512
22753
  // === PROCESS CONFIGURATION (Optional) ===
22513
22754
  // HOW should this issuance be handled?
22514
22755
  configuration: external_exports.object({
22756
+ guardianEmail: external_exports.string().email().optional().describe(
22757
+ "Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
22758
+ ),
22515
22759
  signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
22516
22760
  "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."
22517
22761
  ),
@@ -22565,17 +22809,130 @@ var IssueInboxCredentialValidator = external_exports.object({
22565
22809
  }).optional().describe(
22566
22810
  "Configuration for the credential issuance. If not provided, the default configuration will be used."
22567
22811
  )
22812
+ }).refine((data) => !data.idempotencyKey || data.refresh === true, {
22813
+ message: "idempotencyKey requires refresh: true."
22568
22814
  }).refine((data) => data.credential || data.templateUri, {
22569
22815
  message: "Either credential or templateUri must be provided.",
22570
22816
  path: ["credential"]
22571
- });
22817
+ }).refine(
22818
+ (data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
22819
+ {
22820
+ message: "guardianEmail must differ from recipient (self-approval not allowed)",
22821
+ path: ["configuration", "guardianEmail"]
22822
+ }
22823
+ );
22572
22824
  var IssueInboxCredentialResponseValidator = external_exports.object({
22825
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
22573
22826
  issuanceId: external_exports.string(),
22574
22827
  status: LCNInboxStatusEnumValidator,
22575
22828
  recipient: ContactMethodQueryValidator,
22576
22829
  claimUrl: external_exports.string().url().optional(),
22577
22830
  recipientDid: external_exports.string().optional()
22578
22831
  });
22832
+ var InboxBatchConfigurationValidator = IssueInboxCredentialValidator.shape.configuration.unwrap().extend({
22833
+ refresh: IssueInboxCredentialValidator.shape.refresh.describe(
22834
+ "Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
22835
+ ),
22836
+ delivery: IssueInboxCredentialValidator.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports.boolean().optional() }).optional()
22837
+ });
22838
+ var InboxBatchItemConfigurationValidator = InboxBatchConfigurationValidator.extend({
22839
+ guardianEmail: InboxBatchConfigurationValidator.shape.guardianEmail.nullable().describe(
22840
+ "Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
22841
+ )
22842
+ });
22843
+ var IssueInboxCredentialBatchItemValidator = external_exports.object({
22844
+ ...IssueInboxCredentialValidator.shape,
22845
+ configuration: InboxBatchItemConfigurationValidator.optional(),
22846
+ idempotencyKey: external_exports.string().max(256).optional()
22847
+ }).refine((data) => data.credential || data.templateUri, {
22848
+ message: "Either credential or templateUri must be provided.",
22849
+ path: ["credential"]
22850
+ }).describe(
22851
+ "One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
22852
+ );
22853
+ var IssueInboxCredentialBatchValidator = external_exports.object({
22854
+ requestId: external_exports.string().min(1).max(256).optional(),
22855
+ items: external_exports.array(IssueInboxCredentialBatchItemValidator).min(1).max(100),
22856
+ configuration: InboxBatchConfigurationValidator.optional()
22857
+ }).superRefine((batch, ctx) => {
22858
+ batch.items.forEach((item, index) => {
22859
+ const itemGuardian = item.configuration?.guardianEmail;
22860
+ const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
22861
+ if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
22862
+ ctx.addIssue({
22863
+ code: "custom",
22864
+ path: ["items", index, "configuration", "guardianEmail"],
22865
+ message: "guardianEmail must differ from recipient (self-approval not allowed)"
22866
+ });
22867
+ }
22868
+ });
22869
+ });
22870
+ var InboxBatchErrorReasonValidator = external_exports.enum([
22871
+ "DUPLICATE_KEY",
22872
+ "IDEMPOTENCY_MISMATCH",
22873
+ "IN_PROGRESS",
22874
+ "UNCONFIRMED"
22875
+ ]);
22876
+ var IssueInboxCredentialBatchItemResultValidator = external_exports.discriminatedUnion("success", [
22877
+ IssueInboxCredentialResponseValidator.extend({
22878
+ success: external_exports.literal(true),
22879
+ index: external_exports.number().int().nonnegative(),
22880
+ deduplicated: external_exports.boolean().optional(),
22881
+ guardianStatus: GuardianStatusValidator.optional(),
22882
+ idempotencyKey: external_exports.string().optional()
22883
+ }),
22884
+ external_exports.object({
22885
+ success: external_exports.literal(false),
22886
+ index: external_exports.number().int().nonnegative(),
22887
+ idempotencyKey: external_exports.string().optional(),
22888
+ recipient: ContactMethodQueryValidator.optional(),
22889
+ error: external_exports.object({
22890
+ code: external_exports.string(),
22891
+ message: external_exports.string(),
22892
+ reason: InboxBatchErrorReasonValidator.optional()
22893
+ }),
22894
+ issuanceId: external_exports.string().optional().describe(
22895
+ "Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
22896
+ ),
22897
+ claimUrl: external_exports.string().url().optional().describe(
22898
+ "Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
22899
+ )
22900
+ })
22901
+ ]);
22902
+ var IssueInboxCredentialBatchResponseValidator = external_exports.object({
22903
+ results: external_exports.array(IssueInboxCredentialBatchItemResultValidator),
22904
+ summary: external_exports.object({
22905
+ total: external_exports.number(),
22906
+ succeeded: external_exports.number(),
22907
+ failed: external_exports.number(),
22908
+ deduplicated: external_exports.number()
22909
+ })
22910
+ });
22911
+ var InboxBatchReceiptValidator = external_exports.object({
22912
+ batchId: external_exports.string(),
22913
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
22914
+ createdAt: external_exports.string()
22915
+ });
22916
+ var InboxBatchStatusValidator = external_exports.object({
22917
+ batchId: external_exports.string(),
22918
+ createdAt: external_exports.string(),
22919
+ done: external_exports.boolean().describe(
22920
+ "True when no queued or processing items remain, including unconfirmed outcomes."
22921
+ ),
22922
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
22923
+ items: external_exports.array(
22924
+ external_exports.object({
22925
+ index: external_exports.number().int().nonnegative(),
22926
+ state: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
22927
+ result: IssueInboxCredentialBatchItemResultValidator.optional()
22928
+ })
22929
+ ),
22930
+ summary: IssueInboxCredentialBatchResponseValidator.shape.summary.extend({
22931
+ completed: external_exports.number(),
22932
+ pending: external_exports.number(),
22933
+ unconfirmed: external_exports.number()
22934
+ })
22935
+ });
22579
22936
  var CredentialNameRefValidator = external_exports.object({ name: external_exports.string() }).passthrough();
22580
22937
  var ClaimInboxCredentialValidator = external_exports.object({
22581
22938
  credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
@@ -23061,6 +23418,7 @@ var CredentialActivityValidator = external_exports.object({
23061
23418
  eventType: CredentialActivityEventTypeValidator,
23062
23419
  timestamp: external_exports.string(),
23063
23420
  actorProfileId: external_exports.string().optional(),
23421
+ onBehalfOf: external_exports.string().optional(),
23064
23422
  recipientType: CredentialActivityRecipientTypeValidator,
23065
23423
  recipientIdentifier: external_exports.string(),
23066
23424
  boostUri: external_exports.string().optional(),
@@ -23210,191 +23568,6 @@ var inAppMessagesFlagValidator = external_exports.object({
23210
23568
  version: external_exports.number().default(1),
23211
23569
  messages: external_exports.array(inAppMessageValidator).default([])
23212
23570
  }).passthrough();
23213
- var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
23214
- var ManagedCredentialRefreshServiceValidator = external_exports.object({
23215
- id: external_exports.string().min(1),
23216
- type: external_exports.literal("LearnCardCredentialRefresh2026"),
23217
- authorization: LearnCardRefreshAuthorizationValidator.optional()
23218
- }).catchall(external_exports.any());
23219
- var StandardCredentialRefreshServiceValidator = external_exports.object({
23220
- id: external_exports.string().min(1),
23221
- type: external_exports.literal("1EdTechCredentialRefresh")
23222
- }).catchall(external_exports.any());
23223
- var SupportedCredentialRefreshServiceValidator = external_exports.union([
23224
- ManagedCredentialRefreshServiceValidator,
23225
- StandardCredentialRefreshServiceValidator
23226
- ]);
23227
- var AllocateCredentialRefreshInputValidator = external_exports.object({
23228
- holder: external_exports.object({
23229
- profileId: external_exports.string().optional(),
23230
- did: external_exports.string().min(1)
23231
- }),
23232
- credentialId: external_exports.string().min(1)
23233
- });
23234
- var AllocateCredentialRefreshResultValidator = external_exports.object({
23235
- refreshId: external_exports.string().min(1),
23236
- refreshService: ManagedCredentialRefreshServiceValidator.extend({
23237
- authorization: LearnCardRefreshAuthorizationValidator
23238
- })
23239
- });
23240
- var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
23241
- var PublishCredentialRefreshBaseFields = {
23242
- refreshId: external_exports.string().min(1),
23243
- notifyHolder: external_exports.boolean().optional(),
23244
- updateSummary: external_exports.string().optional(),
23245
- idempotencyKey: external_exports.string().optional()
23246
- };
23247
- var PublishIssuerSignedRefreshValidator = external_exports.object({
23248
- ...PublishCredentialRefreshBaseFields,
23249
- mode: external_exports.literal("issuer-signed"),
23250
- signedCredential: VCValidator
23251
- });
23252
- var PublishSigningAuthorityRefreshValidator = external_exports.object({
23253
- ...PublishCredentialRefreshBaseFields,
23254
- mode: external_exports.literal("signing-authority"),
23255
- credential: UnsignedVCValidator,
23256
- signingAuthority: external_exports.object({
23257
- type: external_exports.string().min(1)
23258
- }).catchall(external_exports.any())
23259
- });
23260
- var PublishCredentialRefreshInputValidator = external_exports.object({
23261
- ...PublishCredentialRefreshBaseFields,
23262
- mode: CredentialRefreshSigningModeValidator,
23263
- signedCredential: VCValidator.optional(),
23264
- credential: UnsignedVCValidator.optional(),
23265
- signingAuthority: external_exports.object({
23266
- type: external_exports.string().min(1)
23267
- }).catchall(external_exports.any()).optional()
23268
- }).superRefine((input, ctx) => {
23269
- if (input.mode === "issuer-signed" && !input.signedCredential) {
23270
- ctx.addIssue({
23271
- code: "custom",
23272
- path: ["signedCredential"],
23273
- message: "signedCredential is required for issuer-signed publication"
23274
- });
23275
- }
23276
- if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
23277
- ctx.addIssue({
23278
- code: "custom",
23279
- path: ["mode"],
23280
- message: "issuer-signed publication cannot include signing-authority fields"
23281
- });
23282
- }
23283
- if (input.mode === "signing-authority") {
23284
- if (input.signedCredential !== void 0) {
23285
- ctx.addIssue({
23286
- code: "custom",
23287
- path: ["signedCredential"],
23288
- message: "signing-authority publication cannot include signedCredential"
23289
- });
23290
- }
23291
- if (!input.credential) {
23292
- ctx.addIssue({
23293
- code: "custom",
23294
- path: ["credential"],
23295
- message: "credential is required for signing-authority publication"
23296
- });
23297
- }
23298
- if (!input.signingAuthority) {
23299
- ctx.addIssue({
23300
- code: "custom",
23301
- path: ["signingAuthority"],
23302
- message: "signingAuthority is required for signing-authority publication"
23303
- });
23304
- }
23305
- }
23306
- });
23307
- var PublishCredentialRefreshNotificationValidator = external_exports.enum([
23308
- "queued",
23309
- "suppressed",
23310
- "not-applicable",
23311
- /** Publication succeeded, but the post-commit notification enqueue must be retried. */
23312
- "delivery-failed"
23313
- ]);
23314
- var PublishCredentialRefreshResultValidator = external_exports.object({
23315
- refreshId: external_exports.string().min(1),
23316
- version: external_exports.number().int().positive(),
23317
- publishedAt: external_exports.string().min(1),
23318
- notification: PublishCredentialRefreshNotificationValidator
23319
- });
23320
- var CredentialRefreshVersionMetadataValidator = external_exports.object({
23321
- version: external_exports.number().int().positive(),
23322
- publishedAt: external_exports.string().min(1),
23323
- effectiveAt: external_exports.string().optional(),
23324
- etag: external_exports.string().optional(),
23325
- signingMode: CredentialRefreshSigningModeValidator.optional(),
23326
- updateSummary: external_exports.string().optional()
23327
- });
23328
- var GetCredentialRefreshHistoryInputValidator = external_exports.object({
23329
- refreshId: external_exports.string().min(1),
23330
- cursor: external_exports.string().optional(),
23331
- limit: external_exports.number().int().positive().optional()
23332
- });
23333
- var GetCredentialRefreshHistoryResultValidator = external_exports.object({
23334
- records: CredentialRefreshVersionMetadataValidator.array(),
23335
- hasMore: external_exports.boolean(),
23336
- cursor: external_exports.string().optional()
23337
- });
23338
- var CredentialRefreshChallengeValidator = external_exports.object({
23339
- challenge: external_exports.string().min(1),
23340
- expiresAt: external_exports.string().min(1),
23341
- domain: external_exports.string().optional(),
23342
- scheme: external_exports.literal("LearnCardDIDAuth").optional()
23343
- });
23344
- var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
23345
- format: external_exports.literal("vc"),
23346
- credential: VCValidator,
23347
- etag: external_exports.string().optional()
23348
- });
23349
- var JweCredentialRefreshEnvelopeValidator = external_exports.object({
23350
- format: external_exports.literal("jwe"),
23351
- jwe: JWEValidator,
23352
- etag: external_exports.string().optional(),
23353
- /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
23354
- version: external_exports.number().int().positive().optional()
23355
- });
23356
- var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
23357
- PublicCredentialRefreshEnvelopeValidator,
23358
- JweCredentialRefreshEnvelopeValidator
23359
- ]);
23360
- var CredentialRefreshFailureCodeValidator = external_exports.enum([
23361
- "UNAVAILABLE",
23362
- "TIMEOUT",
23363
- "UNSUPPORTED_SERVICE",
23364
- "UNAUTHORIZED",
23365
- "MALFORMED_RESPONSE",
23366
- "INVALID_PROOF",
23367
- "ISSUER_MISMATCH",
23368
- "ID_MISMATCH",
23369
- "ROLLBACK",
23370
- "REVOKED",
23371
- "UNSAFE_ENDPOINT"
23372
- ]);
23373
- var CredentialRefreshUpdatedResultValidator = external_exports.object({
23374
- status: external_exports.literal("updated"),
23375
- credential: VCValidator,
23376
- etag: external_exports.string().optional(),
23377
- managedVersion: external_exports.number().int().positive().optional()
23378
- });
23379
- var CredentialRefreshUnchangedResultValidator = external_exports.object({
23380
- status: external_exports.literal("unchanged"),
23381
- checkedAt: external_exports.string().min(1),
23382
- etag: external_exports.string().optional()
23383
- });
23384
- var CredentialRefreshUnsupportedResultValidator = external_exports.object({
23385
- status: external_exports.literal("unsupported")
23386
- });
23387
- var CredentialRefreshFailedResultValidator = external_exports.object({
23388
- status: external_exports.literal("failed"),
23389
- code: CredentialRefreshFailureCodeValidator,
23390
- retryable: external_exports.boolean()
23391
- });
23392
- var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
23393
- CredentialRefreshUpdatedResultValidator,
23394
- CredentialRefreshUnchangedResultValidator,
23395
- CredentialRefreshUnsupportedResultValidator,
23396
- CredentialRefreshFailedResultValidator
23397
- ]);
23398
23571
 
23399
23572
  // src/helpers.ts
23400
23573
  var import_json_stringify_deterministic = __toESM(require_lib(), 1);