@learncard/render-method-plugin 7.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15982,6 +15982,7 @@ var require_types_cjs_development = __commonJS({
15982
15982
  var __toCommonJS2 = /* @__PURE__ */ __name2((mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod), "__toCommonJS");
15983
15983
  var index_exports2 = {};
15984
15984
  __export22(index_exports2, {
15985
+ ACT_AS_HEADER: /* @__PURE__ */ __name2(() => ACT_AS_HEADER, "ACT_AS_HEADER"),
15985
15986
  AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: /* @__PURE__ */ __name2(() => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2, "AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX"),
15986
15987
  AchievementCredentialValidator: /* @__PURE__ */ __name2(() => AchievementCredentialValidator2, "AchievementCredentialValidator"),
15987
15988
  AchievementCriteriaValidator: /* @__PURE__ */ __name2(() => AchievementCriteriaValidator2, "AchievementCriteriaValidator"),
@@ -16121,10 +16122,18 @@ var require_types_cjs_development = __commonJS({
16121
16122
  IdentifierTypeValidator: /* @__PURE__ */ __name2(() => IdentifierTypeValidator2, "IdentifierTypeValidator"),
16122
16123
  IdentityObjectValidator: /* @__PURE__ */ __name2(() => IdentityObjectValidator2, "IdentityObjectValidator"),
16123
16124
  ImageValidator: /* @__PURE__ */ __name2(() => ImageValidator2, "ImageValidator"),
16125
+ InboxBatchErrorReasonValidator: /* @__PURE__ */ __name2(() => InboxBatchErrorReasonValidator2, "InboxBatchErrorReasonValidator"),
16126
+ InboxBatchReceiptValidator: /* @__PURE__ */ __name2(() => InboxBatchReceiptValidator2, "InboxBatchReceiptValidator"),
16127
+ InboxBatchStatusValidator: /* @__PURE__ */ __name2(() => InboxBatchStatusValidator2, "InboxBatchStatusValidator"),
16124
16128
  InboxCredentialQueryValidator: /* @__PURE__ */ __name2(() => InboxCredentialQueryValidator2, "InboxCredentialQueryValidator"),
16129
+ InboxCredentialRefreshReceiptValidator: /* @__PURE__ */ __name2(() => InboxCredentialRefreshReceiptValidator2, "InboxCredentialRefreshReceiptValidator"),
16125
16130
  InboxCredentialValidator: /* @__PURE__ */ __name2(() => InboxCredentialValidator2, "InboxCredentialValidator"),
16126
16131
  IncrementCounterEventValidator: /* @__PURE__ */ __name2(() => IncrementCounterEventValidator2, "IncrementCounterEventValidator"),
16127
16132
  InstalledAppValidator: /* @__PURE__ */ __name2(() => InstalledAppValidator2, "InstalledAppValidator"),
16133
+ IssueInboxCredentialBatchItemResultValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchItemResultValidator2, "IssueInboxCredentialBatchItemResultValidator"),
16134
+ IssueInboxCredentialBatchItemValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchItemValidator2, "IssueInboxCredentialBatchItemValidator"),
16135
+ IssueInboxCredentialBatchResponseValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchResponseValidator2, "IssueInboxCredentialBatchResponseValidator"),
16136
+ IssueInboxCredentialBatchValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchValidator2, "IssueInboxCredentialBatchValidator"),
16128
16137
  IssueInboxCredentialResponseValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialResponseValidator2, "IssueInboxCredentialResponseValidator"),
16129
16138
  IssueInboxCredentialValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialValidator2, "IssueInboxCredentialValidator"),
16130
16139
  IssueInboxSigningAuthorityValidator: /* @__PURE__ */ __name2(() => IssueInboxSigningAuthorityValidator2, "IssueInboxSigningAuthorityValidator"),
@@ -16173,6 +16182,7 @@ var require_types_cjs_development = __commonJS({
16173
16182
  LaunchTypeValidator: /* @__PURE__ */ __name2(() => LaunchTypeValidator2, "LaunchTypeValidator"),
16174
16183
  LearnCardRefreshAuthorizationValidator: /* @__PURE__ */ __name2(() => LearnCardRefreshAuthorizationValidator2, "LearnCardRefreshAuthorizationValidator"),
16175
16184
  LinkProviderFrameworkInputValidator: /* @__PURE__ */ __name2(() => LinkProviderFrameworkInputValidator2, "LinkProviderFrameworkInputValidator"),
16185
+ ManagedCredentialRefreshReceiptValidator: /* @__PURE__ */ __name2(() => ManagedCredentialRefreshReceiptValidator2, "ManagedCredentialRefreshReceiptValidator"),
16176
16186
  ManagedCredentialRefreshServiceValidator: /* @__PURE__ */ __name2(() => ManagedCredentialRefreshServiceValidator2, "ManagedCredentialRefreshServiceValidator"),
16177
16187
  PaginatedAppStoreListingsValidator: /* @__PURE__ */ __name2(() => PaginatedAppStoreListingsValidator2, "PaginatedAppStoreListingsValidator"),
16178
16188
  PaginatedBoostRecipientsValidator: /* @__PURE__ */ __name2(() => PaginatedBoostRecipientsValidator2, "PaginatedBoostRecipientsValidator"),
@@ -16199,6 +16209,8 @@ var require_types_cjs_development = __commonJS({
16199
16209
  PaginatedVisibleLCNProfilesValidator: /* @__PURE__ */ __name2(() => PaginatedVisibleLCNProfilesValidator2, "PaginatedVisibleLCNProfilesValidator"),
16200
16210
  PaginationOptionsValidator: /* @__PURE__ */ __name2(() => PaginationOptionsValidator2, "PaginationOptionsValidator"),
16201
16211
  PaginationResponseValidator: /* @__PURE__ */ __name2(() => PaginationResponseValidator2, "PaginationResponseValidator"),
16212
+ PrepareRefreshableSendInputValidator: /* @__PURE__ */ __name2(() => PrepareRefreshableSendInputValidator2, "PrepareRefreshableSendInputValidator"),
16213
+ PrepareRefreshableSendResultValidator: /* @__PURE__ */ __name2(() => PrepareRefreshableSendResultValidator2, "PrepareRefreshableSendResultValidator"),
16202
16214
  ProfileValidator: /* @__PURE__ */ __name2(() => ProfileValidator2, "ProfileValidator"),
16203
16215
  ProfileVisibilityEnum: /* @__PURE__ */ __name2(() => ProfileVisibilityEnum2, "ProfileVisibilityEnum"),
16204
16216
  PromotionLevelValidator: /* @__PURE__ */ __name2(() => PromotionLevelValidator2, "PromotionLevelValidator"),
@@ -16224,6 +16236,7 @@ var require_types_cjs_development = __commonJS({
16224
16236
  SendAiSessionCredentialEventValidator: /* @__PURE__ */ __name2(() => SendAiSessionCredentialEventValidator2, "SendAiSessionCredentialEventValidator"),
16225
16237
  SendBoostInputValidator: /* @__PURE__ */ __name2(() => SendBoostInputValidator2, "SendBoostInputValidator"),
16226
16238
  SendBoostResponseValidator: /* @__PURE__ */ __name2(() => SendBoostResponseValidator2, "SendBoostResponseValidator"),
16239
+ SendBoostTemplateValidator: /* @__PURE__ */ __name2(() => SendBoostTemplateValidator2, "SendBoostTemplateValidator"),
16227
16240
  SendBrandingOptionsValidator: /* @__PURE__ */ __name2(() => SendBrandingOptionsValidator2, "SendBrandingOptionsValidator"),
16228
16241
  SendCredentialEventValidator: /* @__PURE__ */ __name2(() => SendCredentialEventValidator2, "SendCredentialEventValidator"),
16229
16242
  SendInboxResponseValidator: /* @__PURE__ */ __name2(() => SendInboxResponseValidator2, "SendInboxResponseValidator"),
@@ -16943,7 +16956,7 @@ var require_types_cjs_development = __commonJS({
16943
16956
  getSizableOrigin: /* @__PURE__ */ __name2(() => getSizableOrigin2, "getSizableOrigin"),
16944
16957
  hexToUint8Array: /* @__PURE__ */ __name2(() => hexToUint8Array2, "hexToUint8Array"),
16945
16958
  isObject: /* @__PURE__ */ __name2(() => isObject2, "isObject"),
16946
- isPlainObject: /* @__PURE__ */ __name2(() => isPlainObject3, "isPlainObject"),
16959
+ isPlainObject: /* @__PURE__ */ __name2(() => isPlainObject22, "isPlainObject"),
16947
16960
  issue: /* @__PURE__ */ __name2(() => issue2, "issue"),
16948
16961
  joinValues: /* @__PURE__ */ __name2(() => joinValues2, "joinValues"),
16949
16962
  jsonStringifyReplacer: /* @__PURE__ */ __name2(() => jsonStringifyReplacer2, "jsonStringifyReplacer"),
@@ -17192,7 +17205,7 @@ var require_types_cjs_development = __commonJS({
17192
17205
  return false;
17193
17206
  }
17194
17207
  });
17195
- function isPlainObject3(o) {
17208
+ function isPlainObject22(o) {
17196
17209
  if (isObject2(o) === false)
17197
17210
  return false;
17198
17211
  const ctor = o.constructor;
@@ -17208,11 +17221,11 @@ var require_types_cjs_development = __commonJS({
17208
17221
  }
17209
17222
  return true;
17210
17223
  }
17211
- __name(isPlainObject3, "isPlainObject");
17212
- __name2(isPlainObject3, "isPlainObject");
17213
- __name22(isPlainObject3, "isPlainObject");
17224
+ __name(isPlainObject22, "isPlainObject2");
17225
+ __name2(isPlainObject22, "isPlainObject");
17226
+ __name22(isPlainObject22, "isPlainObject");
17214
17227
  function shallowClone2(o) {
17215
- if (isPlainObject3(o))
17228
+ if (isPlainObject22(o))
17216
17229
  return { ...o };
17217
17230
  if (Array.isArray(o))
17218
17231
  return [...o];
@@ -17446,7 +17459,7 @@ var require_types_cjs_development = __commonJS({
17446
17459
  __name2(omit2, "omit");
17447
17460
  __name22(omit2, "omit");
17448
17461
  function extend2(schema, shape) {
17449
- if (!isPlainObject3(shape)) {
17462
+ if (!isPlainObject22(shape)) {
17450
17463
  throw new Error("Invalid input to extend: expected a plain object");
17451
17464
  }
17452
17465
  const checks = schema._zod.def.checks;
@@ -17472,7 +17485,7 @@ var require_types_cjs_development = __commonJS({
17472
17485
  __name2(extend2, "extend");
17473
17486
  __name22(extend2, "extend");
17474
17487
  function safeExtend2(schema, shape) {
17475
- if (!isPlainObject3(shape)) {
17488
+ if (!isPlainObject22(shape)) {
17476
17489
  throw new Error("Invalid input to safeExtend: expected a plain object");
17477
17490
  }
17478
17491
  const def = mergeDefs2(schema._zod.def, {
@@ -19928,7 +19941,7 @@ var require_types_cjs_development = __commonJS({
19928
19941
  if (a instanceof Date && b instanceof Date && +a === +b) {
19929
19942
  return { valid: true, data: a };
19930
19943
  }
19931
- if (isPlainObject3(a) && isPlainObject3(b)) {
19944
+ if (isPlainObject22(a) && isPlainObject22(b)) {
19932
19945
  const bKeys = Object.keys(b);
19933
19946
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
19934
19947
  const newObj = { ...a, ...b };
@@ -20129,7 +20142,7 @@ var require_types_cjs_development = __commonJS({
20129
20142
  $ZodType2.init(inst, def);
20130
20143
  inst._zod.parse = (payload, ctx) => {
20131
20144
  const input = payload.value;
20132
- if (!isPlainObject3(input)) {
20145
+ if (!isPlainObject22(input)) {
20133
20146
  payload.issues.push({
20134
20147
  expected: "record",
20135
20148
  code: "invalid_type",
@@ -32541,6 +32554,204 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32541
32554
  $or: BaseStringQuery2.array()
32542
32555
  })
32543
32556
  ]);
32557
+ var LearnCardRefreshAuthorizationValidator2 = external_exports2.object({ type: external_exports2.literal("LearnCardDIDAuth") }).catchall(external_exports2.any());
32558
+ var ManagedCredentialRefreshServiceValidator2 = external_exports2.object({
32559
+ id: external_exports2.string().min(1),
32560
+ type: external_exports2.literal("LearnCardCredentialRefresh2026"),
32561
+ authorization: LearnCardRefreshAuthorizationValidator2.optional()
32562
+ }).catchall(external_exports2.any());
32563
+ var StandardCredentialRefreshServiceValidator2 = external_exports2.object({
32564
+ id: external_exports2.string().min(1),
32565
+ type: external_exports2.literal("1EdTechCredentialRefresh")
32566
+ }).catchall(external_exports2.any());
32567
+ var SupportedCredentialRefreshServiceValidator2 = external_exports2.union([
32568
+ ManagedCredentialRefreshServiceValidator2,
32569
+ StandardCredentialRefreshServiceValidator2
32570
+ ]);
32571
+ var AllocateCredentialRefreshInputValidator2 = external_exports2.object({
32572
+ holder: external_exports2.object({
32573
+ profileId: external_exports2.string().optional(),
32574
+ did: external_exports2.string().min(1)
32575
+ }),
32576
+ credentialId: external_exports2.string().min(1)
32577
+ });
32578
+ var AllocateCredentialRefreshResultValidator2 = external_exports2.object({
32579
+ refreshId: external_exports2.string().min(1),
32580
+ refreshService: ManagedCredentialRefreshServiceValidator2.extend({
32581
+ authorization: LearnCardRefreshAuthorizationValidator2
32582
+ })
32583
+ });
32584
+ var ManagedCredentialRefreshReceiptValidator2 = external_exports2.object({
32585
+ refreshId: external_exports2.string().min(1),
32586
+ refreshService: ManagedCredentialRefreshServiceValidator2,
32587
+ credentialId: external_exports2.string().min(1),
32588
+ issuerDid: external_exports2.string().min(1),
32589
+ holderDid: external_exports2.string().min(1),
32590
+ credentialStatus: CredentialStatusValidator2.or(
32591
+ CredentialStatusValidator2.array()
32592
+ ).optional()
32593
+ }).strip();
32594
+ var InboxCredentialRefreshReceiptValidator2 = ManagedCredentialRefreshReceiptValidator2.omit(
32595
+ { holderDid: true }
32596
+ ).extend({ holderDid: external_exports2.string().min(1).optional() });
32597
+ var CredentialRefreshSigningModeValidator2 = external_exports2.enum(["issuer-signed", "signing-authority"]);
32598
+ var PublishCredentialRefreshBaseFields2 = {
32599
+ refreshId: external_exports2.string().min(1),
32600
+ notifyHolder: external_exports2.boolean().optional(),
32601
+ updateSummary: external_exports2.string().optional(),
32602
+ idempotencyKey: external_exports2.string().optional()
32603
+ };
32604
+ var PublishIssuerSignedRefreshValidator2 = external_exports2.object({
32605
+ ...PublishCredentialRefreshBaseFields2,
32606
+ mode: external_exports2.literal("issuer-signed"),
32607
+ signedCredential: VCValidator2
32608
+ });
32609
+ var PublishSigningAuthorityRefreshValidator2 = external_exports2.object({
32610
+ ...PublishCredentialRefreshBaseFields2,
32611
+ mode: external_exports2.literal("signing-authority"),
32612
+ credential: UnsignedVCValidator2,
32613
+ signingAuthority: external_exports2.object({
32614
+ type: external_exports2.string().min(1)
32615
+ }).catchall(external_exports2.any())
32616
+ });
32617
+ var PublishCredentialRefreshInputValidator2 = external_exports2.object({
32618
+ ...PublishCredentialRefreshBaseFields2,
32619
+ mode: CredentialRefreshSigningModeValidator2,
32620
+ signedCredential: VCValidator2.optional(),
32621
+ credential: UnsignedVCValidator2.optional(),
32622
+ signingAuthority: external_exports2.object({
32623
+ type: external_exports2.string().min(1)
32624
+ }).catchall(external_exports2.any()).optional()
32625
+ }).superRefine((input, ctx) => {
32626
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
32627
+ ctx.addIssue({
32628
+ code: "custom",
32629
+ path: ["signedCredential"],
32630
+ message: "signedCredential is required for issuer-signed publication"
32631
+ });
32632
+ }
32633
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
32634
+ ctx.addIssue({
32635
+ code: "custom",
32636
+ path: ["mode"],
32637
+ message: "issuer-signed publication cannot include signing-authority fields"
32638
+ });
32639
+ }
32640
+ if (input.mode === "signing-authority") {
32641
+ if (input.signedCredential !== void 0) {
32642
+ ctx.addIssue({
32643
+ code: "custom",
32644
+ path: ["signedCredential"],
32645
+ message: "signing-authority publication cannot include signedCredential"
32646
+ });
32647
+ }
32648
+ if (!input.credential) {
32649
+ ctx.addIssue({
32650
+ code: "custom",
32651
+ path: ["credential"],
32652
+ message: "credential is required for signing-authority publication"
32653
+ });
32654
+ }
32655
+ if (!input.signingAuthority) {
32656
+ ctx.addIssue({
32657
+ code: "custom",
32658
+ path: ["signingAuthority"],
32659
+ message: "signingAuthority is required for signing-authority publication"
32660
+ });
32661
+ }
32662
+ }
32663
+ });
32664
+ var PublishCredentialRefreshNotificationValidator2 = external_exports2.enum([
32665
+ "queued",
32666
+ "suppressed",
32667
+ "not-applicable",
32668
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
32669
+ "delivery-failed"
32670
+ ]);
32671
+ var PublishCredentialRefreshResultValidator2 = external_exports2.object({
32672
+ refreshId: external_exports2.string().min(1),
32673
+ version: external_exports2.number().int().positive(),
32674
+ publishedAt: external_exports2.string().min(1),
32675
+ notification: PublishCredentialRefreshNotificationValidator2
32676
+ });
32677
+ var CredentialRefreshVersionMetadataValidator2 = external_exports2.object({
32678
+ version: external_exports2.number().int().positive(),
32679
+ publishedAt: external_exports2.string().min(1),
32680
+ effectiveAt: external_exports2.string().optional(),
32681
+ etag: external_exports2.string().optional(),
32682
+ signingMode: CredentialRefreshSigningModeValidator2.optional(),
32683
+ updateSummary: external_exports2.string().optional()
32684
+ });
32685
+ var GetCredentialRefreshHistoryInputValidator2 = external_exports2.object({
32686
+ refreshId: external_exports2.string().min(1),
32687
+ cursor: external_exports2.string().optional(),
32688
+ limit: external_exports2.number().int().positive().optional()
32689
+ });
32690
+ var GetCredentialRefreshHistoryResultValidator2 = external_exports2.object({
32691
+ records: CredentialRefreshVersionMetadataValidator2.array(),
32692
+ hasMore: external_exports2.boolean(),
32693
+ cursor: external_exports2.string().optional()
32694
+ });
32695
+ var CredentialRefreshChallengeValidator2 = external_exports2.object({
32696
+ challenge: external_exports2.string().min(1),
32697
+ expiresAt: external_exports2.string().min(1),
32698
+ domain: external_exports2.string().optional(),
32699
+ scheme: external_exports2.literal("LearnCardDIDAuth").optional()
32700
+ });
32701
+ var PublicCredentialRefreshEnvelopeValidator2 = external_exports2.object({
32702
+ format: external_exports2.literal("vc"),
32703
+ credential: VCValidator2,
32704
+ etag: external_exports2.string().optional()
32705
+ });
32706
+ var JweCredentialRefreshEnvelopeValidator2 = external_exports2.object({
32707
+ format: external_exports2.literal("jwe"),
32708
+ jwe: JWEValidator2,
32709
+ etag: external_exports2.string().optional(),
32710
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
32711
+ version: external_exports2.number().int().positive().optional()
32712
+ });
32713
+ var CredentialRefreshResponseEnvelopeValidator2 = external_exports2.discriminatedUnion("format", [
32714
+ PublicCredentialRefreshEnvelopeValidator2,
32715
+ JweCredentialRefreshEnvelopeValidator2
32716
+ ]);
32717
+ var CredentialRefreshFailureCodeValidator2 = external_exports2.enum([
32718
+ "UNAVAILABLE",
32719
+ "TIMEOUT",
32720
+ "UNSUPPORTED_SERVICE",
32721
+ "UNAUTHORIZED",
32722
+ "MALFORMED_RESPONSE",
32723
+ "INVALID_PROOF",
32724
+ "ISSUER_MISMATCH",
32725
+ "ID_MISMATCH",
32726
+ "ROLLBACK",
32727
+ "REVOKED",
32728
+ "UNSAFE_ENDPOINT"
32729
+ ]);
32730
+ var CredentialRefreshUpdatedResultValidator2 = external_exports2.object({
32731
+ status: external_exports2.literal("updated"),
32732
+ credential: VCValidator2,
32733
+ etag: external_exports2.string().optional(),
32734
+ managedVersion: external_exports2.number().int().positive().optional()
32735
+ });
32736
+ var CredentialRefreshUnchangedResultValidator2 = external_exports2.object({
32737
+ status: external_exports2.literal("unchanged"),
32738
+ checkedAt: external_exports2.string().min(1),
32739
+ etag: external_exports2.string().optional()
32740
+ });
32741
+ var CredentialRefreshUnsupportedResultValidator2 = external_exports2.object({
32742
+ status: external_exports2.literal("unsupported")
32743
+ });
32744
+ var CredentialRefreshFailedResultValidator2 = external_exports2.object({
32745
+ status: external_exports2.literal("failed"),
32746
+ code: CredentialRefreshFailureCodeValidator2,
32747
+ retryable: external_exports2.boolean()
32748
+ });
32749
+ var CredentialRefreshResultValidator2 = external_exports2.discriminatedUnion("status", [
32750
+ CredentialRefreshUpdatedResultValidator2,
32751
+ CredentialRefreshUnchangedResultValidator2,
32752
+ CredentialRefreshUnsupportedResultValidator2,
32753
+ CredentialRefreshFailedResultValidator2
32754
+ ]);
32544
32755
  var LCNProfileDisplayValidator2 = external_exports2.object({
32545
32756
  backgroundColor: external_exports2.string().optional(),
32546
32757
  backgroundImage: external_exports2.string().optional(),
@@ -32876,7 +33087,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32876
33087
  "Options for email/phone recipients (Universal Inbox)"
32877
33088
  ),
32878
33089
  templateData: external_exports2.record(external_exports2.string(), external_exports2.unknown()).optional(),
32879
- integrationId: external_exports2.string().optional().describe("Integration ID for activity tracking")
33090
+ integrationId: external_exports2.string().optional().describe("Integration ID for activity tracking"),
33091
+ refresh: external_exports2.boolean().optional().describe(
33092
+ "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."
33093
+ ),
33094
+ idempotencyKey: external_exports2.string().min(1).max(200).optional().describe(
33095
+ "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."
33096
+ )
32880
33097
  }).refine((data) => data.templateUri || data.template || data.signedCredential, {
32881
33098
  message: "Either templateUri, template, or signedCredential must be provided.",
32882
33099
  path: ["templateUri"]
@@ -32891,8 +33108,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32891
33108
  message: "guardianEmail must differ from recipient (self-approval not allowed)",
32892
33109
  path: ["options", "guardianEmail"]
32893
33110
  }
32894
- );
33111
+ ).refine((data) => !data.idempotencyKey || data.refresh === true, {
33112
+ message: "idempotencyKey is only supported with refresh: true.",
33113
+ path: ["idempotencyKey"]
33114
+ });
32895
33115
  var SendInboxResponseValidator2 = external_exports2.object({
33116
+ refresh: InboxCredentialRefreshReceiptValidator2.optional(),
32896
33117
  issuanceId: external_exports2.string(),
32897
33118
  status: external_exports2.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
32898
33119
  claimUrl: external_exports2.string().url().optional().describe("Present when suppressDelivery=true"),
@@ -32907,8 +33128,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32907
33128
  activityId: external_exports2.string().describe("Links to the activity lifecycle for this issuance"),
32908
33129
  inbox: SendInboxResponseValidator2.optional().describe(
32909
33130
  "Present when sent via email/phone (Universal Inbox)"
33131
+ ),
33132
+ refresh: ManagedCredentialRefreshReceiptValidator2.optional().describe(
33133
+ "Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
32910
33134
  )
32911
33135
  });
33136
+ var PrepareRefreshableSendInputValidator2 = external_exports2.object({
33137
+ recipient: external_exports2.string(),
33138
+ templateUri: external_exports2.string().optional(),
33139
+ template: SendBoostTemplateValidator2.optional(),
33140
+ contractUri: external_exports2.string().optional(),
33141
+ templateData: external_exports2.record(external_exports2.string(), external_exports2.unknown()).optional(),
33142
+ integrationId: external_exports2.string().optional(),
33143
+ /** Credential ID to allocate for; generated server-side when omitted. */
33144
+ credentialId: external_exports2.string().min(1).optional(),
33145
+ idempotencyKey: external_exports2.string().min(1).max(200).optional()
33146
+ }).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
33147
+ message: "Provide exactly one of templateUri or template."
33148
+ });
33149
+ var PrepareRefreshableSendResultValidator2 = external_exports2.object({
33150
+ boostUri: external_exports2.string(),
33151
+ credentialId: external_exports2.string(),
33152
+ refreshId: external_exports2.string(),
33153
+ refreshService: ManagedCredentialRefreshServiceValidator2,
33154
+ /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
33155
+ holderDid: external_exports2.string(),
33156
+ /** Present when this idempotencyKey already completed: return it without signing. */
33157
+ completed: SendBoostResponseValidator2.optional()
33158
+ });
32912
33159
  var SendInputValidator2 = external_exports2.discriminatedUnion("type", [SendBoostInputValidator2]);
32913
33160
  var SendResponseValidator2 = external_exports2.discriminatedUnion("type", [SendBoostResponseValidator2]);
32914
33161
  var ConsentFlowTermsStatusValidator2 = external_exports2.enum(["live", "stale", "withdrawn"]);
@@ -33227,6 +33474,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33227
33474
  webhookUrl: external_exports2.string().optional()
33228
33475
  });
33229
33476
  var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2 = "auth-grant:";
33477
+ var ACT_AS_HEADER = "X-LearnCard-Act-As";
33230
33478
  var AuthGrantValidator2 = external_exports2.object({
33231
33479
  id: external_exports2.string(),
33232
33480
  name: external_exports2.string(),
@@ -33239,6 +33487,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33239
33487
  }, "error")
33240
33488
  }),
33241
33489
  scope: external_exports2.string(),
33490
+ actAs: external_exports2.string().optional(),
33242
33491
  createdAt: external_exports2.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
33243
33492
  expiresAt: external_exports2.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
33244
33493
  });
@@ -33310,6 +33559,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33310
33559
  sessionJwt: external_exports2.string()
33311
33560
  });
33312
33561
  var InboxCredentialValidator2 = external_exports2.object({
33562
+ refresh: InboxCredentialRefreshReceiptValidator2.optional(),
33563
+ refreshId: external_exports2.string().optional(),
33313
33564
  id: external_exports2.string(),
33314
33565
  credential: external_exports2.string().optional(),
33315
33566
  isSigned: external_exports2.boolean(),
@@ -33364,12 +33615,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33364
33615
  templateUri: external_exports2.string().optional().describe(
33365
33616
  "URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
33366
33617
  ),
33618
+ refresh: external_exports2.boolean().optional().describe(
33619
+ "Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
33620
+ ),
33621
+ idempotencyKey: external_exports2.string().min(1).max(200).optional(),
33367
33622
  // === OPTIONAL FEATURES ===
33368
33623
  // Add major, distinct features at the top level.
33369
33624
  //consentRequest: ConsentRequestValidator.optional(),
33370
33625
  // === PROCESS CONFIGURATION (Optional) ===
33371
33626
  // HOW should this issuance be handled?
33372
33627
  configuration: external_exports2.object({
33628
+ guardianEmail: external_exports2.string().email().optional().describe(
33629
+ "Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
33630
+ ),
33373
33631
  signingAuthority: IssueInboxSigningAuthorityValidator2.optional().describe(
33374
33632
  "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."
33375
33633
  ),
@@ -33423,17 +33681,130 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33423
33681
  }).optional().describe(
33424
33682
  "Configuration for the credential issuance. If not provided, the default configuration will be used."
33425
33683
  )
33684
+ }).refine((data) => !data.idempotencyKey || data.refresh === true, {
33685
+ message: "idempotencyKey requires refresh: true."
33426
33686
  }).refine((data) => data.credential || data.templateUri, {
33427
33687
  message: "Either credential or templateUri must be provided.",
33428
33688
  path: ["credential"]
33429
- });
33689
+ }).refine(
33690
+ (data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
33691
+ {
33692
+ message: "guardianEmail must differ from recipient (self-approval not allowed)",
33693
+ path: ["configuration", "guardianEmail"]
33694
+ }
33695
+ );
33430
33696
  var IssueInboxCredentialResponseValidator2 = external_exports2.object({
33697
+ refresh: InboxCredentialRefreshReceiptValidator2.optional(),
33431
33698
  issuanceId: external_exports2.string(),
33432
33699
  status: LCNInboxStatusEnumValidator2,
33433
33700
  recipient: ContactMethodQueryValidator2,
33434
33701
  claimUrl: external_exports2.string().url().optional(),
33435
33702
  recipientDid: external_exports2.string().optional()
33436
33703
  });
33704
+ var InboxBatchConfigurationValidator2 = IssueInboxCredentialValidator2.shape.configuration.unwrap().extend({
33705
+ refresh: IssueInboxCredentialValidator2.shape.refresh.describe(
33706
+ "Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
33707
+ ),
33708
+ delivery: IssueInboxCredentialValidator2.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports2.boolean().optional() }).optional()
33709
+ });
33710
+ var InboxBatchItemConfigurationValidator2 = InboxBatchConfigurationValidator2.extend({
33711
+ guardianEmail: InboxBatchConfigurationValidator2.shape.guardianEmail.nullable().describe(
33712
+ "Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
33713
+ )
33714
+ });
33715
+ var IssueInboxCredentialBatchItemValidator2 = external_exports2.object({
33716
+ ...IssueInboxCredentialValidator2.shape,
33717
+ configuration: InboxBatchItemConfigurationValidator2.optional(),
33718
+ idempotencyKey: external_exports2.string().max(256).optional()
33719
+ }).refine((data) => data.credential || data.templateUri, {
33720
+ message: "Either credential or templateUri must be provided.",
33721
+ path: ["credential"]
33722
+ }).describe(
33723
+ "One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
33724
+ );
33725
+ var IssueInboxCredentialBatchValidator2 = external_exports2.object({
33726
+ requestId: external_exports2.string().min(1).max(256).optional(),
33727
+ items: external_exports2.array(IssueInboxCredentialBatchItemValidator2).min(1).max(100),
33728
+ configuration: InboxBatchConfigurationValidator2.optional()
33729
+ }).superRefine((batch, ctx) => {
33730
+ batch.items.forEach((item, index) => {
33731
+ const itemGuardian = item.configuration?.guardianEmail;
33732
+ const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
33733
+ if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
33734
+ ctx.addIssue({
33735
+ code: "custom",
33736
+ path: ["items", index, "configuration", "guardianEmail"],
33737
+ message: "guardianEmail must differ from recipient (self-approval not allowed)"
33738
+ });
33739
+ }
33740
+ });
33741
+ });
33742
+ var InboxBatchErrorReasonValidator2 = external_exports2.enum([
33743
+ "DUPLICATE_KEY",
33744
+ "IDEMPOTENCY_MISMATCH",
33745
+ "IN_PROGRESS",
33746
+ "UNCONFIRMED"
33747
+ ]);
33748
+ var IssueInboxCredentialBatchItemResultValidator2 = external_exports2.discriminatedUnion("success", [
33749
+ IssueInboxCredentialResponseValidator2.extend({
33750
+ success: external_exports2.literal(true),
33751
+ index: external_exports2.number().int().nonnegative(),
33752
+ deduplicated: external_exports2.boolean().optional(),
33753
+ guardianStatus: GuardianStatusValidator2.optional(),
33754
+ idempotencyKey: external_exports2.string().optional()
33755
+ }),
33756
+ external_exports2.object({
33757
+ success: external_exports2.literal(false),
33758
+ index: external_exports2.number().int().nonnegative(),
33759
+ idempotencyKey: external_exports2.string().optional(),
33760
+ recipient: ContactMethodQueryValidator2.optional(),
33761
+ error: external_exports2.object({
33762
+ code: external_exports2.string(),
33763
+ message: external_exports2.string(),
33764
+ reason: InboxBatchErrorReasonValidator2.optional()
33765
+ }),
33766
+ issuanceId: external_exports2.string().optional().describe(
33767
+ "Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
33768
+ ),
33769
+ claimUrl: external_exports2.string().url().optional().describe(
33770
+ "Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
33771
+ )
33772
+ })
33773
+ ]);
33774
+ var IssueInboxCredentialBatchResponseValidator2 = external_exports2.object({
33775
+ results: external_exports2.array(IssueInboxCredentialBatchItemResultValidator2),
33776
+ summary: external_exports2.object({
33777
+ total: external_exports2.number(),
33778
+ succeeded: external_exports2.number(),
33779
+ failed: external_exports2.number(),
33780
+ deduplicated: external_exports2.number()
33781
+ })
33782
+ });
33783
+ var InboxBatchReceiptValidator2 = external_exports2.object({
33784
+ batchId: external_exports2.string(),
33785
+ status: external_exports2.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
33786
+ createdAt: external_exports2.string()
33787
+ });
33788
+ var InboxBatchStatusValidator2 = external_exports2.object({
33789
+ batchId: external_exports2.string(),
33790
+ createdAt: external_exports2.string(),
33791
+ done: external_exports2.boolean().describe(
33792
+ "True when no queued or processing items remain, including unconfirmed outcomes."
33793
+ ),
33794
+ status: external_exports2.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
33795
+ items: external_exports2.array(
33796
+ external_exports2.object({
33797
+ index: external_exports2.number().int().nonnegative(),
33798
+ state: external_exports2.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
33799
+ result: IssueInboxCredentialBatchItemResultValidator2.optional()
33800
+ })
33801
+ ),
33802
+ summary: IssueInboxCredentialBatchResponseValidator2.shape.summary.extend({
33803
+ completed: external_exports2.number(),
33804
+ pending: external_exports2.number(),
33805
+ unconfirmed: external_exports2.number()
33806
+ })
33807
+ });
33437
33808
  var CredentialNameRefValidator2 = external_exports2.object({ name: external_exports2.string() }).passthrough();
33438
33809
  var ClaimInboxCredentialValidator2 = external_exports2.object({
33439
33810
  credential: VCValidator2.or(VPValidator2).or(UnsignedVCValidator2).or(CredentialNameRefValidator2).describe("The credential to issue, or a { name } reference to resolve a boost template."),
@@ -33919,6 +34290,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33919
34290
  eventType: CredentialActivityEventTypeValidator2,
33920
34291
  timestamp: external_exports2.string(),
33921
34292
  actorProfileId: external_exports2.string().optional(),
34293
+ onBehalfOf: external_exports2.string().optional(),
33922
34294
  recipientType: CredentialActivityRecipientTypeValidator2,
33923
34295
  recipientIdentifier: external_exports2.string(),
33924
34296
  boostUri: external_exports2.string().optional(),
@@ -34073,191 +34445,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
34073
34445
  const result = inAppMessagesFlagValidator2.safeParse(raw);
34074
34446
  return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
34075
34447
  }, "parseInAppMessagesFlag");
34076
- var LearnCardRefreshAuthorizationValidator2 = external_exports2.object({ type: external_exports2.literal("LearnCardDIDAuth") }).catchall(external_exports2.any());
34077
- var ManagedCredentialRefreshServiceValidator2 = external_exports2.object({
34078
- id: external_exports2.string().min(1),
34079
- type: external_exports2.literal("LearnCardCredentialRefresh2026"),
34080
- authorization: LearnCardRefreshAuthorizationValidator2.optional()
34081
- }).catchall(external_exports2.any());
34082
- var StandardCredentialRefreshServiceValidator2 = external_exports2.object({
34083
- id: external_exports2.string().min(1),
34084
- type: external_exports2.literal("1EdTechCredentialRefresh")
34085
- }).catchall(external_exports2.any());
34086
- var SupportedCredentialRefreshServiceValidator2 = external_exports2.union([
34087
- ManagedCredentialRefreshServiceValidator2,
34088
- StandardCredentialRefreshServiceValidator2
34089
- ]);
34090
- var AllocateCredentialRefreshInputValidator2 = external_exports2.object({
34091
- holder: external_exports2.object({
34092
- profileId: external_exports2.string().optional(),
34093
- did: external_exports2.string().min(1)
34094
- }),
34095
- credentialId: external_exports2.string().min(1)
34096
- });
34097
- var AllocateCredentialRefreshResultValidator2 = external_exports2.object({
34098
- refreshId: external_exports2.string().min(1),
34099
- refreshService: ManagedCredentialRefreshServiceValidator2.extend({
34100
- authorization: LearnCardRefreshAuthorizationValidator2
34101
- })
34102
- });
34103
- var CredentialRefreshSigningModeValidator2 = external_exports2.enum(["issuer-signed", "signing-authority"]);
34104
- var PublishCredentialRefreshBaseFields2 = {
34105
- refreshId: external_exports2.string().min(1),
34106
- notifyHolder: external_exports2.boolean().optional(),
34107
- updateSummary: external_exports2.string().optional(),
34108
- idempotencyKey: external_exports2.string().optional()
34109
- };
34110
- var PublishIssuerSignedRefreshValidator2 = external_exports2.object({
34111
- ...PublishCredentialRefreshBaseFields2,
34112
- mode: external_exports2.literal("issuer-signed"),
34113
- signedCredential: VCValidator2
34114
- });
34115
- var PublishSigningAuthorityRefreshValidator2 = external_exports2.object({
34116
- ...PublishCredentialRefreshBaseFields2,
34117
- mode: external_exports2.literal("signing-authority"),
34118
- credential: UnsignedVCValidator2,
34119
- signingAuthority: external_exports2.object({
34120
- type: external_exports2.string().min(1)
34121
- }).catchall(external_exports2.any())
34122
- });
34123
- var PublishCredentialRefreshInputValidator2 = external_exports2.object({
34124
- ...PublishCredentialRefreshBaseFields2,
34125
- mode: CredentialRefreshSigningModeValidator2,
34126
- signedCredential: VCValidator2.optional(),
34127
- credential: UnsignedVCValidator2.optional(),
34128
- signingAuthority: external_exports2.object({
34129
- type: external_exports2.string().min(1)
34130
- }).catchall(external_exports2.any()).optional()
34131
- }).superRefine((input, ctx) => {
34132
- if (input.mode === "issuer-signed" && !input.signedCredential) {
34133
- ctx.addIssue({
34134
- code: "custom",
34135
- path: ["signedCredential"],
34136
- message: "signedCredential is required for issuer-signed publication"
34137
- });
34138
- }
34139
- if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
34140
- ctx.addIssue({
34141
- code: "custom",
34142
- path: ["mode"],
34143
- message: "issuer-signed publication cannot include signing-authority fields"
34144
- });
34145
- }
34146
- if (input.mode === "signing-authority") {
34147
- if (input.signedCredential !== void 0) {
34148
- ctx.addIssue({
34149
- code: "custom",
34150
- path: ["signedCredential"],
34151
- message: "signing-authority publication cannot include signedCredential"
34152
- });
34153
- }
34154
- if (!input.credential) {
34155
- ctx.addIssue({
34156
- code: "custom",
34157
- path: ["credential"],
34158
- message: "credential is required for signing-authority publication"
34159
- });
34160
- }
34161
- if (!input.signingAuthority) {
34162
- ctx.addIssue({
34163
- code: "custom",
34164
- path: ["signingAuthority"],
34165
- message: "signingAuthority is required for signing-authority publication"
34166
- });
34167
- }
34168
- }
34169
- });
34170
- var PublishCredentialRefreshNotificationValidator2 = external_exports2.enum([
34171
- "queued",
34172
- "suppressed",
34173
- "not-applicable",
34174
- /** Publication succeeded, but the post-commit notification enqueue must be retried. */
34175
- "delivery-failed"
34176
- ]);
34177
- var PublishCredentialRefreshResultValidator2 = external_exports2.object({
34178
- refreshId: external_exports2.string().min(1),
34179
- version: external_exports2.number().int().positive(),
34180
- publishedAt: external_exports2.string().min(1),
34181
- notification: PublishCredentialRefreshNotificationValidator2
34182
- });
34183
- var CredentialRefreshVersionMetadataValidator2 = external_exports2.object({
34184
- version: external_exports2.number().int().positive(),
34185
- publishedAt: external_exports2.string().min(1),
34186
- effectiveAt: external_exports2.string().optional(),
34187
- etag: external_exports2.string().optional(),
34188
- signingMode: CredentialRefreshSigningModeValidator2.optional(),
34189
- updateSummary: external_exports2.string().optional()
34190
- });
34191
- var GetCredentialRefreshHistoryInputValidator2 = external_exports2.object({
34192
- refreshId: external_exports2.string().min(1),
34193
- cursor: external_exports2.string().optional(),
34194
- limit: external_exports2.number().int().positive().optional()
34195
- });
34196
- var GetCredentialRefreshHistoryResultValidator2 = external_exports2.object({
34197
- records: CredentialRefreshVersionMetadataValidator2.array(),
34198
- hasMore: external_exports2.boolean(),
34199
- cursor: external_exports2.string().optional()
34200
- });
34201
- var CredentialRefreshChallengeValidator2 = external_exports2.object({
34202
- challenge: external_exports2.string().min(1),
34203
- expiresAt: external_exports2.string().min(1),
34204
- domain: external_exports2.string().optional(),
34205
- scheme: external_exports2.literal("LearnCardDIDAuth").optional()
34206
- });
34207
- var PublicCredentialRefreshEnvelopeValidator2 = external_exports2.object({
34208
- format: external_exports2.literal("vc"),
34209
- credential: VCValidator2,
34210
- etag: external_exports2.string().optional()
34211
- });
34212
- var JweCredentialRefreshEnvelopeValidator2 = external_exports2.object({
34213
- format: external_exports2.literal("jwe"),
34214
- jwe: JWEValidator2,
34215
- etag: external_exports2.string().optional(),
34216
- /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
34217
- version: external_exports2.number().int().positive().optional()
34218
- });
34219
- var CredentialRefreshResponseEnvelopeValidator2 = external_exports2.discriminatedUnion("format", [
34220
- PublicCredentialRefreshEnvelopeValidator2,
34221
- JweCredentialRefreshEnvelopeValidator2
34222
- ]);
34223
- var CredentialRefreshFailureCodeValidator2 = external_exports2.enum([
34224
- "UNAVAILABLE",
34225
- "TIMEOUT",
34226
- "UNSUPPORTED_SERVICE",
34227
- "UNAUTHORIZED",
34228
- "MALFORMED_RESPONSE",
34229
- "INVALID_PROOF",
34230
- "ISSUER_MISMATCH",
34231
- "ID_MISMATCH",
34232
- "ROLLBACK",
34233
- "REVOKED",
34234
- "UNSAFE_ENDPOINT"
34235
- ]);
34236
- var CredentialRefreshUpdatedResultValidator2 = external_exports2.object({
34237
- status: external_exports2.literal("updated"),
34238
- credential: VCValidator2,
34239
- etag: external_exports2.string().optional(),
34240
- managedVersion: external_exports2.number().int().positive().optional()
34241
- });
34242
- var CredentialRefreshUnchangedResultValidator2 = external_exports2.object({
34243
- status: external_exports2.literal("unchanged"),
34244
- checkedAt: external_exports2.string().min(1),
34245
- etag: external_exports2.string().optional()
34246
- });
34247
- var CredentialRefreshUnsupportedResultValidator2 = external_exports2.object({
34248
- status: external_exports2.literal("unsupported")
34249
- });
34250
- var CredentialRefreshFailedResultValidator2 = external_exports2.object({
34251
- status: external_exports2.literal("failed"),
34252
- code: CredentialRefreshFailureCodeValidator2,
34253
- retryable: external_exports2.boolean()
34254
- });
34255
- var CredentialRefreshResultValidator2 = external_exports2.discriminatedUnion("status", [
34256
- CredentialRefreshUpdatedResultValidator2,
34257
- CredentialRefreshUnchangedResultValidator2,
34258
- CredentialRefreshUnsupportedResultValidator2,
34259
- CredentialRefreshFailedResultValidator2
34260
- ]);
34261
34448
  }
34262
34449
  });
34263
34450
  var require_dist = __commonJS({
@@ -34553,6 +34740,18 @@ var ImageWithLoadingStateValdator = external_exports.object({
34553
34740
  });
34554
34741
  var import_types2 = __toESM(require_dist());
34555
34742
  var import_types22 = __toESM(require_dist());
34743
+ var MANAGED_REFRESH_TYPE_TERM = "LearnCardCredentialRefresh2026";
34744
+ var MANAGED_REFRESH_DID_AUTH_TERM = "LearnCardDIDAuth";
34745
+ var MANAGED_REFRESH_TYPE_IRI = "https://learncard.com/refresh#LearnCardCredentialRefresh2026";
34746
+ var MANAGED_REFRESH_AUTHORIZATION_IRI = "https://purl.imsglobal.org/spec/ob/v3p0#authorization";
34747
+ var MANAGED_REFRESH_DID_AUTH_IRI = "https://docs.learncard.com/definitions#LearnCardDIDAuth";
34748
+ var MANAGED_REFRESH_SERVICE_CONTEXT = {
34749
+ [MANAGED_REFRESH_TYPE_TERM]: MANAGED_REFRESH_TYPE_IRI,
34750
+ authorization: {
34751
+ "@id": MANAGED_REFRESH_AUTHORIZATION_IRI,
34752
+ "@context": { [MANAGED_REFRESH_DID_AUTH_TERM]: MANAGED_REFRESH_DID_AUTH_IRI }
34753
+ }
34754
+ };
34556
34755
  var _a4;
34557
34756
  var EnvironmentConfigurationError = (_a4 = class extends Error {
34558
34757
  constructor(message) {
@@ -35175,6 +35374,204 @@ var StringQuery = external_exports.union([
35175
35374
  $or: BaseStringQuery.array()
35176
35375
  })
35177
35376
  ]);
35377
+ var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
35378
+ var ManagedCredentialRefreshServiceValidator = external_exports.object({
35379
+ id: external_exports.string().min(1),
35380
+ type: external_exports.literal("LearnCardCredentialRefresh2026"),
35381
+ authorization: LearnCardRefreshAuthorizationValidator.optional()
35382
+ }).catchall(external_exports.any());
35383
+ var StandardCredentialRefreshServiceValidator = external_exports.object({
35384
+ id: external_exports.string().min(1),
35385
+ type: external_exports.literal("1EdTechCredentialRefresh")
35386
+ }).catchall(external_exports.any());
35387
+ var SupportedCredentialRefreshServiceValidator = external_exports.union([
35388
+ ManagedCredentialRefreshServiceValidator,
35389
+ StandardCredentialRefreshServiceValidator
35390
+ ]);
35391
+ var AllocateCredentialRefreshInputValidator = external_exports.object({
35392
+ holder: external_exports.object({
35393
+ profileId: external_exports.string().optional(),
35394
+ did: external_exports.string().min(1)
35395
+ }),
35396
+ credentialId: external_exports.string().min(1)
35397
+ });
35398
+ var AllocateCredentialRefreshResultValidator = external_exports.object({
35399
+ refreshId: external_exports.string().min(1),
35400
+ refreshService: ManagedCredentialRefreshServiceValidator.extend({
35401
+ authorization: LearnCardRefreshAuthorizationValidator
35402
+ })
35403
+ });
35404
+ var ManagedCredentialRefreshReceiptValidator = external_exports.object({
35405
+ refreshId: external_exports.string().min(1),
35406
+ refreshService: ManagedCredentialRefreshServiceValidator,
35407
+ credentialId: external_exports.string().min(1),
35408
+ issuerDid: external_exports.string().min(1),
35409
+ holderDid: external_exports.string().min(1),
35410
+ credentialStatus: CredentialStatusValidator.or(
35411
+ CredentialStatusValidator.array()
35412
+ ).optional()
35413
+ }).strip();
35414
+ var InboxCredentialRefreshReceiptValidator = ManagedCredentialRefreshReceiptValidator.omit(
35415
+ { holderDid: true }
35416
+ ).extend({ holderDid: external_exports.string().min(1).optional() });
35417
+ var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
35418
+ var PublishCredentialRefreshBaseFields = {
35419
+ refreshId: external_exports.string().min(1),
35420
+ notifyHolder: external_exports.boolean().optional(),
35421
+ updateSummary: external_exports.string().optional(),
35422
+ idempotencyKey: external_exports.string().optional()
35423
+ };
35424
+ var PublishIssuerSignedRefreshValidator = external_exports.object({
35425
+ ...PublishCredentialRefreshBaseFields,
35426
+ mode: external_exports.literal("issuer-signed"),
35427
+ signedCredential: VCValidator
35428
+ });
35429
+ var PublishSigningAuthorityRefreshValidator = external_exports.object({
35430
+ ...PublishCredentialRefreshBaseFields,
35431
+ mode: external_exports.literal("signing-authority"),
35432
+ credential: UnsignedVCValidator,
35433
+ signingAuthority: external_exports.object({
35434
+ type: external_exports.string().min(1)
35435
+ }).catchall(external_exports.any())
35436
+ });
35437
+ var PublishCredentialRefreshInputValidator = external_exports.object({
35438
+ ...PublishCredentialRefreshBaseFields,
35439
+ mode: CredentialRefreshSigningModeValidator,
35440
+ signedCredential: VCValidator.optional(),
35441
+ credential: UnsignedVCValidator.optional(),
35442
+ signingAuthority: external_exports.object({
35443
+ type: external_exports.string().min(1)
35444
+ }).catchall(external_exports.any()).optional()
35445
+ }).superRefine((input, ctx) => {
35446
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
35447
+ ctx.addIssue({
35448
+ code: "custom",
35449
+ path: ["signedCredential"],
35450
+ message: "signedCredential is required for issuer-signed publication"
35451
+ });
35452
+ }
35453
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
35454
+ ctx.addIssue({
35455
+ code: "custom",
35456
+ path: ["mode"],
35457
+ message: "issuer-signed publication cannot include signing-authority fields"
35458
+ });
35459
+ }
35460
+ if (input.mode === "signing-authority") {
35461
+ if (input.signedCredential !== void 0) {
35462
+ ctx.addIssue({
35463
+ code: "custom",
35464
+ path: ["signedCredential"],
35465
+ message: "signing-authority publication cannot include signedCredential"
35466
+ });
35467
+ }
35468
+ if (!input.credential) {
35469
+ ctx.addIssue({
35470
+ code: "custom",
35471
+ path: ["credential"],
35472
+ message: "credential is required for signing-authority publication"
35473
+ });
35474
+ }
35475
+ if (!input.signingAuthority) {
35476
+ ctx.addIssue({
35477
+ code: "custom",
35478
+ path: ["signingAuthority"],
35479
+ message: "signingAuthority is required for signing-authority publication"
35480
+ });
35481
+ }
35482
+ }
35483
+ });
35484
+ var PublishCredentialRefreshNotificationValidator = external_exports.enum([
35485
+ "queued",
35486
+ "suppressed",
35487
+ "not-applicable",
35488
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
35489
+ "delivery-failed"
35490
+ ]);
35491
+ var PublishCredentialRefreshResultValidator = external_exports.object({
35492
+ refreshId: external_exports.string().min(1),
35493
+ version: external_exports.number().int().positive(),
35494
+ publishedAt: external_exports.string().min(1),
35495
+ notification: PublishCredentialRefreshNotificationValidator
35496
+ });
35497
+ var CredentialRefreshVersionMetadataValidator = external_exports.object({
35498
+ version: external_exports.number().int().positive(),
35499
+ publishedAt: external_exports.string().min(1),
35500
+ effectiveAt: external_exports.string().optional(),
35501
+ etag: external_exports.string().optional(),
35502
+ signingMode: CredentialRefreshSigningModeValidator.optional(),
35503
+ updateSummary: external_exports.string().optional()
35504
+ });
35505
+ var GetCredentialRefreshHistoryInputValidator = external_exports.object({
35506
+ refreshId: external_exports.string().min(1),
35507
+ cursor: external_exports.string().optional(),
35508
+ limit: external_exports.number().int().positive().optional()
35509
+ });
35510
+ var GetCredentialRefreshHistoryResultValidator = external_exports.object({
35511
+ records: CredentialRefreshVersionMetadataValidator.array(),
35512
+ hasMore: external_exports.boolean(),
35513
+ cursor: external_exports.string().optional()
35514
+ });
35515
+ var CredentialRefreshChallengeValidator = external_exports.object({
35516
+ challenge: external_exports.string().min(1),
35517
+ expiresAt: external_exports.string().min(1),
35518
+ domain: external_exports.string().optional(),
35519
+ scheme: external_exports.literal("LearnCardDIDAuth").optional()
35520
+ });
35521
+ var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
35522
+ format: external_exports.literal("vc"),
35523
+ credential: VCValidator,
35524
+ etag: external_exports.string().optional()
35525
+ });
35526
+ var JweCredentialRefreshEnvelopeValidator = external_exports.object({
35527
+ format: external_exports.literal("jwe"),
35528
+ jwe: JWEValidator,
35529
+ etag: external_exports.string().optional(),
35530
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
35531
+ version: external_exports.number().int().positive().optional()
35532
+ });
35533
+ var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
35534
+ PublicCredentialRefreshEnvelopeValidator,
35535
+ JweCredentialRefreshEnvelopeValidator
35536
+ ]);
35537
+ var CredentialRefreshFailureCodeValidator = external_exports.enum([
35538
+ "UNAVAILABLE",
35539
+ "TIMEOUT",
35540
+ "UNSUPPORTED_SERVICE",
35541
+ "UNAUTHORIZED",
35542
+ "MALFORMED_RESPONSE",
35543
+ "INVALID_PROOF",
35544
+ "ISSUER_MISMATCH",
35545
+ "ID_MISMATCH",
35546
+ "ROLLBACK",
35547
+ "REVOKED",
35548
+ "UNSAFE_ENDPOINT"
35549
+ ]);
35550
+ var CredentialRefreshUpdatedResultValidator = external_exports.object({
35551
+ status: external_exports.literal("updated"),
35552
+ credential: VCValidator,
35553
+ etag: external_exports.string().optional(),
35554
+ managedVersion: external_exports.number().int().positive().optional()
35555
+ });
35556
+ var CredentialRefreshUnchangedResultValidator = external_exports.object({
35557
+ status: external_exports.literal("unchanged"),
35558
+ checkedAt: external_exports.string().min(1),
35559
+ etag: external_exports.string().optional()
35560
+ });
35561
+ var CredentialRefreshUnsupportedResultValidator = external_exports.object({
35562
+ status: external_exports.literal("unsupported")
35563
+ });
35564
+ var CredentialRefreshFailedResultValidator = external_exports.object({
35565
+ status: external_exports.literal("failed"),
35566
+ code: CredentialRefreshFailureCodeValidator,
35567
+ retryable: external_exports.boolean()
35568
+ });
35569
+ var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
35570
+ CredentialRefreshUpdatedResultValidator,
35571
+ CredentialRefreshUnchangedResultValidator,
35572
+ CredentialRefreshUnsupportedResultValidator,
35573
+ CredentialRefreshFailedResultValidator
35574
+ ]);
35178
35575
  var LCNProfileDisplayValidator = external_exports.object({
35179
35576
  backgroundColor: external_exports.string().optional(),
35180
35577
  backgroundImage: external_exports.string().optional(),
@@ -35510,7 +35907,13 @@ var SendBoostInputValidator = external_exports.object({
35510
35907
  "Options for email/phone recipients (Universal Inbox)"
35511
35908
  ),
35512
35909
  templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
35513
- integrationId: external_exports.string().optional().describe("Integration ID for activity tracking")
35910
+ integrationId: external_exports.string().optional().describe("Integration ID for activity tracking"),
35911
+ refresh: external_exports.boolean().optional().describe(
35912
+ "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."
35913
+ ),
35914
+ idempotencyKey: external_exports.string().min(1).max(200).optional().describe(
35915
+ "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."
35916
+ )
35514
35917
  }).refine((data) => data.templateUri || data.template || data.signedCredential, {
35515
35918
  message: "Either templateUri, template, or signedCredential must be provided.",
35516
35919
  path: ["templateUri"]
@@ -35525,8 +35928,12 @@ var SendBoostInputValidator = external_exports.object({
35525
35928
  message: "guardianEmail must differ from recipient (self-approval not allowed)",
35526
35929
  path: ["options", "guardianEmail"]
35527
35930
  }
35528
- );
35931
+ ).refine((data) => !data.idempotencyKey || data.refresh === true, {
35932
+ message: "idempotencyKey is only supported with refresh: true.",
35933
+ path: ["idempotencyKey"]
35934
+ });
35529
35935
  var SendInboxResponseValidator = external_exports.object({
35936
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
35530
35937
  issuanceId: external_exports.string(),
35531
35938
  status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
35532
35939
  claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
@@ -35541,8 +35948,34 @@ var SendBoostResponseValidator = external_exports.object({
35541
35948
  activityId: external_exports.string().describe("Links to the activity lifecycle for this issuance"),
35542
35949
  inbox: SendInboxResponseValidator.optional().describe(
35543
35950
  "Present when sent via email/phone (Universal Inbox)"
35951
+ ),
35952
+ refresh: ManagedCredentialRefreshReceiptValidator.optional().describe(
35953
+ "Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
35544
35954
  )
35545
35955
  });
35956
+ var PrepareRefreshableSendInputValidator = external_exports.object({
35957
+ recipient: external_exports.string(),
35958
+ templateUri: external_exports.string().optional(),
35959
+ template: SendBoostTemplateValidator.optional(),
35960
+ contractUri: external_exports.string().optional(),
35961
+ templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
35962
+ integrationId: external_exports.string().optional(),
35963
+ /** Credential ID to allocate for; generated server-side when omitted. */
35964
+ credentialId: external_exports.string().min(1).optional(),
35965
+ idempotencyKey: external_exports.string().min(1).max(200).optional()
35966
+ }).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
35967
+ message: "Provide exactly one of templateUri or template."
35968
+ });
35969
+ var PrepareRefreshableSendResultValidator = external_exports.object({
35970
+ boostUri: external_exports.string(),
35971
+ credentialId: external_exports.string(),
35972
+ refreshId: external_exports.string(),
35973
+ refreshService: ManagedCredentialRefreshServiceValidator,
35974
+ /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
35975
+ holderDid: external_exports.string(),
35976
+ /** Present when this idempotencyKey already completed: return it without signing. */
35977
+ completed: SendBoostResponseValidator.optional()
35978
+ });
35546
35979
  var SendInputValidator = external_exports.discriminatedUnion("type", [SendBoostInputValidator]);
35547
35980
  var SendResponseValidator = external_exports.discriminatedUnion("type", [SendBoostResponseValidator]);
35548
35981
  var ConsentFlowTermsStatusValidator = external_exports.enum(["live", "stale", "withdrawn"]);
@@ -35873,6 +36306,7 @@ var AuthGrantValidator = external_exports.object({
35873
36306
  }, "error")
35874
36307
  }),
35875
36308
  scope: external_exports.string(),
36309
+ actAs: external_exports.string().optional(),
35876
36310
  createdAt: external_exports.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
35877
36311
  expiresAt: external_exports.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
35878
36312
  });
@@ -35944,6 +36378,8 @@ var CreateContactMethodSessionResponseValidator = external_exports.object({
35944
36378
  sessionJwt: external_exports.string()
35945
36379
  });
35946
36380
  var InboxCredentialValidator = external_exports.object({
36381
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
36382
+ refreshId: external_exports.string().optional(),
35947
36383
  id: external_exports.string(),
35948
36384
  credential: external_exports.string().optional(),
35949
36385
  isSigned: external_exports.boolean(),
@@ -35998,12 +36434,19 @@ var IssueInboxCredentialValidator = external_exports.object({
35998
36434
  templateUri: external_exports.string().optional().describe(
35999
36435
  "URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
36000
36436
  ),
36437
+ refresh: external_exports.boolean().optional().describe(
36438
+ "Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
36439
+ ),
36440
+ idempotencyKey: external_exports.string().min(1).max(200).optional(),
36001
36441
  // === OPTIONAL FEATURES ===
36002
36442
  // Add major, distinct features at the top level.
36003
36443
  //consentRequest: ConsentRequestValidator.optional(),
36004
36444
  // === PROCESS CONFIGURATION (Optional) ===
36005
36445
  // HOW should this issuance be handled?
36006
36446
  configuration: external_exports.object({
36447
+ guardianEmail: external_exports.string().email().optional().describe(
36448
+ "Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
36449
+ ),
36007
36450
  signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
36008
36451
  "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."
36009
36452
  ),
@@ -36057,17 +36500,130 @@ var IssueInboxCredentialValidator = external_exports.object({
36057
36500
  }).optional().describe(
36058
36501
  "Configuration for the credential issuance. If not provided, the default configuration will be used."
36059
36502
  )
36503
+ }).refine((data) => !data.idempotencyKey || data.refresh === true, {
36504
+ message: "idempotencyKey requires refresh: true."
36060
36505
  }).refine((data) => data.credential || data.templateUri, {
36061
36506
  message: "Either credential or templateUri must be provided.",
36062
36507
  path: ["credential"]
36063
- });
36508
+ }).refine(
36509
+ (data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
36510
+ {
36511
+ message: "guardianEmail must differ from recipient (self-approval not allowed)",
36512
+ path: ["configuration", "guardianEmail"]
36513
+ }
36514
+ );
36064
36515
  var IssueInboxCredentialResponseValidator = external_exports.object({
36516
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
36065
36517
  issuanceId: external_exports.string(),
36066
36518
  status: LCNInboxStatusEnumValidator,
36067
36519
  recipient: ContactMethodQueryValidator,
36068
36520
  claimUrl: external_exports.string().url().optional(),
36069
36521
  recipientDid: external_exports.string().optional()
36070
36522
  });
36523
+ var InboxBatchConfigurationValidator = IssueInboxCredentialValidator.shape.configuration.unwrap().extend({
36524
+ refresh: IssueInboxCredentialValidator.shape.refresh.describe(
36525
+ "Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
36526
+ ),
36527
+ delivery: IssueInboxCredentialValidator.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports.boolean().optional() }).optional()
36528
+ });
36529
+ var InboxBatchItemConfigurationValidator = InboxBatchConfigurationValidator.extend({
36530
+ guardianEmail: InboxBatchConfigurationValidator.shape.guardianEmail.nullable().describe(
36531
+ "Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
36532
+ )
36533
+ });
36534
+ var IssueInboxCredentialBatchItemValidator = external_exports.object({
36535
+ ...IssueInboxCredentialValidator.shape,
36536
+ configuration: InboxBatchItemConfigurationValidator.optional(),
36537
+ idempotencyKey: external_exports.string().max(256).optional()
36538
+ }).refine((data) => data.credential || data.templateUri, {
36539
+ message: "Either credential or templateUri must be provided.",
36540
+ path: ["credential"]
36541
+ }).describe(
36542
+ "One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
36543
+ );
36544
+ var IssueInboxCredentialBatchValidator = external_exports.object({
36545
+ requestId: external_exports.string().min(1).max(256).optional(),
36546
+ items: external_exports.array(IssueInboxCredentialBatchItemValidator).min(1).max(100),
36547
+ configuration: InboxBatchConfigurationValidator.optional()
36548
+ }).superRefine((batch, ctx) => {
36549
+ batch.items.forEach((item, index) => {
36550
+ const itemGuardian = item.configuration?.guardianEmail;
36551
+ const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
36552
+ if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
36553
+ ctx.addIssue({
36554
+ code: "custom",
36555
+ path: ["items", index, "configuration", "guardianEmail"],
36556
+ message: "guardianEmail must differ from recipient (self-approval not allowed)"
36557
+ });
36558
+ }
36559
+ });
36560
+ });
36561
+ var InboxBatchErrorReasonValidator = external_exports.enum([
36562
+ "DUPLICATE_KEY",
36563
+ "IDEMPOTENCY_MISMATCH",
36564
+ "IN_PROGRESS",
36565
+ "UNCONFIRMED"
36566
+ ]);
36567
+ var IssueInboxCredentialBatchItemResultValidator = external_exports.discriminatedUnion("success", [
36568
+ IssueInboxCredentialResponseValidator.extend({
36569
+ success: external_exports.literal(true),
36570
+ index: external_exports.number().int().nonnegative(),
36571
+ deduplicated: external_exports.boolean().optional(),
36572
+ guardianStatus: GuardianStatusValidator.optional(),
36573
+ idempotencyKey: external_exports.string().optional()
36574
+ }),
36575
+ external_exports.object({
36576
+ success: external_exports.literal(false),
36577
+ index: external_exports.number().int().nonnegative(),
36578
+ idempotencyKey: external_exports.string().optional(),
36579
+ recipient: ContactMethodQueryValidator.optional(),
36580
+ error: external_exports.object({
36581
+ code: external_exports.string(),
36582
+ message: external_exports.string(),
36583
+ reason: InboxBatchErrorReasonValidator.optional()
36584
+ }),
36585
+ issuanceId: external_exports.string().optional().describe(
36586
+ "Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
36587
+ ),
36588
+ claimUrl: external_exports.string().url().optional().describe(
36589
+ "Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
36590
+ )
36591
+ })
36592
+ ]);
36593
+ var IssueInboxCredentialBatchResponseValidator = external_exports.object({
36594
+ results: external_exports.array(IssueInboxCredentialBatchItemResultValidator),
36595
+ summary: external_exports.object({
36596
+ total: external_exports.number(),
36597
+ succeeded: external_exports.number(),
36598
+ failed: external_exports.number(),
36599
+ deduplicated: external_exports.number()
36600
+ })
36601
+ });
36602
+ var InboxBatchReceiptValidator = external_exports.object({
36603
+ batchId: external_exports.string(),
36604
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
36605
+ createdAt: external_exports.string()
36606
+ });
36607
+ var InboxBatchStatusValidator = external_exports.object({
36608
+ batchId: external_exports.string(),
36609
+ createdAt: external_exports.string(),
36610
+ done: external_exports.boolean().describe(
36611
+ "True when no queued or processing items remain, including unconfirmed outcomes."
36612
+ ),
36613
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
36614
+ items: external_exports.array(
36615
+ external_exports.object({
36616
+ index: external_exports.number().int().nonnegative(),
36617
+ state: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
36618
+ result: IssueInboxCredentialBatchItemResultValidator.optional()
36619
+ })
36620
+ ),
36621
+ summary: IssueInboxCredentialBatchResponseValidator.shape.summary.extend({
36622
+ completed: external_exports.number(),
36623
+ pending: external_exports.number(),
36624
+ unconfirmed: external_exports.number()
36625
+ })
36626
+ });
36071
36627
  var CredentialNameRefValidator = external_exports.object({ name: external_exports.string() }).passthrough();
36072
36628
  var ClaimInboxCredentialValidator = external_exports.object({
36073
36629
  credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
@@ -36553,6 +37109,7 @@ var CredentialActivityValidator = external_exports.object({
36553
37109
  eventType: CredentialActivityEventTypeValidator,
36554
37110
  timestamp: external_exports.string(),
36555
37111
  actorProfileId: external_exports.string().optional(),
37112
+ onBehalfOf: external_exports.string().optional(),
36556
37113
  recipientType: CredentialActivityRecipientTypeValidator,
36557
37114
  recipientIdentifier: external_exports.string(),
36558
37115
  boostUri: external_exports.string().optional(),
@@ -36702,191 +37259,6 @@ var inAppMessagesFlagValidator = external_exports.object({
36702
37259
  version: external_exports.number().default(1),
36703
37260
  messages: external_exports.array(inAppMessageValidator).default([])
36704
37261
  }).passthrough();
36705
- var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
36706
- var ManagedCredentialRefreshServiceValidator = external_exports.object({
36707
- id: external_exports.string().min(1),
36708
- type: external_exports.literal("LearnCardCredentialRefresh2026"),
36709
- authorization: LearnCardRefreshAuthorizationValidator.optional()
36710
- }).catchall(external_exports.any());
36711
- var StandardCredentialRefreshServiceValidator = external_exports.object({
36712
- id: external_exports.string().min(1),
36713
- type: external_exports.literal("1EdTechCredentialRefresh")
36714
- }).catchall(external_exports.any());
36715
- var SupportedCredentialRefreshServiceValidator = external_exports.union([
36716
- ManagedCredentialRefreshServiceValidator,
36717
- StandardCredentialRefreshServiceValidator
36718
- ]);
36719
- var AllocateCredentialRefreshInputValidator = external_exports.object({
36720
- holder: external_exports.object({
36721
- profileId: external_exports.string().optional(),
36722
- did: external_exports.string().min(1)
36723
- }),
36724
- credentialId: external_exports.string().min(1)
36725
- });
36726
- var AllocateCredentialRefreshResultValidator = external_exports.object({
36727
- refreshId: external_exports.string().min(1),
36728
- refreshService: ManagedCredentialRefreshServiceValidator.extend({
36729
- authorization: LearnCardRefreshAuthorizationValidator
36730
- })
36731
- });
36732
- var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
36733
- var PublishCredentialRefreshBaseFields = {
36734
- refreshId: external_exports.string().min(1),
36735
- notifyHolder: external_exports.boolean().optional(),
36736
- updateSummary: external_exports.string().optional(),
36737
- idempotencyKey: external_exports.string().optional()
36738
- };
36739
- var PublishIssuerSignedRefreshValidator = external_exports.object({
36740
- ...PublishCredentialRefreshBaseFields,
36741
- mode: external_exports.literal("issuer-signed"),
36742
- signedCredential: VCValidator
36743
- });
36744
- var PublishSigningAuthorityRefreshValidator = external_exports.object({
36745
- ...PublishCredentialRefreshBaseFields,
36746
- mode: external_exports.literal("signing-authority"),
36747
- credential: UnsignedVCValidator,
36748
- signingAuthority: external_exports.object({
36749
- type: external_exports.string().min(1)
36750
- }).catchall(external_exports.any())
36751
- });
36752
- var PublishCredentialRefreshInputValidator = external_exports.object({
36753
- ...PublishCredentialRefreshBaseFields,
36754
- mode: CredentialRefreshSigningModeValidator,
36755
- signedCredential: VCValidator.optional(),
36756
- credential: UnsignedVCValidator.optional(),
36757
- signingAuthority: external_exports.object({
36758
- type: external_exports.string().min(1)
36759
- }).catchall(external_exports.any()).optional()
36760
- }).superRefine((input, ctx) => {
36761
- if (input.mode === "issuer-signed" && !input.signedCredential) {
36762
- ctx.addIssue({
36763
- code: "custom",
36764
- path: ["signedCredential"],
36765
- message: "signedCredential is required for issuer-signed publication"
36766
- });
36767
- }
36768
- if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
36769
- ctx.addIssue({
36770
- code: "custom",
36771
- path: ["mode"],
36772
- message: "issuer-signed publication cannot include signing-authority fields"
36773
- });
36774
- }
36775
- if (input.mode === "signing-authority") {
36776
- if (input.signedCredential !== void 0) {
36777
- ctx.addIssue({
36778
- code: "custom",
36779
- path: ["signedCredential"],
36780
- message: "signing-authority publication cannot include signedCredential"
36781
- });
36782
- }
36783
- if (!input.credential) {
36784
- ctx.addIssue({
36785
- code: "custom",
36786
- path: ["credential"],
36787
- message: "credential is required for signing-authority publication"
36788
- });
36789
- }
36790
- if (!input.signingAuthority) {
36791
- ctx.addIssue({
36792
- code: "custom",
36793
- path: ["signingAuthority"],
36794
- message: "signingAuthority is required for signing-authority publication"
36795
- });
36796
- }
36797
- }
36798
- });
36799
- var PublishCredentialRefreshNotificationValidator = external_exports.enum([
36800
- "queued",
36801
- "suppressed",
36802
- "not-applicable",
36803
- /** Publication succeeded, but the post-commit notification enqueue must be retried. */
36804
- "delivery-failed"
36805
- ]);
36806
- var PublishCredentialRefreshResultValidator = external_exports.object({
36807
- refreshId: external_exports.string().min(1),
36808
- version: external_exports.number().int().positive(),
36809
- publishedAt: external_exports.string().min(1),
36810
- notification: PublishCredentialRefreshNotificationValidator
36811
- });
36812
- var CredentialRefreshVersionMetadataValidator = external_exports.object({
36813
- version: external_exports.number().int().positive(),
36814
- publishedAt: external_exports.string().min(1),
36815
- effectiveAt: external_exports.string().optional(),
36816
- etag: external_exports.string().optional(),
36817
- signingMode: CredentialRefreshSigningModeValidator.optional(),
36818
- updateSummary: external_exports.string().optional()
36819
- });
36820
- var GetCredentialRefreshHistoryInputValidator = external_exports.object({
36821
- refreshId: external_exports.string().min(1),
36822
- cursor: external_exports.string().optional(),
36823
- limit: external_exports.number().int().positive().optional()
36824
- });
36825
- var GetCredentialRefreshHistoryResultValidator = external_exports.object({
36826
- records: CredentialRefreshVersionMetadataValidator.array(),
36827
- hasMore: external_exports.boolean(),
36828
- cursor: external_exports.string().optional()
36829
- });
36830
- var CredentialRefreshChallengeValidator = external_exports.object({
36831
- challenge: external_exports.string().min(1),
36832
- expiresAt: external_exports.string().min(1),
36833
- domain: external_exports.string().optional(),
36834
- scheme: external_exports.literal("LearnCardDIDAuth").optional()
36835
- });
36836
- var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
36837
- format: external_exports.literal("vc"),
36838
- credential: VCValidator,
36839
- etag: external_exports.string().optional()
36840
- });
36841
- var JweCredentialRefreshEnvelopeValidator = external_exports.object({
36842
- format: external_exports.literal("jwe"),
36843
- jwe: JWEValidator,
36844
- etag: external_exports.string().optional(),
36845
- /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
36846
- version: external_exports.number().int().positive().optional()
36847
- });
36848
- var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
36849
- PublicCredentialRefreshEnvelopeValidator,
36850
- JweCredentialRefreshEnvelopeValidator
36851
- ]);
36852
- var CredentialRefreshFailureCodeValidator = external_exports.enum([
36853
- "UNAVAILABLE",
36854
- "TIMEOUT",
36855
- "UNSUPPORTED_SERVICE",
36856
- "UNAUTHORIZED",
36857
- "MALFORMED_RESPONSE",
36858
- "INVALID_PROOF",
36859
- "ISSUER_MISMATCH",
36860
- "ID_MISMATCH",
36861
- "ROLLBACK",
36862
- "REVOKED",
36863
- "UNSAFE_ENDPOINT"
36864
- ]);
36865
- var CredentialRefreshUpdatedResultValidator = external_exports.object({
36866
- status: external_exports.literal("updated"),
36867
- credential: VCValidator,
36868
- etag: external_exports.string().optional(),
36869
- managedVersion: external_exports.number().int().positive().optional()
36870
- });
36871
- var CredentialRefreshUnchangedResultValidator = external_exports.object({
36872
- status: external_exports.literal("unchanged"),
36873
- checkedAt: external_exports.string().min(1),
36874
- etag: external_exports.string().optional()
36875
- });
36876
- var CredentialRefreshUnsupportedResultValidator = external_exports.object({
36877
- status: external_exports.literal("unsupported")
36878
- });
36879
- var CredentialRefreshFailedResultValidator = external_exports.object({
36880
- status: external_exports.literal("failed"),
36881
- code: CredentialRefreshFailureCodeValidator,
36882
- retryable: external_exports.boolean()
36883
- });
36884
- var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
36885
- CredentialRefreshUpdatedResultValidator,
36886
- CredentialRefreshUnchangedResultValidator,
36887
- CredentialRefreshUnsupportedResultValidator,
36888
- CredentialRefreshFailedResultValidator
36889
- ]);
36890
37262
 
36891
37263
  // src/read.ts
36892
37264
  var isTemplateRenderMethod = /* @__PURE__ */ __name((rm) => TemplateRenderMethodValidator.safeParse(rm).success, "isTemplateRenderMethod");