full site update

This commit is contained in:
2025-07-24 18:46:24 +02:00
parent bfe2b90d8d
commit 37a6e0ab31
6912 changed files with 540482 additions and 361712 deletions

View File

@@ -1,7 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseAnyDef = void 0;
function parseAnyDef() {
return {};
const getRelativePath_js_1 = require("../getRelativePath.js");
function parseAnyDef(refs) {
if (refs.target !== "openAi") {
return {};
}
const anyDefinitionPath = [
...refs.basePath,
refs.definitionPath,
refs.openAiAnyTypeName,
];
refs.flags.hasReferencedOpenAiAnyType = true;
return {
$ref: refs.$refStrategy === "relative"
? (0, getRelativePath_js_1.getRelativePath)(anyDefinitionPath, refs.currentPath)
: anyDefinitionPath.join("/"),
};
}
exports.parseAnyDef = parseAnyDef;

View File

@@ -2,9 +2,10 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseEffectsDef = void 0;
const parseDef_js_1 = require("../parseDef.js");
const any_js_1 = require("./any.js");
function parseEffectsDef(_def, refs) {
return refs.effectStrategy === "input"
? (0, parseDef_js_1.parseDef)(_def.schema._def, refs)
: {};
: (0, any_js_1.parseAnyDef)(refs);
}
exports.parseEffectsDef = parseEffectsDef;

View File

@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.parseMapDef = void 0;
const parseDef_js_1 = require("../parseDef.js");
const record_js_1 = require("./record.js");
const any_js_1 = require("./any.js");
function parseMapDef(def, refs) {
if (refs.mapStrategy === "record") {
return (0, record_js_1.parseRecordDef)(def, refs);
@@ -10,11 +11,11 @@ function parseMapDef(def, refs) {
const keys = (0, parseDef_js_1.parseDef)(def.keyType._def, {
...refs,
currentPath: [...refs.currentPath, "items", "items", "0"],
}) || {};
}) || (0, any_js_1.parseAnyDef)(refs);
const values = (0, parseDef_js_1.parseDef)(def.valueType._def, {
...refs,
currentPath: [...refs.currentPath, "items", "items", "1"],
}) || {};
}) || (0, any_js_1.parseAnyDef)(refs);
return {
type: "array",
maxItems: 125,

View File

@@ -1,9 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseNeverDef = void 0;
function parseNeverDef() {
return {
not: {},
};
const any_js_1 = require("./any.js");
function parseNeverDef(refs) {
return refs.target === "openAi"
? undefined
: {
not: (0, any_js_1.parseAnyDef)({
...refs,
currentPath: [...refs.currentPath, "not"],
}),
};
}
exports.parseNeverDef = parseNeverDef;

View File

@@ -1,7 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseObjectDef = void 0;
const zod_1 = require("zod");
const parseDef_js_1 = require("../parseDef.js");
function parseObjectDef(def, refs) {
const forceOptionalIntoNullable = refs.target === "openAi";
@@ -18,7 +17,7 @@ function parseObjectDef(def, refs) {
}
let propOptional = safeIsOptional(propDef);
if (propOptional && forceOptionalIntoNullable) {
if (propDef instanceof zod_1.ZodOptional) {
if (propDef._def.typeName === "ZodOptional") {
propDef = propDef._def.innerType;
}
if (!propDef.isNullable()) {

View File

@@ -2,6 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseOptionalDef = void 0;
const parseDef_js_1 = require("../parseDef.js");
const any_js_1 = require("./any.js");
const parseOptionalDef = (def, refs) => {
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
return (0, parseDef_js_1.parseDef)(def.innerType._def, refs);
@@ -14,11 +15,11 @@ const parseOptionalDef = (def, refs) => {
? {
anyOf: [
{
not: {},
not: (0, any_js_1.parseAnyDef)(refs),
},
innerSchema,
],
}
: {};
: (0, any_js_1.parseAnyDef)(refs);
};
exports.parseOptionalDef = parseOptionalDef;

View File

@@ -5,6 +5,7 @@ const zod_1 = require("zod");
const parseDef_js_1 = require("../parseDef.js");
const string_js_1 = require("./string.js");
const branded_js_1 = require("./branded.js");
const any_js_1 = require("./any.js");
function parseRecordDef(def, refs) {
if (refs.target === "openAi") {
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
@@ -19,7 +20,7 @@ function parseRecordDef(def, refs) {
[key]: (0, parseDef_js_1.parseDef)(def.valueType._def, {
...refs,
currentPath: [...refs.currentPath, "properties", key],
}) ?? {},
}) ?? (0, any_js_1.parseAnyDef)(refs),
}), {}),
additionalProperties: refs.rejectedAdditionalProperties,
};

View File

@@ -1,9 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseUndefinedDef = void 0;
function parseUndefinedDef() {
const any_js_1 = require("./any.js");
function parseUndefinedDef(refs) {
return {
not: {},
not: (0, any_js_1.parseAnyDef)(refs),
};
}
exports.parseUndefinedDef = parseUndefinedDef;

View File

@@ -1,7 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseUnknownDef = void 0;
function parseUnknownDef() {
return {};
const any_js_1 = require("./any.js");
function parseUnknownDef(refs) {
return (0, any_js_1.parseAnyDef)(refs);
}
exports.parseUnknownDef = parseUnknownDef;