@learncard/learn-cloud-plugin 2.3.42 → 2.3.44
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/learn-cloud-plugin.cjs.development.cjs +800 -39
- package/dist/learn-cloud-plugin.cjs.development.cjs.map +3 -3
- package/dist/learn-cloud-plugin.cjs.production.min.cjs +47 -47
- package/dist/learn-cloud-plugin.cjs.production.min.cjs.map +3 -3
- package/dist/learn-cloud-plugin.esm.js +800 -39
- package/dist/learn-cloud-plugin.esm.js.map +3 -3
- package/package.json +7 -7
|
@@ -6,7 +6,11 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
|
|
9
|
+
try {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
} catch (e2) {
|
|
12
|
+
throw mod = 0, e2;
|
|
13
|
+
}
|
|
10
14
|
};
|
|
11
15
|
var __export = (target, all) => {
|
|
12
16
|
for (var name in all)
|
|
@@ -6691,10 +6695,10 @@ function $constructor(name, initializer3, params) {
|
|
|
6691
6695
|
let Definition = _Definition;
|
|
6692
6696
|
Object.defineProperty(Definition, "name", { value: name });
|
|
6693
6697
|
function _(def) {
|
|
6694
|
-
var
|
|
6698
|
+
var _a5;
|
|
6695
6699
|
const inst = params?.Parent ? new Definition() : this;
|
|
6696
6700
|
init(inst, def);
|
|
6697
|
-
(
|
|
6701
|
+
(_a5 = inst._zod).deferred ?? (_a5.deferred = []);
|
|
6698
6702
|
for (const fn of inst._zod.deferred) {
|
|
6699
6703
|
fn();
|
|
6700
6704
|
}
|
|
@@ -7360,8 +7364,8 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
7360
7364
|
__name(explicitlyAborted, "explicitlyAborted");
|
|
7361
7365
|
function prefixIssues(path, issues) {
|
|
7362
7366
|
return issues.map((iss) => {
|
|
7363
|
-
var
|
|
7364
|
-
(
|
|
7367
|
+
var _a5;
|
|
7368
|
+
(_a5 = iss).path ?? (_a5.path = []);
|
|
7365
7369
|
iss.path.unshift(path);
|
|
7366
7370
|
return iss;
|
|
7367
7371
|
});
|
|
@@ -7564,7 +7568,7 @@ __name(formatError, "formatError");
|
|
|
7564
7568
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
7565
7569
|
const result = { errors: [] };
|
|
7566
7570
|
const processError = /* @__PURE__ */ __name((error52, path = []) => {
|
|
7567
|
-
var
|
|
7571
|
+
var _a5, _b;
|
|
7568
7572
|
for (const issue2 of error52.issues) {
|
|
7569
7573
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
7570
7574
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
@@ -7585,7 +7589,7 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
7585
7589
|
const terminal = i === fullpath.length - 1;
|
|
7586
7590
|
if (typeof el === "string") {
|
|
7587
7591
|
curr.properties ?? (curr.properties = {});
|
|
7588
|
-
(
|
|
7592
|
+
(_a5 = curr.properties)[el] ?? (_a5[el] = { errors: [] });
|
|
7589
7593
|
curr = curr.properties[el];
|
|
7590
7594
|
} else {
|
|
7591
7595
|
curr.items ?? (curr.items = []);
|
|
@@ -7890,10 +7894,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
|
7890
7894
|
|
|
7891
7895
|
// ../../../node_modules/zod/v4/core/checks.js
|
|
7892
7896
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
7893
|
-
var
|
|
7897
|
+
var _a5;
|
|
7894
7898
|
inst._zod ?? (inst._zod = {});
|
|
7895
7899
|
inst._zod.def = def;
|
|
7896
|
-
(
|
|
7900
|
+
(_a5 = inst._zod).onattach ?? (_a5.onattach = []);
|
|
7897
7901
|
});
|
|
7898
7902
|
var numericOriginMap = {
|
|
7899
7903
|
number: "number",
|
|
@@ -7959,8 +7963,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
7959
7963
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
7960
7964
|
$ZodCheck.init(inst, def);
|
|
7961
7965
|
inst._zod.onattach.push((inst2) => {
|
|
7962
|
-
var
|
|
7963
|
-
(
|
|
7966
|
+
var _a5;
|
|
7967
|
+
(_a5 = inst2._zod.bag).multipleOf ?? (_a5.multipleOf = def.value);
|
|
7964
7968
|
});
|
|
7965
7969
|
inst._zod.check = (payload) => {
|
|
7966
7970
|
if (typeof payload.value !== typeof def.value)
|
|
@@ -8093,9 +8097,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
8093
8097
|
};
|
|
8094
8098
|
});
|
|
8095
8099
|
var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
8096
|
-
var
|
|
8100
|
+
var _a5;
|
|
8097
8101
|
$ZodCheck.init(inst, def);
|
|
8098
|
-
(
|
|
8102
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8099
8103
|
const val = payload.value;
|
|
8100
8104
|
return !nullish(val) && val.size !== void 0;
|
|
8101
8105
|
});
|
|
@@ -8121,9 +8125,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
8121
8125
|
};
|
|
8122
8126
|
});
|
|
8123
8127
|
var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
|
|
8124
|
-
var
|
|
8128
|
+
var _a5;
|
|
8125
8129
|
$ZodCheck.init(inst, def);
|
|
8126
|
-
(
|
|
8130
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8127
8131
|
const val = payload.value;
|
|
8128
8132
|
return !nullish(val) && val.size !== void 0;
|
|
8129
8133
|
});
|
|
@@ -8149,9 +8153,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
8149
8153
|
};
|
|
8150
8154
|
});
|
|
8151
8155
|
var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
8152
|
-
var
|
|
8156
|
+
var _a5;
|
|
8153
8157
|
$ZodCheck.init(inst, def);
|
|
8154
|
-
(
|
|
8158
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8155
8159
|
const val = payload.value;
|
|
8156
8160
|
return !nullish(val) && val.size !== void 0;
|
|
8157
8161
|
});
|
|
@@ -8179,9 +8183,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
8179
8183
|
};
|
|
8180
8184
|
});
|
|
8181
8185
|
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
8182
|
-
var
|
|
8186
|
+
var _a5;
|
|
8183
8187
|
$ZodCheck.init(inst, def);
|
|
8184
|
-
(
|
|
8188
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8185
8189
|
const val = payload.value;
|
|
8186
8190
|
return !nullish(val) && val.length !== void 0;
|
|
8187
8191
|
});
|
|
@@ -8208,9 +8212,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
8208
8212
|
};
|
|
8209
8213
|
});
|
|
8210
8214
|
var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
8211
|
-
var
|
|
8215
|
+
var _a5;
|
|
8212
8216
|
$ZodCheck.init(inst, def);
|
|
8213
|
-
(
|
|
8217
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8214
8218
|
const val = payload.value;
|
|
8215
8219
|
return !nullish(val) && val.length !== void 0;
|
|
8216
8220
|
});
|
|
@@ -8237,9 +8241,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
8237
8241
|
};
|
|
8238
8242
|
});
|
|
8239
8243
|
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
8240
|
-
var
|
|
8244
|
+
var _a5;
|
|
8241
8245
|
$ZodCheck.init(inst, def);
|
|
8242
|
-
(
|
|
8246
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8243
8247
|
const val = payload.value;
|
|
8244
8248
|
return !nullish(val) && val.length !== void 0;
|
|
8245
8249
|
});
|
|
@@ -8268,7 +8272,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
8268
8272
|
};
|
|
8269
8273
|
});
|
|
8270
8274
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
8271
|
-
var
|
|
8275
|
+
var _a5, _b;
|
|
8272
8276
|
$ZodCheck.init(inst, def);
|
|
8273
8277
|
inst._zod.onattach.push((inst2) => {
|
|
8274
8278
|
const bag = inst2._zod.bag;
|
|
@@ -8279,7 +8283,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
|
|
|
8279
8283
|
}
|
|
8280
8284
|
});
|
|
8281
8285
|
if (def.pattern)
|
|
8282
|
-
(
|
|
8286
|
+
(_a5 = inst._zod).check ?? (_a5.check = (payload) => {
|
|
8283
8287
|
def.pattern.lastIndex = 0;
|
|
8284
8288
|
if (def.pattern.test(payload.value))
|
|
8285
8289
|
return;
|
|
@@ -8484,7 +8488,7 @@ var version = {
|
|
|
8484
8488
|
|
|
8485
8489
|
// ../../../node_modules/zod/v4/core/schemas.js
|
|
8486
8490
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
8487
|
-
var
|
|
8491
|
+
var _a5;
|
|
8488
8492
|
inst ?? (inst = {});
|
|
8489
8493
|
inst._zod.def = def;
|
|
8490
8494
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -8499,7 +8503,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
8499
8503
|
}
|
|
8500
8504
|
}
|
|
8501
8505
|
if (checks.length === 0) {
|
|
8502
|
-
(
|
|
8506
|
+
(_a5 = inst._zod).deferred ?? (_a5.deferred = []);
|
|
8503
8507
|
inst._zod.deferred?.push(() => {
|
|
8504
8508
|
inst._zod.run = inst._zod.parse;
|
|
8505
8509
|
});
|
|
@@ -17890,7 +17894,7 @@ function initializeContext(params) {
|
|
|
17890
17894
|
}
|
|
17891
17895
|
__name(initializeContext, "initializeContext");
|
|
17892
17896
|
function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
17893
|
-
var
|
|
17897
|
+
var _a5;
|
|
17894
17898
|
const def = schema._zod.def;
|
|
17895
17899
|
const seen = ctx.seen.get(schema);
|
|
17896
17900
|
if (seen) {
|
|
@@ -17938,7 +17942,7 @@ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
17938
17942
|
delete result.schema.default;
|
|
17939
17943
|
}
|
|
17940
17944
|
if (ctx.io === "input" && "_prefault" in result.schema)
|
|
17941
|
-
(
|
|
17945
|
+
(_a5 = result.schema).default ?? (_a5.default = result.schema._prefault);
|
|
17942
17946
|
delete result.schema._prefault;
|
|
17943
17947
|
const _result = ctx.seen.get(schema);
|
|
17944
17948
|
return _result.schema;
|
|
@@ -21514,7 +21518,8 @@ var AssociationTypeValidator = external_exports.enum([
|
|
|
21514
21518
|
"replacedBy"
|
|
21515
21519
|
]).or(external_exports.string());
|
|
21516
21520
|
var AssociationValidator = external_exports.object({
|
|
21517
|
-
|
|
21521
|
+
// Accept compacted scalars while retaining the existing permissive array contract.
|
|
21522
|
+
type: external_exports.string().min(1).or(external_exports.string().array().nonempty()),
|
|
21518
21523
|
associationType: AssociationTypeValidator,
|
|
21519
21524
|
sourceId: external_exports.string().optional(),
|
|
21520
21525
|
targetId: external_exports.string()
|
|
@@ -22337,11 +22342,48 @@ var ConsentFlowContractDetailsValidator = external_exports.object({
|
|
|
22337
22342
|
updatedAt: external_exports.string(),
|
|
22338
22343
|
expiresAt: external_exports.string().optional(),
|
|
22339
22344
|
autoBoosts: external_exports.string().array().optional(),
|
|
22340
|
-
writers: external_exports.array(LCNProfileValidator).optional()
|
|
22345
|
+
writers: external_exports.array(LCNProfileValidator).optional(),
|
|
22346
|
+
recipients: external_exports.array(LCNPublicProfileValidator.extend({ did: external_exports.string() })).optional(),
|
|
22347
|
+
audienceVersion: external_exports.number().int().nonnegative().optional()
|
|
22341
22348
|
});
|
|
22342
|
-
var ConsentFlowContractRequestStatusValidator = external_exports.enum(["pending", "accepted", "denied"]).nullable();
|
|
22349
|
+
var ConsentFlowContractRequestStatusValidator = external_exports.enum(["pending", "accepted", "denied", "cancelled"]).nullable();
|
|
22343
22350
|
var ConsentFlowContractRequestReadStatusValidator = external_exports.enum(["unseen", "seen"]).nullable();
|
|
22344
|
-
var
|
|
22351
|
+
var ConsentFlowReferralValidator = external_exports.object({
|
|
22352
|
+
requestId: external_exports.string(),
|
|
22353
|
+
requestedBy: external_exports.string(),
|
|
22354
|
+
externalReferenceId: external_exports.string().max(256).optional()
|
|
22355
|
+
});
|
|
22356
|
+
var ContractRequestFieldsValidator = ConsentFlowReferralValidator.partial().extend({
|
|
22357
|
+
requestedAt: external_exports.string().optional(),
|
|
22358
|
+
message: external_exports.string().max(500).optional()
|
|
22359
|
+
});
|
|
22360
|
+
var SendContractRequestValidator = external_exports.object({
|
|
22361
|
+
contractUri: external_exports.string(),
|
|
22362
|
+
targetProfileId: external_exports.string(),
|
|
22363
|
+
externalReferenceId: external_exports.string().trim().min(1).max(256).optional(),
|
|
22364
|
+
message: external_exports.string().trim().max(500).optional()
|
|
22365
|
+
});
|
|
22366
|
+
var ConsentFlowWebhookMetadataValidator = external_exports.object({
|
|
22367
|
+
eventId: external_exports.string(),
|
|
22368
|
+
deliveryKey: external_exports.string(),
|
|
22369
|
+
event: external_exports.enum([
|
|
22370
|
+
"request_sent",
|
|
22371
|
+
"request_accepted",
|
|
22372
|
+
"request_denied",
|
|
22373
|
+
"request_cancelled",
|
|
22374
|
+
"consent_created",
|
|
22375
|
+
"consent_updated",
|
|
22376
|
+
"consent_withdrawn",
|
|
22377
|
+
"credentials_synced"
|
|
22378
|
+
]),
|
|
22379
|
+
contractUri: external_exports.string(),
|
|
22380
|
+
termsUri: external_exports.string().optional(),
|
|
22381
|
+
requestId: external_exports.string().optional(),
|
|
22382
|
+
requestedBy: external_exports.string().optional(),
|
|
22383
|
+
externalReferenceId: external_exports.string().optional(),
|
|
22384
|
+
recipientRole: external_exports.enum(["owner", "recipient", "requester", "target"])
|
|
22385
|
+
});
|
|
22386
|
+
var ConsentFlowContractRequestForProfileValidator = ContractRequestFieldsValidator.extend({
|
|
22345
22387
|
profile: LCNProfileValidator,
|
|
22346
22388
|
status: ConsentFlowContractRequestStatusValidator,
|
|
22347
22389
|
readStatus: ConsentFlowContractRequestReadStatusValidator.optional()
|
|
@@ -22387,6 +22429,7 @@ var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
|
|
|
22387
22429
|
expiresAt: external_exports.string().optional(),
|
|
22388
22430
|
oneTime: external_exports.boolean().optional(),
|
|
22389
22431
|
terms: ConsentFlowTermsValidator,
|
|
22432
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
22390
22433
|
contract: ConsentFlowContractDetailsValidator,
|
|
22391
22434
|
uri: external_exports.string(),
|
|
22392
22435
|
consenter: LCNProfileValidator,
|
|
@@ -22482,6 +22525,7 @@ var ConsentFlowTransactionValidator = external_exports.object({
|
|
|
22482
22525
|
oneTime: external_exports.boolean().optional(),
|
|
22483
22526
|
terms: ConsentFlowTermsValidator.optional(),
|
|
22484
22527
|
guardianApproval: ConsentFlowGuardianApprovalValidator.optional(),
|
|
22528
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
22485
22529
|
id: external_exports.string(),
|
|
22486
22530
|
action: ConsentFlowTransactionActionValidator,
|
|
22487
22531
|
date: external_exports.string(),
|
|
@@ -22492,6 +22536,7 @@ var HolderExportConsentRecordValidator = external_exports.object({
|
|
|
22492
22536
|
status: ConsentFlowTermsStatusValidator,
|
|
22493
22537
|
contract: ConsentFlowContractDetailsValidator,
|
|
22494
22538
|
terms: ConsentFlowTermsValidator,
|
|
22539
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
22495
22540
|
transactions: ConsentFlowTransactionValidator.array()
|
|
22496
22541
|
});
|
|
22497
22542
|
var HolderExportMetadataValidator = external_exports.object({
|
|
@@ -23227,7 +23272,7 @@ var AppStoreListingSubmitterValidator = external_exports.object({
|
|
|
23227
23272
|
displayName: external_exports.string(),
|
|
23228
23273
|
email: external_exports.string().optional()
|
|
23229
23274
|
});
|
|
23230
|
-
var
|
|
23275
|
+
var AppStoreListingFieldsValidator = external_exports.object({
|
|
23231
23276
|
listing_id: external_exports.string(),
|
|
23232
23277
|
slug: external_exports.string().optional(),
|
|
23233
23278
|
display_name: external_exports.string(),
|
|
@@ -23253,15 +23298,33 @@ var AppStoreListingValidator = external_exports.object({
|
|
|
23253
23298
|
submitter: AppStoreListingSubmitterValidator.optional(),
|
|
23254
23299
|
contact_email: external_exports.string().email().optional()
|
|
23255
23300
|
});
|
|
23301
|
+
var PendingListingUpdateStatusValidator = external_exports.enum(["DRAFT", "PENDING_REVIEW"]);
|
|
23302
|
+
var PendingListingUpdateValidator = external_exports.object({
|
|
23303
|
+
status: PendingListingUpdateStatusValidator,
|
|
23304
|
+
submitted_at: external_exports.string().optional(),
|
|
23305
|
+
changes: AppStoreListingFieldsValidator.omit({
|
|
23306
|
+
listing_id: true,
|
|
23307
|
+
app_listing_status: true,
|
|
23308
|
+
promotion_level: true,
|
|
23309
|
+
submitted_at: true,
|
|
23310
|
+
submitter: true
|
|
23311
|
+
}).partial(),
|
|
23312
|
+
manifest_version: external_exports.number().int().min(1).optional()
|
|
23313
|
+
});
|
|
23314
|
+
var AppStoreListingValidator = AppStoreListingFieldsValidator.extend({
|
|
23315
|
+
pending_update: PendingListingUpdateValidator.optional()
|
|
23316
|
+
});
|
|
23256
23317
|
var AppStoreListingCreateValidator = AppStoreListingValidator.omit({
|
|
23257
23318
|
listing_id: true,
|
|
23258
23319
|
app_listing_status: true,
|
|
23259
|
-
promotion_level: true
|
|
23320
|
+
promotion_level: true,
|
|
23321
|
+
pending_update: true
|
|
23260
23322
|
});
|
|
23261
23323
|
var AppStoreListingUpdateValidator = AppStoreListingValidator.partial().omit({
|
|
23262
23324
|
listing_id: true,
|
|
23263
23325
|
app_listing_status: true,
|
|
23264
|
-
promotion_level: true
|
|
23326
|
+
promotion_level: true,
|
|
23327
|
+
pending_update: true
|
|
23265
23328
|
});
|
|
23266
23329
|
var InstalledAppValidator = AppStoreListingValidator.extend({
|
|
23267
23330
|
installed_at: external_exports.string()
|
|
@@ -23276,12 +23339,87 @@ var AppBoostValidator = external_exports.object({
|
|
|
23276
23339
|
templateAlias: external_exports.string().min(1).max(50).regex(/^[a-z0-9-]+$/),
|
|
23277
23340
|
boostUri: external_exports.string()
|
|
23278
23341
|
});
|
|
23279
|
-
var
|
|
23342
|
+
var InlineWalletCategoryValidator = external_exports.enum([
|
|
23343
|
+
"Achievement",
|
|
23344
|
+
"Skill",
|
|
23345
|
+
"ID",
|
|
23346
|
+
"Learning History",
|
|
23347
|
+
"Work History",
|
|
23348
|
+
"Social Badges",
|
|
23349
|
+
"Membership",
|
|
23350
|
+
"Accomplishment",
|
|
23351
|
+
"Experiences",
|
|
23352
|
+
"Accommodation",
|
|
23353
|
+
"Family"
|
|
23354
|
+
]);
|
|
23355
|
+
var InlineAlignmentValidator = external_exports.object({
|
|
23356
|
+
name: external_exports.string(),
|
|
23357
|
+
url: external_exports.string(),
|
|
23358
|
+
framework: external_exports.string().optional(),
|
|
23359
|
+
code: external_exports.string().optional()
|
|
23360
|
+
}).passthrough();
|
|
23361
|
+
var InlineEvidenceValidator = external_exports.object({
|
|
23362
|
+
id: external_exports.string().optional(),
|
|
23363
|
+
name: external_exports.string().optional(),
|
|
23364
|
+
narrative: external_exports.string().optional()
|
|
23365
|
+
}).passthrough();
|
|
23366
|
+
var InlineWalletSkillTagValidator = external_exports.object({
|
|
23367
|
+
frameworkId: external_exports.string(),
|
|
23368
|
+
id: external_exports.string(),
|
|
23369
|
+
proficiencyLevel: external_exports.string().optional()
|
|
23370
|
+
}).passthrough();
|
|
23371
|
+
var SimpleInlineCredentialTemplateValidator = external_exports.object({
|
|
23372
|
+
rawCredential: external_exports.undefined().optional(),
|
|
23373
|
+
name: external_exports.string(),
|
|
23374
|
+
description: external_exports.string().optional(),
|
|
23375
|
+
image: external_exports.string().optional(),
|
|
23376
|
+
issuerName: external_exports.string().optional(),
|
|
23377
|
+
achievementType: external_exports.string().optional(),
|
|
23378
|
+
category: InlineWalletCategoryValidator.optional(),
|
|
23379
|
+
criteria: external_exports.object({
|
|
23380
|
+
narrative: external_exports.string().optional(),
|
|
23381
|
+
url: external_exports.string().optional()
|
|
23382
|
+
}).passthrough().optional(),
|
|
23383
|
+
alignments: external_exports.array(InlineAlignmentValidator).optional(),
|
|
23384
|
+
tags: external_exports.array(external_exports.string()).optional(),
|
|
23385
|
+
activity: external_exports.object({
|
|
23386
|
+
startDate: external_exports.string().optional(),
|
|
23387
|
+
endDate: external_exports.string().optional()
|
|
23388
|
+
}).passthrough().optional(),
|
|
23389
|
+
credits: external_exports.object({
|
|
23390
|
+
earned: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
|
|
23391
|
+
available: external_exports.union([external_exports.number(), external_exports.string()]).optional()
|
|
23392
|
+
}).passthrough().optional(),
|
|
23393
|
+
validUntil: external_exports.string().optional(),
|
|
23394
|
+
evidence: external_exports.array(InlineEvidenceValidator).optional(),
|
|
23395
|
+
walletSkills: external_exports.array(InlineWalletSkillTagValidator).optional()
|
|
23396
|
+
}).passthrough();
|
|
23397
|
+
var RawInlineCredentialTemplateValidator = external_exports.object({
|
|
23398
|
+
rawCredential: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
23399
|
+
category: InlineWalletCategoryValidator.optional(),
|
|
23400
|
+
walletSkills: external_exports.array(InlineWalletSkillTagValidator).optional()
|
|
23401
|
+
}).passthrough();
|
|
23402
|
+
var InlineCredentialTemplateValidator = external_exports.union([
|
|
23403
|
+
RawInlineCredentialTemplateValidator,
|
|
23404
|
+
SimpleInlineCredentialTemplateValidator
|
|
23405
|
+
]);
|
|
23406
|
+
var LegacySendCredentialEventValidator = external_exports.object({
|
|
23280
23407
|
type: external_exports.literal("send-credential"),
|
|
23281
23408
|
templateAlias: external_exports.string(),
|
|
23282
23409
|
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
23283
23410
|
preventDuplicateClaim: external_exports.boolean().optional()
|
|
23284
23411
|
});
|
|
23412
|
+
var InlineSendCredentialEventValidator = external_exports.object({
|
|
23413
|
+
type: external_exports.literal("send-credential"),
|
|
23414
|
+
alias: external_exports.string(),
|
|
23415
|
+
template: InlineCredentialTemplateValidator,
|
|
23416
|
+
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
23417
|
+
preventDuplicateClaim: external_exports.boolean().optional()
|
|
23418
|
+
});
|
|
23419
|
+
var SendCredentialEventValidator = external_exports.union([
|
|
23420
|
+
LegacySendCredentialEventValidator,
|
|
23421
|
+
InlineSendCredentialEventValidator
|
|
23422
|
+
]);
|
|
23285
23423
|
var CheckCredentialEventValidator = external_exports.object({
|
|
23286
23424
|
type: external_exports.literal("check-credential"),
|
|
23287
23425
|
templateAlias: external_exports.string().optional(),
|
|
@@ -23376,7 +23514,119 @@ var GetCountersEventValidator = external_exports.object({
|
|
|
23376
23514
|
type: external_exports.literal("get-counters"),
|
|
23377
23515
|
keys: external_exports.array(counterKeyValidator).min(1).max(50).optional()
|
|
23378
23516
|
});
|
|
23379
|
-
var
|
|
23517
|
+
var ConsentRequestWalletCategoryValidator = external_exports.enum([
|
|
23518
|
+
"Achievement",
|
|
23519
|
+
"Skill",
|
|
23520
|
+
"ID",
|
|
23521
|
+
"Learning History",
|
|
23522
|
+
"Work History",
|
|
23523
|
+
"Social Badges",
|
|
23524
|
+
"Membership",
|
|
23525
|
+
"Accomplishment",
|
|
23526
|
+
"Experiences",
|
|
23527
|
+
"Accommodation",
|
|
23528
|
+
"Family"
|
|
23529
|
+
]);
|
|
23530
|
+
var ConsentRequestPersonalFieldValidator = external_exports.enum([
|
|
23531
|
+
"name",
|
|
23532
|
+
"email",
|
|
23533
|
+
"phone",
|
|
23534
|
+
"birthDate",
|
|
23535
|
+
"country",
|
|
23536
|
+
"avatar"
|
|
23537
|
+
]);
|
|
23538
|
+
var ConsentRequestValidator = external_exports.object({
|
|
23539
|
+
read: external_exports.object({
|
|
23540
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).optional(),
|
|
23541
|
+
personalFields: external_exports.array(ConsentRequestPersonalFieldValidator).optional()
|
|
23542
|
+
}).optional(),
|
|
23543
|
+
write: external_exports.object({
|
|
23544
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).optional()
|
|
23545
|
+
}).optional(),
|
|
23546
|
+
reason: external_exports.string().optional()
|
|
23547
|
+
});
|
|
23548
|
+
var NormalizedConsentScopesValidator = external_exports.object({
|
|
23549
|
+
read: external_exports.object({
|
|
23550
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).default([]),
|
|
23551
|
+
personalFields: external_exports.array(ConsentRequestPersonalFieldValidator).default([])
|
|
23552
|
+
}),
|
|
23553
|
+
write: external_exports.object({
|
|
23554
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).default([])
|
|
23555
|
+
})
|
|
23556
|
+
});
|
|
23557
|
+
var CapturedTemplateRecordValidator = external_exports.object({
|
|
23558
|
+
alias: external_exports.string(),
|
|
23559
|
+
template: InlineCredentialTemplateValidator,
|
|
23560
|
+
version: external_exports.number().int().min(1),
|
|
23561
|
+
lastUsedAt: external_exports.string()
|
|
23562
|
+
}).passthrough();
|
|
23563
|
+
var CapturedConsentRecordValidator = external_exports.object({
|
|
23564
|
+
scopes: NormalizedConsentScopesValidator,
|
|
23565
|
+
reason: external_exports.string().optional(),
|
|
23566
|
+
lastUsedAt: external_exports.string()
|
|
23567
|
+
}).passthrough();
|
|
23568
|
+
var AppManifestValidator = external_exports.object({
|
|
23569
|
+
manifestVersion: external_exports.literal(1),
|
|
23570
|
+
appUrl: external_exports.string(),
|
|
23571
|
+
appKey: external_exports.string().max(200).optional(),
|
|
23572
|
+
suggestedName: external_exports.string().optional(),
|
|
23573
|
+
suggestedIconUrl: external_exports.string().optional(),
|
|
23574
|
+
permissions: external_exports.array(external_exports.string()).default([]),
|
|
23575
|
+
templates: external_exports.array(CapturedTemplateRecordValidator).default([]),
|
|
23576
|
+
consentRequests: external_exports.array(CapturedConsentRecordValidator).default([]),
|
|
23577
|
+
usedConsentContract: external_exports.boolean().optional(),
|
|
23578
|
+
featuresLaunched: external_exports.array(external_exports.string()).default([]),
|
|
23579
|
+
counterKeys: external_exports.array(external_exports.string()).default([]),
|
|
23580
|
+
usedLearnerContext: external_exports.boolean(),
|
|
23581
|
+
usedNotifications: external_exports.boolean(),
|
|
23582
|
+
firstCapturedAt: external_exports.string(),
|
|
23583
|
+
lastUpdatedAt: external_exports.string()
|
|
23584
|
+
}).passthrough();
|
|
23585
|
+
var AppManifestVersionStatusValidator = external_exports.enum(["draft", "active", "superseded"]);
|
|
23586
|
+
var AppManifestVersionValidator = external_exports.object({
|
|
23587
|
+
id: external_exports.string(),
|
|
23588
|
+
version: external_exports.number().int().min(1),
|
|
23589
|
+
manifestHash: external_exports.string(),
|
|
23590
|
+
manifest: AppManifestValidator,
|
|
23591
|
+
status: AppManifestVersionStatusValidator,
|
|
23592
|
+
createdAt: external_exports.string(),
|
|
23593
|
+
activatedAt: external_exports.string().optional()
|
|
23594
|
+
});
|
|
23595
|
+
var AppManifestStringDiffValidator = external_exports.object({
|
|
23596
|
+
added: external_exports.array(external_exports.string()),
|
|
23597
|
+
removed: external_exports.array(external_exports.string()),
|
|
23598
|
+
changed: external_exports.array(external_exports.string())
|
|
23599
|
+
});
|
|
23600
|
+
var AppManifestTemplateRefValidator = external_exports.object({
|
|
23601
|
+
alias: external_exports.string(),
|
|
23602
|
+
version: external_exports.number().int().min(1)
|
|
23603
|
+
});
|
|
23604
|
+
var AppManifestTemplateChangeValidator = external_exports.object({
|
|
23605
|
+
alias: external_exports.string(),
|
|
23606
|
+
fromVersion: external_exports.number().int().min(1),
|
|
23607
|
+
toVersion: external_exports.number().int().min(1)
|
|
23608
|
+
});
|
|
23609
|
+
var AppManifestDiffValidator = external_exports.object({
|
|
23610
|
+
permissions: AppManifestStringDiffValidator,
|
|
23611
|
+
templates: external_exports.object({
|
|
23612
|
+
added: external_exports.array(AppManifestTemplateRefValidator),
|
|
23613
|
+
removed: external_exports.array(AppManifestTemplateRefValidator),
|
|
23614
|
+
changed: external_exports.array(AppManifestTemplateChangeValidator)
|
|
23615
|
+
}),
|
|
23616
|
+
consentScopes: AppManifestStringDiffValidator,
|
|
23617
|
+
featurePaths: AppManifestStringDiffValidator,
|
|
23618
|
+
counterKeys: AppManifestStringDiffValidator,
|
|
23619
|
+
requiresReview: external_exports.boolean()
|
|
23620
|
+
});
|
|
23621
|
+
var UpsertConsentContractEventValidator = external_exports.object({
|
|
23622
|
+
type: external_exports.literal("upsert-consent-contract"),
|
|
23623
|
+
scopes: ConsentRequestValidator
|
|
23624
|
+
});
|
|
23625
|
+
var UpsertConsentContractResponseValidator = external_exports.object({
|
|
23626
|
+
contractUri: external_exports.string(),
|
|
23627
|
+
created: external_exports.boolean()
|
|
23628
|
+
});
|
|
23629
|
+
var AppEventValidator = external_exports.union([
|
|
23380
23630
|
SendCredentialEventValidator,
|
|
23381
23631
|
CheckCredentialEventValidator,
|
|
23382
23632
|
CheckIssuanceStatusEventValidator,
|
|
@@ -23386,7 +23636,8 @@ var AppEventValidator = external_exports.discriminatedUnion("type", [
|
|
|
23386
23636
|
SendNotificationEventValidator,
|
|
23387
23637
|
IncrementCounterEventValidator,
|
|
23388
23638
|
GetCounterEventValidator,
|
|
23389
|
-
GetCountersEventValidator
|
|
23639
|
+
GetCountersEventValidator,
|
|
23640
|
+
UpsertConsentContractEventValidator
|
|
23390
23641
|
]);
|
|
23391
23642
|
var AppEventInputValidator = external_exports.object({
|
|
23392
23643
|
listingId: external_exports.string(),
|
|
@@ -23460,6 +23711,21 @@ var AuthSessionError = (_a3 = class extends Error {
|
|
|
23460
23711
|
this.name = "AuthSessionError";
|
|
23461
23712
|
}
|
|
23462
23713
|
}, __name(_a3, "AuthSessionError"), __name2(_a3, "AuthSessionError"), _a3);
|
|
23714
|
+
var _a4;
|
|
23715
|
+
var UnsupportedSignInOperationError = (_a4 = class extends Error {
|
|
23716
|
+
constructor(operation, providerType) {
|
|
23717
|
+
super(`${operation} is not supported by ${providerType}`);
|
|
23718
|
+
this.operation = operation;
|
|
23719
|
+
this.providerType = providerType;
|
|
23720
|
+
this.name = "UnsupportedSignInOperationError";
|
|
23721
|
+
}
|
|
23722
|
+
}, __name(_a4, "UnsupportedSignInOperationError"), __name2(_a4, "UnsupportedSignInOperationError"), _a4);
|
|
23723
|
+
var EscrowPinStatusValidator = external_exports.object({
|
|
23724
|
+
state: external_exports.enum(["none", "enabled", "locked", "stale"]),
|
|
23725
|
+
enabled: external_exports.boolean(),
|
|
23726
|
+
attemptsRemaining: external_exports.number().int().nonnegative(),
|
|
23727
|
+
salt: external_exports.string().optional()
|
|
23728
|
+
});
|
|
23463
23729
|
var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
|
|
23464
23730
|
var BitstringStatusPurposeValidator = external_exports.enum(BITSTRING_STATUS_PURPOSES);
|
|
23465
23731
|
var BitstringStatusListEntryValidator = external_exports.object({
|
|
@@ -23568,6 +23834,501 @@ var inAppMessagesFlagValidator = external_exports.object({
|
|
|
23568
23834
|
version: external_exports.number().default(1),
|
|
23569
23835
|
messages: external_exports.array(inAppMessageValidator).default([])
|
|
23570
23836
|
}).passthrough();
|
|
23837
|
+
var SHARE_LINK_ID_BYTES = 16;
|
|
23838
|
+
var SHARE_CONTENT_KEY_BYTES = 32;
|
|
23839
|
+
var SHARE_IV_BYTES = 12;
|
|
23840
|
+
var SHARE_TAG_BYTES = 16;
|
|
23841
|
+
var MAX_SHARE_CIPHERTEXT_BYTES = 512 * 1024;
|
|
23842
|
+
var MAX_SHARE_RECOVERY_JWE_BYTES = 64 * 1024;
|
|
23843
|
+
var MAX_SELECTED_CREDENTIALS = 50;
|
|
23844
|
+
var MAX_ENDORSEMENTS = 200;
|
|
23845
|
+
var MAX_VP_MEMBERS = MAX_SELECTED_CREDENTIALS + MAX_ENDORSEMENTS;
|
|
23846
|
+
var MAX_SHARE_SOURCE_URI_CHARS = 2048;
|
|
23847
|
+
var MAX_SHARE_LINK_REQUEST_BYTES = 1024 * 1024;
|
|
23848
|
+
var SHARE_LINK_PROTOCOL = "lc-share/v1";
|
|
23849
|
+
var SHARE_RECOVERY_PROTOCOL = "lc-share-recovery/v1";
|
|
23850
|
+
var BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
23851
|
+
var BASE64URL_LOOKUP = (() => {
|
|
23852
|
+
const table = new Int16Array(128).fill(-1);
|
|
23853
|
+
for (let index = 0; index < BASE64URL_ALPHABET.length; index += 1) {
|
|
23854
|
+
table[BASE64URL_ALPHABET.charCodeAt(index)] = index;
|
|
23855
|
+
}
|
|
23856
|
+
return table;
|
|
23857
|
+
})();
|
|
23858
|
+
var encodeBase64Url = /* @__PURE__ */ __name2((bytes) => {
|
|
23859
|
+
let output = "";
|
|
23860
|
+
for (let index = 0; index < bytes.length; index += 3) {
|
|
23861
|
+
const first = bytes[index];
|
|
23862
|
+
const second = bytes[index + 1];
|
|
23863
|
+
const third = bytes[index + 2];
|
|
23864
|
+
output += BASE64URL_ALPHABET[first >> 2];
|
|
23865
|
+
output += BASE64URL_ALPHABET[(first & 3) << 4 | (second ?? 0) >> 4];
|
|
23866
|
+
if (second === void 0) break;
|
|
23867
|
+
output += BASE64URL_ALPHABET[(second & 15) << 2 | (third ?? 0) >> 6];
|
|
23868
|
+
if (third === void 0) break;
|
|
23869
|
+
output += BASE64URL_ALPHABET[third & 63];
|
|
23870
|
+
}
|
|
23871
|
+
return output;
|
|
23872
|
+
}, "encodeBase64Url");
|
|
23873
|
+
var decodeBase64Url = /* @__PURE__ */ __name2((value) => {
|
|
23874
|
+
if (typeof value !== "string") return null;
|
|
23875
|
+
const output = new Uint8Array(Math.floor(value.length * 6 / 8));
|
|
23876
|
+
let bits = 0;
|
|
23877
|
+
let bitCount = 0;
|
|
23878
|
+
let outputIndex = 0;
|
|
23879
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
23880
|
+
const code = value.charCodeAt(index);
|
|
23881
|
+
const digit = code < 128 ? BASE64URL_LOOKUP[code] : -1;
|
|
23882
|
+
if (digit < 0) return null;
|
|
23883
|
+
bits = bits << 6 | digit;
|
|
23884
|
+
bitCount += 6;
|
|
23885
|
+
if (bitCount >= 8) {
|
|
23886
|
+
bitCount -= 8;
|
|
23887
|
+
output[outputIndex] = bits >> bitCount & 255;
|
|
23888
|
+
outputIndex += 1;
|
|
23889
|
+
}
|
|
23890
|
+
}
|
|
23891
|
+
return output;
|
|
23892
|
+
}, "decodeBase64Url");
|
|
23893
|
+
var isCanonicalBase64Url = /* @__PURE__ */ __name2((value, expectedBytes) => {
|
|
23894
|
+
if (typeof value !== "string") return false;
|
|
23895
|
+
if (expectedBytes !== void 0 && value.length !== Math.ceil(expectedBytes * 4 / 3))
|
|
23896
|
+
return false;
|
|
23897
|
+
const decoded = decodeBase64Url(value);
|
|
23898
|
+
if (decoded === null) return false;
|
|
23899
|
+
if (expectedBytes !== void 0 && decoded.length !== expectedBytes) return false;
|
|
23900
|
+
return encodeBase64Url(decoded) === value;
|
|
23901
|
+
}, "isCanonicalBase64Url");
|
|
23902
|
+
var decodedBase64UrlByteLength = /* @__PURE__ */ __name2((value) => decodeBase64Url(value)?.length ?? null, "decodedBase64UrlByteLength");
|
|
23903
|
+
var utf8ByteLength = /* @__PURE__ */ __name2((value) => new TextEncoder().encode(value).length, "utf8ByteLength");
|
|
23904
|
+
var canonicalBase64Url = /* @__PURE__ */ __name2((bytes) => external_exports.string().refine((value) => isCanonicalBase64Url(value, bytes), {
|
|
23905
|
+
message: `must be canonical base64url for exactly ${bytes} bytes`
|
|
23906
|
+
}), "canonicalBase64Url");
|
|
23907
|
+
var ShareLinkIdValidator = canonicalBase64Url(SHARE_LINK_ID_BYTES);
|
|
23908
|
+
var ShareContentKeyValidator = canonicalBase64Url(SHARE_CONTENT_KEY_BYTES);
|
|
23909
|
+
var ShareIvValidator = canonicalBase64Url(SHARE_IV_BYTES);
|
|
23910
|
+
var ShareCiphertextValidator = external_exports.string().refine(
|
|
23911
|
+
(value) => {
|
|
23912
|
+
if (value.length > Math.ceil(MAX_SHARE_CIPHERTEXT_BYTES * 4 / 3)) return false;
|
|
23913
|
+
const decoded = decodeBase64Url(value);
|
|
23914
|
+
if (decoded === null) return false;
|
|
23915
|
+
if (encodeBase64Url(decoded) !== value) return false;
|
|
23916
|
+
return decoded.length >= SHARE_TAG_BYTES && decoded.length <= MAX_SHARE_CIPHERTEXT_BYTES;
|
|
23917
|
+
},
|
|
23918
|
+
{
|
|
23919
|
+
message: `must be canonical base64url decoding to ${SHARE_TAG_BYTES}..${MAX_SHARE_CIPHERTEXT_BYTES} bytes`
|
|
23920
|
+
}
|
|
23921
|
+
);
|
|
23922
|
+
var ShareEnvelopeValidator = external_exports.object({
|
|
23923
|
+
v: external_exports.literal(1),
|
|
23924
|
+
alg: external_exports.literal("A256GCM"),
|
|
23925
|
+
iv: ShareIvValidator,
|
|
23926
|
+
ct: ShareCiphertextValidator
|
|
23927
|
+
}).strict();
|
|
23928
|
+
var safeVersion = external_exports.number().int().min(1).max(2 ** 31 - 1);
|
|
23929
|
+
var safeCredentialIndex = external_exports.number().int().min(0).max(MAX_VP_MEMBERS - 1);
|
|
23930
|
+
var ShareSelectionEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex }).strict();
|
|
23931
|
+
var ShareEndorsementEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex, targetCredentialIndex: safeCredentialIndex }).strict();
|
|
23932
|
+
var ShareSharerValidator = external_exports.object({
|
|
23933
|
+
profileId: external_exports.string().min(1).max(128),
|
|
23934
|
+
displayName: external_exports.string().min(1).max(120),
|
|
23935
|
+
avatar: external_exports.string().max(2048).optional()
|
|
23936
|
+
}).strict();
|
|
23937
|
+
var presentationShape = VPValidator.extend({
|
|
23938
|
+
verifiableCredential: VCValidator.array().min(1).max(MAX_VP_MEMBERS)
|
|
23939
|
+
});
|
|
23940
|
+
var hasBoundedPresentation = /* @__PURE__ */ __name2((value) => {
|
|
23941
|
+
let credentialCount = 0;
|
|
23942
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
23943
|
+
const visit = /* @__PURE__ */ __name2((node, depth) => {
|
|
23944
|
+
if (node === null || typeof node !== "object") return true;
|
|
23945
|
+
if (depth > 32 || ancestors.has(node)) return false;
|
|
23946
|
+
ancestors.add(node);
|
|
23947
|
+
try {
|
|
23948
|
+
for (const [key, child] of Object.entries(node)) {
|
|
23949
|
+
if (key === "verifiableCredential") {
|
|
23950
|
+
credentialCount += Array.isArray(child) ? child.length : 1;
|
|
23951
|
+
if (credentialCount > MAX_VP_MEMBERS) return false;
|
|
23952
|
+
}
|
|
23953
|
+
if (!visit(child, depth + 1)) return false;
|
|
23954
|
+
}
|
|
23955
|
+
return true;
|
|
23956
|
+
} finally {
|
|
23957
|
+
ancestors.delete(node);
|
|
23958
|
+
}
|
|
23959
|
+
}, "visit");
|
|
23960
|
+
return visit(value, 0);
|
|
23961
|
+
}, "hasBoundedPresentation");
|
|
23962
|
+
var ShareManifestPresentationValidator = external_exports.custom(
|
|
23963
|
+
(value) => hasBoundedPresentation(value) && presentationShape.safeParse(value).success,
|
|
23964
|
+
{ message: "invalid share presentation" }
|
|
23965
|
+
);
|
|
23966
|
+
var SharePayloadValidatorShape = external_exports.object({
|
|
23967
|
+
protocol: external_exports.literal(SHARE_LINK_PROTOCOL),
|
|
23968
|
+
shareId: ShareLinkIdValidator,
|
|
23969
|
+
contentVersion: safeVersion,
|
|
23970
|
+
createdAt: external_exports.iso.datetime(),
|
|
23971
|
+
sharer: ShareSharerValidator,
|
|
23972
|
+
presentation: ShareManifestPresentationValidator,
|
|
23973
|
+
selection: ShareSelectionEntryValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
23974
|
+
endorsements: ShareEndorsementEntryValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
23975
|
+
}).strict();
|
|
23976
|
+
var classificationFailure = /* @__PURE__ */ __name2((code, message, path = []) => ({ ok: false, code, message, path }), "classificationFailure");
|
|
23977
|
+
var readSignedClaimId = /* @__PURE__ */ __name2((member) => {
|
|
23978
|
+
if (member === null || typeof member !== "object") return void 0;
|
|
23979
|
+
const record2 = member;
|
|
23980
|
+
const claim = record2.credentialSubject ?? record2.endorsement;
|
|
23981
|
+
if (claim === null || typeof claim !== "object") return void 0;
|
|
23982
|
+
const claimRecord = claim;
|
|
23983
|
+
const nested = claimRecord.endorsement;
|
|
23984
|
+
const nestedId = nested !== null && typeof nested === "object" ? nested.id : void 0;
|
|
23985
|
+
return claimRecord.id ?? nestedId;
|
|
23986
|
+
}, "readSignedClaimId");
|
|
23987
|
+
var classifyShareManifest = /* @__PURE__ */ __name2((payload) => {
|
|
23988
|
+
const members = payload.presentation?.verifiableCredential;
|
|
23989
|
+
if (!Array.isArray(members) || members.length === 0) {
|
|
23990
|
+
return classificationFailure("NO_PRESENTATION_MEMBERS", "presentation has no credentials");
|
|
23991
|
+
}
|
|
23992
|
+
if (members.length > MAX_VP_MEMBERS) {
|
|
23993
|
+
return classificationFailure(
|
|
23994
|
+
"TOO_MANY_VP_MEMBERS",
|
|
23995
|
+
`presentation has ${members.length} members, over the ${MAX_VP_MEMBERS} bound`
|
|
23996
|
+
);
|
|
23997
|
+
}
|
|
23998
|
+
const selection = payload.selection;
|
|
23999
|
+
const endorsements = payload.endorsements ?? [];
|
|
24000
|
+
if (!Array.isArray(selection) || selection.length < 1 || selection.length > MAX_SELECTED_CREDENTIALS) {
|
|
24001
|
+
return classificationFailure("BAD_SELECTION", "selection must contain 1..50 entries");
|
|
24002
|
+
}
|
|
24003
|
+
if (!Array.isArray(endorsements) || endorsements.length > MAX_ENDORSEMENTS) {
|
|
24004
|
+
return classificationFailure(
|
|
24005
|
+
"BAD_ENDORSEMENTS",
|
|
24006
|
+
"endorsements must contain at most 200 entries"
|
|
24007
|
+
);
|
|
24008
|
+
}
|
|
24009
|
+
const selectedIndices = [];
|
|
24010
|
+
const selected = /* @__PURE__ */ new Set();
|
|
24011
|
+
for (let index = 0; index < selection.length; index += 1) {
|
|
24012
|
+
const entry = selection[index];
|
|
24013
|
+
const credentialIndex = entry?.credentialIndex;
|
|
24014
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
24015
|
+
return classificationFailure(
|
|
24016
|
+
"SELECTION_INDEX_OUT_OF_BOUNDS",
|
|
24017
|
+
`selection[${index}].credentialIndex is out of bounds`,
|
|
24018
|
+
["selection", index, "credentialIndex"]
|
|
24019
|
+
);
|
|
24020
|
+
}
|
|
24021
|
+
if (selected.has(credentialIndex)) {
|
|
24022
|
+
return classificationFailure(
|
|
24023
|
+
"SELECTION_INDEX_DUPLICATE",
|
|
24024
|
+
`selection[${index}].credentialIndex is duplicated`,
|
|
24025
|
+
["selection", index, "credentialIndex"]
|
|
24026
|
+
);
|
|
24027
|
+
}
|
|
24028
|
+
selected.add(credentialIndex);
|
|
24029
|
+
selectedIndices.push(credentialIndex);
|
|
24030
|
+
}
|
|
24031
|
+
const classified = new Set(selected);
|
|
24032
|
+
const endorsementIndices = [];
|
|
24033
|
+
for (let index = 0; index < endorsements.length; index += 1) {
|
|
24034
|
+
const entry = endorsements[index];
|
|
24035
|
+
const credentialIndex = entry?.credentialIndex;
|
|
24036
|
+
const targetIndex = entry?.targetCredentialIndex;
|
|
24037
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
24038
|
+
return classificationFailure(
|
|
24039
|
+
"ENDORSEMENT_INDEX_OUT_OF_BOUNDS",
|
|
24040
|
+
`endorsements[${index}].credentialIndex is out of bounds`,
|
|
24041
|
+
["endorsements", index, "credentialIndex"]
|
|
24042
|
+
);
|
|
24043
|
+
}
|
|
24044
|
+
if (classified.has(credentialIndex)) {
|
|
24045
|
+
return classificationFailure(
|
|
24046
|
+
"VP_MEMBER_CLASSIFIED_TWICE",
|
|
24047
|
+
`endorsements[${index}].credentialIndex was already classified`,
|
|
24048
|
+
["endorsements", index, "credentialIndex"]
|
|
24049
|
+
);
|
|
24050
|
+
}
|
|
24051
|
+
if (!selected.has(targetIndex)) {
|
|
24052
|
+
return classificationFailure(
|
|
24053
|
+
"ENDORSEMENT_TARGET_NOT_SELECTED",
|
|
24054
|
+
`endorsements[${index}].targetCredentialIndex must reference a selected credential`,
|
|
24055
|
+
["endorsements", index, "targetCredentialIndex"]
|
|
24056
|
+
);
|
|
24057
|
+
}
|
|
24058
|
+
const referenced = readSignedClaimId(members[credentialIndex]);
|
|
24059
|
+
const target = members[targetIndex];
|
|
24060
|
+
const targetId = target !== null && typeof target === "object" ? target.id : void 0;
|
|
24061
|
+
if (typeof referenced !== "string" || typeof targetId !== "string" || referenced !== targetId) {
|
|
24062
|
+
return classificationFailure(
|
|
24063
|
+
"ENDORSEMENT_TARGET_UNBOUND",
|
|
24064
|
+
`endorsements[${index}] claim does not reference the target credential id`,
|
|
24065
|
+
["endorsements", index]
|
|
24066
|
+
);
|
|
24067
|
+
}
|
|
24068
|
+
classified.add(credentialIndex);
|
|
24069
|
+
endorsementIndices.push(credentialIndex);
|
|
24070
|
+
}
|
|
24071
|
+
if (classified.size !== members.length) {
|
|
24072
|
+
return classificationFailure(
|
|
24073
|
+
"UNCLASSIFIED_VP_MEMBER",
|
|
24074
|
+
"every presentation member must be classified exactly once",
|
|
24075
|
+
["presentation", "verifiableCredential"]
|
|
24076
|
+
);
|
|
24077
|
+
}
|
|
24078
|
+
return {
|
|
24079
|
+
ok: true,
|
|
24080
|
+
classification: { selectedIndices, endorsementIndices, memberCount: members.length }
|
|
24081
|
+
};
|
|
24082
|
+
}, "classifyShareManifest");
|
|
24083
|
+
var SharePayloadValidator = SharePayloadValidatorShape.superRefine((payload, ctx) => {
|
|
24084
|
+
const result = classifyShareManifest(payload);
|
|
24085
|
+
if (!result.ok) {
|
|
24086
|
+
ctx.addIssue({
|
|
24087
|
+
code: "custom",
|
|
24088
|
+
message: result.message,
|
|
24089
|
+
path: result.path,
|
|
24090
|
+
params: { shareLinkCode: result.code }
|
|
24091
|
+
});
|
|
24092
|
+
}
|
|
24093
|
+
});
|
|
24094
|
+
var ShareRecoverySelectionValidator = external_exports.object({
|
|
24095
|
+
ref: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS),
|
|
24096
|
+
order: external_exports.number().int().min(0).max(MAX_SELECTED_CREDENTIALS - 1)
|
|
24097
|
+
}).strict();
|
|
24098
|
+
var ShareRecoveryEndorsementValidator = external_exports.object({ targetRef: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS) }).strict();
|
|
24099
|
+
var ShareRecoveryPlaintextValidator = external_exports.object({
|
|
24100
|
+
protocol: external_exports.literal(SHARE_RECOVERY_PROTOCOL),
|
|
24101
|
+
shareId: ShareLinkIdValidator,
|
|
24102
|
+
ownerProfileId: external_exports.string().min(1).max(128),
|
|
24103
|
+
createdAt: external_exports.iso.datetime(),
|
|
24104
|
+
latest: external_exports.object({ contentVersion: safeVersion, key: ShareContentKeyValidator }).strict(),
|
|
24105
|
+
selection: ShareRecoverySelectionValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24106
|
+
endorsements: ShareRecoveryEndorsementValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
24107
|
+
}).strict().superRefine((recovery, ctx) => {
|
|
24108
|
+
const orders = /* @__PURE__ */ new Set();
|
|
24109
|
+
recovery.selection.forEach((entry, index) => {
|
|
24110
|
+
if (entry.order >= recovery.selection.length) {
|
|
24111
|
+
ctx.addIssue({
|
|
24112
|
+
code: "custom",
|
|
24113
|
+
message: "order must be within the selection bounds",
|
|
24114
|
+
path: ["selection", index, "order"]
|
|
24115
|
+
});
|
|
24116
|
+
}
|
|
24117
|
+
if (orders.has(entry.order)) {
|
|
24118
|
+
ctx.addIssue({
|
|
24119
|
+
code: "custom",
|
|
24120
|
+
message: "order must be unique within the selection",
|
|
24121
|
+
path: ["selection", index, "order"]
|
|
24122
|
+
});
|
|
24123
|
+
}
|
|
24124
|
+
orders.add(entry.order);
|
|
24125
|
+
});
|
|
24126
|
+
});
|
|
24127
|
+
var ShareOwnerRecoveryValidator = JWEValidator.refine(
|
|
24128
|
+
(value) => utf8ByteLength(JSON.stringify(value)) <= MAX_SHARE_RECOVERY_JWE_BYTES,
|
|
24129
|
+
{ message: `serialized recovery JWE must be at most ${MAX_SHARE_RECOVERY_JWE_BYTES} bytes` }
|
|
24130
|
+
);
|
|
24131
|
+
var ShareLinkStatusValidator = external_exports.enum(["pending", "active", "stopped"]);
|
|
24132
|
+
var ShareContentStateValidator = external_exports.enum(["staging", "finalized", "content_missing"]);
|
|
24133
|
+
var ShareLinkValidator = external_exports.object({
|
|
24134
|
+
id: ShareLinkIdValidator,
|
|
24135
|
+
title: external_exports.string().min(1).max(120),
|
|
24136
|
+
note: external_exports.string().max(500).optional(),
|
|
24137
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24138
|
+
version: safeVersion,
|
|
24139
|
+
contentVersion: safeVersion,
|
|
24140
|
+
status: ShareLinkStatusValidator,
|
|
24141
|
+
attachmentId: external_exports.string().uuid().nullable().optional(),
|
|
24142
|
+
attachmentChunkCount: external_exports.number().int().min(1).max(16).nullable().optional(),
|
|
24143
|
+
contentState: ShareContentStateValidator,
|
|
24144
|
+
createdAt: external_exports.iso.datetime(),
|
|
24145
|
+
updatedAt: external_exports.iso.datetime(),
|
|
24146
|
+
expiresAt: external_exports.iso.datetime().nullable(),
|
|
24147
|
+
stoppedAt: external_exports.iso.datetime().nullable(),
|
|
24148
|
+
lastViewedAt: external_exports.iso.datetime().nullable(),
|
|
24149
|
+
viewCount: external_exports.number().int().min(0).optional(),
|
|
24150
|
+
passcodeProtected: external_exports.boolean(),
|
|
24151
|
+
notifyOnView: external_exports.boolean(),
|
|
24152
|
+
minorPolicy: external_exports.object({
|
|
24153
|
+
isMinor: external_exports.boolean().nullable(),
|
|
24154
|
+
policyResolved: external_exports.boolean(),
|
|
24155
|
+
defaultExpiryDays: external_exports.union([external_exports.literal(30), external_exports.literal(365)]),
|
|
24156
|
+
viewCountingEnabled: external_exports.boolean()
|
|
24157
|
+
}),
|
|
24158
|
+
/**
|
|
24159
|
+
* Guarded application/API URL for the content. Optional because owner APIs in
|
|
24160
|
+
* D1 have no public resolve/content endpoint yet; it must never be a
|
|
24161
|
+
* LearnCloud object URL or carry a fabricated decryption key.
|
|
24162
|
+
*/
|
|
24163
|
+
contentUrl: external_exports.string().optional()
|
|
24164
|
+
});
|
|
24165
|
+
var clientRequestId = external_exports.string().uuid();
|
|
24166
|
+
var ShareLinkAttachmentValidator = external_exports.object({
|
|
24167
|
+
id: external_exports.string().uuid(),
|
|
24168
|
+
chunkCount: external_exports.number().int().min(1).max(16)
|
|
24169
|
+
}).strict();
|
|
24170
|
+
var attachmentChunkKey = {
|
|
24171
|
+
id: ShareLinkIdValidator,
|
|
24172
|
+
contentVersion: safeVersion,
|
|
24173
|
+
attachmentId: external_exports.string().uuid(),
|
|
24174
|
+
chunkIndex: external_exports.number().int().min(0).max(15)
|
|
24175
|
+
};
|
|
24176
|
+
var ShareLinkAttachmentChunkEnvelopeValidator = ShareEnvelopeValidator.refine(
|
|
24177
|
+
(value) => (decodedBase64UrlByteLength(value.ct) ?? Infinity) <= 256 * 1024 + SHARE_TAG_BYTES
|
|
24178
|
+
);
|
|
24179
|
+
var PutShareLinkAttachmentChunkInputValidator = external_exports.object({
|
|
24180
|
+
...attachmentChunkKey,
|
|
24181
|
+
chunkCount: external_exports.number().int().min(1).max(16),
|
|
24182
|
+
envelope: ShareLinkAttachmentChunkEnvelopeValidator,
|
|
24183
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator
|
|
24184
|
+
}).strict().refine((value) => value.chunkIndex < value.chunkCount);
|
|
24185
|
+
var GetShareLinkAttachmentChunkInputValidator = external_exports.object({
|
|
24186
|
+
...attachmentChunkKey,
|
|
24187
|
+
passcode: external_exports.string().min(4).max(64).optional(),
|
|
24188
|
+
accessToken: external_exports.string().min(1).max(2048).optional()
|
|
24189
|
+
}).strict();
|
|
24190
|
+
var ShareLinkAttachmentChunkOutputValidator = external_exports.object({
|
|
24191
|
+
...attachmentChunkKey,
|
|
24192
|
+
envelope: ShareLinkAttachmentChunkEnvelopeValidator,
|
|
24193
|
+
accessToken: external_exports.string().min(1).max(2048).optional()
|
|
24194
|
+
}).strict();
|
|
24195
|
+
var DeleteShareLinkAttachmentChunksInputValidator = external_exports.object({
|
|
24196
|
+
id: ShareLinkIdValidator,
|
|
24197
|
+
contentVersion: safeVersion,
|
|
24198
|
+
attachmentId: external_exports.string().uuid(),
|
|
24199
|
+
chunkCount: external_exports.number().int().min(1).max(16)
|
|
24200
|
+
}).strict();
|
|
24201
|
+
var PutShareLinkAttachmentChunkOutputValidator = external_exports.object({ ok: external_exports.literal(true) }).strict();
|
|
24202
|
+
var DeleteShareLinkAttachmentChunksOutputValidator = external_exports.object({ ok: external_exports.boolean() }).strict();
|
|
24203
|
+
var CreateShareLinkInputValidator = external_exports.object({
|
|
24204
|
+
id: ShareLinkIdValidator,
|
|
24205
|
+
clientRequestId,
|
|
24206
|
+
title: external_exports.string().min(1).max(120),
|
|
24207
|
+
note: external_exports.string().max(500).optional(),
|
|
24208
|
+
expiresAt: external_exports.iso.datetime().nullable().optional(),
|
|
24209
|
+
passcode: external_exports.string().min(8).max(64).optional(),
|
|
24210
|
+
notifyOnView: external_exports.boolean().default(false),
|
|
24211
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24212
|
+
contentVersion: external_exports.literal(1),
|
|
24213
|
+
envelope: ShareEnvelopeValidator,
|
|
24214
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator,
|
|
24215
|
+
attachment: ShareLinkAttachmentValidator.optional()
|
|
24216
|
+
}).strict();
|
|
24217
|
+
var UpdateShareLinkInputValidator = external_exports.object({
|
|
24218
|
+
id: ShareLinkIdValidator,
|
|
24219
|
+
expectedVersion: safeVersion,
|
|
24220
|
+
clientRequestId,
|
|
24221
|
+
title: external_exports.string().min(1).max(120).optional(),
|
|
24222
|
+
note: external_exports.string().max(500).nullable().optional(),
|
|
24223
|
+
expiresAt: external_exports.iso.datetime().nullable().optional(),
|
|
24224
|
+
/** Omitted preserves the current passcode, null removes it, and a string replaces it. */
|
|
24225
|
+
passcode: external_exports.string().min(8).max(64).nullable().optional(),
|
|
24226
|
+
notifyOnView: external_exports.boolean().optional(),
|
|
24227
|
+
contentVersion: safeVersion.optional(),
|
|
24228
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS).optional(),
|
|
24229
|
+
envelope: ShareEnvelopeValidator.optional(),
|
|
24230
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator.optional(),
|
|
24231
|
+
attachment: ShareLinkAttachmentValidator.optional()
|
|
24232
|
+
}).strict().superRefine((value, ctx) => {
|
|
24233
|
+
const provided = [
|
|
24234
|
+
value.contentVersion,
|
|
24235
|
+
value.selectedCount,
|
|
24236
|
+
value.envelope,
|
|
24237
|
+
value.ownerEncryptedRecovery
|
|
24238
|
+
].filter((field) => field !== void 0).length;
|
|
24239
|
+
if (provided !== 0 && provided !== 4) {
|
|
24240
|
+
ctx.addIssue({
|
|
24241
|
+
code: "custom",
|
|
24242
|
+
message: "content replacement requires contentVersion, selectedCount, envelope and ownerEncryptedRecovery together"
|
|
24243
|
+
});
|
|
24244
|
+
}
|
|
24245
|
+
if (value.attachment !== void 0 && provided !== 4) {
|
|
24246
|
+
ctx.addIssue({ code: "custom", message: "attachment requires a content replacement" });
|
|
24247
|
+
}
|
|
24248
|
+
});
|
|
24249
|
+
var ShareLinkIdInputValidator = external_exports.object({ id: ShareLinkIdValidator }).strict();
|
|
24250
|
+
var ShareLinkOperationKeyInputValidator = external_exports.object({ id: ShareLinkIdValidator, operationId: external_exports.string().uuid() }).strict();
|
|
24251
|
+
var ShareLinkOwnerCommitOutputValidator = external_exports.discriminatedUnion("status", [
|
|
24252
|
+
external_exports.object({ status: external_exports.literal("completed"), share: ShareLinkValidator }).strict(),
|
|
24253
|
+
external_exports.object({
|
|
24254
|
+
status: external_exports.literal("pending"),
|
|
24255
|
+
id: ShareLinkIdValidator,
|
|
24256
|
+
operationId: external_exports.string().uuid()
|
|
24257
|
+
}).strict()
|
|
24258
|
+
]);
|
|
24259
|
+
var ShareLinkOwnerStatusOutputValidator = external_exports.discriminatedUnion("status", [
|
|
24260
|
+
external_exports.object({ status: external_exports.literal("found"), share: ShareLinkValidator }).strict(),
|
|
24261
|
+
external_exports.object({
|
|
24262
|
+
status: external_exports.literal("pending"),
|
|
24263
|
+
id: ShareLinkIdValidator,
|
|
24264
|
+
operationId: external_exports.string().uuid()
|
|
24265
|
+
}).strict(),
|
|
24266
|
+
external_exports.object({ status: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
24267
|
+
]);
|
|
24268
|
+
var ShareLinkOwnerRecoveryOutputValidator = external_exports.object({ recovery: ShareOwnerRecoveryValidator }).strict();
|
|
24269
|
+
var ShareLinkOwnerContentOutputValidator = external_exports.object({
|
|
24270
|
+
id: ShareLinkIdValidator,
|
|
24271
|
+
contentVersion: safeVersion,
|
|
24272
|
+
envelope: ShareEnvelopeValidator
|
|
24273
|
+
}).strict();
|
|
24274
|
+
var ResolveShareLinkInputValidator = external_exports.object({
|
|
24275
|
+
id: ShareLinkIdValidator,
|
|
24276
|
+
/** Sent only in a POST body; it must never be placed in a share URL. */
|
|
24277
|
+
passcode: external_exports.string().min(4).max(64).optional()
|
|
24278
|
+
}).strict();
|
|
24279
|
+
var ShareLinkPublicStateValidator = external_exports.discriminatedUnion("state", [
|
|
24280
|
+
external_exports.object({
|
|
24281
|
+
state: external_exports.literal("passcode_required"),
|
|
24282
|
+
id: ShareLinkIdValidator
|
|
24283
|
+
}).strict(),
|
|
24284
|
+
external_exports.object({ state: external_exports.literal("try_later"), id: ShareLinkIdValidator }).strict(),
|
|
24285
|
+
external_exports.object({
|
|
24286
|
+
state: external_exports.literal("active"),
|
|
24287
|
+
id: ShareLinkIdValidator,
|
|
24288
|
+
title: external_exports.string().max(120),
|
|
24289
|
+
note: external_exports.string().max(500).optional(),
|
|
24290
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24291
|
+
contentVersion: safeVersion,
|
|
24292
|
+
contentUrl: external_exports.string(),
|
|
24293
|
+
sharer: external_exports.object({
|
|
24294
|
+
displayName: external_exports.string().max(120),
|
|
24295
|
+
avatar: external_exports.string().max(2048).optional()
|
|
24296
|
+
}),
|
|
24297
|
+
createdAt: external_exports.iso.datetime(),
|
|
24298
|
+
updatedAt: external_exports.iso.datetime(),
|
|
24299
|
+
expiresAt: external_exports.iso.datetime().nullable()
|
|
24300
|
+
}).strict(),
|
|
24301
|
+
external_exports.object({
|
|
24302
|
+
state: external_exports.literal("expired"),
|
|
24303
|
+
id: ShareLinkIdValidator,
|
|
24304
|
+
expiresAt: external_exports.iso.datetime()
|
|
24305
|
+
}).strict(),
|
|
24306
|
+
external_exports.object({
|
|
24307
|
+
state: external_exports.literal("stopped"),
|
|
24308
|
+
id: ShareLinkIdValidator,
|
|
24309
|
+
stoppedAt: external_exports.iso.datetime()
|
|
24310
|
+
}).strict(),
|
|
24311
|
+
external_exports.object({ state: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
24312
|
+
]);
|
|
24313
|
+
var ListShareLinksInputValidator = external_exports.object({
|
|
24314
|
+
limit: external_exports.number().int().min(1).max(50).default(25),
|
|
24315
|
+
cursor: external_exports.string().max(512).optional()
|
|
24316
|
+
}).strict();
|
|
24317
|
+
var PaginatedShareLinksValidator = PaginationResponseValidator.extend({
|
|
24318
|
+
records: ShareLinkValidator.array()
|
|
24319
|
+
});
|
|
24320
|
+
var AcknowledgeViewInputValidator = external_exports.object({
|
|
24321
|
+
receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
24322
|
+
}).strict();
|
|
24323
|
+
var AcknowledgeViewOutputValidator = external_exports.object({ ok: external_exports.literal(true) }).strict();
|
|
24324
|
+
var SHARE_VIEW_RECEIPT_TTL_SECONDS = 10 * 60;
|
|
24325
|
+
var ShareLinkPublicContentViewValidator = external_exports.object({
|
|
24326
|
+
id: ShareLinkIdValidator,
|
|
24327
|
+
contentVersion: safeVersion,
|
|
24328
|
+
envelope: ShareEnvelopeValidator,
|
|
24329
|
+
contentUrl: external_exports.string(),
|
|
24330
|
+
receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
24331
|
+
}).strict();
|
|
23571
24332
|
|
|
23572
24333
|
// src/helpers.ts
|
|
23573
24334
|
var import_json_stringify_deterministic = __toESM(require_lib(), 1);
|