@learncard/helpers 1.3.12 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Utilities.d.ts +59 -0
- package/dist/Utilities.d.ts.map +1 -0
- package/dist/app-install/index.d.ts +62 -0
- package/dist/app-install/index.d.ts.map +1 -0
- package/dist/arrays/index.d.ts +3 -0
- package/dist/arrays/index.d.ts.map +1 -0
- package/dist/bitstring-status-list/index.d.ts +8 -0
- package/dist/bitstring-status-list/index.d.ts.map +1 -0
- package/dist/credential-format.d.ts +96 -0
- package/dist/credential-format.d.ts.map +1 -0
- package/dist/did.d.ts +3 -0
- package/dist/did.d.ts.map +1 -0
- package/dist/environment.d.ts +32 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/helpers.cjs.development.cjs +1648 -1540
- package/dist/helpers.cjs.development.cjs.map +4 -4
- package/dist/helpers.cjs.production.min.cjs +15 -11
- package/dist/helpers.cjs.production.min.cjs.map +4 -4
- package/dist/helpers.esm.js +172 -80
- package/dist/helpers.esm.js.map +4 -4
- package/dist/images/discord.helpers.d.ts +65 -0
- package/dist/images/discord.helpers.d.ts.map +1 -0
- package/dist/images/filestack.helpers.d.ts +92 -0
- package/dist/images/filestack.helpers.d.ts.map +1 -0
- package/dist/images/images.helpers.d.ts +32 -0
- package/dist/images/images.helpers.d.ts.map +1 -0
- package/dist/images/index.d.ts +2 -0
- package/dist/images/index.d.ts.map +1 -0
- package/dist/images/unsplash.helpers.d.ts +64 -0
- package/dist/images/unsplash.helpers.d.ts.map +1 -0
- package/dist/images/url.helpers.d.ts +14 -0
- package/dist/images/url.helpers.d.ts.map +1 -0
- package/dist/index.d.cts +43 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/numbers/index.d.ts +5 -0
- package/dist/numbers/index.d.ts.map +1 -0
- package/dist/state.d.ts +130 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/strings/index.d.ts +2 -0
- package/dist/strings/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +12 -17
- package/src/credential-format.ts +5 -4
- package/src/environment.ts +75 -0
- package/src/index.ts +11 -10
- package/dist/helpers.d.cts +0 -979
- package/dist/helpers.d.ts +0 -979
package/dist/helpers.esm.js
CHANGED
|
@@ -195,6 +195,12 @@ var require_types_cjs_development = __commonJS({
|
|
|
195
195
|
LCNBoostClaimLinkSigningAuthorityValidator: /* @__PURE__ */ __name(() => LCNBoostClaimLinkSigningAuthorityValidator, "LCNBoostClaimLinkSigningAuthorityValidator"),
|
|
196
196
|
LCNBoostStatus: /* @__PURE__ */ __name(() => LCNBoostStatus, "LCNBoostStatus"),
|
|
197
197
|
LCNConnectionProfileValidator: /* @__PURE__ */ __name(() => LCNConnectionProfileValidator, "LCNConnectionProfileValidator"),
|
|
198
|
+
LCNConnectionPromptActionResultValidator: /* @__PURE__ */ __name(() => LCNConnectionPromptActionResultValidator, "LCNConnectionPromptActionResultValidator"),
|
|
199
|
+
LCNConnectionPromptActionStatusValidator: /* @__PURE__ */ __name(() => LCNConnectionPromptActionStatusValidator, "LCNConnectionPromptActionStatusValidator"),
|
|
200
|
+
LCNConnectionPromptMetadataValidator: /* @__PURE__ */ __name(() => LCNConnectionPromptMetadataValidator, "LCNConnectionPromptMetadataValidator"),
|
|
201
|
+
LCNConnectionPromptStatusValidator: /* @__PURE__ */ __name(() => LCNConnectionPromptStatusValidator, "LCNConnectionPromptStatusValidator"),
|
|
202
|
+
LCNConnectionPromptSurfaceValidator: /* @__PURE__ */ __name(() => LCNConnectionPromptSurfaceValidator, "LCNConnectionPromptSurfaceValidator"),
|
|
203
|
+
LCNConnectionPromptValidator: /* @__PURE__ */ __name(() => LCNConnectionPromptValidator, "LCNConnectionPromptValidator"),
|
|
198
204
|
LCNDomainOrOriginValidator: /* @__PURE__ */ __name(() => LCNDomainOrOriginValidator, "LCNDomainOrOriginValidator"),
|
|
199
205
|
LCNInboxContactMethodValidator: /* @__PURE__ */ __name(() => LCNInboxContactMethodValidator, "LCNInboxContactMethodValidator"),
|
|
200
206
|
LCNInboxStatusEnumValidator: /* @__PURE__ */ __name(() => LCNInboxStatusEnumValidator, "LCNInboxStatusEnumValidator"),
|
|
@@ -206,6 +212,7 @@ var require_types_cjs_development = __commonJS({
|
|
|
206
212
|
LCNNotificationDataValidator: /* @__PURE__ */ __name(() => LCNNotificationDataValidator, "LCNNotificationDataValidator"),
|
|
207
213
|
LCNNotificationInboxValidator: /* @__PURE__ */ __name(() => LCNNotificationInboxValidator, "LCNNotificationInboxValidator"),
|
|
208
214
|
LCNNotificationMessageValidator: /* @__PURE__ */ __name(() => LCNNotificationMessageValidator, "LCNNotificationMessageValidator"),
|
|
215
|
+
LCNNotificationMetadataValidator: /* @__PURE__ */ __name(() => LCNNotificationMetadataValidator, "LCNNotificationMetadataValidator"),
|
|
209
216
|
LCNNotificationTypeEnumValidator: /* @__PURE__ */ __name(() => LCNNotificationTypeEnumValidator, "LCNNotificationTypeEnumValidator"),
|
|
210
217
|
LCNNotificationValidator: /* @__PURE__ */ __name(() => LCNNotificationValidator, "LCNNotificationValidator"),
|
|
211
218
|
LCNProfileConnectionStatusEnum: /* @__PURE__ */ __name(() => LCNProfileConnectionStatusEnum, "LCNProfileConnectionStatusEnum"),
|
|
@@ -15072,7 +15079,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15072
15079
|
var ZodFirstPartyTypeKind;
|
|
15073
15080
|
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
15074
15081
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
15075
|
-
var
|
|
15082
|
+
var z3 = {
|
|
15076
15083
|
...schemas_exports2,
|
|
15077
15084
|
...checks_exports2,
|
|
15078
15085
|
iso: iso_exports
|
|
@@ -15186,7 +15193,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15186
15193
|
function convertBaseSchema(schema, ctx) {
|
|
15187
15194
|
if (schema.not !== void 0) {
|
|
15188
15195
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
15189
|
-
return
|
|
15196
|
+
return z3.never();
|
|
15190
15197
|
}
|
|
15191
15198
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
15192
15199
|
}
|
|
@@ -15208,7 +15215,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15208
15215
|
return ctx.refs.get(refPath);
|
|
15209
15216
|
}
|
|
15210
15217
|
if (ctx.processing.has(refPath)) {
|
|
15211
|
-
return
|
|
15218
|
+
return z3.lazy(() => {
|
|
15212
15219
|
if (!ctx.refs.has(refPath)) {
|
|
15213
15220
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
15214
15221
|
}
|
|
@@ -15225,25 +15232,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15225
15232
|
if (schema.enum !== void 0) {
|
|
15226
15233
|
const enumValues = schema.enum;
|
|
15227
15234
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
15228
|
-
return
|
|
15235
|
+
return z3.null();
|
|
15229
15236
|
}
|
|
15230
15237
|
if (enumValues.length === 0) {
|
|
15231
|
-
return
|
|
15238
|
+
return z3.never();
|
|
15232
15239
|
}
|
|
15233
15240
|
if (enumValues.length === 1) {
|
|
15234
|
-
return
|
|
15241
|
+
return z3.literal(enumValues[0]);
|
|
15235
15242
|
}
|
|
15236
15243
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
15237
|
-
return
|
|
15244
|
+
return z3.enum(enumValues);
|
|
15238
15245
|
}
|
|
15239
|
-
const literalSchemas = enumValues.map((v) =>
|
|
15246
|
+
const literalSchemas = enumValues.map((v) => z3.literal(v));
|
|
15240
15247
|
if (literalSchemas.length < 2) {
|
|
15241
15248
|
return literalSchemas[0];
|
|
15242
15249
|
}
|
|
15243
|
-
return
|
|
15250
|
+
return z3.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
15244
15251
|
}
|
|
15245
15252
|
if (schema.const !== void 0) {
|
|
15246
|
-
return
|
|
15253
|
+
return z3.literal(schema.const);
|
|
15247
15254
|
}
|
|
15248
15255
|
const type = schema.type;
|
|
15249
15256
|
if (Array.isArray(type)) {
|
|
@@ -15252,68 +15259,68 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15252
15259
|
return convertBaseSchema(typeSchema, ctx);
|
|
15253
15260
|
});
|
|
15254
15261
|
if (typeSchemas.length === 0) {
|
|
15255
|
-
return
|
|
15262
|
+
return z3.never();
|
|
15256
15263
|
}
|
|
15257
15264
|
if (typeSchemas.length === 1) {
|
|
15258
15265
|
return typeSchemas[0];
|
|
15259
15266
|
}
|
|
15260
|
-
return
|
|
15267
|
+
return z3.union(typeSchemas);
|
|
15261
15268
|
}
|
|
15262
15269
|
if (!type) {
|
|
15263
|
-
return
|
|
15270
|
+
return z3.any();
|
|
15264
15271
|
}
|
|
15265
15272
|
let zodSchema;
|
|
15266
15273
|
switch (type) {
|
|
15267
15274
|
case "string": {
|
|
15268
|
-
let stringSchema =
|
|
15275
|
+
let stringSchema = z3.string();
|
|
15269
15276
|
if (schema.format) {
|
|
15270
15277
|
const format = schema.format;
|
|
15271
15278
|
if (format === "email") {
|
|
15272
|
-
stringSchema = stringSchema.check(
|
|
15279
|
+
stringSchema = stringSchema.check(z3.email());
|
|
15273
15280
|
} else if (format === "uri" || format === "uri-reference") {
|
|
15274
|
-
stringSchema = stringSchema.check(
|
|
15281
|
+
stringSchema = stringSchema.check(z3.url());
|
|
15275
15282
|
} else if (format === "uuid" || format === "guid") {
|
|
15276
|
-
stringSchema = stringSchema.check(
|
|
15283
|
+
stringSchema = stringSchema.check(z3.uuid());
|
|
15277
15284
|
} else if (format === "date-time") {
|
|
15278
|
-
stringSchema = stringSchema.check(
|
|
15285
|
+
stringSchema = stringSchema.check(z3.iso.datetime());
|
|
15279
15286
|
} else if (format === "date") {
|
|
15280
|
-
stringSchema = stringSchema.check(
|
|
15287
|
+
stringSchema = stringSchema.check(z3.iso.date());
|
|
15281
15288
|
} else if (format === "time") {
|
|
15282
|
-
stringSchema = stringSchema.check(
|
|
15289
|
+
stringSchema = stringSchema.check(z3.iso.time());
|
|
15283
15290
|
} else if (format === "duration") {
|
|
15284
|
-
stringSchema = stringSchema.check(
|
|
15291
|
+
stringSchema = stringSchema.check(z3.iso.duration());
|
|
15285
15292
|
} else if (format === "ipv4") {
|
|
15286
|
-
stringSchema = stringSchema.check(
|
|
15293
|
+
stringSchema = stringSchema.check(z3.ipv4());
|
|
15287
15294
|
} else if (format === "ipv6") {
|
|
15288
|
-
stringSchema = stringSchema.check(
|
|
15295
|
+
stringSchema = stringSchema.check(z3.ipv6());
|
|
15289
15296
|
} else if (format === "mac") {
|
|
15290
|
-
stringSchema = stringSchema.check(
|
|
15297
|
+
stringSchema = stringSchema.check(z3.mac());
|
|
15291
15298
|
} else if (format === "cidr") {
|
|
15292
|
-
stringSchema = stringSchema.check(
|
|
15299
|
+
stringSchema = stringSchema.check(z3.cidrv4());
|
|
15293
15300
|
} else if (format === "cidr-v6") {
|
|
15294
|
-
stringSchema = stringSchema.check(
|
|
15301
|
+
stringSchema = stringSchema.check(z3.cidrv6());
|
|
15295
15302
|
} else if (format === "base64") {
|
|
15296
|
-
stringSchema = stringSchema.check(
|
|
15303
|
+
stringSchema = stringSchema.check(z3.base64());
|
|
15297
15304
|
} else if (format === "base64url") {
|
|
15298
|
-
stringSchema = stringSchema.check(
|
|
15305
|
+
stringSchema = stringSchema.check(z3.base64url());
|
|
15299
15306
|
} else if (format === "e164") {
|
|
15300
|
-
stringSchema = stringSchema.check(
|
|
15307
|
+
stringSchema = stringSchema.check(z3.e164());
|
|
15301
15308
|
} else if (format === "jwt") {
|
|
15302
|
-
stringSchema = stringSchema.check(
|
|
15309
|
+
stringSchema = stringSchema.check(z3.jwt());
|
|
15303
15310
|
} else if (format === "emoji") {
|
|
15304
|
-
stringSchema = stringSchema.check(
|
|
15311
|
+
stringSchema = stringSchema.check(z3.emoji());
|
|
15305
15312
|
} else if (format === "nanoid") {
|
|
15306
|
-
stringSchema = stringSchema.check(
|
|
15313
|
+
stringSchema = stringSchema.check(z3.nanoid());
|
|
15307
15314
|
} else if (format === "cuid") {
|
|
15308
|
-
stringSchema = stringSchema.check(
|
|
15315
|
+
stringSchema = stringSchema.check(z3.cuid());
|
|
15309
15316
|
} else if (format === "cuid2") {
|
|
15310
|
-
stringSchema = stringSchema.check(
|
|
15317
|
+
stringSchema = stringSchema.check(z3.cuid2());
|
|
15311
15318
|
} else if (format === "ulid") {
|
|
15312
|
-
stringSchema = stringSchema.check(
|
|
15319
|
+
stringSchema = stringSchema.check(z3.ulid());
|
|
15313
15320
|
} else if (format === "xid") {
|
|
15314
|
-
stringSchema = stringSchema.check(
|
|
15321
|
+
stringSchema = stringSchema.check(z3.xid());
|
|
15315
15322
|
} else if (format === "ksuid") {
|
|
15316
|
-
stringSchema = stringSchema.check(
|
|
15323
|
+
stringSchema = stringSchema.check(z3.ksuid());
|
|
15317
15324
|
}
|
|
15318
15325
|
}
|
|
15319
15326
|
if (typeof schema.minLength === "number") {
|
|
@@ -15330,7 +15337,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15330
15337
|
}
|
|
15331
15338
|
case "number":
|
|
15332
15339
|
case "integer": {
|
|
15333
|
-
let numberSchema = type === "integer" ?
|
|
15340
|
+
let numberSchema = type === "integer" ? z3.number().int() : z3.number();
|
|
15334
15341
|
if (typeof schema.minimum === "number") {
|
|
15335
15342
|
numberSchema = numberSchema.min(schema.minimum);
|
|
15336
15343
|
}
|
|
@@ -15354,11 +15361,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15354
15361
|
break;
|
|
15355
15362
|
}
|
|
15356
15363
|
case "boolean": {
|
|
15357
|
-
zodSchema =
|
|
15364
|
+
zodSchema = z3.boolean();
|
|
15358
15365
|
break;
|
|
15359
15366
|
}
|
|
15360
15367
|
case "null": {
|
|
15361
|
-
zodSchema =
|
|
15368
|
+
zodSchema = z3.null();
|
|
15362
15369
|
break;
|
|
15363
15370
|
}
|
|
15364
15371
|
case "object": {
|
|
@@ -15371,14 +15378,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15371
15378
|
}
|
|
15372
15379
|
if (schema.propertyNames) {
|
|
15373
15380
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
15374
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
15381
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z3.any();
|
|
15375
15382
|
if (Object.keys(shape).length === 0) {
|
|
15376
|
-
zodSchema =
|
|
15383
|
+
zodSchema = z3.record(keySchema, valueSchema);
|
|
15377
15384
|
break;
|
|
15378
15385
|
}
|
|
15379
|
-
const objectSchema2 =
|
|
15380
|
-
const recordSchema =
|
|
15381
|
-
zodSchema =
|
|
15386
|
+
const objectSchema2 = z3.object(shape).passthrough();
|
|
15387
|
+
const recordSchema = z3.looseRecord(keySchema, valueSchema);
|
|
15388
|
+
zodSchema = z3.intersection(objectSchema2, recordSchema);
|
|
15382
15389
|
break;
|
|
15383
15390
|
}
|
|
15384
15391
|
if (schema.patternProperties) {
|
|
@@ -15387,28 +15394,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15387
15394
|
const looseRecords = [];
|
|
15388
15395
|
for (const pattern of patternKeys) {
|
|
15389
15396
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
15390
|
-
const keySchema =
|
|
15391
|
-
looseRecords.push(
|
|
15397
|
+
const keySchema = z3.string().regex(new RegExp(pattern));
|
|
15398
|
+
looseRecords.push(z3.looseRecord(keySchema, patternValue));
|
|
15392
15399
|
}
|
|
15393
15400
|
const schemasToIntersect = [];
|
|
15394
15401
|
if (Object.keys(shape).length > 0) {
|
|
15395
|
-
schemasToIntersect.push(
|
|
15402
|
+
schemasToIntersect.push(z3.object(shape).passthrough());
|
|
15396
15403
|
}
|
|
15397
15404
|
schemasToIntersect.push(...looseRecords);
|
|
15398
15405
|
if (schemasToIntersect.length === 0) {
|
|
15399
|
-
zodSchema =
|
|
15406
|
+
zodSchema = z3.object({}).passthrough();
|
|
15400
15407
|
} else if (schemasToIntersect.length === 1) {
|
|
15401
15408
|
zodSchema = schemasToIntersect[0];
|
|
15402
15409
|
} else {
|
|
15403
|
-
let result =
|
|
15410
|
+
let result = z3.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
15404
15411
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
15405
|
-
result =
|
|
15412
|
+
result = z3.intersection(result, schemasToIntersect[i]);
|
|
15406
15413
|
}
|
|
15407
15414
|
zodSchema = result;
|
|
15408
15415
|
}
|
|
15409
15416
|
break;
|
|
15410
15417
|
}
|
|
15411
|
-
const objectSchema =
|
|
15418
|
+
const objectSchema = z3.object(shape);
|
|
15412
15419
|
if (schema.additionalProperties === false) {
|
|
15413
15420
|
zodSchema = objectSchema.strict();
|
|
15414
15421
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -15425,33 +15432,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15425
15432
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
15426
15433
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
15427
15434
|
if (rest) {
|
|
15428
|
-
zodSchema =
|
|
15435
|
+
zodSchema = z3.tuple(tupleItems).rest(rest);
|
|
15429
15436
|
} else {
|
|
15430
|
-
zodSchema =
|
|
15437
|
+
zodSchema = z3.tuple(tupleItems);
|
|
15431
15438
|
}
|
|
15432
15439
|
if (typeof schema.minItems === "number") {
|
|
15433
|
-
zodSchema = zodSchema.check(
|
|
15440
|
+
zodSchema = zodSchema.check(z3.minLength(schema.minItems));
|
|
15434
15441
|
}
|
|
15435
15442
|
if (typeof schema.maxItems === "number") {
|
|
15436
|
-
zodSchema = zodSchema.check(
|
|
15443
|
+
zodSchema = zodSchema.check(z3.maxLength(schema.maxItems));
|
|
15437
15444
|
}
|
|
15438
15445
|
} else if (Array.isArray(items)) {
|
|
15439
15446
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
15440
15447
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
15441
15448
|
if (rest) {
|
|
15442
|
-
zodSchema =
|
|
15449
|
+
zodSchema = z3.tuple(tupleItems).rest(rest);
|
|
15443
15450
|
} else {
|
|
15444
|
-
zodSchema =
|
|
15451
|
+
zodSchema = z3.tuple(tupleItems);
|
|
15445
15452
|
}
|
|
15446
15453
|
if (typeof schema.minItems === "number") {
|
|
15447
|
-
zodSchema = zodSchema.check(
|
|
15454
|
+
zodSchema = zodSchema.check(z3.minLength(schema.minItems));
|
|
15448
15455
|
}
|
|
15449
15456
|
if (typeof schema.maxItems === "number") {
|
|
15450
|
-
zodSchema = zodSchema.check(
|
|
15457
|
+
zodSchema = zodSchema.check(z3.maxLength(schema.maxItems));
|
|
15451
15458
|
}
|
|
15452
15459
|
} else if (items !== void 0) {
|
|
15453
15460
|
const element = convertSchema(items, ctx);
|
|
15454
|
-
let arraySchema =
|
|
15461
|
+
let arraySchema = z3.array(element);
|
|
15455
15462
|
if (typeof schema.minItems === "number") {
|
|
15456
15463
|
arraySchema = arraySchema.min(schema.minItems);
|
|
15457
15464
|
}
|
|
@@ -15460,7 +15467,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15460
15467
|
}
|
|
15461
15468
|
zodSchema = arraySchema;
|
|
15462
15469
|
} else {
|
|
15463
|
-
zodSchema =
|
|
15470
|
+
zodSchema = z3.array(z3.any());
|
|
15464
15471
|
}
|
|
15465
15472
|
break;
|
|
15466
15473
|
}
|
|
@@ -15473,37 +15480,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15473
15480
|
__name2(convertBaseSchema, "convertBaseSchema");
|
|
15474
15481
|
function convertSchema(schema, ctx) {
|
|
15475
15482
|
if (typeof schema === "boolean") {
|
|
15476
|
-
return schema ?
|
|
15483
|
+
return schema ? z3.any() : z3.never();
|
|
15477
15484
|
}
|
|
15478
15485
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
15479
15486
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
15480
15487
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
15481
15488
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
15482
|
-
const anyOfUnion =
|
|
15483
|
-
baseSchema = hasExplicitType ?
|
|
15489
|
+
const anyOfUnion = z3.union(options);
|
|
15490
|
+
baseSchema = hasExplicitType ? z3.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
15484
15491
|
}
|
|
15485
15492
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
15486
15493
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
15487
|
-
const oneOfUnion =
|
|
15488
|
-
baseSchema = hasExplicitType ?
|
|
15494
|
+
const oneOfUnion = z3.xor(options);
|
|
15495
|
+
baseSchema = hasExplicitType ? z3.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
15489
15496
|
}
|
|
15490
15497
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
15491
15498
|
if (schema.allOf.length === 0) {
|
|
15492
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
15499
|
+
baseSchema = hasExplicitType ? baseSchema : z3.any();
|
|
15493
15500
|
} else {
|
|
15494
15501
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
15495
15502
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
15496
15503
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
15497
|
-
result =
|
|
15504
|
+
result = z3.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
15498
15505
|
}
|
|
15499
15506
|
baseSchema = result;
|
|
15500
15507
|
}
|
|
15501
15508
|
}
|
|
15502
15509
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
15503
|
-
baseSchema =
|
|
15510
|
+
baseSchema = z3.nullable(baseSchema);
|
|
15504
15511
|
}
|
|
15505
15512
|
if (schema.readOnly === true) {
|
|
15506
|
-
baseSchema =
|
|
15513
|
+
baseSchema = z3.readonly(baseSchema);
|
|
15507
15514
|
}
|
|
15508
15515
|
if (schema.default !== void 0) {
|
|
15509
15516
|
baseSchema = baseSchema.default(schema.default);
|
|
@@ -15538,7 +15545,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15538
15545
|
__name2(convertSchema, "convertSchema");
|
|
15539
15546
|
function fromJSONSchema(schema, params) {
|
|
15540
15547
|
if (typeof schema === "boolean") {
|
|
15541
|
-
return schema ?
|
|
15548
|
+
return schema ? z3.any() : z3.never();
|
|
15542
15549
|
}
|
|
15543
15550
|
let normalized;
|
|
15544
15551
|
try {
|
|
@@ -16230,6 +16237,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16230
16237
|
isServiceProfile: true,
|
|
16231
16238
|
display: true
|
|
16232
16239
|
});
|
|
16240
|
+
var LCNConnectionPromptStatusValidator = external_exports.enum(["PENDING", "SKIPPED", "CONNECTED"]);
|
|
16241
|
+
var LCNConnectionPromptSurfaceValidator = external_exports.enum(["POST_CLAIM", "NOTIFICATION"]);
|
|
16242
|
+
var LCNConnectionPromptActionStatusValidator = external_exports.enum([
|
|
16243
|
+
"PENDING",
|
|
16244
|
+
"SKIPPED",
|
|
16245
|
+
"CONNECTED",
|
|
16246
|
+
"STALE"
|
|
16247
|
+
]);
|
|
16248
|
+
var LCNConnectionPromptValidator = external_exports.object({
|
|
16249
|
+
promptId: external_exports.string().uuid(),
|
|
16250
|
+
status: LCNConnectionPromptStatusValidator,
|
|
16251
|
+
surface: LCNConnectionPromptSurfaceValidator,
|
|
16252
|
+
triggerId: external_exports.string(),
|
|
16253
|
+
triggeredAt: external_exports.iso.datetime(),
|
|
16254
|
+
updatedAt: external_exports.iso.datetime(),
|
|
16255
|
+
counterpart: LCNPublicProfileValidator
|
|
16256
|
+
});
|
|
16257
|
+
var LCNConnectionPromptActionResultValidator = external_exports.object({
|
|
16258
|
+
promptId: external_exports.string().uuid(),
|
|
16259
|
+
status: LCNConnectionPromptActionStatusValidator
|
|
16260
|
+
});
|
|
16261
|
+
var LCNConnectionPromptMetadataValidator = external_exports.object({
|
|
16262
|
+
promptId: external_exports.string().uuid(),
|
|
16263
|
+
counterpartProfileId: external_exports.string()
|
|
16264
|
+
});
|
|
16233
16265
|
var LCNAuthedProfileValidator = LCNPublicProfileValidator.extend({
|
|
16234
16266
|
bio: LCNProfileValidator.shape.bio,
|
|
16235
16267
|
websiteLink: LCNProfileValidator.shape.websiteLink,
|
|
@@ -16238,7 +16270,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16238
16270
|
did: LCNProfileValidator.shape.did
|
|
16239
16271
|
});
|
|
16240
16272
|
var LCNConnectionProfileValidator = LCNAuthedProfileValidator.extend({
|
|
16241
|
-
email: LCNProfileValidator.shape.email
|
|
16273
|
+
email: LCNProfileValidator.shape.email,
|
|
16274
|
+
connectedAt: external_exports.iso.datetime().optional().describe("When the viewer and this profile became connected.")
|
|
16242
16275
|
});
|
|
16243
16276
|
var LCNVisibleProfileValidator = external_exports.union([
|
|
16244
16277
|
LCNConnectionProfileValidator.strict(),
|
|
@@ -16794,12 +16827,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16794
16827
|
}),
|
|
16795
16828
|
timestamp: external_exports.iso.datetime().optional()
|
|
16796
16829
|
});
|
|
16830
|
+
var LCNNotificationMetadataValidator = external_exports.object({
|
|
16831
|
+
connectionPrompt: LCNConnectionPromptMetadataValidator.optional()
|
|
16832
|
+
}).catchall(external_exports.unknown());
|
|
16797
16833
|
var LCNNotificationDataValidator = external_exports.object({
|
|
16798
16834
|
vcUris: external_exports.array(external_exports.string()).optional(),
|
|
16799
16835
|
vpUris: external_exports.array(external_exports.string()).optional(),
|
|
16800
16836
|
transaction: ConsentFlowTransactionValidator.optional(),
|
|
16801
16837
|
inbox: LCNNotificationInboxValidator.optional(),
|
|
16802
|
-
metadata:
|
|
16838
|
+
metadata: LCNNotificationMetadataValidator.optional()
|
|
16803
16839
|
}).loose();
|
|
16804
16840
|
var LCNNotificationValidator = external_exports.object({
|
|
16805
16841
|
type: LCNNotificationTypeEnumValidator,
|
|
@@ -18492,6 +18528,56 @@ var getDidWeb = /* @__PURE__ */ __name((domain, profileId) => {
|
|
|
18492
18528
|
return `did:web:${encodeURIComponent(decodedDomain)}:users:${profileId}`;
|
|
18493
18529
|
}, "getDidWeb");
|
|
18494
18530
|
|
|
18531
|
+
// src/environment.ts
|
|
18532
|
+
import { z as z2 } from "zod";
|
|
18533
|
+
var EnvironmentConfigurationError = class extends Error {
|
|
18534
|
+
static {
|
|
18535
|
+
__name(this, "EnvironmentConfigurationError");
|
|
18536
|
+
}
|
|
18537
|
+
constructor(message) {
|
|
18538
|
+
super(message);
|
|
18539
|
+
this.name = "EnvironmentConfigurationError";
|
|
18540
|
+
}
|
|
18541
|
+
};
|
|
18542
|
+
var requiredEnvironmentString = z2.string().trim().min(1, "Required but missing");
|
|
18543
|
+
var optionalEnvironmentString = z2.preprocess(
|
|
18544
|
+
(value) => value === "" ? void 0 : value,
|
|
18545
|
+
requiredEnvironmentString.optional()
|
|
18546
|
+
);
|
|
18547
|
+
var optionalEnvironmentUrl = z2.preprocess(
|
|
18548
|
+
(value) => value === "" ? void 0 : value,
|
|
18549
|
+
z2.url("Expected a valid URL").optional()
|
|
18550
|
+
);
|
|
18551
|
+
var environmentBoolean = z2.enum(["true", "false", "1", "0"]).transform((value) => value === "true" || value === "1");
|
|
18552
|
+
var optionalEnvironmentBoolean = z2.preprocess(
|
|
18553
|
+
(value) => value === "" || value === void 0 ? void 0 : value,
|
|
18554
|
+
environmentBoolean.optional()
|
|
18555
|
+
);
|
|
18556
|
+
var environmentPort = z2.coerce.number().int().min(1).max(65535);
|
|
18557
|
+
var optionalEnvironmentPort = z2.preprocess(
|
|
18558
|
+
(value) => value === "" || value === void 0 ? void 0 : value,
|
|
18559
|
+
environmentPort.optional()
|
|
18560
|
+
);
|
|
18561
|
+
var parseEnvironment = /* @__PURE__ */ __name((schema, raw, context) => {
|
|
18562
|
+
const result = schema.safeParse(raw);
|
|
18563
|
+
if (result.success) return result.data;
|
|
18564
|
+
const issues = result.error.issues.map((issue) => {
|
|
18565
|
+
const key = issue.path.length ? issue.path.map(String).join(".") : "(environment)";
|
|
18566
|
+
return `${key}
|
|
18567
|
+
${issue.message}`;
|
|
18568
|
+
}).join("\n\n");
|
|
18569
|
+
throw new EnvironmentConfigurationError(
|
|
18570
|
+
[
|
|
18571
|
+
`Invalid ${context.project} configuration`,
|
|
18572
|
+
"",
|
|
18573
|
+
issues,
|
|
18574
|
+
"",
|
|
18575
|
+
`Configuration source: ${context.source}`,
|
|
18576
|
+
`Copy ${context.examplePath} to .env and correct the values above.`
|
|
18577
|
+
].join("\n")
|
|
18578
|
+
);
|
|
18579
|
+
}, "parseEnvironment");
|
|
18580
|
+
|
|
18495
18581
|
// src/index.ts
|
|
18496
18582
|
var isHex = /* @__PURE__ */ __name((str) => /^[0-9a-f]+$/i.test(str), "isHex");
|
|
18497
18583
|
var isEncrypted = /* @__PURE__ */ __name((item) => {
|
|
@@ -18523,12 +18609,9 @@ var RegExpTransformer = {
|
|
|
18523
18609
|
}
|
|
18524
18610
|
};
|
|
18525
18611
|
var isVC2Format = /* @__PURE__ */ __name((credential) => {
|
|
18526
|
-
if (!credential
|
|
18527
|
-
|
|
18528
|
-
|
|
18529
|
-
return credential["@context"].some(
|
|
18530
|
-
(context) => context === "https://www.w3.org/ns/credentials/v2"
|
|
18531
|
-
);
|
|
18612
|
+
if (!credential || typeof credential !== "object" || !("@context" in credential)) return false;
|
|
18613
|
+
const context = credential["@context"];
|
|
18614
|
+
return Array.isArray(context) ? context.some((value) => value === "https://www.w3.org/ns/credentials/v2") : context === "https://www.w3.org/ns/credentials/v2";
|
|
18532
18615
|
}, "isVC2Format");
|
|
18533
18616
|
var unwrapBoostCredential = /* @__PURE__ */ __name((vc) => {
|
|
18534
18617
|
if (vc?.type?.includes("CertifiedBoostCredential") && vc?.boostCredential) {
|
|
@@ -18545,6 +18628,7 @@ var isAppDidWeb = /* @__PURE__ */ __name((did) => {
|
|
|
18545
18628
|
export {
|
|
18546
18629
|
AGE_RATING_TO_MIN_AGE,
|
|
18547
18630
|
DEFAULT_RESOLUTIONS,
|
|
18631
|
+
EnvironmentConfigurationError,
|
|
18548
18632
|
ImageResizingValidator,
|
|
18549
18633
|
ImageUploadingValidator,
|
|
18550
18634
|
ImageWithLoadingStateValdator,
|
|
@@ -18562,6 +18646,8 @@ export {
|
|
|
18562
18646
|
deriveNameFromVct,
|
|
18563
18647
|
deriveSdJwtIssuedAtIso,
|
|
18564
18648
|
deriveTypeFromVct,
|
|
18649
|
+
environmentBoolean,
|
|
18650
|
+
environmentPort,
|
|
18565
18651
|
extractVctSegment,
|
|
18566
18652
|
filterMaybes,
|
|
18567
18653
|
filterUndefined,
|
|
@@ -18587,8 +18673,14 @@ export {
|
|
|
18587
18673
|
isNotMaybe,
|
|
18588
18674
|
isNotUndefined,
|
|
18589
18675
|
isVC2Format,
|
|
18676
|
+
optionalEnvironmentBoolean,
|
|
18677
|
+
optionalEnvironmentPort,
|
|
18678
|
+
optionalEnvironmentString,
|
|
18679
|
+
optionalEnvironmentUrl,
|
|
18680
|
+
parseEnvironment,
|
|
18590
18681
|
projectEnvelopeToDisplayVc,
|
|
18591
18682
|
quantizeValue,
|
|
18683
|
+
requiredEnvironmentString,
|
|
18592
18684
|
resizeAndChangeQuality4 as resizeAndChangeQuality,
|
|
18593
18685
|
resolveStorageReadResult,
|
|
18594
18686
|
setBitstringStatusListBit,
|