@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.
@@ -15949,6 +15949,7 @@ var require_types_cjs_development = __commonJS({
15949
15949
  var __toCommonJS = /* @__PURE__ */ __name2((mod) => __copyProps2(__defProp22({}, "__esModule", { value: true }), mod), "__toCommonJS");
15950
15950
  var index_exports = {};
15951
15951
  __export22(index_exports, {
15952
+ ACT_AS_HEADER: /* @__PURE__ */ __name2(() => ACT_AS_HEADER, "ACT_AS_HEADER"),
15952
15953
  AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: /* @__PURE__ */ __name2(() => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2, "AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX"),
15953
15954
  AchievementCredentialValidator: /* @__PURE__ */ __name2(() => AchievementCredentialValidator2, "AchievementCredentialValidator"),
15954
15955
  AchievementCriteriaValidator: /* @__PURE__ */ __name2(() => AchievementCriteriaValidator2, "AchievementCriteriaValidator"),
@@ -16088,10 +16089,18 @@ var require_types_cjs_development = __commonJS({
16088
16089
  IdentifierTypeValidator: /* @__PURE__ */ __name2(() => IdentifierTypeValidator2, "IdentifierTypeValidator"),
16089
16090
  IdentityObjectValidator: /* @__PURE__ */ __name2(() => IdentityObjectValidator2, "IdentityObjectValidator"),
16090
16091
  ImageValidator: /* @__PURE__ */ __name2(() => ImageValidator2, "ImageValidator"),
16092
+ InboxBatchErrorReasonValidator: /* @__PURE__ */ __name2(() => InboxBatchErrorReasonValidator2, "InboxBatchErrorReasonValidator"),
16093
+ InboxBatchReceiptValidator: /* @__PURE__ */ __name2(() => InboxBatchReceiptValidator2, "InboxBatchReceiptValidator"),
16094
+ InboxBatchStatusValidator: /* @__PURE__ */ __name2(() => InboxBatchStatusValidator2, "InboxBatchStatusValidator"),
16091
16095
  InboxCredentialQueryValidator: /* @__PURE__ */ __name2(() => InboxCredentialQueryValidator2, "InboxCredentialQueryValidator"),
16096
+ InboxCredentialRefreshReceiptValidator: /* @__PURE__ */ __name2(() => InboxCredentialRefreshReceiptValidator2, "InboxCredentialRefreshReceiptValidator"),
16092
16097
  InboxCredentialValidator: /* @__PURE__ */ __name2(() => InboxCredentialValidator2, "InboxCredentialValidator"),
16093
16098
  IncrementCounterEventValidator: /* @__PURE__ */ __name2(() => IncrementCounterEventValidator2, "IncrementCounterEventValidator"),
16094
16099
  InstalledAppValidator: /* @__PURE__ */ __name2(() => InstalledAppValidator2, "InstalledAppValidator"),
16100
+ IssueInboxCredentialBatchItemResultValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchItemResultValidator2, "IssueInboxCredentialBatchItemResultValidator"),
16101
+ IssueInboxCredentialBatchItemValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchItemValidator2, "IssueInboxCredentialBatchItemValidator"),
16102
+ IssueInboxCredentialBatchResponseValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchResponseValidator2, "IssueInboxCredentialBatchResponseValidator"),
16103
+ IssueInboxCredentialBatchValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialBatchValidator2, "IssueInboxCredentialBatchValidator"),
16095
16104
  IssueInboxCredentialResponseValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialResponseValidator2, "IssueInboxCredentialResponseValidator"),
16096
16105
  IssueInboxCredentialValidator: /* @__PURE__ */ __name2(() => IssueInboxCredentialValidator2, "IssueInboxCredentialValidator"),
16097
16106
  IssueInboxSigningAuthorityValidator: /* @__PURE__ */ __name2(() => IssueInboxSigningAuthorityValidator2, "IssueInboxSigningAuthorityValidator"),
@@ -16140,6 +16149,7 @@ var require_types_cjs_development = __commonJS({
16140
16149
  LaunchTypeValidator: /* @__PURE__ */ __name2(() => LaunchTypeValidator2, "LaunchTypeValidator"),
16141
16150
  LearnCardRefreshAuthorizationValidator: /* @__PURE__ */ __name2(() => LearnCardRefreshAuthorizationValidator2, "LearnCardRefreshAuthorizationValidator"),
16142
16151
  LinkProviderFrameworkInputValidator: /* @__PURE__ */ __name2(() => LinkProviderFrameworkInputValidator2, "LinkProviderFrameworkInputValidator"),
16152
+ ManagedCredentialRefreshReceiptValidator: /* @__PURE__ */ __name2(() => ManagedCredentialRefreshReceiptValidator2, "ManagedCredentialRefreshReceiptValidator"),
16143
16153
  ManagedCredentialRefreshServiceValidator: /* @__PURE__ */ __name2(() => ManagedCredentialRefreshServiceValidator2, "ManagedCredentialRefreshServiceValidator"),
16144
16154
  PaginatedAppStoreListingsValidator: /* @__PURE__ */ __name2(() => PaginatedAppStoreListingsValidator2, "PaginatedAppStoreListingsValidator"),
16145
16155
  PaginatedBoostRecipientsValidator: /* @__PURE__ */ __name2(() => PaginatedBoostRecipientsValidator2, "PaginatedBoostRecipientsValidator"),
@@ -16166,6 +16176,8 @@ var require_types_cjs_development = __commonJS({
16166
16176
  PaginatedVisibleLCNProfilesValidator: /* @__PURE__ */ __name2(() => PaginatedVisibleLCNProfilesValidator2, "PaginatedVisibleLCNProfilesValidator"),
16167
16177
  PaginationOptionsValidator: /* @__PURE__ */ __name2(() => PaginationOptionsValidator2, "PaginationOptionsValidator"),
16168
16178
  PaginationResponseValidator: /* @__PURE__ */ __name2(() => PaginationResponseValidator2, "PaginationResponseValidator"),
16179
+ PrepareRefreshableSendInputValidator: /* @__PURE__ */ __name2(() => PrepareRefreshableSendInputValidator2, "PrepareRefreshableSendInputValidator"),
16180
+ PrepareRefreshableSendResultValidator: /* @__PURE__ */ __name2(() => PrepareRefreshableSendResultValidator2, "PrepareRefreshableSendResultValidator"),
16169
16181
  ProfileValidator: /* @__PURE__ */ __name2(() => ProfileValidator2, "ProfileValidator"),
16170
16182
  ProfileVisibilityEnum: /* @__PURE__ */ __name2(() => ProfileVisibilityEnum2, "ProfileVisibilityEnum"),
16171
16183
  PromotionLevelValidator: /* @__PURE__ */ __name2(() => PromotionLevelValidator2, "PromotionLevelValidator"),
@@ -16191,6 +16203,7 @@ var require_types_cjs_development = __commonJS({
16191
16203
  SendAiSessionCredentialEventValidator: /* @__PURE__ */ __name2(() => SendAiSessionCredentialEventValidator2, "SendAiSessionCredentialEventValidator"),
16192
16204
  SendBoostInputValidator: /* @__PURE__ */ __name2(() => SendBoostInputValidator2, "SendBoostInputValidator"),
16193
16205
  SendBoostResponseValidator: /* @__PURE__ */ __name2(() => SendBoostResponseValidator2, "SendBoostResponseValidator"),
16206
+ SendBoostTemplateValidator: /* @__PURE__ */ __name2(() => SendBoostTemplateValidator2, "SendBoostTemplateValidator"),
16194
16207
  SendBrandingOptionsValidator: /* @__PURE__ */ __name2(() => SendBrandingOptionsValidator2, "SendBrandingOptionsValidator"),
16195
16208
  SendCredentialEventValidator: /* @__PURE__ */ __name2(() => SendCredentialEventValidator2, "SendCredentialEventValidator"),
16196
16209
  SendInboxResponseValidator: /* @__PURE__ */ __name2(() => SendInboxResponseValidator2, "SendInboxResponseValidator"),
@@ -16910,7 +16923,7 @@ var require_types_cjs_development = __commonJS({
16910
16923
  getSizableOrigin: /* @__PURE__ */ __name2(() => getSizableOrigin2, "getSizableOrigin"),
16911
16924
  hexToUint8Array: /* @__PURE__ */ __name2(() => hexToUint8Array2, "hexToUint8Array"),
16912
16925
  isObject: /* @__PURE__ */ __name2(() => isObject2, "isObject"),
16913
- isPlainObject: /* @__PURE__ */ __name2(() => isPlainObject3, "isPlainObject"),
16926
+ isPlainObject: /* @__PURE__ */ __name2(() => isPlainObject22, "isPlainObject"),
16914
16927
  issue: /* @__PURE__ */ __name2(() => issue2, "issue"),
16915
16928
  joinValues: /* @__PURE__ */ __name2(() => joinValues2, "joinValues"),
16916
16929
  jsonStringifyReplacer: /* @__PURE__ */ __name2(() => jsonStringifyReplacer2, "jsonStringifyReplacer"),
@@ -17159,7 +17172,7 @@ var require_types_cjs_development = __commonJS({
17159
17172
  return false;
17160
17173
  }
17161
17174
  });
17162
- function isPlainObject3(o) {
17175
+ function isPlainObject22(o) {
17163
17176
  if (isObject2(o) === false)
17164
17177
  return false;
17165
17178
  const ctor = o.constructor;
@@ -17175,11 +17188,11 @@ var require_types_cjs_development = __commonJS({
17175
17188
  }
17176
17189
  return true;
17177
17190
  }
17178
- __name(isPlainObject3, "isPlainObject");
17179
- __name2(isPlainObject3, "isPlainObject");
17180
- __name22(isPlainObject3, "isPlainObject");
17191
+ __name(isPlainObject22, "isPlainObject2");
17192
+ __name2(isPlainObject22, "isPlainObject");
17193
+ __name22(isPlainObject22, "isPlainObject");
17181
17194
  function shallowClone2(o) {
17182
- if (isPlainObject3(o))
17195
+ if (isPlainObject22(o))
17183
17196
  return { ...o };
17184
17197
  if (Array.isArray(o))
17185
17198
  return [...o];
@@ -17413,7 +17426,7 @@ var require_types_cjs_development = __commonJS({
17413
17426
  __name2(omit2, "omit");
17414
17427
  __name22(omit2, "omit");
17415
17428
  function extend2(schema, shape) {
17416
- if (!isPlainObject3(shape)) {
17429
+ if (!isPlainObject22(shape)) {
17417
17430
  throw new Error("Invalid input to extend: expected a plain object");
17418
17431
  }
17419
17432
  const checks = schema._zod.def.checks;
@@ -17439,7 +17452,7 @@ var require_types_cjs_development = __commonJS({
17439
17452
  __name2(extend2, "extend");
17440
17453
  __name22(extend2, "extend");
17441
17454
  function safeExtend2(schema, shape) {
17442
- if (!isPlainObject3(shape)) {
17455
+ if (!isPlainObject22(shape)) {
17443
17456
  throw new Error("Invalid input to safeExtend: expected a plain object");
17444
17457
  }
17445
17458
  const def = mergeDefs2(schema._zod.def, {
@@ -19895,7 +19908,7 @@ var require_types_cjs_development = __commonJS({
19895
19908
  if (a instanceof Date && b instanceof Date && +a === +b) {
19896
19909
  return { valid: true, data: a };
19897
19910
  }
19898
- if (isPlainObject3(a) && isPlainObject3(b)) {
19911
+ if (isPlainObject22(a) && isPlainObject22(b)) {
19899
19912
  const bKeys = Object.keys(b);
19900
19913
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
19901
19914
  const newObj = { ...a, ...b };
@@ -20096,7 +20109,7 @@ var require_types_cjs_development = __commonJS({
20096
20109
  $ZodType2.init(inst, def);
20097
20110
  inst._zod.parse = (payload, ctx) => {
20098
20111
  const input = payload.value;
20099
- if (!isPlainObject3(input)) {
20112
+ if (!isPlainObject22(input)) {
20100
20113
  payload.issues.push({
20101
20114
  expected: "record",
20102
20115
  code: "invalid_type",
@@ -32508,6 +32521,204 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32508
32521
  $or: BaseStringQuery2.array()
32509
32522
  })
32510
32523
  ]);
32524
+ var LearnCardRefreshAuthorizationValidator2 = external_exports2.object({ type: external_exports2.literal("LearnCardDIDAuth") }).catchall(external_exports2.any());
32525
+ var ManagedCredentialRefreshServiceValidator2 = external_exports2.object({
32526
+ id: external_exports2.string().min(1),
32527
+ type: external_exports2.literal("LearnCardCredentialRefresh2026"),
32528
+ authorization: LearnCardRefreshAuthorizationValidator2.optional()
32529
+ }).catchall(external_exports2.any());
32530
+ var StandardCredentialRefreshServiceValidator2 = external_exports2.object({
32531
+ id: external_exports2.string().min(1),
32532
+ type: external_exports2.literal("1EdTechCredentialRefresh")
32533
+ }).catchall(external_exports2.any());
32534
+ var SupportedCredentialRefreshServiceValidator2 = external_exports2.union([
32535
+ ManagedCredentialRefreshServiceValidator2,
32536
+ StandardCredentialRefreshServiceValidator2
32537
+ ]);
32538
+ var AllocateCredentialRefreshInputValidator2 = external_exports2.object({
32539
+ holder: external_exports2.object({
32540
+ profileId: external_exports2.string().optional(),
32541
+ did: external_exports2.string().min(1)
32542
+ }),
32543
+ credentialId: external_exports2.string().min(1)
32544
+ });
32545
+ var AllocateCredentialRefreshResultValidator2 = external_exports2.object({
32546
+ refreshId: external_exports2.string().min(1),
32547
+ refreshService: ManagedCredentialRefreshServiceValidator2.extend({
32548
+ authorization: LearnCardRefreshAuthorizationValidator2
32549
+ })
32550
+ });
32551
+ var ManagedCredentialRefreshReceiptValidator2 = external_exports2.object({
32552
+ refreshId: external_exports2.string().min(1),
32553
+ refreshService: ManagedCredentialRefreshServiceValidator2,
32554
+ credentialId: external_exports2.string().min(1),
32555
+ issuerDid: external_exports2.string().min(1),
32556
+ holderDid: external_exports2.string().min(1),
32557
+ credentialStatus: CredentialStatusValidator2.or(
32558
+ CredentialStatusValidator2.array()
32559
+ ).optional()
32560
+ }).strip();
32561
+ var InboxCredentialRefreshReceiptValidator2 = ManagedCredentialRefreshReceiptValidator2.omit(
32562
+ { holderDid: true }
32563
+ ).extend({ holderDid: external_exports2.string().min(1).optional() });
32564
+ var CredentialRefreshSigningModeValidator2 = external_exports2.enum(["issuer-signed", "signing-authority"]);
32565
+ var PublishCredentialRefreshBaseFields2 = {
32566
+ refreshId: external_exports2.string().min(1),
32567
+ notifyHolder: external_exports2.boolean().optional(),
32568
+ updateSummary: external_exports2.string().optional(),
32569
+ idempotencyKey: external_exports2.string().optional()
32570
+ };
32571
+ var PublishIssuerSignedRefreshValidator2 = external_exports2.object({
32572
+ ...PublishCredentialRefreshBaseFields2,
32573
+ mode: external_exports2.literal("issuer-signed"),
32574
+ signedCredential: VCValidator2
32575
+ });
32576
+ var PublishSigningAuthorityRefreshValidator2 = external_exports2.object({
32577
+ ...PublishCredentialRefreshBaseFields2,
32578
+ mode: external_exports2.literal("signing-authority"),
32579
+ credential: UnsignedVCValidator2,
32580
+ signingAuthority: external_exports2.object({
32581
+ type: external_exports2.string().min(1)
32582
+ }).catchall(external_exports2.any())
32583
+ });
32584
+ var PublishCredentialRefreshInputValidator2 = external_exports2.object({
32585
+ ...PublishCredentialRefreshBaseFields2,
32586
+ mode: CredentialRefreshSigningModeValidator2,
32587
+ signedCredential: VCValidator2.optional(),
32588
+ credential: UnsignedVCValidator2.optional(),
32589
+ signingAuthority: external_exports2.object({
32590
+ type: external_exports2.string().min(1)
32591
+ }).catchall(external_exports2.any()).optional()
32592
+ }).superRefine((input, ctx) => {
32593
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
32594
+ ctx.addIssue({
32595
+ code: "custom",
32596
+ path: ["signedCredential"],
32597
+ message: "signedCredential is required for issuer-signed publication"
32598
+ });
32599
+ }
32600
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
32601
+ ctx.addIssue({
32602
+ code: "custom",
32603
+ path: ["mode"],
32604
+ message: "issuer-signed publication cannot include signing-authority fields"
32605
+ });
32606
+ }
32607
+ if (input.mode === "signing-authority") {
32608
+ if (input.signedCredential !== void 0) {
32609
+ ctx.addIssue({
32610
+ code: "custom",
32611
+ path: ["signedCredential"],
32612
+ message: "signing-authority publication cannot include signedCredential"
32613
+ });
32614
+ }
32615
+ if (!input.credential) {
32616
+ ctx.addIssue({
32617
+ code: "custom",
32618
+ path: ["credential"],
32619
+ message: "credential is required for signing-authority publication"
32620
+ });
32621
+ }
32622
+ if (!input.signingAuthority) {
32623
+ ctx.addIssue({
32624
+ code: "custom",
32625
+ path: ["signingAuthority"],
32626
+ message: "signingAuthority is required for signing-authority publication"
32627
+ });
32628
+ }
32629
+ }
32630
+ });
32631
+ var PublishCredentialRefreshNotificationValidator2 = external_exports2.enum([
32632
+ "queued",
32633
+ "suppressed",
32634
+ "not-applicable",
32635
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
32636
+ "delivery-failed"
32637
+ ]);
32638
+ var PublishCredentialRefreshResultValidator2 = external_exports2.object({
32639
+ refreshId: external_exports2.string().min(1),
32640
+ version: external_exports2.number().int().positive(),
32641
+ publishedAt: external_exports2.string().min(1),
32642
+ notification: PublishCredentialRefreshNotificationValidator2
32643
+ });
32644
+ var CredentialRefreshVersionMetadataValidator2 = external_exports2.object({
32645
+ version: external_exports2.number().int().positive(),
32646
+ publishedAt: external_exports2.string().min(1),
32647
+ effectiveAt: external_exports2.string().optional(),
32648
+ etag: external_exports2.string().optional(),
32649
+ signingMode: CredentialRefreshSigningModeValidator2.optional(),
32650
+ updateSummary: external_exports2.string().optional()
32651
+ });
32652
+ var GetCredentialRefreshHistoryInputValidator2 = external_exports2.object({
32653
+ refreshId: external_exports2.string().min(1),
32654
+ cursor: external_exports2.string().optional(),
32655
+ limit: external_exports2.number().int().positive().optional()
32656
+ });
32657
+ var GetCredentialRefreshHistoryResultValidator2 = external_exports2.object({
32658
+ records: CredentialRefreshVersionMetadataValidator2.array(),
32659
+ hasMore: external_exports2.boolean(),
32660
+ cursor: external_exports2.string().optional()
32661
+ });
32662
+ var CredentialRefreshChallengeValidator2 = external_exports2.object({
32663
+ challenge: external_exports2.string().min(1),
32664
+ expiresAt: external_exports2.string().min(1),
32665
+ domain: external_exports2.string().optional(),
32666
+ scheme: external_exports2.literal("LearnCardDIDAuth").optional()
32667
+ });
32668
+ var PublicCredentialRefreshEnvelopeValidator2 = external_exports2.object({
32669
+ format: external_exports2.literal("vc"),
32670
+ credential: VCValidator2,
32671
+ etag: external_exports2.string().optional()
32672
+ });
32673
+ var JweCredentialRefreshEnvelopeValidator2 = external_exports2.object({
32674
+ format: external_exports2.literal("jwe"),
32675
+ jwe: JWEValidator2,
32676
+ etag: external_exports2.string().optional(),
32677
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
32678
+ version: external_exports2.number().int().positive().optional()
32679
+ });
32680
+ var CredentialRefreshResponseEnvelopeValidator2 = external_exports2.discriminatedUnion("format", [
32681
+ PublicCredentialRefreshEnvelopeValidator2,
32682
+ JweCredentialRefreshEnvelopeValidator2
32683
+ ]);
32684
+ var CredentialRefreshFailureCodeValidator2 = external_exports2.enum([
32685
+ "UNAVAILABLE",
32686
+ "TIMEOUT",
32687
+ "UNSUPPORTED_SERVICE",
32688
+ "UNAUTHORIZED",
32689
+ "MALFORMED_RESPONSE",
32690
+ "INVALID_PROOF",
32691
+ "ISSUER_MISMATCH",
32692
+ "ID_MISMATCH",
32693
+ "ROLLBACK",
32694
+ "REVOKED",
32695
+ "UNSAFE_ENDPOINT"
32696
+ ]);
32697
+ var CredentialRefreshUpdatedResultValidator2 = external_exports2.object({
32698
+ status: external_exports2.literal("updated"),
32699
+ credential: VCValidator2,
32700
+ etag: external_exports2.string().optional(),
32701
+ managedVersion: external_exports2.number().int().positive().optional()
32702
+ });
32703
+ var CredentialRefreshUnchangedResultValidator2 = external_exports2.object({
32704
+ status: external_exports2.literal("unchanged"),
32705
+ checkedAt: external_exports2.string().min(1),
32706
+ etag: external_exports2.string().optional()
32707
+ });
32708
+ var CredentialRefreshUnsupportedResultValidator2 = external_exports2.object({
32709
+ status: external_exports2.literal("unsupported")
32710
+ });
32711
+ var CredentialRefreshFailedResultValidator2 = external_exports2.object({
32712
+ status: external_exports2.literal("failed"),
32713
+ code: CredentialRefreshFailureCodeValidator2,
32714
+ retryable: external_exports2.boolean()
32715
+ });
32716
+ var CredentialRefreshResultValidator2 = external_exports2.discriminatedUnion("status", [
32717
+ CredentialRefreshUpdatedResultValidator2,
32718
+ CredentialRefreshUnchangedResultValidator2,
32719
+ CredentialRefreshUnsupportedResultValidator2,
32720
+ CredentialRefreshFailedResultValidator2
32721
+ ]);
32511
32722
  var LCNProfileDisplayValidator2 = external_exports2.object({
32512
32723
  backgroundColor: external_exports2.string().optional(),
32513
32724
  backgroundImage: external_exports2.string().optional(),
@@ -32843,7 +33054,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32843
33054
  "Options for email/phone recipients (Universal Inbox)"
32844
33055
  ),
32845
33056
  templateData: external_exports2.record(external_exports2.string(), external_exports2.unknown()).optional(),
32846
- integrationId: external_exports2.string().optional().describe("Integration ID for activity tracking")
33057
+ integrationId: external_exports2.string().optional().describe("Integration ID for activity tracking"),
33058
+ refresh: external_exports2.boolean().optional().describe(
33059
+ "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."
33060
+ ),
33061
+ idempotencyKey: external_exports2.string().min(1).max(200).optional().describe(
33062
+ "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."
33063
+ )
32847
33064
  }).refine((data) => data.templateUri || data.template || data.signedCredential, {
32848
33065
  message: "Either templateUri, template, or signedCredential must be provided.",
32849
33066
  path: ["templateUri"]
@@ -32858,8 +33075,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32858
33075
  message: "guardianEmail must differ from recipient (self-approval not allowed)",
32859
33076
  path: ["options", "guardianEmail"]
32860
33077
  }
32861
- );
33078
+ ).refine((data) => !data.idempotencyKey || data.refresh === true, {
33079
+ message: "idempotencyKey is only supported with refresh: true.",
33080
+ path: ["idempotencyKey"]
33081
+ });
32862
33082
  var SendInboxResponseValidator2 = external_exports2.object({
33083
+ refresh: InboxCredentialRefreshReceiptValidator2.optional(),
32863
33084
  issuanceId: external_exports2.string(),
32864
33085
  status: external_exports2.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
32865
33086
  claimUrl: external_exports2.string().url().optional().describe("Present when suppressDelivery=true"),
@@ -32874,8 +33095,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
32874
33095
  activityId: external_exports2.string().describe("Links to the activity lifecycle for this issuance"),
32875
33096
  inbox: SendInboxResponseValidator2.optional().describe(
32876
33097
  "Present when sent via email/phone (Universal Inbox)"
33098
+ ),
33099
+ refresh: ManagedCredentialRefreshReceiptValidator2.optional().describe(
33100
+ "Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
32877
33101
  )
32878
33102
  });
33103
+ var PrepareRefreshableSendInputValidator2 = external_exports2.object({
33104
+ recipient: external_exports2.string(),
33105
+ templateUri: external_exports2.string().optional(),
33106
+ template: SendBoostTemplateValidator2.optional(),
33107
+ contractUri: external_exports2.string().optional(),
33108
+ templateData: external_exports2.record(external_exports2.string(), external_exports2.unknown()).optional(),
33109
+ integrationId: external_exports2.string().optional(),
33110
+ /** Credential ID to allocate for; generated server-side when omitted. */
33111
+ credentialId: external_exports2.string().min(1).optional(),
33112
+ idempotencyKey: external_exports2.string().min(1).max(200).optional()
33113
+ }).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
33114
+ message: "Provide exactly one of templateUri or template."
33115
+ });
33116
+ var PrepareRefreshableSendResultValidator2 = external_exports2.object({
33117
+ boostUri: external_exports2.string(),
33118
+ credentialId: external_exports2.string(),
33119
+ refreshId: external_exports2.string(),
33120
+ refreshService: ManagedCredentialRefreshServiceValidator2,
33121
+ /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
33122
+ holderDid: external_exports2.string(),
33123
+ /** Present when this idempotencyKey already completed: return it without signing. */
33124
+ completed: SendBoostResponseValidator2.optional()
33125
+ });
32879
33126
  var SendInputValidator2 = external_exports2.discriminatedUnion("type", [SendBoostInputValidator2]);
32880
33127
  var SendResponseValidator2 = external_exports2.discriminatedUnion("type", [SendBoostResponseValidator2]);
32881
33128
  var ConsentFlowTermsStatusValidator2 = external_exports2.enum(["live", "stale", "withdrawn"]);
@@ -33194,6 +33441,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33194
33441
  webhookUrl: external_exports2.string().optional()
33195
33442
  });
33196
33443
  var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2 = "auth-grant:";
33444
+ var ACT_AS_HEADER = "X-LearnCard-Act-As";
33197
33445
  var AuthGrantValidator2 = external_exports2.object({
33198
33446
  id: external_exports2.string(),
33199
33447
  name: external_exports2.string(),
@@ -33206,6 +33454,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33206
33454
  }, "error")
33207
33455
  }),
33208
33456
  scope: external_exports2.string(),
33457
+ actAs: external_exports2.string().optional(),
33209
33458
  createdAt: external_exports2.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
33210
33459
  expiresAt: external_exports2.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
33211
33460
  });
@@ -33277,6 +33526,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33277
33526
  sessionJwt: external_exports2.string()
33278
33527
  });
33279
33528
  var InboxCredentialValidator2 = external_exports2.object({
33529
+ refresh: InboxCredentialRefreshReceiptValidator2.optional(),
33530
+ refreshId: external_exports2.string().optional(),
33280
33531
  id: external_exports2.string(),
33281
33532
  credential: external_exports2.string().optional(),
33282
33533
  isSigned: external_exports2.boolean(),
@@ -33331,12 +33582,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33331
33582
  templateUri: external_exports2.string().optional().describe(
33332
33583
  "URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
33333
33584
  ),
33585
+ refresh: external_exports2.boolean().optional().describe(
33586
+ "Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
33587
+ ),
33588
+ idempotencyKey: external_exports2.string().min(1).max(200).optional(),
33334
33589
  // === OPTIONAL FEATURES ===
33335
33590
  // Add major, distinct features at the top level.
33336
33591
  //consentRequest: ConsentRequestValidator.optional(),
33337
33592
  // === PROCESS CONFIGURATION (Optional) ===
33338
33593
  // HOW should this issuance be handled?
33339
33594
  configuration: external_exports2.object({
33595
+ guardianEmail: external_exports2.string().email().optional().describe(
33596
+ "Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
33597
+ ),
33340
33598
  signingAuthority: IssueInboxSigningAuthorityValidator2.optional().describe(
33341
33599
  "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."
33342
33600
  ),
@@ -33390,17 +33648,130 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33390
33648
  }).optional().describe(
33391
33649
  "Configuration for the credential issuance. If not provided, the default configuration will be used."
33392
33650
  )
33651
+ }).refine((data) => !data.idempotencyKey || data.refresh === true, {
33652
+ message: "idempotencyKey requires refresh: true."
33393
33653
  }).refine((data) => data.credential || data.templateUri, {
33394
33654
  message: "Either credential or templateUri must be provided.",
33395
33655
  path: ["credential"]
33396
- });
33656
+ }).refine(
33657
+ (data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
33658
+ {
33659
+ message: "guardianEmail must differ from recipient (self-approval not allowed)",
33660
+ path: ["configuration", "guardianEmail"]
33661
+ }
33662
+ );
33397
33663
  var IssueInboxCredentialResponseValidator2 = external_exports2.object({
33664
+ refresh: InboxCredentialRefreshReceiptValidator2.optional(),
33398
33665
  issuanceId: external_exports2.string(),
33399
33666
  status: LCNInboxStatusEnumValidator2,
33400
33667
  recipient: ContactMethodQueryValidator2,
33401
33668
  claimUrl: external_exports2.string().url().optional(),
33402
33669
  recipientDid: external_exports2.string().optional()
33403
33670
  });
33671
+ var InboxBatchConfigurationValidator2 = IssueInboxCredentialValidator2.shape.configuration.unwrap().extend({
33672
+ refresh: IssueInboxCredentialValidator2.shape.refresh.describe(
33673
+ "Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
33674
+ ),
33675
+ delivery: IssueInboxCredentialValidator2.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports2.boolean().optional() }).optional()
33676
+ });
33677
+ var InboxBatchItemConfigurationValidator2 = InboxBatchConfigurationValidator2.extend({
33678
+ guardianEmail: InboxBatchConfigurationValidator2.shape.guardianEmail.nullable().describe(
33679
+ "Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
33680
+ )
33681
+ });
33682
+ var IssueInboxCredentialBatchItemValidator2 = external_exports2.object({
33683
+ ...IssueInboxCredentialValidator2.shape,
33684
+ configuration: InboxBatchItemConfigurationValidator2.optional(),
33685
+ idempotencyKey: external_exports2.string().max(256).optional()
33686
+ }).refine((data) => data.credential || data.templateUri, {
33687
+ message: "Either credential or templateUri must be provided.",
33688
+ path: ["credential"]
33689
+ }).describe(
33690
+ "One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
33691
+ );
33692
+ var IssueInboxCredentialBatchValidator2 = external_exports2.object({
33693
+ requestId: external_exports2.string().min(1).max(256).optional(),
33694
+ items: external_exports2.array(IssueInboxCredentialBatchItemValidator2).min(1).max(100),
33695
+ configuration: InboxBatchConfigurationValidator2.optional()
33696
+ }).superRefine((batch, ctx) => {
33697
+ batch.items.forEach((item, index) => {
33698
+ const itemGuardian = item.configuration?.guardianEmail;
33699
+ const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
33700
+ if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
33701
+ ctx.addIssue({
33702
+ code: "custom",
33703
+ path: ["items", index, "configuration", "guardianEmail"],
33704
+ message: "guardianEmail must differ from recipient (self-approval not allowed)"
33705
+ });
33706
+ }
33707
+ });
33708
+ });
33709
+ var InboxBatchErrorReasonValidator2 = external_exports2.enum([
33710
+ "DUPLICATE_KEY",
33711
+ "IDEMPOTENCY_MISMATCH",
33712
+ "IN_PROGRESS",
33713
+ "UNCONFIRMED"
33714
+ ]);
33715
+ var IssueInboxCredentialBatchItemResultValidator2 = external_exports2.discriminatedUnion("success", [
33716
+ IssueInboxCredentialResponseValidator2.extend({
33717
+ success: external_exports2.literal(true),
33718
+ index: external_exports2.number().int().nonnegative(),
33719
+ deduplicated: external_exports2.boolean().optional(),
33720
+ guardianStatus: GuardianStatusValidator2.optional(),
33721
+ idempotencyKey: external_exports2.string().optional()
33722
+ }),
33723
+ external_exports2.object({
33724
+ success: external_exports2.literal(false),
33725
+ index: external_exports2.number().int().nonnegative(),
33726
+ idempotencyKey: external_exports2.string().optional(),
33727
+ recipient: ContactMethodQueryValidator2.optional(),
33728
+ error: external_exports2.object({
33729
+ code: external_exports2.string(),
33730
+ message: external_exports2.string(),
33731
+ reason: InboxBatchErrorReasonValidator2.optional()
33732
+ }),
33733
+ issuanceId: external_exports2.string().optional().describe(
33734
+ "Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
33735
+ ),
33736
+ claimUrl: external_exports2.string().url().optional().describe(
33737
+ "Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
33738
+ )
33739
+ })
33740
+ ]);
33741
+ var IssueInboxCredentialBatchResponseValidator2 = external_exports2.object({
33742
+ results: external_exports2.array(IssueInboxCredentialBatchItemResultValidator2),
33743
+ summary: external_exports2.object({
33744
+ total: external_exports2.number(),
33745
+ succeeded: external_exports2.number(),
33746
+ failed: external_exports2.number(),
33747
+ deduplicated: external_exports2.number()
33748
+ })
33749
+ });
33750
+ var InboxBatchReceiptValidator2 = external_exports2.object({
33751
+ batchId: external_exports2.string(),
33752
+ status: external_exports2.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
33753
+ createdAt: external_exports2.string()
33754
+ });
33755
+ var InboxBatchStatusValidator2 = external_exports2.object({
33756
+ batchId: external_exports2.string(),
33757
+ createdAt: external_exports2.string(),
33758
+ done: external_exports2.boolean().describe(
33759
+ "True when no queued or processing items remain, including unconfirmed outcomes."
33760
+ ),
33761
+ status: external_exports2.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
33762
+ items: external_exports2.array(
33763
+ external_exports2.object({
33764
+ index: external_exports2.number().int().nonnegative(),
33765
+ state: external_exports2.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
33766
+ result: IssueInboxCredentialBatchItemResultValidator2.optional()
33767
+ })
33768
+ ),
33769
+ summary: IssueInboxCredentialBatchResponseValidator2.shape.summary.extend({
33770
+ completed: external_exports2.number(),
33771
+ pending: external_exports2.number(),
33772
+ unconfirmed: external_exports2.number()
33773
+ })
33774
+ });
33404
33775
  var CredentialNameRefValidator2 = external_exports2.object({ name: external_exports2.string() }).passthrough();
33405
33776
  var ClaimInboxCredentialValidator2 = external_exports2.object({
33406
33777
  credential: VCValidator2.or(VPValidator2).or(UnsignedVCValidator2).or(CredentialNameRefValidator2).describe("The credential to issue, or a { name } reference to resolve a boost template."),
@@ -33886,6 +34257,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
33886
34257
  eventType: CredentialActivityEventTypeValidator2,
33887
34258
  timestamp: external_exports2.string(),
33888
34259
  actorProfileId: external_exports2.string().optional(),
34260
+ onBehalfOf: external_exports2.string().optional(),
33889
34261
  recipientType: CredentialActivityRecipientTypeValidator2,
33890
34262
  recipientIdentifier: external_exports2.string(),
33891
34263
  boostUri: external_exports2.string().optional(),
@@ -34040,191 +34412,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
34040
34412
  const result = inAppMessagesFlagValidator2.safeParse(raw);
34041
34413
  return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
34042
34414
  }, "parseInAppMessagesFlag");
34043
- var LearnCardRefreshAuthorizationValidator2 = external_exports2.object({ type: external_exports2.literal("LearnCardDIDAuth") }).catchall(external_exports2.any());
34044
- var ManagedCredentialRefreshServiceValidator2 = external_exports2.object({
34045
- id: external_exports2.string().min(1),
34046
- type: external_exports2.literal("LearnCardCredentialRefresh2026"),
34047
- authorization: LearnCardRefreshAuthorizationValidator2.optional()
34048
- }).catchall(external_exports2.any());
34049
- var StandardCredentialRefreshServiceValidator2 = external_exports2.object({
34050
- id: external_exports2.string().min(1),
34051
- type: external_exports2.literal("1EdTechCredentialRefresh")
34052
- }).catchall(external_exports2.any());
34053
- var SupportedCredentialRefreshServiceValidator2 = external_exports2.union([
34054
- ManagedCredentialRefreshServiceValidator2,
34055
- StandardCredentialRefreshServiceValidator2
34056
- ]);
34057
- var AllocateCredentialRefreshInputValidator2 = external_exports2.object({
34058
- holder: external_exports2.object({
34059
- profileId: external_exports2.string().optional(),
34060
- did: external_exports2.string().min(1)
34061
- }),
34062
- credentialId: external_exports2.string().min(1)
34063
- });
34064
- var AllocateCredentialRefreshResultValidator2 = external_exports2.object({
34065
- refreshId: external_exports2.string().min(1),
34066
- refreshService: ManagedCredentialRefreshServiceValidator2.extend({
34067
- authorization: LearnCardRefreshAuthorizationValidator2
34068
- })
34069
- });
34070
- var CredentialRefreshSigningModeValidator2 = external_exports2.enum(["issuer-signed", "signing-authority"]);
34071
- var PublishCredentialRefreshBaseFields2 = {
34072
- refreshId: external_exports2.string().min(1),
34073
- notifyHolder: external_exports2.boolean().optional(),
34074
- updateSummary: external_exports2.string().optional(),
34075
- idempotencyKey: external_exports2.string().optional()
34076
- };
34077
- var PublishIssuerSignedRefreshValidator2 = external_exports2.object({
34078
- ...PublishCredentialRefreshBaseFields2,
34079
- mode: external_exports2.literal("issuer-signed"),
34080
- signedCredential: VCValidator2
34081
- });
34082
- var PublishSigningAuthorityRefreshValidator2 = external_exports2.object({
34083
- ...PublishCredentialRefreshBaseFields2,
34084
- mode: external_exports2.literal("signing-authority"),
34085
- credential: UnsignedVCValidator2,
34086
- signingAuthority: external_exports2.object({
34087
- type: external_exports2.string().min(1)
34088
- }).catchall(external_exports2.any())
34089
- });
34090
- var PublishCredentialRefreshInputValidator2 = external_exports2.object({
34091
- ...PublishCredentialRefreshBaseFields2,
34092
- mode: CredentialRefreshSigningModeValidator2,
34093
- signedCredential: VCValidator2.optional(),
34094
- credential: UnsignedVCValidator2.optional(),
34095
- signingAuthority: external_exports2.object({
34096
- type: external_exports2.string().min(1)
34097
- }).catchall(external_exports2.any()).optional()
34098
- }).superRefine((input, ctx) => {
34099
- if (input.mode === "issuer-signed" && !input.signedCredential) {
34100
- ctx.addIssue({
34101
- code: "custom",
34102
- path: ["signedCredential"],
34103
- message: "signedCredential is required for issuer-signed publication"
34104
- });
34105
- }
34106
- if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
34107
- ctx.addIssue({
34108
- code: "custom",
34109
- path: ["mode"],
34110
- message: "issuer-signed publication cannot include signing-authority fields"
34111
- });
34112
- }
34113
- if (input.mode === "signing-authority") {
34114
- if (input.signedCredential !== void 0) {
34115
- ctx.addIssue({
34116
- code: "custom",
34117
- path: ["signedCredential"],
34118
- message: "signing-authority publication cannot include signedCredential"
34119
- });
34120
- }
34121
- if (!input.credential) {
34122
- ctx.addIssue({
34123
- code: "custom",
34124
- path: ["credential"],
34125
- message: "credential is required for signing-authority publication"
34126
- });
34127
- }
34128
- if (!input.signingAuthority) {
34129
- ctx.addIssue({
34130
- code: "custom",
34131
- path: ["signingAuthority"],
34132
- message: "signingAuthority is required for signing-authority publication"
34133
- });
34134
- }
34135
- }
34136
- });
34137
- var PublishCredentialRefreshNotificationValidator2 = external_exports2.enum([
34138
- "queued",
34139
- "suppressed",
34140
- "not-applicable",
34141
- /** Publication succeeded, but the post-commit notification enqueue must be retried. */
34142
- "delivery-failed"
34143
- ]);
34144
- var PublishCredentialRefreshResultValidator2 = external_exports2.object({
34145
- refreshId: external_exports2.string().min(1),
34146
- version: external_exports2.number().int().positive(),
34147
- publishedAt: external_exports2.string().min(1),
34148
- notification: PublishCredentialRefreshNotificationValidator2
34149
- });
34150
- var CredentialRefreshVersionMetadataValidator2 = external_exports2.object({
34151
- version: external_exports2.number().int().positive(),
34152
- publishedAt: external_exports2.string().min(1),
34153
- effectiveAt: external_exports2.string().optional(),
34154
- etag: external_exports2.string().optional(),
34155
- signingMode: CredentialRefreshSigningModeValidator2.optional(),
34156
- updateSummary: external_exports2.string().optional()
34157
- });
34158
- var GetCredentialRefreshHistoryInputValidator2 = external_exports2.object({
34159
- refreshId: external_exports2.string().min(1),
34160
- cursor: external_exports2.string().optional(),
34161
- limit: external_exports2.number().int().positive().optional()
34162
- });
34163
- var GetCredentialRefreshHistoryResultValidator2 = external_exports2.object({
34164
- records: CredentialRefreshVersionMetadataValidator2.array(),
34165
- hasMore: external_exports2.boolean(),
34166
- cursor: external_exports2.string().optional()
34167
- });
34168
- var CredentialRefreshChallengeValidator2 = external_exports2.object({
34169
- challenge: external_exports2.string().min(1),
34170
- expiresAt: external_exports2.string().min(1),
34171
- domain: external_exports2.string().optional(),
34172
- scheme: external_exports2.literal("LearnCardDIDAuth").optional()
34173
- });
34174
- var PublicCredentialRefreshEnvelopeValidator2 = external_exports2.object({
34175
- format: external_exports2.literal("vc"),
34176
- credential: VCValidator2,
34177
- etag: external_exports2.string().optional()
34178
- });
34179
- var JweCredentialRefreshEnvelopeValidator2 = external_exports2.object({
34180
- format: external_exports2.literal("jwe"),
34181
- jwe: JWEValidator2,
34182
- etag: external_exports2.string().optional(),
34183
- /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
34184
- version: external_exports2.number().int().positive().optional()
34185
- });
34186
- var CredentialRefreshResponseEnvelopeValidator2 = external_exports2.discriminatedUnion("format", [
34187
- PublicCredentialRefreshEnvelopeValidator2,
34188
- JweCredentialRefreshEnvelopeValidator2
34189
- ]);
34190
- var CredentialRefreshFailureCodeValidator2 = external_exports2.enum([
34191
- "UNAVAILABLE",
34192
- "TIMEOUT",
34193
- "UNSUPPORTED_SERVICE",
34194
- "UNAUTHORIZED",
34195
- "MALFORMED_RESPONSE",
34196
- "INVALID_PROOF",
34197
- "ISSUER_MISMATCH",
34198
- "ID_MISMATCH",
34199
- "ROLLBACK",
34200
- "REVOKED",
34201
- "UNSAFE_ENDPOINT"
34202
- ]);
34203
- var CredentialRefreshUpdatedResultValidator2 = external_exports2.object({
34204
- status: external_exports2.literal("updated"),
34205
- credential: VCValidator2,
34206
- etag: external_exports2.string().optional(),
34207
- managedVersion: external_exports2.number().int().positive().optional()
34208
- });
34209
- var CredentialRefreshUnchangedResultValidator2 = external_exports2.object({
34210
- status: external_exports2.literal("unchanged"),
34211
- checkedAt: external_exports2.string().min(1),
34212
- etag: external_exports2.string().optional()
34213
- });
34214
- var CredentialRefreshUnsupportedResultValidator2 = external_exports2.object({
34215
- status: external_exports2.literal("unsupported")
34216
- });
34217
- var CredentialRefreshFailedResultValidator2 = external_exports2.object({
34218
- status: external_exports2.literal("failed"),
34219
- code: CredentialRefreshFailureCodeValidator2,
34220
- retryable: external_exports2.boolean()
34221
- });
34222
- var CredentialRefreshResultValidator2 = external_exports2.discriminatedUnion("status", [
34223
- CredentialRefreshUpdatedResultValidator2,
34224
- CredentialRefreshUnchangedResultValidator2,
34225
- CredentialRefreshUnsupportedResultValidator2,
34226
- CredentialRefreshFailedResultValidator2
34227
- ]);
34228
34415
  }
34229
34416
  });
34230
34417
  var require_dist = __commonJS({
@@ -34520,6 +34707,18 @@ var ImageWithLoadingStateValdator = external_exports.object({
34520
34707
  });
34521
34708
  var import_types2 = __toESM(require_dist());
34522
34709
  var import_types22 = __toESM(require_dist());
34710
+ var MANAGED_REFRESH_TYPE_TERM = "LearnCardCredentialRefresh2026";
34711
+ var MANAGED_REFRESH_DID_AUTH_TERM = "LearnCardDIDAuth";
34712
+ var MANAGED_REFRESH_TYPE_IRI = "https://learncard.com/refresh#LearnCardCredentialRefresh2026";
34713
+ var MANAGED_REFRESH_AUTHORIZATION_IRI = "https://purl.imsglobal.org/spec/ob/v3p0#authorization";
34714
+ var MANAGED_REFRESH_DID_AUTH_IRI = "https://docs.learncard.com/definitions#LearnCardDIDAuth";
34715
+ var MANAGED_REFRESH_SERVICE_CONTEXT = {
34716
+ [MANAGED_REFRESH_TYPE_TERM]: MANAGED_REFRESH_TYPE_IRI,
34717
+ authorization: {
34718
+ "@id": MANAGED_REFRESH_AUTHORIZATION_IRI,
34719
+ "@context": { [MANAGED_REFRESH_DID_AUTH_TERM]: MANAGED_REFRESH_DID_AUTH_IRI }
34720
+ }
34721
+ };
34523
34722
  var _a4;
34524
34723
  var EnvironmentConfigurationError = (_a4 = class extends Error {
34525
34724
  constructor(message) {
@@ -35142,6 +35341,204 @@ var StringQuery = external_exports.union([
35142
35341
  $or: BaseStringQuery.array()
35143
35342
  })
35144
35343
  ]);
35344
+ var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
35345
+ var ManagedCredentialRefreshServiceValidator = external_exports.object({
35346
+ id: external_exports.string().min(1),
35347
+ type: external_exports.literal("LearnCardCredentialRefresh2026"),
35348
+ authorization: LearnCardRefreshAuthorizationValidator.optional()
35349
+ }).catchall(external_exports.any());
35350
+ var StandardCredentialRefreshServiceValidator = external_exports.object({
35351
+ id: external_exports.string().min(1),
35352
+ type: external_exports.literal("1EdTechCredentialRefresh")
35353
+ }).catchall(external_exports.any());
35354
+ var SupportedCredentialRefreshServiceValidator = external_exports.union([
35355
+ ManagedCredentialRefreshServiceValidator,
35356
+ StandardCredentialRefreshServiceValidator
35357
+ ]);
35358
+ var AllocateCredentialRefreshInputValidator = external_exports.object({
35359
+ holder: external_exports.object({
35360
+ profileId: external_exports.string().optional(),
35361
+ did: external_exports.string().min(1)
35362
+ }),
35363
+ credentialId: external_exports.string().min(1)
35364
+ });
35365
+ var AllocateCredentialRefreshResultValidator = external_exports.object({
35366
+ refreshId: external_exports.string().min(1),
35367
+ refreshService: ManagedCredentialRefreshServiceValidator.extend({
35368
+ authorization: LearnCardRefreshAuthorizationValidator
35369
+ })
35370
+ });
35371
+ var ManagedCredentialRefreshReceiptValidator = external_exports.object({
35372
+ refreshId: external_exports.string().min(1),
35373
+ refreshService: ManagedCredentialRefreshServiceValidator,
35374
+ credentialId: external_exports.string().min(1),
35375
+ issuerDid: external_exports.string().min(1),
35376
+ holderDid: external_exports.string().min(1),
35377
+ credentialStatus: CredentialStatusValidator.or(
35378
+ CredentialStatusValidator.array()
35379
+ ).optional()
35380
+ }).strip();
35381
+ var InboxCredentialRefreshReceiptValidator = ManagedCredentialRefreshReceiptValidator.omit(
35382
+ { holderDid: true }
35383
+ ).extend({ holderDid: external_exports.string().min(1).optional() });
35384
+ var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
35385
+ var PublishCredentialRefreshBaseFields = {
35386
+ refreshId: external_exports.string().min(1),
35387
+ notifyHolder: external_exports.boolean().optional(),
35388
+ updateSummary: external_exports.string().optional(),
35389
+ idempotencyKey: external_exports.string().optional()
35390
+ };
35391
+ var PublishIssuerSignedRefreshValidator = external_exports.object({
35392
+ ...PublishCredentialRefreshBaseFields,
35393
+ mode: external_exports.literal("issuer-signed"),
35394
+ signedCredential: VCValidator
35395
+ });
35396
+ var PublishSigningAuthorityRefreshValidator = external_exports.object({
35397
+ ...PublishCredentialRefreshBaseFields,
35398
+ mode: external_exports.literal("signing-authority"),
35399
+ credential: UnsignedVCValidator,
35400
+ signingAuthority: external_exports.object({
35401
+ type: external_exports.string().min(1)
35402
+ }).catchall(external_exports.any())
35403
+ });
35404
+ var PublishCredentialRefreshInputValidator = external_exports.object({
35405
+ ...PublishCredentialRefreshBaseFields,
35406
+ mode: CredentialRefreshSigningModeValidator,
35407
+ signedCredential: VCValidator.optional(),
35408
+ credential: UnsignedVCValidator.optional(),
35409
+ signingAuthority: external_exports.object({
35410
+ type: external_exports.string().min(1)
35411
+ }).catchall(external_exports.any()).optional()
35412
+ }).superRefine((input, ctx) => {
35413
+ if (input.mode === "issuer-signed" && !input.signedCredential) {
35414
+ ctx.addIssue({
35415
+ code: "custom",
35416
+ path: ["signedCredential"],
35417
+ message: "signedCredential is required for issuer-signed publication"
35418
+ });
35419
+ }
35420
+ if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
35421
+ ctx.addIssue({
35422
+ code: "custom",
35423
+ path: ["mode"],
35424
+ message: "issuer-signed publication cannot include signing-authority fields"
35425
+ });
35426
+ }
35427
+ if (input.mode === "signing-authority") {
35428
+ if (input.signedCredential !== void 0) {
35429
+ ctx.addIssue({
35430
+ code: "custom",
35431
+ path: ["signedCredential"],
35432
+ message: "signing-authority publication cannot include signedCredential"
35433
+ });
35434
+ }
35435
+ if (!input.credential) {
35436
+ ctx.addIssue({
35437
+ code: "custom",
35438
+ path: ["credential"],
35439
+ message: "credential is required for signing-authority publication"
35440
+ });
35441
+ }
35442
+ if (!input.signingAuthority) {
35443
+ ctx.addIssue({
35444
+ code: "custom",
35445
+ path: ["signingAuthority"],
35446
+ message: "signingAuthority is required for signing-authority publication"
35447
+ });
35448
+ }
35449
+ }
35450
+ });
35451
+ var PublishCredentialRefreshNotificationValidator = external_exports.enum([
35452
+ "queued",
35453
+ "suppressed",
35454
+ "not-applicable",
35455
+ /** Publication succeeded, but the post-commit notification enqueue must be retried. */
35456
+ "delivery-failed"
35457
+ ]);
35458
+ var PublishCredentialRefreshResultValidator = external_exports.object({
35459
+ refreshId: external_exports.string().min(1),
35460
+ version: external_exports.number().int().positive(),
35461
+ publishedAt: external_exports.string().min(1),
35462
+ notification: PublishCredentialRefreshNotificationValidator
35463
+ });
35464
+ var CredentialRefreshVersionMetadataValidator = external_exports.object({
35465
+ version: external_exports.number().int().positive(),
35466
+ publishedAt: external_exports.string().min(1),
35467
+ effectiveAt: external_exports.string().optional(),
35468
+ etag: external_exports.string().optional(),
35469
+ signingMode: CredentialRefreshSigningModeValidator.optional(),
35470
+ updateSummary: external_exports.string().optional()
35471
+ });
35472
+ var GetCredentialRefreshHistoryInputValidator = external_exports.object({
35473
+ refreshId: external_exports.string().min(1),
35474
+ cursor: external_exports.string().optional(),
35475
+ limit: external_exports.number().int().positive().optional()
35476
+ });
35477
+ var GetCredentialRefreshHistoryResultValidator = external_exports.object({
35478
+ records: CredentialRefreshVersionMetadataValidator.array(),
35479
+ hasMore: external_exports.boolean(),
35480
+ cursor: external_exports.string().optional()
35481
+ });
35482
+ var CredentialRefreshChallengeValidator = external_exports.object({
35483
+ challenge: external_exports.string().min(1),
35484
+ expiresAt: external_exports.string().min(1),
35485
+ domain: external_exports.string().optional(),
35486
+ scheme: external_exports.literal("LearnCardDIDAuth").optional()
35487
+ });
35488
+ var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
35489
+ format: external_exports.literal("vc"),
35490
+ credential: VCValidator,
35491
+ etag: external_exports.string().optional()
35492
+ });
35493
+ var JweCredentialRefreshEnvelopeValidator = external_exports.object({
35494
+ format: external_exports.literal("jwe"),
35495
+ jwe: JWEValidator,
35496
+ etag: external_exports.string().optional(),
35497
+ /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
35498
+ version: external_exports.number().int().positive().optional()
35499
+ });
35500
+ var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
35501
+ PublicCredentialRefreshEnvelopeValidator,
35502
+ JweCredentialRefreshEnvelopeValidator
35503
+ ]);
35504
+ var CredentialRefreshFailureCodeValidator = external_exports.enum([
35505
+ "UNAVAILABLE",
35506
+ "TIMEOUT",
35507
+ "UNSUPPORTED_SERVICE",
35508
+ "UNAUTHORIZED",
35509
+ "MALFORMED_RESPONSE",
35510
+ "INVALID_PROOF",
35511
+ "ISSUER_MISMATCH",
35512
+ "ID_MISMATCH",
35513
+ "ROLLBACK",
35514
+ "REVOKED",
35515
+ "UNSAFE_ENDPOINT"
35516
+ ]);
35517
+ var CredentialRefreshUpdatedResultValidator = external_exports.object({
35518
+ status: external_exports.literal("updated"),
35519
+ credential: VCValidator,
35520
+ etag: external_exports.string().optional(),
35521
+ managedVersion: external_exports.number().int().positive().optional()
35522
+ });
35523
+ var CredentialRefreshUnchangedResultValidator = external_exports.object({
35524
+ status: external_exports.literal("unchanged"),
35525
+ checkedAt: external_exports.string().min(1),
35526
+ etag: external_exports.string().optional()
35527
+ });
35528
+ var CredentialRefreshUnsupportedResultValidator = external_exports.object({
35529
+ status: external_exports.literal("unsupported")
35530
+ });
35531
+ var CredentialRefreshFailedResultValidator = external_exports.object({
35532
+ status: external_exports.literal("failed"),
35533
+ code: CredentialRefreshFailureCodeValidator,
35534
+ retryable: external_exports.boolean()
35535
+ });
35536
+ var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
35537
+ CredentialRefreshUpdatedResultValidator,
35538
+ CredentialRefreshUnchangedResultValidator,
35539
+ CredentialRefreshUnsupportedResultValidator,
35540
+ CredentialRefreshFailedResultValidator
35541
+ ]);
35145
35542
  var LCNProfileDisplayValidator = external_exports.object({
35146
35543
  backgroundColor: external_exports.string().optional(),
35147
35544
  backgroundImage: external_exports.string().optional(),
@@ -35477,7 +35874,13 @@ var SendBoostInputValidator = external_exports.object({
35477
35874
  "Options for email/phone recipients (Universal Inbox)"
35478
35875
  ),
35479
35876
  templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
35480
- integrationId: external_exports.string().optional().describe("Integration ID for activity tracking")
35877
+ integrationId: external_exports.string().optional().describe("Integration ID for activity tracking"),
35878
+ refresh: external_exports.boolean().optional().describe(
35879
+ "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."
35880
+ ),
35881
+ idempotencyKey: external_exports.string().min(1).max(200).optional().describe(
35882
+ "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."
35883
+ )
35481
35884
  }).refine((data) => data.templateUri || data.template || data.signedCredential, {
35482
35885
  message: "Either templateUri, template, or signedCredential must be provided.",
35483
35886
  path: ["templateUri"]
@@ -35492,8 +35895,12 @@ var SendBoostInputValidator = external_exports.object({
35492
35895
  message: "guardianEmail must differ from recipient (self-approval not allowed)",
35493
35896
  path: ["options", "guardianEmail"]
35494
35897
  }
35495
- );
35898
+ ).refine((data) => !data.idempotencyKey || data.refresh === true, {
35899
+ message: "idempotencyKey is only supported with refresh: true.",
35900
+ path: ["idempotencyKey"]
35901
+ });
35496
35902
  var SendInboxResponseValidator = external_exports.object({
35903
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
35497
35904
  issuanceId: external_exports.string(),
35498
35905
  status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
35499
35906
  claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
@@ -35508,8 +35915,34 @@ var SendBoostResponseValidator = external_exports.object({
35508
35915
  activityId: external_exports.string().describe("Links to the activity lifecycle for this issuance"),
35509
35916
  inbox: SendInboxResponseValidator.optional().describe(
35510
35917
  "Present when sent via email/phone (Universal Inbox)"
35918
+ ),
35919
+ refresh: ManagedCredentialRefreshReceiptValidator.optional().describe(
35920
+ "Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
35511
35921
  )
35512
35922
  });
35923
+ var PrepareRefreshableSendInputValidator = external_exports.object({
35924
+ recipient: external_exports.string(),
35925
+ templateUri: external_exports.string().optional(),
35926
+ template: SendBoostTemplateValidator.optional(),
35927
+ contractUri: external_exports.string().optional(),
35928
+ templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
35929
+ integrationId: external_exports.string().optional(),
35930
+ /** Credential ID to allocate for; generated server-side when omitted. */
35931
+ credentialId: external_exports.string().min(1).optional(),
35932
+ idempotencyKey: external_exports.string().min(1).max(200).optional()
35933
+ }).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
35934
+ message: "Provide exactly one of templateUri or template."
35935
+ });
35936
+ var PrepareRefreshableSendResultValidator = external_exports.object({
35937
+ boostUri: external_exports.string(),
35938
+ credentialId: external_exports.string(),
35939
+ refreshId: external_exports.string(),
35940
+ refreshService: ManagedCredentialRefreshServiceValidator,
35941
+ /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
35942
+ holderDid: external_exports.string(),
35943
+ /** Present when this idempotencyKey already completed: return it without signing. */
35944
+ completed: SendBoostResponseValidator.optional()
35945
+ });
35513
35946
  var SendInputValidator = external_exports.discriminatedUnion("type", [SendBoostInputValidator]);
35514
35947
  var SendResponseValidator = external_exports.discriminatedUnion("type", [SendBoostResponseValidator]);
35515
35948
  var ConsentFlowTermsStatusValidator = external_exports.enum(["live", "stale", "withdrawn"]);
@@ -35840,6 +36273,7 @@ var AuthGrantValidator = external_exports.object({
35840
36273
  }, "error")
35841
36274
  }),
35842
36275
  scope: external_exports.string(),
36276
+ actAs: external_exports.string().optional(),
35843
36277
  createdAt: external_exports.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
35844
36278
  expiresAt: external_exports.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
35845
36279
  });
@@ -35911,6 +36345,8 @@ var CreateContactMethodSessionResponseValidator = external_exports.object({
35911
36345
  sessionJwt: external_exports.string()
35912
36346
  });
35913
36347
  var InboxCredentialValidator = external_exports.object({
36348
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
36349
+ refreshId: external_exports.string().optional(),
35914
36350
  id: external_exports.string(),
35915
36351
  credential: external_exports.string().optional(),
35916
36352
  isSigned: external_exports.boolean(),
@@ -35965,12 +36401,19 @@ var IssueInboxCredentialValidator = external_exports.object({
35965
36401
  templateUri: external_exports.string().optional().describe(
35966
36402
  "URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
35967
36403
  ),
36404
+ refresh: external_exports.boolean().optional().describe(
36405
+ "Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
36406
+ ),
36407
+ idempotencyKey: external_exports.string().min(1).max(200).optional(),
35968
36408
  // === OPTIONAL FEATURES ===
35969
36409
  // Add major, distinct features at the top level.
35970
36410
  //consentRequest: ConsentRequestValidator.optional(),
35971
36411
  // === PROCESS CONFIGURATION (Optional) ===
35972
36412
  // HOW should this issuance be handled?
35973
36413
  configuration: external_exports.object({
36414
+ guardianEmail: external_exports.string().email().optional().describe(
36415
+ "Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
36416
+ ),
35974
36417
  signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
35975
36418
  "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."
35976
36419
  ),
@@ -36024,17 +36467,130 @@ var IssueInboxCredentialValidator = external_exports.object({
36024
36467
  }).optional().describe(
36025
36468
  "Configuration for the credential issuance. If not provided, the default configuration will be used."
36026
36469
  )
36470
+ }).refine((data) => !data.idempotencyKey || data.refresh === true, {
36471
+ message: "idempotencyKey requires refresh: true."
36027
36472
  }).refine((data) => data.credential || data.templateUri, {
36028
36473
  message: "Either credential or templateUri must be provided.",
36029
36474
  path: ["credential"]
36030
- });
36475
+ }).refine(
36476
+ (data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
36477
+ {
36478
+ message: "guardianEmail must differ from recipient (self-approval not allowed)",
36479
+ path: ["configuration", "guardianEmail"]
36480
+ }
36481
+ );
36031
36482
  var IssueInboxCredentialResponseValidator = external_exports.object({
36483
+ refresh: InboxCredentialRefreshReceiptValidator.optional(),
36032
36484
  issuanceId: external_exports.string(),
36033
36485
  status: LCNInboxStatusEnumValidator,
36034
36486
  recipient: ContactMethodQueryValidator,
36035
36487
  claimUrl: external_exports.string().url().optional(),
36036
36488
  recipientDid: external_exports.string().optional()
36037
36489
  });
36490
+ var InboxBatchConfigurationValidator = IssueInboxCredentialValidator.shape.configuration.unwrap().extend({
36491
+ refresh: IssueInboxCredentialValidator.shape.refresh.describe(
36492
+ "Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
36493
+ ),
36494
+ delivery: IssueInboxCredentialValidator.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports.boolean().optional() }).optional()
36495
+ });
36496
+ var InboxBatchItemConfigurationValidator = InboxBatchConfigurationValidator.extend({
36497
+ guardianEmail: InboxBatchConfigurationValidator.shape.guardianEmail.nullable().describe(
36498
+ "Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
36499
+ )
36500
+ });
36501
+ var IssueInboxCredentialBatchItemValidator = external_exports.object({
36502
+ ...IssueInboxCredentialValidator.shape,
36503
+ configuration: InboxBatchItemConfigurationValidator.optional(),
36504
+ idempotencyKey: external_exports.string().max(256).optional()
36505
+ }).refine((data) => data.credential || data.templateUri, {
36506
+ message: "Either credential or templateUri must be provided.",
36507
+ path: ["credential"]
36508
+ }).describe(
36509
+ "One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
36510
+ );
36511
+ var IssueInboxCredentialBatchValidator = external_exports.object({
36512
+ requestId: external_exports.string().min(1).max(256).optional(),
36513
+ items: external_exports.array(IssueInboxCredentialBatchItemValidator).min(1).max(100),
36514
+ configuration: InboxBatchConfigurationValidator.optional()
36515
+ }).superRefine((batch, ctx) => {
36516
+ batch.items.forEach((item, index) => {
36517
+ const itemGuardian = item.configuration?.guardianEmail;
36518
+ const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
36519
+ if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
36520
+ ctx.addIssue({
36521
+ code: "custom",
36522
+ path: ["items", index, "configuration", "guardianEmail"],
36523
+ message: "guardianEmail must differ from recipient (self-approval not allowed)"
36524
+ });
36525
+ }
36526
+ });
36527
+ });
36528
+ var InboxBatchErrorReasonValidator = external_exports.enum([
36529
+ "DUPLICATE_KEY",
36530
+ "IDEMPOTENCY_MISMATCH",
36531
+ "IN_PROGRESS",
36532
+ "UNCONFIRMED"
36533
+ ]);
36534
+ var IssueInboxCredentialBatchItemResultValidator = external_exports.discriminatedUnion("success", [
36535
+ IssueInboxCredentialResponseValidator.extend({
36536
+ success: external_exports.literal(true),
36537
+ index: external_exports.number().int().nonnegative(),
36538
+ deduplicated: external_exports.boolean().optional(),
36539
+ guardianStatus: GuardianStatusValidator.optional(),
36540
+ idempotencyKey: external_exports.string().optional()
36541
+ }),
36542
+ external_exports.object({
36543
+ success: external_exports.literal(false),
36544
+ index: external_exports.number().int().nonnegative(),
36545
+ idempotencyKey: external_exports.string().optional(),
36546
+ recipient: ContactMethodQueryValidator.optional(),
36547
+ error: external_exports.object({
36548
+ code: external_exports.string(),
36549
+ message: external_exports.string(),
36550
+ reason: InboxBatchErrorReasonValidator.optional()
36551
+ }),
36552
+ issuanceId: external_exports.string().optional().describe(
36553
+ "Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
36554
+ ),
36555
+ claimUrl: external_exports.string().url().optional().describe(
36556
+ "Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
36557
+ )
36558
+ })
36559
+ ]);
36560
+ var IssueInboxCredentialBatchResponseValidator = external_exports.object({
36561
+ results: external_exports.array(IssueInboxCredentialBatchItemResultValidator),
36562
+ summary: external_exports.object({
36563
+ total: external_exports.number(),
36564
+ succeeded: external_exports.number(),
36565
+ failed: external_exports.number(),
36566
+ deduplicated: external_exports.number()
36567
+ })
36568
+ });
36569
+ var InboxBatchReceiptValidator = external_exports.object({
36570
+ batchId: external_exports.string(),
36571
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
36572
+ createdAt: external_exports.string()
36573
+ });
36574
+ var InboxBatchStatusValidator = external_exports.object({
36575
+ batchId: external_exports.string(),
36576
+ createdAt: external_exports.string(),
36577
+ done: external_exports.boolean().describe(
36578
+ "True when no queued or processing items remain, including unconfirmed outcomes."
36579
+ ),
36580
+ status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
36581
+ items: external_exports.array(
36582
+ external_exports.object({
36583
+ index: external_exports.number().int().nonnegative(),
36584
+ state: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
36585
+ result: IssueInboxCredentialBatchItemResultValidator.optional()
36586
+ })
36587
+ ),
36588
+ summary: IssueInboxCredentialBatchResponseValidator.shape.summary.extend({
36589
+ completed: external_exports.number(),
36590
+ pending: external_exports.number(),
36591
+ unconfirmed: external_exports.number()
36592
+ })
36593
+ });
36038
36594
  var CredentialNameRefValidator = external_exports.object({ name: external_exports.string() }).passthrough();
36039
36595
  var ClaimInboxCredentialValidator = external_exports.object({
36040
36596
  credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
@@ -36520,6 +37076,7 @@ var CredentialActivityValidator = external_exports.object({
36520
37076
  eventType: CredentialActivityEventTypeValidator,
36521
37077
  timestamp: external_exports.string(),
36522
37078
  actorProfileId: external_exports.string().optional(),
37079
+ onBehalfOf: external_exports.string().optional(),
36523
37080
  recipientType: CredentialActivityRecipientTypeValidator,
36524
37081
  recipientIdentifier: external_exports.string(),
36525
37082
  boostUri: external_exports.string().optional(),
@@ -36669,191 +37226,6 @@ var inAppMessagesFlagValidator = external_exports.object({
36669
37226
  version: external_exports.number().default(1),
36670
37227
  messages: external_exports.array(inAppMessageValidator).default([])
36671
37228
  }).passthrough();
36672
- var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
36673
- var ManagedCredentialRefreshServiceValidator = external_exports.object({
36674
- id: external_exports.string().min(1),
36675
- type: external_exports.literal("LearnCardCredentialRefresh2026"),
36676
- authorization: LearnCardRefreshAuthorizationValidator.optional()
36677
- }).catchall(external_exports.any());
36678
- var StandardCredentialRefreshServiceValidator = external_exports.object({
36679
- id: external_exports.string().min(1),
36680
- type: external_exports.literal("1EdTechCredentialRefresh")
36681
- }).catchall(external_exports.any());
36682
- var SupportedCredentialRefreshServiceValidator = external_exports.union([
36683
- ManagedCredentialRefreshServiceValidator,
36684
- StandardCredentialRefreshServiceValidator
36685
- ]);
36686
- var AllocateCredentialRefreshInputValidator = external_exports.object({
36687
- holder: external_exports.object({
36688
- profileId: external_exports.string().optional(),
36689
- did: external_exports.string().min(1)
36690
- }),
36691
- credentialId: external_exports.string().min(1)
36692
- });
36693
- var AllocateCredentialRefreshResultValidator = external_exports.object({
36694
- refreshId: external_exports.string().min(1),
36695
- refreshService: ManagedCredentialRefreshServiceValidator.extend({
36696
- authorization: LearnCardRefreshAuthorizationValidator
36697
- })
36698
- });
36699
- var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
36700
- var PublishCredentialRefreshBaseFields = {
36701
- refreshId: external_exports.string().min(1),
36702
- notifyHolder: external_exports.boolean().optional(),
36703
- updateSummary: external_exports.string().optional(),
36704
- idempotencyKey: external_exports.string().optional()
36705
- };
36706
- var PublishIssuerSignedRefreshValidator = external_exports.object({
36707
- ...PublishCredentialRefreshBaseFields,
36708
- mode: external_exports.literal("issuer-signed"),
36709
- signedCredential: VCValidator
36710
- });
36711
- var PublishSigningAuthorityRefreshValidator = external_exports.object({
36712
- ...PublishCredentialRefreshBaseFields,
36713
- mode: external_exports.literal("signing-authority"),
36714
- credential: UnsignedVCValidator,
36715
- signingAuthority: external_exports.object({
36716
- type: external_exports.string().min(1)
36717
- }).catchall(external_exports.any())
36718
- });
36719
- var PublishCredentialRefreshInputValidator = external_exports.object({
36720
- ...PublishCredentialRefreshBaseFields,
36721
- mode: CredentialRefreshSigningModeValidator,
36722
- signedCredential: VCValidator.optional(),
36723
- credential: UnsignedVCValidator.optional(),
36724
- signingAuthority: external_exports.object({
36725
- type: external_exports.string().min(1)
36726
- }).catchall(external_exports.any()).optional()
36727
- }).superRefine((input, ctx) => {
36728
- if (input.mode === "issuer-signed" && !input.signedCredential) {
36729
- ctx.addIssue({
36730
- code: "custom",
36731
- path: ["signedCredential"],
36732
- message: "signedCredential is required for issuer-signed publication"
36733
- });
36734
- }
36735
- if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
36736
- ctx.addIssue({
36737
- code: "custom",
36738
- path: ["mode"],
36739
- message: "issuer-signed publication cannot include signing-authority fields"
36740
- });
36741
- }
36742
- if (input.mode === "signing-authority") {
36743
- if (input.signedCredential !== void 0) {
36744
- ctx.addIssue({
36745
- code: "custom",
36746
- path: ["signedCredential"],
36747
- message: "signing-authority publication cannot include signedCredential"
36748
- });
36749
- }
36750
- if (!input.credential) {
36751
- ctx.addIssue({
36752
- code: "custom",
36753
- path: ["credential"],
36754
- message: "credential is required for signing-authority publication"
36755
- });
36756
- }
36757
- if (!input.signingAuthority) {
36758
- ctx.addIssue({
36759
- code: "custom",
36760
- path: ["signingAuthority"],
36761
- message: "signingAuthority is required for signing-authority publication"
36762
- });
36763
- }
36764
- }
36765
- });
36766
- var PublishCredentialRefreshNotificationValidator = external_exports.enum([
36767
- "queued",
36768
- "suppressed",
36769
- "not-applicable",
36770
- /** Publication succeeded, but the post-commit notification enqueue must be retried. */
36771
- "delivery-failed"
36772
- ]);
36773
- var PublishCredentialRefreshResultValidator = external_exports.object({
36774
- refreshId: external_exports.string().min(1),
36775
- version: external_exports.number().int().positive(),
36776
- publishedAt: external_exports.string().min(1),
36777
- notification: PublishCredentialRefreshNotificationValidator
36778
- });
36779
- var CredentialRefreshVersionMetadataValidator = external_exports.object({
36780
- version: external_exports.number().int().positive(),
36781
- publishedAt: external_exports.string().min(1),
36782
- effectiveAt: external_exports.string().optional(),
36783
- etag: external_exports.string().optional(),
36784
- signingMode: CredentialRefreshSigningModeValidator.optional(),
36785
- updateSummary: external_exports.string().optional()
36786
- });
36787
- var GetCredentialRefreshHistoryInputValidator = external_exports.object({
36788
- refreshId: external_exports.string().min(1),
36789
- cursor: external_exports.string().optional(),
36790
- limit: external_exports.number().int().positive().optional()
36791
- });
36792
- var GetCredentialRefreshHistoryResultValidator = external_exports.object({
36793
- records: CredentialRefreshVersionMetadataValidator.array(),
36794
- hasMore: external_exports.boolean(),
36795
- cursor: external_exports.string().optional()
36796
- });
36797
- var CredentialRefreshChallengeValidator = external_exports.object({
36798
- challenge: external_exports.string().min(1),
36799
- expiresAt: external_exports.string().min(1),
36800
- domain: external_exports.string().optional(),
36801
- scheme: external_exports.literal("LearnCardDIDAuth").optional()
36802
- });
36803
- var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
36804
- format: external_exports.literal("vc"),
36805
- credential: VCValidator,
36806
- etag: external_exports.string().optional()
36807
- });
36808
- var JweCredentialRefreshEnvelopeValidator = external_exports.object({
36809
- format: external_exports.literal("jwe"),
36810
- jwe: JWEValidator,
36811
- etag: external_exports.string().optional(),
36812
- /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
36813
- version: external_exports.number().int().positive().optional()
36814
- });
36815
- var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
36816
- PublicCredentialRefreshEnvelopeValidator,
36817
- JweCredentialRefreshEnvelopeValidator
36818
- ]);
36819
- var CredentialRefreshFailureCodeValidator = external_exports.enum([
36820
- "UNAVAILABLE",
36821
- "TIMEOUT",
36822
- "UNSUPPORTED_SERVICE",
36823
- "UNAUTHORIZED",
36824
- "MALFORMED_RESPONSE",
36825
- "INVALID_PROOF",
36826
- "ISSUER_MISMATCH",
36827
- "ID_MISMATCH",
36828
- "ROLLBACK",
36829
- "REVOKED",
36830
- "UNSAFE_ENDPOINT"
36831
- ]);
36832
- var CredentialRefreshUpdatedResultValidator = external_exports.object({
36833
- status: external_exports.literal("updated"),
36834
- credential: VCValidator,
36835
- etag: external_exports.string().optional(),
36836
- managedVersion: external_exports.number().int().positive().optional()
36837
- });
36838
- var CredentialRefreshUnchangedResultValidator = external_exports.object({
36839
- status: external_exports.literal("unchanged"),
36840
- checkedAt: external_exports.string().min(1),
36841
- etag: external_exports.string().optional()
36842
- });
36843
- var CredentialRefreshUnsupportedResultValidator = external_exports.object({
36844
- status: external_exports.literal("unsupported")
36845
- });
36846
- var CredentialRefreshFailedResultValidator = external_exports.object({
36847
- status: external_exports.literal("failed"),
36848
- code: CredentialRefreshFailureCodeValidator,
36849
- retryable: external_exports.boolean()
36850
- });
36851
- var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
36852
- CredentialRefreshUpdatedResultValidator,
36853
- CredentialRefreshUnchangedResultValidator,
36854
- CredentialRefreshUnsupportedResultValidator,
36855
- CredentialRefreshFailedResultValidator
36856
- ]);
36857
37229
 
36858
37230
  // src/read.ts
36859
37231
  var isTemplateRenderMethod = /* @__PURE__ */ __name((rm) => TemplateRenderMethodValidator.safeParse(rm).success, "isTemplateRenderMethod");