@learncard/types 5.21.0 → 5.23.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/__tests__/unsupportedSignInOperation.test.d.ts +2 -0
- package/dist/__tests__/unsupportedSignInOperation.test.d.ts.map +1 -0
- package/dist/auth.d.ts +233 -5
- package/dist/auth.d.ts.map +1 -1
- package/dist/clr.d.ts +2 -2
- package/dist/clr.d.ts.map +1 -1
- package/dist/clr.test.d.ts +2 -0
- package/dist/clr.test.d.ts.map +1 -0
- package/dist/inAppMessages.d.ts +10 -10
- 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 +1638 -15
- package/dist/lcn.d.ts.map +1 -1
- package/dist/share-links.d.ts +1950 -0
- package/dist/share-links.d.ts.map +1 -0
- package/dist/types.cjs.development.cjs +873 -10
- package/dist/types.cjs.development.cjs.map +4 -4
- package/dist/types.cjs.production.min.cjs +33 -33
- package/dist/types.cjs.production.min.cjs.map +4 -4
- package/dist/types.esm.js +941 -76
- package/dist/types.esm.js.map +4 -4
- package/package.json +2 -1
- package/src/__tests__/unsupportedSignInOperation.test.ts +13 -0
- package/src/auth.ts +248 -4
- package/src/clr.test.ts +163 -0
- package/src/clr.ts +2 -1
- package/src/index.ts +1 -0
- package/src/lcn.ts +342 -5
- package/src/share-links.ts +931 -0
package/dist/types.esm.js
CHANGED
|
@@ -440,7 +440,8 @@ var AssociationTypeValidator = z5.enum([
|
|
|
440
440
|
"replacedBy"
|
|
441
441
|
]).or(z5.string());
|
|
442
442
|
var AssociationValidator = z5.object({
|
|
443
|
-
|
|
443
|
+
// Accept compacted scalars while retaining the existing permissive array contract.
|
|
444
|
+
type: z5.string().min(1).or(z5.string().array().nonempty()),
|
|
444
445
|
associationType: AssociationTypeValidator,
|
|
445
446
|
sourceId: z5.string().optional(),
|
|
446
447
|
targetId: z5.string()
|
|
@@ -1288,11 +1289,48 @@ var ConsentFlowContractDetailsValidator = z12.object({
|
|
|
1288
1289
|
updatedAt: z12.string(),
|
|
1289
1290
|
expiresAt: z12.string().optional(),
|
|
1290
1291
|
autoBoosts: z12.string().array().optional(),
|
|
1291
|
-
writers: z12.array(LCNProfileValidator).optional()
|
|
1292
|
+
writers: z12.array(LCNProfileValidator).optional(),
|
|
1293
|
+
recipients: z12.array(LCNPublicProfileValidator.extend({ did: z12.string() })).optional(),
|
|
1294
|
+
audienceVersion: z12.number().int().nonnegative().optional()
|
|
1292
1295
|
});
|
|
1293
|
-
var ConsentFlowContractRequestStatusValidator = z12.enum(["pending", "accepted", "denied"]).nullable();
|
|
1296
|
+
var ConsentFlowContractRequestStatusValidator = z12.enum(["pending", "accepted", "denied", "cancelled"]).nullable();
|
|
1294
1297
|
var ConsentFlowContractRequestReadStatusValidator = z12.enum(["unseen", "seen"]).nullable();
|
|
1295
|
-
var
|
|
1298
|
+
var ConsentFlowReferralValidator = z12.object({
|
|
1299
|
+
requestId: z12.string(),
|
|
1300
|
+
requestedBy: z12.string(),
|
|
1301
|
+
externalReferenceId: z12.string().max(256).optional()
|
|
1302
|
+
});
|
|
1303
|
+
var ContractRequestFieldsValidator = ConsentFlowReferralValidator.partial().extend({
|
|
1304
|
+
requestedAt: z12.string().optional(),
|
|
1305
|
+
message: z12.string().max(500).optional()
|
|
1306
|
+
});
|
|
1307
|
+
var SendContractRequestValidator = z12.object({
|
|
1308
|
+
contractUri: z12.string(),
|
|
1309
|
+
targetProfileId: z12.string(),
|
|
1310
|
+
externalReferenceId: z12.string().trim().min(1).max(256).optional(),
|
|
1311
|
+
message: z12.string().trim().max(500).optional()
|
|
1312
|
+
});
|
|
1313
|
+
var ConsentFlowWebhookMetadataValidator = z12.object({
|
|
1314
|
+
eventId: z12.string(),
|
|
1315
|
+
deliveryKey: z12.string(),
|
|
1316
|
+
event: z12.enum([
|
|
1317
|
+
"request_sent",
|
|
1318
|
+
"request_accepted",
|
|
1319
|
+
"request_denied",
|
|
1320
|
+
"request_cancelled",
|
|
1321
|
+
"consent_created",
|
|
1322
|
+
"consent_updated",
|
|
1323
|
+
"consent_withdrawn",
|
|
1324
|
+
"credentials_synced"
|
|
1325
|
+
]),
|
|
1326
|
+
contractUri: z12.string(),
|
|
1327
|
+
termsUri: z12.string().optional(),
|
|
1328
|
+
requestId: z12.string().optional(),
|
|
1329
|
+
requestedBy: z12.string().optional(),
|
|
1330
|
+
externalReferenceId: z12.string().optional(),
|
|
1331
|
+
recipientRole: z12.enum(["owner", "recipient", "requester", "target"])
|
|
1332
|
+
});
|
|
1333
|
+
var ConsentFlowContractRequestForProfileValidator = ContractRequestFieldsValidator.extend({
|
|
1296
1334
|
profile: LCNProfileValidator,
|
|
1297
1335
|
status: ConsentFlowContractRequestStatusValidator,
|
|
1298
1336
|
readStatus: ConsentFlowContractRequestReadStatusValidator.optional()
|
|
@@ -1338,6 +1376,7 @@ var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
|
|
|
1338
1376
|
expiresAt: z12.string().optional(),
|
|
1339
1377
|
oneTime: z12.boolean().optional(),
|
|
1340
1378
|
terms: ConsentFlowTermsValidator,
|
|
1379
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
1341
1380
|
contract: ConsentFlowContractDetailsValidator,
|
|
1342
1381
|
uri: z12.string(),
|
|
1343
1382
|
consenter: LCNProfileValidator,
|
|
@@ -1433,6 +1472,7 @@ var ConsentFlowTransactionValidator = z12.object({
|
|
|
1433
1472
|
oneTime: z12.boolean().optional(),
|
|
1434
1473
|
terms: ConsentFlowTermsValidator.optional(),
|
|
1435
1474
|
guardianApproval: ConsentFlowGuardianApprovalValidator.optional(),
|
|
1475
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
1436
1476
|
id: z12.string(),
|
|
1437
1477
|
action: ConsentFlowTransactionActionValidator,
|
|
1438
1478
|
date: z12.string(),
|
|
@@ -1443,6 +1483,7 @@ var HolderExportConsentRecordValidator = z12.object({
|
|
|
1443
1483
|
status: ConsentFlowTermsStatusValidator,
|
|
1444
1484
|
contract: ConsentFlowContractDetailsValidator,
|
|
1445
1485
|
terms: ConsentFlowTermsValidator,
|
|
1486
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
1446
1487
|
transactions: ConsentFlowTransactionValidator.array()
|
|
1447
1488
|
});
|
|
1448
1489
|
var HolderExportMetadataValidator = z12.object({
|
|
@@ -2179,7 +2220,7 @@ var AppStoreListingSubmitterValidator = z12.object({
|
|
|
2179
2220
|
displayName: z12.string(),
|
|
2180
2221
|
email: z12.string().optional()
|
|
2181
2222
|
});
|
|
2182
|
-
var
|
|
2223
|
+
var AppStoreListingFieldsValidator = z12.object({
|
|
2183
2224
|
listing_id: z12.string(),
|
|
2184
2225
|
slug: z12.string().optional(),
|
|
2185
2226
|
display_name: z12.string(),
|
|
@@ -2205,15 +2246,33 @@ var AppStoreListingValidator = z12.object({
|
|
|
2205
2246
|
submitter: AppStoreListingSubmitterValidator.optional(),
|
|
2206
2247
|
contact_email: z12.string().email().optional()
|
|
2207
2248
|
});
|
|
2249
|
+
var PendingListingUpdateStatusValidator = z12.enum(["DRAFT", "PENDING_REVIEW"]);
|
|
2250
|
+
var PendingListingUpdateValidator = z12.object({
|
|
2251
|
+
status: PendingListingUpdateStatusValidator,
|
|
2252
|
+
submitted_at: z12.string().optional(),
|
|
2253
|
+
changes: AppStoreListingFieldsValidator.omit({
|
|
2254
|
+
listing_id: true,
|
|
2255
|
+
app_listing_status: true,
|
|
2256
|
+
promotion_level: true,
|
|
2257
|
+
submitted_at: true,
|
|
2258
|
+
submitter: true
|
|
2259
|
+
}).partial(),
|
|
2260
|
+
manifest_version: z12.number().int().min(1).optional()
|
|
2261
|
+
});
|
|
2262
|
+
var AppStoreListingValidator = AppStoreListingFieldsValidator.extend({
|
|
2263
|
+
pending_update: PendingListingUpdateValidator.optional()
|
|
2264
|
+
});
|
|
2208
2265
|
var AppStoreListingCreateValidator = AppStoreListingValidator.omit({
|
|
2209
2266
|
listing_id: true,
|
|
2210
2267
|
app_listing_status: true,
|
|
2211
|
-
promotion_level: true
|
|
2268
|
+
promotion_level: true,
|
|
2269
|
+
pending_update: true
|
|
2212
2270
|
});
|
|
2213
2271
|
var AppStoreListingUpdateValidator = AppStoreListingValidator.partial().omit({
|
|
2214
2272
|
listing_id: true,
|
|
2215
2273
|
app_listing_status: true,
|
|
2216
|
-
promotion_level: true
|
|
2274
|
+
promotion_level: true,
|
|
2275
|
+
pending_update: true
|
|
2217
2276
|
});
|
|
2218
2277
|
var InstalledAppValidator = AppStoreListingValidator.extend({
|
|
2219
2278
|
installed_at: z12.string()
|
|
@@ -2228,12 +2287,87 @@ var AppBoostValidator = z12.object({
|
|
|
2228
2287
|
templateAlias: z12.string().min(1).max(50).regex(/^[a-z0-9-]+$/),
|
|
2229
2288
|
boostUri: z12.string()
|
|
2230
2289
|
});
|
|
2231
|
-
var
|
|
2290
|
+
var InlineWalletCategoryValidator = z12.enum([
|
|
2291
|
+
"Achievement",
|
|
2292
|
+
"Skill",
|
|
2293
|
+
"ID",
|
|
2294
|
+
"Learning History",
|
|
2295
|
+
"Work History",
|
|
2296
|
+
"Social Badges",
|
|
2297
|
+
"Membership",
|
|
2298
|
+
"Accomplishment",
|
|
2299
|
+
"Experiences",
|
|
2300
|
+
"Accommodation",
|
|
2301
|
+
"Family"
|
|
2302
|
+
]);
|
|
2303
|
+
var InlineAlignmentValidator = z12.object({
|
|
2304
|
+
name: z12.string(),
|
|
2305
|
+
url: z12.string(),
|
|
2306
|
+
framework: z12.string().optional(),
|
|
2307
|
+
code: z12.string().optional()
|
|
2308
|
+
}).passthrough();
|
|
2309
|
+
var InlineEvidenceValidator = z12.object({
|
|
2310
|
+
id: z12.string().optional(),
|
|
2311
|
+
name: z12.string().optional(),
|
|
2312
|
+
narrative: z12.string().optional()
|
|
2313
|
+
}).passthrough();
|
|
2314
|
+
var InlineWalletSkillTagValidator = z12.object({
|
|
2315
|
+
frameworkId: z12.string(),
|
|
2316
|
+
id: z12.string(),
|
|
2317
|
+
proficiencyLevel: z12.string().optional()
|
|
2318
|
+
}).passthrough();
|
|
2319
|
+
var SimpleInlineCredentialTemplateValidator = z12.object({
|
|
2320
|
+
rawCredential: z12.undefined().optional(),
|
|
2321
|
+
name: z12.string(),
|
|
2322
|
+
description: z12.string().optional(),
|
|
2323
|
+
image: z12.string().optional(),
|
|
2324
|
+
issuerName: z12.string().optional(),
|
|
2325
|
+
achievementType: z12.string().optional(),
|
|
2326
|
+
category: InlineWalletCategoryValidator.optional(),
|
|
2327
|
+
criteria: z12.object({
|
|
2328
|
+
narrative: z12.string().optional(),
|
|
2329
|
+
url: z12.string().optional()
|
|
2330
|
+
}).passthrough().optional(),
|
|
2331
|
+
alignments: z12.array(InlineAlignmentValidator).optional(),
|
|
2332
|
+
tags: z12.array(z12.string()).optional(),
|
|
2333
|
+
activity: z12.object({
|
|
2334
|
+
startDate: z12.string().optional(),
|
|
2335
|
+
endDate: z12.string().optional()
|
|
2336
|
+
}).passthrough().optional(),
|
|
2337
|
+
credits: z12.object({
|
|
2338
|
+
earned: z12.union([z12.number(), z12.string()]).optional(),
|
|
2339
|
+
available: z12.union([z12.number(), z12.string()]).optional()
|
|
2340
|
+
}).passthrough().optional(),
|
|
2341
|
+
validUntil: z12.string().optional(),
|
|
2342
|
+
evidence: z12.array(InlineEvidenceValidator).optional(),
|
|
2343
|
+
walletSkills: z12.array(InlineWalletSkillTagValidator).optional()
|
|
2344
|
+
}).passthrough();
|
|
2345
|
+
var RawInlineCredentialTemplateValidator = z12.object({
|
|
2346
|
+
rawCredential: z12.record(z12.string(), z12.unknown()),
|
|
2347
|
+
category: InlineWalletCategoryValidator.optional(),
|
|
2348
|
+
walletSkills: z12.array(InlineWalletSkillTagValidator).optional()
|
|
2349
|
+
}).passthrough();
|
|
2350
|
+
var InlineCredentialTemplateValidator = z12.union([
|
|
2351
|
+
RawInlineCredentialTemplateValidator,
|
|
2352
|
+
SimpleInlineCredentialTemplateValidator
|
|
2353
|
+
]);
|
|
2354
|
+
var LegacySendCredentialEventValidator = z12.object({
|
|
2232
2355
|
type: z12.literal("send-credential"),
|
|
2233
2356
|
templateAlias: z12.string(),
|
|
2234
2357
|
templateData: z12.record(z12.string(), z12.unknown()).optional(),
|
|
2235
2358
|
preventDuplicateClaim: z12.boolean().optional()
|
|
2236
2359
|
});
|
|
2360
|
+
var InlineSendCredentialEventValidator = z12.object({
|
|
2361
|
+
type: z12.literal("send-credential"),
|
|
2362
|
+
alias: z12.string(),
|
|
2363
|
+
template: InlineCredentialTemplateValidator,
|
|
2364
|
+
templateData: z12.record(z12.string(), z12.unknown()).optional(),
|
|
2365
|
+
preventDuplicateClaim: z12.boolean().optional()
|
|
2366
|
+
});
|
|
2367
|
+
var SendCredentialEventValidator = z12.union([
|
|
2368
|
+
LegacySendCredentialEventValidator,
|
|
2369
|
+
InlineSendCredentialEventValidator
|
|
2370
|
+
]);
|
|
2237
2371
|
var CheckCredentialEventValidator = z12.object({
|
|
2238
2372
|
type: z12.literal("check-credential"),
|
|
2239
2373
|
templateAlias: z12.string().optional(),
|
|
@@ -2328,7 +2462,119 @@ var GetCountersEventValidator = z12.object({
|
|
|
2328
2462
|
type: z12.literal("get-counters"),
|
|
2329
2463
|
keys: z12.array(counterKeyValidator).min(1).max(50).optional()
|
|
2330
2464
|
});
|
|
2331
|
-
var
|
|
2465
|
+
var ConsentRequestWalletCategoryValidator = z12.enum([
|
|
2466
|
+
"Achievement",
|
|
2467
|
+
"Skill",
|
|
2468
|
+
"ID",
|
|
2469
|
+
"Learning History",
|
|
2470
|
+
"Work History",
|
|
2471
|
+
"Social Badges",
|
|
2472
|
+
"Membership",
|
|
2473
|
+
"Accomplishment",
|
|
2474
|
+
"Experiences",
|
|
2475
|
+
"Accommodation",
|
|
2476
|
+
"Family"
|
|
2477
|
+
]);
|
|
2478
|
+
var ConsentRequestPersonalFieldValidator = z12.enum([
|
|
2479
|
+
"name",
|
|
2480
|
+
"email",
|
|
2481
|
+
"phone",
|
|
2482
|
+
"birthDate",
|
|
2483
|
+
"country",
|
|
2484
|
+
"avatar"
|
|
2485
|
+
]);
|
|
2486
|
+
var ConsentRequestValidator = z12.object({
|
|
2487
|
+
read: z12.object({
|
|
2488
|
+
credentialCategories: z12.array(ConsentRequestWalletCategoryValidator).optional(),
|
|
2489
|
+
personalFields: z12.array(ConsentRequestPersonalFieldValidator).optional()
|
|
2490
|
+
}).optional(),
|
|
2491
|
+
write: z12.object({
|
|
2492
|
+
credentialCategories: z12.array(ConsentRequestWalletCategoryValidator).optional()
|
|
2493
|
+
}).optional(),
|
|
2494
|
+
reason: z12.string().optional()
|
|
2495
|
+
});
|
|
2496
|
+
var NormalizedConsentScopesValidator = z12.object({
|
|
2497
|
+
read: z12.object({
|
|
2498
|
+
credentialCategories: z12.array(ConsentRequestWalletCategoryValidator).default([]),
|
|
2499
|
+
personalFields: z12.array(ConsentRequestPersonalFieldValidator).default([])
|
|
2500
|
+
}),
|
|
2501
|
+
write: z12.object({
|
|
2502
|
+
credentialCategories: z12.array(ConsentRequestWalletCategoryValidator).default([])
|
|
2503
|
+
})
|
|
2504
|
+
});
|
|
2505
|
+
var CapturedTemplateRecordValidator = z12.object({
|
|
2506
|
+
alias: z12.string(),
|
|
2507
|
+
template: InlineCredentialTemplateValidator,
|
|
2508
|
+
version: z12.number().int().min(1),
|
|
2509
|
+
lastUsedAt: z12.string()
|
|
2510
|
+
}).passthrough();
|
|
2511
|
+
var CapturedConsentRecordValidator = z12.object({
|
|
2512
|
+
scopes: NormalizedConsentScopesValidator,
|
|
2513
|
+
reason: z12.string().optional(),
|
|
2514
|
+
lastUsedAt: z12.string()
|
|
2515
|
+
}).passthrough();
|
|
2516
|
+
var AppManifestValidator = z12.object({
|
|
2517
|
+
manifestVersion: z12.literal(1),
|
|
2518
|
+
appUrl: z12.string(),
|
|
2519
|
+
appKey: z12.string().max(200).optional(),
|
|
2520
|
+
suggestedName: z12.string().optional(),
|
|
2521
|
+
suggestedIconUrl: z12.string().optional(),
|
|
2522
|
+
permissions: z12.array(z12.string()).default([]),
|
|
2523
|
+
templates: z12.array(CapturedTemplateRecordValidator).default([]),
|
|
2524
|
+
consentRequests: z12.array(CapturedConsentRecordValidator).default([]),
|
|
2525
|
+
usedConsentContract: z12.boolean().optional(),
|
|
2526
|
+
featuresLaunched: z12.array(z12.string()).default([]),
|
|
2527
|
+
counterKeys: z12.array(z12.string()).default([]),
|
|
2528
|
+
usedLearnerContext: z12.boolean(),
|
|
2529
|
+
usedNotifications: z12.boolean(),
|
|
2530
|
+
firstCapturedAt: z12.string(),
|
|
2531
|
+
lastUpdatedAt: z12.string()
|
|
2532
|
+
}).passthrough();
|
|
2533
|
+
var AppManifestVersionStatusValidator = z12.enum(["draft", "active", "superseded"]);
|
|
2534
|
+
var AppManifestVersionValidator = z12.object({
|
|
2535
|
+
id: z12.string(),
|
|
2536
|
+
version: z12.number().int().min(1),
|
|
2537
|
+
manifestHash: z12.string(),
|
|
2538
|
+
manifest: AppManifestValidator,
|
|
2539
|
+
status: AppManifestVersionStatusValidator,
|
|
2540
|
+
createdAt: z12.string(),
|
|
2541
|
+
activatedAt: z12.string().optional()
|
|
2542
|
+
});
|
|
2543
|
+
var AppManifestStringDiffValidator = z12.object({
|
|
2544
|
+
added: z12.array(z12.string()),
|
|
2545
|
+
removed: z12.array(z12.string()),
|
|
2546
|
+
changed: z12.array(z12.string())
|
|
2547
|
+
});
|
|
2548
|
+
var AppManifestTemplateRefValidator = z12.object({
|
|
2549
|
+
alias: z12.string(),
|
|
2550
|
+
version: z12.number().int().min(1)
|
|
2551
|
+
});
|
|
2552
|
+
var AppManifestTemplateChangeValidator = z12.object({
|
|
2553
|
+
alias: z12.string(),
|
|
2554
|
+
fromVersion: z12.number().int().min(1),
|
|
2555
|
+
toVersion: z12.number().int().min(1)
|
|
2556
|
+
});
|
|
2557
|
+
var AppManifestDiffValidator = z12.object({
|
|
2558
|
+
permissions: AppManifestStringDiffValidator,
|
|
2559
|
+
templates: z12.object({
|
|
2560
|
+
added: z12.array(AppManifestTemplateRefValidator),
|
|
2561
|
+
removed: z12.array(AppManifestTemplateRefValidator),
|
|
2562
|
+
changed: z12.array(AppManifestTemplateChangeValidator)
|
|
2563
|
+
}),
|
|
2564
|
+
consentScopes: AppManifestStringDiffValidator,
|
|
2565
|
+
featurePaths: AppManifestStringDiffValidator,
|
|
2566
|
+
counterKeys: AppManifestStringDiffValidator,
|
|
2567
|
+
requiresReview: z12.boolean()
|
|
2568
|
+
});
|
|
2569
|
+
var UpsertConsentContractEventValidator = z12.object({
|
|
2570
|
+
type: z12.literal("upsert-consent-contract"),
|
|
2571
|
+
scopes: ConsentRequestValidator
|
|
2572
|
+
});
|
|
2573
|
+
var UpsertConsentContractResponseValidator = z12.object({
|
|
2574
|
+
contractUri: z12.string(),
|
|
2575
|
+
created: z12.boolean()
|
|
2576
|
+
});
|
|
2577
|
+
var AppEventValidator = z12.union([
|
|
2332
2578
|
SendCredentialEventValidator,
|
|
2333
2579
|
CheckCredentialEventValidator,
|
|
2334
2580
|
CheckIssuanceStatusEventValidator,
|
|
@@ -2338,7 +2584,8 @@ var AppEventValidator = z12.discriminatedUnion("type", [
|
|
|
2338
2584
|
SendNotificationEventValidator,
|
|
2339
2585
|
IncrementCounterEventValidator,
|
|
2340
2586
|
GetCounterEventValidator,
|
|
2341
|
-
GetCountersEventValidator
|
|
2587
|
+
GetCountersEventValidator,
|
|
2588
|
+
UpsertConsentContractEventValidator
|
|
2342
2589
|
]);
|
|
2343
2590
|
var AppEventInputValidator = z12.object({
|
|
2344
2591
|
listingId: z12.string(),
|
|
@@ -2406,6 +2653,7 @@ var CredentialActivityStatsValidator = z12.object({
|
|
|
2406
2653
|
});
|
|
2407
2654
|
|
|
2408
2655
|
// src/auth.ts
|
|
2656
|
+
import { z as z13 } from "zod";
|
|
2409
2657
|
var AuthSessionError = class extends Error {
|
|
2410
2658
|
constructor(message, reason) {
|
|
2411
2659
|
super(message);
|
|
@@ -2416,126 +2664,646 @@ var AuthSessionError = class extends Error {
|
|
|
2416
2664
|
__name(this, "AuthSessionError");
|
|
2417
2665
|
}
|
|
2418
2666
|
};
|
|
2667
|
+
var UnsupportedSignInOperationError = class extends Error {
|
|
2668
|
+
constructor(operation, providerType) {
|
|
2669
|
+
super(`${operation} is not supported by ${providerType}`);
|
|
2670
|
+
this.operation = operation;
|
|
2671
|
+
this.providerType = providerType;
|
|
2672
|
+
this.name = "UnsupportedSignInOperationError";
|
|
2673
|
+
}
|
|
2674
|
+
static {
|
|
2675
|
+
__name(this, "UnsupportedSignInOperationError");
|
|
2676
|
+
}
|
|
2677
|
+
};
|
|
2678
|
+
var ESCROW_PIN_LOCKED_MESSAGE = "Too many incorrect PIN attempts. You can still recover by waiting.";
|
|
2679
|
+
var ESCROW_PIN_UNAVAILABLE_MESSAGE = "PIN recovery is not available for this account.";
|
|
2680
|
+
var ESCROW_PIN_MISMATCH_PATTERN = /^Incorrect PIN\. (\d+) attempts left\.$/;
|
|
2681
|
+
var escrowPinMismatchMessage = /* @__PURE__ */ __name((attemptsRemaining) => `Incorrect PIN. ${attemptsRemaining} attempts left.`, "escrowPinMismatchMessage");
|
|
2682
|
+
var EscrowPinStatusValidator = z13.object({
|
|
2683
|
+
state: z13.enum(["none", "enabled", "locked", "stale"]),
|
|
2684
|
+
enabled: z13.boolean(),
|
|
2685
|
+
attemptsRemaining: z13.number().int().nonnegative(),
|
|
2686
|
+
salt: z13.string().optional()
|
|
2687
|
+
});
|
|
2419
2688
|
|
|
2420
2689
|
// src/bitstring-status-list.ts
|
|
2421
|
-
import { z as
|
|
2690
|
+
import { z as z14 } from "zod/v4";
|
|
2422
2691
|
var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
|
|
2423
2692
|
var DEFAULT_BITSTRING_STATUS_LIST_SIZE = 131072;
|
|
2424
|
-
var BitstringStatusPurposeValidator =
|
|
2425
|
-
var BitstringStatusListEntryValidator =
|
|
2426
|
-
id:
|
|
2427
|
-
type:
|
|
2693
|
+
var BitstringStatusPurposeValidator = z14.enum(BITSTRING_STATUS_PURPOSES);
|
|
2694
|
+
var BitstringStatusListEntryValidator = z14.object({
|
|
2695
|
+
id: z14.string().optional(),
|
|
2696
|
+
type: z14.literal("BitstringStatusListEntry"),
|
|
2428
2697
|
statusPurpose: BitstringStatusPurposeValidator,
|
|
2429
|
-
statusListIndex:
|
|
2430
|
-
statusListCredential:
|
|
2698
|
+
statusListIndex: z14.string().or(z14.number().int().nonnegative()),
|
|
2699
|
+
statusListCredential: z14.string()
|
|
2431
2700
|
});
|
|
2432
2701
|
var AllocatedBitstringStatusListEntryValidator = BitstringStatusListEntryValidator.extend({
|
|
2433
|
-
id:
|
|
2702
|
+
id: z14.string()
|
|
2434
2703
|
});
|
|
2435
|
-
var BitstringStatusListCredentialSubjectValidator =
|
|
2436
|
-
id:
|
|
2437
|
-
type:
|
|
2704
|
+
var BitstringStatusListCredentialSubjectValidator = z14.object({
|
|
2705
|
+
id: z14.string().optional(),
|
|
2706
|
+
type: z14.literal("BitstringStatusList"),
|
|
2438
2707
|
statusPurpose: BitstringStatusPurposeValidator,
|
|
2439
|
-
encodedList:
|
|
2708
|
+
encodedList: z14.string()
|
|
2440
2709
|
});
|
|
2441
|
-
var AllocateCredentialStatusInputValidator =
|
|
2442
|
-
statusPurposes:
|
|
2443
|
-
listSize:
|
|
2710
|
+
var AllocateCredentialStatusInputValidator = z14.object({
|
|
2711
|
+
statusPurposes: z14.array(BitstringStatusPurposeValidator).optional(),
|
|
2712
|
+
listSize: z14.number().int().positive().optional()
|
|
2444
2713
|
}).default({});
|
|
2445
2714
|
|
|
2446
2715
|
// src/inAppMessages.ts
|
|
2447
|
-
import { z as
|
|
2448
|
-
var inAppMessagePlatformValidator =
|
|
2449
|
-
var inAppMessageVersionSourceValidator =
|
|
2450
|
-
var inAppMessageVersionOpValidator =
|
|
2451
|
-
var platformPredicateValidator =
|
|
2452
|
-
var rolePredicateValidator =
|
|
2453
|
-
var versionPredicateValidator =
|
|
2454
|
-
version:
|
|
2716
|
+
import { z as z15 } from "zod";
|
|
2717
|
+
var inAppMessagePlatformValidator = z15.enum(["ios", "android", "web"]);
|
|
2718
|
+
var inAppMessageVersionSourceValidator = z15.enum(["native", "web", "capgo"]);
|
|
2719
|
+
var inAppMessageVersionOpValidator = z15.enum(["lt", "lte", "eq", "gte", "gt"]);
|
|
2720
|
+
var platformPredicateValidator = z15.object({ platform: z15.array(inAppMessagePlatformValidator).nonempty() }).strict();
|
|
2721
|
+
var rolePredicateValidator = z15.object({ role: z15.array(z15.string()).nonempty() }).strict();
|
|
2722
|
+
var versionPredicateValidator = z15.object({
|
|
2723
|
+
version: z15.object({
|
|
2455
2724
|
source: inAppMessageVersionSourceValidator,
|
|
2456
2725
|
op: inAppMessageVersionOpValidator,
|
|
2457
|
-
value:
|
|
2726
|
+
value: z15.string()
|
|
2458
2727
|
}).strict()
|
|
2459
2728
|
}).strict();
|
|
2460
|
-
var inAppMessagePredicateValidator =
|
|
2461
|
-
() =>
|
|
2729
|
+
var inAppMessagePredicateValidator = z15.lazy(
|
|
2730
|
+
() => z15.union([
|
|
2462
2731
|
platformPredicateValidator,
|
|
2463
2732
|
rolePredicateValidator,
|
|
2464
2733
|
versionPredicateValidator,
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2734
|
+
z15.object({ all: z15.array(inAppMessagePredicateValidator) }).strict(),
|
|
2735
|
+
z15.object({ any: z15.array(inAppMessagePredicateValidator) }).strict(),
|
|
2736
|
+
z15.object({ not: inAppMessagePredicateValidator }).strict()
|
|
2468
2737
|
])
|
|
2469
2738
|
);
|
|
2470
|
-
var inAppMessageActionStyleValidator =
|
|
2471
|
-
var internalLinkActionValidator =
|
|
2472
|
-
var externalLinkActionValidator =
|
|
2473
|
-
var appStoreActionValidator =
|
|
2474
|
-
type:
|
|
2475
|
-
iosUrl:
|
|
2476
|
-
androidUrl:
|
|
2477
|
-
webUrl:
|
|
2739
|
+
var inAppMessageActionStyleValidator = z15.enum(["primary", "secondary", "positive", "dismiss"]).default("secondary");
|
|
2740
|
+
var internalLinkActionValidator = z15.object({ type: z15.literal("internalLink"), path: z15.string() }).passthrough();
|
|
2741
|
+
var externalLinkActionValidator = z15.object({ type: z15.literal("externalLink"), url: z15.string() }).passthrough();
|
|
2742
|
+
var appStoreActionValidator = z15.object({
|
|
2743
|
+
type: z15.literal("appStore"),
|
|
2744
|
+
iosUrl: z15.string().optional(),
|
|
2745
|
+
androidUrl: z15.string().optional(),
|
|
2746
|
+
webUrl: z15.string().optional()
|
|
2478
2747
|
}).passthrough();
|
|
2479
|
-
var capgoUpdateActionValidator =
|
|
2480
|
-
var dismissActionValidator =
|
|
2481
|
-
var inAppMessageActionTargetValidator =
|
|
2748
|
+
var capgoUpdateActionValidator = z15.object({ type: z15.literal("capgoUpdate") }).passthrough();
|
|
2749
|
+
var dismissActionValidator = z15.object({ type: z15.literal("dismiss") }).passthrough();
|
|
2750
|
+
var inAppMessageActionTargetValidator = z15.union([
|
|
2482
2751
|
internalLinkActionValidator,
|
|
2483
2752
|
externalLinkActionValidator,
|
|
2484
2753
|
appStoreActionValidator,
|
|
2485
2754
|
capgoUpdateActionValidator,
|
|
2486
2755
|
dismissActionValidator
|
|
2487
2756
|
]);
|
|
2488
|
-
var inAppMessageActionValidator =
|
|
2489
|
-
label:
|
|
2757
|
+
var inAppMessageActionValidator = z15.object({
|
|
2758
|
+
label: z15.string(),
|
|
2490
2759
|
style: inAppMessageActionStyleValidator,
|
|
2491
2760
|
action: inAppMessageActionTargetValidator,
|
|
2492
2761
|
/** When true, the message closes after this action runs (default true). */
|
|
2493
|
-
closeOnComplete:
|
|
2762
|
+
closeOnComplete: z15.boolean().default(true)
|
|
2494
2763
|
}).passthrough();
|
|
2495
|
-
var inAppMessageMediaValidator =
|
|
2496
|
-
type:
|
|
2497
|
-
url:
|
|
2764
|
+
var inAppMessageMediaValidator = z15.object({
|
|
2765
|
+
type: z15.enum(["youtube", "image", "gif"]),
|
|
2766
|
+
url: z15.string(),
|
|
2498
2767
|
/** Aspect ratio hint, e.g. "16:9" or "1:1". Defaults to 16:9. */
|
|
2499
|
-
aspect:
|
|
2768
|
+
aspect: z15.string().default("16:9"),
|
|
2500
2769
|
/** Alt text for images/gifs (accessibility). */
|
|
2501
|
-
alt:
|
|
2770
|
+
alt: z15.string().optional()
|
|
2502
2771
|
}).passthrough();
|
|
2503
|
-
var inAppMessageFrequencyValidator =
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2772
|
+
var inAppMessageFrequencyValidator = z15.union([
|
|
2773
|
+
z15.literal("once"),
|
|
2774
|
+
z15.literal("session"),
|
|
2775
|
+
z15.literal("always"),
|
|
2776
|
+
z15.object({ everyDays: z15.number().positive() }).strict()
|
|
2508
2777
|
]).default("once");
|
|
2509
|
-
var inAppMessagePresentationValidator =
|
|
2510
|
-
var inAppMessageValidator =
|
|
2778
|
+
var inAppMessagePresentationValidator = z15.enum(["modal", "banner", "toast"]).default("modal");
|
|
2779
|
+
var inAppMessageValidator = z15.object({
|
|
2511
2780
|
/** Stable identifier — used to persist dismissal / frequency state. */
|
|
2512
|
-
id:
|
|
2781
|
+
id: z15.string(),
|
|
2513
2782
|
/** Higher priority wins when multiple messages match. Default 0. */
|
|
2514
|
-
priority:
|
|
2783
|
+
priority: z15.number().default(0),
|
|
2515
2784
|
/** When false, the message is required/blocking (no dismiss affordance). */
|
|
2516
|
-
dismissible:
|
|
2785
|
+
dismissible: z15.boolean().default(true),
|
|
2517
2786
|
frequency: inAppMessageFrequencyValidator,
|
|
2518
2787
|
presentation: inAppMessagePresentationValidator,
|
|
2519
2788
|
media: inAppMessageMediaValidator.optional(),
|
|
2520
2789
|
/** Optional emoji hero glyph — rendered only when `media` is not set. */
|
|
2521
|
-
emoji:
|
|
2522
|
-
title:
|
|
2523
|
-
body:
|
|
2524
|
-
actions:
|
|
2790
|
+
emoji: z15.string().optional(),
|
|
2791
|
+
title: z15.string(),
|
|
2792
|
+
body: z15.string().optional(),
|
|
2793
|
+
actions: z15.array(inAppMessageActionValidator).default([]),
|
|
2525
2794
|
/** Targeting predicate tree. Omitted → matches everyone. */
|
|
2526
2795
|
targeting: inAppMessagePredicateValidator.optional(),
|
|
2527
2796
|
/** Allow disabling a message without removing it from the flag. */
|
|
2528
|
-
enabled:
|
|
2797
|
+
enabled: z15.boolean().default(true)
|
|
2529
2798
|
}).passthrough();
|
|
2530
|
-
var inAppMessagesFlagValidator =
|
|
2531
|
-
version:
|
|
2532
|
-
messages:
|
|
2799
|
+
var inAppMessagesFlagValidator = z15.object({
|
|
2800
|
+
version: z15.number().default(1),
|
|
2801
|
+
messages: z15.array(inAppMessageValidator).default([])
|
|
2533
2802
|
}).passthrough();
|
|
2534
2803
|
var EMPTY_IN_APP_MESSAGES_FLAG = { version: 1, messages: [] };
|
|
2535
2804
|
var parseInAppMessagesFlag = /* @__PURE__ */ __name((raw) => {
|
|
2536
2805
|
const result = inAppMessagesFlagValidator.safeParse(raw);
|
|
2537
2806
|
return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
|
|
2538
2807
|
}, "parseInAppMessagesFlag");
|
|
2808
|
+
|
|
2809
|
+
// src/share-links.ts
|
|
2810
|
+
import { z as z16 } from "zod/v4";
|
|
2811
|
+
var SHARE_LINK_ID_BYTES = 16;
|
|
2812
|
+
var SHARE_CONTENT_KEY_BYTES = 32;
|
|
2813
|
+
var SHARE_IV_BYTES = 12;
|
|
2814
|
+
var SHARE_TAG_BYTES = 16;
|
|
2815
|
+
var MAX_SHARE_CIPHERTEXT_BYTES = 512 * 1024;
|
|
2816
|
+
var MAX_SHARE_RECOVERY_JWE_BYTES = 64 * 1024;
|
|
2817
|
+
var MAX_SELECTED_CREDENTIALS = 50;
|
|
2818
|
+
var MAX_ENDORSEMENTS = 200;
|
|
2819
|
+
var MAX_VP_MEMBERS = MAX_SELECTED_CREDENTIALS + MAX_ENDORSEMENTS;
|
|
2820
|
+
var MAX_SHARE_SOURCE_URI_CHARS = 2048;
|
|
2821
|
+
var MAX_SHARE_LINK_REQUEST_BYTES = 1024 * 1024;
|
|
2822
|
+
var SHARE_LINK_PROTOCOL = "lc-share/v1";
|
|
2823
|
+
var SHARE_RECOVERY_PROTOCOL = "lc-share-recovery/v1";
|
|
2824
|
+
var SHARE_AAD_PREFIX = "lc-share:v1";
|
|
2825
|
+
var BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
2826
|
+
var BASE64URL_LOOKUP = (() => {
|
|
2827
|
+
const table = new Int16Array(128).fill(-1);
|
|
2828
|
+
for (let index = 0; index < BASE64URL_ALPHABET.length; index += 1) {
|
|
2829
|
+
table[BASE64URL_ALPHABET.charCodeAt(index)] = index;
|
|
2830
|
+
}
|
|
2831
|
+
return table;
|
|
2832
|
+
})();
|
|
2833
|
+
var encodeBase64Url = /* @__PURE__ */ __name((bytes) => {
|
|
2834
|
+
let output = "";
|
|
2835
|
+
for (let index = 0; index < bytes.length; index += 3) {
|
|
2836
|
+
const first = bytes[index];
|
|
2837
|
+
const second = bytes[index + 1];
|
|
2838
|
+
const third = bytes[index + 2];
|
|
2839
|
+
output += BASE64URL_ALPHABET[first >> 2];
|
|
2840
|
+
output += BASE64URL_ALPHABET[(first & 3) << 4 | (second ?? 0) >> 4];
|
|
2841
|
+
if (second === void 0) break;
|
|
2842
|
+
output += BASE64URL_ALPHABET[(second & 15) << 2 | (third ?? 0) >> 6];
|
|
2843
|
+
if (third === void 0) break;
|
|
2844
|
+
output += BASE64URL_ALPHABET[third & 63];
|
|
2845
|
+
}
|
|
2846
|
+
return output;
|
|
2847
|
+
}, "encodeBase64Url");
|
|
2848
|
+
var decodeBase64Url = /* @__PURE__ */ __name((value) => {
|
|
2849
|
+
if (typeof value !== "string") return null;
|
|
2850
|
+
const output = new Uint8Array(Math.floor(value.length * 6 / 8));
|
|
2851
|
+
let bits = 0;
|
|
2852
|
+
let bitCount = 0;
|
|
2853
|
+
let outputIndex = 0;
|
|
2854
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
2855
|
+
const code = value.charCodeAt(index);
|
|
2856
|
+
const digit = code < 128 ? BASE64URL_LOOKUP[code] : -1;
|
|
2857
|
+
if (digit < 0) return null;
|
|
2858
|
+
bits = bits << 6 | digit;
|
|
2859
|
+
bitCount += 6;
|
|
2860
|
+
if (bitCount >= 8) {
|
|
2861
|
+
bitCount -= 8;
|
|
2862
|
+
output[outputIndex] = bits >> bitCount & 255;
|
|
2863
|
+
outputIndex += 1;
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
return output;
|
|
2867
|
+
}, "decodeBase64Url");
|
|
2868
|
+
var isCanonicalBase64Url = /* @__PURE__ */ __name((value, expectedBytes) => {
|
|
2869
|
+
if (typeof value !== "string") return false;
|
|
2870
|
+
if (expectedBytes !== void 0 && value.length !== Math.ceil(expectedBytes * 4 / 3))
|
|
2871
|
+
return false;
|
|
2872
|
+
const decoded = decodeBase64Url(value);
|
|
2873
|
+
if (decoded === null) return false;
|
|
2874
|
+
if (expectedBytes !== void 0 && decoded.length !== expectedBytes) return false;
|
|
2875
|
+
return encodeBase64Url(decoded) === value;
|
|
2876
|
+
}, "isCanonicalBase64Url");
|
|
2877
|
+
var decodedBase64UrlByteLength = /* @__PURE__ */ __name((value) => decodeBase64Url(value)?.length ?? null, "decodedBase64UrlByteLength");
|
|
2878
|
+
var utf8ByteLength = /* @__PURE__ */ __name((value) => new TextEncoder().encode(value).length, "utf8ByteLength");
|
|
2879
|
+
var canonicalBase64Url = /* @__PURE__ */ __name((bytes) => z16.string().refine((value) => isCanonicalBase64Url(value, bytes), {
|
|
2880
|
+
message: `must be canonical base64url for exactly ${bytes} bytes`
|
|
2881
|
+
}), "canonicalBase64Url");
|
|
2882
|
+
var ShareLinkIdValidator = canonicalBase64Url(SHARE_LINK_ID_BYTES);
|
|
2883
|
+
var ShareContentKeyValidator = canonicalBase64Url(SHARE_CONTENT_KEY_BYTES);
|
|
2884
|
+
var ShareIvValidator = canonicalBase64Url(SHARE_IV_BYTES);
|
|
2885
|
+
var ShareCiphertextValidator = z16.string().refine(
|
|
2886
|
+
(value) => {
|
|
2887
|
+
if (value.length > Math.ceil(MAX_SHARE_CIPHERTEXT_BYTES * 4 / 3)) return false;
|
|
2888
|
+
const decoded = decodeBase64Url(value);
|
|
2889
|
+
if (decoded === null) return false;
|
|
2890
|
+
if (encodeBase64Url(decoded) !== value) return false;
|
|
2891
|
+
return decoded.length >= SHARE_TAG_BYTES && decoded.length <= MAX_SHARE_CIPHERTEXT_BYTES;
|
|
2892
|
+
},
|
|
2893
|
+
{
|
|
2894
|
+
message: `must be canonical base64url decoding to ${SHARE_TAG_BYTES}..${MAX_SHARE_CIPHERTEXT_BYTES} bytes`
|
|
2895
|
+
}
|
|
2896
|
+
);
|
|
2897
|
+
var ShareEnvelopeValidator = z16.object({
|
|
2898
|
+
v: z16.literal(1),
|
|
2899
|
+
alg: z16.literal("A256GCM"),
|
|
2900
|
+
iv: ShareIvValidator,
|
|
2901
|
+
ct: ShareCiphertextValidator
|
|
2902
|
+
}).strict();
|
|
2903
|
+
var safeVersion = z16.number().int().min(1).max(2 ** 31 - 1);
|
|
2904
|
+
var safeCredentialIndex = z16.number().int().min(0).max(MAX_VP_MEMBERS - 1);
|
|
2905
|
+
var ShareSelectionEntryValidator = z16.object({ credentialIndex: safeCredentialIndex }).strict();
|
|
2906
|
+
var ShareEndorsementEntryValidator = z16.object({ credentialIndex: safeCredentialIndex, targetCredentialIndex: safeCredentialIndex }).strict();
|
|
2907
|
+
var ShareSharerValidator = z16.object({
|
|
2908
|
+
profileId: z16.string().min(1).max(128),
|
|
2909
|
+
displayName: z16.string().min(1).max(120),
|
|
2910
|
+
avatar: z16.string().max(2048).optional()
|
|
2911
|
+
}).strict();
|
|
2912
|
+
var presentationShape = VPValidator.extend({
|
|
2913
|
+
verifiableCredential: VCValidator.array().min(1).max(MAX_VP_MEMBERS)
|
|
2914
|
+
});
|
|
2915
|
+
var hasBoundedPresentation = /* @__PURE__ */ __name((value) => {
|
|
2916
|
+
let credentialCount = 0;
|
|
2917
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
2918
|
+
const visit = /* @__PURE__ */ __name((node, depth) => {
|
|
2919
|
+
if (node === null || typeof node !== "object") return true;
|
|
2920
|
+
if (depth > 32 || ancestors.has(node)) return false;
|
|
2921
|
+
ancestors.add(node);
|
|
2922
|
+
try {
|
|
2923
|
+
for (const [key, child] of Object.entries(node)) {
|
|
2924
|
+
if (key === "verifiableCredential") {
|
|
2925
|
+
credentialCount += Array.isArray(child) ? child.length : 1;
|
|
2926
|
+
if (credentialCount > MAX_VP_MEMBERS) return false;
|
|
2927
|
+
}
|
|
2928
|
+
if (!visit(child, depth + 1)) return false;
|
|
2929
|
+
}
|
|
2930
|
+
return true;
|
|
2931
|
+
} finally {
|
|
2932
|
+
ancestors.delete(node);
|
|
2933
|
+
}
|
|
2934
|
+
}, "visit");
|
|
2935
|
+
return visit(value, 0);
|
|
2936
|
+
}, "hasBoundedPresentation");
|
|
2937
|
+
var ShareManifestPresentationValidator = z16.custom(
|
|
2938
|
+
(value) => hasBoundedPresentation(value) && presentationShape.safeParse(value).success,
|
|
2939
|
+
{ message: "invalid share presentation" }
|
|
2940
|
+
);
|
|
2941
|
+
var SharePayloadValidatorShape = z16.object({
|
|
2942
|
+
protocol: z16.literal(SHARE_LINK_PROTOCOL),
|
|
2943
|
+
shareId: ShareLinkIdValidator,
|
|
2944
|
+
contentVersion: safeVersion,
|
|
2945
|
+
createdAt: z16.iso.datetime(),
|
|
2946
|
+
sharer: ShareSharerValidator,
|
|
2947
|
+
presentation: ShareManifestPresentationValidator,
|
|
2948
|
+
selection: ShareSelectionEntryValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
2949
|
+
endorsements: ShareEndorsementEntryValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
2950
|
+
}).strict();
|
|
2951
|
+
var classificationFailure = /* @__PURE__ */ __name((code, message, path = []) => ({ ok: false, code, message, path }), "classificationFailure");
|
|
2952
|
+
var readSignedClaimId = /* @__PURE__ */ __name((member) => {
|
|
2953
|
+
if (member === null || typeof member !== "object") return void 0;
|
|
2954
|
+
const record = member;
|
|
2955
|
+
const claim = record.credentialSubject ?? record.endorsement;
|
|
2956
|
+
if (claim === null || typeof claim !== "object") return void 0;
|
|
2957
|
+
const claimRecord = claim;
|
|
2958
|
+
const nested = claimRecord.endorsement;
|
|
2959
|
+
const nestedId = nested !== null && typeof nested === "object" ? nested.id : void 0;
|
|
2960
|
+
return claimRecord.id ?? nestedId;
|
|
2961
|
+
}, "readSignedClaimId");
|
|
2962
|
+
var classifyShareManifest = /* @__PURE__ */ __name((payload) => {
|
|
2963
|
+
const members = payload.presentation?.verifiableCredential;
|
|
2964
|
+
if (!Array.isArray(members) || members.length === 0) {
|
|
2965
|
+
return classificationFailure("NO_PRESENTATION_MEMBERS", "presentation has no credentials");
|
|
2966
|
+
}
|
|
2967
|
+
if (members.length > MAX_VP_MEMBERS) {
|
|
2968
|
+
return classificationFailure(
|
|
2969
|
+
"TOO_MANY_VP_MEMBERS",
|
|
2970
|
+
`presentation has ${members.length} members, over the ${MAX_VP_MEMBERS} bound`
|
|
2971
|
+
);
|
|
2972
|
+
}
|
|
2973
|
+
const selection = payload.selection;
|
|
2974
|
+
const endorsements = payload.endorsements ?? [];
|
|
2975
|
+
if (!Array.isArray(selection) || selection.length < 1 || selection.length > MAX_SELECTED_CREDENTIALS) {
|
|
2976
|
+
return classificationFailure("BAD_SELECTION", "selection must contain 1..50 entries");
|
|
2977
|
+
}
|
|
2978
|
+
if (!Array.isArray(endorsements) || endorsements.length > MAX_ENDORSEMENTS) {
|
|
2979
|
+
return classificationFailure(
|
|
2980
|
+
"BAD_ENDORSEMENTS",
|
|
2981
|
+
"endorsements must contain at most 200 entries"
|
|
2982
|
+
);
|
|
2983
|
+
}
|
|
2984
|
+
const selectedIndices = [];
|
|
2985
|
+
const selected = /* @__PURE__ */ new Set();
|
|
2986
|
+
for (let index = 0; index < selection.length; index += 1) {
|
|
2987
|
+
const entry = selection[index];
|
|
2988
|
+
const credentialIndex = entry?.credentialIndex;
|
|
2989
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
2990
|
+
return classificationFailure(
|
|
2991
|
+
"SELECTION_INDEX_OUT_OF_BOUNDS",
|
|
2992
|
+
`selection[${index}].credentialIndex is out of bounds`,
|
|
2993
|
+
["selection", index, "credentialIndex"]
|
|
2994
|
+
);
|
|
2995
|
+
}
|
|
2996
|
+
if (selected.has(credentialIndex)) {
|
|
2997
|
+
return classificationFailure(
|
|
2998
|
+
"SELECTION_INDEX_DUPLICATE",
|
|
2999
|
+
`selection[${index}].credentialIndex is duplicated`,
|
|
3000
|
+
["selection", index, "credentialIndex"]
|
|
3001
|
+
);
|
|
3002
|
+
}
|
|
3003
|
+
selected.add(credentialIndex);
|
|
3004
|
+
selectedIndices.push(credentialIndex);
|
|
3005
|
+
}
|
|
3006
|
+
const classified = new Set(selected);
|
|
3007
|
+
const endorsementIndices = [];
|
|
3008
|
+
for (let index = 0; index < endorsements.length; index += 1) {
|
|
3009
|
+
const entry = endorsements[index];
|
|
3010
|
+
const credentialIndex = entry?.credentialIndex;
|
|
3011
|
+
const targetIndex = entry?.targetCredentialIndex;
|
|
3012
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
3013
|
+
return classificationFailure(
|
|
3014
|
+
"ENDORSEMENT_INDEX_OUT_OF_BOUNDS",
|
|
3015
|
+
`endorsements[${index}].credentialIndex is out of bounds`,
|
|
3016
|
+
["endorsements", index, "credentialIndex"]
|
|
3017
|
+
);
|
|
3018
|
+
}
|
|
3019
|
+
if (classified.has(credentialIndex)) {
|
|
3020
|
+
return classificationFailure(
|
|
3021
|
+
"VP_MEMBER_CLASSIFIED_TWICE",
|
|
3022
|
+
`endorsements[${index}].credentialIndex was already classified`,
|
|
3023
|
+
["endorsements", index, "credentialIndex"]
|
|
3024
|
+
);
|
|
3025
|
+
}
|
|
3026
|
+
if (!selected.has(targetIndex)) {
|
|
3027
|
+
return classificationFailure(
|
|
3028
|
+
"ENDORSEMENT_TARGET_NOT_SELECTED",
|
|
3029
|
+
`endorsements[${index}].targetCredentialIndex must reference a selected credential`,
|
|
3030
|
+
["endorsements", index, "targetCredentialIndex"]
|
|
3031
|
+
);
|
|
3032
|
+
}
|
|
3033
|
+
const referenced = readSignedClaimId(members[credentialIndex]);
|
|
3034
|
+
const target = members[targetIndex];
|
|
3035
|
+
const targetId = target !== null && typeof target === "object" ? target.id : void 0;
|
|
3036
|
+
if (typeof referenced !== "string" || typeof targetId !== "string" || referenced !== targetId) {
|
|
3037
|
+
return classificationFailure(
|
|
3038
|
+
"ENDORSEMENT_TARGET_UNBOUND",
|
|
3039
|
+
`endorsements[${index}] claim does not reference the target credential id`,
|
|
3040
|
+
["endorsements", index]
|
|
3041
|
+
);
|
|
3042
|
+
}
|
|
3043
|
+
classified.add(credentialIndex);
|
|
3044
|
+
endorsementIndices.push(credentialIndex);
|
|
3045
|
+
}
|
|
3046
|
+
if (classified.size !== members.length) {
|
|
3047
|
+
return classificationFailure(
|
|
3048
|
+
"UNCLASSIFIED_VP_MEMBER",
|
|
3049
|
+
"every presentation member must be classified exactly once",
|
|
3050
|
+
["presentation", "verifiableCredential"]
|
|
3051
|
+
);
|
|
3052
|
+
}
|
|
3053
|
+
return {
|
|
3054
|
+
ok: true,
|
|
3055
|
+
classification: { selectedIndices, endorsementIndices, memberCount: members.length }
|
|
3056
|
+
};
|
|
3057
|
+
}, "classifyShareManifest");
|
|
3058
|
+
var SharePayloadValidator = SharePayloadValidatorShape.superRefine((payload, ctx) => {
|
|
3059
|
+
const result = classifyShareManifest(payload);
|
|
3060
|
+
if (!result.ok) {
|
|
3061
|
+
ctx.addIssue({
|
|
3062
|
+
code: "custom",
|
|
3063
|
+
message: result.message,
|
|
3064
|
+
path: result.path,
|
|
3065
|
+
params: { shareLinkCode: result.code }
|
|
3066
|
+
});
|
|
3067
|
+
}
|
|
3068
|
+
});
|
|
3069
|
+
var ShareRecoverySelectionValidator = z16.object({
|
|
3070
|
+
ref: z16.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS),
|
|
3071
|
+
order: z16.number().int().min(0).max(MAX_SELECTED_CREDENTIALS - 1)
|
|
3072
|
+
}).strict();
|
|
3073
|
+
var ShareRecoveryEndorsementValidator = z16.object({ targetRef: z16.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS) }).strict();
|
|
3074
|
+
var ShareRecoveryPlaintextValidator = z16.object({
|
|
3075
|
+
protocol: z16.literal(SHARE_RECOVERY_PROTOCOL),
|
|
3076
|
+
shareId: ShareLinkIdValidator,
|
|
3077
|
+
ownerProfileId: z16.string().min(1).max(128),
|
|
3078
|
+
createdAt: z16.iso.datetime(),
|
|
3079
|
+
latest: z16.object({ contentVersion: safeVersion, key: ShareContentKeyValidator }).strict(),
|
|
3080
|
+
selection: ShareRecoverySelectionValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
3081
|
+
endorsements: ShareRecoveryEndorsementValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
3082
|
+
}).strict().superRefine((recovery, ctx) => {
|
|
3083
|
+
const orders = /* @__PURE__ */ new Set();
|
|
3084
|
+
recovery.selection.forEach((entry, index) => {
|
|
3085
|
+
if (entry.order >= recovery.selection.length) {
|
|
3086
|
+
ctx.addIssue({
|
|
3087
|
+
code: "custom",
|
|
3088
|
+
message: "order must be within the selection bounds",
|
|
3089
|
+
path: ["selection", index, "order"]
|
|
3090
|
+
});
|
|
3091
|
+
}
|
|
3092
|
+
if (orders.has(entry.order)) {
|
|
3093
|
+
ctx.addIssue({
|
|
3094
|
+
code: "custom",
|
|
3095
|
+
message: "order must be unique within the selection",
|
|
3096
|
+
path: ["selection", index, "order"]
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
orders.add(entry.order);
|
|
3100
|
+
});
|
|
3101
|
+
});
|
|
3102
|
+
var ShareOwnerRecoveryValidator = JWEValidator.refine(
|
|
3103
|
+
(value) => utf8ByteLength(JSON.stringify(value)) <= MAX_SHARE_RECOVERY_JWE_BYTES,
|
|
3104
|
+
{ message: `serialized recovery JWE must be at most ${MAX_SHARE_RECOVERY_JWE_BYTES} bytes` }
|
|
3105
|
+
);
|
|
3106
|
+
var ShareLinkStatusValidator = z16.enum(["pending", "active", "stopped"]);
|
|
3107
|
+
var ShareContentStateValidator = z16.enum(["staging", "finalized", "content_missing"]);
|
|
3108
|
+
var ShareLinkValidator = z16.object({
|
|
3109
|
+
id: ShareLinkIdValidator,
|
|
3110
|
+
title: z16.string().min(1).max(120),
|
|
3111
|
+
note: z16.string().max(500).optional(),
|
|
3112
|
+
selectedCount: z16.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
3113
|
+
version: safeVersion,
|
|
3114
|
+
contentVersion: safeVersion,
|
|
3115
|
+
status: ShareLinkStatusValidator,
|
|
3116
|
+
attachmentId: z16.string().uuid().nullable().optional(),
|
|
3117
|
+
attachmentChunkCount: z16.number().int().min(1).max(16).nullable().optional(),
|
|
3118
|
+
contentState: ShareContentStateValidator,
|
|
3119
|
+
createdAt: z16.iso.datetime(),
|
|
3120
|
+
updatedAt: z16.iso.datetime(),
|
|
3121
|
+
expiresAt: z16.iso.datetime().nullable(),
|
|
3122
|
+
stoppedAt: z16.iso.datetime().nullable(),
|
|
3123
|
+
lastViewedAt: z16.iso.datetime().nullable(),
|
|
3124
|
+
viewCount: z16.number().int().min(0).optional(),
|
|
3125
|
+
passcodeProtected: z16.boolean(),
|
|
3126
|
+
notifyOnView: z16.boolean(),
|
|
3127
|
+
minorPolicy: z16.object({
|
|
3128
|
+
isMinor: z16.boolean().nullable(),
|
|
3129
|
+
policyResolved: z16.boolean(),
|
|
3130
|
+
defaultExpiryDays: z16.union([z16.literal(30), z16.literal(365)]),
|
|
3131
|
+
viewCountingEnabled: z16.boolean()
|
|
3132
|
+
}),
|
|
3133
|
+
/**
|
|
3134
|
+
* Guarded application/API URL for the content. Optional because owner APIs in
|
|
3135
|
+
* D1 have no public resolve/content endpoint yet; it must never be a
|
|
3136
|
+
* LearnCloud object URL or carry a fabricated decryption key.
|
|
3137
|
+
*/
|
|
3138
|
+
contentUrl: z16.string().optional()
|
|
3139
|
+
});
|
|
3140
|
+
var clientRequestId = z16.string().uuid();
|
|
3141
|
+
var ShareLinkAttachmentValidator = z16.object({
|
|
3142
|
+
id: z16.string().uuid(),
|
|
3143
|
+
chunkCount: z16.number().int().min(1).max(16)
|
|
3144
|
+
}).strict();
|
|
3145
|
+
var attachmentChunkKey = {
|
|
3146
|
+
id: ShareLinkIdValidator,
|
|
3147
|
+
contentVersion: safeVersion,
|
|
3148
|
+
attachmentId: z16.string().uuid(),
|
|
3149
|
+
chunkIndex: z16.number().int().min(0).max(15)
|
|
3150
|
+
};
|
|
3151
|
+
var ShareLinkAttachmentChunkEnvelopeValidator = ShareEnvelopeValidator.refine(
|
|
3152
|
+
(value) => (decodedBase64UrlByteLength(value.ct) ?? Infinity) <= 256 * 1024 + SHARE_TAG_BYTES
|
|
3153
|
+
);
|
|
3154
|
+
var PutShareLinkAttachmentChunkInputValidator = z16.object({
|
|
3155
|
+
...attachmentChunkKey,
|
|
3156
|
+
chunkCount: z16.number().int().min(1).max(16),
|
|
3157
|
+
envelope: ShareLinkAttachmentChunkEnvelopeValidator,
|
|
3158
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator
|
|
3159
|
+
}).strict().refine((value) => value.chunkIndex < value.chunkCount);
|
|
3160
|
+
var GetShareLinkAttachmentChunkInputValidator = z16.object({
|
|
3161
|
+
...attachmentChunkKey,
|
|
3162
|
+
passcode: z16.string().min(4).max(64).optional(),
|
|
3163
|
+
accessToken: z16.string().min(1).max(2048).optional()
|
|
3164
|
+
}).strict();
|
|
3165
|
+
var ShareLinkAttachmentChunkOutputValidator = z16.object({
|
|
3166
|
+
...attachmentChunkKey,
|
|
3167
|
+
envelope: ShareLinkAttachmentChunkEnvelopeValidator,
|
|
3168
|
+
accessToken: z16.string().min(1).max(2048).optional()
|
|
3169
|
+
}).strict();
|
|
3170
|
+
var DeleteShareLinkAttachmentChunksInputValidator = z16.object({
|
|
3171
|
+
id: ShareLinkIdValidator,
|
|
3172
|
+
contentVersion: safeVersion,
|
|
3173
|
+
attachmentId: z16.string().uuid(),
|
|
3174
|
+
chunkCount: z16.number().int().min(1).max(16)
|
|
3175
|
+
}).strict();
|
|
3176
|
+
var PutShareLinkAttachmentChunkOutputValidator = z16.object({ ok: z16.literal(true) }).strict();
|
|
3177
|
+
var DeleteShareLinkAttachmentChunksOutputValidator = z16.object({ ok: z16.boolean() }).strict();
|
|
3178
|
+
var CreateShareLinkInputValidator = z16.object({
|
|
3179
|
+
id: ShareLinkIdValidator,
|
|
3180
|
+
clientRequestId,
|
|
3181
|
+
title: z16.string().min(1).max(120),
|
|
3182
|
+
note: z16.string().max(500).optional(),
|
|
3183
|
+
expiresAt: z16.iso.datetime().nullable().optional(),
|
|
3184
|
+
passcode: z16.string().min(8).max(64).optional(),
|
|
3185
|
+
notifyOnView: z16.boolean().default(false),
|
|
3186
|
+
selectedCount: z16.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
3187
|
+
contentVersion: z16.literal(1),
|
|
3188
|
+
envelope: ShareEnvelopeValidator,
|
|
3189
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator,
|
|
3190
|
+
attachment: ShareLinkAttachmentValidator.optional()
|
|
3191
|
+
}).strict();
|
|
3192
|
+
var UpdateShareLinkInputValidator = z16.object({
|
|
3193
|
+
id: ShareLinkIdValidator,
|
|
3194
|
+
expectedVersion: safeVersion,
|
|
3195
|
+
clientRequestId,
|
|
3196
|
+
title: z16.string().min(1).max(120).optional(),
|
|
3197
|
+
note: z16.string().max(500).nullable().optional(),
|
|
3198
|
+
expiresAt: z16.iso.datetime().nullable().optional(),
|
|
3199
|
+
/** Omitted preserves the current passcode, null removes it, and a string replaces it. */
|
|
3200
|
+
passcode: z16.string().min(8).max(64).nullable().optional(),
|
|
3201
|
+
notifyOnView: z16.boolean().optional(),
|
|
3202
|
+
contentVersion: safeVersion.optional(),
|
|
3203
|
+
selectedCount: z16.number().int().min(1).max(MAX_SELECTED_CREDENTIALS).optional(),
|
|
3204
|
+
envelope: ShareEnvelopeValidator.optional(),
|
|
3205
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator.optional(),
|
|
3206
|
+
attachment: ShareLinkAttachmentValidator.optional()
|
|
3207
|
+
}).strict().superRefine((value, ctx) => {
|
|
3208
|
+
const provided = [
|
|
3209
|
+
value.contentVersion,
|
|
3210
|
+
value.selectedCount,
|
|
3211
|
+
value.envelope,
|
|
3212
|
+
value.ownerEncryptedRecovery
|
|
3213
|
+
].filter((field) => field !== void 0).length;
|
|
3214
|
+
if (provided !== 0 && provided !== 4) {
|
|
3215
|
+
ctx.addIssue({
|
|
3216
|
+
code: "custom",
|
|
3217
|
+
message: "content replacement requires contentVersion, selectedCount, envelope and ownerEncryptedRecovery together"
|
|
3218
|
+
});
|
|
3219
|
+
}
|
|
3220
|
+
if (value.attachment !== void 0 && provided !== 4) {
|
|
3221
|
+
ctx.addIssue({ code: "custom", message: "attachment requires a content replacement" });
|
|
3222
|
+
}
|
|
3223
|
+
});
|
|
3224
|
+
var ShareLinkIdInputValidator = z16.object({ id: ShareLinkIdValidator }).strict();
|
|
3225
|
+
var ShareLinkOperationKeyInputValidator = z16.object({ id: ShareLinkIdValidator, operationId: z16.string().uuid() }).strict();
|
|
3226
|
+
var ShareLinkOwnerCommitOutputValidator = z16.discriminatedUnion("status", [
|
|
3227
|
+
z16.object({ status: z16.literal("completed"), share: ShareLinkValidator }).strict(),
|
|
3228
|
+
z16.object({
|
|
3229
|
+
status: z16.literal("pending"),
|
|
3230
|
+
id: ShareLinkIdValidator,
|
|
3231
|
+
operationId: z16.string().uuid()
|
|
3232
|
+
}).strict()
|
|
3233
|
+
]);
|
|
3234
|
+
var ShareLinkOwnerStatusOutputValidator = z16.discriminatedUnion("status", [
|
|
3235
|
+
z16.object({ status: z16.literal("found"), share: ShareLinkValidator }).strict(),
|
|
3236
|
+
z16.object({
|
|
3237
|
+
status: z16.literal("pending"),
|
|
3238
|
+
id: ShareLinkIdValidator,
|
|
3239
|
+
operationId: z16.string().uuid()
|
|
3240
|
+
}).strict(),
|
|
3241
|
+
z16.object({ status: z16.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
3242
|
+
]);
|
|
3243
|
+
var ShareLinkOwnerRecoveryOutputValidator = z16.object({ recovery: ShareOwnerRecoveryValidator }).strict();
|
|
3244
|
+
var ShareLinkOwnerContentOutputValidator = z16.object({
|
|
3245
|
+
id: ShareLinkIdValidator,
|
|
3246
|
+
contentVersion: safeVersion,
|
|
3247
|
+
envelope: ShareEnvelopeValidator
|
|
3248
|
+
}).strict();
|
|
3249
|
+
var ResolveShareLinkInputValidator = z16.object({
|
|
3250
|
+
id: ShareLinkIdValidator,
|
|
3251
|
+
/** Sent only in a POST body; it must never be placed in a share URL. */
|
|
3252
|
+
passcode: z16.string().min(4).max(64).optional()
|
|
3253
|
+
}).strict();
|
|
3254
|
+
var ShareLinkPublicStateValidator = z16.discriminatedUnion("state", [
|
|
3255
|
+
z16.object({
|
|
3256
|
+
state: z16.literal("passcode_required"),
|
|
3257
|
+
id: ShareLinkIdValidator
|
|
3258
|
+
}).strict(),
|
|
3259
|
+
z16.object({ state: z16.literal("try_later"), id: ShareLinkIdValidator }).strict(),
|
|
3260
|
+
z16.object({
|
|
3261
|
+
state: z16.literal("active"),
|
|
3262
|
+
id: ShareLinkIdValidator,
|
|
3263
|
+
title: z16.string().max(120),
|
|
3264
|
+
note: z16.string().max(500).optional(),
|
|
3265
|
+
selectedCount: z16.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
3266
|
+
contentVersion: safeVersion,
|
|
3267
|
+
contentUrl: z16.string(),
|
|
3268
|
+
sharer: z16.object({
|
|
3269
|
+
displayName: z16.string().max(120),
|
|
3270
|
+
avatar: z16.string().max(2048).optional()
|
|
3271
|
+
}),
|
|
3272
|
+
createdAt: z16.iso.datetime(),
|
|
3273
|
+
updatedAt: z16.iso.datetime(),
|
|
3274
|
+
expiresAt: z16.iso.datetime().nullable()
|
|
3275
|
+
}).strict(),
|
|
3276
|
+
z16.object({
|
|
3277
|
+
state: z16.literal("expired"),
|
|
3278
|
+
id: ShareLinkIdValidator,
|
|
3279
|
+
expiresAt: z16.iso.datetime()
|
|
3280
|
+
}).strict(),
|
|
3281
|
+
z16.object({
|
|
3282
|
+
state: z16.literal("stopped"),
|
|
3283
|
+
id: ShareLinkIdValidator,
|
|
3284
|
+
stoppedAt: z16.iso.datetime()
|
|
3285
|
+
}).strict(),
|
|
3286
|
+
z16.object({ state: z16.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
3287
|
+
]);
|
|
3288
|
+
var ListShareLinksInputValidator = z16.object({
|
|
3289
|
+
limit: z16.number().int().min(1).max(50).default(25),
|
|
3290
|
+
cursor: z16.string().max(512).optional()
|
|
3291
|
+
}).strict();
|
|
3292
|
+
var PaginatedShareLinksValidator = PaginationResponseValidator.extend({
|
|
3293
|
+
records: ShareLinkValidator.array()
|
|
3294
|
+
});
|
|
3295
|
+
var AcknowledgeViewInputValidator = z16.object({
|
|
3296
|
+
receipt: z16.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
3297
|
+
}).strict();
|
|
3298
|
+
var AcknowledgeViewOutputValidator = z16.object({ ok: z16.literal(true) }).strict();
|
|
3299
|
+
var SHARE_VIEW_RECEIPT_TTL_SECONDS = 10 * 60;
|
|
3300
|
+
var ShareLinkPublicContentViewValidator = z16.object({
|
|
3301
|
+
id: ShareLinkIdValidator,
|
|
3302
|
+
contentVersion: safeVersion,
|
|
3303
|
+
envelope: ShareEnvelopeValidator,
|
|
3304
|
+
contentUrl: z16.string(),
|
|
3305
|
+
receipt: z16.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
3306
|
+
}).strict();
|
|
2539
3307
|
export {
|
|
2540
3308
|
ACT_AS_HEADER,
|
|
2541
3309
|
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
|
|
@@ -2544,6 +3312,8 @@ export {
|
|
|
2544
3312
|
AchievementSubjectValidator,
|
|
2545
3313
|
AchievementTypeValidator,
|
|
2546
3314
|
AchievementValidator,
|
|
3315
|
+
AcknowledgeViewInputValidator,
|
|
3316
|
+
AcknowledgeViewOutputValidator,
|
|
2547
3317
|
AddTagInputValidator,
|
|
2548
3318
|
AddressValidator,
|
|
2549
3319
|
AgeRatingValidator,
|
|
@@ -2559,6 +3329,12 @@ export {
|
|
|
2559
3329
|
AppEventResponseValidator,
|
|
2560
3330
|
AppEventValidator,
|
|
2561
3331
|
AppListingStatusValidator,
|
|
3332
|
+
AppManifestDiffValidator,
|
|
3333
|
+
AppManifestTemplateChangeValidator,
|
|
3334
|
+
AppManifestTemplateRefValidator,
|
|
3335
|
+
AppManifestValidator,
|
|
3336
|
+
AppManifestVersionStatusValidator,
|
|
3337
|
+
AppManifestVersionValidator,
|
|
2562
3338
|
AppStoreListingCreateValidator,
|
|
2563
3339
|
AppStoreListingSubmitterValidator,
|
|
2564
3340
|
AppStoreListingUpdateValidator,
|
|
@@ -2580,6 +3356,8 @@ export {
|
|
|
2580
3356
|
BoostRecipientValidator,
|
|
2581
3357
|
BoostRecipientWithChildrenValidator,
|
|
2582
3358
|
BoostValidator,
|
|
3359
|
+
CapturedConsentRecordValidator,
|
|
3360
|
+
CapturedTemplateRecordValidator,
|
|
2583
3361
|
CheckCredentialEventValidator,
|
|
2584
3362
|
CheckIssuanceStatusEventValidator,
|
|
2585
3363
|
ClaimHookQueryValidator,
|
|
@@ -2601,6 +3379,7 @@ export {
|
|
|
2601
3379
|
ConsentFlowDataForDidQueryValidator,
|
|
2602
3380
|
ConsentFlowDataQueryValidator,
|
|
2603
3381
|
ConsentFlowGuardianApprovalValidator,
|
|
3382
|
+
ConsentFlowReferralValidator,
|
|
2604
3383
|
ConsentFlowTermValidator,
|
|
2605
3384
|
ConsentFlowTermsQueryValidator,
|
|
2606
3385
|
ConsentFlowTermsStatusValidator,
|
|
@@ -2608,6 +3387,10 @@ export {
|
|
|
2608
3387
|
ConsentFlowTransactionActionValidator,
|
|
2609
3388
|
ConsentFlowTransactionValidator,
|
|
2610
3389
|
ConsentFlowTransactionsQueryValidator,
|
|
3390
|
+
ConsentFlowWebhookMetadataValidator,
|
|
3391
|
+
ConsentRequestPersonalFieldValidator,
|
|
3392
|
+
ConsentRequestValidator,
|
|
3393
|
+
ConsentRequestWalletCategoryValidator,
|
|
2611
3394
|
ContactMethodCreateValidator,
|
|
2612
3395
|
ContactMethodQueryValidator,
|
|
2613
3396
|
ContactMethodValidator,
|
|
@@ -2615,12 +3398,14 @@ export {
|
|
|
2615
3398
|
ContactMethodVerificationValidator,
|
|
2616
3399
|
ContextValidator,
|
|
2617
3400
|
ContractCredentialValidator,
|
|
3401
|
+
ContractRequestFieldsValidator,
|
|
2618
3402
|
CountSkillsInputValidator,
|
|
2619
3403
|
CountSkillsResultValidator,
|
|
2620
3404
|
CreateContactMethodSessionResponseValidator,
|
|
2621
3405
|
CreateContactMethodSessionValidator,
|
|
2622
3406
|
CreateManagedFrameworkBatchInputValidator,
|
|
2623
3407
|
CreateManagedFrameworkInputValidator,
|
|
3408
|
+
CreateShareLinkInputValidator,
|
|
2624
3409
|
CreateSkillInputValidator,
|
|
2625
3410
|
CreateSkillsBatchInputValidator,
|
|
2626
3411
|
CredentialActivityEventTypeValidator,
|
|
@@ -2649,13 +3434,19 @@ export {
|
|
|
2649
3434
|
CriteriaValidator,
|
|
2650
3435
|
DEFAULT_BITSTRING_STATUS_LIST_SIZE,
|
|
2651
3436
|
DeleteFrameworkInputValidator,
|
|
3437
|
+
DeleteShareLinkAttachmentChunksInputValidator,
|
|
3438
|
+
DeleteShareLinkAttachmentChunksOutputValidator,
|
|
2652
3439
|
DeleteSkillInputValidator,
|
|
2653
3440
|
DidDocumentValidator,
|
|
2654
3441
|
EMPTY_IN_APP_MESSAGES_FLAG,
|
|
3442
|
+
ESCROW_PIN_LOCKED_MESSAGE,
|
|
3443
|
+
ESCROW_PIN_MISMATCH_PATTERN,
|
|
3444
|
+
ESCROW_PIN_UNAVAILABLE_MESSAGE,
|
|
2655
3445
|
EncryptedCredentialRecordValidator,
|
|
2656
3446
|
EncryptedRecordValidator,
|
|
2657
3447
|
EndorsementCredentialValidator,
|
|
2658
3448
|
EndorsementSubjectValidator,
|
|
3449
|
+
EscrowPinStatusValidator,
|
|
2659
3450
|
EvidenceValidator,
|
|
2660
3451
|
FlatAuthGrantValidator,
|
|
2661
3452
|
FrameworkWithSkillsValidator,
|
|
@@ -2667,6 +3458,7 @@ export {
|
|
|
2667
3458
|
GetCredentialRefreshHistoryResultValidator,
|
|
2668
3459
|
GetFullSkillTreeInputValidator,
|
|
2669
3460
|
GetFullSkillTreeResultValidator,
|
|
3461
|
+
GetShareLinkAttachmentChunkInputValidator,
|
|
2670
3462
|
GetSkillPathInputValidator,
|
|
2671
3463
|
GetSkillPathResultValidator,
|
|
2672
3464
|
GetTemplateRecipientsEventValidator,
|
|
@@ -2684,6 +3476,12 @@ export {
|
|
|
2684
3476
|
InboxCredentialRefreshReceiptValidator,
|
|
2685
3477
|
InboxCredentialValidator,
|
|
2686
3478
|
IncrementCounterEventValidator,
|
|
3479
|
+
InlineAlignmentValidator,
|
|
3480
|
+
InlineCredentialTemplateValidator,
|
|
3481
|
+
InlineEvidenceValidator,
|
|
3482
|
+
InlineSendCredentialEventValidator,
|
|
3483
|
+
InlineWalletCategoryValidator,
|
|
3484
|
+
InlineWalletSkillTagValidator,
|
|
2687
3485
|
InstalledAppValidator,
|
|
2688
3486
|
IssueInboxCredentialBatchItemResultValidator,
|
|
2689
3487
|
IssueInboxCredentialBatchItemValidator,
|
|
@@ -2736,9 +3534,19 @@ export {
|
|
|
2736
3534
|
LCNVisibleProfileValidator,
|
|
2737
3535
|
LaunchTypeValidator,
|
|
2738
3536
|
LearnCardRefreshAuthorizationValidator,
|
|
3537
|
+
LegacySendCredentialEventValidator,
|
|
2739
3538
|
LinkProviderFrameworkInputValidator,
|
|
3539
|
+
ListShareLinksInputValidator,
|
|
3540
|
+
MAX_ENDORSEMENTS,
|
|
3541
|
+
MAX_SELECTED_CREDENTIALS,
|
|
3542
|
+
MAX_SHARE_CIPHERTEXT_BYTES,
|
|
3543
|
+
MAX_SHARE_LINK_REQUEST_BYTES,
|
|
3544
|
+
MAX_SHARE_RECOVERY_JWE_BYTES,
|
|
3545
|
+
MAX_SHARE_SOURCE_URI_CHARS,
|
|
3546
|
+
MAX_VP_MEMBERS,
|
|
2740
3547
|
ManagedCredentialRefreshReceiptValidator,
|
|
2741
3548
|
ManagedCredentialRefreshServiceValidator,
|
|
3549
|
+
NormalizedConsentScopesValidator,
|
|
2742
3550
|
PaginatedAppStoreListingsValidator,
|
|
2743
3551
|
PaginatedBoostRecipientsValidator,
|
|
2744
3552
|
PaginatedBoostRecipientsWithChildrenValidator,
|
|
@@ -2759,11 +3567,14 @@ export {
|
|
|
2759
3567
|
PaginatedLCNProfileManagersValidator,
|
|
2760
3568
|
PaginatedLCNProfilesAndManagersValidator,
|
|
2761
3569
|
PaginatedLCNProfilesValidator,
|
|
3570
|
+
PaginatedShareLinksValidator,
|
|
2762
3571
|
PaginatedSkillFrameworksValidator,
|
|
2763
3572
|
PaginatedSkillTreeValidator,
|
|
2764
3573
|
PaginatedVisibleLCNProfilesValidator,
|
|
2765
3574
|
PaginationOptionsValidator,
|
|
2766
3575
|
PaginationResponseValidator,
|
|
3576
|
+
PendingListingUpdateStatusValidator,
|
|
3577
|
+
PendingListingUpdateValidator,
|
|
2767
3578
|
PrepareRefreshableSendInputValidator,
|
|
2768
3579
|
PrepareRefreshableSendResultValidator,
|
|
2769
3580
|
ProfileValidator,
|
|
@@ -2776,6 +3587,9 @@ export {
|
|
|
2776
3587
|
PublishCredentialRefreshResultValidator,
|
|
2777
3588
|
PublishIssuerSignedRefreshValidator,
|
|
2778
3589
|
PublishSigningAuthorityRefreshValidator,
|
|
3590
|
+
PutShareLinkAttachmentChunkInputValidator,
|
|
3591
|
+
PutShareLinkAttachmentChunkOutputValidator,
|
|
3592
|
+
RawInlineCredentialTemplateValidator,
|
|
2779
3593
|
RefreshServiceValidator,
|
|
2780
3594
|
RegExpValidator,
|
|
2781
3595
|
RelatedValidator,
|
|
@@ -2783,16 +3597,26 @@ export {
|
|
|
2783
3597
|
ReplaceSkillFrameworkSkillsInputValidator,
|
|
2784
3598
|
ReplaceSkillFrameworkSkillsResultValidator,
|
|
2785
3599
|
RequestLearnerContextEventValidator,
|
|
3600
|
+
ResolveShareLinkInputValidator,
|
|
2786
3601
|
ResultDescriptionValidator,
|
|
2787
3602
|
ResultStatusTypeValidator,
|
|
2788
3603
|
ResultTypeValidator,
|
|
2789
3604
|
ResultValidator,
|
|
2790
3605
|
RubricCriterionValidator,
|
|
3606
|
+
SHARE_AAD_PREFIX,
|
|
3607
|
+
SHARE_CONTENT_KEY_BYTES,
|
|
3608
|
+
SHARE_IV_BYTES,
|
|
3609
|
+
SHARE_LINK_ID_BYTES,
|
|
3610
|
+
SHARE_LINK_PROTOCOL,
|
|
3611
|
+
SHARE_RECOVERY_PROTOCOL,
|
|
3612
|
+
SHARE_TAG_BYTES,
|
|
3613
|
+
SHARE_VIEW_RECEIPT_TTL_SECONDS,
|
|
2791
3614
|
SendAiSessionCredentialEventValidator,
|
|
2792
3615
|
SendBoostInputValidator,
|
|
2793
3616
|
SendBoostResponseValidator,
|
|
2794
3617
|
SendBoostTemplateValidator,
|
|
2795
3618
|
SendBrandingOptionsValidator,
|
|
3619
|
+
SendContractRequestValidator,
|
|
2796
3620
|
SendCredentialEventValidator,
|
|
2797
3621
|
SendInboxResponseValidator,
|
|
2798
3622
|
SendInputValidator,
|
|
@@ -2802,6 +3626,36 @@ export {
|
|
|
2802
3626
|
SentCredentialInfoValidator,
|
|
2803
3627
|
ServiceValidator,
|
|
2804
3628
|
SetPrimaryContactMethodValidator,
|
|
3629
|
+
ShareCiphertextValidator,
|
|
3630
|
+
ShareContentKeyValidator,
|
|
3631
|
+
ShareContentStateValidator,
|
|
3632
|
+
ShareEndorsementEntryValidator,
|
|
3633
|
+
ShareEnvelopeValidator,
|
|
3634
|
+
ShareIvValidator,
|
|
3635
|
+
ShareLinkAttachmentChunkEnvelopeValidator,
|
|
3636
|
+
ShareLinkAttachmentChunkOutputValidator,
|
|
3637
|
+
ShareLinkAttachmentValidator,
|
|
3638
|
+
ShareLinkIdInputValidator,
|
|
3639
|
+
ShareLinkIdValidator,
|
|
3640
|
+
ShareLinkOperationKeyInputValidator,
|
|
3641
|
+
ShareLinkOwnerCommitOutputValidator,
|
|
3642
|
+
ShareLinkOwnerContentOutputValidator,
|
|
3643
|
+
ShareLinkOwnerRecoveryOutputValidator,
|
|
3644
|
+
ShareLinkOwnerStatusOutputValidator,
|
|
3645
|
+
ShareLinkPublicContentViewValidator,
|
|
3646
|
+
ShareLinkPublicStateValidator,
|
|
3647
|
+
ShareLinkStatusValidator,
|
|
3648
|
+
ShareLinkValidator,
|
|
3649
|
+
ShareManifestPresentationValidator,
|
|
3650
|
+
ShareOwnerRecoveryValidator,
|
|
3651
|
+
SharePayloadValidator,
|
|
3652
|
+
SharePayloadValidatorShape,
|
|
3653
|
+
ShareRecoveryEndorsementValidator,
|
|
3654
|
+
ShareRecoveryPlaintextValidator,
|
|
3655
|
+
ShareRecoverySelectionValidator,
|
|
3656
|
+
ShareSelectionEntryValidator,
|
|
3657
|
+
ShareSharerValidator,
|
|
3658
|
+
SimpleInlineCredentialTemplateValidator,
|
|
2805
3659
|
SkillDeletionStrategyValidator,
|
|
2806
3660
|
SkillFrameworkAdminInputValidator,
|
|
2807
3661
|
SkillFrameworkAdminsValidator,
|
|
@@ -2832,8 +3686,12 @@ export {
|
|
|
2832
3686
|
UnsignedClrCredentialValidator,
|
|
2833
3687
|
UnsignedVCValidator,
|
|
2834
3688
|
UnsignedVPValidator,
|
|
3689
|
+
UnsupportedSignInOperationError,
|
|
2835
3690
|
UpdateFrameworkInputValidator,
|
|
3691
|
+
UpdateShareLinkInputValidator,
|
|
2836
3692
|
UpdateSkillInputValidator,
|
|
3693
|
+
UpsertConsentContractEventValidator,
|
|
3694
|
+
UpsertConsentContractResponseValidator,
|
|
2837
3695
|
VC2EvidenceValidator,
|
|
2838
3696
|
VCValidator,
|
|
2839
3697
|
VPValidator,
|
|
@@ -2844,7 +3702,12 @@ export {
|
|
|
2844
3702
|
VerificationStatusValidator,
|
|
2845
3703
|
appStoreActionValidator,
|
|
2846
3704
|
capgoUpdateActionValidator,
|
|
3705
|
+
classifyShareManifest,
|
|
3706
|
+
decodeBase64Url,
|
|
3707
|
+
decodedBase64UrlByteLength,
|
|
2847
3708
|
dismissActionValidator,
|
|
3709
|
+
encodeBase64Url,
|
|
3710
|
+
escrowPinMismatchMessage,
|
|
2848
3711
|
externalLinkActionValidator,
|
|
2849
3712
|
inAppMessageActionStyleValidator,
|
|
2850
3713
|
inAppMessageActionTargetValidator,
|
|
@@ -2859,9 +3722,11 @@ export {
|
|
|
2859
3722
|
inAppMessageVersionSourceValidator,
|
|
2860
3723
|
inAppMessagesFlagValidator,
|
|
2861
3724
|
internalLinkActionValidator,
|
|
3725
|
+
isCanonicalBase64Url,
|
|
2862
3726
|
isStoredCredentialEnvelope,
|
|
2863
3727
|
parseInAppMessagesFlag,
|
|
2864
3728
|
platformPredicateValidator,
|
|
2865
3729
|
rolePredicateValidator,
|
|
3730
|
+
utf8ByteLength,
|
|
2866
3731
|
versionPredicateValidator
|
|
2867
3732
|
};
|