@learncard/types 5.21.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 +216 -5
- package/dist/auth.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 +6 -6
- package/dist/share-links.d.ts +1846 -0
- package/dist/share-links.d.ts.map +1 -0
- package/dist/types.cjs.development.cjs +523 -0
- package/dist/types.cjs.development.cjs.map +4 -4
- package/dist/types.cjs.production.min.cjs +22 -22
- package/dist/types.cjs.production.min.cjs.map +4 -4
- package/dist/types.esm.js +591 -66
- package/dist/types.esm.js.map +4 -4
- package/package.json +1 -1
- package/src/auth.ts +225 -4
- package/src/index.ts +1 -0
- package/src/share-links.ts +856 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-links.d.ts","sourceRoot":"","sources":["../src/share-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAM3B;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,+DAA+D;AAC/D,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,sCAAsC;AACtC,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,oDAAoD;AACpD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,QAAa,CAAC;AACrD,0EAA0E;AAC1E,eAAO,MAAM,4BAA4B,QAAY,CAAC;AACtD,gEAAgE;AAChE,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAA8C,CAAC;AAC1E,iEAAiE;AACjE,eAAO,MAAM,0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AC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEjF,2FAA2F;AAC3F,eAAO,MAAM,8BAA8B;;kBAA6C,CAAC;AACzF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,QAAU,CAAC;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;kBAYnC,CAAC;AACd,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
|
|
@@ -28,6 +28,8 @@ __export(index_exports, {
|
|
|
28
28
|
AchievementSubjectValidator: () => AchievementSubjectValidator,
|
|
29
29
|
AchievementTypeValidator: () => AchievementTypeValidator,
|
|
30
30
|
AchievementValidator: () => AchievementValidator,
|
|
31
|
+
AcknowledgeViewInputValidator: () => AcknowledgeViewInputValidator,
|
|
32
|
+
AcknowledgeViewOutputValidator: () => AcknowledgeViewOutputValidator,
|
|
31
33
|
AddTagInputValidator: () => AddTagInputValidator,
|
|
32
34
|
AddressValidator: () => AddressValidator,
|
|
33
35
|
AgeRatingValidator: () => AgeRatingValidator,
|
|
@@ -105,6 +107,7 @@ __export(index_exports, {
|
|
|
105
107
|
CreateContactMethodSessionValidator: () => CreateContactMethodSessionValidator,
|
|
106
108
|
CreateManagedFrameworkBatchInputValidator: () => CreateManagedFrameworkBatchInputValidator,
|
|
107
109
|
CreateManagedFrameworkInputValidator: () => CreateManagedFrameworkInputValidator,
|
|
110
|
+
CreateShareLinkInputValidator: () => CreateShareLinkInputValidator,
|
|
108
111
|
CreateSkillInputValidator: () => CreateSkillInputValidator,
|
|
109
112
|
CreateSkillsBatchInputValidator: () => CreateSkillsBatchInputValidator,
|
|
110
113
|
CredentialActivityEventTypeValidator: () => CredentialActivityEventTypeValidator,
|
|
@@ -136,10 +139,14 @@ __export(index_exports, {
|
|
|
136
139
|
DeleteSkillInputValidator: () => DeleteSkillInputValidator,
|
|
137
140
|
DidDocumentValidator: () => DidDocumentValidator,
|
|
138
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,
|
|
139
145
|
EncryptedCredentialRecordValidator: () => EncryptedCredentialRecordValidator,
|
|
140
146
|
EncryptedRecordValidator: () => EncryptedRecordValidator,
|
|
141
147
|
EndorsementCredentialValidator: () => EndorsementCredentialValidator,
|
|
142
148
|
EndorsementSubjectValidator: () => EndorsementSubjectValidator,
|
|
149
|
+
EscrowPinStatusValidator: () => EscrowPinStatusValidator,
|
|
143
150
|
EvidenceValidator: () => EvidenceValidator,
|
|
144
151
|
FlatAuthGrantValidator: () => FlatAuthGrantValidator,
|
|
145
152
|
FrameworkWithSkillsValidator: () => FrameworkWithSkillsValidator,
|
|
@@ -221,6 +228,14 @@ __export(index_exports, {
|
|
|
221
228
|
LaunchTypeValidator: () => LaunchTypeValidator,
|
|
222
229
|
LearnCardRefreshAuthorizationValidator: () => LearnCardRefreshAuthorizationValidator,
|
|
223
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,
|
|
224
239
|
ManagedCredentialRefreshReceiptValidator: () => ManagedCredentialRefreshReceiptValidator,
|
|
225
240
|
ManagedCredentialRefreshServiceValidator: () => ManagedCredentialRefreshServiceValidator,
|
|
226
241
|
PaginatedAppStoreListingsValidator: () => PaginatedAppStoreListingsValidator,
|
|
@@ -243,6 +258,7 @@ __export(index_exports, {
|
|
|
243
258
|
PaginatedLCNProfileManagersValidator: () => PaginatedLCNProfileManagersValidator,
|
|
244
259
|
PaginatedLCNProfilesAndManagersValidator: () => PaginatedLCNProfilesAndManagersValidator,
|
|
245
260
|
PaginatedLCNProfilesValidator: () => PaginatedLCNProfilesValidator,
|
|
261
|
+
PaginatedShareLinksValidator: () => PaginatedShareLinksValidator,
|
|
246
262
|
PaginatedSkillFrameworksValidator: () => PaginatedSkillFrameworksValidator,
|
|
247
263
|
PaginatedSkillTreeValidator: () => PaginatedSkillTreeValidator,
|
|
248
264
|
PaginatedVisibleLCNProfilesValidator: () => PaginatedVisibleLCNProfilesValidator,
|
|
@@ -267,11 +283,20 @@ __export(index_exports, {
|
|
|
267
283
|
ReplaceSkillFrameworkSkillsInputValidator: () => ReplaceSkillFrameworkSkillsInputValidator,
|
|
268
284
|
ReplaceSkillFrameworkSkillsResultValidator: () => ReplaceSkillFrameworkSkillsResultValidator,
|
|
269
285
|
RequestLearnerContextEventValidator: () => RequestLearnerContextEventValidator,
|
|
286
|
+
ResolveShareLinkInputValidator: () => ResolveShareLinkInputValidator,
|
|
270
287
|
ResultDescriptionValidator: () => ResultDescriptionValidator,
|
|
271
288
|
ResultStatusTypeValidator: () => ResultStatusTypeValidator,
|
|
272
289
|
ResultTypeValidator: () => ResultTypeValidator,
|
|
273
290
|
ResultValidator: () => ResultValidator,
|
|
274
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,
|
|
275
300
|
SendAiSessionCredentialEventValidator: () => SendAiSessionCredentialEventValidator,
|
|
276
301
|
SendBoostInputValidator: () => SendBoostInputValidator,
|
|
277
302
|
SendBoostResponseValidator: () => SendBoostResponseValidator,
|
|
@@ -286,6 +311,32 @@ __export(index_exports, {
|
|
|
286
311
|
SentCredentialInfoValidator: () => SentCredentialInfoValidator,
|
|
287
312
|
ServiceValidator: () => ServiceValidator,
|
|
288
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,
|
|
289
340
|
SkillDeletionStrategyValidator: () => SkillDeletionStrategyValidator,
|
|
290
341
|
SkillFrameworkAdminInputValidator: () => SkillFrameworkAdminInputValidator,
|
|
291
342
|
SkillFrameworkAdminsValidator: () => SkillFrameworkAdminsValidator,
|
|
@@ -317,6 +368,7 @@ __export(index_exports, {
|
|
|
317
368
|
UnsignedVCValidator: () => UnsignedVCValidator,
|
|
318
369
|
UnsignedVPValidator: () => UnsignedVPValidator,
|
|
319
370
|
UpdateFrameworkInputValidator: () => UpdateFrameworkInputValidator,
|
|
371
|
+
UpdateShareLinkInputValidator: () => UpdateShareLinkInputValidator,
|
|
320
372
|
UpdateSkillInputValidator: () => UpdateSkillInputValidator,
|
|
321
373
|
VC2EvidenceValidator: () => VC2EvidenceValidator,
|
|
322
374
|
VCValidator: () => VCValidator,
|
|
@@ -328,7 +380,12 @@ __export(index_exports, {
|
|
|
328
380
|
VerificationStatusValidator: () => VerificationStatusValidator,
|
|
329
381
|
appStoreActionValidator: () => appStoreActionValidator,
|
|
330
382
|
capgoUpdateActionValidator: () => capgoUpdateActionValidator,
|
|
383
|
+
classifyShareManifest: () => classifyShareManifest,
|
|
384
|
+
decodeBase64Url: () => decodeBase64Url,
|
|
385
|
+
decodedBase64UrlByteLength: () => decodedBase64UrlByteLength,
|
|
331
386
|
dismissActionValidator: () => dismissActionValidator,
|
|
387
|
+
encodeBase64Url: () => encodeBase64Url,
|
|
388
|
+
escrowPinMismatchMessage: () => escrowPinMismatchMessage,
|
|
332
389
|
externalLinkActionValidator: () => externalLinkActionValidator,
|
|
333
390
|
inAppMessageActionStyleValidator: () => inAppMessageActionStyleValidator,
|
|
334
391
|
inAppMessageActionTargetValidator: () => inAppMessageActionTargetValidator,
|
|
@@ -343,10 +400,12 @@ __export(index_exports, {
|
|
|
343
400
|
inAppMessageVersionSourceValidator: () => inAppMessageVersionSourceValidator,
|
|
344
401
|
inAppMessagesFlagValidator: () => inAppMessagesFlagValidator,
|
|
345
402
|
internalLinkActionValidator: () => internalLinkActionValidator,
|
|
403
|
+
isCanonicalBase64Url: () => isCanonicalBase64Url,
|
|
346
404
|
isStoredCredentialEnvelope: () => isStoredCredentialEnvelope,
|
|
347
405
|
parseInAppMessagesFlag: () => parseInAppMessagesFlag,
|
|
348
406
|
platformPredicateValidator: () => platformPredicateValidator,
|
|
349
407
|
rolePredicateValidator: () => rolePredicateValidator,
|
|
408
|
+
utf8ByteLength: () => utf8ByteLength,
|
|
350
409
|
versionPredicateValidator: () => versionPredicateValidator
|
|
351
410
|
});
|
|
352
411
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -17714,6 +17773,16 @@ var AuthSessionError = class extends Error {
|
|
|
17714
17773
|
__name(this, "AuthSessionError");
|
|
17715
17774
|
}
|
|
17716
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
|
+
});
|
|
17717
17786
|
|
|
17718
17787
|
// src/bitstring-status-list.ts
|
|
17719
17788
|
var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
|
|
@@ -17832,3 +17901,457 @@ var parseInAppMessagesFlag = /* @__PURE__ */ __name((raw) => {
|
|
|
17832
17901
|
const result = inAppMessagesFlagValidator.safeParse(raw);
|
|
17833
17902
|
return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
|
|
17834
17903
|
}, "parseInAppMessagesFlag");
|
|
17904
|
+
|
|
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`
|
|
17990
|
+
}
|
|
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) {
|
|
18156
|
+
ctx.addIssue({
|
|
18157
|
+
code: "custom",
|
|
18158
|
+
message: result.message,
|
|
18159
|
+
path: result.path,
|
|
18160
|
+
params: { shareLinkCode: result.code }
|
|
18161
|
+
});
|
|
18162
|
+
}
|
|
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) {
|
|
18181
|
+
ctx.addIssue({
|
|
18182
|
+
code: "custom",
|
|
18183
|
+
message: "order must be within the selection bounds",
|
|
18184
|
+
path: ["selection", index, "order"]
|
|
18185
|
+
});
|
|
18186
|
+
}
|
|
18187
|
+
if (orders.has(entry.order)) {
|
|
18188
|
+
ctx.addIssue({
|
|
18189
|
+
code: "custom",
|
|
18190
|
+
message: "order must be unique within the selection",
|
|
18191
|
+
path: ["selection", index, "order"]
|
|
18192
|
+
});
|
|
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
|
+
});
|
|
18273
|
+
}
|
|
18274
|
+
});
|
|
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()
|
|
18284
|
+
]);
|
|
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()
|
|
18293
|
+
]);
|
|
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()
|
|
18338
|
+
]);
|
|
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()
|
|
18345
|
+
});
|
|
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();
|