@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
|
@@ -7,7 +7,11 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
9
|
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
-
|
|
10
|
+
try {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
} catch (e2) {
|
|
13
|
+
throw mod = 0, e2;
|
|
14
|
+
}
|
|
11
15
|
};
|
|
12
16
|
var __export = (target, all) => {
|
|
13
17
|
for (var name in all)
|
|
@@ -6700,10 +6704,10 @@ function $constructor(name, initializer3, params) {
|
|
|
6700
6704
|
let Definition = _Definition;
|
|
6701
6705
|
Object.defineProperty(Definition, "name", { value: name });
|
|
6702
6706
|
function _(def) {
|
|
6703
|
-
var
|
|
6707
|
+
var _a5;
|
|
6704
6708
|
const inst = params?.Parent ? new Definition() : this;
|
|
6705
6709
|
init(inst, def);
|
|
6706
|
-
(
|
|
6710
|
+
(_a5 = inst._zod).deferred ?? (_a5.deferred = []);
|
|
6707
6711
|
for (const fn of inst._zod.deferred) {
|
|
6708
6712
|
fn();
|
|
6709
6713
|
}
|
|
@@ -7369,8 +7373,8 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
7369
7373
|
__name(explicitlyAborted, "explicitlyAborted");
|
|
7370
7374
|
function prefixIssues(path, issues) {
|
|
7371
7375
|
return issues.map((iss) => {
|
|
7372
|
-
var
|
|
7373
|
-
(
|
|
7376
|
+
var _a5;
|
|
7377
|
+
(_a5 = iss).path ?? (_a5.path = []);
|
|
7374
7378
|
iss.path.unshift(path);
|
|
7375
7379
|
return iss;
|
|
7376
7380
|
});
|
|
@@ -7573,7 +7577,7 @@ __name(formatError, "formatError");
|
|
|
7573
7577
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
7574
7578
|
const result = { errors: [] };
|
|
7575
7579
|
const processError = /* @__PURE__ */ __name((error52, path = []) => {
|
|
7576
|
-
var
|
|
7580
|
+
var _a5, _b;
|
|
7577
7581
|
for (const issue2 of error52.issues) {
|
|
7578
7582
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
7579
7583
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
@@ -7594,7 +7598,7 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
7594
7598
|
const terminal = i === fullpath.length - 1;
|
|
7595
7599
|
if (typeof el === "string") {
|
|
7596
7600
|
curr.properties ?? (curr.properties = {});
|
|
7597
|
-
(
|
|
7601
|
+
(_a5 = curr.properties)[el] ?? (_a5[el] = { errors: [] });
|
|
7598
7602
|
curr = curr.properties[el];
|
|
7599
7603
|
} else {
|
|
7600
7604
|
curr.items ?? (curr.items = []);
|
|
@@ -7899,10 +7903,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
|
7899
7903
|
|
|
7900
7904
|
// ../../../node_modules/zod/v4/core/checks.js
|
|
7901
7905
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
7902
|
-
var
|
|
7906
|
+
var _a5;
|
|
7903
7907
|
inst._zod ?? (inst._zod = {});
|
|
7904
7908
|
inst._zod.def = def;
|
|
7905
|
-
(
|
|
7909
|
+
(_a5 = inst._zod).onattach ?? (_a5.onattach = []);
|
|
7906
7910
|
});
|
|
7907
7911
|
var numericOriginMap = {
|
|
7908
7912
|
number: "number",
|
|
@@ -7968,8 +7972,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
7968
7972
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
7969
7973
|
$ZodCheck.init(inst, def);
|
|
7970
7974
|
inst._zod.onattach.push((inst2) => {
|
|
7971
|
-
var
|
|
7972
|
-
(
|
|
7975
|
+
var _a5;
|
|
7976
|
+
(_a5 = inst2._zod.bag).multipleOf ?? (_a5.multipleOf = def.value);
|
|
7973
7977
|
});
|
|
7974
7978
|
inst._zod.check = (payload) => {
|
|
7975
7979
|
if (typeof payload.value !== typeof def.value)
|
|
@@ -8102,9 +8106,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
8102
8106
|
};
|
|
8103
8107
|
});
|
|
8104
8108
|
var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
8105
|
-
var
|
|
8109
|
+
var _a5;
|
|
8106
8110
|
$ZodCheck.init(inst, def);
|
|
8107
|
-
(
|
|
8111
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8108
8112
|
const val = payload.value;
|
|
8109
8113
|
return !nullish(val) && val.size !== void 0;
|
|
8110
8114
|
});
|
|
@@ -8130,9 +8134,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
8130
8134
|
};
|
|
8131
8135
|
});
|
|
8132
8136
|
var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
|
|
8133
|
-
var
|
|
8137
|
+
var _a5;
|
|
8134
8138
|
$ZodCheck.init(inst, def);
|
|
8135
|
-
(
|
|
8139
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8136
8140
|
const val = payload.value;
|
|
8137
8141
|
return !nullish(val) && val.size !== void 0;
|
|
8138
8142
|
});
|
|
@@ -8158,9 +8162,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
8158
8162
|
};
|
|
8159
8163
|
});
|
|
8160
8164
|
var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
8161
|
-
var
|
|
8165
|
+
var _a5;
|
|
8162
8166
|
$ZodCheck.init(inst, def);
|
|
8163
|
-
(
|
|
8167
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8164
8168
|
const val = payload.value;
|
|
8165
8169
|
return !nullish(val) && val.size !== void 0;
|
|
8166
8170
|
});
|
|
@@ -8188,9 +8192,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
8188
8192
|
};
|
|
8189
8193
|
});
|
|
8190
8194
|
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
8191
|
-
var
|
|
8195
|
+
var _a5;
|
|
8192
8196
|
$ZodCheck.init(inst, def);
|
|
8193
|
-
(
|
|
8197
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8194
8198
|
const val = payload.value;
|
|
8195
8199
|
return !nullish(val) && val.length !== void 0;
|
|
8196
8200
|
});
|
|
@@ -8217,9 +8221,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
8217
8221
|
};
|
|
8218
8222
|
});
|
|
8219
8223
|
var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
8220
|
-
var
|
|
8224
|
+
var _a5;
|
|
8221
8225
|
$ZodCheck.init(inst, def);
|
|
8222
|
-
(
|
|
8226
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8223
8227
|
const val = payload.value;
|
|
8224
8228
|
return !nullish(val) && val.length !== void 0;
|
|
8225
8229
|
});
|
|
@@ -8246,9 +8250,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
8246
8250
|
};
|
|
8247
8251
|
});
|
|
8248
8252
|
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
8249
|
-
var
|
|
8253
|
+
var _a5;
|
|
8250
8254
|
$ZodCheck.init(inst, def);
|
|
8251
|
-
(
|
|
8255
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
8252
8256
|
const val = payload.value;
|
|
8253
8257
|
return !nullish(val) && val.length !== void 0;
|
|
8254
8258
|
});
|
|
@@ -8277,7 +8281,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
8277
8281
|
};
|
|
8278
8282
|
});
|
|
8279
8283
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
8280
|
-
var
|
|
8284
|
+
var _a5, _b;
|
|
8281
8285
|
$ZodCheck.init(inst, def);
|
|
8282
8286
|
inst._zod.onattach.push((inst2) => {
|
|
8283
8287
|
const bag = inst2._zod.bag;
|
|
@@ -8288,7 +8292,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
|
|
|
8288
8292
|
}
|
|
8289
8293
|
});
|
|
8290
8294
|
if (def.pattern)
|
|
8291
|
-
(
|
|
8295
|
+
(_a5 = inst._zod).check ?? (_a5.check = (payload) => {
|
|
8292
8296
|
def.pattern.lastIndex = 0;
|
|
8293
8297
|
if (def.pattern.test(payload.value))
|
|
8294
8298
|
return;
|
|
@@ -8493,7 +8497,7 @@ var version = {
|
|
|
8493
8497
|
|
|
8494
8498
|
// ../../../node_modules/zod/v4/core/schemas.js
|
|
8495
8499
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
8496
|
-
var
|
|
8500
|
+
var _a5;
|
|
8497
8501
|
inst ?? (inst = {});
|
|
8498
8502
|
inst._zod.def = def;
|
|
8499
8503
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -8508,7 +8512,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
8508
8512
|
}
|
|
8509
8513
|
}
|
|
8510
8514
|
if (checks.length === 0) {
|
|
8511
|
-
(
|
|
8515
|
+
(_a5 = inst._zod).deferred ?? (_a5.deferred = []);
|
|
8512
8516
|
inst._zod.deferred?.push(() => {
|
|
8513
8517
|
inst._zod.run = inst._zod.parse;
|
|
8514
8518
|
});
|
|
@@ -17899,7 +17903,7 @@ function initializeContext(params) {
|
|
|
17899
17903
|
}
|
|
17900
17904
|
__name(initializeContext, "initializeContext");
|
|
17901
17905
|
function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
17902
|
-
var
|
|
17906
|
+
var _a5;
|
|
17903
17907
|
const def = schema._zod.def;
|
|
17904
17908
|
const seen = ctx.seen.get(schema);
|
|
17905
17909
|
if (seen) {
|
|
@@ -17947,7 +17951,7 @@ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
17947
17951
|
delete result.schema.default;
|
|
17948
17952
|
}
|
|
17949
17953
|
if (ctx.io === "input" && "_prefault" in result.schema)
|
|
17950
|
-
(
|
|
17954
|
+
(_a5 = result.schema).default ?? (_a5.default = result.schema._prefault);
|
|
17951
17955
|
delete result.schema._prefault;
|
|
17952
17956
|
const _result = ctx.seen.get(schema);
|
|
17953
17957
|
return _result.schema;
|
|
@@ -21523,7 +21527,8 @@ var AssociationTypeValidator = external_exports.enum([
|
|
|
21523
21527
|
"replacedBy"
|
|
21524
21528
|
]).or(external_exports.string());
|
|
21525
21529
|
var AssociationValidator = external_exports.object({
|
|
21526
|
-
|
|
21530
|
+
// Accept compacted scalars while retaining the existing permissive array contract.
|
|
21531
|
+
type: external_exports.string().min(1).or(external_exports.string().array().nonempty()),
|
|
21527
21532
|
associationType: AssociationTypeValidator,
|
|
21528
21533
|
sourceId: external_exports.string().optional(),
|
|
21529
21534
|
targetId: external_exports.string()
|
|
@@ -22346,11 +22351,48 @@ var ConsentFlowContractDetailsValidator = external_exports.object({
|
|
|
22346
22351
|
updatedAt: external_exports.string(),
|
|
22347
22352
|
expiresAt: external_exports.string().optional(),
|
|
22348
22353
|
autoBoosts: external_exports.string().array().optional(),
|
|
22349
|
-
writers: external_exports.array(LCNProfileValidator).optional()
|
|
22354
|
+
writers: external_exports.array(LCNProfileValidator).optional(),
|
|
22355
|
+
recipients: external_exports.array(LCNPublicProfileValidator.extend({ did: external_exports.string() })).optional(),
|
|
22356
|
+
audienceVersion: external_exports.number().int().nonnegative().optional()
|
|
22350
22357
|
});
|
|
22351
|
-
var ConsentFlowContractRequestStatusValidator = external_exports.enum(["pending", "accepted", "denied"]).nullable();
|
|
22358
|
+
var ConsentFlowContractRequestStatusValidator = external_exports.enum(["pending", "accepted", "denied", "cancelled"]).nullable();
|
|
22352
22359
|
var ConsentFlowContractRequestReadStatusValidator = external_exports.enum(["unseen", "seen"]).nullable();
|
|
22353
|
-
var
|
|
22360
|
+
var ConsentFlowReferralValidator = external_exports.object({
|
|
22361
|
+
requestId: external_exports.string(),
|
|
22362
|
+
requestedBy: external_exports.string(),
|
|
22363
|
+
externalReferenceId: external_exports.string().max(256).optional()
|
|
22364
|
+
});
|
|
22365
|
+
var ContractRequestFieldsValidator = ConsentFlowReferralValidator.partial().extend({
|
|
22366
|
+
requestedAt: external_exports.string().optional(),
|
|
22367
|
+
message: external_exports.string().max(500).optional()
|
|
22368
|
+
});
|
|
22369
|
+
var SendContractRequestValidator = external_exports.object({
|
|
22370
|
+
contractUri: external_exports.string(),
|
|
22371
|
+
targetProfileId: external_exports.string(),
|
|
22372
|
+
externalReferenceId: external_exports.string().trim().min(1).max(256).optional(),
|
|
22373
|
+
message: external_exports.string().trim().max(500).optional()
|
|
22374
|
+
});
|
|
22375
|
+
var ConsentFlowWebhookMetadataValidator = external_exports.object({
|
|
22376
|
+
eventId: external_exports.string(),
|
|
22377
|
+
deliveryKey: external_exports.string(),
|
|
22378
|
+
event: external_exports.enum([
|
|
22379
|
+
"request_sent",
|
|
22380
|
+
"request_accepted",
|
|
22381
|
+
"request_denied",
|
|
22382
|
+
"request_cancelled",
|
|
22383
|
+
"consent_created",
|
|
22384
|
+
"consent_updated",
|
|
22385
|
+
"consent_withdrawn",
|
|
22386
|
+
"credentials_synced"
|
|
22387
|
+
]),
|
|
22388
|
+
contractUri: external_exports.string(),
|
|
22389
|
+
termsUri: external_exports.string().optional(),
|
|
22390
|
+
requestId: external_exports.string().optional(),
|
|
22391
|
+
requestedBy: external_exports.string().optional(),
|
|
22392
|
+
externalReferenceId: external_exports.string().optional(),
|
|
22393
|
+
recipientRole: external_exports.enum(["owner", "recipient", "requester", "target"])
|
|
22394
|
+
});
|
|
22395
|
+
var ConsentFlowContractRequestForProfileValidator = ContractRequestFieldsValidator.extend({
|
|
22354
22396
|
profile: LCNProfileValidator,
|
|
22355
22397
|
status: ConsentFlowContractRequestStatusValidator,
|
|
22356
22398
|
readStatus: ConsentFlowContractRequestReadStatusValidator.optional()
|
|
@@ -22396,6 +22438,7 @@ var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
|
|
|
22396
22438
|
expiresAt: external_exports.string().optional(),
|
|
22397
22439
|
oneTime: external_exports.boolean().optional(),
|
|
22398
22440
|
terms: ConsentFlowTermsValidator,
|
|
22441
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
22399
22442
|
contract: ConsentFlowContractDetailsValidator,
|
|
22400
22443
|
uri: external_exports.string(),
|
|
22401
22444
|
consenter: LCNProfileValidator,
|
|
@@ -22491,6 +22534,7 @@ var ConsentFlowTransactionValidator = external_exports.object({
|
|
|
22491
22534
|
oneTime: external_exports.boolean().optional(),
|
|
22492
22535
|
terms: ConsentFlowTermsValidator.optional(),
|
|
22493
22536
|
guardianApproval: ConsentFlowGuardianApprovalValidator.optional(),
|
|
22537
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
22494
22538
|
id: external_exports.string(),
|
|
22495
22539
|
action: ConsentFlowTransactionActionValidator,
|
|
22496
22540
|
date: external_exports.string(),
|
|
@@ -22501,6 +22545,7 @@ var HolderExportConsentRecordValidator = external_exports.object({
|
|
|
22501
22545
|
status: ConsentFlowTermsStatusValidator,
|
|
22502
22546
|
contract: ConsentFlowContractDetailsValidator,
|
|
22503
22547
|
terms: ConsentFlowTermsValidator,
|
|
22548
|
+
referral: ConsentFlowReferralValidator.optional(),
|
|
22504
22549
|
transactions: ConsentFlowTransactionValidator.array()
|
|
22505
22550
|
});
|
|
22506
22551
|
var HolderExportMetadataValidator = external_exports.object({
|
|
@@ -23236,7 +23281,7 @@ var AppStoreListingSubmitterValidator = external_exports.object({
|
|
|
23236
23281
|
displayName: external_exports.string(),
|
|
23237
23282
|
email: external_exports.string().optional()
|
|
23238
23283
|
});
|
|
23239
|
-
var
|
|
23284
|
+
var AppStoreListingFieldsValidator = external_exports.object({
|
|
23240
23285
|
listing_id: external_exports.string(),
|
|
23241
23286
|
slug: external_exports.string().optional(),
|
|
23242
23287
|
display_name: external_exports.string(),
|
|
@@ -23262,15 +23307,33 @@ var AppStoreListingValidator = external_exports.object({
|
|
|
23262
23307
|
submitter: AppStoreListingSubmitterValidator.optional(),
|
|
23263
23308
|
contact_email: external_exports.string().email().optional()
|
|
23264
23309
|
});
|
|
23310
|
+
var PendingListingUpdateStatusValidator = external_exports.enum(["DRAFT", "PENDING_REVIEW"]);
|
|
23311
|
+
var PendingListingUpdateValidator = external_exports.object({
|
|
23312
|
+
status: PendingListingUpdateStatusValidator,
|
|
23313
|
+
submitted_at: external_exports.string().optional(),
|
|
23314
|
+
changes: AppStoreListingFieldsValidator.omit({
|
|
23315
|
+
listing_id: true,
|
|
23316
|
+
app_listing_status: true,
|
|
23317
|
+
promotion_level: true,
|
|
23318
|
+
submitted_at: true,
|
|
23319
|
+
submitter: true
|
|
23320
|
+
}).partial(),
|
|
23321
|
+
manifest_version: external_exports.number().int().min(1).optional()
|
|
23322
|
+
});
|
|
23323
|
+
var AppStoreListingValidator = AppStoreListingFieldsValidator.extend({
|
|
23324
|
+
pending_update: PendingListingUpdateValidator.optional()
|
|
23325
|
+
});
|
|
23265
23326
|
var AppStoreListingCreateValidator = AppStoreListingValidator.omit({
|
|
23266
23327
|
listing_id: true,
|
|
23267
23328
|
app_listing_status: true,
|
|
23268
|
-
promotion_level: true
|
|
23329
|
+
promotion_level: true,
|
|
23330
|
+
pending_update: true
|
|
23269
23331
|
});
|
|
23270
23332
|
var AppStoreListingUpdateValidator = AppStoreListingValidator.partial().omit({
|
|
23271
23333
|
listing_id: true,
|
|
23272
23334
|
app_listing_status: true,
|
|
23273
|
-
promotion_level: true
|
|
23335
|
+
promotion_level: true,
|
|
23336
|
+
pending_update: true
|
|
23274
23337
|
});
|
|
23275
23338
|
var InstalledAppValidator = AppStoreListingValidator.extend({
|
|
23276
23339
|
installed_at: external_exports.string()
|
|
@@ -23285,12 +23348,87 @@ var AppBoostValidator = external_exports.object({
|
|
|
23285
23348
|
templateAlias: external_exports.string().min(1).max(50).regex(/^[a-z0-9-]+$/),
|
|
23286
23349
|
boostUri: external_exports.string()
|
|
23287
23350
|
});
|
|
23288
|
-
var
|
|
23351
|
+
var InlineWalletCategoryValidator = external_exports.enum([
|
|
23352
|
+
"Achievement",
|
|
23353
|
+
"Skill",
|
|
23354
|
+
"ID",
|
|
23355
|
+
"Learning History",
|
|
23356
|
+
"Work History",
|
|
23357
|
+
"Social Badges",
|
|
23358
|
+
"Membership",
|
|
23359
|
+
"Accomplishment",
|
|
23360
|
+
"Experiences",
|
|
23361
|
+
"Accommodation",
|
|
23362
|
+
"Family"
|
|
23363
|
+
]);
|
|
23364
|
+
var InlineAlignmentValidator = external_exports.object({
|
|
23365
|
+
name: external_exports.string(),
|
|
23366
|
+
url: external_exports.string(),
|
|
23367
|
+
framework: external_exports.string().optional(),
|
|
23368
|
+
code: external_exports.string().optional()
|
|
23369
|
+
}).passthrough();
|
|
23370
|
+
var InlineEvidenceValidator = external_exports.object({
|
|
23371
|
+
id: external_exports.string().optional(),
|
|
23372
|
+
name: external_exports.string().optional(),
|
|
23373
|
+
narrative: external_exports.string().optional()
|
|
23374
|
+
}).passthrough();
|
|
23375
|
+
var InlineWalletSkillTagValidator = external_exports.object({
|
|
23376
|
+
frameworkId: external_exports.string(),
|
|
23377
|
+
id: external_exports.string(),
|
|
23378
|
+
proficiencyLevel: external_exports.string().optional()
|
|
23379
|
+
}).passthrough();
|
|
23380
|
+
var SimpleInlineCredentialTemplateValidator = external_exports.object({
|
|
23381
|
+
rawCredential: external_exports.undefined().optional(),
|
|
23382
|
+
name: external_exports.string(),
|
|
23383
|
+
description: external_exports.string().optional(),
|
|
23384
|
+
image: external_exports.string().optional(),
|
|
23385
|
+
issuerName: external_exports.string().optional(),
|
|
23386
|
+
achievementType: external_exports.string().optional(),
|
|
23387
|
+
category: InlineWalletCategoryValidator.optional(),
|
|
23388
|
+
criteria: external_exports.object({
|
|
23389
|
+
narrative: external_exports.string().optional(),
|
|
23390
|
+
url: external_exports.string().optional()
|
|
23391
|
+
}).passthrough().optional(),
|
|
23392
|
+
alignments: external_exports.array(InlineAlignmentValidator).optional(),
|
|
23393
|
+
tags: external_exports.array(external_exports.string()).optional(),
|
|
23394
|
+
activity: external_exports.object({
|
|
23395
|
+
startDate: external_exports.string().optional(),
|
|
23396
|
+
endDate: external_exports.string().optional()
|
|
23397
|
+
}).passthrough().optional(),
|
|
23398
|
+
credits: external_exports.object({
|
|
23399
|
+
earned: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
|
|
23400
|
+
available: external_exports.union([external_exports.number(), external_exports.string()]).optional()
|
|
23401
|
+
}).passthrough().optional(),
|
|
23402
|
+
validUntil: external_exports.string().optional(),
|
|
23403
|
+
evidence: external_exports.array(InlineEvidenceValidator).optional(),
|
|
23404
|
+
walletSkills: external_exports.array(InlineWalletSkillTagValidator).optional()
|
|
23405
|
+
}).passthrough();
|
|
23406
|
+
var RawInlineCredentialTemplateValidator = external_exports.object({
|
|
23407
|
+
rawCredential: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
23408
|
+
category: InlineWalletCategoryValidator.optional(),
|
|
23409
|
+
walletSkills: external_exports.array(InlineWalletSkillTagValidator).optional()
|
|
23410
|
+
}).passthrough();
|
|
23411
|
+
var InlineCredentialTemplateValidator = external_exports.union([
|
|
23412
|
+
RawInlineCredentialTemplateValidator,
|
|
23413
|
+
SimpleInlineCredentialTemplateValidator
|
|
23414
|
+
]);
|
|
23415
|
+
var LegacySendCredentialEventValidator = external_exports.object({
|
|
23289
23416
|
type: external_exports.literal("send-credential"),
|
|
23290
23417
|
templateAlias: external_exports.string(),
|
|
23291
23418
|
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
23292
23419
|
preventDuplicateClaim: external_exports.boolean().optional()
|
|
23293
23420
|
});
|
|
23421
|
+
var InlineSendCredentialEventValidator = external_exports.object({
|
|
23422
|
+
type: external_exports.literal("send-credential"),
|
|
23423
|
+
alias: external_exports.string(),
|
|
23424
|
+
template: InlineCredentialTemplateValidator,
|
|
23425
|
+
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
23426
|
+
preventDuplicateClaim: external_exports.boolean().optional()
|
|
23427
|
+
});
|
|
23428
|
+
var SendCredentialEventValidator = external_exports.union([
|
|
23429
|
+
LegacySendCredentialEventValidator,
|
|
23430
|
+
InlineSendCredentialEventValidator
|
|
23431
|
+
]);
|
|
23294
23432
|
var CheckCredentialEventValidator = external_exports.object({
|
|
23295
23433
|
type: external_exports.literal("check-credential"),
|
|
23296
23434
|
templateAlias: external_exports.string().optional(),
|
|
@@ -23385,7 +23523,119 @@ var GetCountersEventValidator = external_exports.object({
|
|
|
23385
23523
|
type: external_exports.literal("get-counters"),
|
|
23386
23524
|
keys: external_exports.array(counterKeyValidator).min(1).max(50).optional()
|
|
23387
23525
|
});
|
|
23388
|
-
var
|
|
23526
|
+
var ConsentRequestWalletCategoryValidator = external_exports.enum([
|
|
23527
|
+
"Achievement",
|
|
23528
|
+
"Skill",
|
|
23529
|
+
"ID",
|
|
23530
|
+
"Learning History",
|
|
23531
|
+
"Work History",
|
|
23532
|
+
"Social Badges",
|
|
23533
|
+
"Membership",
|
|
23534
|
+
"Accomplishment",
|
|
23535
|
+
"Experiences",
|
|
23536
|
+
"Accommodation",
|
|
23537
|
+
"Family"
|
|
23538
|
+
]);
|
|
23539
|
+
var ConsentRequestPersonalFieldValidator = external_exports.enum([
|
|
23540
|
+
"name",
|
|
23541
|
+
"email",
|
|
23542
|
+
"phone",
|
|
23543
|
+
"birthDate",
|
|
23544
|
+
"country",
|
|
23545
|
+
"avatar"
|
|
23546
|
+
]);
|
|
23547
|
+
var ConsentRequestValidator = external_exports.object({
|
|
23548
|
+
read: external_exports.object({
|
|
23549
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).optional(),
|
|
23550
|
+
personalFields: external_exports.array(ConsentRequestPersonalFieldValidator).optional()
|
|
23551
|
+
}).optional(),
|
|
23552
|
+
write: external_exports.object({
|
|
23553
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).optional()
|
|
23554
|
+
}).optional(),
|
|
23555
|
+
reason: external_exports.string().optional()
|
|
23556
|
+
});
|
|
23557
|
+
var NormalizedConsentScopesValidator = external_exports.object({
|
|
23558
|
+
read: external_exports.object({
|
|
23559
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).default([]),
|
|
23560
|
+
personalFields: external_exports.array(ConsentRequestPersonalFieldValidator).default([])
|
|
23561
|
+
}),
|
|
23562
|
+
write: external_exports.object({
|
|
23563
|
+
credentialCategories: external_exports.array(ConsentRequestWalletCategoryValidator).default([])
|
|
23564
|
+
})
|
|
23565
|
+
});
|
|
23566
|
+
var CapturedTemplateRecordValidator = external_exports.object({
|
|
23567
|
+
alias: external_exports.string(),
|
|
23568
|
+
template: InlineCredentialTemplateValidator,
|
|
23569
|
+
version: external_exports.number().int().min(1),
|
|
23570
|
+
lastUsedAt: external_exports.string()
|
|
23571
|
+
}).passthrough();
|
|
23572
|
+
var CapturedConsentRecordValidator = external_exports.object({
|
|
23573
|
+
scopes: NormalizedConsentScopesValidator,
|
|
23574
|
+
reason: external_exports.string().optional(),
|
|
23575
|
+
lastUsedAt: external_exports.string()
|
|
23576
|
+
}).passthrough();
|
|
23577
|
+
var AppManifestValidator = external_exports.object({
|
|
23578
|
+
manifestVersion: external_exports.literal(1),
|
|
23579
|
+
appUrl: external_exports.string(),
|
|
23580
|
+
appKey: external_exports.string().max(200).optional(),
|
|
23581
|
+
suggestedName: external_exports.string().optional(),
|
|
23582
|
+
suggestedIconUrl: external_exports.string().optional(),
|
|
23583
|
+
permissions: external_exports.array(external_exports.string()).default([]),
|
|
23584
|
+
templates: external_exports.array(CapturedTemplateRecordValidator).default([]),
|
|
23585
|
+
consentRequests: external_exports.array(CapturedConsentRecordValidator).default([]),
|
|
23586
|
+
usedConsentContract: external_exports.boolean().optional(),
|
|
23587
|
+
featuresLaunched: external_exports.array(external_exports.string()).default([]),
|
|
23588
|
+
counterKeys: external_exports.array(external_exports.string()).default([]),
|
|
23589
|
+
usedLearnerContext: external_exports.boolean(),
|
|
23590
|
+
usedNotifications: external_exports.boolean(),
|
|
23591
|
+
firstCapturedAt: external_exports.string(),
|
|
23592
|
+
lastUpdatedAt: external_exports.string()
|
|
23593
|
+
}).passthrough();
|
|
23594
|
+
var AppManifestVersionStatusValidator = external_exports.enum(["draft", "active", "superseded"]);
|
|
23595
|
+
var AppManifestVersionValidator = external_exports.object({
|
|
23596
|
+
id: external_exports.string(),
|
|
23597
|
+
version: external_exports.number().int().min(1),
|
|
23598
|
+
manifestHash: external_exports.string(),
|
|
23599
|
+
manifest: AppManifestValidator,
|
|
23600
|
+
status: AppManifestVersionStatusValidator,
|
|
23601
|
+
createdAt: external_exports.string(),
|
|
23602
|
+
activatedAt: external_exports.string().optional()
|
|
23603
|
+
});
|
|
23604
|
+
var AppManifestStringDiffValidator = external_exports.object({
|
|
23605
|
+
added: external_exports.array(external_exports.string()),
|
|
23606
|
+
removed: external_exports.array(external_exports.string()),
|
|
23607
|
+
changed: external_exports.array(external_exports.string())
|
|
23608
|
+
});
|
|
23609
|
+
var AppManifestTemplateRefValidator = external_exports.object({
|
|
23610
|
+
alias: external_exports.string(),
|
|
23611
|
+
version: external_exports.number().int().min(1)
|
|
23612
|
+
});
|
|
23613
|
+
var AppManifestTemplateChangeValidator = external_exports.object({
|
|
23614
|
+
alias: external_exports.string(),
|
|
23615
|
+
fromVersion: external_exports.number().int().min(1),
|
|
23616
|
+
toVersion: external_exports.number().int().min(1)
|
|
23617
|
+
});
|
|
23618
|
+
var AppManifestDiffValidator = external_exports.object({
|
|
23619
|
+
permissions: AppManifestStringDiffValidator,
|
|
23620
|
+
templates: external_exports.object({
|
|
23621
|
+
added: external_exports.array(AppManifestTemplateRefValidator),
|
|
23622
|
+
removed: external_exports.array(AppManifestTemplateRefValidator),
|
|
23623
|
+
changed: external_exports.array(AppManifestTemplateChangeValidator)
|
|
23624
|
+
}),
|
|
23625
|
+
consentScopes: AppManifestStringDiffValidator,
|
|
23626
|
+
featurePaths: AppManifestStringDiffValidator,
|
|
23627
|
+
counterKeys: AppManifestStringDiffValidator,
|
|
23628
|
+
requiresReview: external_exports.boolean()
|
|
23629
|
+
});
|
|
23630
|
+
var UpsertConsentContractEventValidator = external_exports.object({
|
|
23631
|
+
type: external_exports.literal("upsert-consent-contract"),
|
|
23632
|
+
scopes: ConsentRequestValidator
|
|
23633
|
+
});
|
|
23634
|
+
var UpsertConsentContractResponseValidator = external_exports.object({
|
|
23635
|
+
contractUri: external_exports.string(),
|
|
23636
|
+
created: external_exports.boolean()
|
|
23637
|
+
});
|
|
23638
|
+
var AppEventValidator = external_exports.union([
|
|
23389
23639
|
SendCredentialEventValidator,
|
|
23390
23640
|
CheckCredentialEventValidator,
|
|
23391
23641
|
CheckIssuanceStatusEventValidator,
|
|
@@ -23395,7 +23645,8 @@ var AppEventValidator = external_exports.discriminatedUnion("type", [
|
|
|
23395
23645
|
SendNotificationEventValidator,
|
|
23396
23646
|
IncrementCounterEventValidator,
|
|
23397
23647
|
GetCounterEventValidator,
|
|
23398
|
-
GetCountersEventValidator
|
|
23648
|
+
GetCountersEventValidator,
|
|
23649
|
+
UpsertConsentContractEventValidator
|
|
23399
23650
|
]);
|
|
23400
23651
|
var AppEventInputValidator = external_exports.object({
|
|
23401
23652
|
listingId: external_exports.string(),
|
|
@@ -23469,6 +23720,21 @@ var AuthSessionError = (_a3 = class extends Error {
|
|
|
23469
23720
|
this.name = "AuthSessionError";
|
|
23470
23721
|
}
|
|
23471
23722
|
}, __name(_a3, "AuthSessionError"), __name2(_a3, "AuthSessionError"), _a3);
|
|
23723
|
+
var _a4;
|
|
23724
|
+
var UnsupportedSignInOperationError = (_a4 = class extends Error {
|
|
23725
|
+
constructor(operation, providerType) {
|
|
23726
|
+
super(`${operation} is not supported by ${providerType}`);
|
|
23727
|
+
this.operation = operation;
|
|
23728
|
+
this.providerType = providerType;
|
|
23729
|
+
this.name = "UnsupportedSignInOperationError";
|
|
23730
|
+
}
|
|
23731
|
+
}, __name(_a4, "UnsupportedSignInOperationError"), __name2(_a4, "UnsupportedSignInOperationError"), _a4);
|
|
23732
|
+
var EscrowPinStatusValidator = external_exports.object({
|
|
23733
|
+
state: external_exports.enum(["none", "enabled", "locked", "stale"]),
|
|
23734
|
+
enabled: external_exports.boolean(),
|
|
23735
|
+
attemptsRemaining: external_exports.number().int().nonnegative(),
|
|
23736
|
+
salt: external_exports.string().optional()
|
|
23737
|
+
});
|
|
23472
23738
|
var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
|
|
23473
23739
|
var BitstringStatusPurposeValidator = external_exports.enum(BITSTRING_STATUS_PURPOSES);
|
|
23474
23740
|
var BitstringStatusListEntryValidator = external_exports.object({
|
|
@@ -23577,6 +23843,501 @@ var inAppMessagesFlagValidator = external_exports.object({
|
|
|
23577
23843
|
version: external_exports.number().default(1),
|
|
23578
23844
|
messages: external_exports.array(inAppMessageValidator).default([])
|
|
23579
23845
|
}).passthrough();
|
|
23846
|
+
var SHARE_LINK_ID_BYTES = 16;
|
|
23847
|
+
var SHARE_CONTENT_KEY_BYTES = 32;
|
|
23848
|
+
var SHARE_IV_BYTES = 12;
|
|
23849
|
+
var SHARE_TAG_BYTES = 16;
|
|
23850
|
+
var MAX_SHARE_CIPHERTEXT_BYTES = 512 * 1024;
|
|
23851
|
+
var MAX_SHARE_RECOVERY_JWE_BYTES = 64 * 1024;
|
|
23852
|
+
var MAX_SELECTED_CREDENTIALS = 50;
|
|
23853
|
+
var MAX_ENDORSEMENTS = 200;
|
|
23854
|
+
var MAX_VP_MEMBERS = MAX_SELECTED_CREDENTIALS + MAX_ENDORSEMENTS;
|
|
23855
|
+
var MAX_SHARE_SOURCE_URI_CHARS = 2048;
|
|
23856
|
+
var MAX_SHARE_LINK_REQUEST_BYTES = 1024 * 1024;
|
|
23857
|
+
var SHARE_LINK_PROTOCOL = "lc-share/v1";
|
|
23858
|
+
var SHARE_RECOVERY_PROTOCOL = "lc-share-recovery/v1";
|
|
23859
|
+
var BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
23860
|
+
var BASE64URL_LOOKUP = (() => {
|
|
23861
|
+
const table = new Int16Array(128).fill(-1);
|
|
23862
|
+
for (let index = 0; index < BASE64URL_ALPHABET.length; index += 1) {
|
|
23863
|
+
table[BASE64URL_ALPHABET.charCodeAt(index)] = index;
|
|
23864
|
+
}
|
|
23865
|
+
return table;
|
|
23866
|
+
})();
|
|
23867
|
+
var encodeBase64Url = /* @__PURE__ */ __name2((bytes) => {
|
|
23868
|
+
let output = "";
|
|
23869
|
+
for (let index = 0; index < bytes.length; index += 3) {
|
|
23870
|
+
const first = bytes[index];
|
|
23871
|
+
const second = bytes[index + 1];
|
|
23872
|
+
const third = bytes[index + 2];
|
|
23873
|
+
output += BASE64URL_ALPHABET[first >> 2];
|
|
23874
|
+
output += BASE64URL_ALPHABET[(first & 3) << 4 | (second ?? 0) >> 4];
|
|
23875
|
+
if (second === void 0) break;
|
|
23876
|
+
output += BASE64URL_ALPHABET[(second & 15) << 2 | (third ?? 0) >> 6];
|
|
23877
|
+
if (third === void 0) break;
|
|
23878
|
+
output += BASE64URL_ALPHABET[third & 63];
|
|
23879
|
+
}
|
|
23880
|
+
return output;
|
|
23881
|
+
}, "encodeBase64Url");
|
|
23882
|
+
var decodeBase64Url = /* @__PURE__ */ __name2((value) => {
|
|
23883
|
+
if (typeof value !== "string") return null;
|
|
23884
|
+
const output = new Uint8Array(Math.floor(value.length * 6 / 8));
|
|
23885
|
+
let bits = 0;
|
|
23886
|
+
let bitCount = 0;
|
|
23887
|
+
let outputIndex = 0;
|
|
23888
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
23889
|
+
const code = value.charCodeAt(index);
|
|
23890
|
+
const digit = code < 128 ? BASE64URL_LOOKUP[code] : -1;
|
|
23891
|
+
if (digit < 0) return null;
|
|
23892
|
+
bits = bits << 6 | digit;
|
|
23893
|
+
bitCount += 6;
|
|
23894
|
+
if (bitCount >= 8) {
|
|
23895
|
+
bitCount -= 8;
|
|
23896
|
+
output[outputIndex] = bits >> bitCount & 255;
|
|
23897
|
+
outputIndex += 1;
|
|
23898
|
+
}
|
|
23899
|
+
}
|
|
23900
|
+
return output;
|
|
23901
|
+
}, "decodeBase64Url");
|
|
23902
|
+
var isCanonicalBase64Url = /* @__PURE__ */ __name2((value, expectedBytes) => {
|
|
23903
|
+
if (typeof value !== "string") return false;
|
|
23904
|
+
if (expectedBytes !== void 0 && value.length !== Math.ceil(expectedBytes * 4 / 3))
|
|
23905
|
+
return false;
|
|
23906
|
+
const decoded = decodeBase64Url(value);
|
|
23907
|
+
if (decoded === null) return false;
|
|
23908
|
+
if (expectedBytes !== void 0 && decoded.length !== expectedBytes) return false;
|
|
23909
|
+
return encodeBase64Url(decoded) === value;
|
|
23910
|
+
}, "isCanonicalBase64Url");
|
|
23911
|
+
var decodedBase64UrlByteLength = /* @__PURE__ */ __name2((value) => decodeBase64Url(value)?.length ?? null, "decodedBase64UrlByteLength");
|
|
23912
|
+
var utf8ByteLength = /* @__PURE__ */ __name2((value) => new TextEncoder().encode(value).length, "utf8ByteLength");
|
|
23913
|
+
var canonicalBase64Url = /* @__PURE__ */ __name2((bytes) => external_exports.string().refine((value) => isCanonicalBase64Url(value, bytes), {
|
|
23914
|
+
message: `must be canonical base64url for exactly ${bytes} bytes`
|
|
23915
|
+
}), "canonicalBase64Url");
|
|
23916
|
+
var ShareLinkIdValidator = canonicalBase64Url(SHARE_LINK_ID_BYTES);
|
|
23917
|
+
var ShareContentKeyValidator = canonicalBase64Url(SHARE_CONTENT_KEY_BYTES);
|
|
23918
|
+
var ShareIvValidator = canonicalBase64Url(SHARE_IV_BYTES);
|
|
23919
|
+
var ShareCiphertextValidator = external_exports.string().refine(
|
|
23920
|
+
(value) => {
|
|
23921
|
+
if (value.length > Math.ceil(MAX_SHARE_CIPHERTEXT_BYTES * 4 / 3)) return false;
|
|
23922
|
+
const decoded = decodeBase64Url(value);
|
|
23923
|
+
if (decoded === null) return false;
|
|
23924
|
+
if (encodeBase64Url(decoded) !== value) return false;
|
|
23925
|
+
return decoded.length >= SHARE_TAG_BYTES && decoded.length <= MAX_SHARE_CIPHERTEXT_BYTES;
|
|
23926
|
+
},
|
|
23927
|
+
{
|
|
23928
|
+
message: `must be canonical base64url decoding to ${SHARE_TAG_BYTES}..${MAX_SHARE_CIPHERTEXT_BYTES} bytes`
|
|
23929
|
+
}
|
|
23930
|
+
);
|
|
23931
|
+
var ShareEnvelopeValidator = external_exports.object({
|
|
23932
|
+
v: external_exports.literal(1),
|
|
23933
|
+
alg: external_exports.literal("A256GCM"),
|
|
23934
|
+
iv: ShareIvValidator,
|
|
23935
|
+
ct: ShareCiphertextValidator
|
|
23936
|
+
}).strict();
|
|
23937
|
+
var safeVersion = external_exports.number().int().min(1).max(2 ** 31 - 1);
|
|
23938
|
+
var safeCredentialIndex = external_exports.number().int().min(0).max(MAX_VP_MEMBERS - 1);
|
|
23939
|
+
var ShareSelectionEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex }).strict();
|
|
23940
|
+
var ShareEndorsementEntryValidator = external_exports.object({ credentialIndex: safeCredentialIndex, targetCredentialIndex: safeCredentialIndex }).strict();
|
|
23941
|
+
var ShareSharerValidator = external_exports.object({
|
|
23942
|
+
profileId: external_exports.string().min(1).max(128),
|
|
23943
|
+
displayName: external_exports.string().min(1).max(120),
|
|
23944
|
+
avatar: external_exports.string().max(2048).optional()
|
|
23945
|
+
}).strict();
|
|
23946
|
+
var presentationShape = VPValidator.extend({
|
|
23947
|
+
verifiableCredential: VCValidator.array().min(1).max(MAX_VP_MEMBERS)
|
|
23948
|
+
});
|
|
23949
|
+
var hasBoundedPresentation = /* @__PURE__ */ __name2((value) => {
|
|
23950
|
+
let credentialCount = 0;
|
|
23951
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
23952
|
+
const visit = /* @__PURE__ */ __name2((node, depth) => {
|
|
23953
|
+
if (node === null || typeof node !== "object") return true;
|
|
23954
|
+
if (depth > 32 || ancestors.has(node)) return false;
|
|
23955
|
+
ancestors.add(node);
|
|
23956
|
+
try {
|
|
23957
|
+
for (const [key, child] of Object.entries(node)) {
|
|
23958
|
+
if (key === "verifiableCredential") {
|
|
23959
|
+
credentialCount += Array.isArray(child) ? child.length : 1;
|
|
23960
|
+
if (credentialCount > MAX_VP_MEMBERS) return false;
|
|
23961
|
+
}
|
|
23962
|
+
if (!visit(child, depth + 1)) return false;
|
|
23963
|
+
}
|
|
23964
|
+
return true;
|
|
23965
|
+
} finally {
|
|
23966
|
+
ancestors.delete(node);
|
|
23967
|
+
}
|
|
23968
|
+
}, "visit");
|
|
23969
|
+
return visit(value, 0);
|
|
23970
|
+
}, "hasBoundedPresentation");
|
|
23971
|
+
var ShareManifestPresentationValidator = external_exports.custom(
|
|
23972
|
+
(value) => hasBoundedPresentation(value) && presentationShape.safeParse(value).success,
|
|
23973
|
+
{ message: "invalid share presentation" }
|
|
23974
|
+
);
|
|
23975
|
+
var SharePayloadValidatorShape = external_exports.object({
|
|
23976
|
+
protocol: external_exports.literal(SHARE_LINK_PROTOCOL),
|
|
23977
|
+
shareId: ShareLinkIdValidator,
|
|
23978
|
+
contentVersion: safeVersion,
|
|
23979
|
+
createdAt: external_exports.iso.datetime(),
|
|
23980
|
+
sharer: ShareSharerValidator,
|
|
23981
|
+
presentation: ShareManifestPresentationValidator,
|
|
23982
|
+
selection: ShareSelectionEntryValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
23983
|
+
endorsements: ShareEndorsementEntryValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
23984
|
+
}).strict();
|
|
23985
|
+
var classificationFailure = /* @__PURE__ */ __name2((code, message, path = []) => ({ ok: false, code, message, path }), "classificationFailure");
|
|
23986
|
+
var readSignedClaimId = /* @__PURE__ */ __name2((member) => {
|
|
23987
|
+
if (member === null || typeof member !== "object") return void 0;
|
|
23988
|
+
const record2 = member;
|
|
23989
|
+
const claim = record2.credentialSubject ?? record2.endorsement;
|
|
23990
|
+
if (claim === null || typeof claim !== "object") return void 0;
|
|
23991
|
+
const claimRecord = claim;
|
|
23992
|
+
const nested = claimRecord.endorsement;
|
|
23993
|
+
const nestedId = nested !== null && typeof nested === "object" ? nested.id : void 0;
|
|
23994
|
+
return claimRecord.id ?? nestedId;
|
|
23995
|
+
}, "readSignedClaimId");
|
|
23996
|
+
var classifyShareManifest = /* @__PURE__ */ __name2((payload) => {
|
|
23997
|
+
const members = payload.presentation?.verifiableCredential;
|
|
23998
|
+
if (!Array.isArray(members) || members.length === 0) {
|
|
23999
|
+
return classificationFailure("NO_PRESENTATION_MEMBERS", "presentation has no credentials");
|
|
24000
|
+
}
|
|
24001
|
+
if (members.length > MAX_VP_MEMBERS) {
|
|
24002
|
+
return classificationFailure(
|
|
24003
|
+
"TOO_MANY_VP_MEMBERS",
|
|
24004
|
+
`presentation has ${members.length} members, over the ${MAX_VP_MEMBERS} bound`
|
|
24005
|
+
);
|
|
24006
|
+
}
|
|
24007
|
+
const selection = payload.selection;
|
|
24008
|
+
const endorsements = payload.endorsements ?? [];
|
|
24009
|
+
if (!Array.isArray(selection) || selection.length < 1 || selection.length > MAX_SELECTED_CREDENTIALS) {
|
|
24010
|
+
return classificationFailure("BAD_SELECTION", "selection must contain 1..50 entries");
|
|
24011
|
+
}
|
|
24012
|
+
if (!Array.isArray(endorsements) || endorsements.length > MAX_ENDORSEMENTS) {
|
|
24013
|
+
return classificationFailure(
|
|
24014
|
+
"BAD_ENDORSEMENTS",
|
|
24015
|
+
"endorsements must contain at most 200 entries"
|
|
24016
|
+
);
|
|
24017
|
+
}
|
|
24018
|
+
const selectedIndices = [];
|
|
24019
|
+
const selected = /* @__PURE__ */ new Set();
|
|
24020
|
+
for (let index = 0; index < selection.length; index += 1) {
|
|
24021
|
+
const entry = selection[index];
|
|
24022
|
+
const credentialIndex = entry?.credentialIndex;
|
|
24023
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
24024
|
+
return classificationFailure(
|
|
24025
|
+
"SELECTION_INDEX_OUT_OF_BOUNDS",
|
|
24026
|
+
`selection[${index}].credentialIndex is out of bounds`,
|
|
24027
|
+
["selection", index, "credentialIndex"]
|
|
24028
|
+
);
|
|
24029
|
+
}
|
|
24030
|
+
if (selected.has(credentialIndex)) {
|
|
24031
|
+
return classificationFailure(
|
|
24032
|
+
"SELECTION_INDEX_DUPLICATE",
|
|
24033
|
+
`selection[${index}].credentialIndex is duplicated`,
|
|
24034
|
+
["selection", index, "credentialIndex"]
|
|
24035
|
+
);
|
|
24036
|
+
}
|
|
24037
|
+
selected.add(credentialIndex);
|
|
24038
|
+
selectedIndices.push(credentialIndex);
|
|
24039
|
+
}
|
|
24040
|
+
const classified = new Set(selected);
|
|
24041
|
+
const endorsementIndices = [];
|
|
24042
|
+
for (let index = 0; index < endorsements.length; index += 1) {
|
|
24043
|
+
const entry = endorsements[index];
|
|
24044
|
+
const credentialIndex = entry?.credentialIndex;
|
|
24045
|
+
const targetIndex = entry?.targetCredentialIndex;
|
|
24046
|
+
if (!Number.isSafeInteger(credentialIndex) || credentialIndex < 0 || credentialIndex >= members.length) {
|
|
24047
|
+
return classificationFailure(
|
|
24048
|
+
"ENDORSEMENT_INDEX_OUT_OF_BOUNDS",
|
|
24049
|
+
`endorsements[${index}].credentialIndex is out of bounds`,
|
|
24050
|
+
["endorsements", index, "credentialIndex"]
|
|
24051
|
+
);
|
|
24052
|
+
}
|
|
24053
|
+
if (classified.has(credentialIndex)) {
|
|
24054
|
+
return classificationFailure(
|
|
24055
|
+
"VP_MEMBER_CLASSIFIED_TWICE",
|
|
24056
|
+
`endorsements[${index}].credentialIndex was already classified`,
|
|
24057
|
+
["endorsements", index, "credentialIndex"]
|
|
24058
|
+
);
|
|
24059
|
+
}
|
|
24060
|
+
if (!selected.has(targetIndex)) {
|
|
24061
|
+
return classificationFailure(
|
|
24062
|
+
"ENDORSEMENT_TARGET_NOT_SELECTED",
|
|
24063
|
+
`endorsements[${index}].targetCredentialIndex must reference a selected credential`,
|
|
24064
|
+
["endorsements", index, "targetCredentialIndex"]
|
|
24065
|
+
);
|
|
24066
|
+
}
|
|
24067
|
+
const referenced = readSignedClaimId(members[credentialIndex]);
|
|
24068
|
+
const target = members[targetIndex];
|
|
24069
|
+
const targetId = target !== null && typeof target === "object" ? target.id : void 0;
|
|
24070
|
+
if (typeof referenced !== "string" || typeof targetId !== "string" || referenced !== targetId) {
|
|
24071
|
+
return classificationFailure(
|
|
24072
|
+
"ENDORSEMENT_TARGET_UNBOUND",
|
|
24073
|
+
`endorsements[${index}] claim does not reference the target credential id`,
|
|
24074
|
+
["endorsements", index]
|
|
24075
|
+
);
|
|
24076
|
+
}
|
|
24077
|
+
classified.add(credentialIndex);
|
|
24078
|
+
endorsementIndices.push(credentialIndex);
|
|
24079
|
+
}
|
|
24080
|
+
if (classified.size !== members.length) {
|
|
24081
|
+
return classificationFailure(
|
|
24082
|
+
"UNCLASSIFIED_VP_MEMBER",
|
|
24083
|
+
"every presentation member must be classified exactly once",
|
|
24084
|
+
["presentation", "verifiableCredential"]
|
|
24085
|
+
);
|
|
24086
|
+
}
|
|
24087
|
+
return {
|
|
24088
|
+
ok: true,
|
|
24089
|
+
classification: { selectedIndices, endorsementIndices, memberCount: members.length }
|
|
24090
|
+
};
|
|
24091
|
+
}, "classifyShareManifest");
|
|
24092
|
+
var SharePayloadValidator = SharePayloadValidatorShape.superRefine((payload, ctx) => {
|
|
24093
|
+
const result = classifyShareManifest(payload);
|
|
24094
|
+
if (!result.ok) {
|
|
24095
|
+
ctx.addIssue({
|
|
24096
|
+
code: "custom",
|
|
24097
|
+
message: result.message,
|
|
24098
|
+
path: result.path,
|
|
24099
|
+
params: { shareLinkCode: result.code }
|
|
24100
|
+
});
|
|
24101
|
+
}
|
|
24102
|
+
});
|
|
24103
|
+
var ShareRecoverySelectionValidator = external_exports.object({
|
|
24104
|
+
ref: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS),
|
|
24105
|
+
order: external_exports.number().int().min(0).max(MAX_SELECTED_CREDENTIALS - 1)
|
|
24106
|
+
}).strict();
|
|
24107
|
+
var ShareRecoveryEndorsementValidator = external_exports.object({ targetRef: external_exports.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS) }).strict();
|
|
24108
|
+
var ShareRecoveryPlaintextValidator = external_exports.object({
|
|
24109
|
+
protocol: external_exports.literal(SHARE_RECOVERY_PROTOCOL),
|
|
24110
|
+
shareId: ShareLinkIdValidator,
|
|
24111
|
+
ownerProfileId: external_exports.string().min(1).max(128),
|
|
24112
|
+
createdAt: external_exports.iso.datetime(),
|
|
24113
|
+
latest: external_exports.object({ contentVersion: safeVersion, key: ShareContentKeyValidator }).strict(),
|
|
24114
|
+
selection: ShareRecoverySelectionValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24115
|
+
endorsements: ShareRecoveryEndorsementValidator.array().max(MAX_ENDORSEMENTS).default([])
|
|
24116
|
+
}).strict().superRefine((recovery, ctx) => {
|
|
24117
|
+
const orders = /* @__PURE__ */ new Set();
|
|
24118
|
+
recovery.selection.forEach((entry, index) => {
|
|
24119
|
+
if (entry.order >= recovery.selection.length) {
|
|
24120
|
+
ctx.addIssue({
|
|
24121
|
+
code: "custom",
|
|
24122
|
+
message: "order must be within the selection bounds",
|
|
24123
|
+
path: ["selection", index, "order"]
|
|
24124
|
+
});
|
|
24125
|
+
}
|
|
24126
|
+
if (orders.has(entry.order)) {
|
|
24127
|
+
ctx.addIssue({
|
|
24128
|
+
code: "custom",
|
|
24129
|
+
message: "order must be unique within the selection",
|
|
24130
|
+
path: ["selection", index, "order"]
|
|
24131
|
+
});
|
|
24132
|
+
}
|
|
24133
|
+
orders.add(entry.order);
|
|
24134
|
+
});
|
|
24135
|
+
});
|
|
24136
|
+
var ShareOwnerRecoveryValidator = JWEValidator.refine(
|
|
24137
|
+
(value) => utf8ByteLength(JSON.stringify(value)) <= MAX_SHARE_RECOVERY_JWE_BYTES,
|
|
24138
|
+
{ message: `serialized recovery JWE must be at most ${MAX_SHARE_RECOVERY_JWE_BYTES} bytes` }
|
|
24139
|
+
);
|
|
24140
|
+
var ShareLinkStatusValidator = external_exports.enum(["pending", "active", "stopped"]);
|
|
24141
|
+
var ShareContentStateValidator = external_exports.enum(["staging", "finalized", "content_missing"]);
|
|
24142
|
+
var ShareLinkValidator = external_exports.object({
|
|
24143
|
+
id: ShareLinkIdValidator,
|
|
24144
|
+
title: external_exports.string().min(1).max(120),
|
|
24145
|
+
note: external_exports.string().max(500).optional(),
|
|
24146
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24147
|
+
version: safeVersion,
|
|
24148
|
+
contentVersion: safeVersion,
|
|
24149
|
+
status: ShareLinkStatusValidator,
|
|
24150
|
+
attachmentId: external_exports.string().uuid().nullable().optional(),
|
|
24151
|
+
attachmentChunkCount: external_exports.number().int().min(1).max(16).nullable().optional(),
|
|
24152
|
+
contentState: ShareContentStateValidator,
|
|
24153
|
+
createdAt: external_exports.iso.datetime(),
|
|
24154
|
+
updatedAt: external_exports.iso.datetime(),
|
|
24155
|
+
expiresAt: external_exports.iso.datetime().nullable(),
|
|
24156
|
+
stoppedAt: external_exports.iso.datetime().nullable(),
|
|
24157
|
+
lastViewedAt: external_exports.iso.datetime().nullable(),
|
|
24158
|
+
viewCount: external_exports.number().int().min(0).optional(),
|
|
24159
|
+
passcodeProtected: external_exports.boolean(),
|
|
24160
|
+
notifyOnView: external_exports.boolean(),
|
|
24161
|
+
minorPolicy: external_exports.object({
|
|
24162
|
+
isMinor: external_exports.boolean().nullable(),
|
|
24163
|
+
policyResolved: external_exports.boolean(),
|
|
24164
|
+
defaultExpiryDays: external_exports.union([external_exports.literal(30), external_exports.literal(365)]),
|
|
24165
|
+
viewCountingEnabled: external_exports.boolean()
|
|
24166
|
+
}),
|
|
24167
|
+
/**
|
|
24168
|
+
* Guarded application/API URL for the content. Optional because owner APIs in
|
|
24169
|
+
* D1 have no public resolve/content endpoint yet; it must never be a
|
|
24170
|
+
* LearnCloud object URL or carry a fabricated decryption key.
|
|
24171
|
+
*/
|
|
24172
|
+
contentUrl: external_exports.string().optional()
|
|
24173
|
+
});
|
|
24174
|
+
var clientRequestId = external_exports.string().uuid();
|
|
24175
|
+
var ShareLinkAttachmentValidator = external_exports.object({
|
|
24176
|
+
id: external_exports.string().uuid(),
|
|
24177
|
+
chunkCount: external_exports.number().int().min(1).max(16)
|
|
24178
|
+
}).strict();
|
|
24179
|
+
var attachmentChunkKey = {
|
|
24180
|
+
id: ShareLinkIdValidator,
|
|
24181
|
+
contentVersion: safeVersion,
|
|
24182
|
+
attachmentId: external_exports.string().uuid(),
|
|
24183
|
+
chunkIndex: external_exports.number().int().min(0).max(15)
|
|
24184
|
+
};
|
|
24185
|
+
var ShareLinkAttachmentChunkEnvelopeValidator = ShareEnvelopeValidator.refine(
|
|
24186
|
+
(value) => (decodedBase64UrlByteLength(value.ct) ?? Infinity) <= 256 * 1024 + SHARE_TAG_BYTES
|
|
24187
|
+
);
|
|
24188
|
+
var PutShareLinkAttachmentChunkInputValidator = external_exports.object({
|
|
24189
|
+
...attachmentChunkKey,
|
|
24190
|
+
chunkCount: external_exports.number().int().min(1).max(16),
|
|
24191
|
+
envelope: ShareLinkAttachmentChunkEnvelopeValidator,
|
|
24192
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator
|
|
24193
|
+
}).strict().refine((value) => value.chunkIndex < value.chunkCount);
|
|
24194
|
+
var GetShareLinkAttachmentChunkInputValidator = external_exports.object({
|
|
24195
|
+
...attachmentChunkKey,
|
|
24196
|
+
passcode: external_exports.string().min(4).max(64).optional(),
|
|
24197
|
+
accessToken: external_exports.string().min(1).max(2048).optional()
|
|
24198
|
+
}).strict();
|
|
24199
|
+
var ShareLinkAttachmentChunkOutputValidator = external_exports.object({
|
|
24200
|
+
...attachmentChunkKey,
|
|
24201
|
+
envelope: ShareLinkAttachmentChunkEnvelopeValidator,
|
|
24202
|
+
accessToken: external_exports.string().min(1).max(2048).optional()
|
|
24203
|
+
}).strict();
|
|
24204
|
+
var DeleteShareLinkAttachmentChunksInputValidator = external_exports.object({
|
|
24205
|
+
id: ShareLinkIdValidator,
|
|
24206
|
+
contentVersion: safeVersion,
|
|
24207
|
+
attachmentId: external_exports.string().uuid(),
|
|
24208
|
+
chunkCount: external_exports.number().int().min(1).max(16)
|
|
24209
|
+
}).strict();
|
|
24210
|
+
var PutShareLinkAttachmentChunkOutputValidator = external_exports.object({ ok: external_exports.literal(true) }).strict();
|
|
24211
|
+
var DeleteShareLinkAttachmentChunksOutputValidator = external_exports.object({ ok: external_exports.boolean() }).strict();
|
|
24212
|
+
var CreateShareLinkInputValidator = external_exports.object({
|
|
24213
|
+
id: ShareLinkIdValidator,
|
|
24214
|
+
clientRequestId,
|
|
24215
|
+
title: external_exports.string().min(1).max(120),
|
|
24216
|
+
note: external_exports.string().max(500).optional(),
|
|
24217
|
+
expiresAt: external_exports.iso.datetime().nullable().optional(),
|
|
24218
|
+
passcode: external_exports.string().min(8).max(64).optional(),
|
|
24219
|
+
notifyOnView: external_exports.boolean().default(false),
|
|
24220
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24221
|
+
contentVersion: external_exports.literal(1),
|
|
24222
|
+
envelope: ShareEnvelopeValidator,
|
|
24223
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator,
|
|
24224
|
+
attachment: ShareLinkAttachmentValidator.optional()
|
|
24225
|
+
}).strict();
|
|
24226
|
+
var UpdateShareLinkInputValidator = external_exports.object({
|
|
24227
|
+
id: ShareLinkIdValidator,
|
|
24228
|
+
expectedVersion: safeVersion,
|
|
24229
|
+
clientRequestId,
|
|
24230
|
+
title: external_exports.string().min(1).max(120).optional(),
|
|
24231
|
+
note: external_exports.string().max(500).nullable().optional(),
|
|
24232
|
+
expiresAt: external_exports.iso.datetime().nullable().optional(),
|
|
24233
|
+
/** Omitted preserves the current passcode, null removes it, and a string replaces it. */
|
|
24234
|
+
passcode: external_exports.string().min(8).max(64).nullable().optional(),
|
|
24235
|
+
notifyOnView: external_exports.boolean().optional(),
|
|
24236
|
+
contentVersion: safeVersion.optional(),
|
|
24237
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS).optional(),
|
|
24238
|
+
envelope: ShareEnvelopeValidator.optional(),
|
|
24239
|
+
ownerEncryptedRecovery: ShareOwnerRecoveryValidator.optional(),
|
|
24240
|
+
attachment: ShareLinkAttachmentValidator.optional()
|
|
24241
|
+
}).strict().superRefine((value, ctx) => {
|
|
24242
|
+
const provided = [
|
|
24243
|
+
value.contentVersion,
|
|
24244
|
+
value.selectedCount,
|
|
24245
|
+
value.envelope,
|
|
24246
|
+
value.ownerEncryptedRecovery
|
|
24247
|
+
].filter((field) => field !== void 0).length;
|
|
24248
|
+
if (provided !== 0 && provided !== 4) {
|
|
24249
|
+
ctx.addIssue({
|
|
24250
|
+
code: "custom",
|
|
24251
|
+
message: "content replacement requires contentVersion, selectedCount, envelope and ownerEncryptedRecovery together"
|
|
24252
|
+
});
|
|
24253
|
+
}
|
|
24254
|
+
if (value.attachment !== void 0 && provided !== 4) {
|
|
24255
|
+
ctx.addIssue({ code: "custom", message: "attachment requires a content replacement" });
|
|
24256
|
+
}
|
|
24257
|
+
});
|
|
24258
|
+
var ShareLinkIdInputValidator = external_exports.object({ id: ShareLinkIdValidator }).strict();
|
|
24259
|
+
var ShareLinkOperationKeyInputValidator = external_exports.object({ id: ShareLinkIdValidator, operationId: external_exports.string().uuid() }).strict();
|
|
24260
|
+
var ShareLinkOwnerCommitOutputValidator = external_exports.discriminatedUnion("status", [
|
|
24261
|
+
external_exports.object({ status: external_exports.literal("completed"), share: ShareLinkValidator }).strict(),
|
|
24262
|
+
external_exports.object({
|
|
24263
|
+
status: external_exports.literal("pending"),
|
|
24264
|
+
id: ShareLinkIdValidator,
|
|
24265
|
+
operationId: external_exports.string().uuid()
|
|
24266
|
+
}).strict()
|
|
24267
|
+
]);
|
|
24268
|
+
var ShareLinkOwnerStatusOutputValidator = external_exports.discriminatedUnion("status", [
|
|
24269
|
+
external_exports.object({ status: external_exports.literal("found"), share: ShareLinkValidator }).strict(),
|
|
24270
|
+
external_exports.object({
|
|
24271
|
+
status: external_exports.literal("pending"),
|
|
24272
|
+
id: ShareLinkIdValidator,
|
|
24273
|
+
operationId: external_exports.string().uuid()
|
|
24274
|
+
}).strict(),
|
|
24275
|
+
external_exports.object({ status: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
24276
|
+
]);
|
|
24277
|
+
var ShareLinkOwnerRecoveryOutputValidator = external_exports.object({ recovery: ShareOwnerRecoveryValidator }).strict();
|
|
24278
|
+
var ShareLinkOwnerContentOutputValidator = external_exports.object({
|
|
24279
|
+
id: ShareLinkIdValidator,
|
|
24280
|
+
contentVersion: safeVersion,
|
|
24281
|
+
envelope: ShareEnvelopeValidator
|
|
24282
|
+
}).strict();
|
|
24283
|
+
var ResolveShareLinkInputValidator = external_exports.object({
|
|
24284
|
+
id: ShareLinkIdValidator,
|
|
24285
|
+
/** Sent only in a POST body; it must never be placed in a share URL. */
|
|
24286
|
+
passcode: external_exports.string().min(4).max(64).optional()
|
|
24287
|
+
}).strict();
|
|
24288
|
+
var ShareLinkPublicStateValidator = external_exports.discriminatedUnion("state", [
|
|
24289
|
+
external_exports.object({
|
|
24290
|
+
state: external_exports.literal("passcode_required"),
|
|
24291
|
+
id: ShareLinkIdValidator
|
|
24292
|
+
}).strict(),
|
|
24293
|
+
external_exports.object({ state: external_exports.literal("try_later"), id: ShareLinkIdValidator }).strict(),
|
|
24294
|
+
external_exports.object({
|
|
24295
|
+
state: external_exports.literal("active"),
|
|
24296
|
+
id: ShareLinkIdValidator,
|
|
24297
|
+
title: external_exports.string().max(120),
|
|
24298
|
+
note: external_exports.string().max(500).optional(),
|
|
24299
|
+
selectedCount: external_exports.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),
|
|
24300
|
+
contentVersion: safeVersion,
|
|
24301
|
+
contentUrl: external_exports.string(),
|
|
24302
|
+
sharer: external_exports.object({
|
|
24303
|
+
displayName: external_exports.string().max(120),
|
|
24304
|
+
avatar: external_exports.string().max(2048).optional()
|
|
24305
|
+
}),
|
|
24306
|
+
createdAt: external_exports.iso.datetime(),
|
|
24307
|
+
updatedAt: external_exports.iso.datetime(),
|
|
24308
|
+
expiresAt: external_exports.iso.datetime().nullable()
|
|
24309
|
+
}).strict(),
|
|
24310
|
+
external_exports.object({
|
|
24311
|
+
state: external_exports.literal("expired"),
|
|
24312
|
+
id: ShareLinkIdValidator,
|
|
24313
|
+
expiresAt: external_exports.iso.datetime()
|
|
24314
|
+
}).strict(),
|
|
24315
|
+
external_exports.object({
|
|
24316
|
+
state: external_exports.literal("stopped"),
|
|
24317
|
+
id: ShareLinkIdValidator,
|
|
24318
|
+
stoppedAt: external_exports.iso.datetime()
|
|
24319
|
+
}).strict(),
|
|
24320
|
+
external_exports.object({ state: external_exports.literal("not_found"), id: ShareLinkIdValidator }).strict()
|
|
24321
|
+
]);
|
|
24322
|
+
var ListShareLinksInputValidator = external_exports.object({
|
|
24323
|
+
limit: external_exports.number().int().min(1).max(50).default(25),
|
|
24324
|
+
cursor: external_exports.string().max(512).optional()
|
|
24325
|
+
}).strict();
|
|
24326
|
+
var PaginatedShareLinksValidator = PaginationResponseValidator.extend({
|
|
24327
|
+
records: ShareLinkValidator.array()
|
|
24328
|
+
});
|
|
24329
|
+
var AcknowledgeViewInputValidator = external_exports.object({
|
|
24330
|
+
receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
24331
|
+
}).strict();
|
|
24332
|
+
var AcknowledgeViewOutputValidator = external_exports.object({ ok: external_exports.literal(true) }).strict();
|
|
24333
|
+
var SHARE_VIEW_RECEIPT_TTL_SECONDS = 10 * 60;
|
|
24334
|
+
var ShareLinkPublicContentViewValidator = external_exports.object({
|
|
24335
|
+
id: ShareLinkIdValidator,
|
|
24336
|
+
contentVersion: safeVersion,
|
|
24337
|
+
envelope: ShareEnvelopeValidator,
|
|
24338
|
+
contentUrl: external_exports.string(),
|
|
24339
|
+
receipt: external_exports.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
24340
|
+
}).strict();
|
|
23580
24341
|
|
|
23581
24342
|
// src/helpers.ts
|
|
23582
24343
|
var import_json_stringify_deterministic = __toESM(require_lib(), 1);
|