@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.
@@ -21692,6 +21692,204 @@ var StringQuery = external_exports.union([
21692
21692
  $or: BaseStringQuery.array()
21693
21693
  })
21694
21694
  ]);
21695
+ var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
21696
+ var ManagedCredentialRefreshServiceValidator = external_exports.object({
21697
+ id: external_exports.string().min(1),
21698
+ type: external_exports.literal("LearnCardCredentialRefresh2026"),
21699
+ authorization: LearnCardRefreshAuthorizationValidator.optional()
21700
+ }).catchall(external_exports.any());
21701
+ var StandardCredentialRefreshServiceValidator = external_exports.object({
21702
+ id: external_exports.string().min(1),
21703
+ type: external_exports.literal("1EdTechCredentialRefresh")
21704
+ }).catchall(external_exports.any());
21705
+ var SupportedCredentialRefreshServiceValidator = external_exports.union([
21706
+ ManagedCredentialRefreshServiceValidator,
21707
+ StandardCredentialRefreshServiceValidator
21708
+ ]);
21709
+ var AllocateCredentialRefreshInputValidator = external_exports.object({
21710
+ holder: external_exports.object({
21711
+ profileId: external_exports.string().optional(),
21712
+ did: external_exports.string().min(1)
21713
+ }),
21714
+ credentialId: external_exports.string().min(1)
21715
+ });
21716
+ var AllocateCredentialRefreshResultValidator = external_exports.object({
21717
+ refreshId: external_exports.string().min(1),
21718
+ refreshService: ManagedCredentialRefreshServiceValidator.extend({
21719
+ authorization: LearnCardRefreshAuthorizationValidator
21720
+ })
21721
+ });
21722
+ var ManagedCredentialRefreshReceiptValidator = external_exports.object({
21723
+ refreshId: external_exports.string().min(1),
21724
+ refreshService: ManagedCredentialRefreshServiceValidator,
21725
+ credentialId: external_exports.string().min(1),
21726
+ issuerDid: external_exports.string().min(1),
21727
+ holderDid: external_exports.string().min(1),
21728
+ credentialStatus: CredentialStatusValidator.or(
21729
+ CredentialStatusValidator.array()
21730
+ ).optional()
21731
+ }).strip();
21732
+ var InboxCredentialRefreshReceiptValidator = ManagedCredentialRefreshReceiptValidator.omit(
21733
+ { holderDid: true }
21734
+ ).extend({ holderDid: external_exports.string().min(1).optional() });
21735
+ var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
21736
+ var PublishCredentialRefreshBaseFields = {
21737
+ refreshId: external_exports.string().min(1),
21738
+ notifyHolder: external_exports.boolean().optional(),
21739
+ updateSummary: external_exports.string().optional(),
21740
+ idempotencyKey: external_exports.string().optional()
21741
+ };
21742
+ var PublishIssuerSignedRefreshValidator = external_exports.object({
21743
+ ...PublishCredentialRefreshBaseFields,
21744
+ mode: external_exports.literal("issuer-signed"),
21745
+ signedCredential: VCValidator
21746
+ });
21747
+ var PublishSigningAuthorityRefreshValidator = external_exports.object({
21748
+ ...PublishCredentialRefreshBaseFields,
21749
+ mode: external_exports.literal("signing-authority"),
21750
+ credential: UnsignedVCValidator,
21751
+ signingAuthority: external_exports.object({
21752
+ type: external_exports.string().min(1)
21753
+ }).catchall(external_exports.any())
21754
+ });
21755
+ var PublishCredentialRefreshInputValidator = external_exports.object({
21756
+ ...PublishCredentialRefreshBaseFields,
21757
+ mode: CredentialRefreshSigningModeValidator,
21758
+ signedCredential: VCValidator.optional(),
21759
+ credential: UnsignedVCValidator.optional(),
21760
+ signingAuthority: external_exports.object({
21761
+ type: external_exports.string().min(1)
21762
+ }).catchall(external_exports.any()).optional()
21763
+ }).superRefine((input, ctx) => {
21764
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
21765
+ ctx.addIssue({
21766
+ code: "custom",
21767
+ path: ["signedCredential"],
21768
+ message: "signedCredential is required for issuer-signed publication"
21769
+ });
21770
+ }
21771
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
21772
+ ctx.addIssue({
21773
+ code: "custom",
21774
+ path: ["mode"],
21775
+ message: "issuer-signed publication cannot include signing-authority fields"
21776
+ });
21777
+ }
21778
+ if (input.mode === "signing-authority") {
21779
+ if (input.signedCredential !== void 0) {
21780
+ ctx.addIssue({
21781
+ code: "custom",
21782
+ path: ["signedCredential"],
21783
+ message: "signing-authority publication cannot include signedCredential"
21784
+ });
21785
+ }
21786
+ if (!input.credential) {
21787
+ ctx.addIssue({
21788
+ code: "custom",
21789
+ path: ["credential"],
21790
+ message: "credential is required for signing-authority publication"
21791
+ });
21792
+ }
21793
+ if (!input.signingAuthority) {
21794
+ ctx.addIssue({
21795
+ code: "custom",
21796
+ path: ["signingAuthority"],
21797
+ message: "signingAuthority is required for signing-authority publication"
21798
+ });
21799
+ }
21800
+ }
21801
+ });
21802
+ var PublishCredentialRefreshNotificationValidator = external_exports.enum([
21803
+ "queued",
21804
+ "suppressed",
21805
+ "not-applicable",
21806
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
21807
+ "delivery-failed"
21808
+ ]);
21809
+ var PublishCredentialRefreshResultValidator = external_exports.object({
21810
+ refreshId: external_exports.string().min(1),
21811
+ version: external_exports.number().int().positive(),
21812
+ publishedAt: external_exports.string().min(1),
21813
+ notification: PublishCredentialRefreshNotificationValidator
21814
+ });
21815
+ var CredentialRefreshVersionMetadataValidator = external_exports.object({
21816
+ version: external_exports.number().int().positive(),
21817
+ publishedAt: external_exports.string().min(1),
21818
+ effectiveAt: external_exports.string().optional(),
21819
+ etag: external_exports.string().optional(),
21820
+ signingMode: CredentialRefreshSigningModeValidator.optional(),
21821
+ updateSummary: external_exports.string().optional()
21822
+ });
21823
+ var GetCredentialRefreshHistoryInputValidator = external_exports.object({
21824
+ refreshId: external_exports.string().min(1),
21825
+ cursor: external_exports.string().optional(),
21826
+ limit: external_exports.number().int().positive().optional()
21827
+ });
21828
+ var GetCredentialRefreshHistoryResultValidator = external_exports.object({
21829
+ records: CredentialRefreshVersionMetadataValidator.array(),
21830
+ hasMore: external_exports.boolean(),
21831
+ cursor: external_exports.string().optional()
21832
+ });
21833
+ var CredentialRefreshChallengeValidator = external_exports.object({
21834
+ challenge: external_exports.string().min(1),
21835
+ expiresAt: external_exports.string().min(1),
21836
+ domain: external_exports.string().optional(),
21837
+ scheme: external_exports.literal("LearnCardDIDAuth").optional()
21838
+ });
21839
+ var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
21840
+ format: external_exports.literal("vc"),
21841
+ credential: VCValidator,
21842
+ etag: external_exports.string().optional()
21843
+ });
21844
+ var JweCredentialRefreshEnvelopeValidator = external_exports.object({
21845
+ format: external_exports.literal("jwe"),
21846
+ jwe: JWEValidator,
21847
+ etag: external_exports.string().optional(),
21848
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
21849
+ version: external_exports.number().int().positive().optional()
21850
+ });
21851
+ var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
21852
+ PublicCredentialRefreshEnvelopeValidator,
21853
+ JweCredentialRefreshEnvelopeValidator
21854
+ ]);
21855
+ var CredentialRefreshFailureCodeValidator = external_exports.enum([
21856
+ "UNAVAILABLE",
21857
+ "TIMEOUT",
21858
+ "UNSUPPORTED_SERVICE",
21859
+ "UNAUTHORIZED",
21860
+ "MALFORMED_RESPONSE",
21861
+ "INVALID_PROOF",
21862
+ "ISSUER_MISMATCH",
21863
+ "ID_MISMATCH",
21864
+ "ROLLBACK",
21865
+ "REVOKED",
21866
+ "UNSAFE_ENDPOINT"
21867
+ ]);
21868
+ var CredentialRefreshUpdatedResultValidator = external_exports.object({
21869
+ status: external_exports.literal("updated"),
21870
+ credential: VCValidator,
21871
+ etag: external_exports.string().optional(),
21872
+ managedVersion: external_exports.number().int().positive().optional()
21873
+ });
21874
+ var CredentialRefreshUnchangedResultValidator = external_exports.object({
21875
+ status: external_exports.literal("unchanged"),
21876
+ checkedAt: external_exports.string().min(1),
21877
+ etag: external_exports.string().optional()
21878
+ });
21879
+ var CredentialRefreshUnsupportedResultValidator = external_exports.object({
21880
+ status: external_exports.literal("unsupported")
21881
+ });
21882
+ var CredentialRefreshFailedResultValidator = external_exports.object({
21883
+ status: external_exports.literal("failed"),
21884
+ code: CredentialRefreshFailureCodeValidator,
21885
+ retryable: external_exports.boolean()
21886
+ });
21887
+ var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
21888
+ CredentialRefreshUpdatedResultValidator,
21889
+ CredentialRefreshUnchangedResultValidator,
21890
+ CredentialRefreshUnsupportedResultValidator,
21891
+ CredentialRefreshFailedResultValidator
21892
+ ]);
21695
21893
  var LCNProfileDisplayValidator = external_exports.object({
21696
21894
  backgroundColor: external_exports.string().optional(),
21697
21895
  backgroundImage: external_exports.string().optional(),
@@ -22027,7 +22225,13 @@ var SendBoostInputValidator = external_exports.object({
22027
22225
  "Options for email/phone recipients (Universal Inbox)"
22028
22226
  ),
22029
22227
  templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
22030
- integrationId: external_exports.string().optional().describe("Integration ID for activity tracking")
22228
+ integrationId: external_exports.string().optional().describe("Integration ID for activity tracking"),
22229
+ refresh: external_exports.boolean().optional().describe(
22230
+ "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."
22231
+ ),
22232
+ idempotencyKey: external_exports.string().min(1).max(200).optional().describe(
22233
+ "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."
22234
+ )
22031
22235
  }).refine((data) => data.templateUri || data.template || data.signedCredential, {
22032
22236
  message: "Either templateUri, template, or signedCredential must be provided.",
22033
22237
  path: ["templateUri"]
@@ -22042,8 +22246,12 @@ var SendBoostInputValidator = external_exports.object({
22042
22246
  message: "guardianEmail must differ from recipient (self-approval not allowed)",
22043
22247
  path: ["options", "guardianEmail"]
22044
22248
  }
22045
- );
22249
+ ).refine((data) => !data.idempotencyKey || data.refresh === true, {
22250
+ message: "idempotencyKey is only supported with refresh: true.",
22251
+ path: ["idempotencyKey"]
22252
+ });
22046
22253
  var SendInboxResponseValidator = external_exports.object({
22254
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
22047
22255
  issuanceId: external_exports.string(),
22048
22256
  status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
22049
22257
  claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
@@ -22058,8 +22266,34 @@ var SendBoostResponseValidator = external_exports.object({
22058
22266
  activityId: external_exports.string().describe("Links to the activity lifecycle for this issuance"),
22059
22267
  inbox: SendInboxResponseValidator.optional().describe(
22060
22268
  "Present when sent via email/phone (Universal Inbox)"
22269
+ ),
22270
+ refresh: ManagedCredentialRefreshReceiptValidator.optional().describe(
22271
+ "Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
22061
22272
  )
22062
22273
  });
22274
+ var PrepareRefreshableSendInputValidator = external_exports.object({
22275
+ recipient: external_exports.string(),
22276
+ templateUri: external_exports.string().optional(),
22277
+ template: SendBoostTemplateValidator.optional(),
22278
+ contractUri: external_exports.string().optional(),
22279
+ templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
22280
+ integrationId: external_exports.string().optional(),
22281
+ /** Credential ID to allocate for; generated server-side when omitted. */
22282
+ credentialId: external_exports.string().min(1).optional(),
22283
+ idempotencyKey: external_exports.string().min(1).max(200).optional()
22284
+ }).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
22285
+ message: "Provide exactly one of templateUri or template."
22286
+ });
22287
+ var PrepareRefreshableSendResultValidator = external_exports.object({
22288
+ boostUri: external_exports.string(),
22289
+ credentialId: external_exports.string(),
22290
+ refreshId: external_exports.string(),
22291
+ refreshService: ManagedCredentialRefreshServiceValidator,
22292
+ /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
22293
+ holderDid: external_exports.string(),
22294
+ /** Present when this idempotencyKey already completed: return it without signing. */
22295
+ completed: SendBoostResponseValidator.optional()
22296
+ });
22063
22297
  var SendInputValidator = external_exports.discriminatedUnion("type", [SendBoostInputValidator]);
22064
22298
  var SendResponseValidator = external_exports.discriminatedUnion("type", [SendBoostResponseValidator]);
22065
22299
  var ConsentFlowTermsStatusValidator = external_exports.enum(["live", "stale", "withdrawn"]);
@@ -22390,6 +22624,7 @@ var AuthGrantValidator = external_exports.object({
22390
22624
  }, "error")
22391
22625
  }),
22392
22626
  scope: external_exports.string(),
22627
+ actAs: external_exports.string().optional(),
22393
22628
  createdAt: external_exports.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
22394
22629
  expiresAt: external_exports.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
22395
22630
  });
@@ -22461,6 +22696,8 @@ var CreateContactMethodSessionResponseValidator = external_exports.object({
22461
22696
  sessionJwt: external_exports.string()
22462
22697
  });
22463
22698
  var InboxCredentialValidator = external_exports.object({
22699
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
22700
+ refreshId: external_exports.string().optional(),
22464
22701
  id: external_exports.string(),
22465
22702
  credential: external_exports.string().optional(),
22466
22703
  isSigned: external_exports.boolean(),
@@ -22515,12 +22752,19 @@ var IssueInboxCredentialValidator = external_exports.object({
22515
22752
  templateUri: external_exports.string().optional().describe(
22516
22753
  "URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
22517
22754
  ),
22755
+ refresh: external_exports.boolean().optional().describe(
22756
+ "Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
22757
+ ),
22758
+ idempotencyKey: external_exports.string().min(1).max(200).optional(),
22518
22759
  // === OPTIONAL FEATURES ===
22519
22760
  // Add major, distinct features at the top level.
22520
22761
  //consentRequest: ConsentRequestValidator.optional(),
22521
22762
  // === PROCESS CONFIGURATION (Optional) ===
22522
22763
  // HOW should this issuance be handled?
22523
22764
  configuration: external_exports.object({
22765
+ guardianEmail: external_exports.string().email().optional().describe(
22766
+ "Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
22767
+ ),
22524
22768
  signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
22525
22769
  "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."
22526
22770
  ),
@@ -22574,17 +22818,130 @@ var IssueInboxCredentialValidator = external_exports.object({
22574
22818
  }).optional().describe(
22575
22819
  "Configuration for the credential issuance. If not provided, the default configuration will be used."
22576
22820
  )
22821
+ }).refine((data) => !data.idempotencyKey || data.refresh === true, {
22822
+ message: "idempotencyKey requires refresh: true."
22577
22823
  }).refine((data) => data.credential || data.templateUri, {
22578
22824
  message: "Either credential or templateUri must be provided.",
22579
22825
  path: ["credential"]
22580
- });
22826
+ }).refine(
22827
+ (data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
22828
+ {
22829
+ message: "guardianEmail must differ from recipient (self-approval not allowed)",
22830
+ path: ["configuration", "guardianEmail"]
22831
+ }
22832
+ );
22581
22833
  var IssueInboxCredentialResponseValidator = external_exports.object({
22834
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
22582
22835
  issuanceId: external_exports.string(),
22583
22836
  status: LCNInboxStatusEnumValidator,
22584
22837
  recipient: ContactMethodQueryValidator,
22585
22838
  claimUrl: external_exports.string().url().optional(),
22586
22839
  recipientDid: external_exports.string().optional()
22587
22840
  });
22841
+ var InboxBatchConfigurationValidator = IssueInboxCredentialValidator.shape.configuration.unwrap().extend({
22842
+ refresh: IssueInboxCredentialValidator.shape.refresh.describe(
22843
+ "Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
22844
+ ),
22845
+ delivery: IssueInboxCredentialValidator.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports.boolean().optional() }).optional()
22846
+ });
22847
+ var InboxBatchItemConfigurationValidator = InboxBatchConfigurationValidator.extend({
22848
+ guardianEmail: InboxBatchConfigurationValidator.shape.guardianEmail.nullable().describe(
22849
+ "Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
22850
+ )
22851
+ });
22852
+ var IssueInboxCredentialBatchItemValidator = external_exports.object({
22853
+ ...IssueInboxCredentialValidator.shape,
22854
+ configuration: InboxBatchItemConfigurationValidator.optional(),
22855
+ idempotencyKey: external_exports.string().max(256).optional()
22856
+ }).refine((data) => data.credential || data.templateUri, {
22857
+ message: "Either credential or templateUri must be provided.",
22858
+ path: ["credential"]
22859
+ }).describe(
22860
+ "One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
22861
+ );
22862
+ var IssueInboxCredentialBatchValidator = external_exports.object({
22863
+ requestId: external_exports.string().min(1).max(256).optional(),
22864
+ items: external_exports.array(IssueInboxCredentialBatchItemValidator).min(1).max(100),
22865
+ configuration: InboxBatchConfigurationValidator.optional()
22866
+ }).superRefine((batch, ctx) => {
22867
+ batch.items.forEach((item, index) => {
22868
+ const itemGuardian = item.configuration?.guardianEmail;
22869
+ const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
22870
+ if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
22871
+ ctx.addIssue({
22872
+ code: "custom",
22873
+ path: ["items", index, "configuration", "guardianEmail"],
22874
+ message: "guardianEmail must differ from recipient (self-approval not allowed)"
22875
+ });
22876
+ }
22877
+ });
22878
+ });
22879
+ var InboxBatchErrorReasonValidator = external_exports.enum([
22880
+ "DUPLICATE_KEY",
22881
+ "IDEMPOTENCY_MISMATCH",
22882
+ "IN_PROGRESS",
22883
+ "UNCONFIRMED"
22884
+ ]);
22885
+ var IssueInboxCredentialBatchItemResultValidator = external_exports.discriminatedUnion("success", [
22886
+ IssueInboxCredentialResponseValidator.extend({
22887
+ success: external_exports.literal(true),
22888
+ index: external_exports.number().int().nonnegative(),
22889
+ deduplicated: external_exports.boolean().optional(),
22890
+ guardianStatus: GuardianStatusValidator.optional(),
22891
+ idempotencyKey: external_exports.string().optional()
22892
+ }),
22893
+ external_exports.object({
22894
+ success: external_exports.literal(false),
22895
+ index: external_exports.number().int().nonnegative(),
22896
+ idempotencyKey: external_exports.string().optional(),
22897
+ recipient: ContactMethodQueryValidator.optional(),
22898
+ error: external_exports.object({
22899
+ code: external_exports.string(),
22900
+ message: external_exports.string(),
22901
+ reason: InboxBatchErrorReasonValidator.optional()
22902
+ }),
22903
+ issuanceId: external_exports.string().optional().describe(
22904
+ "Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
22905
+ ),
22906
+ claimUrl: external_exports.string().url().optional().describe(
22907
+ "Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
22908
+ )
22909
+ })
22910
+ ]);
22911
+ var IssueInboxCredentialBatchResponseValidator = external_exports.object({
22912
+ results: external_exports.array(IssueInboxCredentialBatchItemResultValidator),
22913
+ summary: external_exports.object({
22914
+ total: external_exports.number(),
22915
+ succeeded: external_exports.number(),
22916
+ failed: external_exports.number(),
22917
+ deduplicated: external_exports.number()
22918
+ })
22919
+ });
22920
+ var InboxBatchReceiptValidator = external_exports.object({
22921
+ batchId: external_exports.string(),
22922
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
22923
+ createdAt: external_exports.string()
22924
+ });
22925
+ var InboxBatchStatusValidator = external_exports.object({
22926
+ batchId: external_exports.string(),
22927
+ createdAt: external_exports.string(),
22928
+ done: external_exports.boolean().describe(
22929
+ "True when no queued or processing items remain, including unconfirmed outcomes."
22930
+ ),
22931
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
22932
+ items: external_exports.array(
22933
+ external_exports.object({
22934
+ index: external_exports.number().int().nonnegative(),
22935
+ state: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
22936
+ result: IssueInboxCredentialBatchItemResultValidator.optional()
22937
+ })
22938
+ ),
22939
+ summary: IssueInboxCredentialBatchResponseValidator.shape.summary.extend({
22940
+ completed: external_exports.number(),
22941
+ pending: external_exports.number(),
22942
+ unconfirmed: external_exports.number()
22943
+ })
22944
+ });
22588
22945
  var CredentialNameRefValidator = external_exports.object({ name: external_exports.string() }).passthrough();
22589
22946
  var ClaimInboxCredentialValidator = external_exports.object({
22590
22947
  credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
@@ -23070,6 +23427,7 @@ var CredentialActivityValidator = external_exports.object({
23070
23427
  eventType: CredentialActivityEventTypeValidator,
23071
23428
  timestamp: external_exports.string(),
23072
23429
  actorProfileId: external_exports.string().optional(),
23430
+ onBehalfOf: external_exports.string().optional(),
23073
23431
  recipientType: CredentialActivityRecipientTypeValidator,
23074
23432
  recipientIdentifier: external_exports.string(),
23075
23433
  boostUri: external_exports.string().optional(),
@@ -23219,191 +23577,6 @@ var inAppMessagesFlagValidator = external_exports.object({
23219
23577
  version: external_exports.number().default(1),
23220
23578
  messages: external_exports.array(inAppMessageValidator).default([])
23221
23579
  }).passthrough();
23222
- var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
23223
- var ManagedCredentialRefreshServiceValidator = external_exports.object({
23224
- id: external_exports.string().min(1),
23225
- type: external_exports.literal("LearnCardCredentialRefresh2026"),
23226
- authorization: LearnCardRefreshAuthorizationValidator.optional()
23227
- }).catchall(external_exports.any());
23228
- var StandardCredentialRefreshServiceValidator = external_exports.object({
23229
- id: external_exports.string().min(1),
23230
- type: external_exports.literal("1EdTechCredentialRefresh")
23231
- }).catchall(external_exports.any());
23232
- var SupportedCredentialRefreshServiceValidator = external_exports.union([
23233
- ManagedCredentialRefreshServiceValidator,
23234
- StandardCredentialRefreshServiceValidator
23235
- ]);
23236
- var AllocateCredentialRefreshInputValidator = external_exports.object({
23237
- holder: external_exports.object({
23238
- profileId: external_exports.string().optional(),
23239
- did: external_exports.string().min(1)
23240
- }),
23241
- credentialId: external_exports.string().min(1)
23242
- });
23243
- var AllocateCredentialRefreshResultValidator = external_exports.object({
23244
- refreshId: external_exports.string().min(1),
23245
- refreshService: ManagedCredentialRefreshServiceValidator.extend({
23246
- authorization: LearnCardRefreshAuthorizationValidator
23247
- })
23248
- });
23249
- var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
23250
- var PublishCredentialRefreshBaseFields = {
23251
- refreshId: external_exports.string().min(1),
23252
- notifyHolder: external_exports.boolean().optional(),
23253
- updateSummary: external_exports.string().optional(),
23254
- idempotencyKey: external_exports.string().optional()
23255
- };
23256
- var PublishIssuerSignedRefreshValidator = external_exports.object({
23257
- ...PublishCredentialRefreshBaseFields,
23258
- mode: external_exports.literal("issuer-signed"),
23259
- signedCredential: VCValidator
23260
- });
23261
- var PublishSigningAuthorityRefreshValidator = external_exports.object({
23262
- ...PublishCredentialRefreshBaseFields,
23263
- mode: external_exports.literal("signing-authority"),
23264
- credential: UnsignedVCValidator,
23265
- signingAuthority: external_exports.object({
23266
- type: external_exports.string().min(1)
23267
- }).catchall(external_exports.any())
23268
- });
23269
- var PublishCredentialRefreshInputValidator = external_exports.object({
23270
- ...PublishCredentialRefreshBaseFields,
23271
- mode: CredentialRefreshSigningModeValidator,
23272
- signedCredential: VCValidator.optional(),
23273
- credential: UnsignedVCValidator.optional(),
23274
- signingAuthority: external_exports.object({
23275
- type: external_exports.string().min(1)
23276
- }).catchall(external_exports.any()).optional()
23277
- }).superRefine((input, ctx) => {
23278
- if (input.mode === "issuer-signed" && !input.signedCredential) {
23279
- ctx.addIssue({
23280
- code: "custom",
23281
- path: ["signedCredential"],
23282
- message: "signedCredential is required for issuer-signed publication"
23283
- });
23284
- }
23285
- if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
23286
- ctx.addIssue({
23287
- code: "custom",
23288
- path: ["mode"],
23289
- message: "issuer-signed publication cannot include signing-authority fields"
23290
- });
23291
- }
23292
- if (input.mode === "signing-authority") {
23293
- if (input.signedCredential !== void 0) {
23294
- ctx.addIssue({
23295
- code: "custom",
23296
- path: ["signedCredential"],
23297
- message: "signing-authority publication cannot include signedCredential"
23298
- });
23299
- }
23300
- if (!input.credential) {
23301
- ctx.addIssue({
23302
- code: "custom",
23303
- path: ["credential"],
23304
- message: "credential is required for signing-authority publication"
23305
- });
23306
- }
23307
- if (!input.signingAuthority) {
23308
- ctx.addIssue({
23309
- code: "custom",
23310
- path: ["signingAuthority"],
23311
- message: "signingAuthority is required for signing-authority publication"
23312
- });
23313
- }
23314
- }
23315
- });
23316
- var PublishCredentialRefreshNotificationValidator = external_exports.enum([
23317
- "queued",
23318
- "suppressed",
23319
- "not-applicable",
23320
- /** Publication succeeded, but the post-commit notification enqueue must be retried. */
23321
- "delivery-failed"
23322
- ]);
23323
- var PublishCredentialRefreshResultValidator = external_exports.object({
23324
- refreshId: external_exports.string().min(1),
23325
- version: external_exports.number().int().positive(),
23326
- publishedAt: external_exports.string().min(1),
23327
- notification: PublishCredentialRefreshNotificationValidator
23328
- });
23329
- var CredentialRefreshVersionMetadataValidator = external_exports.object({
23330
- version: external_exports.number().int().positive(),
23331
- publishedAt: external_exports.string().min(1),
23332
- effectiveAt: external_exports.string().optional(),
23333
- etag: external_exports.string().optional(),
23334
- signingMode: CredentialRefreshSigningModeValidator.optional(),
23335
- updateSummary: external_exports.string().optional()
23336
- });
23337
- var GetCredentialRefreshHistoryInputValidator = external_exports.object({
23338
- refreshId: external_exports.string().min(1),
23339
- cursor: external_exports.string().optional(),
23340
- limit: external_exports.number().int().positive().optional()
23341
- });
23342
- var GetCredentialRefreshHistoryResultValidator = external_exports.object({
23343
- records: CredentialRefreshVersionMetadataValidator.array(),
23344
- hasMore: external_exports.boolean(),
23345
- cursor: external_exports.string().optional()
23346
- });
23347
- var CredentialRefreshChallengeValidator = external_exports.object({
23348
- challenge: external_exports.string().min(1),
23349
- expiresAt: external_exports.string().min(1),
23350
- domain: external_exports.string().optional(),
23351
- scheme: external_exports.literal("LearnCardDIDAuth").optional()
23352
- });
23353
- var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
23354
- format: external_exports.literal("vc"),
23355
- credential: VCValidator,
23356
- etag: external_exports.string().optional()
23357
- });
23358
- var JweCredentialRefreshEnvelopeValidator = external_exports.object({
23359
- format: external_exports.literal("jwe"),
23360
- jwe: JWEValidator,
23361
- etag: external_exports.string().optional(),
23362
- /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
23363
- version: external_exports.number().int().positive().optional()
23364
- });
23365
- var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
23366
- PublicCredentialRefreshEnvelopeValidator,
23367
- JweCredentialRefreshEnvelopeValidator
23368
- ]);
23369
- var CredentialRefreshFailureCodeValidator = external_exports.enum([
23370
- "UNAVAILABLE",
23371
- "TIMEOUT",
23372
- "UNSUPPORTED_SERVICE",
23373
- "UNAUTHORIZED",
23374
- "MALFORMED_RESPONSE",
23375
- "INVALID_PROOF",
23376
- "ISSUER_MISMATCH",
23377
- "ID_MISMATCH",
23378
- "ROLLBACK",
23379
- "REVOKED",
23380
- "UNSAFE_ENDPOINT"
23381
- ]);
23382
- var CredentialRefreshUpdatedResultValidator = external_exports.object({
23383
- status: external_exports.literal("updated"),
23384
- credential: VCValidator,
23385
- etag: external_exports.string().optional(),
23386
- managedVersion: external_exports.number().int().positive().optional()
23387
- });
23388
- var CredentialRefreshUnchangedResultValidator = external_exports.object({
23389
- status: external_exports.literal("unchanged"),
23390
- checkedAt: external_exports.string().min(1),
23391
- etag: external_exports.string().optional()
23392
- });
23393
- var CredentialRefreshUnsupportedResultValidator = external_exports.object({
23394
- status: external_exports.literal("unsupported")
23395
- });
23396
- var CredentialRefreshFailedResultValidator = external_exports.object({
23397
- status: external_exports.literal("failed"),
23398
- code: CredentialRefreshFailureCodeValidator,
23399
- retryable: external_exports.boolean()
23400
- });
23401
- var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
23402
- CredentialRefreshUpdatedResultValidator,
23403
- CredentialRefreshUnchangedResultValidator,
23404
- CredentialRefreshUnsupportedResultValidator,
23405
- CredentialRefreshFailedResultValidator
23406
- ]);
23407
23580
 
23408
23581
  // src/helpers.ts
23409
23582
  var import_json_stringify_deterministic = __toESM(require_lib(), 1);