@kyo-so/cli 0.9.0 → 0.9.1
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/CHANGELOG.md +30 -0
- package/README.ja.md +56 -19
- package/README.md +56 -19
- package/README.zh-CN.md +56 -19
- package/dist/bin/kyoso.js +1585 -1216
- package/dist/cli/pluginRuntimeContract.d.ts +4 -4
- package/dist/core/constants.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/bin/kyoso.js
CHANGED
|
@@ -169672,7 +169672,7 @@ var DEFAULT_AGENT_TIMEOUT_MS = 120000;
|
|
|
169672
169672
|
var RAW_OUTPUT_MAX_CHARS = 16384;
|
|
169673
169673
|
var TRACE_DIR = ".kyoso/traces";
|
|
169674
169674
|
var KYOSO_CHILD_AGENT = "KYOSO_CHILD_AGENT";
|
|
169675
|
-
var KYOSO_VERSION = "0.9.
|
|
169675
|
+
var KYOSO_VERSION = "0.9.1";
|
|
169676
169676
|
|
|
169677
169677
|
// src/utils/pathContainment.ts
|
|
169678
169678
|
import { resolve, sep as sep2 } from "node:path";
|
|
@@ -169973,7 +169973,7 @@ var defaultConfig = {
|
|
|
169973
169973
|
enabled: true,
|
|
169974
169974
|
type: "acp",
|
|
169975
169975
|
command: "npx",
|
|
169976
|
-
args: ["-y", "@agentclientprotocol/codex-acp@1.1.
|
|
169976
|
+
args: ["-y", "@agentclientprotocol/codex-acp@1.1.2"],
|
|
169977
169977
|
role: "implementation_reviewer",
|
|
169978
169978
|
timeoutMs: 120000,
|
|
169979
169979
|
env: {
|
|
@@ -169997,7 +169997,7 @@ var defaultConfig = {
|
|
|
169997
169997
|
enabled: true,
|
|
169998
169998
|
type: "acp",
|
|
169999
169999
|
command: "npx",
|
|
170000
|
-
args: ["-y", "@agentclientprotocol/claude-agent-acp@0.
|
|
170000
|
+
args: ["-y", "@agentclientprotocol/claude-agent-acp@0.58.1"],
|
|
170001
170001
|
role: "architecture_security_reviewer",
|
|
170002
170002
|
timeoutMs: 300000,
|
|
170003
170003
|
env: {
|
|
@@ -186299,9 +186299,9 @@ var PLUGIN_RUNTIME_COMPATIBILITY_SCHEMA_VERSION = 1;
|
|
|
186299
186299
|
var MINIMUM_SUPPORTED_CODEX_VERSION = "0.144.0-alpha.4";
|
|
186300
186300
|
var PLUGIN_RUNTIME_EXPECTED_CONTRACT = {
|
|
186301
186301
|
distribution: {
|
|
186302
|
-
pluginVersion: "0.
|
|
186302
|
+
pluginVersion: "0.3.0",
|
|
186303
186303
|
mcpCommand: "npx",
|
|
186304
|
-
mcpPackagePin: "@kyo-so/cli@0.
|
|
186304
|
+
mcpPackagePin: "@kyo-so/cli@0.9.0"
|
|
186305
186305
|
},
|
|
186306
186306
|
marketplace: {
|
|
186307
186307
|
name: "kyoso",
|
|
@@ -188547,7 +188547,7 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__
|
|
|
188547
188547
|
value: mod,
|
|
188548
188548
|
enumerable: true
|
|
188549
188549
|
}) : target, mod));
|
|
188550
|
-
// node_modules/@modelcontextprotocol/server/dist/ajvProvider-
|
|
188550
|
+
// node_modules/@modelcontextprotocol/server/dist/ajvProvider-Cpjfhu7O.mjs
|
|
188551
188551
|
var require_code$1 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
188552
188552
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
188553
188553
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = undefined;
|
|
@@ -194143,767 +194143,310 @@ var require_applicator$1 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
|
194143
194143
|
}
|
|
194144
194144
|
exports.default = getApplicator;
|
|
194145
194145
|
});
|
|
194146
|
-
var
|
|
194147
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194148
|
-
exports.dynamicAnchor = undefined;
|
|
194149
|
-
const codegen_1 = require_codegen();
|
|
194150
|
-
const names_1 = require_names();
|
|
194151
|
-
const compile_1 = require_compile();
|
|
194152
|
-
const ref_1 = require_ref();
|
|
194153
|
-
const def = {
|
|
194154
|
-
keyword: "$dynamicAnchor",
|
|
194155
|
-
schemaType: "string",
|
|
194156
|
-
code: (cxt) => dynamicAnchor(cxt, cxt.schema)
|
|
194157
|
-
};
|
|
194158
|
-
function dynamicAnchor(cxt, anchor) {
|
|
194159
|
-
const { gen, it } = cxt;
|
|
194160
|
-
it.schemaEnv.root.dynamicAnchors[anchor] = true;
|
|
194161
|
-
const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
|
|
194162
|
-
const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
|
|
194163
|
-
gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
|
|
194164
|
-
}
|
|
194165
|
-
exports.dynamicAnchor = dynamicAnchor;
|
|
194166
|
-
function _getValidate(cxt) {
|
|
194167
|
-
const { schemaEnv, schema, self } = cxt.it;
|
|
194168
|
-
const { root, baseId, localRefs, meta: meta3 } = schemaEnv.root;
|
|
194169
|
-
const { schemaId } = self.opts;
|
|
194170
|
-
const sch = new compile_1.SchemaEnv({
|
|
194171
|
-
schema,
|
|
194172
|
-
schemaId,
|
|
194173
|
-
root,
|
|
194174
|
-
baseId,
|
|
194175
|
-
localRefs,
|
|
194176
|
-
meta: meta3
|
|
194177
|
-
});
|
|
194178
|
-
compile_1.compileSchema.call(self, sch);
|
|
194179
|
-
return (0, ref_1.getValidate)(cxt, sch);
|
|
194180
|
-
}
|
|
194181
|
-
exports.default = def;
|
|
194182
|
-
});
|
|
194183
|
-
var require_dynamicRef = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194146
|
+
var require_format$1 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194184
194147
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194185
|
-
exports.dynamicRef = undefined;
|
|
194186
194148
|
const codegen_1 = require_codegen();
|
|
194187
|
-
const names_1 = require_names();
|
|
194188
|
-
const ref_1 = require_ref();
|
|
194189
194149
|
const def = {
|
|
194190
|
-
keyword: "
|
|
194150
|
+
keyword: "format",
|
|
194151
|
+
type: ["number", "string"],
|
|
194191
194152
|
schemaType: "string",
|
|
194192
|
-
|
|
194193
|
-
|
|
194194
|
-
|
|
194195
|
-
|
|
194196
|
-
|
|
194197
|
-
|
|
194198
|
-
|
|
194199
|
-
|
|
194200
|
-
|
|
194201
|
-
|
|
194202
|
-
|
|
194203
|
-
|
|
194204
|
-
cxt.ok(valid);
|
|
194205
|
-
}
|
|
194206
|
-
function _dynamicRef(valid) {
|
|
194207
|
-
if (it.schemaEnv.root.dynamicAnchors[anchor]) {
|
|
194208
|
-
const v = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
|
|
194209
|
-
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
|
|
194210
|
-
} else
|
|
194211
|
-
_callRef(it.validateName, valid)();
|
|
194212
|
-
}
|
|
194213
|
-
function _callRef(validate, valid) {
|
|
194214
|
-
return valid ? () => gen.block(() => {
|
|
194215
|
-
(0, ref_1.callRef)(cxt, validate);
|
|
194216
|
-
gen.let(valid, true);
|
|
194217
|
-
}) : () => (0, ref_1.callRef)(cxt, validate);
|
|
194218
|
-
}
|
|
194219
|
-
}
|
|
194220
|
-
exports.dynamicRef = dynamicRef;
|
|
194221
|
-
exports.default = def;
|
|
194222
|
-
});
|
|
194223
|
-
var require_recursiveAnchor = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194224
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194225
|
-
const dynamicAnchor_1 = require_dynamicAnchor();
|
|
194226
|
-
const util_1 = require_util();
|
|
194227
|
-
const def = {
|
|
194228
|
-
keyword: "$recursiveAnchor",
|
|
194229
|
-
schemaType: "boolean",
|
|
194230
|
-
code(cxt) {
|
|
194231
|
-
if (cxt.schema)
|
|
194232
|
-
(0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
|
|
194153
|
+
$data: true,
|
|
194154
|
+
error: {
|
|
194155
|
+
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
194156
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
194157
|
+
},
|
|
194158
|
+
code(cxt, ruleType) {
|
|
194159
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
194160
|
+
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
194161
|
+
if (!opts.validateFormats)
|
|
194162
|
+
return;
|
|
194163
|
+
if ($data)
|
|
194164
|
+
validate$DataFormat();
|
|
194233
194165
|
else
|
|
194234
|
-
(
|
|
194166
|
+
validateFormat();
|
|
194167
|
+
function validate$DataFormat() {
|
|
194168
|
+
const fmts = gen.scopeValue("formats", {
|
|
194169
|
+
ref: self.formats,
|
|
194170
|
+
code: opts.code.formats
|
|
194171
|
+
});
|
|
194172
|
+
const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
|
|
194173
|
+
const fType = gen.let("fType");
|
|
194174
|
+
const format = gen.let("format");
|
|
194175
|
+
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef));
|
|
194176
|
+
cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
|
|
194177
|
+
function unknownFmt() {
|
|
194178
|
+
if (opts.strictSchema === false)
|
|
194179
|
+
return codegen_1.nil;
|
|
194180
|
+
return (0, codegen_1._)`${schemaCode} && !${format}`;
|
|
194181
|
+
}
|
|
194182
|
+
function invalidFmt() {
|
|
194183
|
+
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
|
|
194184
|
+
const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
|
|
194185
|
+
return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
194186
|
+
}
|
|
194187
|
+
}
|
|
194188
|
+
function validateFormat() {
|
|
194189
|
+
const formatDef = self.formats[schema];
|
|
194190
|
+
if (!formatDef) {
|
|
194191
|
+
unknownFormat();
|
|
194192
|
+
return;
|
|
194193
|
+
}
|
|
194194
|
+
if (formatDef === true)
|
|
194195
|
+
return;
|
|
194196
|
+
const [fmtType, format, fmtRef] = getFormat(formatDef);
|
|
194197
|
+
if (fmtType === ruleType)
|
|
194198
|
+
cxt.pass(validCondition());
|
|
194199
|
+
function unknownFormat() {
|
|
194200
|
+
if (opts.strictSchema === false) {
|
|
194201
|
+
self.logger.warn(unknownMsg());
|
|
194202
|
+
return;
|
|
194203
|
+
}
|
|
194204
|
+
throw new Error(unknownMsg());
|
|
194205
|
+
function unknownMsg() {
|
|
194206
|
+
return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
|
|
194207
|
+
}
|
|
194208
|
+
}
|
|
194209
|
+
function getFormat(fmtDef) {
|
|
194210
|
+
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : undefined;
|
|
194211
|
+
const fmt = gen.scopeValue("formats", {
|
|
194212
|
+
key: schema,
|
|
194213
|
+
ref: fmtDef,
|
|
194214
|
+
code
|
|
194215
|
+
});
|
|
194216
|
+
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp))
|
|
194217
|
+
return [
|
|
194218
|
+
fmtDef.type || "string",
|
|
194219
|
+
fmtDef.validate,
|
|
194220
|
+
(0, codegen_1._)`${fmt}.validate`
|
|
194221
|
+
];
|
|
194222
|
+
return [
|
|
194223
|
+
"string",
|
|
194224
|
+
fmtDef,
|
|
194225
|
+
fmt
|
|
194226
|
+
];
|
|
194227
|
+
}
|
|
194228
|
+
function validCondition() {
|
|
194229
|
+
if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
|
|
194230
|
+
if (!schemaEnv.$async)
|
|
194231
|
+
throw new Error("async format in sync schema");
|
|
194232
|
+
return (0, codegen_1._)`await ${fmtRef}(${data})`;
|
|
194233
|
+
}
|
|
194234
|
+
return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
|
|
194235
|
+
}
|
|
194236
|
+
}
|
|
194235
194237
|
}
|
|
194236
194238
|
};
|
|
194237
194239
|
exports.default = def;
|
|
194238
194240
|
});
|
|
194239
|
-
var
|
|
194241
|
+
var require_format = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194240
194242
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194241
|
-
const
|
|
194242
|
-
|
|
194243
|
-
keyword: "$recursiveRef",
|
|
194244
|
-
schemaType: "string",
|
|
194245
|
-
code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
|
|
194246
|
-
};
|
|
194247
|
-
exports.default = def;
|
|
194243
|
+
const format = [require_format$1().default];
|
|
194244
|
+
exports.default = format;
|
|
194248
194245
|
});
|
|
194249
|
-
var
|
|
194246
|
+
var require_metadata = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194250
194247
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194251
|
-
|
|
194252
|
-
|
|
194253
|
-
|
|
194254
|
-
|
|
194255
|
-
|
|
194256
|
-
|
|
194257
|
-
|
|
194258
|
-
|
|
194259
|
-
|
|
194248
|
+
exports.contentVocabulary = exports.metadataVocabulary = undefined;
|
|
194249
|
+
exports.metadataVocabulary = [
|
|
194250
|
+
"title",
|
|
194251
|
+
"description",
|
|
194252
|
+
"default",
|
|
194253
|
+
"deprecated",
|
|
194254
|
+
"readOnly",
|
|
194255
|
+
"writeOnly",
|
|
194256
|
+
"examples"
|
|
194257
|
+
];
|
|
194258
|
+
exports.contentVocabulary = [
|
|
194259
|
+
"contentMediaType",
|
|
194260
|
+
"contentEncoding",
|
|
194261
|
+
"contentSchema"
|
|
194260
194262
|
];
|
|
194261
|
-
exports.default = dynamic;
|
|
194262
194263
|
});
|
|
194263
|
-
var
|
|
194264
|
+
var require_draft7 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194264
194265
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194265
|
-
const
|
|
194266
|
-
const
|
|
194267
|
-
|
|
194268
|
-
|
|
194269
|
-
|
|
194270
|
-
|
|
194271
|
-
|
|
194272
|
-
|
|
194273
|
-
|
|
194266
|
+
const core_1 = require_core$1();
|
|
194267
|
+
const validation_1 = require_validation$1();
|
|
194268
|
+
const applicator_1 = require_applicator$1();
|
|
194269
|
+
const format_1 = require_format();
|
|
194270
|
+
const metadata_1 = require_metadata();
|
|
194271
|
+
const draft7Vocabularies = [
|
|
194272
|
+
core_1.default,
|
|
194273
|
+
validation_1.default,
|
|
194274
|
+
(0, applicator_1.default)(),
|
|
194275
|
+
format_1.default,
|
|
194276
|
+
metadata_1.metadataVocabulary,
|
|
194277
|
+
metadata_1.contentVocabulary
|
|
194278
|
+
];
|
|
194279
|
+
exports.default = draft7Vocabularies;
|
|
194274
194280
|
});
|
|
194275
|
-
var
|
|
194281
|
+
var require_types = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194276
194282
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194277
|
-
|
|
194278
|
-
|
|
194279
|
-
|
|
194280
|
-
|
|
194281
|
-
|
|
194282
|
-
|
|
194283
|
-
};
|
|
194284
|
-
exports.default = def;
|
|
194283
|
+
exports.DiscrError = undefined;
|
|
194284
|
+
var DiscrError;
|
|
194285
|
+
(function(DiscrError2) {
|
|
194286
|
+
DiscrError2["Tag"] = "tag";
|
|
194287
|
+
DiscrError2["Mapping"] = "mapping";
|
|
194288
|
+
})(DiscrError || (exports.DiscrError = DiscrError = {}));
|
|
194285
194289
|
});
|
|
194286
|
-
var
|
|
194290
|
+
var require_discriminator = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194287
194291
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194292
|
+
const codegen_1 = require_codegen();
|
|
194293
|
+
const types_1 = require_types();
|
|
194294
|
+
const compile_1 = require_compile();
|
|
194295
|
+
const ref_error_1 = require_ref_error();
|
|
194288
194296
|
const util_1 = require_util();
|
|
194289
194297
|
const def = {
|
|
194290
|
-
keyword:
|
|
194291
|
-
type: "array",
|
|
194292
|
-
schemaType: "number",
|
|
194293
|
-
code({ keyword, parentSchema, it }) {
|
|
194294
|
-
if (parentSchema.contains === undefined)
|
|
194295
|
-
(0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
|
|
194296
|
-
}
|
|
194297
|
-
};
|
|
194298
|
-
exports.default = def;
|
|
194299
|
-
});
|
|
194300
|
-
var require_next = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194301
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194302
|
-
const dependentRequired_1 = require_dependentRequired();
|
|
194303
|
-
const dependentSchemas_1 = require_dependentSchemas();
|
|
194304
|
-
const limitContains_1 = require_limitContains();
|
|
194305
|
-
const next = [
|
|
194306
|
-
dependentRequired_1.default,
|
|
194307
|
-
dependentSchemas_1.default,
|
|
194308
|
-
limitContains_1.default
|
|
194309
|
-
];
|
|
194310
|
-
exports.default = next;
|
|
194311
|
-
});
|
|
194312
|
-
var require_unevaluatedProperties = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194313
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194314
|
-
const codegen_1 = require_codegen();
|
|
194315
|
-
const util_1 = require_util();
|
|
194316
|
-
const names_1 = require_names();
|
|
194317
|
-
const def = {
|
|
194318
|
-
keyword: "unevaluatedProperties",
|
|
194298
|
+
keyword: "discriminator",
|
|
194319
194299
|
type: "object",
|
|
194320
|
-
schemaType:
|
|
194321
|
-
trackErrors: true,
|
|
194300
|
+
schemaType: "object",
|
|
194322
194301
|
error: {
|
|
194323
|
-
message: "must
|
|
194324
|
-
params: ({ params }) => (0, codegen_1._)`{
|
|
194302
|
+
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
194303
|
+
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
|
|
194325
194304
|
},
|
|
194326
194305
|
code(cxt) {
|
|
194327
|
-
const { gen,
|
|
194328
|
-
|
|
194329
|
-
|
|
194330
|
-
|
|
194331
|
-
|
|
194332
|
-
|
|
194333
|
-
|
|
194334
|
-
|
|
194335
|
-
|
|
194336
|
-
|
|
194337
|
-
|
|
194338
|
-
|
|
194339
|
-
|
|
194340
|
-
|
|
194341
|
-
|
|
194342
|
-
|
|
194343
|
-
|
|
194344
|
-
|
|
194345
|
-
|
|
194346
|
-
|
|
194347
|
-
|
|
194348
|
-
|
|
194349
|
-
|
|
194350
|
-
|
|
194351
|
-
|
|
194352
|
-
if (!allErrors)
|
|
194353
|
-
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
194306
|
+
const { gen, data, schema, parentSchema, it } = cxt;
|
|
194307
|
+
const { oneOf } = parentSchema;
|
|
194308
|
+
if (!it.opts.discriminator)
|
|
194309
|
+
throw new Error("discriminator: requires discriminator option");
|
|
194310
|
+
const tagName = schema.propertyName;
|
|
194311
|
+
if (typeof tagName != "string")
|
|
194312
|
+
throw new Error("discriminator: requires propertyName");
|
|
194313
|
+
if (schema.mapping)
|
|
194314
|
+
throw new Error("discriminator: mapping is not supported");
|
|
194315
|
+
if (!oneOf)
|
|
194316
|
+
throw new Error("discriminator: requires oneOf keyword");
|
|
194317
|
+
const valid = gen.let("valid", false);
|
|
194318
|
+
const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);
|
|
194319
|
+
gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, {
|
|
194320
|
+
discrError: types_1.DiscrError.Tag,
|
|
194321
|
+
tag,
|
|
194322
|
+
tagName
|
|
194323
|
+
}));
|
|
194324
|
+
cxt.ok(valid);
|
|
194325
|
+
function validateMapping() {
|
|
194326
|
+
const mapping = getMapping();
|
|
194327
|
+
gen.if(false);
|
|
194328
|
+
for (const tagValue in mapping) {
|
|
194329
|
+
gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);
|
|
194330
|
+
gen.assign(valid, applyTagSchema(mapping[tagValue]));
|
|
194354
194331
|
}
|
|
194332
|
+
gen.else();
|
|
194333
|
+
cxt.error(false, {
|
|
194334
|
+
discrError: types_1.DiscrError.Mapping,
|
|
194335
|
+
tag,
|
|
194336
|
+
tagName
|
|
194337
|
+
});
|
|
194338
|
+
gen.endIf();
|
|
194355
194339
|
}
|
|
194356
|
-
function
|
|
194357
|
-
|
|
194340
|
+
function applyTagSchema(schemaProp) {
|
|
194341
|
+
const _valid = gen.name("valid");
|
|
194342
|
+
const schCxt = cxt.subschema({
|
|
194343
|
+
keyword: "oneOf",
|
|
194344
|
+
schemaProp
|
|
194345
|
+
}, _valid);
|
|
194346
|
+
cxt.mergeEvaluated(schCxt, codegen_1.Name);
|
|
194347
|
+
return _valid;
|
|
194358
194348
|
}
|
|
194359
|
-
function
|
|
194360
|
-
|
|
194361
|
-
|
|
194362
|
-
|
|
194363
|
-
|
|
194364
|
-
|
|
194349
|
+
function getMapping() {
|
|
194350
|
+
var _a3;
|
|
194351
|
+
const oneOfMapping = {};
|
|
194352
|
+
const topRequired = hasRequired(parentSchema);
|
|
194353
|
+
let tagRequired = true;
|
|
194354
|
+
for (let i = 0;i < oneOf.length; i++) {
|
|
194355
|
+
let sch = oneOf[i];
|
|
194356
|
+
if ((sch === null || sch === undefined ? undefined : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
|
|
194357
|
+
const ref = sch.$ref;
|
|
194358
|
+
sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
|
|
194359
|
+
if (sch instanceof compile_1.SchemaEnv)
|
|
194360
|
+
sch = sch.schema;
|
|
194361
|
+
if (sch === undefined)
|
|
194362
|
+
throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
|
|
194363
|
+
}
|
|
194364
|
+
const propSch = (_a3 = sch === null || sch === undefined ? undefined : sch.properties) === null || _a3 === undefined ? undefined : _a3[tagName];
|
|
194365
|
+
if (typeof propSch != "object")
|
|
194366
|
+
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
|
|
194367
|
+
tagRequired = tagRequired && (topRequired || hasRequired(sch));
|
|
194368
|
+
addMappings(propSch, i);
|
|
194369
|
+
}
|
|
194370
|
+
if (!tagRequired)
|
|
194371
|
+
throw new Error(`discriminator: "${tagName}" must be required`);
|
|
194372
|
+
return oneOfMapping;
|
|
194373
|
+
function hasRequired({ required: required2 }) {
|
|
194374
|
+
return Array.isArray(required2) && required2.includes(tagName);
|
|
194375
|
+
}
|
|
194376
|
+
function addMappings(sch, i) {
|
|
194377
|
+
if (sch.const)
|
|
194378
|
+
addMapping(sch.const, i);
|
|
194379
|
+
else if (sch.enum)
|
|
194380
|
+
for (const tagValue of sch.enum)
|
|
194381
|
+
addMapping(tagValue, i);
|
|
194382
|
+
else
|
|
194383
|
+
throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
|
|
194384
|
+
}
|
|
194385
|
+
function addMapping(tagValue, i) {
|
|
194386
|
+
if (typeof tagValue != "string" || tagValue in oneOfMapping)
|
|
194387
|
+
throw new Error(`discriminator: "${tagName}" values must be unique strings`);
|
|
194388
|
+
oneOfMapping[tagValue] = i;
|
|
194389
|
+
}
|
|
194365
194390
|
}
|
|
194366
194391
|
}
|
|
194367
194392
|
};
|
|
194368
194393
|
exports.default = def;
|
|
194369
194394
|
});
|
|
194370
|
-
var
|
|
194371
|
-
|
|
194372
|
-
|
|
194373
|
-
|
|
194374
|
-
|
|
194375
|
-
|
|
194376
|
-
|
|
194377
|
-
|
|
194378
|
-
|
|
194379
|
-
|
|
194380
|
-
|
|
194381
|
-
|
|
194382
|
-
|
|
194383
|
-
|
|
194384
|
-
|
|
194385
|
-
|
|
194386
|
-
|
|
194387
|
-
|
|
194388
|
-
|
|
194389
|
-
|
|
194390
|
-
|
|
194391
|
-
|
|
194392
|
-
|
|
194393
|
-
|
|
194394
|
-
|
|
194395
|
-
|
|
194396
|
-
|
|
194397
|
-
|
|
194398
|
-
|
|
194399
|
-
|
|
194400
|
-
keyword: "unevaluatedItems",
|
|
194401
|
-
dataProp: i,
|
|
194402
|
-
dataPropType: util_1.Type.Num
|
|
194403
|
-
}, valid);
|
|
194404
|
-
if (!it.allErrors)
|
|
194405
|
-
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
194406
|
-
});
|
|
194395
|
+
var require_json_schema_draft_07 = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194396
|
+
module.exports = {
|
|
194397
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
194398
|
+
$id: "http://json-schema.org/draft-07/schema#",
|
|
194399
|
+
title: "Core schema meta-schema",
|
|
194400
|
+
definitions: {
|
|
194401
|
+
schemaArray: {
|
|
194402
|
+
type: "array",
|
|
194403
|
+
minItems: 1,
|
|
194404
|
+
items: { $ref: "#" }
|
|
194405
|
+
},
|
|
194406
|
+
nonNegativeInteger: {
|
|
194407
|
+
type: "integer",
|
|
194408
|
+
minimum: 0
|
|
194409
|
+
},
|
|
194410
|
+
nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] },
|
|
194411
|
+
simpleTypes: { enum: [
|
|
194412
|
+
"array",
|
|
194413
|
+
"boolean",
|
|
194414
|
+
"integer",
|
|
194415
|
+
"null",
|
|
194416
|
+
"number",
|
|
194417
|
+
"object",
|
|
194418
|
+
"string"
|
|
194419
|
+
] },
|
|
194420
|
+
stringArray: {
|
|
194421
|
+
type: "array",
|
|
194422
|
+
items: { type: "string" },
|
|
194423
|
+
uniqueItems: true,
|
|
194424
|
+
default: []
|
|
194407
194425
|
}
|
|
194408
|
-
}
|
|
194409
|
-
};
|
|
194410
|
-
exports.default = def;
|
|
194411
|
-
});
|
|
194412
|
-
var require_unevaluated$1 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194413
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194414
|
-
const unevaluatedProperties_1 = require_unevaluatedProperties();
|
|
194415
|
-
const unevaluatedItems_1 = require_unevaluatedItems();
|
|
194416
|
-
const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
|
|
194417
|
-
exports.default = unevaluated;
|
|
194418
|
-
});
|
|
194419
|
-
var require_format$1 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194420
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194421
|
-
const codegen_1 = require_codegen();
|
|
194422
|
-
const def = {
|
|
194423
|
-
keyword: "format",
|
|
194424
|
-
type: ["number", "string"],
|
|
194425
|
-
schemaType: "string",
|
|
194426
|
-
$data: true,
|
|
194427
|
-
error: {
|
|
194428
|
-
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
194429
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
194430
194426
|
},
|
|
194431
|
-
code(cxt, ruleType) {
|
|
194432
|
-
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
194433
|
-
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
194434
|
-
if (!opts.validateFormats)
|
|
194435
|
-
return;
|
|
194436
|
-
if ($data)
|
|
194437
|
-
validate$DataFormat();
|
|
194438
|
-
else
|
|
194439
|
-
validateFormat();
|
|
194440
|
-
function validate$DataFormat() {
|
|
194441
|
-
const fmts = gen.scopeValue("formats", {
|
|
194442
|
-
ref: self.formats,
|
|
194443
|
-
code: opts.code.formats
|
|
194444
|
-
});
|
|
194445
|
-
const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
|
|
194446
|
-
const fType = gen.let("fType");
|
|
194447
|
-
const format = gen.let("format");
|
|
194448
|
-
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef));
|
|
194449
|
-
cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
|
|
194450
|
-
function unknownFmt() {
|
|
194451
|
-
if (opts.strictSchema === false)
|
|
194452
|
-
return codegen_1.nil;
|
|
194453
|
-
return (0, codegen_1._)`${schemaCode} && !${format}`;
|
|
194454
|
-
}
|
|
194455
|
-
function invalidFmt() {
|
|
194456
|
-
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
|
|
194457
|
-
const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
|
|
194458
|
-
return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
194459
|
-
}
|
|
194460
|
-
}
|
|
194461
|
-
function validateFormat() {
|
|
194462
|
-
const formatDef = self.formats[schema];
|
|
194463
|
-
if (!formatDef) {
|
|
194464
|
-
unknownFormat();
|
|
194465
|
-
return;
|
|
194466
|
-
}
|
|
194467
|
-
if (formatDef === true)
|
|
194468
|
-
return;
|
|
194469
|
-
const [fmtType, format, fmtRef] = getFormat(formatDef);
|
|
194470
|
-
if (fmtType === ruleType)
|
|
194471
|
-
cxt.pass(validCondition());
|
|
194472
|
-
function unknownFormat() {
|
|
194473
|
-
if (opts.strictSchema === false) {
|
|
194474
|
-
self.logger.warn(unknownMsg());
|
|
194475
|
-
return;
|
|
194476
|
-
}
|
|
194477
|
-
throw new Error(unknownMsg());
|
|
194478
|
-
function unknownMsg() {
|
|
194479
|
-
return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
|
|
194480
|
-
}
|
|
194481
|
-
}
|
|
194482
|
-
function getFormat(fmtDef) {
|
|
194483
|
-
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : undefined;
|
|
194484
|
-
const fmt = gen.scopeValue("formats", {
|
|
194485
|
-
key: schema,
|
|
194486
|
-
ref: fmtDef,
|
|
194487
|
-
code
|
|
194488
|
-
});
|
|
194489
|
-
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp))
|
|
194490
|
-
return [
|
|
194491
|
-
fmtDef.type || "string",
|
|
194492
|
-
fmtDef.validate,
|
|
194493
|
-
(0, codegen_1._)`${fmt}.validate`
|
|
194494
|
-
];
|
|
194495
|
-
return [
|
|
194496
|
-
"string",
|
|
194497
|
-
fmtDef,
|
|
194498
|
-
fmt
|
|
194499
|
-
];
|
|
194500
|
-
}
|
|
194501
|
-
function validCondition() {
|
|
194502
|
-
if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
|
|
194503
|
-
if (!schemaEnv.$async)
|
|
194504
|
-
throw new Error("async format in sync schema");
|
|
194505
|
-
return (0, codegen_1._)`await ${fmtRef}(${data})`;
|
|
194506
|
-
}
|
|
194507
|
-
return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
|
|
194508
|
-
}
|
|
194509
|
-
}
|
|
194510
|
-
}
|
|
194511
|
-
};
|
|
194512
|
-
exports.default = def;
|
|
194513
|
-
});
|
|
194514
|
-
var require_format = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194515
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194516
|
-
const format = [require_format$1().default];
|
|
194517
|
-
exports.default = format;
|
|
194518
|
-
});
|
|
194519
|
-
var require_metadata = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194520
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194521
|
-
exports.contentVocabulary = exports.metadataVocabulary = undefined;
|
|
194522
|
-
exports.metadataVocabulary = [
|
|
194523
|
-
"title",
|
|
194524
|
-
"description",
|
|
194525
|
-
"default",
|
|
194526
|
-
"deprecated",
|
|
194527
|
-
"readOnly",
|
|
194528
|
-
"writeOnly",
|
|
194529
|
-
"examples"
|
|
194530
|
-
];
|
|
194531
|
-
exports.contentVocabulary = [
|
|
194532
|
-
"contentMediaType",
|
|
194533
|
-
"contentEncoding",
|
|
194534
|
-
"contentSchema"
|
|
194535
|
-
];
|
|
194536
|
-
});
|
|
194537
|
-
var require_draft2020 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194538
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194539
|
-
const core_1 = require_core$1();
|
|
194540
|
-
const validation_1 = require_validation$1();
|
|
194541
|
-
const applicator_1 = require_applicator$1();
|
|
194542
|
-
const dynamic_1 = require_dynamic();
|
|
194543
|
-
const next_1 = require_next();
|
|
194544
|
-
const unevaluated_1 = require_unevaluated$1();
|
|
194545
|
-
const format_1 = require_format();
|
|
194546
|
-
const metadata_1 = require_metadata();
|
|
194547
|
-
const draft2020Vocabularies = [
|
|
194548
|
-
dynamic_1.default,
|
|
194549
|
-
core_1.default,
|
|
194550
|
-
validation_1.default,
|
|
194551
|
-
(0, applicator_1.default)(true),
|
|
194552
|
-
format_1.default,
|
|
194553
|
-
metadata_1.metadataVocabulary,
|
|
194554
|
-
metadata_1.contentVocabulary,
|
|
194555
|
-
next_1.default,
|
|
194556
|
-
unevaluated_1.default
|
|
194557
|
-
];
|
|
194558
|
-
exports.default = draft2020Vocabularies;
|
|
194559
|
-
});
|
|
194560
|
-
var require_types = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194561
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194562
|
-
exports.DiscrError = undefined;
|
|
194563
|
-
var DiscrError;
|
|
194564
|
-
(function(DiscrError2) {
|
|
194565
|
-
DiscrError2["Tag"] = "tag";
|
|
194566
|
-
DiscrError2["Mapping"] = "mapping";
|
|
194567
|
-
})(DiscrError || (exports.DiscrError = DiscrError = {}));
|
|
194568
|
-
});
|
|
194569
|
-
var require_discriminator = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194570
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194571
|
-
const codegen_1 = require_codegen();
|
|
194572
|
-
const types_1 = require_types();
|
|
194573
|
-
const compile_1 = require_compile();
|
|
194574
|
-
const ref_error_1 = require_ref_error();
|
|
194575
|
-
const util_1 = require_util();
|
|
194576
|
-
const def = {
|
|
194577
|
-
keyword: "discriminator",
|
|
194578
|
-
type: "object",
|
|
194579
|
-
schemaType: "object",
|
|
194580
|
-
error: {
|
|
194581
|
-
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
194582
|
-
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
|
|
194583
|
-
},
|
|
194584
|
-
code(cxt) {
|
|
194585
|
-
const { gen, data, schema, parentSchema, it } = cxt;
|
|
194586
|
-
const { oneOf } = parentSchema;
|
|
194587
|
-
if (!it.opts.discriminator)
|
|
194588
|
-
throw new Error("discriminator: requires discriminator option");
|
|
194589
|
-
const tagName = schema.propertyName;
|
|
194590
|
-
if (typeof tagName != "string")
|
|
194591
|
-
throw new Error("discriminator: requires propertyName");
|
|
194592
|
-
if (schema.mapping)
|
|
194593
|
-
throw new Error("discriminator: mapping is not supported");
|
|
194594
|
-
if (!oneOf)
|
|
194595
|
-
throw new Error("discriminator: requires oneOf keyword");
|
|
194596
|
-
const valid = gen.let("valid", false);
|
|
194597
|
-
const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);
|
|
194598
|
-
gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, {
|
|
194599
|
-
discrError: types_1.DiscrError.Tag,
|
|
194600
|
-
tag,
|
|
194601
|
-
tagName
|
|
194602
|
-
}));
|
|
194603
|
-
cxt.ok(valid);
|
|
194604
|
-
function validateMapping() {
|
|
194605
|
-
const mapping = getMapping();
|
|
194606
|
-
gen.if(false);
|
|
194607
|
-
for (const tagValue in mapping) {
|
|
194608
|
-
gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);
|
|
194609
|
-
gen.assign(valid, applyTagSchema(mapping[tagValue]));
|
|
194610
|
-
}
|
|
194611
|
-
gen.else();
|
|
194612
|
-
cxt.error(false, {
|
|
194613
|
-
discrError: types_1.DiscrError.Mapping,
|
|
194614
|
-
tag,
|
|
194615
|
-
tagName
|
|
194616
|
-
});
|
|
194617
|
-
gen.endIf();
|
|
194618
|
-
}
|
|
194619
|
-
function applyTagSchema(schemaProp) {
|
|
194620
|
-
const _valid = gen.name("valid");
|
|
194621
|
-
const schCxt = cxt.subschema({
|
|
194622
|
-
keyword: "oneOf",
|
|
194623
|
-
schemaProp
|
|
194624
|
-
}, _valid);
|
|
194625
|
-
cxt.mergeEvaluated(schCxt, codegen_1.Name);
|
|
194626
|
-
return _valid;
|
|
194627
|
-
}
|
|
194628
|
-
function getMapping() {
|
|
194629
|
-
var _a3;
|
|
194630
|
-
const oneOfMapping = {};
|
|
194631
|
-
const topRequired = hasRequired(parentSchema);
|
|
194632
|
-
let tagRequired = true;
|
|
194633
|
-
for (let i = 0;i < oneOf.length; i++) {
|
|
194634
|
-
let sch = oneOf[i];
|
|
194635
|
-
if ((sch === null || sch === undefined ? undefined : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
|
|
194636
|
-
const ref = sch.$ref;
|
|
194637
|
-
sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
|
|
194638
|
-
if (sch instanceof compile_1.SchemaEnv)
|
|
194639
|
-
sch = sch.schema;
|
|
194640
|
-
if (sch === undefined)
|
|
194641
|
-
throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
|
|
194642
|
-
}
|
|
194643
|
-
const propSch = (_a3 = sch === null || sch === undefined ? undefined : sch.properties) === null || _a3 === undefined ? undefined : _a3[tagName];
|
|
194644
|
-
if (typeof propSch != "object")
|
|
194645
|
-
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
|
|
194646
|
-
tagRequired = tagRequired && (topRequired || hasRequired(sch));
|
|
194647
|
-
addMappings(propSch, i);
|
|
194648
|
-
}
|
|
194649
|
-
if (!tagRequired)
|
|
194650
|
-
throw new Error(`discriminator: "${tagName}" must be required`);
|
|
194651
|
-
return oneOfMapping;
|
|
194652
|
-
function hasRequired({ required: required2 }) {
|
|
194653
|
-
return Array.isArray(required2) && required2.includes(tagName);
|
|
194654
|
-
}
|
|
194655
|
-
function addMappings(sch, i) {
|
|
194656
|
-
if (sch.const)
|
|
194657
|
-
addMapping(sch.const, i);
|
|
194658
|
-
else if (sch.enum)
|
|
194659
|
-
for (const tagValue of sch.enum)
|
|
194660
|
-
addMapping(tagValue, i);
|
|
194661
|
-
else
|
|
194662
|
-
throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
|
|
194663
|
-
}
|
|
194664
|
-
function addMapping(tagValue, i) {
|
|
194665
|
-
if (typeof tagValue != "string" || tagValue in oneOfMapping)
|
|
194666
|
-
throw new Error(`discriminator: "${tagName}" values must be unique strings`);
|
|
194667
|
-
oneOfMapping[tagValue] = i;
|
|
194668
|
-
}
|
|
194669
|
-
}
|
|
194670
|
-
}
|
|
194671
|
-
};
|
|
194672
|
-
exports.default = def;
|
|
194673
|
-
});
|
|
194674
|
-
var require_schema = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194675
|
-
module.exports = {
|
|
194676
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194677
|
-
$id: "https://json-schema.org/draft/2020-12/schema",
|
|
194678
|
-
$vocabulary: {
|
|
194679
|
-
"https://json-schema.org/draft/2020-12/vocab/core": true,
|
|
194680
|
-
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
|
|
194681
|
-
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
|
|
194682
|
-
"https://json-schema.org/draft/2020-12/vocab/validation": true,
|
|
194683
|
-
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
|
|
194684
|
-
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
|
|
194685
|
-
"https://json-schema.org/draft/2020-12/vocab/content": true
|
|
194686
|
-
},
|
|
194687
|
-
$dynamicAnchor: "meta",
|
|
194688
|
-
title: "Core and Validation specifications meta-schema",
|
|
194689
|
-
allOf: [
|
|
194690
|
-
{ $ref: "meta/core" },
|
|
194691
|
-
{ $ref: "meta/applicator" },
|
|
194692
|
-
{ $ref: "meta/unevaluated" },
|
|
194693
|
-
{ $ref: "meta/validation" },
|
|
194694
|
-
{ $ref: "meta/meta-data" },
|
|
194695
|
-
{ $ref: "meta/format-annotation" },
|
|
194696
|
-
{ $ref: "meta/content" }
|
|
194697
|
-
],
|
|
194698
|
-
type: ["object", "boolean"],
|
|
194699
|
-
$comment: "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
|
|
194700
|
-
properties: {
|
|
194701
|
-
definitions: {
|
|
194702
|
-
$comment: '"definitions" has been replaced by "$defs".',
|
|
194703
|
-
type: "object",
|
|
194704
|
-
additionalProperties: { $dynamicRef: "#meta" },
|
|
194705
|
-
deprecated: true,
|
|
194706
|
-
default: {}
|
|
194707
|
-
},
|
|
194708
|
-
dependencies: {
|
|
194709
|
-
$comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
|
|
194710
|
-
type: "object",
|
|
194711
|
-
additionalProperties: { anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] },
|
|
194712
|
-
deprecated: true,
|
|
194713
|
-
default: {}
|
|
194714
|
-
},
|
|
194715
|
-
$recursiveAnchor: {
|
|
194716
|
-
$comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
|
|
194717
|
-
$ref: "meta/core#/$defs/anchorString",
|
|
194718
|
-
deprecated: true
|
|
194719
|
-
},
|
|
194720
|
-
$recursiveRef: {
|
|
194721
|
-
$comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
|
|
194722
|
-
$ref: "meta/core#/$defs/uriReferenceString",
|
|
194723
|
-
deprecated: true
|
|
194724
|
-
}
|
|
194725
|
-
}
|
|
194726
|
-
};
|
|
194727
|
-
});
|
|
194728
|
-
var require_applicator = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194729
|
-
module.exports = {
|
|
194730
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194731
|
-
$id: "https://json-schema.org/draft/2020-12/meta/applicator",
|
|
194732
|
-
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/applicator": true },
|
|
194733
|
-
$dynamicAnchor: "meta",
|
|
194734
|
-
title: "Applicator vocabulary meta-schema",
|
|
194735
|
-
type: ["object", "boolean"],
|
|
194736
|
-
properties: {
|
|
194737
|
-
prefixItems: { $ref: "#/$defs/schemaArray" },
|
|
194738
|
-
items: { $dynamicRef: "#meta" },
|
|
194739
|
-
contains: { $dynamicRef: "#meta" },
|
|
194740
|
-
additionalProperties: { $dynamicRef: "#meta" },
|
|
194741
|
-
properties: {
|
|
194742
|
-
type: "object",
|
|
194743
|
-
additionalProperties: { $dynamicRef: "#meta" },
|
|
194744
|
-
default: {}
|
|
194745
|
-
},
|
|
194746
|
-
patternProperties: {
|
|
194747
|
-
type: "object",
|
|
194748
|
-
additionalProperties: { $dynamicRef: "#meta" },
|
|
194749
|
-
propertyNames: { format: "regex" },
|
|
194750
|
-
default: {}
|
|
194751
|
-
},
|
|
194752
|
-
dependentSchemas: {
|
|
194753
|
-
type: "object",
|
|
194754
|
-
additionalProperties: { $dynamicRef: "#meta" },
|
|
194755
|
-
default: {}
|
|
194756
|
-
},
|
|
194757
|
-
propertyNames: { $dynamicRef: "#meta" },
|
|
194758
|
-
if: { $dynamicRef: "#meta" },
|
|
194759
|
-
then: { $dynamicRef: "#meta" },
|
|
194760
|
-
else: { $dynamicRef: "#meta" },
|
|
194761
|
-
allOf: { $ref: "#/$defs/schemaArray" },
|
|
194762
|
-
anyOf: { $ref: "#/$defs/schemaArray" },
|
|
194763
|
-
oneOf: { $ref: "#/$defs/schemaArray" },
|
|
194764
|
-
not: { $dynamicRef: "#meta" }
|
|
194765
|
-
},
|
|
194766
|
-
$defs: { schemaArray: {
|
|
194767
|
-
type: "array",
|
|
194768
|
-
minItems: 1,
|
|
194769
|
-
items: { $dynamicRef: "#meta" }
|
|
194770
|
-
} }
|
|
194771
|
-
};
|
|
194772
|
-
});
|
|
194773
|
-
var require_unevaluated = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194774
|
-
module.exports = {
|
|
194775
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194776
|
-
$id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
|
194777
|
-
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/unevaluated": true },
|
|
194778
|
-
$dynamicAnchor: "meta",
|
|
194779
|
-
title: "Unevaluated applicator vocabulary meta-schema",
|
|
194780
|
-
type: ["object", "boolean"],
|
|
194781
|
-
properties: {
|
|
194782
|
-
unevaluatedItems: { $dynamicRef: "#meta" },
|
|
194783
|
-
unevaluatedProperties: { $dynamicRef: "#meta" }
|
|
194784
|
-
}
|
|
194785
|
-
};
|
|
194786
|
-
});
|
|
194787
|
-
var require_content = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194788
|
-
module.exports = {
|
|
194789
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194790
|
-
$id: "https://json-schema.org/draft/2020-12/meta/content",
|
|
194791
|
-
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/content": true },
|
|
194792
|
-
$dynamicAnchor: "meta",
|
|
194793
|
-
title: "Content vocabulary meta-schema",
|
|
194794
|
-
type: ["object", "boolean"],
|
|
194795
|
-
properties: {
|
|
194796
|
-
contentEncoding: { type: "string" },
|
|
194797
|
-
contentMediaType: { type: "string" },
|
|
194798
|
-
contentSchema: { $dynamicRef: "#meta" }
|
|
194799
|
-
}
|
|
194800
|
-
};
|
|
194801
|
-
});
|
|
194802
|
-
var require_core = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194803
|
-
module.exports = {
|
|
194804
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194805
|
-
$id: "https://json-schema.org/draft/2020-12/meta/core",
|
|
194806
|
-
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/core": true },
|
|
194807
|
-
$dynamicAnchor: "meta",
|
|
194808
|
-
title: "Core vocabulary meta-schema",
|
|
194809
194427
|
type: ["object", "boolean"],
|
|
194810
194428
|
properties: {
|
|
194811
194429
|
$id: {
|
|
194812
|
-
$ref: "#/$defs/uriReferenceString",
|
|
194813
|
-
$comment: "Non-empty fragments not allowed.",
|
|
194814
|
-
pattern: "^[^#]*#?$"
|
|
194815
|
-
},
|
|
194816
|
-
$schema: { $ref: "#/$defs/uriString" },
|
|
194817
|
-
$ref: { $ref: "#/$defs/uriReferenceString" },
|
|
194818
|
-
$anchor: { $ref: "#/$defs/anchorString" },
|
|
194819
|
-
$dynamicRef: { $ref: "#/$defs/uriReferenceString" },
|
|
194820
|
-
$dynamicAnchor: { $ref: "#/$defs/anchorString" },
|
|
194821
|
-
$vocabulary: {
|
|
194822
|
-
type: "object",
|
|
194823
|
-
propertyNames: { $ref: "#/$defs/uriString" },
|
|
194824
|
-
additionalProperties: { type: "boolean" }
|
|
194825
|
-
},
|
|
194826
|
-
$comment: { type: "string" },
|
|
194827
|
-
$defs: {
|
|
194828
|
-
type: "object",
|
|
194829
|
-
additionalProperties: { $dynamicRef: "#meta" }
|
|
194830
|
-
}
|
|
194831
|
-
},
|
|
194832
|
-
$defs: {
|
|
194833
|
-
anchorString: {
|
|
194834
194430
|
type: "string",
|
|
194835
|
-
|
|
194431
|
+
format: "uri-reference"
|
|
194836
194432
|
},
|
|
194837
|
-
|
|
194433
|
+
$schema: {
|
|
194838
194434
|
type: "string",
|
|
194839
194435
|
format: "uri"
|
|
194840
194436
|
},
|
|
194841
|
-
|
|
194437
|
+
$ref: {
|
|
194842
194438
|
type: "string",
|
|
194843
194439
|
format: "uri-reference"
|
|
194844
|
-
}
|
|
194845
|
-
|
|
194846
|
-
};
|
|
194847
|
-
});
|
|
194848
|
-
var require_format_annotation = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194849
|
-
module.exports = {
|
|
194850
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194851
|
-
$id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
|
194852
|
-
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/format-annotation": true },
|
|
194853
|
-
$dynamicAnchor: "meta",
|
|
194854
|
-
title: "Format vocabulary meta-schema for annotation results",
|
|
194855
|
-
type: ["object", "boolean"],
|
|
194856
|
-
properties: { format: { type: "string" } }
|
|
194857
|
-
};
|
|
194858
|
-
});
|
|
194859
|
-
var require_meta_data = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194860
|
-
module.exports = {
|
|
194861
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194862
|
-
$id: "https://json-schema.org/draft/2020-12/meta/meta-data",
|
|
194863
|
-
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/meta-data": true },
|
|
194864
|
-
$dynamicAnchor: "meta",
|
|
194865
|
-
title: "Meta-data vocabulary meta-schema",
|
|
194866
|
-
type: ["object", "boolean"],
|
|
194867
|
-
properties: {
|
|
194440
|
+
},
|
|
194441
|
+
$comment: { type: "string" },
|
|
194868
194442
|
title: { type: "string" },
|
|
194869
194443
|
description: { type: "string" },
|
|
194870
194444
|
default: true,
|
|
194871
|
-
deprecated: {
|
|
194872
|
-
type: "boolean",
|
|
194873
|
-
default: false
|
|
194874
|
-
},
|
|
194875
194445
|
readOnly: {
|
|
194876
194446
|
type: "boolean",
|
|
194877
|
-
default: false
|
|
194878
|
-
},
|
|
194879
|
-
|
|
194880
|
-
type: "boolean",
|
|
194881
|
-
default: false
|
|
194882
|
-
},
|
|
194883
|
-
examples: {
|
|
194884
|
-
type: "array",
|
|
194885
|
-
items: true
|
|
194886
|
-
}
|
|
194887
|
-
}
|
|
194888
|
-
};
|
|
194889
|
-
});
|
|
194890
|
-
var require_validation = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194891
|
-
module.exports = {
|
|
194892
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194893
|
-
$id: "https://json-schema.org/draft/2020-12/meta/validation",
|
|
194894
|
-
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/validation": true },
|
|
194895
|
-
$dynamicAnchor: "meta",
|
|
194896
|
-
title: "Validation vocabulary meta-schema",
|
|
194897
|
-
type: ["object", "boolean"],
|
|
194898
|
-
properties: {
|
|
194899
|
-
type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, {
|
|
194900
|
-
type: "array",
|
|
194901
|
-
items: { $ref: "#/$defs/simpleTypes" },
|
|
194902
|
-
minItems: 1,
|
|
194903
|
-
uniqueItems: true
|
|
194904
|
-
}] },
|
|
194905
|
-
const: true,
|
|
194906
|
-
enum: {
|
|
194447
|
+
default: false
|
|
194448
|
+
},
|
|
194449
|
+
examples: {
|
|
194907
194450
|
type: "array",
|
|
194908
194451
|
items: true
|
|
194909
194452
|
},
|
|
@@ -194915,127 +194458,109 @@ var require_validation = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
|
194915
194458
|
exclusiveMaximum: { type: "number" },
|
|
194916
194459
|
minimum: { type: "number" },
|
|
194917
194460
|
exclusiveMinimum: { type: "number" },
|
|
194918
|
-
maxLength: { $ref: "
|
|
194919
|
-
minLength: { $ref: "
|
|
194461
|
+
maxLength: { $ref: "#/definitions/nonNegativeInteger" },
|
|
194462
|
+
minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
|
|
194920
194463
|
pattern: {
|
|
194921
194464
|
type: "string",
|
|
194922
194465
|
format: "regex"
|
|
194923
194466
|
},
|
|
194924
|
-
|
|
194925
|
-
|
|
194467
|
+
additionalItems: { $ref: "#" },
|
|
194468
|
+
items: {
|
|
194469
|
+
anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
|
|
194470
|
+
default: true
|
|
194471
|
+
},
|
|
194472
|
+
maxItems: { $ref: "#/definitions/nonNegativeInteger" },
|
|
194473
|
+
minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
|
|
194926
194474
|
uniqueItems: {
|
|
194927
194475
|
type: "boolean",
|
|
194928
194476
|
default: false
|
|
194929
194477
|
},
|
|
194930
|
-
|
|
194931
|
-
|
|
194932
|
-
|
|
194933
|
-
|
|
194478
|
+
contains: { $ref: "#" },
|
|
194479
|
+
maxProperties: { $ref: "#/definitions/nonNegativeInteger" },
|
|
194480
|
+
minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
|
|
194481
|
+
required: { $ref: "#/definitions/stringArray" },
|
|
194482
|
+
additionalProperties: { $ref: "#" },
|
|
194483
|
+
definitions: {
|
|
194484
|
+
type: "object",
|
|
194485
|
+
additionalProperties: { $ref: "#" },
|
|
194486
|
+
default: {}
|
|
194934
194487
|
},
|
|
194935
|
-
|
|
194936
|
-
minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
194937
|
-
required: { $ref: "#/$defs/stringArray" },
|
|
194938
|
-
dependentRequired: {
|
|
194488
|
+
properties: {
|
|
194939
194489
|
type: "object",
|
|
194940
|
-
additionalProperties: { $ref: "
|
|
194941
|
-
|
|
194942
|
-
},
|
|
194943
|
-
$defs: {
|
|
194944
|
-
nonNegativeInteger: {
|
|
194945
|
-
type: "integer",
|
|
194946
|
-
minimum: 0
|
|
194490
|
+
additionalProperties: { $ref: "#" },
|
|
194491
|
+
default: {}
|
|
194947
194492
|
},
|
|
194948
|
-
|
|
194949
|
-
|
|
194950
|
-
|
|
194493
|
+
patternProperties: {
|
|
194494
|
+
type: "object",
|
|
194495
|
+
additionalProperties: { $ref: "#" },
|
|
194496
|
+
propertyNames: { format: "regex" },
|
|
194497
|
+
default: {}
|
|
194951
194498
|
},
|
|
194952
|
-
|
|
194953
|
-
"
|
|
194954
|
-
"
|
|
194955
|
-
|
|
194956
|
-
|
|
194957
|
-
|
|
194958
|
-
|
|
194959
|
-
"string"
|
|
194960
|
-
] },
|
|
194961
|
-
stringArray: {
|
|
194499
|
+
dependencies: {
|
|
194500
|
+
type: "object",
|
|
194501
|
+
additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] }
|
|
194502
|
+
},
|
|
194503
|
+
propertyNames: { $ref: "#" },
|
|
194504
|
+
const: true,
|
|
194505
|
+
enum: {
|
|
194962
194506
|
type: "array",
|
|
194963
|
-
items:
|
|
194964
|
-
|
|
194965
|
-
|
|
194966
|
-
}
|
|
194967
|
-
|
|
194507
|
+
items: true,
|
|
194508
|
+
minItems: 1,
|
|
194509
|
+
uniqueItems: true
|
|
194510
|
+
},
|
|
194511
|
+
type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, {
|
|
194512
|
+
type: "array",
|
|
194513
|
+
items: { $ref: "#/definitions/simpleTypes" },
|
|
194514
|
+
minItems: 1,
|
|
194515
|
+
uniqueItems: true
|
|
194516
|
+
}] },
|
|
194517
|
+
format: { type: "string" },
|
|
194518
|
+
contentMediaType: { type: "string" },
|
|
194519
|
+
contentEncoding: { type: "string" },
|
|
194520
|
+
if: { $ref: "#" },
|
|
194521
|
+
then: { $ref: "#" },
|
|
194522
|
+
else: { $ref: "#" },
|
|
194523
|
+
allOf: { $ref: "#/definitions/schemaArray" },
|
|
194524
|
+
anyOf: { $ref: "#/definitions/schemaArray" },
|
|
194525
|
+
oneOf: { $ref: "#/definitions/schemaArray" },
|
|
194526
|
+
not: { $ref: "#" }
|
|
194527
|
+
},
|
|
194528
|
+
default: true
|
|
194968
194529
|
};
|
|
194969
194530
|
});
|
|
194970
|
-
var
|
|
194971
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194972
|
-
const metaSchema = require_schema();
|
|
194973
|
-
const applicator = require_applicator();
|
|
194974
|
-
const unevaluated = require_unevaluated();
|
|
194975
|
-
const content = require_content();
|
|
194976
|
-
const core2 = require_core();
|
|
194977
|
-
const format = require_format_annotation();
|
|
194978
|
-
const metadata = require_meta_data();
|
|
194979
|
-
const validation = require_validation();
|
|
194980
|
-
const META_SUPPORT_DATA = ["/properties"];
|
|
194981
|
-
function addMetaSchema2020($data) {
|
|
194982
|
-
[
|
|
194983
|
-
metaSchema,
|
|
194984
|
-
applicator,
|
|
194985
|
-
unevaluated,
|
|
194986
|
-
content,
|
|
194987
|
-
core2,
|
|
194988
|
-
with$data(this, format),
|
|
194989
|
-
metadata,
|
|
194990
|
-
with$data(this, validation)
|
|
194991
|
-
].forEach((sch) => this.addMetaSchema(sch, undefined, false));
|
|
194992
|
-
return this;
|
|
194993
|
-
function with$data(ajv, sch) {
|
|
194994
|
-
return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
|
|
194995
|
-
}
|
|
194996
|
-
}
|
|
194997
|
-
exports.default = addMetaSchema2020;
|
|
194998
|
-
});
|
|
194999
|
-
var require__2020 = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194531
|
+
var require_ajv = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195000
194532
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195001
|
-
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.
|
|
194533
|
+
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = undefined;
|
|
195002
194534
|
const core_1 = require_core$2();
|
|
195003
|
-
const
|
|
194535
|
+
const draft7_1 = require_draft7();
|
|
195004
194536
|
const discriminator_1 = require_discriminator();
|
|
195005
|
-
const
|
|
195006
|
-
const
|
|
195007
|
-
|
|
195008
|
-
|
|
195009
|
-
super({
|
|
195010
|
-
...opts,
|
|
195011
|
-
dynamicRef: true,
|
|
195012
|
-
next: true,
|
|
195013
|
-
unevaluated: true
|
|
195014
|
-
});
|
|
195015
|
-
}
|
|
194537
|
+
const draft7MetaSchema = require_json_schema_draft_07();
|
|
194538
|
+
const META_SUPPORT_DATA = ["/properties"];
|
|
194539
|
+
const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
194540
|
+
var Ajv = class extends core_1.default {
|
|
195016
194541
|
_addVocabularies() {
|
|
195017
194542
|
super._addVocabularies();
|
|
195018
|
-
|
|
194543
|
+
draft7_1.default.forEach((v) => this.addVocabulary(v));
|
|
195019
194544
|
if (this.opts.discriminator)
|
|
195020
194545
|
this.addKeyword(discriminator_1.default);
|
|
195021
194546
|
}
|
|
195022
194547
|
_addDefaultMetaSchema() {
|
|
195023
194548
|
super._addDefaultMetaSchema();
|
|
195024
|
-
|
|
195025
|
-
if (!meta3)
|
|
194549
|
+
if (!this.opts.meta)
|
|
195026
194550
|
return;
|
|
195027
|
-
|
|
194551
|
+
const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema;
|
|
194552
|
+
this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
|
|
195028
194553
|
this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
|
|
195029
194554
|
}
|
|
195030
194555
|
defaultMeta() {
|
|
195031
194556
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined);
|
|
195032
194557
|
}
|
|
195033
194558
|
};
|
|
195034
|
-
exports.
|
|
195035
|
-
module.exports = exports =
|
|
195036
|
-
module.exports.
|
|
194559
|
+
exports.Ajv = Ajv;
|
|
194560
|
+
module.exports = exports = Ajv;
|
|
194561
|
+
module.exports.Ajv = Ajv;
|
|
195037
194562
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195038
|
-
exports.default =
|
|
194563
|
+
exports.default = Ajv;
|
|
195039
194564
|
var validate_1 = require_validate();
|
|
195040
194565
|
Object.defineProperty(exports, "KeywordCxt", {
|
|
195041
194566
|
enumerable: true,
|
|
@@ -195095,284 +194620,537 @@ var require__2020 = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
|
195095
194620
|
}
|
|
195096
194621
|
});
|
|
195097
194622
|
});
|
|
195098
|
-
var
|
|
194623
|
+
var require_dynamicAnchor = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194624
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194625
|
+
exports.dynamicAnchor = undefined;
|
|
194626
|
+
const codegen_1 = require_codegen();
|
|
194627
|
+
const names_1 = require_names();
|
|
194628
|
+
const compile_1 = require_compile();
|
|
194629
|
+
const ref_1 = require_ref();
|
|
194630
|
+
const def = {
|
|
194631
|
+
keyword: "$dynamicAnchor",
|
|
194632
|
+
schemaType: "string",
|
|
194633
|
+
code: (cxt) => dynamicAnchor(cxt, cxt.schema)
|
|
194634
|
+
};
|
|
194635
|
+
function dynamicAnchor(cxt, anchor) {
|
|
194636
|
+
const { gen, it } = cxt;
|
|
194637
|
+
it.schemaEnv.root.dynamicAnchors[anchor] = true;
|
|
194638
|
+
const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
|
|
194639
|
+
const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
|
|
194640
|
+
gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
|
|
194641
|
+
}
|
|
194642
|
+
exports.dynamicAnchor = dynamicAnchor;
|
|
194643
|
+
function _getValidate(cxt) {
|
|
194644
|
+
const { schemaEnv, schema, self } = cxt.it;
|
|
194645
|
+
const { root, baseId, localRefs, meta: meta3 } = schemaEnv.root;
|
|
194646
|
+
const { schemaId } = self.opts;
|
|
194647
|
+
const sch = new compile_1.SchemaEnv({
|
|
194648
|
+
schema,
|
|
194649
|
+
schemaId,
|
|
194650
|
+
root,
|
|
194651
|
+
baseId,
|
|
194652
|
+
localRefs,
|
|
194653
|
+
meta: meta3
|
|
194654
|
+
});
|
|
194655
|
+
compile_1.compileSchema.call(self, sch);
|
|
194656
|
+
return (0, ref_1.getValidate)(cxt, sch);
|
|
194657
|
+
}
|
|
194658
|
+
exports.default = def;
|
|
194659
|
+
});
|
|
194660
|
+
var require_dynamicRef = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194661
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194662
|
+
exports.dynamicRef = undefined;
|
|
194663
|
+
const codegen_1 = require_codegen();
|
|
194664
|
+
const names_1 = require_names();
|
|
194665
|
+
const ref_1 = require_ref();
|
|
194666
|
+
const def = {
|
|
194667
|
+
keyword: "$dynamicRef",
|
|
194668
|
+
schemaType: "string",
|
|
194669
|
+
code: (cxt) => dynamicRef(cxt, cxt.schema)
|
|
194670
|
+
};
|
|
194671
|
+
function dynamicRef(cxt, ref) {
|
|
194672
|
+
const { gen, keyword, it } = cxt;
|
|
194673
|
+
if (ref[0] !== "#")
|
|
194674
|
+
throw new Error(`"${keyword}" only supports hash fragment reference`);
|
|
194675
|
+
const anchor = ref.slice(1);
|
|
194676
|
+
if (it.allErrors)
|
|
194677
|
+
_dynamicRef();
|
|
194678
|
+
else {
|
|
194679
|
+
const valid = gen.let("valid", false);
|
|
194680
|
+
_dynamicRef(valid);
|
|
194681
|
+
cxt.ok(valid);
|
|
194682
|
+
}
|
|
194683
|
+
function _dynamicRef(valid) {
|
|
194684
|
+
if (it.schemaEnv.root.dynamicAnchors[anchor]) {
|
|
194685
|
+
const v = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
|
|
194686
|
+
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
|
|
194687
|
+
} else
|
|
194688
|
+
_callRef(it.validateName, valid)();
|
|
194689
|
+
}
|
|
194690
|
+
function _callRef(validate, valid) {
|
|
194691
|
+
return valid ? () => gen.block(() => {
|
|
194692
|
+
(0, ref_1.callRef)(cxt, validate);
|
|
194693
|
+
gen.let(valid, true);
|
|
194694
|
+
}) : () => (0, ref_1.callRef)(cxt, validate);
|
|
194695
|
+
}
|
|
194696
|
+
}
|
|
194697
|
+
exports.dynamicRef = dynamicRef;
|
|
194698
|
+
exports.default = def;
|
|
194699
|
+
});
|
|
194700
|
+
var require_recursiveAnchor = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194701
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194702
|
+
const dynamicAnchor_1 = require_dynamicAnchor();
|
|
194703
|
+
const util_1 = require_util();
|
|
194704
|
+
const def = {
|
|
194705
|
+
keyword: "$recursiveAnchor",
|
|
194706
|
+
schemaType: "boolean",
|
|
194707
|
+
code(cxt) {
|
|
194708
|
+
if (cxt.schema)
|
|
194709
|
+
(0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
|
|
194710
|
+
else
|
|
194711
|
+
(0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
|
|
194712
|
+
}
|
|
194713
|
+
};
|
|
194714
|
+
exports.default = def;
|
|
194715
|
+
});
|
|
194716
|
+
var require_recursiveRef = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194717
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194718
|
+
const dynamicRef_1 = require_dynamicRef();
|
|
194719
|
+
const def = {
|
|
194720
|
+
keyword: "$recursiveRef",
|
|
194721
|
+
schemaType: "string",
|
|
194722
|
+
code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
|
|
194723
|
+
};
|
|
194724
|
+
exports.default = def;
|
|
194725
|
+
});
|
|
194726
|
+
var require_dynamic = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
195099
194727
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195100
|
-
|
|
195101
|
-
|
|
195102
|
-
|
|
195103
|
-
|
|
195104
|
-
|
|
195105
|
-
|
|
195106
|
-
|
|
195107
|
-
|
|
195108
|
-
|
|
195109
|
-
|
|
195110
|
-
|
|
195111
|
-
|
|
195112
|
-
|
|
195113
|
-
|
|
195114
|
-
|
|
195115
|
-
|
|
195116
|
-
|
|
195117
|
-
|
|
195118
|
-
|
|
195119
|
-
|
|
195120
|
-
|
|
195121
|
-
ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
195122
|
-
regex,
|
|
195123
|
-
uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
|
|
195124
|
-
"json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
|
|
195125
|
-
"json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
|
|
195126
|
-
"relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
|
|
195127
|
-
byte,
|
|
195128
|
-
int32: {
|
|
195129
|
-
type: "number",
|
|
195130
|
-
validate: validateInt32
|
|
195131
|
-
},
|
|
195132
|
-
int64: {
|
|
195133
|
-
type: "number",
|
|
195134
|
-
validate: validateInt64
|
|
195135
|
-
},
|
|
195136
|
-
float: {
|
|
195137
|
-
type: "number",
|
|
195138
|
-
validate: validateNumber
|
|
195139
|
-
},
|
|
195140
|
-
double: {
|
|
195141
|
-
type: "number",
|
|
195142
|
-
validate: validateNumber
|
|
195143
|
-
},
|
|
195144
|
-
password: true,
|
|
195145
|
-
binary: true
|
|
194728
|
+
const dynamicAnchor_1 = require_dynamicAnchor();
|
|
194729
|
+
const dynamicRef_1 = require_dynamicRef();
|
|
194730
|
+
const recursiveAnchor_1 = require_recursiveAnchor();
|
|
194731
|
+
const recursiveRef_1 = require_recursiveRef();
|
|
194732
|
+
const dynamic = [
|
|
194733
|
+
dynamicAnchor_1.default,
|
|
194734
|
+
dynamicRef_1.default,
|
|
194735
|
+
recursiveAnchor_1.default,
|
|
194736
|
+
recursiveRef_1.default
|
|
194737
|
+
];
|
|
194738
|
+
exports.default = dynamic;
|
|
194739
|
+
});
|
|
194740
|
+
var require_dependentRequired = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194741
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194742
|
+
const dependencies_1 = require_dependencies();
|
|
194743
|
+
const def = {
|
|
194744
|
+
keyword: "dependentRequired",
|
|
194745
|
+
type: "object",
|
|
194746
|
+
schemaType: "object",
|
|
194747
|
+
error: dependencies_1.error,
|
|
194748
|
+
code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)
|
|
195146
194749
|
};
|
|
195147
|
-
exports.
|
|
195148
|
-
|
|
195149
|
-
|
|
195150
|
-
|
|
195151
|
-
|
|
195152
|
-
|
|
195153
|
-
"
|
|
195154
|
-
|
|
195155
|
-
"
|
|
195156
|
-
|
|
194750
|
+
exports.default = def;
|
|
194751
|
+
});
|
|
194752
|
+
var require_dependentSchemas = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194753
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194754
|
+
const dependencies_1 = require_dependencies();
|
|
194755
|
+
const def = {
|
|
194756
|
+
keyword: "dependentSchemas",
|
|
194757
|
+
type: "object",
|
|
194758
|
+
schemaType: "object",
|
|
194759
|
+
code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)
|
|
195157
194760
|
};
|
|
195158
|
-
exports.
|
|
195159
|
-
|
|
195160
|
-
|
|
195161
|
-
}
|
|
195162
|
-
const
|
|
195163
|
-
const
|
|
195164
|
-
|
|
195165
|
-
|
|
195166
|
-
|
|
195167
|
-
|
|
195168
|
-
|
|
195169
|
-
|
|
195170
|
-
|
|
195171
|
-
|
|
195172
|
-
|
|
195173
|
-
|
|
195174
|
-
|
|
195175
|
-
|
|
195176
|
-
|
|
195177
|
-
|
|
195178
|
-
|
|
195179
|
-
|
|
195180
|
-
|
|
195181
|
-
|
|
195182
|
-
|
|
195183
|
-
|
|
195184
|
-
|
|
195185
|
-
|
|
195186
|
-
|
|
195187
|
-
|
|
195188
|
-
|
|
195189
|
-
|
|
195190
|
-
|
|
195191
|
-
|
|
195192
|
-
|
|
195193
|
-
|
|
195194
|
-
|
|
195195
|
-
|
|
195196
|
-
|
|
195197
|
-
|
|
195198
|
-
|
|
195199
|
-
|
|
195200
|
-
|
|
195201
|
-
|
|
195202
|
-
|
|
195203
|
-
|
|
195204
|
-
const
|
|
195205
|
-
|
|
195206
|
-
|
|
195207
|
-
|
|
195208
|
-
|
|
195209
|
-
|
|
195210
|
-
|
|
195211
|
-
|
|
195212
|
-
|
|
195213
|
-
|
|
195214
|
-
|
|
195215
|
-
|
|
195216
|
-
|
|
195217
|
-
|
|
195218
|
-
|
|
195219
|
-
|
|
195220
|
-
|
|
195221
|
-
|
|
195222
|
-
|
|
195223
|
-
|
|
195224
|
-
|
|
195225
|
-
|
|
195226
|
-
|
|
195227
|
-
|
|
195228
|
-
|
|
195229
|
-
|
|
195230
|
-
|
|
195231
|
-
|
|
195232
|
-
|
|
195233
|
-
|
|
195234
|
-
|
|
195235
|
-
|
|
195236
|
-
|
|
195237
|
-
|
|
195238
|
-
|
|
195239
|
-
|
|
195240
|
-
return 0;
|
|
195241
|
-
}
|
|
195242
|
-
const DATE_TIME_SEPARATOR = /t|\s/i;
|
|
195243
|
-
function getDateTime(strictTimeZone) {
|
|
195244
|
-
const time3 = getTime(strictTimeZone);
|
|
195245
|
-
return function date_time(str) {
|
|
195246
|
-
const dateTime = str.split(DATE_TIME_SEPARATOR);
|
|
195247
|
-
return dateTime.length === 2 && date5(dateTime[0]) && time3(dateTime[1]);
|
|
195248
|
-
};
|
|
195249
|
-
}
|
|
195250
|
-
function compareDateTime(dt1, dt2) {
|
|
195251
|
-
if (!(dt1 && dt2))
|
|
195252
|
-
return;
|
|
195253
|
-
const d1 = new Date(dt1).valueOf();
|
|
195254
|
-
const d2 = new Date(dt2).valueOf();
|
|
195255
|
-
if (!(d1 && d2))
|
|
195256
|
-
return;
|
|
195257
|
-
return d1 - d2;
|
|
195258
|
-
}
|
|
195259
|
-
function compareIsoDateTime(dt1, dt2) {
|
|
195260
|
-
if (!(dt1 && dt2))
|
|
195261
|
-
return;
|
|
195262
|
-
const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
|
|
195263
|
-
const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
|
|
195264
|
-
const res = compareDate(d1, d2);
|
|
195265
|
-
if (res === undefined)
|
|
195266
|
-
return;
|
|
195267
|
-
return res || compareTime(t1, t2);
|
|
195268
|
-
}
|
|
195269
|
-
const NOT_URI_FRAGMENT = /\/|:/;
|
|
195270
|
-
const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
195271
|
-
function uri(str) {
|
|
195272
|
-
return NOT_URI_FRAGMENT.test(str) && URI.test(str);
|
|
195273
|
-
}
|
|
195274
|
-
const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
195275
|
-
function byte(str) {
|
|
195276
|
-
BYTE.lastIndex = 0;
|
|
195277
|
-
return BYTE.test(str);
|
|
195278
|
-
}
|
|
195279
|
-
const MIN_INT32 = -(2 ** 31);
|
|
195280
|
-
const MAX_INT32 = 2 ** 31 - 1;
|
|
195281
|
-
function validateInt32(value) {
|
|
195282
|
-
return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
|
|
195283
|
-
}
|
|
195284
|
-
function validateInt64(value) {
|
|
195285
|
-
return Number.isInteger(value);
|
|
195286
|
-
}
|
|
195287
|
-
function validateNumber() {
|
|
195288
|
-
return true;
|
|
195289
|
-
}
|
|
195290
|
-
const Z_ANCHOR = /[^\\]\\Z/;
|
|
195291
|
-
function regex(str) {
|
|
195292
|
-
if (Z_ANCHOR.test(str))
|
|
195293
|
-
return false;
|
|
195294
|
-
try {
|
|
195295
|
-
new RegExp(str);
|
|
195296
|
-
return true;
|
|
195297
|
-
} catch (e) {
|
|
195298
|
-
return false;
|
|
194761
|
+
exports.default = def;
|
|
194762
|
+
});
|
|
194763
|
+
var require_limitContains = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194764
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194765
|
+
const util_1 = require_util();
|
|
194766
|
+
const def = {
|
|
194767
|
+
keyword: ["maxContains", "minContains"],
|
|
194768
|
+
type: "array",
|
|
194769
|
+
schemaType: "number",
|
|
194770
|
+
code({ keyword, parentSchema, it }) {
|
|
194771
|
+
if (parentSchema.contains === undefined)
|
|
194772
|
+
(0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
|
|
194773
|
+
}
|
|
194774
|
+
};
|
|
194775
|
+
exports.default = def;
|
|
194776
|
+
});
|
|
194777
|
+
var require_next = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194778
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194779
|
+
const dependentRequired_1 = require_dependentRequired();
|
|
194780
|
+
const dependentSchemas_1 = require_dependentSchemas();
|
|
194781
|
+
const limitContains_1 = require_limitContains();
|
|
194782
|
+
const next = [
|
|
194783
|
+
dependentRequired_1.default,
|
|
194784
|
+
dependentSchemas_1.default,
|
|
194785
|
+
limitContains_1.default
|
|
194786
|
+
];
|
|
194787
|
+
exports.default = next;
|
|
194788
|
+
});
|
|
194789
|
+
var require_unevaluatedProperties = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194790
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194791
|
+
const codegen_1 = require_codegen();
|
|
194792
|
+
const util_1 = require_util();
|
|
194793
|
+
const names_1 = require_names();
|
|
194794
|
+
const def = {
|
|
194795
|
+
keyword: "unevaluatedProperties",
|
|
194796
|
+
type: "object",
|
|
194797
|
+
schemaType: ["boolean", "object"],
|
|
194798
|
+
trackErrors: true,
|
|
194799
|
+
error: {
|
|
194800
|
+
message: "must NOT have unevaluated properties",
|
|
194801
|
+
params: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`
|
|
194802
|
+
},
|
|
194803
|
+
code(cxt) {
|
|
194804
|
+
const { gen, schema, data, errsCount, it } = cxt;
|
|
194805
|
+
if (!errsCount)
|
|
194806
|
+
throw new Error("ajv implementation error");
|
|
194807
|
+
const { allErrors, props } = it;
|
|
194808
|
+
if (props instanceof codegen_1.Name)
|
|
194809
|
+
gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
|
|
194810
|
+
else if (props !== true)
|
|
194811
|
+
gen.forIn("key", data, (key) => props === undefined ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
|
|
194812
|
+
it.props = true;
|
|
194813
|
+
cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
194814
|
+
function unevaluatedPropCode(key) {
|
|
194815
|
+
if (schema === false) {
|
|
194816
|
+
cxt.setParams({ unevaluatedProperty: key });
|
|
194817
|
+
cxt.error();
|
|
194818
|
+
if (!allErrors)
|
|
194819
|
+
gen.break();
|
|
194820
|
+
return;
|
|
194821
|
+
}
|
|
194822
|
+
if (!(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
194823
|
+
const valid = gen.name("valid");
|
|
194824
|
+
cxt.subschema({
|
|
194825
|
+
keyword: "unevaluatedProperties",
|
|
194826
|
+
dataProp: key,
|
|
194827
|
+
dataPropType: util_1.Type.Str
|
|
194828
|
+
}, valid);
|
|
194829
|
+
if (!allErrors)
|
|
194830
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
194831
|
+
}
|
|
194832
|
+
}
|
|
194833
|
+
function unevaluatedDynamic(evaluatedProps, key) {
|
|
194834
|
+
return (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;
|
|
194835
|
+
}
|
|
194836
|
+
function unevaluatedStatic(evaluatedProps, key) {
|
|
194837
|
+
const ps = [];
|
|
194838
|
+
for (const p in evaluatedProps)
|
|
194839
|
+
if (evaluatedProps[p] === true)
|
|
194840
|
+
ps.push((0, codegen_1._)`${key} !== ${p}`);
|
|
194841
|
+
return (0, codegen_1.and)(...ps);
|
|
194842
|
+
}
|
|
195299
194843
|
}
|
|
195300
|
-
}
|
|
194844
|
+
};
|
|
194845
|
+
exports.default = def;
|
|
195301
194846
|
});
|
|
195302
|
-
var
|
|
194847
|
+
var require_unevaluatedItems = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194848
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194849
|
+
const codegen_1 = require_codegen();
|
|
194850
|
+
const util_1 = require_util();
|
|
194851
|
+
const def = {
|
|
194852
|
+
keyword: "unevaluatedItems",
|
|
194853
|
+
type: "array",
|
|
194854
|
+
schemaType: ["boolean", "object"],
|
|
194855
|
+
error: {
|
|
194856
|
+
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
194857
|
+
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
194858
|
+
},
|
|
194859
|
+
code(cxt) {
|
|
194860
|
+
const { gen, schema, data, it } = cxt;
|
|
194861
|
+
const items = it.items || 0;
|
|
194862
|
+
if (items === true)
|
|
194863
|
+
return;
|
|
194864
|
+
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
194865
|
+
if (schema === false) {
|
|
194866
|
+
cxt.setParams({ len: items });
|
|
194867
|
+
cxt.fail((0, codegen_1._)`${len} > ${items}`);
|
|
194868
|
+
} else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
194869
|
+
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`);
|
|
194870
|
+
gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
|
|
194871
|
+
cxt.ok(valid);
|
|
194872
|
+
}
|
|
194873
|
+
it.items = true;
|
|
194874
|
+
function validateItems(valid, from) {
|
|
194875
|
+
gen.forRange("i", from, len, (i) => {
|
|
194876
|
+
cxt.subschema({
|
|
194877
|
+
keyword: "unevaluatedItems",
|
|
194878
|
+
dataProp: i,
|
|
194879
|
+
dataPropType: util_1.Type.Num
|
|
194880
|
+
}, valid);
|
|
194881
|
+
if (!it.allErrors)
|
|
194882
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
194883
|
+
});
|
|
194884
|
+
}
|
|
194885
|
+
}
|
|
194886
|
+
};
|
|
194887
|
+
exports.default = def;
|
|
194888
|
+
});
|
|
194889
|
+
var require_unevaluated$1 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
194890
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
194891
|
+
const unevaluatedProperties_1 = require_unevaluatedProperties();
|
|
194892
|
+
const unevaluatedItems_1 = require_unevaluatedItems();
|
|
194893
|
+
const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
|
|
194894
|
+
exports.default = unevaluated;
|
|
194895
|
+
});
|
|
194896
|
+
var require_draft2020 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
195303
194897
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195304
194898
|
const core_1 = require_core$1();
|
|
195305
194899
|
const validation_1 = require_validation$1();
|
|
195306
194900
|
const applicator_1 = require_applicator$1();
|
|
194901
|
+
const dynamic_1 = require_dynamic();
|
|
194902
|
+
const next_1 = require_next();
|
|
194903
|
+
const unevaluated_1 = require_unevaluated$1();
|
|
195307
194904
|
const format_1 = require_format();
|
|
195308
194905
|
const metadata_1 = require_metadata();
|
|
195309
|
-
const
|
|
194906
|
+
const draft2020Vocabularies = [
|
|
194907
|
+
dynamic_1.default,
|
|
195310
194908
|
core_1.default,
|
|
195311
194909
|
validation_1.default,
|
|
195312
|
-
(0, applicator_1.default)(),
|
|
194910
|
+
(0, applicator_1.default)(true),
|
|
195313
194911
|
format_1.default,
|
|
195314
194912
|
metadata_1.metadataVocabulary,
|
|
195315
|
-
metadata_1.contentVocabulary
|
|
194913
|
+
metadata_1.contentVocabulary,
|
|
194914
|
+
next_1.default,
|
|
194915
|
+
unevaluated_1.default
|
|
195316
194916
|
];
|
|
195317
|
-
exports.default =
|
|
194917
|
+
exports.default = draft2020Vocabularies;
|
|
194918
|
+
});
|
|
194919
|
+
var require_schema = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194920
|
+
module.exports = {
|
|
194921
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194922
|
+
$id: "https://json-schema.org/draft/2020-12/schema",
|
|
194923
|
+
$vocabulary: {
|
|
194924
|
+
"https://json-schema.org/draft/2020-12/vocab/core": true,
|
|
194925
|
+
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
|
|
194926
|
+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
|
|
194927
|
+
"https://json-schema.org/draft/2020-12/vocab/validation": true,
|
|
194928
|
+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
|
|
194929
|
+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
|
|
194930
|
+
"https://json-schema.org/draft/2020-12/vocab/content": true
|
|
194931
|
+
},
|
|
194932
|
+
$dynamicAnchor: "meta",
|
|
194933
|
+
title: "Core and Validation specifications meta-schema",
|
|
194934
|
+
allOf: [
|
|
194935
|
+
{ $ref: "meta/core" },
|
|
194936
|
+
{ $ref: "meta/applicator" },
|
|
194937
|
+
{ $ref: "meta/unevaluated" },
|
|
194938
|
+
{ $ref: "meta/validation" },
|
|
194939
|
+
{ $ref: "meta/meta-data" },
|
|
194940
|
+
{ $ref: "meta/format-annotation" },
|
|
194941
|
+
{ $ref: "meta/content" }
|
|
194942
|
+
],
|
|
194943
|
+
type: ["object", "boolean"],
|
|
194944
|
+
$comment: "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
|
|
194945
|
+
properties: {
|
|
194946
|
+
definitions: {
|
|
194947
|
+
$comment: '"definitions" has been replaced by "$defs".',
|
|
194948
|
+
type: "object",
|
|
194949
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
194950
|
+
deprecated: true,
|
|
194951
|
+
default: {}
|
|
194952
|
+
},
|
|
194953
|
+
dependencies: {
|
|
194954
|
+
$comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
|
|
194955
|
+
type: "object",
|
|
194956
|
+
additionalProperties: { anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] },
|
|
194957
|
+
deprecated: true,
|
|
194958
|
+
default: {}
|
|
194959
|
+
},
|
|
194960
|
+
$recursiveAnchor: {
|
|
194961
|
+
$comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
|
|
194962
|
+
$ref: "meta/core#/$defs/anchorString",
|
|
194963
|
+
deprecated: true
|
|
194964
|
+
},
|
|
194965
|
+
$recursiveRef: {
|
|
194966
|
+
$comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
|
|
194967
|
+
$ref: "meta/core#/$defs/uriReferenceString",
|
|
194968
|
+
deprecated: true
|
|
194969
|
+
}
|
|
194970
|
+
}
|
|
194971
|
+
};
|
|
194972
|
+
});
|
|
194973
|
+
var require_applicator = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
194974
|
+
module.exports = {
|
|
194975
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
194976
|
+
$id: "https://json-schema.org/draft/2020-12/meta/applicator",
|
|
194977
|
+
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/applicator": true },
|
|
194978
|
+
$dynamicAnchor: "meta",
|
|
194979
|
+
title: "Applicator vocabulary meta-schema",
|
|
194980
|
+
type: ["object", "boolean"],
|
|
194981
|
+
properties: {
|
|
194982
|
+
prefixItems: { $ref: "#/$defs/schemaArray" },
|
|
194983
|
+
items: { $dynamicRef: "#meta" },
|
|
194984
|
+
contains: { $dynamicRef: "#meta" },
|
|
194985
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
194986
|
+
properties: {
|
|
194987
|
+
type: "object",
|
|
194988
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
194989
|
+
default: {}
|
|
194990
|
+
},
|
|
194991
|
+
patternProperties: {
|
|
194992
|
+
type: "object",
|
|
194993
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
194994
|
+
propertyNames: { format: "regex" },
|
|
194995
|
+
default: {}
|
|
194996
|
+
},
|
|
194997
|
+
dependentSchemas: {
|
|
194998
|
+
type: "object",
|
|
194999
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
195000
|
+
default: {}
|
|
195001
|
+
},
|
|
195002
|
+
propertyNames: { $dynamicRef: "#meta" },
|
|
195003
|
+
if: { $dynamicRef: "#meta" },
|
|
195004
|
+
then: { $dynamicRef: "#meta" },
|
|
195005
|
+
else: { $dynamicRef: "#meta" },
|
|
195006
|
+
allOf: { $ref: "#/$defs/schemaArray" },
|
|
195007
|
+
anyOf: { $ref: "#/$defs/schemaArray" },
|
|
195008
|
+
oneOf: { $ref: "#/$defs/schemaArray" },
|
|
195009
|
+
not: { $dynamicRef: "#meta" }
|
|
195010
|
+
},
|
|
195011
|
+
$defs: { schemaArray: {
|
|
195012
|
+
type: "array",
|
|
195013
|
+
minItems: 1,
|
|
195014
|
+
items: { $dynamicRef: "#meta" }
|
|
195015
|
+
} }
|
|
195016
|
+
};
|
|
195017
|
+
});
|
|
195018
|
+
var require_unevaluated = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195019
|
+
module.exports = {
|
|
195020
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
195021
|
+
$id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
|
195022
|
+
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/unevaluated": true },
|
|
195023
|
+
$dynamicAnchor: "meta",
|
|
195024
|
+
title: "Unevaluated applicator vocabulary meta-schema",
|
|
195025
|
+
type: ["object", "boolean"],
|
|
195026
|
+
properties: {
|
|
195027
|
+
unevaluatedItems: { $dynamicRef: "#meta" },
|
|
195028
|
+
unevaluatedProperties: { $dynamicRef: "#meta" }
|
|
195029
|
+
}
|
|
195030
|
+
};
|
|
195031
|
+
});
|
|
195032
|
+
var require_content = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195033
|
+
module.exports = {
|
|
195034
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
195035
|
+
$id: "https://json-schema.org/draft/2020-12/meta/content",
|
|
195036
|
+
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/content": true },
|
|
195037
|
+
$dynamicAnchor: "meta",
|
|
195038
|
+
title: "Content vocabulary meta-schema",
|
|
195039
|
+
type: ["object", "boolean"],
|
|
195040
|
+
properties: {
|
|
195041
|
+
contentEncoding: { type: "string" },
|
|
195042
|
+
contentMediaType: { type: "string" },
|
|
195043
|
+
contentSchema: { $dynamicRef: "#meta" }
|
|
195044
|
+
}
|
|
195045
|
+
};
|
|
195318
195046
|
});
|
|
195319
|
-
var
|
|
195047
|
+
var require_core = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195320
195048
|
module.exports = {
|
|
195321
|
-
$schema: "
|
|
195322
|
-
$id: "
|
|
195323
|
-
|
|
195324
|
-
|
|
195325
|
-
|
|
195326
|
-
|
|
195327
|
-
|
|
195328
|
-
|
|
195049
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
195050
|
+
$id: "https://json-schema.org/draft/2020-12/meta/core",
|
|
195051
|
+
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/core": true },
|
|
195052
|
+
$dynamicAnchor: "meta",
|
|
195053
|
+
title: "Core vocabulary meta-schema",
|
|
195054
|
+
type: ["object", "boolean"],
|
|
195055
|
+
properties: {
|
|
195056
|
+
$id: {
|
|
195057
|
+
$ref: "#/$defs/uriReferenceString",
|
|
195058
|
+
$comment: "Non-empty fragments not allowed.",
|
|
195059
|
+
pattern: "^[^#]*#?$"
|
|
195329
195060
|
},
|
|
195330
|
-
|
|
195331
|
-
|
|
195332
|
-
|
|
195061
|
+
$schema: { $ref: "#/$defs/uriString" },
|
|
195062
|
+
$ref: { $ref: "#/$defs/uriReferenceString" },
|
|
195063
|
+
$anchor: { $ref: "#/$defs/anchorString" },
|
|
195064
|
+
$dynamicRef: { $ref: "#/$defs/uriReferenceString" },
|
|
195065
|
+
$dynamicAnchor: { $ref: "#/$defs/anchorString" },
|
|
195066
|
+
$vocabulary: {
|
|
195067
|
+
type: "object",
|
|
195068
|
+
propertyNames: { $ref: "#/$defs/uriString" },
|
|
195069
|
+
additionalProperties: { type: "boolean" }
|
|
195333
195070
|
},
|
|
195334
|
-
|
|
195335
|
-
|
|
195336
|
-
"
|
|
195337
|
-
"
|
|
195338
|
-
"integer",
|
|
195339
|
-
"null",
|
|
195340
|
-
"number",
|
|
195341
|
-
"object",
|
|
195342
|
-
"string"
|
|
195343
|
-
] },
|
|
195344
|
-
stringArray: {
|
|
195345
|
-
type: "array",
|
|
195346
|
-
items: { type: "string" },
|
|
195347
|
-
uniqueItems: true,
|
|
195348
|
-
default: []
|
|
195071
|
+
$comment: { type: "string" },
|
|
195072
|
+
$defs: {
|
|
195073
|
+
type: "object",
|
|
195074
|
+
additionalProperties: { $dynamicRef: "#meta" }
|
|
195349
195075
|
}
|
|
195350
195076
|
},
|
|
195351
|
-
|
|
195352
|
-
|
|
195353
|
-
$id: {
|
|
195077
|
+
$defs: {
|
|
195078
|
+
anchorString: {
|
|
195354
195079
|
type: "string",
|
|
195355
|
-
|
|
195080
|
+
pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
|
|
195356
195081
|
},
|
|
195357
|
-
|
|
195082
|
+
uriString: {
|
|
195358
195083
|
type: "string",
|
|
195359
195084
|
format: "uri"
|
|
195360
195085
|
},
|
|
195361
|
-
|
|
195086
|
+
uriReferenceString: {
|
|
195362
195087
|
type: "string",
|
|
195363
195088
|
format: "uri-reference"
|
|
195364
|
-
}
|
|
195365
|
-
|
|
195089
|
+
}
|
|
195090
|
+
}
|
|
195091
|
+
};
|
|
195092
|
+
});
|
|
195093
|
+
var require_format_annotation = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195094
|
+
module.exports = {
|
|
195095
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
195096
|
+
$id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
|
195097
|
+
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/format-annotation": true },
|
|
195098
|
+
$dynamicAnchor: "meta",
|
|
195099
|
+
title: "Format vocabulary meta-schema for annotation results",
|
|
195100
|
+
type: ["object", "boolean"],
|
|
195101
|
+
properties: { format: { type: "string" } }
|
|
195102
|
+
};
|
|
195103
|
+
});
|
|
195104
|
+
var require_meta_data = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195105
|
+
module.exports = {
|
|
195106
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
195107
|
+
$id: "https://json-schema.org/draft/2020-12/meta/meta-data",
|
|
195108
|
+
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/meta-data": true },
|
|
195109
|
+
$dynamicAnchor: "meta",
|
|
195110
|
+
title: "Meta-data vocabulary meta-schema",
|
|
195111
|
+
type: ["object", "boolean"],
|
|
195112
|
+
properties: {
|
|
195366
195113
|
title: { type: "string" },
|
|
195367
195114
|
description: { type: "string" },
|
|
195368
195115
|
default: true,
|
|
195116
|
+
deprecated: {
|
|
195117
|
+
type: "boolean",
|
|
195118
|
+
default: false
|
|
195119
|
+
},
|
|
195369
195120
|
readOnly: {
|
|
195370
195121
|
type: "boolean",
|
|
195371
195122
|
default: false
|
|
195372
195123
|
},
|
|
195124
|
+
writeOnly: {
|
|
195125
|
+
type: "boolean",
|
|
195126
|
+
default: false
|
|
195127
|
+
},
|
|
195373
195128
|
examples: {
|
|
195374
195129
|
type: "array",
|
|
195375
195130
|
items: true
|
|
195131
|
+
}
|
|
195132
|
+
}
|
|
195133
|
+
};
|
|
195134
|
+
});
|
|
195135
|
+
var require_validation = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195136
|
+
module.exports = {
|
|
195137
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
195138
|
+
$id: "https://json-schema.org/draft/2020-12/meta/validation",
|
|
195139
|
+
$vocabulary: { "https://json-schema.org/draft/2020-12/vocab/validation": true },
|
|
195140
|
+
$dynamicAnchor: "meta",
|
|
195141
|
+
title: "Validation vocabulary meta-schema",
|
|
195142
|
+
type: ["object", "boolean"],
|
|
195143
|
+
properties: {
|
|
195144
|
+
type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, {
|
|
195145
|
+
type: "array",
|
|
195146
|
+
items: { $ref: "#/$defs/simpleTypes" },
|
|
195147
|
+
minItems: 1,
|
|
195148
|
+
uniqueItems: true
|
|
195149
|
+
}] },
|
|
195150
|
+
const: true,
|
|
195151
|
+
enum: {
|
|
195152
|
+
type: "array",
|
|
195153
|
+
items: true
|
|
195376
195154
|
},
|
|
195377
195155
|
multipleOf: {
|
|
195378
195156
|
type: "number",
|
|
@@ -195382,109 +195160,127 @@ var require_json_schema_draft_07 = /* @__PURE__ */ __commonJSMin((exports, modul
|
|
|
195382
195160
|
exclusiveMaximum: { type: "number" },
|
|
195383
195161
|
minimum: { type: "number" },
|
|
195384
195162
|
exclusiveMinimum: { type: "number" },
|
|
195385
|
-
maxLength: { $ref: "
|
|
195386
|
-
minLength: { $ref: "
|
|
195163
|
+
maxLength: { $ref: "#/$defs/nonNegativeInteger" },
|
|
195164
|
+
minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
195387
195165
|
pattern: {
|
|
195388
195166
|
type: "string",
|
|
195389
195167
|
format: "regex"
|
|
195390
195168
|
},
|
|
195391
|
-
|
|
195392
|
-
|
|
195393
|
-
anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
|
|
195394
|
-
default: true
|
|
195395
|
-
},
|
|
195396
|
-
maxItems: { $ref: "#/definitions/nonNegativeInteger" },
|
|
195397
|
-
minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
|
|
195169
|
+
maxItems: { $ref: "#/$defs/nonNegativeInteger" },
|
|
195170
|
+
minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
195398
195171
|
uniqueItems: {
|
|
195399
195172
|
type: "boolean",
|
|
195400
195173
|
default: false
|
|
195401
195174
|
},
|
|
195402
|
-
|
|
195403
|
-
|
|
195404
|
-
|
|
195405
|
-
|
|
195406
|
-
additionalProperties: { $ref: "#" },
|
|
195407
|
-
definitions: {
|
|
195408
|
-
type: "object",
|
|
195409
|
-
additionalProperties: { $ref: "#" },
|
|
195410
|
-
default: {}
|
|
195411
|
-
},
|
|
195412
|
-
properties: {
|
|
195413
|
-
type: "object",
|
|
195414
|
-
additionalProperties: { $ref: "#" },
|
|
195415
|
-
default: {}
|
|
195416
|
-
},
|
|
195417
|
-
patternProperties: {
|
|
195418
|
-
type: "object",
|
|
195419
|
-
additionalProperties: { $ref: "#" },
|
|
195420
|
-
propertyNames: { format: "regex" },
|
|
195421
|
-
default: {}
|
|
195175
|
+
maxContains: { $ref: "#/$defs/nonNegativeInteger" },
|
|
195176
|
+
minContains: {
|
|
195177
|
+
$ref: "#/$defs/nonNegativeInteger",
|
|
195178
|
+
default: 1
|
|
195422
195179
|
},
|
|
195423
|
-
|
|
195180
|
+
maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
|
|
195181
|
+
minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
195182
|
+
required: { $ref: "#/$defs/stringArray" },
|
|
195183
|
+
dependentRequired: {
|
|
195424
195184
|
type: "object",
|
|
195425
|
-
additionalProperties: {
|
|
195185
|
+
additionalProperties: { $ref: "#/$defs/stringArray" }
|
|
195186
|
+
}
|
|
195187
|
+
},
|
|
195188
|
+
$defs: {
|
|
195189
|
+
nonNegativeInteger: {
|
|
195190
|
+
type: "integer",
|
|
195191
|
+
minimum: 0
|
|
195426
195192
|
},
|
|
195427
|
-
|
|
195428
|
-
|
|
195429
|
-
|
|
195430
|
-
type: "array",
|
|
195431
|
-
items: true,
|
|
195432
|
-
minItems: 1,
|
|
195433
|
-
uniqueItems: true
|
|
195193
|
+
nonNegativeIntegerDefault0: {
|
|
195194
|
+
$ref: "#/$defs/nonNegativeInteger",
|
|
195195
|
+
default: 0
|
|
195434
195196
|
},
|
|
195435
|
-
|
|
195197
|
+
simpleTypes: { enum: [
|
|
195198
|
+
"array",
|
|
195199
|
+
"boolean",
|
|
195200
|
+
"integer",
|
|
195201
|
+
"null",
|
|
195202
|
+
"number",
|
|
195203
|
+
"object",
|
|
195204
|
+
"string"
|
|
195205
|
+
] },
|
|
195206
|
+
stringArray: {
|
|
195436
195207
|
type: "array",
|
|
195437
|
-
items: {
|
|
195438
|
-
|
|
195439
|
-
|
|
195440
|
-
}
|
|
195441
|
-
|
|
195442
|
-
contentMediaType: { type: "string" },
|
|
195443
|
-
contentEncoding: { type: "string" },
|
|
195444
|
-
if: { $ref: "#" },
|
|
195445
|
-
then: { $ref: "#" },
|
|
195446
|
-
else: { $ref: "#" },
|
|
195447
|
-
allOf: { $ref: "#/definitions/schemaArray" },
|
|
195448
|
-
anyOf: { $ref: "#/definitions/schemaArray" },
|
|
195449
|
-
oneOf: { $ref: "#/definitions/schemaArray" },
|
|
195450
|
-
not: { $ref: "#" }
|
|
195451
|
-
},
|
|
195452
|
-
default: true
|
|
195208
|
+
items: { type: "string" },
|
|
195209
|
+
uniqueItems: true,
|
|
195210
|
+
default: []
|
|
195211
|
+
}
|
|
195212
|
+
}
|
|
195453
195213
|
};
|
|
195454
195214
|
});
|
|
195455
|
-
var
|
|
195215
|
+
var require_json_schema_2020_12 = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
195456
195216
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195457
|
-
|
|
195458
|
-
const
|
|
195459
|
-
const
|
|
195460
|
-
const
|
|
195461
|
-
const
|
|
195217
|
+
const metaSchema = require_schema();
|
|
195218
|
+
const applicator = require_applicator();
|
|
195219
|
+
const unevaluated = require_unevaluated();
|
|
195220
|
+
const content = require_content();
|
|
195221
|
+
const core2 = require_core();
|
|
195222
|
+
const format = require_format_annotation();
|
|
195223
|
+
const metadata = require_meta_data();
|
|
195224
|
+
const validation = require_validation();
|
|
195462
195225
|
const META_SUPPORT_DATA = ["/properties"];
|
|
195463
|
-
|
|
195464
|
-
|
|
195226
|
+
function addMetaSchema2020($data) {
|
|
195227
|
+
[
|
|
195228
|
+
metaSchema,
|
|
195229
|
+
applicator,
|
|
195230
|
+
unevaluated,
|
|
195231
|
+
content,
|
|
195232
|
+
core2,
|
|
195233
|
+
with$data(this, format),
|
|
195234
|
+
metadata,
|
|
195235
|
+
with$data(this, validation)
|
|
195236
|
+
].forEach((sch) => this.addMetaSchema(sch, undefined, false));
|
|
195237
|
+
return this;
|
|
195238
|
+
function with$data(ajv, sch) {
|
|
195239
|
+
return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
|
|
195240
|
+
}
|
|
195241
|
+
}
|
|
195242
|
+
exports.default = addMetaSchema2020;
|
|
195243
|
+
});
|
|
195244
|
+
var require__2020 = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
195245
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195246
|
+
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = undefined;
|
|
195247
|
+
const core_1 = require_core$2();
|
|
195248
|
+
const draft2020_1 = require_draft2020();
|
|
195249
|
+
const discriminator_1 = require_discriminator();
|
|
195250
|
+
const json_schema_2020_12_1 = require_json_schema_2020_12();
|
|
195251
|
+
const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema";
|
|
195252
|
+
var Ajv2020 = class extends core_1.default {
|
|
195253
|
+
constructor(opts = {}) {
|
|
195254
|
+
super({
|
|
195255
|
+
...opts,
|
|
195256
|
+
dynamicRef: true,
|
|
195257
|
+
next: true,
|
|
195258
|
+
unevaluated: true
|
|
195259
|
+
});
|
|
195260
|
+
}
|
|
195465
195261
|
_addVocabularies() {
|
|
195466
195262
|
super._addVocabularies();
|
|
195467
|
-
|
|
195263
|
+
draft2020_1.default.forEach((v) => this.addVocabulary(v));
|
|
195468
195264
|
if (this.opts.discriminator)
|
|
195469
195265
|
this.addKeyword(discriminator_1.default);
|
|
195470
195266
|
}
|
|
195471
195267
|
_addDefaultMetaSchema() {
|
|
195472
195268
|
super._addDefaultMetaSchema();
|
|
195473
|
-
|
|
195269
|
+
const { $data, meta: meta3 } = this.opts;
|
|
195270
|
+
if (!meta3)
|
|
195474
195271
|
return;
|
|
195475
|
-
|
|
195476
|
-
this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
|
|
195272
|
+
json_schema_2020_12_1.default.call(this, $data);
|
|
195477
195273
|
this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
|
|
195478
195274
|
}
|
|
195479
195275
|
defaultMeta() {
|
|
195480
195276
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined);
|
|
195481
195277
|
}
|
|
195482
195278
|
};
|
|
195483
|
-
exports.
|
|
195484
|
-
module.exports = exports =
|
|
195485
|
-
module.exports.
|
|
195279
|
+
exports.Ajv2020 = Ajv2020;
|
|
195280
|
+
module.exports = exports = Ajv2020;
|
|
195281
|
+
module.exports.Ajv2020 = Ajv2020;
|
|
195486
195282
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195487
|
-
exports.default =
|
|
195283
|
+
exports.default = Ajv2020;
|
|
195488
195284
|
var validate_1 = require_validate();
|
|
195489
195285
|
Object.defineProperty(exports, "KeywordCxt", {
|
|
195490
195286
|
enumerable: true,
|
|
@@ -195544,6 +195340,210 @@ var require_ajv = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
|
195544
195340
|
}
|
|
195545
195341
|
});
|
|
195546
195342
|
});
|
|
195343
|
+
var require_formats = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
195344
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195345
|
+
exports.formatNames = exports.fastFormats = exports.fullFormats = undefined;
|
|
195346
|
+
function fmtDef(validate, compare) {
|
|
195347
|
+
return {
|
|
195348
|
+
validate,
|
|
195349
|
+
compare
|
|
195350
|
+
};
|
|
195351
|
+
}
|
|
195352
|
+
exports.fullFormats = {
|
|
195353
|
+
date: fmtDef(date5, compareDate),
|
|
195354
|
+
time: fmtDef(getTime(true), compareTime),
|
|
195355
|
+
"date-time": fmtDef(getDateTime(true), compareDateTime),
|
|
195356
|
+
"iso-time": fmtDef(getTime(), compareIsoTime),
|
|
195357
|
+
"iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
|
|
195358
|
+
duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
|
|
195359
|
+
uri,
|
|
195360
|
+
"uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
|
|
195361
|
+
"uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
|
|
195362
|
+
url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
|
|
195363
|
+
email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
|
195364
|
+
hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
|
|
195365
|
+
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
|
|
195366
|
+
ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
195367
|
+
regex,
|
|
195368
|
+
uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
|
|
195369
|
+
"json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
|
|
195370
|
+
"json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
|
|
195371
|
+
"relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
|
|
195372
|
+
byte,
|
|
195373
|
+
int32: {
|
|
195374
|
+
type: "number",
|
|
195375
|
+
validate: validateInt32
|
|
195376
|
+
},
|
|
195377
|
+
int64: {
|
|
195378
|
+
type: "number",
|
|
195379
|
+
validate: validateInt64
|
|
195380
|
+
},
|
|
195381
|
+
float: {
|
|
195382
|
+
type: "number",
|
|
195383
|
+
validate: validateNumber
|
|
195384
|
+
},
|
|
195385
|
+
double: {
|
|
195386
|
+
type: "number",
|
|
195387
|
+
validate: validateNumber
|
|
195388
|
+
},
|
|
195389
|
+
password: true,
|
|
195390
|
+
binary: true
|
|
195391
|
+
};
|
|
195392
|
+
exports.fastFormats = {
|
|
195393
|
+
...exports.fullFormats,
|
|
195394
|
+
date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
|
|
195395
|
+
time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
|
|
195396
|
+
"date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
|
|
195397
|
+
"iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
|
|
195398
|
+
"iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime),
|
|
195399
|
+
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
|
|
195400
|
+
"uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
195401
|
+
email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
|
|
195402
|
+
};
|
|
195403
|
+
exports.formatNames = Object.keys(exports.fullFormats);
|
|
195404
|
+
function isLeapYear(year) {
|
|
195405
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
195406
|
+
}
|
|
195407
|
+
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
195408
|
+
const DAYS = [
|
|
195409
|
+
0,
|
|
195410
|
+
31,
|
|
195411
|
+
28,
|
|
195412
|
+
31,
|
|
195413
|
+
30,
|
|
195414
|
+
31,
|
|
195415
|
+
30,
|
|
195416
|
+
31,
|
|
195417
|
+
31,
|
|
195418
|
+
30,
|
|
195419
|
+
31,
|
|
195420
|
+
30,
|
|
195421
|
+
31
|
|
195422
|
+
];
|
|
195423
|
+
function date5(str) {
|
|
195424
|
+
const matches = DATE.exec(str);
|
|
195425
|
+
if (!matches)
|
|
195426
|
+
return false;
|
|
195427
|
+
const year = +matches[1];
|
|
195428
|
+
const month = +matches[2];
|
|
195429
|
+
const day = +matches[3];
|
|
195430
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
|
|
195431
|
+
}
|
|
195432
|
+
function compareDate(d1, d2) {
|
|
195433
|
+
if (!(d1 && d2))
|
|
195434
|
+
return;
|
|
195435
|
+
if (d1 > d2)
|
|
195436
|
+
return 1;
|
|
195437
|
+
if (d1 < d2)
|
|
195438
|
+
return -1;
|
|
195439
|
+
return 0;
|
|
195440
|
+
}
|
|
195441
|
+
const TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
195442
|
+
function getTime(strictTimeZone) {
|
|
195443
|
+
return function time3(str) {
|
|
195444
|
+
const matches = TIME.exec(str);
|
|
195445
|
+
if (!matches)
|
|
195446
|
+
return false;
|
|
195447
|
+
const hr = +matches[1];
|
|
195448
|
+
const min = +matches[2];
|
|
195449
|
+
const sec = +matches[3];
|
|
195450
|
+
const tz = matches[4];
|
|
195451
|
+
const tzSign = matches[5] === "-" ? -1 : 1;
|
|
195452
|
+
const tzH = +(matches[6] || 0);
|
|
195453
|
+
const tzM = +(matches[7] || 0);
|
|
195454
|
+
if (tzH > 23 || tzM > 59 || strictTimeZone && !tz)
|
|
195455
|
+
return false;
|
|
195456
|
+
if (hr <= 23 && min <= 59 && sec < 60)
|
|
195457
|
+
return true;
|
|
195458
|
+
const utcMin = min - tzM * tzSign;
|
|
195459
|
+
const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
|
|
195460
|
+
return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
|
|
195461
|
+
};
|
|
195462
|
+
}
|
|
195463
|
+
function compareTime(s1, s2) {
|
|
195464
|
+
if (!(s1 && s2))
|
|
195465
|
+
return;
|
|
195466
|
+
const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf();
|
|
195467
|
+
const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf();
|
|
195468
|
+
if (!(t1 && t2))
|
|
195469
|
+
return;
|
|
195470
|
+
return t1 - t2;
|
|
195471
|
+
}
|
|
195472
|
+
function compareIsoTime(t1, t2) {
|
|
195473
|
+
if (!(t1 && t2))
|
|
195474
|
+
return;
|
|
195475
|
+
const a1 = TIME.exec(t1);
|
|
195476
|
+
const a2 = TIME.exec(t2);
|
|
195477
|
+
if (!(a1 && a2))
|
|
195478
|
+
return;
|
|
195479
|
+
t1 = a1[1] + a1[2] + a1[3];
|
|
195480
|
+
t2 = a2[1] + a2[2] + a2[3];
|
|
195481
|
+
if (t1 > t2)
|
|
195482
|
+
return 1;
|
|
195483
|
+
if (t1 < t2)
|
|
195484
|
+
return -1;
|
|
195485
|
+
return 0;
|
|
195486
|
+
}
|
|
195487
|
+
const DATE_TIME_SEPARATOR = /t|\s/i;
|
|
195488
|
+
function getDateTime(strictTimeZone) {
|
|
195489
|
+
const time3 = getTime(strictTimeZone);
|
|
195490
|
+
return function date_time(str) {
|
|
195491
|
+
const dateTime = str.split(DATE_TIME_SEPARATOR);
|
|
195492
|
+
return dateTime.length === 2 && date5(dateTime[0]) && time3(dateTime[1]);
|
|
195493
|
+
};
|
|
195494
|
+
}
|
|
195495
|
+
function compareDateTime(dt1, dt2) {
|
|
195496
|
+
if (!(dt1 && dt2))
|
|
195497
|
+
return;
|
|
195498
|
+
const d1 = new Date(dt1).valueOf();
|
|
195499
|
+
const d2 = new Date(dt2).valueOf();
|
|
195500
|
+
if (!(d1 && d2))
|
|
195501
|
+
return;
|
|
195502
|
+
return d1 - d2;
|
|
195503
|
+
}
|
|
195504
|
+
function compareIsoDateTime(dt1, dt2) {
|
|
195505
|
+
if (!(dt1 && dt2))
|
|
195506
|
+
return;
|
|
195507
|
+
const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
|
|
195508
|
+
const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
|
|
195509
|
+
const res = compareDate(d1, d2);
|
|
195510
|
+
if (res === undefined)
|
|
195511
|
+
return;
|
|
195512
|
+
return res || compareTime(t1, t2);
|
|
195513
|
+
}
|
|
195514
|
+
const NOT_URI_FRAGMENT = /\/|:/;
|
|
195515
|
+
const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
195516
|
+
function uri(str) {
|
|
195517
|
+
return NOT_URI_FRAGMENT.test(str) && URI.test(str);
|
|
195518
|
+
}
|
|
195519
|
+
const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
195520
|
+
function byte(str) {
|
|
195521
|
+
BYTE.lastIndex = 0;
|
|
195522
|
+
return BYTE.test(str);
|
|
195523
|
+
}
|
|
195524
|
+
const MIN_INT32 = -(2 ** 31);
|
|
195525
|
+
const MAX_INT32 = 2 ** 31 - 1;
|
|
195526
|
+
function validateInt32(value) {
|
|
195527
|
+
return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
|
|
195528
|
+
}
|
|
195529
|
+
function validateInt64(value) {
|
|
195530
|
+
return Number.isInteger(value);
|
|
195531
|
+
}
|
|
195532
|
+
function validateNumber() {
|
|
195533
|
+
return true;
|
|
195534
|
+
}
|
|
195535
|
+
const Z_ANCHOR = /[^\\]\\Z/;
|
|
195536
|
+
function regex(str) {
|
|
195537
|
+
if (Z_ANCHOR.test(str))
|
|
195538
|
+
return false;
|
|
195539
|
+
try {
|
|
195540
|
+
new RegExp(str);
|
|
195541
|
+
return true;
|
|
195542
|
+
} catch (e) {
|
|
195543
|
+
return false;
|
|
195544
|
+
}
|
|
195545
|
+
}
|
|
195546
|
+
});
|
|
195547
195547
|
var require_limit = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
195548
195548
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195549
195549
|
exports.formatLimitDefinition = undefined;
|
|
@@ -195661,9 +195661,9 @@ var require_dist = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
|
195661
195661
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195662
195662
|
exports.default = formatsPlugin;
|
|
195663
195663
|
});
|
|
195664
|
+
var import_ajv = require_ajv();
|
|
195664
195665
|
var import__2020 = require__2020();
|
|
195665
195666
|
var import_dist = /* @__PURE__ */ __toESM2(require_dist(), 1);
|
|
195666
|
-
var import_ajv = require_ajv();
|
|
195667
195667
|
var DRAFT_2020_12_URIS = new Set(["https://json-schema.org/draft/2020-12/schema", "http://json-schema.org/draft/2020-12/schema"]);
|
|
195668
195668
|
var addFormats = import_dist.default;
|
|
195669
195669
|
function createDefaultAjvInstance() {
|
|
@@ -195702,11 +195702,12 @@ var AjvJsonSchemaValidator = class {
|
|
|
195702
195702
|
};
|
|
195703
195703
|
}
|
|
195704
195704
|
};
|
|
195705
|
+
var Ajv = import_ajv.Ajv;
|
|
195705
195706
|
|
|
195706
195707
|
// node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
|
|
195707
195708
|
import process3 from "node:process";
|
|
195708
195709
|
|
|
195709
|
-
// node_modules/@modelcontextprotocol/server/dist/mcp-
|
|
195710
|
+
// node_modules/@modelcontextprotocol/server/dist/mcp-CM8J1mhp.mjs
|
|
195710
195711
|
var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
195711
195712
|
function isCompletable(schema) {
|
|
195712
195713
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -195714,6 +195715,66 @@ function isCompletable(schema) {
|
|
|
195714
195715
|
function getCompleter(schema) {
|
|
195715
195716
|
return schema[COMPLETABLE_SYMBOL]?.complete;
|
|
195716
195717
|
}
|
|
195718
|
+
var BRANDS = Symbol.for("mcp.sdk.errorBrands");
|
|
195719
|
+
function stampErrorBrands(instance, ctor) {
|
|
195720
|
+
const brands = /* @__PURE__ */ new Set;
|
|
195721
|
+
let current = ctor;
|
|
195722
|
+
while (typeof current === "function") {
|
|
195723
|
+
const brand = current.mcpBrand;
|
|
195724
|
+
if (Object.prototype.hasOwnProperty.call(current, "mcpBrand") && typeof brand === "string")
|
|
195725
|
+
brands.add(brand);
|
|
195726
|
+
current = Object.getPrototypeOf(current);
|
|
195727
|
+
}
|
|
195728
|
+
if (brands.size === 0)
|
|
195729
|
+
return;
|
|
195730
|
+
Object.defineProperty(instance, BRANDS, {
|
|
195731
|
+
value: brands,
|
|
195732
|
+
enumerable: false,
|
|
195733
|
+
configurable: true
|
|
195734
|
+
});
|
|
195735
|
+
}
|
|
195736
|
+
function brandedHasInstance(cls, value) {
|
|
195737
|
+
try {
|
|
195738
|
+
if (typeof value === "object" && value !== null && Object.prototype.hasOwnProperty.call(cls, "mcpBrand") && typeof cls.mcpBrand === "string" && Object.prototype.hasOwnProperty.call(value, BRANDS)) {
|
|
195739
|
+
const carried = value[BRANDS];
|
|
195740
|
+
if (carried && typeof carried.has === "function" && carried.has(cls.mcpBrand))
|
|
195741
|
+
return true;
|
|
195742
|
+
}
|
|
195743
|
+
} catch {}
|
|
195744
|
+
return Function.prototype[Symbol.hasInstance].call(cls, value);
|
|
195745
|
+
}
|
|
195746
|
+
var OAuthError = class OAuthError2 extends Error {
|
|
195747
|
+
static {
|
|
195748
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.OAuthError" });
|
|
195749
|
+
}
|
|
195750
|
+
static [Symbol.hasInstance](value) {
|
|
195751
|
+
return brandedHasInstance(this, value);
|
|
195752
|
+
}
|
|
195753
|
+
static isInstance(value) {
|
|
195754
|
+
if (typeof this !== "function")
|
|
195755
|
+
throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
|
|
195756
|
+
return brandedHasInstance(this, value);
|
|
195757
|
+
}
|
|
195758
|
+
constructor(code, message, errorUri) {
|
|
195759
|
+
super(message);
|
|
195760
|
+
this.code = code;
|
|
195761
|
+
this.errorUri = errorUri;
|
|
195762
|
+
this.name = "OAuthError";
|
|
195763
|
+
stampErrorBrands(this, new.target);
|
|
195764
|
+
}
|
|
195765
|
+
toResponseObject() {
|
|
195766
|
+
const response = {
|
|
195767
|
+
error: this.code,
|
|
195768
|
+
error_description: this.message
|
|
195769
|
+
};
|
|
195770
|
+
if (this.errorUri)
|
|
195771
|
+
response.error_uri = this.errorUri;
|
|
195772
|
+
return response;
|
|
195773
|
+
}
|
|
195774
|
+
static fromResponse(response) {
|
|
195775
|
+
return new OAuthError2(response.error, response.error_description ?? response.error, response.error_uri);
|
|
195776
|
+
}
|
|
195777
|
+
};
|
|
195717
195778
|
var SdkErrorCode = /* @__PURE__ */ function(SdkErrorCode$1) {
|
|
195718
195779
|
SdkErrorCode$1["NotConnected"] = "NOT_CONNECTED";
|
|
195719
195780
|
SdkErrorCode$1["AlreadyConnected"] = "ALREADY_CONNECTED";
|
|
@@ -195737,11 +195798,38 @@ var SdkErrorCode = /* @__PURE__ */ function(SdkErrorCode$1) {
|
|
|
195737
195798
|
return SdkErrorCode$1;
|
|
195738
195799
|
}({});
|
|
195739
195800
|
var SdkError = class extends Error {
|
|
195801
|
+
static {
|
|
195802
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.SdkError" });
|
|
195803
|
+
}
|
|
195804
|
+
static [Symbol.hasInstance](value) {
|
|
195805
|
+
return brandedHasInstance(this, value);
|
|
195806
|
+
}
|
|
195807
|
+
static isInstance(value) {
|
|
195808
|
+
if (typeof this !== "function")
|
|
195809
|
+
throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
|
|
195810
|
+
return brandedHasInstance(this, value);
|
|
195811
|
+
}
|
|
195740
195812
|
constructor(code, message, data) {
|
|
195741
195813
|
super(message);
|
|
195742
195814
|
this.code = code;
|
|
195743
195815
|
this.data = data;
|
|
195744
195816
|
this.name = "SdkError";
|
|
195817
|
+
stampErrorBrands(this, new.target);
|
|
195818
|
+
}
|
|
195819
|
+
};
|
|
195820
|
+
var SdkHttpError = class extends SdkError {
|
|
195821
|
+
static {
|
|
195822
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.SdkHttpError" });
|
|
195823
|
+
}
|
|
195824
|
+
constructor(code, message, data) {
|
|
195825
|
+
super(code, message, data);
|
|
195826
|
+
this.name = "SdkHttpError";
|
|
195827
|
+
}
|
|
195828
|
+
get status() {
|
|
195829
|
+
return this.data.status;
|
|
195830
|
+
}
|
|
195831
|
+
get statusText() {
|
|
195832
|
+
return this.data.statusText;
|
|
195745
195833
|
}
|
|
195746
195834
|
};
|
|
195747
195835
|
var SafeUrlSchema = url().superRefine((val, ctx) => {
|
|
@@ -196034,6 +196122,19 @@ function wrapOutputSchemaForLegacy(natural) {
|
|
|
196034
196122
|
required: ["result"]
|
|
196035
196123
|
};
|
|
196036
196124
|
}
|
|
196125
|
+
var TOOL_RESULT_FOREIGN_FAMILY_KEYS = [
|
|
196126
|
+
"task",
|
|
196127
|
+
"inputRequests",
|
|
196128
|
+
"requestState"
|
|
196129
|
+
];
|
|
196130
|
+
function normalizeContentlessToolResult(value) {
|
|
196131
|
+
if (value === null || typeof value !== "object" || Array.isArray(value) || value.content !== undefined || TOOL_RESULT_FOREIGN_FAMILY_KEYS.some((key) => (key in value)))
|
|
196132
|
+
return value;
|
|
196133
|
+
return {
|
|
196134
|
+
...value,
|
|
196135
|
+
content: []
|
|
196136
|
+
};
|
|
196137
|
+
}
|
|
196037
196138
|
var JSONValueSchema$2 = lazy(() => union([
|
|
196038
196139
|
string2(),
|
|
196039
196140
|
number2(),
|
|
@@ -196755,6 +196856,18 @@ var ServerResultSchema$1 = union([
|
|
|
196755
196856
|
ListTasksResultSchema$1,
|
|
196756
196857
|
CreateTaskResultSchema$1
|
|
196757
196858
|
]);
|
|
196859
|
+
var CallToolResultWireSchema = unknown().superRefine((value, ctx) => {
|
|
196860
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) || value.content !== undefined)
|
|
196861
|
+
return;
|
|
196862
|
+
for (const key of TOOL_RESULT_FOREIGN_FAMILY_KEYS)
|
|
196863
|
+
if (key in value) {
|
|
196864
|
+
ctx.addIssue({
|
|
196865
|
+
code: "custom",
|
|
196866
|
+
message: `content is required when the body carries '${key}' — another result family cannot default into an empty tools/call success`
|
|
196867
|
+
});
|
|
196868
|
+
return;
|
|
196869
|
+
}
|
|
196870
|
+
}).transform(normalizeContentlessToolResult).pipe(CallToolResultSchema$2);
|
|
196758
196871
|
var resultSchemas = {
|
|
196759
196872
|
ping: EmptyResultSchema$1,
|
|
196760
196873
|
initialize: InitializeResultSchema$1,
|
|
@@ -196767,7 +196880,7 @@ var resultSchemas = {
|
|
|
196767
196880
|
"resources/read": ReadResourceResultSchema$2,
|
|
196768
196881
|
"resources/subscribe": EmptyResultSchema$1,
|
|
196769
196882
|
"resources/unsubscribe": EmptyResultSchema$1,
|
|
196770
|
-
"tools/call":
|
|
196883
|
+
"tools/call": CallToolResultWireSchema,
|
|
196771
196884
|
"tools/list": ListToolsResultSchema$2,
|
|
196772
196885
|
"sampling/createMessage": CreateMessageResultWithToolsSchema$1,
|
|
196773
196886
|
"elicitation/create": ElicitResultSchema$2,
|
|
@@ -196980,11 +197093,23 @@ var ProtocolErrorCode = /* @__PURE__ */ function(ProtocolErrorCode$1) {
|
|
|
196980
197093
|
return ProtocolErrorCode$1;
|
|
196981
197094
|
}({});
|
|
196982
197095
|
var ProtocolError = class ProtocolError2 extends Error {
|
|
197096
|
+
static {
|
|
197097
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.ProtocolError" });
|
|
197098
|
+
}
|
|
197099
|
+
static [Symbol.hasInstance](value) {
|
|
197100
|
+
return brandedHasInstance(this, value);
|
|
197101
|
+
}
|
|
197102
|
+
static isInstance(value) {
|
|
197103
|
+
if (typeof this !== "function")
|
|
197104
|
+
throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
|
|
197105
|
+
return brandedHasInstance(this, value);
|
|
197106
|
+
}
|
|
196983
197107
|
constructor(code, message, data) {
|
|
196984
197108
|
super(message);
|
|
196985
197109
|
this.code = code;
|
|
196986
197110
|
this.data = data;
|
|
196987
197111
|
this.name = "ProtocolError";
|
|
197112
|
+
stampErrorBrands(this, new.target);
|
|
196988
197113
|
}
|
|
196989
197114
|
static fromError(code, message, data) {
|
|
196990
197115
|
if (code === ProtocolErrorCode.UrlElicitationRequired && data) {
|
|
@@ -197014,6 +197139,9 @@ var ProtocolError = class ProtocolError2 extends Error {
|
|
|
197014
197139
|
}
|
|
197015
197140
|
};
|
|
197016
197141
|
var ResourceNotFoundError = class extends ProtocolError {
|
|
197142
|
+
static {
|
|
197143
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.ResourceNotFoundError" });
|
|
197144
|
+
}
|
|
197017
197145
|
constructor(uri, message = `Resource not found: ${uri}`) {
|
|
197018
197146
|
super(ProtocolErrorCode.InvalidParams, message, { uri });
|
|
197019
197147
|
}
|
|
@@ -197022,6 +197150,9 @@ var ResourceNotFoundError = class extends ProtocolError {
|
|
|
197022
197150
|
}
|
|
197023
197151
|
};
|
|
197024
197152
|
var UrlElicitationRequiredError = class extends ProtocolError {
|
|
197153
|
+
static {
|
|
197154
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.UrlElicitationRequiredError" });
|
|
197155
|
+
}
|
|
197025
197156
|
constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? "s" : ""} required`) {
|
|
197026
197157
|
super(ProtocolErrorCode.UrlElicitationRequired, message, { elicitations });
|
|
197027
197158
|
}
|
|
@@ -197030,6 +197161,9 @@ var UrlElicitationRequiredError = class extends ProtocolError {
|
|
|
197030
197161
|
}
|
|
197031
197162
|
};
|
|
197032
197163
|
var UnsupportedProtocolVersionError = class extends ProtocolError {
|
|
197164
|
+
static {
|
|
197165
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.UnsupportedProtocolVersionError" });
|
|
197166
|
+
}
|
|
197033
197167
|
constructor(data, message = `Unsupported protocol version: ${data.requested}`) {
|
|
197034
197168
|
super(ProtocolErrorCode.UnsupportedProtocolVersion, message, data);
|
|
197035
197169
|
}
|
|
@@ -197041,6 +197175,9 @@ var UnsupportedProtocolVersionError = class extends ProtocolError {
|
|
|
197041
197175
|
}
|
|
197042
197176
|
};
|
|
197043
197177
|
var MissingRequiredClientCapabilityError = class extends ProtocolError {
|
|
197178
|
+
static {
|
|
197179
|
+
Object.defineProperty(this, "mcpBrand", { value: "mcp.MissingRequiredClientCapabilityError" });
|
|
197180
|
+
}
|
|
197044
197181
|
constructor(data, message = `Missing required client capabilities: ${Object.keys(data.requiredCapabilities).join(", ")}`) {
|
|
197045
197182
|
super(ProtocolErrorCode.MissingRequiredClientCapability, message, data);
|
|
197046
197183
|
}
|
|
@@ -198638,7 +198775,7 @@ var ToolSchema = object({
|
|
|
198638
198775
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({ method: literal("tools/list") });
|
|
198639
198776
|
var ListToolsResultSchema = PaginatedResultSchema.extend({ tools: array(ToolSchema) });
|
|
198640
198777
|
var CallToolResultSchema = ResultSchema.extend({
|
|
198641
|
-
content: array(ContentBlockSchema),
|
|
198778
|
+
content: array(ContentBlockSchema).default([]),
|
|
198642
198779
|
structuredContent: unknown().optional(),
|
|
198643
198780
|
isError: boolean2().optional()
|
|
198644
198781
|
});
|
|
@@ -199226,6 +199363,256 @@ var LADDER_ERROR_HTTP_STATUS = {
|
|
|
199226
199363
|
[ProtocolErrorCode.MissingRequiredClientCapability]: 400,
|
|
199227
199364
|
[HEADER_MISMATCH_ERROR_CODE]: 400
|
|
199228
199365
|
};
|
|
199366
|
+
function parseSchema(schema, data) {
|
|
199367
|
+
return safeParse2(schema, data);
|
|
199368
|
+
}
|
|
199369
|
+
function shapeKeys(schemas3) {
|
|
199370
|
+
return new Set(schemas3.flatMap((schema) => Object.keys(schema.shape)));
|
|
199371
|
+
}
|
|
199372
|
+
function isStandardSchema(schema) {
|
|
199373
|
+
if (schema == null)
|
|
199374
|
+
return false;
|
|
199375
|
+
const schemaType = typeof schema;
|
|
199376
|
+
if (schemaType !== "object" && schemaType !== "function")
|
|
199377
|
+
return false;
|
|
199378
|
+
if (!("~standard" in schema))
|
|
199379
|
+
return false;
|
|
199380
|
+
return typeof schema["~standard"]?.validate === "function";
|
|
199381
|
+
}
|
|
199382
|
+
var warnedZodFallback = false;
|
|
199383
|
+
var JSON_SCHEMA_CONVERSION_TARGET = "draft-2020-12";
|
|
199384
|
+
function standardSchemaToJsonSchema(schema, io = "input") {
|
|
199385
|
+
const std = schema["~standard"];
|
|
199386
|
+
let result;
|
|
199387
|
+
if (std.jsonSchema)
|
|
199388
|
+
result = std.jsonSchema[io]({ target: JSON_SCHEMA_CONVERSION_TARGET });
|
|
199389
|
+
else if (std.vendor === "zod") {
|
|
199390
|
+
if (!("_zod" in schema))
|
|
199391
|
+
throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");
|
|
199392
|
+
if (!warnedZodFallback) {
|
|
199393
|
+
warnedZodFallback = true;
|
|
199394
|
+
console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");
|
|
199395
|
+
}
|
|
199396
|
+
result = toJSONSchema(schema, {
|
|
199397
|
+
target: JSON_SCHEMA_CONVERSION_TARGET,
|
|
199398
|
+
io
|
|
199399
|
+
});
|
|
199400
|
+
} else
|
|
199401
|
+
throw new Error(`Schema library "${std.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);
|
|
199402
|
+
if (io === "output") {
|
|
199403
|
+
if (result.type !== undefined)
|
|
199404
|
+
return result;
|
|
199405
|
+
return isProvablyObjectShapedRoot(result) ? {
|
|
199406
|
+
type: "object",
|
|
199407
|
+
...result
|
|
199408
|
+
} : result;
|
|
199409
|
+
}
|
|
199410
|
+
if (result.type !== undefined && result.type !== "object")
|
|
199411
|
+
throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(result.type)}). Wrap your schema in z.object({...}) or equivalent.`);
|
|
199412
|
+
return {
|
|
199413
|
+
type: "object",
|
|
199414
|
+
...result
|
|
199415
|
+
};
|
|
199416
|
+
}
|
|
199417
|
+
function isProvablyObjectShapedRoot(schema) {
|
|
199418
|
+
if ("properties" in schema || "patternProperties" in schema || "additionalProperties" in schema || "required" in schema)
|
|
199419
|
+
return true;
|
|
199420
|
+
for (const key of [
|
|
199421
|
+
"oneOf",
|
|
199422
|
+
"anyOf",
|
|
199423
|
+
"allOf"
|
|
199424
|
+
]) {
|
|
199425
|
+
const members = schema[key];
|
|
199426
|
+
if (Array.isArray(members) && members.length > 0)
|
|
199427
|
+
return members.every((m) => m !== null && typeof m === "object" && (m.type === "object" || isProvablyObjectShapedRoot(m)));
|
|
199428
|
+
}
|
|
199429
|
+
return false;
|
|
199430
|
+
}
|
|
199431
|
+
function formatIssue(issue2) {
|
|
199432
|
+
if (!issue2.path?.length)
|
|
199433
|
+
return issue2.message;
|
|
199434
|
+
return `${issue2.path.map((p) => String(typeof p === "object" ? p.key : p)).join(".")}: ${issue2.message}`;
|
|
199435
|
+
}
|
|
199436
|
+
async function validateStandardSchema(schema, data) {
|
|
199437
|
+
const result = await schema["~standard"].validate(data);
|
|
199438
|
+
if (result.issues && result.issues.length > 0)
|
|
199439
|
+
return {
|
|
199440
|
+
success: false,
|
|
199441
|
+
error: result.issues.map((i) => formatIssue(i)).join(", ")
|
|
199442
|
+
};
|
|
199443
|
+
return {
|
|
199444
|
+
success: true,
|
|
199445
|
+
data: result.value
|
|
199446
|
+
};
|
|
199447
|
+
}
|
|
199448
|
+
function zodEmittedPattern(schema) {
|
|
199449
|
+
const jsonSchema = toJSONSchema(schema, {
|
|
199450
|
+
target: JSON_SCHEMA_CONVERSION_TARGET,
|
|
199451
|
+
io: "input"
|
|
199452
|
+
});
|
|
199453
|
+
return typeof jsonSchema.pattern === "string" ? jsonSchema.pattern : undefined;
|
|
199454
|
+
}
|
|
199455
|
+
var DATETIME_FRACTION_DIGITS = /\\\.\\d\{(\d+)\}/;
|
|
199456
|
+
function datetimeReferenceSchemas(pattern) {
|
|
199457
|
+
const fractionDigits = DATETIME_FRACTION_DIGITS.exec(pattern);
|
|
199458
|
+
const precisions = [
|
|
199459
|
+
undefined,
|
|
199460
|
+
-1,
|
|
199461
|
+
0
|
|
199462
|
+
];
|
|
199463
|
+
if (fractionDigits)
|
|
199464
|
+
precisions.push(Number(fractionDigits[1]));
|
|
199465
|
+
return [false, true].flatMap((local) => [false, true].flatMap((offset) => precisions.map((precision) => exports_iso.datetime({
|
|
199466
|
+
local,
|
|
199467
|
+
offset,
|
|
199468
|
+
precision
|
|
199469
|
+
}))));
|
|
199470
|
+
}
|
|
199471
|
+
function referencePatternsForFormat(format, pattern) {
|
|
199472
|
+
let referenceSchemas;
|
|
199473
|
+
switch (format) {
|
|
199474
|
+
case "email":
|
|
199475
|
+
referenceSchemas = [email2()];
|
|
199476
|
+
break;
|
|
199477
|
+
case "uri":
|
|
199478
|
+
referenceSchemas = [url()];
|
|
199479
|
+
break;
|
|
199480
|
+
case "date":
|
|
199481
|
+
referenceSchemas = [exports_iso.date()];
|
|
199482
|
+
break;
|
|
199483
|
+
case "date-time":
|
|
199484
|
+
referenceSchemas = datetimeReferenceSchemas(pattern);
|
|
199485
|
+
break;
|
|
199486
|
+
}
|
|
199487
|
+
return new Set(referenceSchemas.map((schema) => zodEmittedPattern(schema)).filter((emitted) => emitted !== undefined));
|
|
199488
|
+
}
|
|
199489
|
+
function isLibraryFormatPattern(format, pattern, vendor) {
|
|
199490
|
+
if (vendor !== "zod")
|
|
199491
|
+
return true;
|
|
199492
|
+
return referencePatternsForFormat(format, pattern).has(pattern);
|
|
199493
|
+
}
|
|
199494
|
+
function promptArgumentsFromStandardSchema(schema) {
|
|
199495
|
+
const jsonSchema = standardSchemaToJsonSchema(schema, "input");
|
|
199496
|
+
const properties = jsonSchema.properties || {};
|
|
199497
|
+
const required2 = jsonSchema.required || [];
|
|
199498
|
+
return Object.entries(properties).map(([name, prop]) => ({
|
|
199499
|
+
name,
|
|
199500
|
+
description: prop?.description,
|
|
199501
|
+
required: required2.includes(name)
|
|
199502
|
+
}));
|
|
199503
|
+
}
|
|
199504
|
+
function isJsonObject(value) {
|
|
199505
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
199506
|
+
}
|
|
199507
|
+
function convertStandardElicitationSchema(schema) {
|
|
199508
|
+
try {
|
|
199509
|
+
return standardSchemaToJsonSchema(schema, "input");
|
|
199510
|
+
} catch (error51) {
|
|
199511
|
+
const detail = error51 instanceof Error ? error51.message : String(error51);
|
|
199512
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema must describe an object with flat primitive properties: ${detail}`);
|
|
199513
|
+
}
|
|
199514
|
+
}
|
|
199515
|
+
var ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS = new Set([
|
|
199516
|
+
"$comment",
|
|
199517
|
+
"deprecated",
|
|
199518
|
+
"description",
|
|
199519
|
+
"examples",
|
|
199520
|
+
"readOnly",
|
|
199521
|
+
"title",
|
|
199522
|
+
"writeOnly"
|
|
199523
|
+
]);
|
|
199524
|
+
function isAnnotationOnlyJsonSchemaKeyword(key) {
|
|
199525
|
+
return ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS.has(key) || key.startsWith("x-");
|
|
199526
|
+
}
|
|
199527
|
+
var ROOT_KEYS = new Set(["$schema", ...Object.keys(ElicitRequestFormParamsSchema.shape.requestedSchema.shape)]);
|
|
199528
|
+
var PROPERTY_KEYS_BY_TYPE = {
|
|
199529
|
+
string: shapeKeys([
|
|
199530
|
+
StringSchemaSchema,
|
|
199531
|
+
UntitledSingleSelectEnumSchemaSchema,
|
|
199532
|
+
TitledSingleSelectEnumSchemaSchema,
|
|
199533
|
+
LegacyTitledEnumSchemaSchema
|
|
199534
|
+
]),
|
|
199535
|
+
number: shapeKeys([NumberSchemaSchema]),
|
|
199536
|
+
integer: shapeKeys([NumberSchemaSchema]),
|
|
199537
|
+
boolean: shapeKeys([BooleanSchemaSchema]),
|
|
199538
|
+
array: shapeKeys([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema])
|
|
199539
|
+
};
|
|
199540
|
+
var SUPPORTED_STRING_FORMATS = new Set(StringSchemaSchema.shape.format.unwrap().options);
|
|
199541
|
+
function walkProperty(node, path, vendor, unsupported2) {
|
|
199542
|
+
if (!isJsonObject(node))
|
|
199543
|
+
return node;
|
|
199544
|
+
const allowedKeys = typeof node.type === "string" && Object.hasOwn(PROPERTY_KEYS_BY_TYPE, node.type) ? PROPERTY_KEYS_BY_TYPE[node.type] : undefined;
|
|
199545
|
+
if (allowedKeys === undefined)
|
|
199546
|
+
return node;
|
|
199547
|
+
const pruned = {};
|
|
199548
|
+
for (const [key, value] of Object.entries(node))
|
|
199549
|
+
if (allowedKeys.has(key) || isAnnotationOnlyJsonSchemaKeyword(key))
|
|
199550
|
+
pruned[key] = value;
|
|
199551
|
+
else if (key === "pattern" && node.type === "string" && typeof node.format === "string") {
|
|
199552
|
+
if (!SUPPORTED_STRING_FORMATS.has(node.format))
|
|
199553
|
+
pruned[key] = value;
|
|
199554
|
+
else if (typeof value !== "string" || !isLibraryFormatPattern(node.format, value, vendor))
|
|
199555
|
+
unsupported2.push(`${path}.${key}`);
|
|
199556
|
+
} else
|
|
199557
|
+
unsupported2.push(`${path}.${key}`);
|
|
199558
|
+
return pruned;
|
|
199559
|
+
}
|
|
199560
|
+
function walkRequestedSchema(converted, vendor) {
|
|
199561
|
+
const pruned = {};
|
|
199562
|
+
const unsupported2 = [];
|
|
199563
|
+
for (const [key, value] of Object.entries(converted))
|
|
199564
|
+
if (key === "properties" && isJsonObject(value))
|
|
199565
|
+
pruned[key] = Object.fromEntries(Object.entries(value).map(([name, node]) => [name, walkProperty(node, `properties.${name}`, vendor, unsupported2)]));
|
|
199566
|
+
else if (ROOT_KEYS.has(key))
|
|
199567
|
+
pruned[key] = value;
|
|
199568
|
+
else if (!isAnnotationOnlyJsonSchemaKeyword(key))
|
|
199569
|
+
unsupported2.push(key);
|
|
199570
|
+
if (unsupported2.length > 0)
|
|
199571
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${unsupported2.join(", ")}`);
|
|
199572
|
+
return pruned;
|
|
199573
|
+
}
|
|
199574
|
+
function describeUnsupportedProperties(pruned, fallback) {
|
|
199575
|
+
if (!isJsonObject(pruned.properties))
|
|
199576
|
+
return fallback;
|
|
199577
|
+
const offenders = Object.entries(pruned.properties).filter(([, node]) => !parseSchema(PrimitiveSchemaDefinitionSchema, node).success).map(([name]) => `properties.${name}`);
|
|
199578
|
+
return offenders.length > 0 ? offenders.join(", ") : fallback;
|
|
199579
|
+
}
|
|
199580
|
+
function findDroppedConstraintPaths(original, parsed, path = "") {
|
|
199581
|
+
if (Array.isArray(original) && Array.isArray(parsed))
|
|
199582
|
+
return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed[index], `${path}[${index}]`));
|
|
199583
|
+
if (!isJsonObject(original) || !isJsonObject(parsed))
|
|
199584
|
+
return [];
|
|
199585
|
+
return Object.entries(original).flatMap(([key, value]) => {
|
|
199586
|
+
const childPath = path ? `${path}.${key}` : key;
|
|
199587
|
+
if (!Object.prototype.hasOwnProperty.call(parsed, key))
|
|
199588
|
+
return isAnnotationOnlyJsonSchemaKeyword(key) ? [] : [childPath];
|
|
199589
|
+
return findDroppedConstraintPaths(value, parsed[key], childPath);
|
|
199590
|
+
});
|
|
199591
|
+
}
|
|
199592
|
+
function normalizeElicitInputParams(input2) {
|
|
199593
|
+
if (!isStandardSchema(input2.requestedSchema))
|
|
199594
|
+
return {
|
|
199595
|
+
...input2,
|
|
199596
|
+
mode: "form",
|
|
199597
|
+
requestedSchema: input2.requestedSchema
|
|
199598
|
+
};
|
|
199599
|
+
const vendor = input2.requestedSchema["~standard"].vendor;
|
|
199600
|
+
const pruned = walkRequestedSchema(convertStandardElicitationSchema(input2.requestedSchema), vendor);
|
|
199601
|
+
const parsed = parseSchema(ElicitRequestFormParamsSchema.shape.requestedSchema, pruned);
|
|
199602
|
+
if (!parsed.success)
|
|
199603
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${describeUnsupportedProperties(pruned, parsed.error.message)}`);
|
|
199604
|
+
const droppedConstraints = findDroppedConstraintPaths(pruned, parsed.data);
|
|
199605
|
+
if (droppedConstraints.length > 0)
|
|
199606
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${droppedConstraints.join(", ")}`);
|
|
199607
|
+
const danglingRequired = (parsed.data.required ?? []).filter((key) => !Object.prototype.hasOwnProperty.call(parsed.data.properties, key));
|
|
199608
|
+
if (danglingRequired.length > 0)
|
|
199609
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema lists required properties that are not defined in properties: ${danglingRequired.join(", ")}`);
|
|
199610
|
+
return {
|
|
199611
|
+
...input2,
|
|
199612
|
+
mode: "form",
|
|
199613
|
+
requestedSchema: parsed.data
|
|
199614
|
+
};
|
|
199615
|
+
}
|
|
199229
199616
|
function buildInputRequired(spec) {
|
|
199230
199617
|
const hasInputRequests = spec.inputRequests !== undefined && Object.keys(spec.inputRequests).length > 0;
|
|
199231
199618
|
const hasRequestState = typeof spec.requestState === "string";
|
|
@@ -199239,13 +199626,14 @@ function buildInputRequired(spec) {
|
|
|
199239
199626
|
}
|
|
199240
199627
|
var inputRequired = Object.assign(buildInputRequired, {
|
|
199241
199628
|
elicit(params) {
|
|
199242
|
-
|
|
199243
|
-
|
|
199244
|
-
|
|
199245
|
-
|
|
199246
|
-
|
|
199247
|
-
|
|
199248
|
-
|
|
199629
|
+
try {
|
|
199630
|
+
return {
|
|
199631
|
+
method: "elicitation/create",
|
|
199632
|
+
params: normalizeElicitInputParams(params)
|
|
199633
|
+
};
|
|
199634
|
+
} catch (error51) {
|
|
199635
|
+
throw error51 instanceof ProtocolError ? new TypeError(error51.message, { cause: error51 }) : error51;
|
|
199636
|
+
}
|
|
199249
199637
|
},
|
|
199250
199638
|
elicitUrl(params) {
|
|
199251
199639
|
return {
|
|
@@ -199488,91 +199876,6 @@ for (const [key, schema] of Object.entries(authSchemas))
|
|
|
199488
199876
|
register(key, schema);
|
|
199489
199877
|
var specTypeSchemas = Object.freeze(_specTypeSchemas);
|
|
199490
199878
|
var isSpecType = Object.freeze(_isSpecType);
|
|
199491
|
-
function isStandardSchema(schema) {
|
|
199492
|
-
if (schema == null)
|
|
199493
|
-
return false;
|
|
199494
|
-
const schemaType = typeof schema;
|
|
199495
|
-
if (schemaType !== "object" && schemaType !== "function")
|
|
199496
|
-
return false;
|
|
199497
|
-
if (!("~standard" in schema))
|
|
199498
|
-
return false;
|
|
199499
|
-
return typeof schema["~standard"]?.validate === "function";
|
|
199500
|
-
}
|
|
199501
|
-
var warnedZodFallback = false;
|
|
199502
|
-
function standardSchemaToJsonSchema(schema, io = "input") {
|
|
199503
|
-
const std = schema["~standard"];
|
|
199504
|
-
let result;
|
|
199505
|
-
if (std.jsonSchema)
|
|
199506
|
-
result = std.jsonSchema[io]({ target: "draft-2020-12" });
|
|
199507
|
-
else if (std.vendor === "zod") {
|
|
199508
|
-
if (!("_zod" in schema))
|
|
199509
|
-
throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");
|
|
199510
|
-
if (!warnedZodFallback) {
|
|
199511
|
-
warnedZodFallback = true;
|
|
199512
|
-
console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");
|
|
199513
|
-
}
|
|
199514
|
-
result = toJSONSchema(schema, {
|
|
199515
|
-
target: "draft-2020-12",
|
|
199516
|
-
io
|
|
199517
|
-
});
|
|
199518
|
-
} else
|
|
199519
|
-
throw new Error(`Schema library "${std.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);
|
|
199520
|
-
if (io === "output") {
|
|
199521
|
-
if (result.type !== undefined)
|
|
199522
|
-
return result;
|
|
199523
|
-
return isProvablyObjectShapedRoot(result) ? {
|
|
199524
|
-
type: "object",
|
|
199525
|
-
...result
|
|
199526
|
-
} : result;
|
|
199527
|
-
}
|
|
199528
|
-
if (result.type !== undefined && result.type !== "object")
|
|
199529
|
-
throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(result.type)}). Wrap your schema in z.object({...}) or equivalent.`);
|
|
199530
|
-
return {
|
|
199531
|
-
type: "object",
|
|
199532
|
-
...result
|
|
199533
|
-
};
|
|
199534
|
-
}
|
|
199535
|
-
function isProvablyObjectShapedRoot(schema) {
|
|
199536
|
-
if ("properties" in schema || "patternProperties" in schema || "additionalProperties" in schema || "required" in schema)
|
|
199537
|
-
return true;
|
|
199538
|
-
for (const key of [
|
|
199539
|
-
"oneOf",
|
|
199540
|
-
"anyOf",
|
|
199541
|
-
"allOf"
|
|
199542
|
-
]) {
|
|
199543
|
-
const members = schema[key];
|
|
199544
|
-
if (Array.isArray(members) && members.length > 0)
|
|
199545
|
-
return members.every((m) => m !== null && typeof m === "object" && (m.type === "object" || isProvablyObjectShapedRoot(m)));
|
|
199546
|
-
}
|
|
199547
|
-
return false;
|
|
199548
|
-
}
|
|
199549
|
-
function formatIssue(issue2) {
|
|
199550
|
-
if (!issue2.path?.length)
|
|
199551
|
-
return issue2.message;
|
|
199552
|
-
return `${issue2.path.map((p) => String(typeof p === "object" ? p.key : p)).join(".")}: ${issue2.message}`;
|
|
199553
|
-
}
|
|
199554
|
-
async function validateStandardSchema(schema, data) {
|
|
199555
|
-
const result = await schema["~standard"].validate(data);
|
|
199556
|
-
if (result.issues && result.issues.length > 0)
|
|
199557
|
-
return {
|
|
199558
|
-
success: false,
|
|
199559
|
-
error: result.issues.map((i) => formatIssue(i)).join(", ")
|
|
199560
|
-
};
|
|
199561
|
-
return {
|
|
199562
|
-
success: true,
|
|
199563
|
-
data: result.value
|
|
199564
|
-
};
|
|
199565
|
-
}
|
|
199566
|
-
function promptArgumentsFromStandardSchema(schema) {
|
|
199567
|
-
const jsonSchema = standardSchemaToJsonSchema(schema, "input");
|
|
199568
|
-
const properties = jsonSchema.properties || {};
|
|
199569
|
-
const required2 = jsonSchema.required || [];
|
|
199570
|
-
return Object.entries(properties).map(([name, prop]) => ({
|
|
199571
|
-
name,
|
|
199572
|
-
description: prop?.description,
|
|
199573
|
-
required: required2.includes(name)
|
|
199574
|
-
}));
|
|
199575
|
-
}
|
|
199576
199879
|
function bootstrapOutboundCodec(method) {
|
|
199577
199880
|
switch (method) {
|
|
199578
199881
|
case "initialize":
|
|
@@ -200307,6 +200610,66 @@ function manualInputRequiredValue(decoded) {
|
|
|
200307
200610
|
...decoded.requestState !== undefined && { requestState: decoded.requestState }
|
|
200308
200611
|
};
|
|
200309
200612
|
}
|
|
200613
|
+
/*!
|
|
200614
|
+
* content-type
|
|
200615
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
200616
|
+
* MIT Licensed
|
|
200617
|
+
*/
|
|
200618
|
+
var require_content_type = /* @__PURE__ */ __commonJSMin((exports) => {
|
|
200619
|
+
var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
|
|
200620
|
+
var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
|
|
200621
|
+
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
200622
|
+
exports.parse = parse6;
|
|
200623
|
+
function parse6(string4) {
|
|
200624
|
+
if (!string4)
|
|
200625
|
+
throw new TypeError("argument string is required");
|
|
200626
|
+
var header = typeof string4 === "object" ? getcontenttype(string4) : string4;
|
|
200627
|
+
if (typeof header !== "string")
|
|
200628
|
+
throw new TypeError("argument string is required to be a string");
|
|
200629
|
+
var index = header.indexOf(";");
|
|
200630
|
+
var type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
200631
|
+
if (!TYPE_REGEXP.test(type))
|
|
200632
|
+
throw new TypeError("invalid media type");
|
|
200633
|
+
var obj = new ContentType(type.toLowerCase());
|
|
200634
|
+
if (index !== -1) {
|
|
200635
|
+
var key;
|
|
200636
|
+
var match;
|
|
200637
|
+
var value;
|
|
200638
|
+
PARAM_REGEXP.lastIndex = index;
|
|
200639
|
+
while (match = PARAM_REGEXP.exec(header)) {
|
|
200640
|
+
if (match.index !== index)
|
|
200641
|
+
throw new TypeError("invalid parameter format");
|
|
200642
|
+
index += match[0].length;
|
|
200643
|
+
key = match[1].toLowerCase();
|
|
200644
|
+
value = match[2];
|
|
200645
|
+
if (value.charCodeAt(0) === 34) {
|
|
200646
|
+
value = value.slice(1, -1);
|
|
200647
|
+
if (value.indexOf("\\") !== -1)
|
|
200648
|
+
value = value.replace(QESC_REGEXP, "$1");
|
|
200649
|
+
}
|
|
200650
|
+
obj.parameters[key] = value;
|
|
200651
|
+
}
|
|
200652
|
+
if (index !== header.length)
|
|
200653
|
+
throw new TypeError("invalid parameter format");
|
|
200654
|
+
}
|
|
200655
|
+
return obj;
|
|
200656
|
+
}
|
|
200657
|
+
function getcontenttype(obj) {
|
|
200658
|
+
var header;
|
|
200659
|
+
if (typeof obj.getHeader === "function")
|
|
200660
|
+
header = obj.getHeader("content-type");
|
|
200661
|
+
else if (typeof obj.headers === "object")
|
|
200662
|
+
header = obj.headers && obj.headers["content-type"];
|
|
200663
|
+
if (typeof header !== "string")
|
|
200664
|
+
throw new TypeError("content-type header is missing from object");
|
|
200665
|
+
return header;
|
|
200666
|
+
}
|
|
200667
|
+
function ContentType(type) {
|
|
200668
|
+
this.parameters = Object.create(null);
|
|
200669
|
+
this.type = type;
|
|
200670
|
+
}
|
|
200671
|
+
});
|
|
200672
|
+
var import_content_type = /* @__PURE__ */ __toESM2(require_content_type(), 1);
|
|
200310
200673
|
var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
200311
200674
|
var ReadBuffer = class {
|
|
200312
200675
|
_buffer;
|
|
@@ -200399,9 +200762,6 @@ function validateAndWarnToolName(name) {
|
|
|
200399
200762
|
issueToolNameWarning(name, result.warnings);
|
|
200400
200763
|
return result.isValid;
|
|
200401
200764
|
}
|
|
200402
|
-
function parseSchema(schema, data) {
|
|
200403
|
-
return safeParse2(schema, data);
|
|
200404
|
-
}
|
|
200405
200765
|
function isZodV4Schema(v) {
|
|
200406
200766
|
return typeof v === "object" && v !== null && "_zod" in v;
|
|
200407
200767
|
}
|
|
@@ -200732,7 +201092,8 @@ var Server = class extends Protocol {
|
|
|
200732
201092
|
const result = await this._invokeInputRequiredCapableHandler("tools/call", handler, request, ctx);
|
|
200733
201093
|
if (isInputRequiredResult(result))
|
|
200734
201094
|
return result;
|
|
200735
|
-
const
|
|
201095
|
+
const normalizedResult = normalizeContentlessToolResult(result);
|
|
201096
|
+
const validationResult = codec2.validateResult("tools/call", normalizedResult);
|
|
200736
201097
|
if (!validationResult.ok)
|
|
200737
201098
|
throw new ProtocolError(validationResult.reason === "not-in-era" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validationResult.reason === "not-in-era" ? "No wire schema for tools/call in the resolved era" : `Invalid tools/call result: ${validationResult.message}`);
|
|
200738
201099
|
return validationResult.value;
|
|
@@ -201246,7 +201607,15 @@ var McpServer = class {
|
|
|
201246
201607
|
})) };
|
|
201247
201608
|
});
|
|
201248
201609
|
this.server.setRequestHandler("resources/read", async (request, ctx) => {
|
|
201249
|
-
|
|
201610
|
+
let uri;
|
|
201611
|
+
try {
|
|
201612
|
+
uri = new URL(request.params.uri);
|
|
201613
|
+
} catch {
|
|
201614
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource URI ${request.params.uri} is invalid`, {
|
|
201615
|
+
uri: request.params.uri,
|
|
201616
|
+
reason: "invalid_uri"
|
|
201617
|
+
});
|
|
201618
|
+
}
|
|
201250
201619
|
const resource = this._registeredResources[uri.toString()];
|
|
201251
201620
|
if (resource) {
|
|
201252
201621
|
if (!resource.enabled)
|