@learncard/types 5.20.0 → 5.22.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.
- package/dist/auth.d.ts +251 -7
- package/dist/auth.d.ts.map +1 -1
- package/dist/credential-refresh.d.ts +53 -0
- package/dist/credential-refresh.d.ts.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lcn.d.ts +5225 -2489
- package/dist/lcn.d.ts.map +1 -1
- package/dist/share-links.d.ts +1846 -0
- package/dist/share-links.d.ts.map +1 -0
- package/dist/types.cjs.development.cjs +880 -170
- package/dist/types.cjs.development.cjs.map +4 -4
- package/dist/types.cjs.production.min.cjs +32 -32
- package/dist/types.cjs.production.min.cjs.map +4 -4
- package/dist/types.esm.js +1746 -1034
- package/dist/types.esm.js.map +4 -4
- package/package.json +1 -1
- package/src/auth.ts +280 -8
- package/src/credential-refresh.ts +35 -1
- package/src/index.ts +1 -0
- package/src/lcn.ts +246 -3
- package/src/share-links.ts +856 -0
|
@@ -21,12 +21,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
// src/index.ts
|
|
22
22
|
var index_exports = {};
|
|
23
23
|
__export(index_exports, {
|
|
24
|
+
ACT_AS_HEADER: () => ACT_AS_HEADER,
|
|
24
25
|
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
|
|
25
26
|
AchievementCredentialValidator: () => AchievementCredentialValidator,
|
|
26
27
|
AchievementCriteriaValidator: () => AchievementCriteriaValidator,
|
|
27
28
|
AchievementSubjectValidator: () => AchievementSubjectValidator,
|
|
28
29
|
AchievementTypeValidator: () => AchievementTypeValidator,
|
|
29
30
|
AchievementValidator: () => AchievementValidator,
|
|
31
|
+
AcknowledgeViewInputValidator: () => AcknowledgeViewInputValidator,
|
|
32
|
+
AcknowledgeViewOutputValidator: () => AcknowledgeViewOutputValidator,
|
|
30
33
|
AddTagInputValidator: () => AddTagInputValidator,
|
|
31
34
|
AddressValidator: () => AddressValidator,
|
|
32
35
|
AgeRatingValidator: () => AgeRatingValidator,
|
|
@@ -104,6 +107,7 @@ __export(index_exports, {
|
|
|
104
107
|
CreateContactMethodSessionValidator: () => CreateContactMethodSessionValidator,
|
|
105
108
|
CreateManagedFrameworkBatchInputValidator: () => CreateManagedFrameworkBatchInputValidator,
|
|
106
109
|
CreateManagedFrameworkInputValidator: () => CreateManagedFrameworkInputValidator,
|
|
110
|
+
CreateShareLinkInputValidator: () => CreateShareLinkInputValidator,
|
|
107
111
|
CreateSkillInputValidator: () => CreateSkillInputValidator,
|
|
108
112
|
CreateSkillsBatchInputValidator: () => CreateSkillsBatchInputValidator,
|
|
109
113
|
CredentialActivityEventTypeValidator: () => CredentialActivityEventTypeValidator,
|
|
@@ -135,10 +139,14 @@ __export(index_exports, {
|
|
|
135
139
|
DeleteSkillInputValidator: () => DeleteSkillInputValidator,
|
|
136
140
|
DidDocumentValidator: () => DidDocumentValidator,
|
|
137
141
|
EMPTY_IN_APP_MESSAGES_FLAG: () => EMPTY_IN_APP_MESSAGES_FLAG,
|
|
142
|
+
ESCROW_PIN_LOCKED_MESSAGE: () => ESCROW_PIN_LOCKED_MESSAGE,
|
|
143
|
+
ESCROW_PIN_MISMATCH_PATTERN: () => ESCROW_PIN_MISMATCH_PATTERN,
|
|
144
|
+
ESCROW_PIN_UNAVAILABLE_MESSAGE: () => ESCROW_PIN_UNAVAILABLE_MESSAGE,
|
|
138
145
|
EncryptedCredentialRecordValidator: () => EncryptedCredentialRecordValidator,
|
|
139
146
|
EncryptedRecordValidator: () => EncryptedRecordValidator,
|
|
140
147
|
EndorsementCredentialValidator: () => EndorsementCredentialValidator,
|
|
141
148
|
EndorsementSubjectValidator: () => EndorsementSubjectValidator,
|
|
149
|
+
EscrowPinStatusValidator: () => EscrowPinStatusValidator,
|
|
142
150
|
EvidenceValidator: () => EvidenceValidator,
|
|
143
151
|
FlatAuthGrantValidator: () => FlatAuthGrantValidator,
|
|
144
152
|
FrameworkWithSkillsValidator: () => FrameworkWithSkillsValidator,
|
|
@@ -160,10 +168,18 @@ __export(index_exports, {
|
|
|
160
168
|
IdentifierTypeValidator: () => IdentifierTypeValidator,
|
|
161
169
|
IdentityObjectValidator: () => IdentityObjectValidator,
|
|
162
170
|
ImageValidator: () => ImageValidator,
|
|
171
|
+
InboxBatchErrorReasonValidator: () => InboxBatchErrorReasonValidator,
|
|
172
|
+
InboxBatchReceiptValidator: () => InboxBatchReceiptValidator,
|
|
173
|
+
InboxBatchStatusValidator: () => InboxBatchStatusValidator,
|
|
163
174
|
InboxCredentialQueryValidator: () => InboxCredentialQueryValidator,
|
|
175
|
+
InboxCredentialRefreshReceiptValidator: () => InboxCredentialRefreshReceiptValidator,
|
|
164
176
|
InboxCredentialValidator: () => InboxCredentialValidator,
|
|
165
177
|
IncrementCounterEventValidator: () => IncrementCounterEventValidator,
|
|
166
178
|
InstalledAppValidator: () => InstalledAppValidator,
|
|
179
|
+
IssueInboxCredentialBatchItemResultValidator: () => IssueInboxCredentialBatchItemResultValidator,
|
|
180
|
+
IssueInboxCredentialBatchItemValidator: () => IssueInboxCredentialBatchItemValidator,
|
|
181
|
+
IssueInboxCredentialBatchResponseValidator: () => IssueInboxCredentialBatchResponseValidator,
|
|
182
|
+
IssueInboxCredentialBatchValidator: () => IssueInboxCredentialBatchValidator,
|
|
167
183
|
IssueInboxCredentialResponseValidator: () => IssueInboxCredentialResponseValidator,
|
|
168
184
|
IssueInboxCredentialValidator: () => IssueInboxCredentialValidator,
|
|
169
185
|
IssueInboxSigningAuthorityValidator: () => IssueInboxSigningAuthorityValidator,
|
|
@@ -212,6 +228,15 @@ __export(index_exports, {
|
|
|
212
228
|
LaunchTypeValidator: () => LaunchTypeValidator,
|
|
213
229
|
LearnCardRefreshAuthorizationValidator: () => LearnCardRefreshAuthorizationValidator,
|
|
214
230
|
LinkProviderFrameworkInputValidator: () => LinkProviderFrameworkInputValidator,
|
|
231
|
+
ListShareLinksInputValidator: () => ListShareLinksInputValidator,
|
|
232
|
+
MAX_ENDORSEMENTS: () => MAX_ENDORSEMENTS,
|
|
233
|
+
MAX_SELECTED_CREDENTIALS: () => MAX_SELECTED_CREDENTIALS,
|
|
234
|
+
MAX_SHARE_CIPHERTEXT_BYTES: () => MAX_SHARE_CIPHERTEXT_BYTES,
|
|
235
|
+
MAX_SHARE_LINK_REQUEST_BYTES: () => MAX_SHARE_LINK_REQUEST_BYTES,
|
|
236
|
+
MAX_SHARE_RECOVERY_JWE_BYTES: () => MAX_SHARE_RECOVERY_JWE_BYTES,
|
|
237
|
+
MAX_SHARE_SOURCE_URI_CHARS: () => MAX_SHARE_SOURCE_URI_CHARS,
|
|
238
|
+
MAX_VP_MEMBERS: () => MAX_VP_MEMBERS,
|
|
239
|
+
ManagedCredentialRefreshReceiptValidator: () => ManagedCredentialRefreshReceiptValidator,
|
|
215
240
|
ManagedCredentialRefreshServiceValidator: () => ManagedCredentialRefreshServiceValidator,
|
|
216
241
|
PaginatedAppStoreListingsValidator: () => PaginatedAppStoreListingsValidator,
|
|
217
242
|
PaginatedBoostRecipientsValidator: () => PaginatedBoostRecipientsValidator,
|
|
@@ -233,11 +258,14 @@ __export(index_exports, {
|
|
|
233
258
|
PaginatedLCNProfileManagersValidator: () => PaginatedLCNProfileManagersValidator,
|
|
234
259
|
PaginatedLCNProfilesAndManagersValidator: () => PaginatedLCNProfilesAndManagersValidator,
|
|
235
260
|
PaginatedLCNProfilesValidator: () => PaginatedLCNProfilesValidator,
|
|
261
|
+
PaginatedShareLinksValidator: () => PaginatedShareLinksValidator,
|
|
236
262
|
PaginatedSkillFrameworksValidator: () => PaginatedSkillFrameworksValidator,
|
|
237
263
|
PaginatedSkillTreeValidator: () => PaginatedSkillTreeValidator,
|
|
238
264
|
PaginatedVisibleLCNProfilesValidator: () => PaginatedVisibleLCNProfilesValidator,
|
|
239
265
|
PaginationOptionsValidator: () => PaginationOptionsValidator,
|
|
240
266
|
PaginationResponseValidator: () => PaginationResponseValidator,
|
|
267
|
+
PrepareRefreshableSendInputValidator: () => PrepareRefreshableSendInputValidator,
|
|
268
|
+
PrepareRefreshableSendResultValidator: () => PrepareRefreshableSendResultValidator,
|
|
241
269
|
ProfileValidator: () => ProfileValidator,
|
|
242
270
|
ProfileVisibilityEnum: () => ProfileVisibilityEnum,
|
|
243
271
|
PromotionLevelValidator: () => PromotionLevelValidator,
|
|
@@ -255,14 +283,24 @@ __export(index_exports, {
|
|
|
255
283
|
ReplaceSkillFrameworkSkillsInputValidator: () => ReplaceSkillFrameworkSkillsInputValidator,
|
|
256
284
|
ReplaceSkillFrameworkSkillsResultValidator: () => ReplaceSkillFrameworkSkillsResultValidator,
|
|
257
285
|
RequestLearnerContextEventValidator: () => RequestLearnerContextEventValidator,
|
|
286
|
+
ResolveShareLinkInputValidator: () => ResolveShareLinkInputValidator,
|
|
258
287
|
ResultDescriptionValidator: () => ResultDescriptionValidator,
|
|
259
288
|
ResultStatusTypeValidator: () => ResultStatusTypeValidator,
|
|
260
289
|
ResultTypeValidator: () => ResultTypeValidator,
|
|
261
290
|
ResultValidator: () => ResultValidator,
|
|
262
291
|
RubricCriterionValidator: () => RubricCriterionValidator,
|
|
292
|
+
SHARE_AAD_PREFIX: () => SHARE_AAD_PREFIX,
|
|
293
|
+
SHARE_CONTENT_KEY_BYTES: () => SHARE_CONTENT_KEY_BYTES,
|
|
294
|
+
SHARE_IV_BYTES: () => SHARE_IV_BYTES,
|
|
295
|
+
SHARE_LINK_ID_BYTES: () => SHARE_LINK_ID_BYTES,
|
|
296
|
+
SHARE_LINK_PROTOCOL: () => SHARE_LINK_PROTOCOL,
|
|
297
|
+
SHARE_RECOVERY_PROTOCOL: () => SHARE_RECOVERY_PROTOCOL,
|
|
298
|
+
SHARE_TAG_BYTES: () => SHARE_TAG_BYTES,
|
|
299
|
+
SHARE_VIEW_RECEIPT_TTL_SECONDS: () => SHARE_VIEW_RECEIPT_TTL_SECONDS,
|
|
263
300
|
SendAiSessionCredentialEventValidator: () => SendAiSessionCredentialEventValidator,
|
|
264
301
|
SendBoostInputValidator: () => SendBoostInputValidator,
|
|
265
302
|
SendBoostResponseValidator: () => SendBoostResponseValidator,
|
|
303
|
+
SendBoostTemplateValidator: () => SendBoostTemplateValidator,
|
|
266
304
|
SendBrandingOptionsValidator: () => SendBrandingOptionsValidator,
|
|
267
305
|
SendCredentialEventValidator: () => SendCredentialEventValidator,
|
|
268
306
|
SendInboxResponseValidator: () => SendInboxResponseValidator,
|
|
@@ -273,6 +311,32 @@ __export(index_exports, {
|
|
|
273
311
|
SentCredentialInfoValidator: () => SentCredentialInfoValidator,
|
|
274
312
|
ServiceValidator: () => ServiceValidator,
|
|
275
313
|
SetPrimaryContactMethodValidator: () => SetPrimaryContactMethodValidator,
|
|
314
|
+
ShareCiphertextValidator: () => ShareCiphertextValidator,
|
|
315
|
+
ShareContentKeyValidator: () => ShareContentKeyValidator,
|
|
316
|
+
ShareContentStateValidator: () => ShareContentStateValidator,
|
|
317
|
+
ShareEndorsementEntryValidator: () => ShareEndorsementEntryValidator,
|
|
318
|
+
ShareEnvelopeValidator: () => ShareEnvelopeValidator,
|
|
319
|
+
ShareIvValidator: () => ShareIvValidator,
|
|
320
|
+
ShareLinkIdInputValidator: () => ShareLinkIdInputValidator,
|
|
321
|
+
ShareLinkIdValidator: () => ShareLinkIdValidator,
|
|
322
|
+
ShareLinkOperationKeyInputValidator: () => ShareLinkOperationKeyInputValidator,
|
|
323
|
+
ShareLinkOwnerCommitOutputValidator: () => ShareLinkOwnerCommitOutputValidator,
|
|
324
|
+
ShareLinkOwnerContentOutputValidator: () => ShareLinkOwnerContentOutputValidator,
|
|
325
|
+
ShareLinkOwnerRecoveryOutputValidator: () => ShareLinkOwnerRecoveryOutputValidator,
|
|
326
|
+
ShareLinkOwnerStatusOutputValidator: () => ShareLinkOwnerStatusOutputValidator,
|
|
327
|
+
ShareLinkPublicContentViewValidator: () => ShareLinkPublicContentViewValidator,
|
|
328
|
+
ShareLinkPublicStateValidator: () => ShareLinkPublicStateValidator,
|
|
329
|
+
ShareLinkStatusValidator: () => ShareLinkStatusValidator,
|
|
330
|
+
ShareLinkValidator: () => ShareLinkValidator,
|
|
331
|
+
ShareManifestPresentationValidator: () => ShareManifestPresentationValidator,
|
|
332
|
+
ShareOwnerRecoveryValidator: () => ShareOwnerRecoveryValidator,
|
|
333
|
+
SharePayloadValidator: () => SharePayloadValidator,
|
|
334
|
+
SharePayloadValidatorShape: () => SharePayloadValidatorShape,
|
|
335
|
+
ShareRecoveryEndorsementValidator: () => ShareRecoveryEndorsementValidator,
|
|
336
|
+
ShareRecoveryPlaintextValidator: () => ShareRecoveryPlaintextValidator,
|
|
337
|
+
ShareRecoverySelectionValidator: () => ShareRecoverySelectionValidator,
|
|
338
|
+
ShareSelectionEntryValidator: () => ShareSelectionEntryValidator,
|
|
339
|
+
ShareSharerValidator: () => ShareSharerValidator,
|
|
276
340
|
SkillDeletionStrategyValidator: () => SkillDeletionStrategyValidator,
|
|
277
341
|
SkillFrameworkAdminInputValidator: () => SkillFrameworkAdminInputValidator,
|
|
278
342
|
SkillFrameworkAdminsValidator: () => SkillFrameworkAdminsValidator,
|
|
@@ -304,6 +368,7 @@ __export(index_exports, {
|
|
|
304
368
|
UnsignedVCValidator: () => UnsignedVCValidator,
|
|
305
369
|
UnsignedVPValidator: () => UnsignedVPValidator,
|
|
306
370
|
UpdateFrameworkInputValidator: () => UpdateFrameworkInputValidator,
|
|
371
|
+
UpdateShareLinkInputValidator: () => UpdateShareLinkInputValidator,
|
|
307
372
|
UpdateSkillInputValidator: () => UpdateSkillInputValidator,
|
|
308
373
|
VC2EvidenceValidator: () => VC2EvidenceValidator,
|
|
309
374
|
VCValidator: () => VCValidator,
|
|
@@ -315,7 +380,12 @@ __export(index_exports, {
|
|
|
315
380
|
VerificationStatusValidator: () => VerificationStatusValidator,
|
|
316
381
|
appStoreActionValidator: () => appStoreActionValidator,
|
|
317
382
|
capgoUpdateActionValidator: () => capgoUpdateActionValidator,
|
|
383
|
+
classifyShareManifest: () => classifyShareManifest,
|
|
384
|
+
decodeBase64Url: () => decodeBase64Url,
|
|
385
|
+
decodedBase64UrlByteLength: () => decodedBase64UrlByteLength,
|
|
318
386
|
dismissActionValidator: () => dismissActionValidator,
|
|
387
|
+
encodeBase64Url: () => encodeBase64Url,
|
|
388
|
+
escrowPinMismatchMessage: () => escrowPinMismatchMessage,
|
|
319
389
|
externalLinkActionValidator: () => externalLinkActionValidator,
|
|
320
390
|
inAppMessageActionStyleValidator: () => inAppMessageActionStyleValidator,
|
|
321
391
|
inAppMessageActionTargetValidator: () => inAppMessageActionTargetValidator,
|
|
@@ -330,10 +400,12 @@ __export(index_exports, {
|
|
|
330
400
|
inAppMessageVersionSourceValidator: () => inAppMessageVersionSourceValidator,
|
|
331
401
|
inAppMessagesFlagValidator: () => inAppMessagesFlagValidator,
|
|
332
402
|
internalLinkActionValidator: () => internalLinkActionValidator,
|
|
403
|
+
isCanonicalBase64Url: () => isCanonicalBase64Url,
|
|
333
404
|
isStoredCredentialEnvelope: () => isStoredCredentialEnvelope,
|
|
334
405
|
parseInAppMessagesFlag: () => parseInAppMessagesFlag,
|
|
335
406
|
platformPredicateValidator: () => platformPredicateValidator,
|
|
336
407
|
rolePredicateValidator: () => rolePredicateValidator,
|
|
408
|
+
utf8ByteLength: () => utf8ByteLength,
|
|
337
409
|
versionPredicateValidator: () => versionPredicateValidator
|
|
338
410
|
});
|
|
339
411
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -15916,6 +15988,206 @@ var StringQuery = external_exports.union([
|
|
|
15916
15988
|
})
|
|
15917
15989
|
]);
|
|
15918
15990
|
|
|
15991
|
+
// src/credential-refresh.ts
|
|
15992
|
+
var LearnCardRefreshAuthorizationValidator = external_exports.object({ type: external_exports.literal("LearnCardDIDAuth") }).catchall(external_exports.any());
|
|
15993
|
+
var ManagedCredentialRefreshServiceValidator = external_exports.object({
|
|
15994
|
+
id: external_exports.string().min(1),
|
|
15995
|
+
type: external_exports.literal("LearnCardCredentialRefresh2026"),
|
|
15996
|
+
authorization: LearnCardRefreshAuthorizationValidator.optional()
|
|
15997
|
+
}).catchall(external_exports.any());
|
|
15998
|
+
var StandardCredentialRefreshServiceValidator = external_exports.object({
|
|
15999
|
+
id: external_exports.string().min(1),
|
|
16000
|
+
type: external_exports.literal("1EdTechCredentialRefresh")
|
|
16001
|
+
}).catchall(external_exports.any());
|
|
16002
|
+
var SupportedCredentialRefreshServiceValidator = external_exports.union([
|
|
16003
|
+
ManagedCredentialRefreshServiceValidator,
|
|
16004
|
+
StandardCredentialRefreshServiceValidator
|
|
16005
|
+
]);
|
|
16006
|
+
var AllocateCredentialRefreshInputValidator = external_exports.object({
|
|
16007
|
+
holder: external_exports.object({
|
|
16008
|
+
profileId: external_exports.string().optional(),
|
|
16009
|
+
did: external_exports.string().min(1)
|
|
16010
|
+
}),
|
|
16011
|
+
credentialId: external_exports.string().min(1)
|
|
16012
|
+
});
|
|
16013
|
+
var AllocateCredentialRefreshResultValidator = external_exports.object({
|
|
16014
|
+
refreshId: external_exports.string().min(1),
|
|
16015
|
+
refreshService: ManagedCredentialRefreshServiceValidator.extend({
|
|
16016
|
+
authorization: LearnCardRefreshAuthorizationValidator
|
|
16017
|
+
})
|
|
16018
|
+
});
|
|
16019
|
+
var ManagedCredentialRefreshReceiptValidator = external_exports.object({
|
|
16020
|
+
refreshId: external_exports.string().min(1),
|
|
16021
|
+
refreshService: ManagedCredentialRefreshServiceValidator,
|
|
16022
|
+
credentialId: external_exports.string().min(1),
|
|
16023
|
+
issuerDid: external_exports.string().min(1),
|
|
16024
|
+
holderDid: external_exports.string().min(1),
|
|
16025
|
+
credentialStatus: CredentialStatusValidator.or(
|
|
16026
|
+
CredentialStatusValidator.array()
|
|
16027
|
+
).optional()
|
|
16028
|
+
}).strip();
|
|
16029
|
+
var InboxCredentialRefreshReceiptValidator = ManagedCredentialRefreshReceiptValidator.omit(
|
|
16030
|
+
{ holderDid: true }
|
|
16031
|
+
).extend({ holderDid: external_exports.string().min(1).optional() });
|
|
16032
|
+
var CredentialRefreshSigningModeValidator = external_exports.enum(["issuer-signed", "signing-authority"]);
|
|
16033
|
+
var PublishCredentialRefreshBaseFields = {
|
|
16034
|
+
refreshId: external_exports.string().min(1),
|
|
16035
|
+
notifyHolder: external_exports.boolean().optional(),
|
|
16036
|
+
updateSummary: external_exports.string().optional(),
|
|
16037
|
+
idempotencyKey: external_exports.string().optional()
|
|
16038
|
+
};
|
|
16039
|
+
var PublishIssuerSignedRefreshValidator = external_exports.object({
|
|
16040
|
+
...PublishCredentialRefreshBaseFields,
|
|
16041
|
+
mode: external_exports.literal("issuer-signed"),
|
|
16042
|
+
signedCredential: VCValidator
|
|
16043
|
+
});
|
|
16044
|
+
var PublishSigningAuthorityRefreshValidator = external_exports.object({
|
|
16045
|
+
...PublishCredentialRefreshBaseFields,
|
|
16046
|
+
mode: external_exports.literal("signing-authority"),
|
|
16047
|
+
credential: UnsignedVCValidator,
|
|
16048
|
+
signingAuthority: external_exports.object({
|
|
16049
|
+
type: external_exports.string().min(1)
|
|
16050
|
+
}).catchall(external_exports.any())
|
|
16051
|
+
});
|
|
16052
|
+
var PublishCredentialRefreshInputValidator = external_exports.object({
|
|
16053
|
+
...PublishCredentialRefreshBaseFields,
|
|
16054
|
+
mode: CredentialRefreshSigningModeValidator,
|
|
16055
|
+
signedCredential: VCValidator.optional(),
|
|
16056
|
+
credential: UnsignedVCValidator.optional(),
|
|
16057
|
+
signingAuthority: external_exports.object({
|
|
16058
|
+
type: external_exports.string().min(1)
|
|
16059
|
+
}).catchall(external_exports.any()).optional()
|
|
16060
|
+
}).superRefine((input, ctx) => {
|
|
16061
|
+
if (input.mode === "issuer-signed" && !input.signedCredential) {
|
|
16062
|
+
ctx.addIssue({
|
|
16063
|
+
code: "custom",
|
|
16064
|
+
path: ["signedCredential"],
|
|
16065
|
+
message: "signedCredential is required for issuer-signed publication"
|
|
16066
|
+
});
|
|
16067
|
+
}
|
|
16068
|
+
if (input.mode === "issuer-signed" && (input.credential !== void 0 || input.signingAuthority !== void 0)) {
|
|
16069
|
+
ctx.addIssue({
|
|
16070
|
+
code: "custom",
|
|
16071
|
+
path: ["mode"],
|
|
16072
|
+
message: "issuer-signed publication cannot include signing-authority fields"
|
|
16073
|
+
});
|
|
16074
|
+
}
|
|
16075
|
+
if (input.mode === "signing-authority") {
|
|
16076
|
+
if (input.signedCredential !== void 0) {
|
|
16077
|
+
ctx.addIssue({
|
|
16078
|
+
code: "custom",
|
|
16079
|
+
path: ["signedCredential"],
|
|
16080
|
+
message: "signing-authority publication cannot include signedCredential"
|
|
16081
|
+
});
|
|
16082
|
+
}
|
|
16083
|
+
if (!input.credential) {
|
|
16084
|
+
ctx.addIssue({
|
|
16085
|
+
code: "custom",
|
|
16086
|
+
path: ["credential"],
|
|
16087
|
+
message: "credential is required for signing-authority publication"
|
|
16088
|
+
});
|
|
16089
|
+
}
|
|
16090
|
+
if (!input.signingAuthority) {
|
|
16091
|
+
ctx.addIssue({
|
|
16092
|
+
code: "custom",
|
|
16093
|
+
path: ["signingAuthority"],
|
|
16094
|
+
message: "signingAuthority is required for signing-authority publication"
|
|
16095
|
+
});
|
|
16096
|
+
}
|
|
16097
|
+
}
|
|
16098
|
+
});
|
|
16099
|
+
var PublishCredentialRefreshNotificationValidator = external_exports.enum([
|
|
16100
|
+
"queued",
|
|
16101
|
+
"suppressed",
|
|
16102
|
+
"not-applicable",
|
|
16103
|
+
/** Publication succeeded, but the post-commit notification enqueue must be retried. */
|
|
16104
|
+
"delivery-failed"
|
|
16105
|
+
]);
|
|
16106
|
+
var PublishCredentialRefreshResultValidator = external_exports.object({
|
|
16107
|
+
refreshId: external_exports.string().min(1),
|
|
16108
|
+
version: external_exports.number().int().positive(),
|
|
16109
|
+
publishedAt: external_exports.string().min(1),
|
|
16110
|
+
notification: PublishCredentialRefreshNotificationValidator
|
|
16111
|
+
});
|
|
16112
|
+
var CredentialRefreshVersionMetadataValidator = external_exports.object({
|
|
16113
|
+
version: external_exports.number().int().positive(),
|
|
16114
|
+
publishedAt: external_exports.string().min(1),
|
|
16115
|
+
effectiveAt: external_exports.string().optional(),
|
|
16116
|
+
etag: external_exports.string().optional(),
|
|
16117
|
+
signingMode: CredentialRefreshSigningModeValidator.optional(),
|
|
16118
|
+
updateSummary: external_exports.string().optional()
|
|
16119
|
+
});
|
|
16120
|
+
var GetCredentialRefreshHistoryInputValidator = external_exports.object({
|
|
16121
|
+
refreshId: external_exports.string().min(1),
|
|
16122
|
+
cursor: external_exports.string().optional(),
|
|
16123
|
+
limit: external_exports.number().int().positive().optional()
|
|
16124
|
+
});
|
|
16125
|
+
var GetCredentialRefreshHistoryResultValidator = external_exports.object({
|
|
16126
|
+
records: CredentialRefreshVersionMetadataValidator.array(),
|
|
16127
|
+
hasMore: external_exports.boolean(),
|
|
16128
|
+
cursor: external_exports.string().optional()
|
|
16129
|
+
});
|
|
16130
|
+
var CredentialRefreshChallengeValidator = external_exports.object({
|
|
16131
|
+
challenge: external_exports.string().min(1),
|
|
16132
|
+
expiresAt: external_exports.string().min(1),
|
|
16133
|
+
domain: external_exports.string().optional(),
|
|
16134
|
+
scheme: external_exports.literal("LearnCardDIDAuth").optional()
|
|
16135
|
+
});
|
|
16136
|
+
var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
|
|
16137
|
+
format: external_exports.literal("vc"),
|
|
16138
|
+
credential: VCValidator,
|
|
16139
|
+
etag: external_exports.string().optional()
|
|
16140
|
+
});
|
|
16141
|
+
var JweCredentialRefreshEnvelopeValidator = external_exports.object({
|
|
16142
|
+
format: external_exports.literal("jwe"),
|
|
16143
|
+
jwe: JWEValidator,
|
|
16144
|
+
etag: external_exports.string().optional(),
|
|
16145
|
+
/** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
|
|
16146
|
+
version: external_exports.number().int().positive().optional()
|
|
16147
|
+
});
|
|
16148
|
+
var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
|
|
16149
|
+
PublicCredentialRefreshEnvelopeValidator,
|
|
16150
|
+
JweCredentialRefreshEnvelopeValidator
|
|
16151
|
+
]);
|
|
16152
|
+
var CredentialRefreshFailureCodeValidator = external_exports.enum([
|
|
16153
|
+
"UNAVAILABLE",
|
|
16154
|
+
"TIMEOUT",
|
|
16155
|
+
"UNSUPPORTED_SERVICE",
|
|
16156
|
+
"UNAUTHORIZED",
|
|
16157
|
+
"MALFORMED_RESPONSE",
|
|
16158
|
+
"INVALID_PROOF",
|
|
16159
|
+
"ISSUER_MISMATCH",
|
|
16160
|
+
"ID_MISMATCH",
|
|
16161
|
+
"ROLLBACK",
|
|
16162
|
+
"REVOKED",
|
|
16163
|
+
"UNSAFE_ENDPOINT"
|
|
16164
|
+
]);
|
|
16165
|
+
var CredentialRefreshUpdatedResultValidator = external_exports.object({
|
|
16166
|
+
status: external_exports.literal("updated"),
|
|
16167
|
+
credential: VCValidator,
|
|
16168
|
+
etag: external_exports.string().optional(),
|
|
16169
|
+
managedVersion: external_exports.number().int().positive().optional()
|
|
16170
|
+
});
|
|
16171
|
+
var CredentialRefreshUnchangedResultValidator = external_exports.object({
|
|
16172
|
+
status: external_exports.literal("unchanged"),
|
|
16173
|
+
checkedAt: external_exports.string().min(1),
|
|
16174
|
+
etag: external_exports.string().optional()
|
|
16175
|
+
});
|
|
16176
|
+
var CredentialRefreshUnsupportedResultValidator = external_exports.object({
|
|
16177
|
+
status: external_exports.literal("unsupported")
|
|
16178
|
+
});
|
|
16179
|
+
var CredentialRefreshFailedResultValidator = external_exports.object({
|
|
16180
|
+
status: external_exports.literal("failed"),
|
|
16181
|
+
code: CredentialRefreshFailureCodeValidator,
|
|
16182
|
+
retryable: external_exports.boolean()
|
|
16183
|
+
});
|
|
16184
|
+
var CredentialRefreshResultValidator = external_exports.discriminatedUnion("status", [
|
|
16185
|
+
CredentialRefreshUpdatedResultValidator,
|
|
16186
|
+
CredentialRefreshUnchangedResultValidator,
|
|
16187
|
+
CredentialRefreshUnsupportedResultValidator,
|
|
16188
|
+
CredentialRefreshFailedResultValidator
|
|
16189
|
+
]);
|
|
16190
|
+
|
|
15919
16191
|
// src/lcn.ts
|
|
15920
16192
|
var LCNProfileDisplayValidator = external_exports.object({
|
|
15921
16193
|
backgroundColor: external_exports.string().optional(),
|
|
@@ -16252,7 +16524,13 @@ var SendBoostInputValidator = external_exports.object({
|
|
|
16252
16524
|
"Options for email/phone recipients (Universal Inbox)"
|
|
16253
16525
|
),
|
|
16254
16526
|
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
16255
|
-
integrationId: external_exports.string().optional().describe("Integration ID for activity tracking")
|
|
16527
|
+
integrationId: external_exports.string().optional().describe("Integration ID for activity tracking"),
|
|
16528
|
+
refresh: external_exports.boolean().optional().describe(
|
|
16529
|
+
"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."
|
|
16530
|
+
),
|
|
16531
|
+
idempotencyKey: external_exports.string().min(1).max(200).optional().describe(
|
|
16532
|
+
"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."
|
|
16533
|
+
)
|
|
16256
16534
|
}).refine((data) => data.templateUri || data.template || data.signedCredential, {
|
|
16257
16535
|
message: "Either templateUri, template, or signedCredential must be provided.",
|
|
16258
16536
|
path: ["templateUri"]
|
|
@@ -16267,8 +16545,12 @@ var SendBoostInputValidator = external_exports.object({
|
|
|
16267
16545
|
message: "guardianEmail must differ from recipient (self-approval not allowed)",
|
|
16268
16546
|
path: ["options", "guardianEmail"]
|
|
16269
16547
|
}
|
|
16270
|
-
)
|
|
16548
|
+
).refine((data) => !data.idempotencyKey || data.refresh === true, {
|
|
16549
|
+
message: "idempotencyKey is only supported with refresh: true.",
|
|
16550
|
+
path: ["idempotencyKey"]
|
|
16551
|
+
});
|
|
16271
16552
|
var SendInboxResponseValidator = external_exports.object({
|
|
16553
|
+
refresh: InboxCredentialRefreshReceiptValidator.optional(),
|
|
16272
16554
|
issuanceId: external_exports.string(),
|
|
16273
16555
|
status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
|
|
16274
16556
|
claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
|
|
@@ -16283,8 +16565,34 @@ var SendBoostResponseValidator = external_exports.object({
|
|
|
16283
16565
|
activityId: external_exports.string().describe("Links to the activity lifecycle for this issuance"),
|
|
16284
16566
|
inbox: SendInboxResponseValidator.optional().describe(
|
|
16285
16567
|
"Present when sent via email/phone (Universal Inbox)"
|
|
16568
|
+
),
|
|
16569
|
+
refresh: ManagedCredentialRefreshReceiptValidator.optional().describe(
|
|
16570
|
+
"Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates"
|
|
16286
16571
|
)
|
|
16287
16572
|
});
|
|
16573
|
+
var PrepareRefreshableSendInputValidator = external_exports.object({
|
|
16574
|
+
recipient: external_exports.string(),
|
|
16575
|
+
templateUri: external_exports.string().optional(),
|
|
16576
|
+
template: SendBoostTemplateValidator.optional(),
|
|
16577
|
+
contractUri: external_exports.string().optional(),
|
|
16578
|
+
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
16579
|
+
integrationId: external_exports.string().optional(),
|
|
16580
|
+
/** Credential ID to allocate for; generated server-side when omitted. */
|
|
16581
|
+
credentialId: external_exports.string().min(1).optional(),
|
|
16582
|
+
idempotencyKey: external_exports.string().min(1).max(200).optional()
|
|
16583
|
+
}).refine((data) => Boolean(data.templateUri) !== Boolean(data.template), {
|
|
16584
|
+
message: "Provide exactly one of templateUri or template."
|
|
16585
|
+
});
|
|
16586
|
+
var PrepareRefreshableSendResultValidator = external_exports.object({
|
|
16587
|
+
boostUri: external_exports.string(),
|
|
16588
|
+
credentialId: external_exports.string(),
|
|
16589
|
+
refreshId: external_exports.string(),
|
|
16590
|
+
refreshService: ManagedCredentialRefreshServiceValidator,
|
|
16591
|
+
/** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */
|
|
16592
|
+
holderDid: external_exports.string(),
|
|
16593
|
+
/** Present when this idempotencyKey already completed: return it without signing. */
|
|
16594
|
+
completed: SendBoostResponseValidator.optional()
|
|
16595
|
+
});
|
|
16288
16596
|
var SendInputValidator = external_exports.discriminatedUnion("type", [SendBoostInputValidator]);
|
|
16289
16597
|
var SendResponseValidator = external_exports.discriminatedUnion("type", [SendBoostResponseValidator]);
|
|
16290
16598
|
var ConsentFlowTermsStatusValidator = external_exports.enum(["live", "stale", "withdrawn"]);
|
|
@@ -16603,6 +16911,7 @@ var LCNNotificationValidator = external_exports.object({
|
|
|
16603
16911
|
webhookUrl: external_exports.string().optional()
|
|
16604
16912
|
});
|
|
16605
16913
|
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
|
|
16914
|
+
var ACT_AS_HEADER = "X-LearnCard-Act-As";
|
|
16606
16915
|
var AuthGrantValidator = external_exports.object({
|
|
16607
16916
|
id: external_exports.string(),
|
|
16608
16917
|
name: external_exports.string(),
|
|
@@ -16615,6 +16924,7 @@ var AuthGrantValidator = external_exports.object({
|
|
|
16615
16924
|
}, "error")
|
|
16616
16925
|
}),
|
|
16617
16926
|
scope: external_exports.string(),
|
|
16927
|
+
actAs: external_exports.string().optional(),
|
|
16618
16928
|
createdAt: external_exports.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
|
|
16619
16929
|
expiresAt: external_exports.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
|
|
16620
16930
|
});
|
|
@@ -16686,6 +16996,8 @@ var CreateContactMethodSessionResponseValidator = external_exports.object({
|
|
|
16686
16996
|
sessionJwt: external_exports.string()
|
|
16687
16997
|
});
|
|
16688
16998
|
var InboxCredentialValidator = external_exports.object({
|
|
16999
|
+
refresh: InboxCredentialRefreshReceiptValidator.optional(),
|
|
17000
|
+
refreshId: external_exports.string().optional(),
|
|
16689
17001
|
id: external_exports.string(),
|
|
16690
17002
|
credential: external_exports.string().optional(),
|
|
16691
17003
|
isSigned: external_exports.boolean(),
|
|
@@ -16740,12 +17052,19 @@ var IssueInboxCredentialValidator = external_exports.object({
|
|
|
16740
17052
|
templateUri: external_exports.string().optional().describe(
|
|
16741
17053
|
"URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field."
|
|
16742
17054
|
),
|
|
17055
|
+
refresh: external_exports.boolean().optional().describe(
|
|
17056
|
+
"Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim."
|
|
17057
|
+
),
|
|
17058
|
+
idempotencyKey: external_exports.string().min(1).max(200).optional(),
|
|
16743
17059
|
// === OPTIONAL FEATURES ===
|
|
16744
17060
|
// Add major, distinct features at the top level.
|
|
16745
17061
|
//consentRequest: ConsentRequestValidator.optional(),
|
|
16746
17062
|
// === PROCESS CONFIGURATION (Optional) ===
|
|
16747
17063
|
// HOW should this issuance be handled?
|
|
16748
17064
|
configuration: external_exports.object({
|
|
17065
|
+
guardianEmail: external_exports.string().email().optional().describe(
|
|
17066
|
+
"Require approval from this guardian before the recipient can claim. Must differ from the recipient email."
|
|
17067
|
+
),
|
|
16749
17068
|
signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
|
|
16750
17069
|
"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."
|
|
16751
17070
|
),
|
|
@@ -16799,17 +17118,130 @@ var IssueInboxCredentialValidator = external_exports.object({
|
|
|
16799
17118
|
}).optional().describe(
|
|
16800
17119
|
"Configuration for the credential issuance. If not provided, the default configuration will be used."
|
|
16801
17120
|
)
|
|
17121
|
+
}).refine((data) => !data.idempotencyKey || data.refresh === true, {
|
|
17122
|
+
message: "idempotencyKey requires refresh: true."
|
|
16802
17123
|
}).refine((data) => data.credential || data.templateUri, {
|
|
16803
17124
|
message: "Either credential or templateUri must be provided.",
|
|
16804
17125
|
path: ["credential"]
|
|
16805
|
-
})
|
|
17126
|
+
}).refine(
|
|
17127
|
+
(data) => !data.configuration?.guardianEmail || data.recipient.type !== "email" || data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),
|
|
17128
|
+
{
|
|
17129
|
+
message: "guardianEmail must differ from recipient (self-approval not allowed)",
|
|
17130
|
+
path: ["configuration", "guardianEmail"]
|
|
17131
|
+
}
|
|
17132
|
+
);
|
|
16806
17133
|
var IssueInboxCredentialResponseValidator = external_exports.object({
|
|
17134
|
+
refresh: InboxCredentialRefreshReceiptValidator.optional(),
|
|
16807
17135
|
issuanceId: external_exports.string(),
|
|
16808
17136
|
status: LCNInboxStatusEnumValidator,
|
|
16809
17137
|
recipient: ContactMethodQueryValidator,
|
|
16810
17138
|
claimUrl: external_exports.string().url().optional(),
|
|
16811
17139
|
recipientDid: external_exports.string().optional()
|
|
16812
17140
|
});
|
|
17141
|
+
var InboxBatchConfigurationValidator = IssueInboxCredentialValidator.shape.configuration.unwrap().extend({
|
|
17142
|
+
refresh: IssueInboxCredentialValidator.shape.refresh.describe(
|
|
17143
|
+
"Enable managed refresh by default. An item configuration.refresh overrides this value, including false."
|
|
17144
|
+
),
|
|
17145
|
+
delivery: IssueInboxCredentialValidator.shape.configuration.unwrap().shape.delivery.unwrap().extend({ suppress: external_exports.boolean().optional() }).optional()
|
|
17146
|
+
});
|
|
17147
|
+
var InboxBatchItemConfigurationValidator = InboxBatchConfigurationValidator.extend({
|
|
17148
|
+
guardianEmail: InboxBatchConfigurationValidator.shape.guardianEmail.nullable().describe(
|
|
17149
|
+
"Require guardian approval, or set null to clear a batch-level guardianEmail for this item."
|
|
17150
|
+
)
|
|
17151
|
+
});
|
|
17152
|
+
var IssueInboxCredentialBatchItemValidator = external_exports.object({
|
|
17153
|
+
...IssueInboxCredentialValidator.shape,
|
|
17154
|
+
configuration: InboxBatchItemConfigurationValidator.optional(),
|
|
17155
|
+
idempotencyKey: external_exports.string().max(256).optional()
|
|
17156
|
+
}).refine((data) => data.credential || data.templateUri, {
|
|
17157
|
+
message: "Either credential or templateUri must be provided.",
|
|
17158
|
+
path: ["credential"]
|
|
17159
|
+
}).describe(
|
|
17160
|
+
"One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index."
|
|
17161
|
+
);
|
|
17162
|
+
var IssueInboxCredentialBatchValidator = external_exports.object({
|
|
17163
|
+
requestId: external_exports.string().min(1).max(256).optional(),
|
|
17164
|
+
items: external_exports.array(IssueInboxCredentialBatchItemValidator).min(1).max(100),
|
|
17165
|
+
configuration: InboxBatchConfigurationValidator.optional()
|
|
17166
|
+
}).superRefine((batch, ctx) => {
|
|
17167
|
+
batch.items.forEach((item, index) => {
|
|
17168
|
+
const itemGuardian = item.configuration?.guardianEmail;
|
|
17169
|
+
const guardian = itemGuardian === null ? void 0 : itemGuardian ?? batch.configuration?.guardianEmail;
|
|
17170
|
+
if (guardian && item.recipient.type === "email" && guardian.toLowerCase() === item.recipient.value.toLowerCase()) {
|
|
17171
|
+
ctx.addIssue({
|
|
17172
|
+
code: "custom",
|
|
17173
|
+
path: ["items", index, "configuration", "guardianEmail"],
|
|
17174
|
+
message: "guardianEmail must differ from recipient (self-approval not allowed)"
|
|
17175
|
+
});
|
|
17176
|
+
}
|
|
17177
|
+
});
|
|
17178
|
+
});
|
|
17179
|
+
var InboxBatchErrorReasonValidator = external_exports.enum([
|
|
17180
|
+
"DUPLICATE_KEY",
|
|
17181
|
+
"IDEMPOTENCY_MISMATCH",
|
|
17182
|
+
"IN_PROGRESS",
|
|
17183
|
+
"UNCONFIRMED"
|
|
17184
|
+
]);
|
|
17185
|
+
var IssueInboxCredentialBatchItemResultValidator = external_exports.discriminatedUnion("success", [
|
|
17186
|
+
IssueInboxCredentialResponseValidator.extend({
|
|
17187
|
+
success: external_exports.literal(true),
|
|
17188
|
+
index: external_exports.number().int().nonnegative(),
|
|
17189
|
+
deduplicated: external_exports.boolean().optional(),
|
|
17190
|
+
guardianStatus: GuardianStatusValidator.optional(),
|
|
17191
|
+
idempotencyKey: external_exports.string().optional()
|
|
17192
|
+
}),
|
|
17193
|
+
external_exports.object({
|
|
17194
|
+
success: external_exports.literal(false),
|
|
17195
|
+
index: external_exports.number().int().nonnegative(),
|
|
17196
|
+
idempotencyKey: external_exports.string().optional(),
|
|
17197
|
+
recipient: ContactMethodQueryValidator.optional(),
|
|
17198
|
+
error: external_exports.object({
|
|
17199
|
+
code: external_exports.string(),
|
|
17200
|
+
message: external_exports.string(),
|
|
17201
|
+
reason: InboxBatchErrorReasonValidator.optional()
|
|
17202
|
+
}),
|
|
17203
|
+
issuanceId: external_exports.string().optional().describe(
|
|
17204
|
+
"Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key."
|
|
17205
|
+
),
|
|
17206
|
+
claimUrl: external_exports.string().url().optional().describe(
|
|
17207
|
+
"Claim URL of the completed issuance, if available, when replay storage could not be confirmed."
|
|
17208
|
+
)
|
|
17209
|
+
})
|
|
17210
|
+
]);
|
|
17211
|
+
var IssueInboxCredentialBatchResponseValidator = external_exports.object({
|
|
17212
|
+
results: external_exports.array(IssueInboxCredentialBatchItemResultValidator),
|
|
17213
|
+
summary: external_exports.object({
|
|
17214
|
+
total: external_exports.number(),
|
|
17215
|
+
succeeded: external_exports.number(),
|
|
17216
|
+
failed: external_exports.number(),
|
|
17217
|
+
deduplicated: external_exports.number()
|
|
17218
|
+
})
|
|
17219
|
+
});
|
|
17220
|
+
var InboxBatchReceiptValidator = external_exports.object({
|
|
17221
|
+
batchId: external_exports.string(),
|
|
17222
|
+
status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
|
|
17223
|
+
createdAt: external_exports.string()
|
|
17224
|
+
});
|
|
17225
|
+
var InboxBatchStatusValidator = external_exports.object({
|
|
17226
|
+
batchId: external_exports.string(),
|
|
17227
|
+
createdAt: external_exports.string(),
|
|
17228
|
+
done: external_exports.boolean().describe(
|
|
17229
|
+
"True when no queued or processing items remain, including unconfirmed outcomes."
|
|
17230
|
+
),
|
|
17231
|
+
status: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
|
|
17232
|
+
items: external_exports.array(
|
|
17233
|
+
external_exports.object({
|
|
17234
|
+
index: external_exports.number().int().nonnegative(),
|
|
17235
|
+
state: external_exports.enum(["QUEUED", "PROCESSING", "COMPLETED", "NEEDS_RECONCILIATION"]),
|
|
17236
|
+
result: IssueInboxCredentialBatchItemResultValidator.optional()
|
|
17237
|
+
})
|
|
17238
|
+
),
|
|
17239
|
+
summary: IssueInboxCredentialBatchResponseValidator.shape.summary.extend({
|
|
17240
|
+
completed: external_exports.number(),
|
|
17241
|
+
pending: external_exports.number(),
|
|
17242
|
+
unconfirmed: external_exports.number()
|
|
17243
|
+
})
|
|
17244
|
+
});
|
|
16813
17245
|
var CredentialNameRefValidator = external_exports.object({ name: external_exports.string() }).passthrough();
|
|
16814
17246
|
var ClaimInboxCredentialValidator = external_exports.object({
|
|
16815
17247
|
credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
|
|
@@ -17295,6 +17727,7 @@ var CredentialActivityValidator = external_exports.object({
|
|
|
17295
17727
|
eventType: CredentialActivityEventTypeValidator,
|
|
17296
17728
|
timestamp: external_exports.string(),
|
|
17297
17729
|
actorProfileId: external_exports.string().optional(),
|
|
17730
|
+
onBehalfOf: external_exports.string().optional(),
|
|
17298
17731
|
recipientType: CredentialActivityRecipientTypeValidator,
|
|
17299
17732
|
recipientIdentifier: external_exports.string(),
|
|
17300
17733
|
boostUri: external_exports.string().optional(),
|
|
@@ -17340,6 +17773,16 @@ var AuthSessionError = class extends Error {
|
|
|
17340
17773
|
__name(this, "AuthSessionError");
|
|
17341
17774
|
}
|
|
17342
17775
|
};
|
|
17776
|
+
var ESCROW_PIN_LOCKED_MESSAGE = "Too many incorrect PIN attempts. You can still recover by waiting.";
|
|
17777
|
+
var ESCROW_PIN_UNAVAILABLE_MESSAGE = "PIN recovery is not available for this account.";
|
|
17778
|
+
var ESCROW_PIN_MISMATCH_PATTERN = /^Incorrect PIN\. (\d+) attempts left\.$/;
|
|
17779
|
+
var escrowPinMismatchMessage = /* @__PURE__ */ __name((attemptsRemaining) => `Incorrect PIN. ${attemptsRemaining} attempts left.`, "escrowPinMismatchMessage");
|
|
17780
|
+
var EscrowPinStatusValidator = external_exports.object({
|
|
17781
|
+
state: external_exports.enum(["none", "enabled", "locked", "stale"]),
|
|
17782
|
+
enabled: external_exports.boolean(),
|
|
17783
|
+
attemptsRemaining: external_exports.number().int().nonnegative(),
|
|
17784
|
+
salt: external_exports.string().optional()
|
|
17785
|
+
});
|
|
17343
17786
|
|
|
17344
17787
|
// src/bitstring-status-list.ts
|
|
17345
17788
|
var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
|
|
@@ -17459,189 +17902,456 @@ var parseInAppMessagesFlag = /* @__PURE__ */ __name((raw) => {
|
|
|
17459
17902
|
return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
|
|
17460
17903
|
}, "parseInAppMessagesFlag");
|
|
17461
17904
|
|
|
17462
|
-
// src/
|
|
17463
|
-
var
|
|
17464
|
-
var
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
var
|
|
17470
|
-
|
|
17471
|
-
|
|
17472
|
-
|
|
17473
|
-
var
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
var
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
|
|
17485
|
-
|
|
17486
|
-
|
|
17487
|
-
|
|
17488
|
-
|
|
17489
|
-
|
|
17490
|
-
|
|
17491
|
-
|
|
17492
|
-
|
|
17493
|
-
|
|
17494
|
-
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17512
|
-
|
|
17513
|
-
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
}
|
|
17518
|
-
|
|
17519
|
-
|
|
17520
|
-
|
|
17521
|
-
|
|
17522
|
-
|
|
17523
|
-
|
|
17524
|
-
|
|
17905
|
+
// src/share-links.ts
|
|
17906
|
+
var SHARE_LINK_ID_BYTES = 16;
|
|
17907
|
+
var SHARE_CONTENT_KEY_BYTES = 32;
|
|
17908
|
+
var SHARE_IV_BYTES = 12;
|
|
17909
|
+
var SHARE_TAG_BYTES = 16;
|
|
17910
|
+
var MAX_SHARE_CIPHERTEXT_BYTES = 512 * 1024;
|
|
17911
|
+
var MAX_SHARE_RECOVERY_JWE_BYTES = 64 * 1024;
|
|
17912
|
+
var MAX_SELECTED_CREDENTIALS = 50;
|
|
17913
|
+
var MAX_ENDORSEMENTS = 200;
|
|
17914
|
+
var MAX_VP_MEMBERS = MAX_SELECTED_CREDENTIALS + MAX_ENDORSEMENTS;
|
|
17915
|
+
var MAX_SHARE_SOURCE_URI_CHARS = 2048;
|
|
17916
|
+
var MAX_SHARE_LINK_REQUEST_BYTES = 1024 * 1024;
|
|
17917
|
+
var SHARE_LINK_PROTOCOL = "lc-share/v1";
|
|
17918
|
+
var SHARE_RECOVERY_PROTOCOL = "lc-share-recovery/v1";
|
|
17919
|
+
var SHARE_AAD_PREFIX = "lc-share:v1";
|
|
17920
|
+
var BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
17921
|
+
var BASE64URL_LOOKUP = (() => {
|
|
17922
|
+
const table = new Int16Array(128).fill(-1);
|
|
17923
|
+
for (let index = 0; index < BASE64URL_ALPHABET.length; index += 1) {
|
|
17924
|
+
table[BASE64URL_ALPHABET.charCodeAt(index)] = index;
|
|
17925
|
+
}
|
|
17926
|
+
return table;
|
|
17927
|
+
})();
|
|
17928
|
+
var encodeBase64Url = /* @__PURE__ */ __name((bytes) => {
|
|
17929
|
+
let output = "";
|
|
17930
|
+
for (let index = 0; index < bytes.length; index += 3) {
|
|
17931
|
+
const first = bytes[index];
|
|
17932
|
+
const second = bytes[index + 1];
|
|
17933
|
+
const third = bytes[index + 2];
|
|
17934
|
+
output += BASE64URL_ALPHABET[first >> 2];
|
|
17935
|
+
output += BASE64URL_ALPHABET[(first & 3) << 4 | (second ?? 0) >> 4];
|
|
17936
|
+
if (second === void 0) break;
|
|
17937
|
+
output += BASE64URL_ALPHABET[(second & 15) << 2 | (third ?? 0) >> 6];
|
|
17938
|
+
if (third === void 0) break;
|
|
17939
|
+
output += BASE64URL_ALPHABET[third & 63];
|
|
17940
|
+
}
|
|
17941
|
+
return output;
|
|
17942
|
+
}, "encodeBase64Url");
|
|
17943
|
+
var decodeBase64Url = /* @__PURE__ */ __name((value) => {
|
|
17944
|
+
if (typeof value !== "string") return null;
|
|
17945
|
+
const output = new Uint8Array(Math.floor(value.length * 6 / 8));
|
|
17946
|
+
let bits = 0;
|
|
17947
|
+
let bitCount = 0;
|
|
17948
|
+
let outputIndex = 0;
|
|
17949
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
17950
|
+
const code = value.charCodeAt(index);
|
|
17951
|
+
const digit = code < 128 ? BASE64URL_LOOKUP[code] : -1;
|
|
17952
|
+
if (digit < 0) return null;
|
|
17953
|
+
bits = bits << 6 | digit;
|
|
17954
|
+
bitCount += 6;
|
|
17955
|
+
if (bitCount >= 8) {
|
|
17956
|
+
bitCount -= 8;
|
|
17957
|
+
output[outputIndex] = bits >> bitCount & 255;
|
|
17958
|
+
outputIndex += 1;
|
|
17959
|
+
}
|
|
17960
|
+
}
|
|
17961
|
+
return output;
|
|
17962
|
+
}, "decodeBase64Url");
|
|
17963
|
+
var isCanonicalBase64Url = /* @__PURE__ */ __name((value, expectedBytes) => {
|
|
17964
|
+
if (typeof value !== "string") return false;
|
|
17965
|
+
if (expectedBytes !== void 0 && value.length !== Math.ceil(expectedBytes * 4 / 3))
|
|
17966
|
+
return false;
|
|
17967
|
+
const decoded = decodeBase64Url(value);
|
|
17968
|
+
if (decoded === null) return false;
|
|
17969
|
+
if (expectedBytes !== void 0 && decoded.length !== expectedBytes) return false;
|
|
17970
|
+
return encodeBase64Url(decoded) === value;
|
|
17971
|
+
}, "isCanonicalBase64Url");
|
|
17972
|
+
var decodedBase64UrlByteLength = /* @__PURE__ */ __name((value) => decodeBase64Url(value)?.length ?? null, "decodedBase64UrlByteLength");
|
|
17973
|
+
var utf8ByteLength = /* @__PURE__ */ __name((value) => new TextEncoder().encode(value).length, "utf8ByteLength");
|
|
17974
|
+
var canonicalBase64Url = /* @__PURE__ */ __name((bytes) => external_exports.string().refine((value) => isCanonicalBase64Url(value, bytes), {
|
|
17975
|
+
message: `must be canonical base64url for exactly ${bytes} bytes`
|
|
17976
|
+
}), "canonicalBase64Url");
|
|
17977
|
+
var ShareLinkIdValidator = canonicalBase64Url(SHARE_LINK_ID_BYTES);
|
|
17978
|
+
var ShareContentKeyValidator = canonicalBase64Url(SHARE_CONTENT_KEY_BYTES);
|
|
17979
|
+
var ShareIvValidator = canonicalBase64Url(SHARE_IV_BYTES);
|
|
17980
|
+
var ShareCiphertextValidator = external_exports.string().refine(
|
|
17981
|
+
(value) => {
|
|
17982
|
+
if (value.length > Math.ceil(MAX_SHARE_CIPHERTEXT_BYTES * 4 / 3)) return false;
|
|
17983
|
+
const decoded = decodeBase64Url(value);
|
|
17984
|
+
if (decoded === null) return false;
|
|
17985
|
+
if (encodeBase64Url(decoded) !== value) return false;
|
|
17986
|
+
return decoded.length >= SHARE_TAG_BYTES && decoded.length <= MAX_SHARE_CIPHERTEXT_BYTES;
|
|
17987
|
+
},
|
|
17988
|
+
{
|
|
17989
|
+
message: `must be canonical base64url decoding to ${SHARE_TAG_BYTES}..${MAX_SHARE_CIPHERTEXT_BYTES} bytes`
|
|
17525
17990
|
}
|
|
17526
|
-
|
|
17991
|
+
);
|
|
17992
|
+
var ShareEnvelopeValidator = external_exports.object({
|
|
17993
|
+
v: external_exports.literal(1),
|
|
17994
|
+
alg: external_exports.literal("A256GCM"),
|
|
17995
|
+
iv: ShareIvValidator,
|
|
17996
|
+
ct: ShareCiphertextValidator
|
|
17997
|
+
}).strict();
|
|
17998
|
+
var safeVersion = external_exports.number().int().min(1).max(2 ** 31 - 1);
|
|
17999
|
+
var safeCredentialIndex = external_exports.number().int().min(0).max(MAX_VP_MEMBERS - 1);
|
|
18000
|
+
var ShareSelectionEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex }).strict();
|
|
18001
|
+
var ShareEndorsementEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex, targetCredentialIndex: safeCredentialIndex }).strict();
|
|
18002
|
+
var ShareSharerValidator = external_exports.object({
|
|
18003
|
+
profileId: external_exports.string().min(1).max(128),
|
|
18004
|
+
displayName: external_exports.string().min(1).max(120),
|
|
18005
|
+
avatar: external_exports.string().max(2048).optional()
|
|
18006
|
+
}).strict();
|
|
18007
|
+
var presentationShape = VPValidator.extend({
|
|
18008
|
+
verifiableCredential: VCValidator.array().min(1).max(MAX_VP_MEMBERS)
|
|
18009
|
+
});
|
|
18010
|
+
var hasBoundedPresentation = /* @__PURE__ */ __name((value) => {
|
|
18011
|
+
let credentialCount = 0;
|
|
18012
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
18013
|
+
const visit = /* @__PURE__ */ __name((node, depth) => {
|
|
18014
|
+
if (node === null || typeof node !== "object") return true;
|
|
18015
|
+
if (depth > 32 || ancestors.has(node)) return false;
|
|
18016
|
+
ancestors.add(node);
|
|
18017
|
+
try {
|
|
18018
|
+
for (const [key, child] of Object.entries(node)) {
|
|
18019
|
+
if (key === "verifiableCredential") {
|
|
18020
|
+
credentialCount += Array.isArray(child) ? child.length : 1;
|
|
18021
|
+
if (credentialCount > MAX_VP_MEMBERS) return false;
|
|
18022
|
+
}
|
|
18023
|
+
if (!visit(child, depth + 1)) return false;
|
|
18024
|
+
}
|
|
18025
|
+
return true;
|
|
18026
|
+
} finally {
|
|
18027
|
+
ancestors.delete(node);
|
|
18028
|
+
}
|
|
18029
|
+
}, "visit");
|
|
18030
|
+
return visit(value, 0);
|
|
18031
|
+
}, "hasBoundedPresentation");
|
|
18032
|
+
var ShareManifestPresentationValidator = external_exports.custom(
|
|
18033
|
+
(value) => hasBoundedPresentation(value) && presentationShape.safeParse(value).success,
|
|
18034
|
+
{ message: "invalid share presentation" }
|
|
18035
|
+
);
|
|
18036
|
+
var SharePayloadValidatorShape = external_exports.object({
|
|
18037
|
+
protocol: external_exports.literal(SHARE_LINK_PROTOCOL),
|
|
18038
|
+
shareId: ShareLinkIdValidator,
|
|
18039
|
+
contentVersion: safeVersion,
|
|
18040
|
+
createdAt: external_exports.iso.datetime(),
|
|
18041
|
+
sharer: ShareSharerValidator,
|
|
18042
|
+
presentation: ShareManifestPresentationValidator,
|
|
18043
|
+
selection: ShareSelectionEntryValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
18044
|
+
endorsements: ShareEndorsementEntryValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
18045
|
+
}).strict();
|
|
18046
|
+
var classificationFailure = /* @__PURE__ */ __name((code, message, path = []) => ({ ok: false, code, message, path }), "classificationFailure");
|
|
18047
|
+
var readSignedClaimId = /* @__PURE__ */ __name((member) => {
|
|
18048
|
+
if (member === null || typeof member !== "object") return void 0;
|
|
18049
|
+
const record2 = member;
|
|
18050
|
+
const claim = record2.credentialSubject ?? record2.endorsement;
|
|
18051
|
+
if (claim === null || typeof claim !== "object") return void 0;
|
|
18052
|
+
const claimRecord = claim;
|
|
18053
|
+
const nested = claimRecord.endorsement;
|
|
18054
|
+
const nestedId = nested !== null && typeof nested === "object" ? nested.id : void 0;
|
|
18055
|
+
return claimRecord.id ?? nestedId;
|
|
18056
|
+
}, "readSignedClaimId");
|
|
18057
|
+
var classifyShareManifest = /* @__PURE__ */ __name((payload) => {
|
|
18058
|
+
const members = payload.presentation?.verifiableCredential;
|
|
18059
|
+
if (!Array.isArray(members) || members.length === 0) {
|
|
18060
|
+
return classificationFailure("NO_PRESENTATION_MEMBERS", "presentation has no credentials");
|
|
18061
|
+
}
|
|
18062
|
+
if (members.length > MAX_VP_MEMBERS) {
|
|
18063
|
+
return classificationFailure(
|
|
18064
|
+
"TOO_MANY_VP_MEMBERS",
|
|
18065
|
+
`presentation has ${members.length} members, over the ${MAX_VP_MEMBERS} bound`
|
|
18066
|
+
);
|
|
18067
|
+
}
|
|
18068
|
+
const selection = payload.selection;
|
|
18069
|
+
const endorsements = payload.endorsements ?? [];
|
|
18070
|
+
if (!Array.isArray(selection) || selection.length < 1 || selection.length > MAX_SELECTED_CREDENTIALS) {
|
|
18071
|
+
return classificationFailure("BAD_SELECTION", "selection must contain 1..50 entries");
|
|
18072
|
+
}
|
|
18073
|
+
if (!Array.isArray(endorsements) || endorsements.length > MAX_ENDORSEMENTS) {
|
|
18074
|
+
return classificationFailure(
|
|
18075
|
+
"BAD_ENDORSEMENTS",
|
|
18076
|
+
"endorsements must contain at most 200 entries"
|
|
18077
|
+
);
|
|
18078
|
+
}
|
|
18079
|
+
const selectedIndices = [];
|
|
18080
|
+
const selected = /* @__PURE__ */ new Set();
|
|
18081
|
+
for (let index = 0; index < selection.length; index += 1) {
|
|
18082
|
+
const entry = selection[index];
|
|
18083
|
+
const credentialIndex = entry?.credentialIndex;
|
|
18084
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
18085
|
+
return classificationFailure(
|
|
18086
|
+
"SELECTION_INDEX_OUT_OF_BOUNDS",
|
|
18087
|
+
`selection[${index}].credentialIndex is out of bounds`,
|
|
18088
|
+
["selection", index, "credentialIndex"]
|
|
18089
|
+
);
|
|
18090
|
+
}
|
|
18091
|
+
if (selected.has(credentialIndex)) {
|
|
18092
|
+
return classificationFailure(
|
|
18093
|
+
"SELECTION_INDEX_DUPLICATE",
|
|
18094
|
+
`selection[${index}].credentialIndex is duplicated`,
|
|
18095
|
+
["selection", index, "credentialIndex"]
|
|
18096
|
+
);
|
|
18097
|
+
}
|
|
18098
|
+
selected.add(credentialIndex);
|
|
18099
|
+
selectedIndices.push(credentialIndex);
|
|
18100
|
+
}
|
|
18101
|
+
const classified = new Set(selected);
|
|
18102
|
+
const endorsementIndices = [];
|
|
18103
|
+
for (let index = 0; index < endorsements.length; index += 1) {
|
|
18104
|
+
const entry = endorsements[index];
|
|
18105
|
+
const credentialIndex = entry?.credentialIndex;
|
|
18106
|
+
const targetIndex = entry?.targetCredentialIndex;
|
|
18107
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
18108
|
+
return classificationFailure(
|
|
18109
|
+
"ENDORSEMENT_INDEX_OUT_OF_BOUNDS",
|
|
18110
|
+
`endorsements[${index}].credentialIndex is out of bounds`,
|
|
18111
|
+
["endorsements", index, "credentialIndex"]
|
|
18112
|
+
);
|
|
18113
|
+
}
|
|
18114
|
+
if (classified.has(credentialIndex)) {
|
|
18115
|
+
return classificationFailure(
|
|
18116
|
+
"VP_MEMBER_CLASSIFIED_TWICE",
|
|
18117
|
+
`endorsements[${index}].credentialIndex was already classified`,
|
|
18118
|
+
["endorsements", index, "credentialIndex"]
|
|
18119
|
+
);
|
|
18120
|
+
}
|
|
18121
|
+
if (!selected.has(targetIndex)) {
|
|
18122
|
+
return classificationFailure(
|
|
18123
|
+
"ENDORSEMENT_TARGET_NOT_SELECTED",
|
|
18124
|
+
`endorsements[${index}].targetCredentialIndex must reference a selected credential`,
|
|
18125
|
+
["endorsements", index, "targetCredentialIndex"]
|
|
18126
|
+
);
|
|
18127
|
+
}
|
|
18128
|
+
const referenced = readSignedClaimId(members[credentialIndex]);
|
|
18129
|
+
const target = members[targetIndex];
|
|
18130
|
+
const targetId = target !== null && typeof target === "object" ? target.id : void 0;
|
|
18131
|
+
if (typeof referenced !== "string" || typeof targetId !== "string" || referenced !== targetId) {
|
|
18132
|
+
return classificationFailure(
|
|
18133
|
+
"ENDORSEMENT_TARGET_UNBOUND",
|
|
18134
|
+
`endorsements[${index}] claim does not reference the target credential id`,
|
|
18135
|
+
["endorsements", index]
|
|
18136
|
+
);
|
|
18137
|
+
}
|
|
18138
|
+
classified.add(credentialIndex);
|
|
18139
|
+
endorsementIndices.push(credentialIndex);
|
|
18140
|
+
}
|
|
18141
|
+
if (classified.size !== members.length) {
|
|
18142
|
+
return classificationFailure(
|
|
18143
|
+
"UNCLASSIFIED_VP_MEMBER",
|
|
18144
|
+
"every presentation member must be classified exactly once",
|
|
18145
|
+
["presentation", "verifiableCredential"]
|
|
18146
|
+
);
|
|
18147
|
+
}
|
|
18148
|
+
return {
|
|
18149
|
+
ok: true,
|
|
18150
|
+
classification: { selectedIndices, endorsementIndices, memberCount: members.length }
|
|
18151
|
+
};
|
|
18152
|
+
}, "classifyShareManifest");
|
|
18153
|
+
var SharePayloadValidator = SharePayloadValidatorShape.superRefine((payload, ctx) => {
|
|
18154
|
+
const result = classifyShareManifest(payload);
|
|
18155
|
+
if (!result.ok) {
|
|
17527
18156
|
ctx.addIssue({
|
|
17528
18157
|
code: "custom",
|
|
17529
|
-
|
|
17530
|
-
|
|
18158
|
+
message: result.message,
|
|
18159
|
+
path: result.path,
|
|
18160
|
+
params: { shareLinkCode: result.code }
|
|
17531
18161
|
});
|
|
17532
18162
|
}
|
|
17533
|
-
|
|
17534
|
-
|
|
18163
|
+
});
|
|
18164
|
+
var ShareRecoverySelectionValidator = external_exports.object({
|
|
18165
|
+
ref: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS),
|
|
18166
|
+
order: external_exports.number().int().min(0).max(MAX_SELECTED_CREDENTIALS - 1)
|
|
18167
|
+
}).strict();
|
|
18168
|
+
var ShareRecoveryEndorsementValidator = external_exports.object({ targetRef: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS) }).strict();
|
|
18169
|
+
var ShareRecoveryPlaintextValidator = external_exports.object({
|
|
18170
|
+
protocol: external_exports.literal(SHARE_RECOVERY_PROTOCOL),
|
|
18171
|
+
shareId: ShareLinkIdValidator,
|
|
18172
|
+
ownerProfileId: external_exports.string().min(1).max(128),
|
|
18173
|
+
createdAt: external_exports.iso.datetime(),
|
|
18174
|
+
latest: external_exports.object({ contentVersion: safeVersion, key: ShareContentKeyValidator }).strict(),
|
|
18175
|
+
selection: ShareRecoverySelectionValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
18176
|
+
endorsements: ShareRecoveryEndorsementValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
18177
|
+
}).strict().superRefine((recovery, ctx) => {
|
|
18178
|
+
const orders = /* @__PURE__ */ new Set();
|
|
18179
|
+
recovery.selection.forEach((entry, index) => {
|
|
18180
|
+
if (entry.order >= recovery.selection.length) {
|
|
17535
18181
|
ctx.addIssue({
|
|
17536
18182
|
code: "custom",
|
|
17537
|
-
|
|
17538
|
-
|
|
18183
|
+
message: "order must be within the selection bounds",
|
|
18184
|
+
path: ["selection", index, "order"]
|
|
17539
18185
|
});
|
|
17540
18186
|
}
|
|
17541
|
-
if (
|
|
18187
|
+
if (orders.has(entry.order)) {
|
|
17542
18188
|
ctx.addIssue({
|
|
17543
18189
|
code: "custom",
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
});
|
|
17547
|
-
}
|
|
17548
|
-
if (!input.signingAuthority) {
|
|
17549
|
-
ctx.addIssue({
|
|
17550
|
-
code: "custom",
|
|
17551
|
-
path: ["signingAuthority"],
|
|
17552
|
-
message: "signingAuthority is required for signing-authority publication"
|
|
18190
|
+
message: "order must be unique within the selection",
|
|
18191
|
+
path: ["selection", index, "order"]
|
|
17553
18192
|
});
|
|
17554
18193
|
}
|
|
18194
|
+
orders.add(entry.order);
|
|
18195
|
+
});
|
|
18196
|
+
});
|
|
18197
|
+
var ShareOwnerRecoveryValidator = JWEValidator.refine(
|
|
18198
|
+
(value) => utf8ByteLength(JSON.stringify(value)) <= MAX_SHARE_RECOVERY_JWE_BYTES,
|
|
18199
|
+
{ message: `serialized recovery JWE must be at most ${MAX_SHARE_RECOVERY_JWE_BYTES} bytes` }
|
|
18200
|
+
);
|
|
18201
|
+
var ShareLinkStatusValidator = external_exports.enum(["pending", "active", "stopped"]);
|
|
18202
|
+
var ShareContentStateValidator = external_exports.enum(["staging", "finalized", "content_missing"]);
|
|
18203
|
+
var ShareLinkValidator = external_exports.object({
|
|
18204
|
+
id: ShareLinkIdValidator,
|
|
18205
|
+
title: external_exports.string().min(1).max(120),
|
|
18206
|
+
note: external_exports.string().max(500).optional(),
|
|
18207
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
18208
|
+
version: safeVersion,
|
|
18209
|
+
contentVersion: safeVersion,
|
|
18210
|
+
status: ShareLinkStatusValidator,
|
|
18211
|
+
contentState: ShareContentStateValidator,
|
|
18212
|
+
createdAt: external_exports.iso.datetime(),
|
|
18213
|
+
updatedAt: external_exports.iso.datetime(),
|
|
18214
|
+
expiresAt: external_exports.iso.datetime().nullable(),
|
|
18215
|
+
stoppedAt: external_exports.iso.datetime().nullable(),
|
|
18216
|
+
lastViewedAt: external_exports.iso.datetime().nullable(),
|
|
18217
|
+
viewCount: external_exports.number().int().min(0).optional(),
|
|
18218
|
+
passcodeProtected: external_exports.boolean(),
|
|
18219
|
+
notifyOnView: external_exports.boolean(),
|
|
18220
|
+
minorPolicy: external_exports.object({
|
|
18221
|
+
isMinor: external_exports.boolean().nullable(),
|
|
18222
|
+
policyResolved: external_exports.boolean(),
|
|
18223
|
+
defaultExpiryDays: external_exports.union([external_exports.literal(30), external_exports.literal(365)]),
|
|
18224
|
+
viewCountingEnabled: external_exports.boolean()
|
|
18225
|
+
}),
|
|
18226
|
+
/**
|
|
18227
|
+
* Guarded application/API URL for the content. Optional because owner APIs in
|
|
18228
|
+
* D1 have no public resolve/content endpoint yet; it must never be a
|
|
18229
|
+
* LearnCloud object URL or carry a fabricated decryption key.
|
|
18230
|
+
*/
|
|
18231
|
+
contentUrl: external_exports.string().optional()
|
|
18232
|
+
});
|
|
18233
|
+
var clientRequestId = external_exports.string().uuid();
|
|
18234
|
+
var CreateShareLinkInputValidator = external_exports.object({
|
|
18235
|
+
id: ShareLinkIdValidator,
|
|
18236
|
+
clientRequestId,
|
|
18237
|
+
title: external_exports.string().min(1).max(120),
|
|
18238
|
+
note: external_exports.string().max(500).optional(),
|
|
18239
|
+
expiresAt: external_exports.iso.datetime().nullable().optional(),
|
|
18240
|
+
passcode: external_exports.string().min(8).max(64).optional(),
|
|
18241
|
+
notifyOnView: external_exports.boolean().default(false),
|
|
18242
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
18243
|
+
contentVersion: external_exports.literal(1),
|
|
18244
|
+
envelope: ShareEnvelopeValidator,
|
|
18245
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator
|
|
18246
|
+
}).strict();
|
|
18247
|
+
var UpdateShareLinkInputValidator = external_exports.object({
|
|
18248
|
+
id: ShareLinkIdValidator,
|
|
18249
|
+
expectedVersion: safeVersion,
|
|
18250
|
+
clientRequestId,
|
|
18251
|
+
title: external_exports.string().min(1).max(120).optional(),
|
|
18252
|
+
note: external_exports.string().max(500).nullable().optional(),
|
|
18253
|
+
expiresAt: external_exports.iso.datetime().nullable().optional(),
|
|
18254
|
+
/** Omitted preserves the current passcode, null removes it, and a string replaces it. */
|
|
18255
|
+
passcode: external_exports.string().min(8).max(64).nullable().optional(),
|
|
18256
|
+
notifyOnView: external_exports.boolean().optional(),
|
|
18257
|
+
contentVersion: safeVersion.optional(),
|
|
18258
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS).optional(),
|
|
18259
|
+
envelope: ShareEnvelopeValidator.optional(),
|
|
18260
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator.optional()
|
|
18261
|
+
}).strict().superRefine((value, ctx) => {
|
|
18262
|
+
const provided = [
|
|
18263
|
+
value.contentVersion,
|
|
18264
|
+
value.selectedCount,
|
|
18265
|
+
value.envelope,
|
|
18266
|
+
value.ownerEncryptedRecovery
|
|
18267
|
+
].filter((field) => field !== void 0).length;
|
|
18268
|
+
if (provided !== 0 && provided !== 4) {
|
|
18269
|
+
ctx.addIssue({
|
|
18270
|
+
code: "custom",
|
|
18271
|
+
message: "content replacement requires contentVersion, selectedCount, envelope and ownerEncryptedRecovery together"
|
|
18272
|
+
});
|
|
17555
18273
|
}
|
|
17556
18274
|
});
|
|
17557
|
-
var
|
|
17558
|
-
|
|
17559
|
-
|
|
17560
|
-
"
|
|
17561
|
-
|
|
17562
|
-
|
|
18275
|
+
var ShareLinkIdInputValidator = external_exports.object({ id: ShareLinkIdValidator }).strict();
|
|
18276
|
+
var ShareLinkOperationKeyInputValidator = external_exports.object({ id: ShareLinkIdValidator, operationId: external_exports.string().uuid() }).strict();
|
|
18277
|
+
var ShareLinkOwnerCommitOutputValidator = external_exports.discriminatedUnion("status", [
|
|
18278
|
+
external_exports.object({ status: external_exports.literal("completed"), share: ShareLinkValidator }).strict(),
|
|
18279
|
+
external_exports.object({
|
|
18280
|
+
status: external_exports.literal("pending"),
|
|
18281
|
+
id: ShareLinkIdValidator,
|
|
18282
|
+
operationId: external_exports.string().uuid()
|
|
18283
|
+
}).strict()
|
|
17563
18284
|
]);
|
|
17564
|
-
var
|
|
17565
|
-
|
|
17566
|
-
|
|
17567
|
-
|
|
17568
|
-
|
|
17569
|
-
|
|
17570
|
-
|
|
17571
|
-
|
|
17572
|
-
publishedAt: external_exports.string().min(1),
|
|
17573
|
-
effectiveAt: external_exports.string().optional(),
|
|
17574
|
-
etag: external_exports.string().optional(),
|
|
17575
|
-
signingMode: CredentialRefreshSigningModeValidator.optional(),
|
|
17576
|
-
updateSummary: external_exports.string().optional()
|
|
17577
|
-
});
|
|
17578
|
-
var GetCredentialRefreshHistoryInputValidator = external_exports.object({
|
|
17579
|
-
refreshId: external_exports.string().min(1),
|
|
17580
|
-
cursor: external_exports.string().optional(),
|
|
17581
|
-
limit: external_exports.number().int().positive().optional()
|
|
17582
|
-
});
|
|
17583
|
-
var GetCredentialRefreshHistoryResultValidator = external_exports.object({
|
|
17584
|
-
records: CredentialRefreshVersionMetadataValidator.array(),
|
|
17585
|
-
hasMore: external_exports.boolean(),
|
|
17586
|
-
cursor: external_exports.string().optional()
|
|
17587
|
-
});
|
|
17588
|
-
var CredentialRefreshChallengeValidator = external_exports.object({
|
|
17589
|
-
challenge: external_exports.string().min(1),
|
|
17590
|
-
expiresAt: external_exports.string().min(1),
|
|
17591
|
-
domain: external_exports.string().optional(),
|
|
17592
|
-
scheme: external_exports.literal("LearnCardDIDAuth").optional()
|
|
17593
|
-
});
|
|
17594
|
-
var PublicCredentialRefreshEnvelopeValidator = external_exports.object({
|
|
17595
|
-
format: external_exports.literal("vc"),
|
|
17596
|
-
credential: VCValidator,
|
|
17597
|
-
etag: external_exports.string().optional()
|
|
17598
|
-
});
|
|
17599
|
-
var JweCredentialRefreshEnvelopeValidator = external_exports.object({
|
|
17600
|
-
format: external_exports.literal("jwe"),
|
|
17601
|
-
jwe: JWEValidator,
|
|
17602
|
-
etag: external_exports.string().optional(),
|
|
17603
|
-
/** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */
|
|
17604
|
-
version: external_exports.number().int().positive().optional()
|
|
17605
|
-
});
|
|
17606
|
-
var CredentialRefreshResponseEnvelopeValidator = external_exports.discriminatedUnion("format", [
|
|
17607
|
-
PublicCredentialRefreshEnvelopeValidator,
|
|
17608
|
-
JweCredentialRefreshEnvelopeValidator
|
|
18285
|
+
var ShareLinkOwnerStatusOutputValidator = external_exports.discriminatedUnion("status", [
|
|
18286
|
+
external_exports.object({ status: external_exports.literal("found"), share: ShareLinkValidator }).strict(),
|
|
18287
|
+
external_exports.object({
|
|
18288
|
+
status: external_exports.literal("pending"),
|
|
18289
|
+
id: ShareLinkIdValidator,
|
|
18290
|
+
operationId: external_exports.string().uuid()
|
|
18291
|
+
}).strict(),
|
|
18292
|
+
external_exports.object({ status: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
17609
18293
|
]);
|
|
17610
|
-
var
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
|
|
17621
|
-
|
|
18294
|
+
var ShareLinkOwnerRecoveryOutputValidator = external_exports.object({ recovery: ShareOwnerRecoveryValidator }).strict();
|
|
18295
|
+
var ShareLinkOwnerContentOutputValidator = external_exports.object({
|
|
18296
|
+
id: ShareLinkIdValidator,
|
|
18297
|
+
contentVersion: safeVersion,
|
|
18298
|
+
envelope: ShareEnvelopeValidator
|
|
18299
|
+
}).strict();
|
|
18300
|
+
var ResolveShareLinkInputValidator = external_exports.object({
|
|
18301
|
+
id: ShareLinkIdValidator,
|
|
18302
|
+
/** Sent only in a POST body; it must never be placed in a share URL. */
|
|
18303
|
+
passcode: external_exports.string().min(4).max(64).optional()
|
|
18304
|
+
}).strict();
|
|
18305
|
+
var ShareLinkPublicStateValidator = external_exports.discriminatedUnion("state", [
|
|
18306
|
+
external_exports.object({
|
|
18307
|
+
state: external_exports.literal("passcode_required"),
|
|
18308
|
+
id: ShareLinkIdValidator
|
|
18309
|
+
}).strict(),
|
|
18310
|
+
external_exports.object({ state: external_exports.literal("try_later"), id: ShareLinkIdValidator }).strict(),
|
|
18311
|
+
external_exports.object({
|
|
18312
|
+
state: external_exports.literal("active"),
|
|
18313
|
+
id: ShareLinkIdValidator,
|
|
18314
|
+
title: external_exports.string().max(120),
|
|
18315
|
+
note: external_exports.string().max(500).optional(),
|
|
18316
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
18317
|
+
contentVersion: safeVersion,
|
|
18318
|
+
contentUrl: external_exports.string(),
|
|
18319
|
+
sharer: external_exports.object({
|
|
18320
|
+
displayName: external_exports.string().max(120),
|
|
18321
|
+
avatar: external_exports.string().max(2048).optional()
|
|
18322
|
+
}),
|
|
18323
|
+
createdAt: external_exports.iso.datetime(),
|
|
18324
|
+
updatedAt: external_exports.iso.datetime(),
|
|
18325
|
+
expiresAt: external_exports.iso.datetime().nullable()
|
|
18326
|
+
}).strict(),
|
|
18327
|
+
external_exports.object({
|
|
18328
|
+
state: external_exports.literal("expired"),
|
|
18329
|
+
id: ShareLinkIdValidator,
|
|
18330
|
+
expiresAt: external_exports.iso.datetime()
|
|
18331
|
+
}).strict(),
|
|
18332
|
+
external_exports.object({
|
|
18333
|
+
state: external_exports.literal("stopped"),
|
|
18334
|
+
id: ShareLinkIdValidator,
|
|
18335
|
+
stoppedAt: external_exports.iso.datetime()
|
|
18336
|
+
}).strict(),
|
|
18337
|
+
external_exports.object({ state: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
17622
18338
|
]);
|
|
17623
|
-
var
|
|
17624
|
-
|
|
17625
|
-
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17629
|
-
var CredentialRefreshUnchangedResultValidator = external_exports.object({
|
|
17630
|
-
status: external_exports.literal("unchanged"),
|
|
17631
|
-
checkedAt: external_exports.string().min(1),
|
|
17632
|
-
etag: external_exports.string().optional()
|
|
17633
|
-
});
|
|
17634
|
-
var CredentialRefreshUnsupportedResultValidator = external_exports.object({
|
|
17635
|
-
status: external_exports.literal("unsupported")
|
|
17636
|
-
});
|
|
17637
|
-
var CredentialRefreshFailedResultValidator = external_exports.object({
|
|
17638
|
-
status: external_exports.literal("failed"),
|
|
17639
|
-
code: CredentialRefreshFailureCodeValidator,
|
|
17640
|
-
retryable: external_exports.boolean()
|
|
18339
|
+
var ListShareLinksInputValidator = external_exports.object({
|
|
18340
|
+
limit: external_exports.number().int().min(1).max(50).default(25),
|
|
18341
|
+
cursor: external_exports.string().max(512).optional()
|
|
18342
|
+
}).strict();
|
|
18343
|
+
var PaginatedShareLinksValidator = PaginationResponseValidator.extend({
|
|
18344
|
+
records: ShareLinkValidator.array()
|
|
17641
18345
|
});
|
|
17642
|
-
var
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
18346
|
+
var AcknowledgeViewInputValidator = external_exports.object({
|
|
18347
|
+
receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
18348
|
+
}).strict();
|
|
18349
|
+
var AcknowledgeViewOutputValidator = external_exports.object({ ok: external_exports.literal(true) }).strict();
|
|
18350
|
+
var SHARE_VIEW_RECEIPT_TTL_SECONDS = 10 * 60;
|
|
18351
|
+
var ShareLinkPublicContentViewValidator = external_exports.object({
|
|
18352
|
+
id: ShareLinkIdValidator,
|
|
18353
|
+
contentVersion: safeVersion,
|
|
18354
|
+
envelope: ShareEnvelopeValidator,
|
|
18355
|
+
contentUrl: external_exports.string(),
|
|
18356
|
+
receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
18357
|
+
}).strict();
|