diff --git a/agents/shared.ts b/agents/shared.ts
index 93f57b5..5a09672 100644
--- a/agents/shared.ts
+++ b/agents/shared.ts
@@ -28,9 +28,9 @@ export type Agent = {
};
export const instructions = `
-# Agent Instructions
+# General instructions
-You are a highly intelligent, no-nonsense senior-level software engineering agent. You are careful, to-the-point, and kind. You only say things you know to be true. Your code is focused, minimal, and production-ready. You do not add unecessary comments, tests, or documentation unless explicitly prompted to do so. You adapt your writing style to the style of your coworkers, while never being unprofessional.
+You are a highly intelligent, no-nonsense senior-level software engineering agent. You will perform the task that is asked of you in the prompt below. You are careful, to-the-point, and kind. You only say things you know to be true. Your code is focused, minimal, and production-ready. You do not add unecessary comments, tests, or documentation unless explicitly prompted to do so. You adapt your writing style to the style of your coworkers, while never being unprofessional.
## Getting Started
@@ -50,15 +50,4 @@ ${workflows.map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
## Workflows
${workflows.map((w) => `### ${w.name}\n\n${w.prompt}`).join("\n\n")}
-
-## When Prompted Directly
-
-when prompted directly (e.g., via issue comment or PR comment):
- (1) start by creating a single response comment using mcp__${ghPullfrogMcpName}__create_issue_comment
- - the initial comment should say something like "I'll do {summary of request}" where you summarize what was requested
- - save the commentId returned from this initial comment creation
- (2) use mcp__${ghPullfrogMcpName}__edit_issue_comment to progressively update that same comment as you make progress
- - update the comment with current status, completed tasks, and any relevant information
- - continue updating the same comment throughout the planning/implementation process
- (3) create_issue_comment should only be used once initially - all subsequent updates must use edit_issue_comment with the saved commentId
`;
diff --git a/entry.js b/entry.js
index 441f836..9beafe7 100755
--- a/entry.js
+++ b/entry.js
@@ -28185,7 +28185,7 @@ import { tmpdir } from "node:os";
import { join as join5 } from "node:path";
import { pipeline } from "node:stream/promises";
-// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.30_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
+// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.26_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
import { join as join3 } from "path";
import { fileURLToPath } from "url";
import { setMaxListeners } from "events";
@@ -28197,7 +28197,6 @@ import { join } from "path";
import { homedir } from "os";
import { dirname, join as join2 } from "path";
import { cwd } from "process";
-import { realpathSync as realpathSync2 } from "fs";
import { randomUUID } from "crypto";
var __create2 = Object.create;
var __getProtoOf2 = Object.getPrototypeOf;
@@ -34454,7 +34453,6 @@ var ProcessTransport = class {
appendSystemPrompt,
maxThinkingTokens,
maxTurns,
- maxBudgetUsd,
model,
fallbackModel,
permissionMode,
@@ -34468,8 +34466,7 @@ var ProcessTransport = class {
mcpServers,
strictMcpConfig,
canUseTool,
- includePartialMessages,
- plugins
+ includePartialMessages
} = this.options;
const args2 = [
"--output-format",
@@ -34487,9 +34484,6 @@ var ProcessTransport = class {
}
if (maxTurns)
args2.push("--max-turns", maxTurns.toString());
- if (maxBudgetUsd !== void 0) {
- args2.push("--max-budget-usd", maxBudgetUsd.toString());
- }
if (model)
args2.push("--model", model);
if (env2.DEBUG)
@@ -34542,15 +34536,6 @@ var ProcessTransport = class {
for (const dir of additionalDirectories) {
args2.push("--add-dir", dir);
}
- if (plugins && plugins.length > 0) {
- for (const plugin of plugins) {
- if (plugin.type === "local") {
- args2.push("--plugin-dir", plugin.path);
- } else {
- throw new Error(`Unsupported plugin type: ${plugin.type}`);
- }
- }
- }
if (this.options.forkSession) {
args2.push("--fork-session");
}
@@ -35316,33 +35301,30 @@ var maxOutputTokensValidator = {
name: "CLAUDE_CODE_MAX_OUTPUT_TOKENS",
default: 32e3,
validate: (value2) => {
- const MAX_OUTPUT_TOKENS = 64e3;
- const DEFAULT_MAX_OUTPUT_TOKENS = 32e3;
if (!value2) {
- return { effective: DEFAULT_MAX_OUTPUT_TOKENS, status: "valid" };
+ return { effective: 32e3, status: "valid" };
}
const parsed2 = parseInt(value2, 10);
if (isNaN(parsed2) || parsed2 <= 0) {
return {
- effective: DEFAULT_MAX_OUTPUT_TOKENS,
+ effective: 32e3,
status: "invalid",
- message: `Invalid value "${value2}" (using default: ${DEFAULT_MAX_OUTPUT_TOKENS})`
+ message: `Invalid value "${value2}" (using default: 32000)`
};
}
- if (parsed2 > MAX_OUTPUT_TOKENS) {
+ if (parsed2 > 32e3) {
return {
- effective: MAX_OUTPUT_TOKENS,
+ effective: 32e3,
status: "capped",
- message: `Capped from ${parsed2} to ${MAX_OUTPUT_TOKENS}`
+ message: `Capped from ${parsed2} to 32000`
};
}
return { effective: parsed2, status: "valid" };
}
};
function getInitialState() {
- const resolvedCwd = realpathSync2(cwd());
return {
- originalCwd: resolvedCwd,
+ originalCwd: cwd(),
totalCostUSD: 0,
totalAPIDuration: 0,
totalAPIDurationWithoutRetries: 0,
@@ -35352,7 +35334,7 @@ function getInitialState() {
totalLinesAdded: 0,
totalLinesRemoved: 0,
hasUnknownModelCost: false,
- cwd: resolvedCwd,
+ cwd: cwd(),
modelUsage: {},
mainLoopModelOverride: void 0,
maxRateLimitFallbackActive: false,
@@ -35483,14 +35465,12 @@ var Query = class {
pendingMcpResponses = /* @__PURE__ */ new Map();
firstResultReceivedPromise;
firstResultReceivedResolve;
- streamCloseTimeout;
constructor(transport, isSingleUserTurn, canUseTool, hooks, abortController, sdkMcpServers = /* @__PURE__ */ new Map()) {
this.transport = transport;
this.isSingleUserTurn = isSingleUserTurn;
this.canUseTool = canUseTool;
this.hooks = hooks;
this.abortController = abortController;
- this.streamCloseTimeout = parseInt(process.env.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT || "") || 6e4;
for (const [name, server] of sdkMcpServers) {
const sdkTransport = new SdkControlServerTransport((message) => this.sendMcpServerMessageToCli(name, message));
this.sdkMcpTransports.set(name, sdkTransport);
@@ -35618,8 +35598,7 @@ var Query = class {
}
return this.canUseTool(request.request.tool_name, request.request.input, {
signal,
- suggestions: request.request.permission_suggestions,
- toolUseID: request.request.tool_use_id
+ suggestions: request.request.permission_suggestions
});
} else if (request.request.subtype === "hook_callback") {
const result = await this.handleHookCallbacks(request.request.callback_id, request.request.input, request.request.tool_use_id, signal);
@@ -35700,14 +35679,6 @@ var Query = class {
max_thinking_tokens: maxThinkingTokens
});
}
- async processPendingPermissionRequests(pendingPermissionRequests) {
- for (const request of pendingPermissionRequests) {
- if (request.request.subtype === "can_use_tool") {
- this.handleControlRequest(request).catch(() => {
- });
- }
- }
- }
request(request) {
const requestId = Math.random().toString(36).substring(2, 15);
const sdkRequest = {
@@ -35721,9 +35692,6 @@ var Query = class {
resolve(response);
} else {
reject(new Error(response.error));
- if (response.pending_permission_requests) {
- this.processPendingPermissionRequests(response.pending_permission_requests);
- }
}
});
Promise.resolve(this.transport.write(JSON.stringify(sdkRequest) + `
@@ -35761,9 +35729,9 @@ var Query = class {
}
logForDebugging(`[Query.streamInput] Finished processing ${messageCount} messages from input stream`);
logForDebugging(`[Query.streamInput] About to check MCP servers. this.sdkMcpTransports.size = ${this.sdkMcpTransports.size}`);
- const hasHooks = this.hooks && Object.keys(this.hooks).length > 0;
- if ((this.sdkMcpTransports.size > 0 || hasHooks) && this.firstResultReceivedPromise) {
+ if (this.sdkMcpTransports.size > 0 && this.firstResultReceivedPromise) {
logForDebugging(`[Query.streamInput] Entering Promise.race to wait for result`);
+ const STREAM_CLOSE_TIMEOUT = 1e4;
let timeoutId;
await Promise.race([
this.firstResultReceivedPromise.then(() => {
@@ -35776,7 +35744,7 @@ var Query = class {
timeoutId = setTimeout(() => {
logForDebugging(`[Query.streamInput] Timed out waiting for first result, closing input stream`);
resolve();
- }, this.streamCloseTimeout);
+ }, STREAM_CLOSE_TIMEOUT);
})
]);
if (timeoutId) {
@@ -35816,7 +35784,11 @@ var Query = class {
const messageId = "id" in mcpRequest.message ? mcpRequest.message.id : null;
const key = `${serverName}:${messageId}`;
return new Promise((resolve, reject) => {
+ let timeoutId = null;
const cleanup = () => {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
this.pendingMcpResponses.delete(key);
};
const resolveAndCleanup = (response) => {
@@ -35838,6 +35810,12 @@ var Query = class {
reject(new Error("No message handler registered"));
return;
}
+ timeoutId = setTimeout(() => {
+ if (this.pendingMcpResponses.has(key)) {
+ cleanup();
+ reject(new Error("Request timeout"));
+ }
+ }, 3e4);
});
}
};
@@ -40367,7 +40345,7 @@ function query({
const dirname22 = join3(filename, "..");
pathToClaudeCodeExecutable = join3(dirname22, "cli.js");
}
- process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.30";
+ process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.26";
const {
abortController = createAbortController(),
additionalDirectories = [],
@@ -40387,13 +40365,11 @@ function query({
includePartialMessages,
maxThinkingTokens,
maxTurns,
- maxBudgetUsd,
mcpServers,
model,
permissionMode = "default",
allowDangerouslySkipPermissions = false,
permissionPromptToolName,
- plugins,
resume,
resumeSessionAt,
stderr,
@@ -40441,7 +40417,6 @@ function query({
appendSystemPrompt,
maxThinkingTokens,
maxTurns,
- maxBudgetUsd,
model,
fallbackModel,
permissionMode,
@@ -40457,8 +40432,7 @@ function query({
strictMcpConfig,
canUseTool: !!canUseTool,
hooks: !!hooks,
- includePartialMessages,
- plugins
+ includePartialMessages
});
const queryInstance = new Query(transport, isSingleUserTurn, canUseTool, hooks, abortController, sdkMcpServers);
if (typeof prompt === "string") {
@@ -40749,6 +40723,55 @@ var log = {
endGroup: endGroup2
};
+// ../lib/workflows.ts
+var ghPullfrogMcpName = "gh-pullfrog";
+var workflows = [
+ {
+ name: "Plan",
+ description: "Create plans, break down tasks, outline steps, analyze requirements, understand scope of work, or provide task breakdowns",
+ prompt: `Follow these steps:
+1. Create initial response comment using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll {summary of request}" and save the commentId
+2. Analyze the request and break it down into clear, actionable tasks
+3. Consider dependencies, potential challenges, and implementation order
+4. Create a structured plan with clear milestones
+5. Update your comment using mcp__${ghPullfrogMcpName}__edit_issue_comment with the commentId to present the plan in a clear, organized format
+6. Continue updating the same comment as needed (never create additional comments - always use edit_issue_comment)`
+ },
+ {
+ name: "Implement",
+ description: "Implement, build, create, or develop code changes; make specific changes to files or features; execute a plan; or handle tasks with specific implementation details",
+ prompt: `Follow these steps:
+1. Create initial response comment using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll {summary of request}" and save the commentId
+2. Understand the requirements and any existing plan
+3. Make the necessary code changes
+4. Test your changes to ensure they work correctly
+5. Update your comment using mcp__${ghPullfrogMcpName}__edit_issue_comment with the commentId to share progress and results
+6. Continue updating the same comment as you make progress (never create additional comments - always use edit_issue_comment)`
+ },
+ {
+ name: "Review",
+ description: "Review code, PRs, or implementations; provide feedback or suggestions; identify issues; or check code quality, style, and correctness",
+ prompt: `Follow these steps:
+1. Create initial response comment using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll review this" and save the commentId
+2. Get PR info with mcp__${ghPullfrogMcpName}__get_pull_request (this automatically prepares the repository by fetching and checking out the PR branch)
+3. View diff: git diff origin/...origin/
(use line numbers from this for inline comments, replace and with 'base' and 'head' from PR info)
+4. Read files from the checked-out PR branch to understand the implementation
+5. Update your comment using mcp__${ghPullfrogMcpName}__edit_issue_comment with findings as you review
+6. When submitting review: use the 'comments' array for ALL specific code issues - include the file path and line position from the diff
+7. Only use the 'body' field for a brief summary (1-2 sentences) or for feedback that doesn't apply to a specific code location
+8. Continue updating the same comment as needed (never create additional comments - always use edit_issue_comment)`
+ },
+ {
+ name: "Prompt",
+ description: "Fallback for tasks that don't fit other workflows, direct prompts via comments, or requests requiring general assistance without a specific workflow pattern",
+ prompt: `Follow these steps:
+1. Create an initial "Progress Comment" using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll {summary of request}" and save the commentId
+2. Perform the requested task. Only take action if you have high confidence that you understand what is being asked. If you are not sure, ask for clarification. Take stock of the tools at your disposal.
+3. As your work progresses, update your Progress Comment to share progress and results. Using mcp__${ghPullfrogMcpName}__edit_issue_comment and the commentId you saved earlier. Do not create additional comments unless you are explicitly asked to do so.
+4. When you finish the task, update the Progress Comment a final time to confirm completion. If you created any issues, PRs, etc, include appropriate links to it here.`
+ }
+];
+
// ../node_modules/.pnpm/@ark+fs@0.53.0/node_modules/@ark/fs/out/caller.js
import path from "node:path";
import * as process2 from "node:process";
@@ -41064,13 +41087,13 @@ function parseRepoContext() {
}
// mcp/config.ts
-var ghPullfrogMcpName = "gh-pullfrog";
+var ghPullfrogMcpName2 = "gh-pullfrog";
function createMcpConfigs(githubInstallationToken) {
const repoContext = parseRepoContext();
const githubRepository = `${repoContext.owner}/${repoContext.name}`;
const serverPath = process.env.GITHUB_ACTIONS ? fromHere("mcp-server.js") : fromHere("server.ts");
return {
- [ghPullfrogMcpName]: {
+ [ghPullfrogMcpName2]: {
command: "node",
args: [serverPath],
env: {
@@ -41083,40 +41106,30 @@ function createMcpConfigs(githubInstallationToken) {
// agents/shared.ts
var instructions = `
-You are a highly intelligent, no-nonsense senior-level software engineering agent. You are careful, to-the-point, and kind. You only say things you know to be true. Your code is focused, minimal, and production-ready. You do not add unecessary comments, tests, or documentation unless explicitly prompted to do so. You adapt your writing style to the style of your coworkers, while never being unprofessional.
+# General instructions
-- eagerly inspect your MCP servers to determine what tools are available to you, especially ${ghPullfrogMcpName}
-- do not under any circumstances use the github cli (\`gh\`). find the corresponding tool from ${ghPullfrogMcpName} instead.
-- mode selection: choose the appropriate mode based on the prompt payload:
- - choose "plan mode" if the prompt asks to:
- - create a plan, break down tasks, outline steps, or analyze requirements
- - understand the scope of work before implementation
- - provide a todo list or task breakdown
- - choose "implement" if the prompt asks to:
- - implement, build, create, or develop code changes
- - make specific changes to files or features
- - execute a plan that was previously created
- - the prompt includes specific implementation details or requirements
- - choose "review" if the prompt asks to:
- - review code, PR, or implementation
- - provide feedback, suggestions, or identify issues
- - check code quality, style, or correctness
-- once you've chosen a mode, follow its associated prompts carefully
-- when prompted directly (e.g., via issue comment or PR comment):
- (1) start by creating a single response comment using mcp__${ghPullfrogMcpName}__create_issue_comment
- - the initial comment should say something like "I'll do {summary of request}" where you summarize what was requested
- - save the commentId returned from this initial comment creation
- (2) use mcp__${ghPullfrogMcpName}__edit_issue_comment to progressively update that same comment as you make progress
- - update the comment with current status, completed tasks, and any relevant information
- - continue updating the same comment throughout the planning/implementation process
- (3) create_issue_comment should only be used once initially - all subsequent updates must use edit_issue_comment with the saved commentId
-- if prompted to review a PR:
- (1) get PR info with mcp__${ghPullfrogMcpName}__get_pull_request (this automatically prepares the repository by fetching and checking out the PR branch)
- (2) view diff: git diff origin/...origin/ (use line numbers from this for inline comments)
- (3) read files from the checked-out PR branch to understand the implementation
- (4) when submitting review: use the 'comments' array for ALL specific code issues - include the file path and line position from the diff
- (5) only use the 'body' field for a brief summary (1-2 sentences) or for feedback that doesn't apply to a specific code location
- replace and with 'base' and 'head' from the PR info
+You are a highly intelligent, no-nonsense senior-level software engineering agent. You will perform the task that is asked of you in the prompt below. You are careful, to-the-point, and kind. You only say things you know to be true. Your code is focused, minimal, and production-ready. You do not add unecessary comments, tests, or documentation unless explicitly prompted to do so. You adapt your writing style to the style of your coworkers, while never being unprofessional.
+
+## Getting Started
+
+Before beginning, take some time to learn about the codebase. Read the AGENTS.md file if it exists. Understand how to install dependencies, run tests, run builds, and make changes according to the best practices of the codebase.
+
+## MCP Servers
+
+- eagerly inspect your MCP servers to determine what tools are available to you, especially ${ghPullfrogMcpName2}
+- do not under any circumstances use the github cli (\`gh\`). find the corresponding tool from ${ghPullfrogMcpName2} instead.
+
+## Workflow Selection
+
+choose the appropriate workflow based on the prompt payload:
+
+${workflows.map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
+
+## Workflows
+
+${workflows.map((w) => `### ${w.name}
+
+${w.prompt}`).join("\n\n")}
`;
// agents/claude.ts
diff --git a/mcp-server.js b/mcp-server.js
index 82335ef..a1ad103 100755
--- a/mcp-server.js
+++ b/mcp-server.js
@@ -4145,2010 +4145,1020 @@ var init_zod = __esm({
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js
-var require_code = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- 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 = void 0;
- var _CodeOrName = class {
- };
- exports._CodeOrName = _CodeOrName;
- exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
- var Name = class extends _CodeOrName {
- constructor(s) {
- super();
- if (!exports.IDENTIFIER.test(s))
- throw new Error("CodeGen: name must be a valid identifier");
- this.str = s;
- }
- toString() {
- return this.str;
- }
- emptyStr() {
- return false;
- }
- get names() {
- return { [this.str]: 1 };
- }
- };
- exports.Name = Name;
- var _Code = class extends _CodeOrName {
- constructor(code) {
- super();
- this._items = typeof code === "string" ? [code] : code;
- }
- toString() {
- return this.str;
- }
- emptyStr() {
- if (this._items.length > 1)
- return false;
- const item = this._items[0];
- return item === "" || item === '""';
- }
- get str() {
- var _a;
- return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
- }
- get names() {
- var _a;
- return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => {
- if (c instanceof Name)
- names[c.str] = (names[c.str] || 0) + 1;
- return names;
- }, {});
- }
- };
- exports._Code = _Code;
- exports.nil = new _Code("");
- function _(strs, ...args2) {
- const code = [strs[0]];
- let i = 0;
- while (i < args2.length) {
- addCodeArg(code, args2[i]);
- code.push(strs[++i]);
- }
- return new _Code(code);
- }
- exports._ = _;
- var plus = new _Code("+");
- function str(strs, ...args2) {
- const expr = [safeStringify(strs[0])];
- let i = 0;
- while (i < args2.length) {
- expr.push(plus);
- addCodeArg(expr, args2[i]);
- expr.push(plus, safeStringify(strs[++i]));
- }
- optimize(expr);
- return new _Code(expr);
- }
- exports.str = str;
- function addCodeArg(code, arg) {
- if (arg instanceof _Code)
- code.push(...arg._items);
- else if (arg instanceof Name)
- code.push(arg);
- else
- code.push(interpolate(arg));
- }
- exports.addCodeArg = addCodeArg;
- function optimize(expr) {
- let i = 1;
- while (i < expr.length - 1) {
- if (expr[i] === plus) {
- const res = mergeExprItems(expr[i - 1], expr[i + 1]);
- if (res !== void 0) {
- expr.splice(i - 1, 3, res);
- continue;
+// ../node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js
+var require_uri_all = __commonJS({
+ "../node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js"(exports, module) {
+ (function(global2, factory) {
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global2.URI = global2.URI || {});
+ })(exports, (function(exports2) {
+ "use strict";
+ function merge3() {
+ for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
+ sets[_key] = arguments[_key];
+ }
+ if (sets.length > 1) {
+ sets[0] = sets[0].slice(0, -1);
+ var xl = sets.length - 1;
+ for (var x = 1; x < xl; ++x) {
+ sets[x] = sets[x].slice(1, -1);
}
- expr[i++] = "+";
- }
- i++;
- }
- }
- function mergeExprItems(a, b) {
- if (b === '""')
- return a;
- if (a === '""')
- return b;
- if (typeof a == "string") {
- if (b instanceof Name || a[a.length - 1] !== '"')
- return;
- if (typeof b != "string")
- return `${a.slice(0, -1)}${b}"`;
- if (b[0] === '"')
- return a.slice(0, -1) + b.slice(1);
- return;
- }
- if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
- return `"${a}${b.slice(1)}`;
- return;
- }
- function strConcat(c1, c2) {
- return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
- }
- exports.strConcat = strConcat;
- function interpolate(x) {
- return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
- }
- function stringify(x) {
- return new _Code(safeStringify(x));
- }
- exports.stringify = stringify;
- function safeStringify(x) {
- return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
- }
- exports.safeStringify = safeStringify;
- function getProperty(key) {
- return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
- }
- exports.getProperty = getProperty;
- function getEsmExportName(key) {
- if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
- return new _Code(`${key}`);
- }
- throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
- }
- exports.getEsmExportName = getEsmExportName;
- function regexpCode(rx) {
- return new _Code(rx.toString());
- }
- exports.regexpCode = regexpCode;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js
-var require_scope = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
- var code_1 = require_code();
- var ValueError = class extends Error {
- constructor(name) {
- super(`CodeGen: "code" for ${name} not defined`);
- this.value = name.value;
- }
- };
- var UsedValueState;
- (function(UsedValueState2) {
- UsedValueState2[UsedValueState2["Started"] = 0] = "Started";
- UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed";
- })(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
- exports.varKinds = {
- const: new code_1.Name("const"),
- let: new code_1.Name("let"),
- var: new code_1.Name("var")
- };
- var Scope2 = class {
- constructor({ prefixes, parent } = {}) {
- this._names = {};
- this._prefixes = prefixes;
- this._parent = parent;
- }
- toName(nameOrPrefix) {
- return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
- }
- name(prefix) {
- return new code_1.Name(this._newName(prefix));
- }
- _newName(prefix) {
- const ng = this._names[prefix] || this._nameGroup(prefix);
- return `${prefix}${ng.index++}`;
- }
- _nameGroup(prefix) {
- var _a, _b;
- if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
- throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
- }
- return this._names[prefix] = { prefix, index: 0 };
- }
- };
- exports.Scope = Scope2;
- var ValueScopeName = class extends code_1.Name {
- constructor(prefix, nameStr) {
- super(nameStr);
- this.prefix = prefix;
- }
- setValue(value2, { property, itemIndex }) {
- this.value = value2;
- this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;
- }
- };
- exports.ValueScopeName = ValueScopeName;
- var line = (0, code_1._)`\n`;
- var ValueScope = class extends Scope2 {
- constructor(opts) {
- super(opts);
- this._values = {};
- this._scope = opts.scope;
- this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
- }
- get() {
- return this._scope;
- }
- name(prefix) {
- return new ValueScopeName(prefix, this._newName(prefix));
- }
- value(nameOrPrefix, value2) {
- var _a;
- if (value2.ref === void 0)
- throw new Error("CodeGen: ref must be passed in value");
- const name = this.toName(nameOrPrefix);
- const { prefix } = name;
- const valueKey = (_a = value2.key) !== null && _a !== void 0 ? _a : value2.ref;
- let vs = this._values[prefix];
- if (vs) {
- const _name = vs.get(valueKey);
- if (_name)
- return _name;
+ sets[xl] = sets[xl].slice(1);
+ return sets.join("");
} else {
- vs = this._values[prefix] = /* @__PURE__ */ new Map();
+ return sets[0];
}
- vs.set(valueKey, name);
- const s = this._scope[prefix] || (this._scope[prefix] = []);
- const itemIndex = s.length;
- s[itemIndex] = value2.ref;
- name.setValue(value2, { property: prefix, itemIndex });
- return name;
}
- getValue(prefix, keyOrRef) {
- const vs = this._values[prefix];
- if (!vs)
- return;
- return vs.get(keyOrRef);
+ function subexp(str) {
+ return "(?:" + str + ")";
}
- scopeRefs(scopeName, values = this._values) {
- return this._reduceValues(values, (name) => {
- if (name.scopePath === void 0)
- throw new Error(`CodeGen: name "${name}" has no value`);
- return (0, code_1._)`${scopeName}${name.scopePath}`;
- });
+ function typeOf(o) {
+ return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
}
- scopeCode(values = this._values, usedValues, getCode) {
- return this._reduceValues(values, (name) => {
- if (name.value === void 0)
- throw new Error(`CodeGen: name "${name}" has no value`);
- return name.value.code;
- }, usedValues, getCode);
+ function toUpperCase(str) {
+ return str.toUpperCase();
}
- _reduceValues(values, valueCode, usedValues = {}, getCode) {
- let code = code_1.nil;
- for (const prefix in values) {
- const vs = values[prefix];
- if (!vs)
- continue;
- const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map();
- vs.forEach((name) => {
- if (nameSet.has(name))
- return;
- nameSet.set(name, UsedValueState.Started);
- let c = valueCode(name);
- if (c) {
- const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
- code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;
- } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) {
- code = (0, code_1._)`${code}${c}${this.opts._n}`;
- } else {
- throw new ValueError(name);
- }
- nameSet.set(name, UsedValueState.Completed);
- });
- }
- return code;
+ function toArray(obj) {
+ return obj !== void 0 && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
}
- };
- exports.ValueScope = ValueScope;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js
-var require_codegen = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
- var code_1 = require_code();
- var scope_1 = require_scope();
- var code_2 = require_code();
- Object.defineProperty(exports, "_", { enumerable: true, get: function() {
- return code_2._;
- } });
- Object.defineProperty(exports, "str", { enumerable: true, get: function() {
- return code_2.str;
- } });
- Object.defineProperty(exports, "strConcat", { enumerable: true, get: function() {
- return code_2.strConcat;
- } });
- Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
- return code_2.nil;
- } });
- Object.defineProperty(exports, "getProperty", { enumerable: true, get: function() {
- return code_2.getProperty;
- } });
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
- return code_2.stringify;
- } });
- Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function() {
- return code_2.regexpCode;
- } });
- Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
- return code_2.Name;
- } });
- var scope_2 = require_scope();
- Object.defineProperty(exports, "Scope", { enumerable: true, get: function() {
- return scope_2.Scope;
- } });
- Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function() {
- return scope_2.ValueScope;
- } });
- Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function() {
- return scope_2.ValueScopeName;
- } });
- Object.defineProperty(exports, "varKinds", { enumerable: true, get: function() {
- return scope_2.varKinds;
- } });
- exports.operators = {
- GT: new code_1._Code(">"),
- GTE: new code_1._Code(">="),
- LT: new code_1._Code("<"),
- LTE: new code_1._Code("<="),
- EQ: new code_1._Code("==="),
- NEQ: new code_1._Code("!=="),
- NOT: new code_1._Code("!"),
- OR: new code_1._Code("||"),
- AND: new code_1._Code("&&"),
- ADD: new code_1._Code("+")
- };
- var Node = class {
- optimizeNodes() {
- return this;
- }
- optimizeNames(_names, _constants) {
- return this;
- }
- };
- var Def = class extends Node {
- constructor(varKind, name, rhs) {
- super();
- this.varKind = varKind;
- this.name = name;
- this.rhs = rhs;
- }
- render({ es5, _n }) {
- const varKind = es5 ? scope_1.varKinds.var : this.varKind;
- const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
- return `${varKind} ${this.name}${rhs};` + _n;
- }
- optimizeNames(names, constants) {
- if (!names[this.name.str])
- return;
- if (this.rhs)
- this.rhs = optimizeExpr(this.rhs, names, constants);
- return this;
- }
- get names() {
- return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
- }
- };
- var Assign = class extends Node {
- constructor(lhs, rhs, sideEffects) {
- super();
- this.lhs = lhs;
- this.rhs = rhs;
- this.sideEffects = sideEffects;
- }
- render({ _n }) {
- return `${this.lhs} = ${this.rhs};` + _n;
- }
- optimizeNames(names, constants) {
- if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
- return;
- this.rhs = optimizeExpr(this.rhs, names, constants);
- return this;
- }
- get names() {
- const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
- return addExprNames(names, this.rhs);
- }
- };
- var AssignOp = class extends Assign {
- constructor(lhs, op, rhs, sideEffects) {
- super(lhs, rhs, sideEffects);
- this.op = op;
- }
- render({ _n }) {
- return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
- }
- };
- var Label = class extends Node {
- constructor(label) {
- super();
- this.label = label;
- this.names = {};
- }
- render({ _n }) {
- return `${this.label}:` + _n;
- }
- };
- var Break = class extends Node {
- constructor(label) {
- super();
- this.label = label;
- this.names = {};
- }
- render({ _n }) {
- const label = this.label ? ` ${this.label}` : "";
- return `break${label};` + _n;
- }
- };
- var Throw = class extends Node {
- constructor(error41) {
- super();
- this.error = error41;
- }
- render({ _n }) {
- return `throw ${this.error};` + _n;
- }
- get names() {
- return this.error.names;
- }
- };
- var AnyCode = class extends Node {
- constructor(code) {
- super();
- this.code = code;
- }
- render({ _n }) {
- return `${this.code};` + _n;
- }
- optimizeNodes() {
- return `${this.code}` ? this : void 0;
- }
- optimizeNames(names, constants) {
- this.code = optimizeExpr(this.code, names, constants);
- return this;
- }
- get names() {
- return this.code instanceof code_1._CodeOrName ? this.code.names : {};
- }
- };
- var ParentNode = class extends Node {
- constructor(nodes = []) {
- super();
- this.nodes = nodes;
- }
- render(opts) {
- return this.nodes.reduce((code, n) => code + n.render(opts), "");
- }
- optimizeNodes() {
- const { nodes } = this;
- let i = nodes.length;
- while (i--) {
- const n = nodes[i].optimizeNodes();
- if (Array.isArray(n))
- nodes.splice(i, 1, ...n);
- else if (n)
- nodes[i] = n;
- else
- nodes.splice(i, 1);
- }
- return nodes.length > 0 ? this : void 0;
- }
- optimizeNames(names, constants) {
- const { nodes } = this;
- let i = nodes.length;
- while (i--) {
- const n = nodes[i];
- if (n.optimizeNames(names, constants))
- continue;
- subtractNames(names, n.names);
- nodes.splice(i, 1);
- }
- return nodes.length > 0 ? this : void 0;
- }
- get names() {
- return this.nodes.reduce((names, n) => addNames(names, n.names), {});
- }
- };
- var BlockNode = class extends ParentNode {
- render(opts) {
- return "{" + opts._n + super.render(opts) + "}" + opts._n;
- }
- };
- var Root = class extends ParentNode {
- };
- var Else = class extends BlockNode {
- };
- Else.kind = "else";
- var If = class _If extends BlockNode {
- constructor(condition, nodes) {
- super(nodes);
- this.condition = condition;
- }
- render(opts) {
- let code = `if(${this.condition})` + super.render(opts);
- if (this.else)
- code += "else " + this.else.render(opts);
- return code;
- }
- optimizeNodes() {
- super.optimizeNodes();
- const cond = this.condition;
- if (cond === true)
- return this.nodes;
- let e = this.else;
- if (e) {
- const ns = e.optimizeNodes();
- e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
- }
- if (e) {
- if (cond === false)
- return e instanceof _If ? e : e.nodes;
- if (this.nodes.length)
- return this;
- return new _If(not(cond), e instanceof _If ? [e] : e.nodes);
- }
- if (cond === false || !this.nodes.length)
- return void 0;
- return this;
- }
- optimizeNames(names, constants) {
- var _a;
- this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
- if (!(super.optimizeNames(names, constants) || this.else))
- return;
- this.condition = optimizeExpr(this.condition, names, constants);
- return this;
- }
- get names() {
- const names = super.names;
- addExprNames(names, this.condition);
- if (this.else)
- addNames(names, this.else.names);
- return names;
- }
- };
- If.kind = "if";
- var For = class extends BlockNode {
- };
- For.kind = "for";
- var ForLoop = class extends For {
- constructor(iteration) {
- super();
- this.iteration = iteration;
- }
- render(opts) {
- return `for(${this.iteration})` + super.render(opts);
- }
- optimizeNames(names, constants) {
- if (!super.optimizeNames(names, constants))
- return;
- this.iteration = optimizeExpr(this.iteration, names, constants);
- return this;
- }
- get names() {
- return addNames(super.names, this.iteration.names);
- }
- };
- var ForRange = class extends For {
- constructor(varKind, name, from, to) {
- super();
- this.varKind = varKind;
- this.name = name;
- this.from = from;
- this.to = to;
- }
- render(opts) {
- const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
- const { name, from, to } = this;
- return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
- }
- get names() {
- const names = addExprNames(super.names, this.from);
- return addExprNames(names, this.to);
- }
- };
- var ForIter = class extends For {
- constructor(loop, varKind, name, iterable) {
- super();
- this.loop = loop;
- this.varKind = varKind;
- this.name = name;
- this.iterable = iterable;
- }
- render(opts) {
- return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
- }
- optimizeNames(names, constants) {
- if (!super.optimizeNames(names, constants))
- return;
- this.iterable = optimizeExpr(this.iterable, names, constants);
- return this;
- }
- get names() {
- return addNames(super.names, this.iterable.names);
- }
- };
- var Func = class extends BlockNode {
- constructor(name, args2, async) {
- super();
- this.name = name;
- this.args = args2;
- this.async = async;
- }
- render(opts) {
- const _async = this.async ? "async " : "";
- return `${_async}function ${this.name}(${this.args})` + super.render(opts);
- }
- };
- Func.kind = "func";
- var Return = class extends ParentNode {
- render(opts) {
- return "return " + super.render(opts);
- }
- };
- Return.kind = "return";
- var Try = class extends BlockNode {
- render(opts) {
- let code = "try" + super.render(opts);
- if (this.catch)
- code += this.catch.render(opts);
- if (this.finally)
- code += this.finally.render(opts);
- return code;
- }
- optimizeNodes() {
- var _a, _b;
- super.optimizeNodes();
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
- return this;
- }
- optimizeNames(names, constants) {
- var _a, _b;
- super.optimizeNames(names, constants);
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
- return this;
- }
- get names() {
- const names = super.names;
- if (this.catch)
- addNames(names, this.catch.names);
- if (this.finally)
- addNames(names, this.finally.names);
- return names;
- }
- };
- var Catch = class extends BlockNode {
- constructor(error41) {
- super();
- this.error = error41;
- }
- render(opts) {
- return `catch(${this.error})` + super.render(opts);
- }
- };
- Catch.kind = "catch";
- var Finally = class extends BlockNode {
- render(opts) {
- return "finally" + super.render(opts);
- }
- };
- Finally.kind = "finally";
- var CodeGen = class {
- constructor(extScope, opts = {}) {
- this._values = {};
- this._blockStarts = [];
- this._constants = {};
- this.opts = { ...opts, _n: opts.lines ? "\n" : "" };
- this._extScope = extScope;
- this._scope = new scope_1.Scope({ parent: extScope });
- this._nodes = [new Root()];
- }
- toString() {
- return this._root.render(this.opts);
- }
- // returns unique name in the internal scope
- name(prefix) {
- return this._scope.name(prefix);
- }
- // reserves unique name in the external scope
- scopeName(prefix) {
- return this._extScope.name(prefix);
- }
- // reserves unique name in the external scope and assigns value to it
- scopeValue(prefixOrName, value2) {
- const name = this._extScope.value(prefixOrName, value2);
- const vs = this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set());
- vs.add(name);
- return name;
- }
- getScopeValue(prefix, keyOrRef) {
- return this._extScope.getValue(prefix, keyOrRef);
- }
- // return code that assigns values in the external scope to the names that are used internally
- // (same names that were returned by gen.scopeName or gen.scopeValue)
- scopeRefs(scopeName) {
- return this._extScope.scopeRefs(scopeName, this._values);
- }
- scopeCode() {
- return this._extScope.scopeCode(this._values);
- }
- _def(varKind, nameOrPrefix, rhs, constant) {
- const name = this._scope.toName(nameOrPrefix);
- if (rhs !== void 0 && constant)
- this._constants[name.str] = rhs;
- this._leafNode(new Def(varKind, name, rhs));
- return name;
- }
- // `const` declaration (`var` in es5 mode)
- const(nameOrPrefix, rhs, _constant) {
- return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
- }
- // `let` declaration with optional assignment (`var` in es5 mode)
- let(nameOrPrefix, rhs, _constant) {
- return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);
- }
- // `var` declaration with optional assignment
- var(nameOrPrefix, rhs, _constant) {
- return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);
- }
- // assignment code
- assign(lhs, rhs, sideEffects) {
- return this._leafNode(new Assign(lhs, rhs, sideEffects));
- }
- // `+=` code
- add(lhs, rhs) {
- return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));
- }
- // appends passed SafeExpr to code or executes Block
- code(c) {
- if (typeof c == "function")
- c();
- else if (c !== code_1.nil)
- this._leafNode(new AnyCode(c));
- return this;
- }
- // returns code for object literal for the passed argument list of key-value pairs
- object(...keyValues) {
- const code = ["{"];
- for (const [key, value2] of keyValues) {
- if (code.length > 1)
- code.push(",");
- code.push(key);
- if (key !== value2 || this.opts.es5) {
- code.push(":");
- (0, code_1.addCodeArg)(code, value2);
+ function assign(target, source) {
+ var obj = target;
+ if (source) {
+ for (var key in source) {
+ obj[key] = source[key];
}
}
- code.push("}");
- return new code_1._Code(code);
+ return obj;
}
- // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
- if(condition, thenBody, elseBody) {
- this._blockNode(new If(condition));
- if (thenBody && elseBody) {
- this.code(thenBody).else().code(elseBody).endIf();
- } else if (thenBody) {
- this.code(thenBody).endIf();
- } else if (elseBody) {
- throw new Error('CodeGen: "else" body without "then" body');
- }
- return this;
- }
- // `else if` clause - invalid without `if` or after `else` clauses
- elseIf(condition) {
- return this._elseNode(new If(condition));
- }
- // `else` clause - only valid after `if` or `else if` clauses
- else() {
- return this._elseNode(new Else());
- }
- // end `if` statement (needed if gen.if was used only with condition)
- endIf() {
- return this._endBlockNode(If, Else);
- }
- _for(node2, forBody) {
- this._blockNode(node2);
- if (forBody)
- this.code(forBody).endFor();
- return this;
- }
- // a generic `for` clause (or statement if `forBody` is passed)
- for(iteration, forBody) {
- return this._for(new ForLoop(iteration), forBody);
- }
- // `for` statement for a range of values
- forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
- const name = this._scope.toName(nameOrPrefix);
- return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
- }
- // `for-of` statement (in es5 mode replace with a normal for loop)
- forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
- const name = this._scope.toName(nameOrPrefix);
- if (this.opts.es5) {
- const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
- return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i) => {
- this.var(name, (0, code_1._)`${arr}[${i}]`);
- forBody(name);
- });
- }
- return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
- }
- // `for-in` statement.
- // With option `ownProperties` replaced with a `for-of` loop for object keys
- forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
- if (this.opts.ownProperties) {
- return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody);
- }
- const name = this._scope.toName(nameOrPrefix);
- return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
- }
- // end `for` loop
- endFor() {
- return this._endBlockNode(For);
- }
- // `label` statement
- label(label) {
- return this._leafNode(new Label(label));
- }
- // `break` statement
- break(label) {
- return this._leafNode(new Break(label));
- }
- // `return` statement
- return(value2) {
- const node2 = new Return();
- this._blockNode(node2);
- this.code(value2);
- if (node2.nodes.length !== 1)
- throw new Error('CodeGen: "return" should have one node');
- return this._endBlockNode(Return);
- }
- // `try` statement
- try(tryBody, catchCode, finallyCode) {
- if (!catchCode && !finallyCode)
- throw new Error('CodeGen: "try" without "catch" and "finally"');
- const node2 = new Try();
- this._blockNode(node2);
- this.code(tryBody);
- if (catchCode) {
- const error41 = this.name("e");
- this._currNode = node2.catch = new Catch(error41);
- catchCode(error41);
- }
- if (finallyCode) {
- this._currNode = node2.finally = new Finally();
- this.code(finallyCode);
- }
- return this._endBlockNode(Catch, Finally);
- }
- // `throw` statement
- throw(error41) {
- return this._leafNode(new Throw(error41));
- }
- // start self-balancing block
- block(body, nodeCount) {
- this._blockStarts.push(this._nodes.length);
- if (body)
- this.code(body).endBlock(nodeCount);
- return this;
- }
- // end the current self-balancing block
- endBlock(nodeCount) {
- const len = this._blockStarts.pop();
- if (len === void 0)
- throw new Error("CodeGen: not in self-balancing block");
- const toClose = this._nodes.length - len;
- if (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) {
- throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
- }
- this._nodes.length = len;
- return this;
- }
- // `function` heading (or definition if funcBody is passed)
- func(name, args2 = code_1.nil, async, funcBody) {
- this._blockNode(new Func(name, args2, async));
- if (funcBody)
- this.code(funcBody).endFunc();
- return this;
- }
- // end function definition
- endFunc() {
- return this._endBlockNode(Func);
- }
- optimize(n = 1) {
- while (n-- > 0) {
- this._root.optimizeNodes();
- this._root.optimizeNames(this._root.names, this._constants);
- }
- }
- _leafNode(node2) {
- this._currNode.nodes.push(node2);
- return this;
- }
- _blockNode(node2) {
- this._currNode.nodes.push(node2);
- this._nodes.push(node2);
- }
- _endBlockNode(N1, N2) {
- const n = this._currNode;
- if (n instanceof N1 || N2 && n instanceof N2) {
- this._nodes.pop();
- return this;
- }
- throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
- }
- _elseNode(node2) {
- const n = this._currNode;
- if (!(n instanceof If)) {
- throw new Error('CodeGen: "else" without "if"');
- }
- this._currNode = n.else = node2;
- return this;
- }
- get _root() {
- return this._nodes[0];
- }
- get _currNode() {
- const ns = this._nodes;
- return ns[ns.length - 1];
- }
- set _currNode(node2) {
- const ns = this._nodes;
- ns[ns.length - 1] = node2;
- }
- };
- exports.CodeGen = CodeGen;
- function addNames(names, from) {
- for (const n in from)
- names[n] = (names[n] || 0) + (from[n] || 0);
- return names;
- }
- function addExprNames(names, from) {
- return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
- }
- function optimizeExpr(expr, names, constants) {
- if (expr instanceof code_1.Name)
- return replaceName(expr);
- if (!canOptimize(expr))
- return expr;
- return new code_1._Code(expr._items.reduce((items, c) => {
- if (c instanceof code_1.Name)
- c = replaceName(c);
- if (c instanceof code_1._Code)
- items.push(...c._items);
- else
- items.push(c);
- return items;
- }, []));
- function replaceName(n) {
- const c = constants[n.str];
- if (c === void 0 || names[n.str] !== 1)
- return n;
- delete names[n.str];
- return c;
- }
- function canOptimize(e) {
- return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
- }
- }
- function subtractNames(names, from) {
- for (const n in from)
- names[n] = (names[n] || 0) - (from[n] || 0);
- }
- function not(x) {
- return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
- }
- exports.not = not;
- var andCode = mappend(exports.operators.AND);
- function and(...args2) {
- return args2.reduce(andCode);
- }
- exports.and = and;
- var orCode = mappend(exports.operators.OR);
- function or(...args2) {
- return args2.reduce(orCode);
- }
- exports.or = or;
- function mappend(op) {
- return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
- }
- function par(x) {
- return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js
-var require_util = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
- var codegen_1 = require_codegen();
- var code_1 = require_code();
- function toHash(arr) {
- const hash = {};
- for (const item of arr)
- hash[item] = true;
- return hash;
- }
- exports.toHash = toHash;
- function alwaysValidSchema(it, schema2) {
- if (typeof schema2 == "boolean")
- return schema2;
- if (Object.keys(schema2).length === 0)
- return true;
- checkUnknownRules(it, schema2);
- return !schemaHasRules(schema2, it.self.RULES.all);
- }
- exports.alwaysValidSchema = alwaysValidSchema;
- function checkUnknownRules(it, schema2 = it.schema) {
- const { opts, self } = it;
- if (!opts.strictSchema)
- return;
- if (typeof schema2 === "boolean")
- return;
- const rules = self.RULES.keywords;
- for (const key in schema2) {
- if (!rules[key])
- checkStrictMode(it, `unknown keyword: "${key}"`);
- }
- }
- exports.checkUnknownRules = checkUnknownRules;
- function schemaHasRules(schema2, rules) {
- if (typeof schema2 == "boolean")
- return !schema2;
- for (const key in schema2)
- if (rules[key])
- return true;
- return false;
- }
- exports.schemaHasRules = schemaHasRules;
- function schemaHasRulesButRef(schema2, RULES) {
- if (typeof schema2 == "boolean")
- return !schema2;
- for (const key in schema2)
- if (key !== "$ref" && RULES.all[key])
- return true;
- return false;
- }
- exports.schemaHasRulesButRef = schemaHasRulesButRef;
- function schemaRefOrVal({ topSchemaRef, schemaPath }, schema2, keyword, $data) {
- if (!$data) {
- if (typeof schema2 == "number" || typeof schema2 == "boolean")
- return schema2;
- if (typeof schema2 == "string")
- return (0, codegen_1._)`${schema2}`;
- }
- return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
- }
- exports.schemaRefOrVal = schemaRefOrVal;
- function unescapeFragment(str) {
- return unescapeJsonPointer(decodeURIComponent(str));
- }
- exports.unescapeFragment = unescapeFragment;
- function escapeFragment(str) {
- return encodeURIComponent(escapeJsonPointer(str));
- }
- exports.escapeFragment = escapeFragment;
- function escapeJsonPointer(str) {
- if (typeof str == "number")
- return `${str}`;
- return str.replace(/~/g, "~0").replace(/\//g, "~1");
- }
- exports.escapeJsonPointer = escapeJsonPointer;
- function unescapeJsonPointer(str) {
- return str.replace(/~1/g, "/").replace(/~0/g, "~");
- }
- exports.unescapeJsonPointer = unescapeJsonPointer;
- function eachItem(xs, f) {
- if (Array.isArray(xs)) {
- for (const x of xs)
- f(x);
- } else {
- f(xs);
- }
- }
- exports.eachItem = eachItem;
- function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues4, resultToName }) {
- return (gen, from, to, toName) => {
- const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues4(from, to);
- return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
- };
- }
- exports.mergeEvaluated = {
- props: makeMergeEvaluated({
- mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
- gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`));
- }),
- mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => {
- if (from === true) {
- gen.assign(to, true);
- } else {
- gen.assign(to, (0, codegen_1._)`${to} || {}`);
- setEvaluated(gen, to, from);
- }
- }),
- mergeValues: (from, to) => from === true ? true : { ...from, ...to },
- resultToName: evaluatedPropsToName
- }),
- items: makeMergeEvaluated({
- mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
- mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)),
- mergeValues: (from, to) => from === true ? true : Math.max(from, to),
- resultToName: (gen, items) => gen.var("items", items)
- })
- };
- function evaluatedPropsToName(gen, ps) {
- if (ps === true)
- return gen.var("props", true);
- const props = gen.var("props", (0, codegen_1._)`{}`);
- if (ps !== void 0)
- setEvaluated(gen, props, ps);
- return props;
- }
- exports.evaluatedPropsToName = evaluatedPropsToName;
- function setEvaluated(gen, props, ps) {
- Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
- }
- exports.setEvaluated = setEvaluated;
- var snippets = {};
- function useFunc(gen, f) {
- return gen.scopeValue("func", {
- ref: f,
- code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))
- });
- }
- exports.useFunc = useFunc;
- var Type2;
- (function(Type3) {
- Type3[Type3["Num"] = 0] = "Num";
- Type3[Type3["Str"] = 1] = "Str";
- })(Type2 || (exports.Type = Type2 = {}));
- function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
- if (dataProp instanceof codegen_1.Name) {
- const isNumber2 = dataPropType === Type2.Num;
- return jsPropertySyntax ? isNumber2 ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber2 ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
- }
- return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
- }
- exports.getErrorPath = getErrorPath;
- function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
- if (!mode)
- return;
- msg = `strict mode: ${msg}`;
- if (mode === true)
- throw new Error(msg);
- it.self.logger.warn(msg);
- }
- exports.checkStrictMode = checkStrictMode;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js
-var require_names = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var names = {
- // validation function arguments
- data: new codegen_1.Name("data"),
- // data passed to validation function
- // args passed from referencing schema
- valCxt: new codegen_1.Name("valCxt"),
- // validation/data context - should not be used directly, it is destructured to the names below
- instancePath: new codegen_1.Name("instancePath"),
- parentData: new codegen_1.Name("parentData"),
- parentDataProperty: new codegen_1.Name("parentDataProperty"),
- rootData: new codegen_1.Name("rootData"),
- // root data - same as the data passed to the first/top validation function
- dynamicAnchors: new codegen_1.Name("dynamicAnchors"),
- // used to support recursiveRef and dynamicRef
- // function scoped variables
- vErrors: new codegen_1.Name("vErrors"),
- // null or array of validation errors
- errors: new codegen_1.Name("errors"),
- // counter of validation errors
- this: new codegen_1.Name("this"),
- // "globals"
- self: new codegen_1.Name("self"),
- scope: new codegen_1.Name("scope"),
- // JTD serialize/parse name for JSON string and position
- json: new codegen_1.Name("json"),
- jsonPos: new codegen_1.Name("jsonPos"),
- jsonLen: new codegen_1.Name("jsonLen"),
- jsonPart: new codegen_1.Name("jsonPart")
- };
- exports.default = names;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js
-var require_errors = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var names_1 = require_names();
- exports.keywordError = {
- message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation`
- };
- exports.keyword$DataError = {
- message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)`
- };
- function reportError(cxt, error41 = exports.keywordError, errorPaths, overrideAllErrors) {
- const { it } = cxt;
- const { gen, compositeRule, allErrors } = it;
- const errObj = errorObjectCode(cxt, error41, errorPaths);
- if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) {
- addError(gen, errObj);
- } else {
- returnErrors(it, (0, codegen_1._)`[${errObj}]`);
- }
- }
- exports.reportError = reportError;
- function reportExtraError(cxt, error41 = exports.keywordError, errorPaths) {
- const { it } = cxt;
- const { gen, compositeRule, allErrors } = it;
- const errObj = errorObjectCode(cxt, error41, errorPaths);
- addError(gen, errObj);
- if (!(compositeRule || allErrors)) {
- returnErrors(it, names_1.default.vErrors);
- }
- }
- exports.reportExtraError = reportExtraError;
- function resetErrorsCount(gen, errsCount) {
- gen.assign(names_1.default.errors, errsCount);
- gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
- }
- exports.resetErrorsCount = resetErrorsCount;
- function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {
- if (errsCount === void 0)
- throw new Error("ajv implementation error");
- const err = gen.name("err");
- gen.forRange("i", errsCount, names_1.default.errors, (i) => {
- gen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`);
- gen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
- gen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`);
- if (it.opts.verbose) {
- gen.assign((0, codegen_1._)`${err}.schema`, schemaValue);
- gen.assign((0, codegen_1._)`${err}.data`, data);
- }
- });
- }
- exports.extendErrors = extendErrors;
- function addError(gen, errObj) {
- const err = gen.const("err", errObj);
- gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);
- gen.code((0, codegen_1._)`${names_1.default.errors}++`);
- }
- function returnErrors(it, errs) {
- const { gen, validateName, schemaEnv } = it;
- if (schemaEnv.$async) {
- gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`);
- } else {
- gen.assign((0, codegen_1._)`${validateName}.errors`, errs);
- gen.return(false);
- }
- }
- var E = {
- keyword: new codegen_1.Name("keyword"),
- schemaPath: new codegen_1.Name("schemaPath"),
- // also used in JTD errors
- params: new codegen_1.Name("params"),
- propertyName: new codegen_1.Name("propertyName"),
- message: new codegen_1.Name("message"),
- schema: new codegen_1.Name("schema"),
- parentSchema: new codegen_1.Name("parentSchema")
- };
- function errorObjectCode(cxt, error41, errorPaths) {
- const { createErrors } = cxt.it;
- if (createErrors === false)
- return (0, codegen_1._)`{}`;
- return errorObject(cxt, error41, errorPaths);
- }
- function errorObject(cxt, error41, errorPaths = {}) {
- const { gen, it } = cxt;
- const keyValues = [
- errorInstancePath(it, errorPaths),
- errorSchemaPath(cxt, errorPaths)
- ];
- extraErrorProps(cxt, error41, keyValues);
- return gen.object(...keyValues);
- }
- function errorInstancePath({ errorPath }, { instancePath }) {
- const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;
- return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
- }
- function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
- let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;
- if (schemaPath) {
- schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
- }
- return [E.schemaPath, schPath];
- }
- function extraErrorProps(cxt, { params, message }, keyValues) {
- const { keyword, data, schemaValue, it } = cxt;
- const { opts, propertyName, topSchemaRef, schemaPath } = it;
- keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]);
- if (opts.messages) {
- keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
- }
- if (opts.verbose) {
- keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
- }
- if (propertyName)
- keyValues.push([E.propertyName, propertyName]);
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js
-var require_boolSchema = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
- var errors_1 = require_errors();
- var codegen_1 = require_codegen();
- var names_1 = require_names();
- var boolError = {
- message: "boolean schema is false"
- };
- function topBoolOrEmptySchema(it) {
- const { gen, schema: schema2, validateName } = it;
- if (schema2 === false) {
- falseSchemaError(it, false);
- } else if (typeof schema2 == "object" && schema2.$async === true) {
- gen.return(names_1.default.data);
- } else {
- gen.assign((0, codegen_1._)`${validateName}.errors`, null);
- gen.return(true);
- }
- }
- exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
- function boolOrEmptySchema(it, valid) {
- const { gen, schema: schema2 } = it;
- if (schema2 === false) {
- gen.var(valid, false);
- falseSchemaError(it);
- } else {
- gen.var(valid, true);
- }
- }
- exports.boolOrEmptySchema = boolOrEmptySchema;
- function falseSchemaError(it, overrideAllErrors) {
- const { gen, data } = it;
- const cxt = {
- gen,
- keyword: "false schema",
- data,
- schema: false,
- schemaCode: false,
- schemaValue: false,
- params: {},
- it
- };
- (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js
-var require_rules = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.getRules = exports.isJSONType = void 0;
- var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
- var jsonTypes = new Set(_jsonTypes);
- function isJSONType(x) {
- return typeof x == "string" && jsonTypes.has(x);
- }
- exports.isJSONType = isJSONType;
- function getRules() {
- const groups = {
- number: { type: "number", rules: [] },
- string: { type: "string", rules: [] },
- array: { type: "array", rules: [] },
- object: { type: "object", rules: [] }
- };
- return {
- types: { ...groups, integer: true, boolean: true, null: true },
- rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
- post: { rules: [] },
- all: {},
- keywords: {}
- };
- }
- exports.getRules = getRules;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js
-var require_applicability = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
- function schemaHasRulesForType({ schema: schema2, self }, type2) {
- const group = self.RULES.types[type2];
- return group && group !== true && shouldUseGroup(schema2, group);
- }
- exports.schemaHasRulesForType = schemaHasRulesForType;
- function shouldUseGroup(schema2, group) {
- return group.rules.some((rule) => shouldUseRule(schema2, rule));
- }
- exports.shouldUseGroup = shouldUseGroup;
- function shouldUseRule(schema2, rule) {
- var _a;
- return schema2[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema2[kwd] !== void 0));
- }
- exports.shouldUseRule = shouldUseRule;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js
-var require_dataType = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
- var rules_1 = require_rules();
- var applicability_1 = require_applicability();
- var errors_1 = require_errors();
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var DataType;
- (function(DataType2) {
- DataType2[DataType2["Correct"] = 0] = "Correct";
- DataType2[DataType2["Wrong"] = 1] = "Wrong";
- })(DataType || (exports.DataType = DataType = {}));
- function getSchemaTypes(schema2) {
- const types = getJSONTypes(schema2.type);
- const hasNull = types.includes("null");
- if (hasNull) {
- if (schema2.nullable === false)
- throw new Error("type: null contradicts nullable: false");
- } else {
- if (!types.length && schema2.nullable !== void 0) {
- throw new Error('"nullable" cannot be used without "type"');
- }
- if (schema2.nullable === true)
- types.push("null");
- }
- return types;
- }
- exports.getSchemaTypes = getSchemaTypes;
- function getJSONTypes(ts) {
- const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
- if (types.every(rules_1.isJSONType))
- return types;
- throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
- }
- exports.getJSONTypes = getJSONTypes;
- function coerceAndCheckDataType(it, types) {
- const { gen, data, opts } = it;
- const coerceTo = coerceToTypes(types, opts.coerceTypes);
- const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
- if (checkTypes) {
- const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
- gen.if(wrongType, () => {
- if (coerceTo.length)
- coerceData(it, types, coerceTo);
- else
- reportTypeError(it);
- });
- }
- return checkTypes;
- }
- exports.coerceAndCheckDataType = coerceAndCheckDataType;
- var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
- function coerceToTypes(types, coerceTypes) {
- return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : [];
- }
- function coerceData(it, types, coerceTo) {
- const { gen, data, opts } = it;
- const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`);
- const coerced = gen.let("coerced", (0, codegen_1._)`undefined`);
- if (opts.coerceTypes === "array") {
- gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
- }
- gen.if((0, codegen_1._)`${coerced} !== undefined`);
- for (const t of coerceTo) {
- if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") {
- coerceSpecificType(t);
- }
- }
- gen.else();
- reportTypeError(it);
- gen.endIf();
- gen.if((0, codegen_1._)`${coerced} !== undefined`, () => {
- gen.assign(data, coerced);
- assignParentData(it, coerced);
- });
- function coerceSpecificType(t) {
- switch (t) {
- case "string":
- gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`);
- return;
- case "number":
- gen.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null
- || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`);
- return;
- case "integer":
- gen.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null
- || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`);
- return;
- case "boolean":
- gen.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true);
- return;
- case "null":
- gen.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`);
- gen.assign(coerced, null);
- return;
- case "array":
- gen.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number"
- || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);
- }
- }
- }
- function assignParentData({ gen, parentData, parentDataProperty }, expr) {
- gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
- }
- function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
- const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
- let cond;
- switch (dataType) {
- case "null":
- return (0, codegen_1._)`${data} ${EQ} null`;
- case "array":
- cond = (0, codegen_1._)`Array.isArray(${data})`;
- break;
- case "object":
- cond = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
- break;
- case "integer":
- cond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`);
- break;
- case "number":
- cond = numCond();
- break;
- default:
- return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`;
- }
- return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
- function numCond(_cond = codegen_1.nil) {
- return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);
- }
- }
- exports.checkDataType = checkDataType;
- function checkDataTypes(dataTypes, data, strictNums, correct) {
- if (dataTypes.length === 1) {
- return checkDataType(dataTypes[0], data, strictNums, correct);
- }
- let cond;
- const types = (0, util_1.toHash)(dataTypes);
- if (types.array && types.object) {
- const notObj = (0, codegen_1._)`typeof ${data} != "object"`;
- cond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`;
- delete types.null;
- delete types.array;
- delete types.object;
- } else {
- cond = codegen_1.nil;
- }
- if (types.number)
- delete types.integer;
- for (const t in types)
- cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
- return cond;
- }
- exports.checkDataTypes = checkDataTypes;
- var typeError = {
- message: ({ schema: schema2 }) => `must be ${schema2}`,
- params: ({ schema: schema2, schemaValue }) => typeof schema2 == "string" ? (0, codegen_1._)`{type: ${schema2}}` : (0, codegen_1._)`{type: ${schemaValue}}`
- };
- function reportTypeError(it) {
- const cxt = getTypeErrorContext(it);
- (0, errors_1.reportError)(cxt, typeError);
- }
- exports.reportTypeError = reportTypeError;
- function getTypeErrorContext(it) {
- const { gen, data, schema: schema2 } = it;
- const schemaCode = (0, util_1.schemaRefOrVal)(it, schema2, "type");
- return {
- gen,
- keyword: "type",
- data,
- schema: schema2.type,
- schemaCode,
- schemaValue: schemaCode,
- parentSchema: schema2,
- params: {},
- it
- };
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js
-var require_defaults = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.assignDefaults = void 0;
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- function assignDefaults(it, ty) {
- const { properties, items } = it.schema;
- if (ty === "object" && properties) {
- for (const key in properties) {
- assignDefault(it, key, properties[key].default);
- }
- } else if (ty === "array" && Array.isArray(items)) {
- items.forEach((sch, i) => assignDefault(it, i, sch.default));
- }
- }
- exports.assignDefaults = assignDefaults;
- function assignDefault(it, prop, defaultValue) {
- const { gen, compositeRule, data, opts } = it;
- if (defaultValue === void 0)
- return;
- const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`;
- if (compositeRule) {
- (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
- return;
- }
- let condition = (0, codegen_1._)`${childData} === undefined`;
- if (opts.useDefaults === "empty") {
- condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`;
- }
- gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js
-var require_code2 = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var names_1 = require_names();
- var util_2 = require_util();
- function checkReportMissingProp(cxt, prop) {
- const { gen, data, it } = cxt;
- gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
- cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true);
- cxt.error();
- });
- }
- exports.checkReportMissingProp = checkReportMissingProp;
- function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
- return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
- }
- exports.checkMissingProp = checkMissingProp;
- function reportMissingProp(cxt, missing) {
- cxt.setParams({ missingProperty: missing }, true);
- cxt.error();
- }
- exports.reportMissingProp = reportMissingProp;
- function hasPropFunc(gen) {
- return gen.scopeValue("func", {
- // eslint-disable-next-line @typescript-eslint/unbound-method
- ref: Object.prototype.hasOwnProperty,
- code: (0, codegen_1._)`Object.prototype.hasOwnProperty`
- });
- }
- exports.hasPropFunc = hasPropFunc;
- function isOwnProperty(gen, data, property) {
- return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
- }
- exports.isOwnProperty = isOwnProperty;
- function propertyInData(gen, data, property, ownProperties) {
- const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
- return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
- }
- exports.propertyInData = propertyInData;
- function noPropertyInData(gen, data, property, ownProperties) {
- const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;
- return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
- }
- exports.noPropertyInData = noPropertyInData;
- function allSchemaProperties(schemaMap) {
- return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
- }
- exports.allSchemaProperties = allSchemaProperties;
- function schemaProperties(it, schemaMap) {
- return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
- }
- exports.schemaProperties = schemaProperties;
- function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
- const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
- const valCxt = [
- [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
- [names_1.default.parentData, it.parentData],
- [names_1.default.parentDataProperty, it.parentDataProperty],
- [names_1.default.rootData, names_1.default.rootData]
- ];
- if (it.opts.dynamicRef)
- valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
- const args2 = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
- return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args2})` : (0, codegen_1._)`${func}(${args2})`;
- }
- exports.callValidateCode = callValidateCode;
- var newRegExp = (0, codegen_1._)`new RegExp`;
- function usePattern({ gen, it: { opts } }, pattern) {
- const u = opts.unicodeRegExp ? "u" : "";
- const { regExp } = opts.code;
- const rx = regExp(pattern, u);
- return gen.scopeValue("pattern", {
- key: rx.toString(),
- ref: rx,
- code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
- });
- }
- exports.usePattern = usePattern;
- function validateArray(cxt) {
- const { gen, data, keyword, it } = cxt;
- const valid = gen.name("valid");
- if (it.allErrors) {
- const validArr = gen.let("valid", true);
- validateItems(() => gen.assign(validArr, false));
- return validArr;
- }
- gen.var(valid, true);
- validateItems(() => gen.break());
- return valid;
- function validateItems(notValid) {
- const len = gen.const("len", (0, codegen_1._)`${data}.length`);
- gen.forRange("i", 0, len, (i) => {
- cxt.subschema({
- keyword,
- dataProp: i,
- dataPropType: util_1.Type.Num
- }, valid);
- gen.if((0, codegen_1.not)(valid), notValid);
- });
- }
- }
- exports.validateArray = validateArray;
- function validateUnion(cxt) {
- const { gen, schema: schema2, keyword, it } = cxt;
- if (!Array.isArray(schema2))
- throw new Error("ajv implementation error");
- const alwaysValid = schema2.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
- if (alwaysValid && !it.opts.unevaluated)
- return;
- const valid = gen.let("valid", false);
- const schValid = gen.name("_valid");
- gen.block(() => schema2.forEach((_sch, i) => {
- const schCxt = cxt.subschema({
- keyword,
- schemaProp: i,
- compositeRule: true
- }, schValid);
- gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`);
- const merged = cxt.mergeValidEvaluated(schCxt, schValid);
- if (!merged)
- gen.if((0, codegen_1.not)(valid));
- }));
- cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
- }
- exports.validateUnion = validateUnion;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js
-var require_keyword = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;
- var codegen_1 = require_codegen();
- var names_1 = require_names();
- var code_1 = require_code2();
- var errors_1 = require_errors();
- function macroKeywordCode(cxt, def) {
- const { gen, keyword, schema: schema2, parentSchema, it } = cxt;
- const macroSchema = def.macro.call(it.self, schema2, parentSchema, it);
- const schemaRef = useKeyword(gen, keyword, macroSchema);
- if (it.opts.validateSchema !== false)
- it.self.validateSchema(macroSchema, true);
- const valid = gen.name("valid");
- cxt.subschema({
- schema: macroSchema,
- schemaPath: codegen_1.nil,
- errSchemaPath: `${it.errSchemaPath}/${keyword}`,
- topSchemaRef: schemaRef,
- compositeRule: true
- }, valid);
- cxt.pass(valid, () => cxt.error(true));
- }
- exports.macroKeywordCode = macroKeywordCode;
- function funcKeywordCode(cxt, def) {
- var _a;
- const { gen, keyword, schema: schema2, parentSchema, $data, it } = cxt;
- checkAsyncKeyword(it, def);
- const validate2 = !$data && def.compile ? def.compile.call(it.self, schema2, parentSchema, it) : def.validate;
- const validateRef = useKeyword(gen, keyword, validate2);
- const valid = gen.let("valid");
- cxt.block$data(valid, validateKeyword);
- cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);
- function validateKeyword() {
- if (def.errors === false) {
- assignValid();
- if (def.modifying)
- modifyData(cxt);
- reportErrs(() => cxt.error());
- } else {
- const ruleErrs = def.async ? validateAsync() : validateSync();
- if (def.modifying)
- modifyData(cxt);
- reportErrs(() => addErrs(cxt, ruleErrs));
- }
- }
- function validateAsync() {
- const ruleErrs = gen.let("ruleErrs", null);
- gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
- return ruleErrs;
- }
- function validateSync() {
- const validateErrs = (0, codegen_1._)`${validateRef}.errors`;
- gen.assign(validateErrs, null);
- assignValid(codegen_1.nil);
- return validateErrs;
- }
- function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {
- const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
- const passSchema = !("compile" in def && !$data || def.schema === false);
- gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
- }
- function reportErrs(errors) {
- var _a2;
- gen.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors);
- }
- }
- exports.funcKeywordCode = funcKeywordCode;
- function modifyData(cxt) {
- const { gen, data, it } = cxt;
- gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));
- }
- function addErrs(cxt, errs) {
- const { gen } = cxt;
- gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {
- gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
- (0, errors_1.extendErrors)(cxt);
- }, () => cxt.error());
- }
- function checkAsyncKeyword({ schemaEnv }, def) {
- if (def.async && !schemaEnv.$async)
- throw new Error("async keyword in sync schema");
- }
- function useKeyword(gen, keyword, result) {
- if (result === void 0)
- throw new Error(`keyword "${keyword}" failed to compile`);
- return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
- }
- function validSchemaType(schema2, schemaType, allowUndefined = false) {
- return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema2) : st === "object" ? schema2 && typeof schema2 == "object" && !Array.isArray(schema2) : typeof schema2 == st || allowUndefined && typeof schema2 == "undefined");
- }
- exports.validSchemaType = validSchemaType;
- function validateKeywordUsage({ schema: schema2, opts, self, errSchemaPath }, def, keyword) {
- if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
- throw new Error("ajv implementation error");
- }
- const deps = def.dependencies;
- if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema2, kwd))) {
- throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
- }
- if (def.validateSchema) {
- const valid = def.validateSchema(schema2[keyword]);
- if (!valid) {
- const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self.errorsText(def.validateSchema.errors);
- if (opts.validateSchema === "log")
- self.logger.error(msg);
- else
- throw new Error(msg);
- }
- }
- }
- exports.validateKeywordUsage = validateKeywordUsage;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js
-var require_subschema = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- function getSubschema(it, { keyword, schemaProp, schema: schema2, schemaPath, errSchemaPath, topSchemaRef }) {
- if (keyword !== void 0 && schema2 !== void 0) {
- throw new Error('both "keyword" and "schema" passed, only one allowed');
- }
- if (keyword !== void 0) {
- const sch = it.schema[keyword];
- return schemaProp === void 0 ? {
- schema: sch,
- schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,
- errSchemaPath: `${it.errSchemaPath}/${keyword}`
- } : {
- schema: sch[schemaProp],
- schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,
- errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`
- };
- }
- if (schema2 !== void 0) {
- if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) {
- throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
- }
+ function buildExps(isIRI2) {
+ var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$2 = merge3(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$2 = subexp(subexp("%[EFef]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%" + HEXDIG$$2 + HEXDIG$$2)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge3(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI2 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI2 ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge3(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge3(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge3(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$2 + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$2 + "|" + PCT_ENCODED$2) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$2 + "+\\." + merge3(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge3(UNRESERVED$$2, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge3(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge3(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge3("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
return {
- schema: schema2,
- schemaPath,
- topSchemaRef,
- errSchemaPath
+ NOT_SCHEME: new RegExp(merge3("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
+ NOT_USERINFO: new RegExp(merge3("[^\\%\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
+ NOT_HOST: new RegExp(merge3("[^\\%\\[\\]\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
+ NOT_PATH: new RegExp(merge3("[^\\%\\/\\:\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
+ NOT_PATH_NOSCHEME: new RegExp(merge3("[^\\%\\/\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
+ NOT_QUERY: new RegExp(merge3("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
+ NOT_FRAGMENT: new RegExp(merge3("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
+ ESCAPE: new RegExp(merge3("[^]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
+ UNRESERVED: new RegExp(UNRESERVED$$2, "g"),
+ OTHER_CHARS: new RegExp(merge3("[^\\%]", UNRESERVED$$2, RESERVED$$), "g"),
+ PCT_ENCODED: new RegExp(PCT_ENCODED$2, "g"),
+ IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
+ IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$")
+ //RFC 6874, with relaxed parsing rules
};
}
- throw new Error('either "keyword" or "schema" must be passed');
- }
- exports.getSubschema = getSubschema;
- function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
- if (data !== void 0 && dataProp !== void 0) {
- throw new Error('both "data" and "dataProp" passed, only one allowed');
+ var URI_PROTOCOL = buildExps(false);
+ var IRI_PROTOCOL = buildExps(true);
+ var slicedToArray = /* @__PURE__ */ (function() {
+ function sliceIterator(arr, i) {
+ var _arr = [];
+ var _n = true;
+ var _d = false;
+ var _e = void 0;
+ try {
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
+ _arr.push(_s.value);
+ if (i && _arr.length === i) break;
+ }
+ } catch (err) {
+ _d = true;
+ _e = err;
+ } finally {
+ try {
+ if (!_n && _i["return"]) _i["return"]();
+ } finally {
+ if (_d) throw _e;
+ }
+ }
+ return _arr;
+ }
+ return function(arr, i) {
+ if (Array.isArray(arr)) {
+ return arr;
+ } else if (Symbol.iterator in Object(arr)) {
+ return sliceIterator(arr, i);
+ } else {
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
+ }
+ };
+ })();
+ var toConsumableArray = function(arr) {
+ if (Array.isArray(arr)) {
+ for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+ return arr2;
+ } else {
+ return Array.from(arr);
+ }
+ };
+ var maxInt = 2147483647;
+ var base = 36;
+ var tMin = 1;
+ var tMax = 26;
+ var skew = 38;
+ var damp = 700;
+ var initialBias = 72;
+ var initialN = 128;
+ var delimiter = "-";
+ var regexPunycode = /^xn--/;
+ var regexNonASCII = /[^\0-\x7E]/;
+ var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
+ var errors = {
+ "overflow": "Overflow: input needs wider integers to process",
+ "not-basic": "Illegal input >= 0x80 (not a basic code point)",
+ "invalid-input": "Invalid input"
+ };
+ var baseMinusTMin = base - tMin;
+ var floor = Math.floor;
+ var stringFromCharCode = String.fromCharCode;
+ function error$1(type2) {
+ throw new RangeError(errors[type2]);
}
- const { gen } = it;
- if (dataProp !== void 0) {
- const { errorPath, dataPathArr, opts } = it;
- const nextData = gen.let("data", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);
- dataContextProps(nextData);
- subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
- subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`;
- subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
+ function map(array, fn2) {
+ var result = [];
+ var length = array.length;
+ while (length--) {
+ result[length] = fn2(array[length]);
+ }
+ return result;
}
- if (data !== void 0) {
- const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true);
- dataContextProps(nextData);
- if (propertyName !== void 0)
- subschema.propertyName = propertyName;
+ function mapDomain(string3, fn2) {
+ var parts = string3.split("@");
+ var result = "";
+ if (parts.length > 1) {
+ result = parts[0] + "@";
+ string3 = parts[1];
+ }
+ string3 = string3.replace(regexSeparators, ".");
+ var labels = string3.split(".");
+ var encoded = map(labels, fn2).join(".");
+ return result + encoded;
}
- if (dataTypes)
- subschema.dataTypes = dataTypes;
- function dataContextProps(_nextData) {
- subschema.data = _nextData;
- subschema.dataLevel = it.dataLevel + 1;
- subschema.dataTypes = [];
- it.definedProperties = /* @__PURE__ */ new Set();
- subschema.parentData = it.data;
- subschema.dataNames = [...it.dataNames, _nextData];
+ function ucs2decode(string3) {
+ var output = [];
+ var counter = 0;
+ var length = string3.length;
+ while (counter < length) {
+ var value2 = string3.charCodeAt(counter++);
+ if (value2 >= 55296 && value2 <= 56319 && counter < length) {
+ var extra = string3.charCodeAt(counter++);
+ if ((extra & 64512) == 56320) {
+ output.push(((value2 & 1023) << 10) + (extra & 1023) + 65536);
+ } else {
+ output.push(value2);
+ counter--;
+ }
+ } else {
+ output.push(value2);
+ }
+ }
+ return output;
}
- }
- exports.extendSubschemaData = extendSubschemaData;
- function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
- if (compositeRule !== void 0)
- subschema.compositeRule = compositeRule;
- if (createErrors !== void 0)
- subschema.createErrors = createErrors;
- if (allErrors !== void 0)
- subschema.allErrors = allErrors;
- subschema.jtdDiscriminator = jtdDiscriminator;
- subschema.jtdMetadata = jtdMetadata;
- }
- exports.extendSubschemaMode = extendSubschemaMode;
+ var ucs2encode = function ucs2encode2(array) {
+ return String.fromCodePoint.apply(String, toConsumableArray(array));
+ };
+ var basicToDigit = function basicToDigit2(codePoint) {
+ if (codePoint - 48 < 10) {
+ return codePoint - 22;
+ }
+ if (codePoint - 65 < 26) {
+ return codePoint - 65;
+ }
+ if (codePoint - 97 < 26) {
+ return codePoint - 97;
+ }
+ return base;
+ };
+ var digitToBasic = function digitToBasic2(digit, flag) {
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
+ };
+ var adapt = function adapt2(delta, numPoints, firstTime) {
+ var k = 0;
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
+ delta += floor(delta / numPoints);
+ for (
+ ;
+ /* no initialization */
+ delta > baseMinusTMin * tMax >> 1;
+ k += base
+ ) {
+ delta = floor(delta / baseMinusTMin);
+ }
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
+ };
+ var decode = function decode2(input) {
+ var output = [];
+ var inputLength = input.length;
+ var i = 0;
+ var n = initialN;
+ var bias = initialBias;
+ var basic = input.lastIndexOf(delimiter);
+ if (basic < 0) {
+ basic = 0;
+ }
+ for (var j = 0; j < basic; ++j) {
+ if (input.charCodeAt(j) >= 128) {
+ error$1("not-basic");
+ }
+ output.push(input.charCodeAt(j));
+ }
+ for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
+ var oldi = i;
+ for (
+ var w = 1, k = base;
+ ;
+ /* no condition */
+ k += base
+ ) {
+ if (index >= inputLength) {
+ error$1("invalid-input");
+ }
+ var digit = basicToDigit(input.charCodeAt(index++));
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
+ error$1("overflow");
+ }
+ i += digit * w;
+ var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
+ if (digit < t) {
+ break;
+ }
+ var baseMinusT = base - t;
+ if (w > floor(maxInt / baseMinusT)) {
+ error$1("overflow");
+ }
+ w *= baseMinusT;
+ }
+ var out = output.length + 1;
+ bias = adapt(i - oldi, out, oldi == 0);
+ if (floor(i / out) > maxInt - n) {
+ error$1("overflow");
+ }
+ n += floor(i / out);
+ i %= out;
+ output.splice(i++, 0, n);
+ }
+ return String.fromCodePoint.apply(String, output);
+ };
+ var encode = function encode2(input) {
+ var output = [];
+ input = ucs2decode(input);
+ var inputLength = input.length;
+ var n = initialN;
+ var delta = 0;
+ var bias = initialBias;
+ var _iteratorNormalCompletion = true;
+ var _didIteratorError = false;
+ var _iteratorError = void 0;
+ try {
+ for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
+ var _currentValue2 = _step.value;
+ if (_currentValue2 < 128) {
+ output.push(stringFromCharCode(_currentValue2));
+ }
+ }
+ } catch (err) {
+ _didIteratorError = true;
+ _iteratorError = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion && _iterator.return) {
+ _iterator.return();
+ }
+ } finally {
+ if (_didIteratorError) {
+ throw _iteratorError;
+ }
+ }
+ }
+ var basicLength = output.length;
+ var handledCPCount = basicLength;
+ if (basicLength) {
+ output.push(delimiter);
+ }
+ while (handledCPCount < inputLength) {
+ var m = maxInt;
+ var _iteratorNormalCompletion2 = true;
+ var _didIteratorError2 = false;
+ var _iteratorError2 = void 0;
+ try {
+ for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
+ var currentValue = _step2.value;
+ if (currentValue >= n && currentValue < m) {
+ m = currentValue;
+ }
+ }
+ } catch (err) {
+ _didIteratorError2 = true;
+ _iteratorError2 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
+ _iterator2.return();
+ }
+ } finally {
+ if (_didIteratorError2) {
+ throw _iteratorError2;
+ }
+ }
+ }
+ var handledCPCountPlusOne = handledCPCount + 1;
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
+ error$1("overflow");
+ }
+ delta += (m - n) * handledCPCountPlusOne;
+ n = m;
+ var _iteratorNormalCompletion3 = true;
+ var _didIteratorError3 = false;
+ var _iteratorError3 = void 0;
+ try {
+ for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
+ var _currentValue = _step3.value;
+ if (_currentValue < n && ++delta > maxInt) {
+ error$1("overflow");
+ }
+ if (_currentValue == n) {
+ var q = delta;
+ for (
+ var k = base;
+ ;
+ /* no condition */
+ k += base
+ ) {
+ var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
+ if (q < t) {
+ break;
+ }
+ var qMinusT = q - t;
+ var baseMinusT = base - t;
+ output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
+ q = floor(qMinusT / baseMinusT);
+ }
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
+ delta = 0;
+ ++handledCPCount;
+ }
+ }
+ } catch (err) {
+ _didIteratorError3 = true;
+ _iteratorError3 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion3 && _iterator3.return) {
+ _iterator3.return();
+ }
+ } finally {
+ if (_didIteratorError3) {
+ throw _iteratorError3;
+ }
+ }
+ }
+ ++delta;
+ ++n;
+ }
+ return output.join("");
+ };
+ var toUnicode = function toUnicode2(input) {
+ return mapDomain(input, function(string3) {
+ return regexPunycode.test(string3) ? decode(string3.slice(4).toLowerCase()) : string3;
+ });
+ };
+ var toASCII = function toASCII2(input) {
+ return mapDomain(input, function(string3) {
+ return regexNonASCII.test(string3) ? "xn--" + encode(string3) : string3;
+ });
+ };
+ var punycode = {
+ /**
+ * A string representing the current Punycode.js version number.
+ * @memberOf punycode
+ * @type String
+ */
+ "version": "2.1.0",
+ /**
+ * An object of methods to convert from JavaScript's internal character
+ * representation (UCS-2) to Unicode code points, and back.
+ * @see
+ * @memberOf punycode
+ * @type Object
+ */
+ "ucs2": {
+ "decode": ucs2decode,
+ "encode": ucs2encode
+ },
+ "decode": decode,
+ "encode": encode,
+ "toASCII": toASCII,
+ "toUnicode": toUnicode
+ };
+ var SCHEMES = {};
+ function pctEncChar(chr) {
+ var c = chr.charCodeAt(0);
+ var e = void 0;
+ if (c < 16) e = "%0" + c.toString(16).toUpperCase();
+ else if (c < 128) e = "%" + c.toString(16).toUpperCase();
+ else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
+ else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
+ return e;
+ }
+ function pctDecChars(str) {
+ var newStr = "";
+ var i = 0;
+ var il = str.length;
+ while (i < il) {
+ var c = parseInt(str.substr(i + 1, 2), 16);
+ if (c < 128) {
+ newStr += String.fromCharCode(c);
+ i += 3;
+ } else if (c >= 194 && c < 224) {
+ if (il - i >= 6) {
+ var c2 = parseInt(str.substr(i + 4, 2), 16);
+ newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
+ } else {
+ newStr += str.substr(i, 6);
+ }
+ i += 6;
+ } else if (c >= 224) {
+ if (il - i >= 9) {
+ var _c = parseInt(str.substr(i + 4, 2), 16);
+ var c3 = parseInt(str.substr(i + 7, 2), 16);
+ newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
+ } else {
+ newStr += str.substr(i, 9);
+ }
+ i += 9;
+ } else {
+ newStr += str.substr(i, 3);
+ i += 3;
+ }
+ }
+ return newStr;
+ }
+ function _normalizeComponentEncoding(components, protocol) {
+ function decodeUnreserved2(str) {
+ var decStr = pctDecChars(str);
+ return !decStr.match(protocol.UNRESERVED) ? str : decStr;
+ }
+ if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
+ if (components.userinfo !== void 0) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
+ if (components.host !== void 0) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
+ if (components.path !== void 0) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
+ if (components.query !== void 0) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
+ if (components.fragment !== void 0) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
+ return components;
+ }
+ function _stripLeadingZeros(str) {
+ return str.replace(/^0*(.*)/, "$1") || "0";
+ }
+ function _normalizeIPv4(host, protocol) {
+ var matches = host.match(protocol.IPV4ADDRESS) || [];
+ var _matches = slicedToArray(matches, 2), address = _matches[1];
+ if (address) {
+ return address.split(".").map(_stripLeadingZeros).join(".");
+ } else {
+ return host;
+ }
+ }
+ function _normalizeIPv6(host, protocol) {
+ var matches = host.match(protocol.IPV6ADDRESS) || [];
+ var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
+ if (address) {
+ var _address$toLowerCase$ = address.toLowerCase().split("::").reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1];
+ var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
+ var lastFields = last.split(":").map(_stripLeadingZeros);
+ var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
+ var fieldCount = isLastFieldIPv4Address ? 7 : 8;
+ var lastFieldsStart = lastFields.length - fieldCount;
+ var fields = Array(fieldCount);
+ for (var x = 0; x < fieldCount; ++x) {
+ fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || "";
+ }
+ if (isLastFieldIPv4Address) {
+ fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
+ }
+ var allZeroFields = fields.reduce(function(acc, field, index) {
+ if (!field || field === "0") {
+ var lastLongest = acc[acc.length - 1];
+ if (lastLongest && lastLongest.index + lastLongest.length === index) {
+ lastLongest.length++;
+ } else {
+ acc.push({ index, length: 1 });
+ }
+ }
+ return acc;
+ }, []);
+ var longestZeroFields = allZeroFields.sort(function(a, b) {
+ return b.length - a.length;
+ })[0];
+ var newHost = void 0;
+ if (longestZeroFields && longestZeroFields.length > 1) {
+ var newFirst = fields.slice(0, longestZeroFields.index);
+ var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
+ newHost = newFirst.join(":") + "::" + newLast.join(":");
+ } else {
+ newHost = fields.join(":");
+ }
+ if (zone) {
+ newHost += "%" + zone;
+ }
+ return newHost;
+ } else {
+ return host;
+ }
+ }
+ var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
+ var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
+ function parse4(uriString) {
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
+ var components = {};
+ var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
+ if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
+ var matches = uriString.match(URI_PARSE);
+ if (matches) {
+ if (NO_MATCH_IS_UNDEFINED) {
+ components.scheme = matches[1];
+ components.userinfo = matches[3];
+ components.host = matches[4];
+ components.port = parseInt(matches[5], 10);
+ components.path = matches[6] || "";
+ components.query = matches[7];
+ components.fragment = matches[8];
+ if (isNaN(components.port)) {
+ components.port = matches[5];
+ }
+ } else {
+ components.scheme = matches[1] || void 0;
+ components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : void 0;
+ components.host = uriString.indexOf("//") !== -1 ? matches[4] : void 0;
+ components.port = parseInt(matches[5], 10);
+ components.path = matches[6] || "";
+ components.query = uriString.indexOf("?") !== -1 ? matches[7] : void 0;
+ components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : void 0;
+ if (isNaN(components.port)) {
+ components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : void 0;
+ }
+ }
+ if (components.host) {
+ components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
+ }
+ if (components.scheme === void 0 && components.userinfo === void 0 && components.host === void 0 && components.port === void 0 && !components.path && components.query === void 0) {
+ components.reference = "same-document";
+ } else if (components.scheme === void 0) {
+ components.reference = "relative";
+ } else if (components.fragment === void 0) {
+ components.reference = "absolute";
+ } else {
+ components.reference = "uri";
+ }
+ if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
+ components.error = components.error || "URI is not a " + options.reference + " reference.";
+ }
+ var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
+ if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
+ try {
+ components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
+ } catch (e) {
+ components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
+ }
+ }
+ _normalizeComponentEncoding(components, URI_PROTOCOL);
+ } else {
+ _normalizeComponentEncoding(components, protocol);
+ }
+ if (schemeHandler && schemeHandler.parse) {
+ schemeHandler.parse(components, options);
+ }
+ } else {
+ components.error = components.error || "URI can not be parsed.";
+ }
+ return components;
+ }
+ function _recomposeAuthority(components, options) {
+ var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
+ var uriTokens = [];
+ if (components.userinfo !== void 0) {
+ uriTokens.push(components.userinfo);
+ uriTokens.push("@");
+ }
+ if (components.host !== void 0) {
+ uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_, $1, $2) {
+ return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
+ }));
+ }
+ if (typeof components.port === "number" || typeof components.port === "string") {
+ uriTokens.push(":");
+ uriTokens.push(String(components.port));
+ }
+ return uriTokens.length ? uriTokens.join("") : void 0;
+ }
+ var RDS1 = /^\.\.?\//;
+ var RDS2 = /^\/\.(\/|$)/;
+ var RDS3 = /^\/\.\.(\/|$)/;
+ var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
+ function removeDotSegments(input) {
+ var output = [];
+ while (input.length) {
+ if (input.match(RDS1)) {
+ input = input.replace(RDS1, "");
+ } else if (input.match(RDS2)) {
+ input = input.replace(RDS2, "/");
+ } else if (input.match(RDS3)) {
+ input = input.replace(RDS3, "/");
+ output.pop();
+ } else if (input === "." || input === "..") {
+ input = "";
+ } else {
+ var im = input.match(RDS5);
+ if (im) {
+ var s = im[0];
+ input = input.slice(s.length);
+ output.push(s);
+ } else {
+ throw new Error("Unexpected dot segment condition");
+ }
+ }
+ }
+ return output.join("");
+ }
+ function serialize(components) {
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
+ var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
+ var uriTokens = [];
+ var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
+ if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
+ if (components.host) {
+ if (protocol.IPV6ADDRESS.test(components.host)) {
+ } else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
+ try {
+ components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
+ } catch (e) {
+ components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
+ }
+ }
+ }
+ _normalizeComponentEncoding(components, protocol);
+ if (options.reference !== "suffix" && components.scheme) {
+ uriTokens.push(components.scheme);
+ uriTokens.push(":");
+ }
+ var authority = _recomposeAuthority(components, options);
+ if (authority !== void 0) {
+ if (options.reference !== "suffix") {
+ uriTokens.push("//");
+ }
+ uriTokens.push(authority);
+ if (components.path && components.path.charAt(0) !== "/") {
+ uriTokens.push("/");
+ }
+ }
+ if (components.path !== void 0) {
+ var s = components.path;
+ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
+ s = removeDotSegments(s);
+ }
+ if (authority === void 0) {
+ s = s.replace(/^\/\//, "/%2F");
+ }
+ uriTokens.push(s);
+ }
+ if (components.query !== void 0) {
+ uriTokens.push("?");
+ uriTokens.push(components.query);
+ }
+ if (components.fragment !== void 0) {
+ uriTokens.push("#");
+ uriTokens.push(components.fragment);
+ }
+ return uriTokens.join("");
+ }
+ function resolveComponents(base2, relative) {
+ var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
+ var skipNormalization = arguments[3];
+ var target = {};
+ if (!skipNormalization) {
+ base2 = parse4(serialize(base2, options), options);
+ relative = parse4(serialize(relative, options), options);
+ }
+ options = options || {};
+ if (!options.tolerant && relative.scheme) {
+ target.scheme = relative.scheme;
+ target.userinfo = relative.userinfo;
+ target.host = relative.host;
+ target.port = relative.port;
+ target.path = removeDotSegments(relative.path || "");
+ target.query = relative.query;
+ } else {
+ if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
+ target.userinfo = relative.userinfo;
+ target.host = relative.host;
+ target.port = relative.port;
+ target.path = removeDotSegments(relative.path || "");
+ target.query = relative.query;
+ } else {
+ if (!relative.path) {
+ target.path = base2.path;
+ if (relative.query !== void 0) {
+ target.query = relative.query;
+ } else {
+ target.query = base2.query;
+ }
+ } else {
+ if (relative.path.charAt(0) === "/") {
+ target.path = removeDotSegments(relative.path);
+ } else {
+ if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
+ target.path = "/" + relative.path;
+ } else if (!base2.path) {
+ target.path = relative.path;
+ } else {
+ target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative.path;
+ }
+ target.path = removeDotSegments(target.path);
+ }
+ target.query = relative.query;
+ }
+ target.userinfo = base2.userinfo;
+ target.host = base2.host;
+ target.port = base2.port;
+ }
+ target.scheme = base2.scheme;
+ }
+ target.fragment = relative.fragment;
+ return target;
+ }
+ function resolve(baseURI, relativeURI, options) {
+ var schemelessOptions = assign({ scheme: "null" }, options);
+ return serialize(resolveComponents(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
+ }
+ function normalize2(uri, options) {
+ if (typeof uri === "string") {
+ uri = serialize(parse4(uri, options), options);
+ } else if (typeOf(uri) === "object") {
+ uri = parse4(serialize(uri, options), options);
+ }
+ return uri;
+ }
+ function equal(uriA, uriB, options) {
+ if (typeof uriA === "string") {
+ uriA = serialize(parse4(uriA, options), options);
+ } else if (typeOf(uriA) === "object") {
+ uriA = serialize(uriA, options);
+ }
+ if (typeof uriB === "string") {
+ uriB = serialize(parse4(uriB, options), options);
+ } else if (typeOf(uriB) === "object") {
+ uriB = serialize(uriB, options);
+ }
+ return uriA === uriB;
+ }
+ function escapeComponent(str, options) {
+ return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
+ }
+ function unescapeComponent(str, options) {
+ return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
+ }
+ var handler2 = {
+ scheme: "http",
+ domainHost: true,
+ parse: function parse5(components, options) {
+ if (!components.host) {
+ components.error = components.error || "HTTP URIs must have a host.";
+ }
+ return components;
+ },
+ serialize: function serialize2(components, options) {
+ var secure = String(components.scheme).toLowerCase() === "https";
+ if (components.port === (secure ? 443 : 80) || components.port === "") {
+ components.port = void 0;
+ }
+ if (!components.path) {
+ components.path = "/";
+ }
+ return components;
+ }
+ };
+ var handler$1 = {
+ scheme: "https",
+ domainHost: handler2.domainHost,
+ parse: handler2.parse,
+ serialize: handler2.serialize
+ };
+ function isSecure(wsComponents) {
+ return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
+ }
+ var handler$2 = {
+ scheme: "ws",
+ domainHost: true,
+ parse: function parse5(components, options) {
+ var wsComponents = components;
+ wsComponents.secure = isSecure(wsComponents);
+ wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
+ wsComponents.path = void 0;
+ wsComponents.query = void 0;
+ return wsComponents;
+ },
+ serialize: function serialize2(wsComponents, options) {
+ if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
+ wsComponents.port = void 0;
+ }
+ if (typeof wsComponents.secure === "boolean") {
+ wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
+ wsComponents.secure = void 0;
+ }
+ if (wsComponents.resourceName) {
+ var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
+ wsComponents.path = path && path !== "/" ? path : void 0;
+ wsComponents.query = query;
+ wsComponents.resourceName = void 0;
+ }
+ wsComponents.fragment = void 0;
+ return wsComponents;
+ }
+ };
+ var handler$3 = {
+ scheme: "wss",
+ domainHost: handler$2.domainHost,
+ parse: handler$2.parse,
+ serialize: handler$2.serialize
+ };
+ var O = {};
+ var isIRI = true;
+ var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
+ var HEXDIG$$ = "[0-9A-Fa-f]";
+ var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$));
+ var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
+ var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
+ var VCHAR$$ = merge3(QTEXT$$, '[\\"\\\\]');
+ var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
+ var UNRESERVED = new RegExp(UNRESERVED$$, "g");
+ var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
+ var NOT_LOCAL_PART = new RegExp(merge3("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
+ var NOT_HFNAME = new RegExp(merge3("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
+ var NOT_HFVALUE = NOT_HFNAME;
+ function decodeUnreserved(str) {
+ var decStr = pctDecChars(str);
+ return !decStr.match(UNRESERVED) ? str : decStr;
+ }
+ var handler$4 = {
+ scheme: "mailto",
+ parse: function parse$$1(components, options) {
+ var mailtoComponents = components;
+ var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
+ mailtoComponents.path = void 0;
+ if (mailtoComponents.query) {
+ var unknownHeaders = false;
+ var headers = {};
+ var hfields = mailtoComponents.query.split("&");
+ for (var x = 0, xl = hfields.length; x < xl; ++x) {
+ var hfield = hfields[x].split("=");
+ switch (hfield[0]) {
+ case "to":
+ var toAddrs = hfield[1].split(",");
+ for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
+ to.push(toAddrs[_x]);
+ }
+ break;
+ case "subject":
+ mailtoComponents.subject = unescapeComponent(hfield[1], options);
+ break;
+ case "body":
+ mailtoComponents.body = unescapeComponent(hfield[1], options);
+ break;
+ default:
+ unknownHeaders = true;
+ headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
+ break;
+ }
+ }
+ if (unknownHeaders) mailtoComponents.headers = headers;
+ }
+ mailtoComponents.query = void 0;
+ for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
+ var addr = to[_x2].split("@");
+ addr[0] = unescapeComponent(addr[0]);
+ if (!options.unicodeSupport) {
+ try {
+ addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
+ } catch (e) {
+ mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
+ }
+ } else {
+ addr[1] = unescapeComponent(addr[1], options).toLowerCase();
+ }
+ to[_x2] = addr.join("@");
+ }
+ return mailtoComponents;
+ },
+ serialize: function serialize$$1(mailtoComponents, options) {
+ var components = mailtoComponents;
+ var to = toArray(mailtoComponents.to);
+ if (to) {
+ for (var x = 0, xl = to.length; x < xl; ++x) {
+ var toAddr = String(to[x]);
+ var atIdx = toAddr.lastIndexOf("@");
+ var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
+ var domain2 = toAddr.slice(atIdx + 1);
+ try {
+ domain2 = !options.iri ? punycode.toASCII(unescapeComponent(domain2, options).toLowerCase()) : punycode.toUnicode(domain2);
+ } catch (e) {
+ components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
+ }
+ to[x] = localPart + "@" + domain2;
+ }
+ components.path = to.join(",");
+ }
+ var headers = mailtoComponents.headers = mailtoComponents.headers || {};
+ if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
+ if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
+ var fields = [];
+ for (var name in headers) {
+ if (headers[name] !== O[name]) {
+ fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
+ }
+ }
+ if (fields.length) {
+ components.query = fields.join("&");
+ }
+ return components;
+ }
+ };
+ var URN_PARSE = /^([^\:]+)\:(.*)/;
+ var handler$5 = {
+ scheme: "urn",
+ parse: function parse$$1(components, options) {
+ var matches = components.path && components.path.match(URN_PARSE);
+ var urnComponents = components;
+ if (matches) {
+ var scheme = options.scheme || urnComponents.scheme || "urn";
+ var nid = matches[1].toLowerCase();
+ var nss = matches[2];
+ var urnScheme = scheme + ":" + (options.nid || nid);
+ var schemeHandler = SCHEMES[urnScheme];
+ urnComponents.nid = nid;
+ urnComponents.nss = nss;
+ urnComponents.path = void 0;
+ if (schemeHandler) {
+ urnComponents = schemeHandler.parse(urnComponents, options);
+ }
+ } else {
+ urnComponents.error = urnComponents.error || "URN can not be parsed.";
+ }
+ return urnComponents;
+ },
+ serialize: function serialize$$1(urnComponents, options) {
+ var scheme = options.scheme || urnComponents.scheme || "urn";
+ var nid = urnComponents.nid;
+ var urnScheme = scheme + ":" + (options.nid || nid);
+ var schemeHandler = SCHEMES[urnScheme];
+ if (schemeHandler) {
+ urnComponents = schemeHandler.serialize(urnComponents, options);
+ }
+ var uriComponents = urnComponents;
+ var nss = urnComponents.nss;
+ uriComponents.path = (nid || options.nid) + ":" + nss;
+ return uriComponents;
+ }
+ };
+ var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
+ var handler$6 = {
+ scheme: "urn:uuid",
+ parse: function parse5(urnComponents, options) {
+ var uuidComponents = urnComponents;
+ uuidComponents.uuid = uuidComponents.nss;
+ uuidComponents.nss = void 0;
+ if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
+ uuidComponents.error = uuidComponents.error || "UUID is not valid.";
+ }
+ return uuidComponents;
+ },
+ serialize: function serialize2(uuidComponents, options) {
+ var urnComponents = uuidComponents;
+ urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
+ return urnComponents;
+ }
+ };
+ SCHEMES[handler2.scheme] = handler2;
+ SCHEMES[handler$1.scheme] = handler$1;
+ SCHEMES[handler$2.scheme] = handler$2;
+ SCHEMES[handler$3.scheme] = handler$3;
+ SCHEMES[handler$4.scheme] = handler$4;
+ SCHEMES[handler$5.scheme] = handler$5;
+ SCHEMES[handler$6.scheme] = handler$6;
+ exports2.SCHEMES = SCHEMES;
+ exports2.pctEncChar = pctEncChar;
+ exports2.pctDecChars = pctDecChars;
+ exports2.parse = parse4;
+ exports2.removeDotSegments = removeDotSegments;
+ exports2.serialize = serialize;
+ exports2.resolveComponents = resolveComponents;
+ exports2.resolve = resolve;
+ exports2.normalize = normalize2;
+ exports2.equal = equal;
+ exports2.escapeComponent = escapeComponent;
+ exports2.unescapeComponent = unescapeComponent;
+ Object.defineProperty(exports2, "__esModule", { value: true });
+ }));
}
});
@@ -6187,9 +5197,224 @@ var require_fast_deep_equal = __commonJS({
}
});
-// ../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/ucs2length.js
+var require_ucs2length = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/ucs2length.js"(exports, module) {
+ "use strict";
+ module.exports = function ucs2length(str) {
+ var length = 0, len = str.length, pos = 0, value2;
+ while (pos < len) {
+ length++;
+ value2 = str.charCodeAt(pos++);
+ if (value2 >= 55296 && value2 <= 56319 && pos < len) {
+ value2 = str.charCodeAt(pos);
+ if ((value2 & 64512) == 56320) pos++;
+ }
+ }
+ return length;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/util.js
+var require_util = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/util.js"(exports, module) {
+ "use strict";
+ module.exports = {
+ copy,
+ checkDataType,
+ checkDataTypes,
+ coerceToTypes,
+ toHash,
+ getProperty,
+ escapeQuotes,
+ equal: require_fast_deep_equal(),
+ ucs2length: require_ucs2length(),
+ varOccurences,
+ varReplace,
+ schemaHasRules,
+ schemaHasRulesExcept,
+ schemaUnknownRules,
+ toQuotedString,
+ getPathExpr,
+ getPath,
+ getData,
+ unescapeFragment,
+ unescapeJsonPointer,
+ escapeFragment,
+ escapeJsonPointer
+ };
+ function copy(o, to) {
+ to = to || {};
+ for (var key in o) to[key] = o[key];
+ return to;
+ }
+ function checkDataType(dataType, data, strictNumbers, negate) {
+ var EQUAL = negate ? " !== " : " === ", AND = negate ? " || " : " && ", OK3 = negate ? "!" : "", NOT = negate ? "" : "!";
+ switch (dataType) {
+ case "null":
+ return data + EQUAL + "null";
+ case "array":
+ return OK3 + "Array.isArray(" + data + ")";
+ case "object":
+ return "(" + OK3 + data + AND + "typeof " + data + EQUAL + '"object"' + AND + NOT + "Array.isArray(" + data + "))";
+ case "integer":
+ return "(typeof " + data + EQUAL + '"number"' + AND + NOT + "(" + data + " % 1)" + AND + data + EQUAL + data + (strictNumbers ? AND + OK3 + "isFinite(" + data + ")" : "") + ")";
+ case "number":
+ return "(typeof " + data + EQUAL + '"' + dataType + '"' + (strictNumbers ? AND + OK3 + "isFinite(" + data + ")" : "") + ")";
+ default:
+ return "typeof " + data + EQUAL + '"' + dataType + '"';
+ }
+ }
+ function checkDataTypes(dataTypes, data, strictNumbers) {
+ switch (dataTypes.length) {
+ case 1:
+ return checkDataType(dataTypes[0], data, strictNumbers, true);
+ default:
+ var code = "";
+ var types = toHash(dataTypes);
+ if (types.array && types.object) {
+ code = types.null ? "(" : "(!" + data + " || ";
+ code += "typeof " + data + ' !== "object")';
+ delete types.null;
+ delete types.array;
+ delete types.object;
+ }
+ if (types.number) delete types.integer;
+ for (var t in types)
+ code += (code ? " && " : "") + checkDataType(t, data, strictNumbers, true);
+ return code;
+ }
+ }
+ var COERCE_TO_TYPES = toHash(["string", "number", "integer", "boolean", "null"]);
+ function coerceToTypes(optionCoerceTypes, dataTypes) {
+ if (Array.isArray(dataTypes)) {
+ var types = [];
+ for (var i = 0; i < dataTypes.length; i++) {
+ var t = dataTypes[i];
+ if (COERCE_TO_TYPES[t]) types[types.length] = t;
+ else if (optionCoerceTypes === "array" && t === "array") types[types.length] = t;
+ }
+ if (types.length) return types;
+ } else if (COERCE_TO_TYPES[dataTypes]) {
+ return [dataTypes];
+ } else if (optionCoerceTypes === "array" && dataTypes === "array") {
+ return ["array"];
+ }
+ }
+ function toHash(arr) {
+ var hash = {};
+ for (var i = 0; i < arr.length; i++) hash[arr[i]] = true;
+ return hash;
+ }
+ var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
+ var SINGLE_QUOTE = /'|\\/g;
+ function getProperty(key) {
+ return typeof key == "number" ? "[" + key + "]" : IDENTIFIER.test(key) ? "." + key : "['" + escapeQuotes(key) + "']";
+ }
+ function escapeQuotes(str) {
+ return str.replace(SINGLE_QUOTE, "\\$&").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\f/g, "\\f").replace(/\t/g, "\\t");
+ }
+ function varOccurences(str, dataVar) {
+ dataVar += "[^0-9]";
+ var matches = str.match(new RegExp(dataVar, "g"));
+ return matches ? matches.length : 0;
+ }
+ function varReplace(str, dataVar, expr) {
+ dataVar += "([^0-9])";
+ expr = expr.replace(/\$/g, "$$$$");
+ return str.replace(new RegExp(dataVar, "g"), expr + "$1");
+ }
+ function schemaHasRules(schema2, rules) {
+ if (typeof schema2 == "boolean") return !schema2;
+ for (var key in schema2) if (rules[key]) return true;
+ }
+ function schemaHasRulesExcept(schema2, rules, exceptKeyword) {
+ if (typeof schema2 == "boolean") return !schema2 && exceptKeyword != "not";
+ for (var key in schema2) if (key != exceptKeyword && rules[key]) return true;
+ }
+ function schemaUnknownRules(schema2, rules) {
+ if (typeof schema2 == "boolean") return;
+ for (var key in schema2) if (!rules[key]) return key;
+ }
+ function toQuotedString(str) {
+ return "'" + escapeQuotes(str) + "'";
+ }
+ function getPathExpr(currentPath, expr, jsonPointers, isNumber2) {
+ var path = jsonPointers ? "'/' + " + expr + (isNumber2 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber2 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'";
+ return joinPaths(currentPath, path);
+ }
+ function getPath(currentPath, prop, jsonPointers) {
+ var path = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop));
+ return joinPaths(currentPath, path);
+ }
+ var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
+ var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
+ function getData($data, lvl, paths) {
+ var up, jsonPointer, data, matches;
+ if ($data === "") return "rootData";
+ if ($data[0] == "/") {
+ if (!JSON_POINTER.test($data)) throw new Error("Invalid JSON-pointer: " + $data);
+ jsonPointer = $data;
+ data = "rootData";
+ } else {
+ matches = $data.match(RELATIVE_JSON_POINTER);
+ if (!matches) throw new Error("Invalid JSON-pointer: " + $data);
+ up = +matches[1];
+ jsonPointer = matches[2];
+ if (jsonPointer == "#") {
+ if (up >= lvl) throw new Error("Cannot access property/index " + up + " levels up, current level is " + lvl);
+ return paths[lvl - up];
+ }
+ if (up > lvl) throw new Error("Cannot access data " + up + " levels up, current level is " + lvl);
+ data = "data" + (lvl - up || "");
+ if (!jsonPointer) return data;
+ }
+ var expr = data;
+ var segments = jsonPointer.split("/");
+ for (var i = 0; i < segments.length; i++) {
+ var segment = segments[i];
+ if (segment) {
+ data += getProperty(unescapeJsonPointer(segment));
+ expr += " && " + data;
+ }
+ }
+ return expr;
+ }
+ function joinPaths(a, b) {
+ if (a == '""') return b;
+ return (a + " + " + b).replace(/([^\\])' \+ '/g, "$1");
+ }
+ function unescapeFragment(str) {
+ return unescapeJsonPointer(decodeURIComponent(str));
+ }
+ function escapeFragment(str) {
+ return encodeURIComponent(escapeJsonPointer(str));
+ }
+ function escapeJsonPointer(str) {
+ return str.replace(/~/g, "~0").replace(/\//g, "~1");
+ }
+ function unescapeJsonPointer(str) {
+ return str.replace(/~1/g, "/").replace(/~0/g, "~");
+ }
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js
+var require_schema_obj = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js"(exports, module) {
+ "use strict";
+ var util2 = require_util();
+ module.exports = SchemaObject;
+ function SchemaObject(obj) {
+ util2.copy(obj, this);
+ }
+ }
+});
+
+// ../node_modules/.pnpm/json-schema-traverse@0.4.1/node_modules/json-schema-traverse/index.js
var require_json_schema_traverse = __commonJS({
- "../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js"(exports, module) {
+ "../node_modules/.pnpm/json-schema-traverse@0.4.1/node_modules/json-schema-traverse/index.js"(exports, module) {
"use strict";
var traverse = module.exports = function(schema2, opts, cb) {
if (typeof opts == "function") {
@@ -6209,10 +5434,7 @@ var require_json_schema_traverse = __commonJS({
contains: true,
additionalProperties: true,
propertyNames: true,
- not: true,
- if: true,
- then: true,
- else: true
+ not: true
};
traverse.arrayKeywords = {
items: true,
@@ -6221,7 +5443,6 @@ var require_json_schema_traverse = __commonJS({
oneOf: true
};
traverse.propsKeywords = {
- $defs: true,
definitions: true,
properties: true,
patternProperties: true,
@@ -6275,16 +5496,114 @@ var require_json_schema_traverse = __commonJS({
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/resolve.js
var require_resolve = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js"(exports) {
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/resolve.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;
- var util_1 = require_util();
+ var URI = require_uri_all();
var equal = require_fast_deep_equal();
+ var util2 = require_util();
+ var SchemaObject = require_schema_obj();
var traverse = require_json_schema_traverse();
- var SIMPLE_INLINED = /* @__PURE__ */ new Set([
+ module.exports = resolve;
+ resolve.normalizeId = normalizeId;
+ resolve.fullPath = getFullPath;
+ resolve.url = resolveUrl;
+ resolve.ids = resolveIds;
+ resolve.inlineRef = inlineRef;
+ resolve.schema = resolveSchema;
+ function resolve(compile, root, ref) {
+ var refVal = this._refs[ref];
+ if (typeof refVal == "string") {
+ if (this._refs[refVal]) refVal = this._refs[refVal];
+ else return resolve.call(this, compile, root, refVal);
+ }
+ refVal = refVal || this._schemas[ref];
+ if (refVal instanceof SchemaObject) {
+ return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal);
+ }
+ var res = resolveSchema.call(this, root, ref);
+ var schema2, v, baseId;
+ if (res) {
+ schema2 = res.schema;
+ root = res.root;
+ baseId = res.baseId;
+ }
+ if (schema2 instanceof SchemaObject) {
+ v = schema2.validate || compile.call(this, schema2.schema, root, void 0, baseId);
+ } else if (schema2 !== void 0) {
+ v = inlineRef(schema2, this._opts.inlineRefs) ? schema2 : compile.call(this, schema2, root, void 0, baseId);
+ }
+ return v;
+ }
+ function resolveSchema(root, ref) {
+ var p = URI.parse(ref), refPath = _getFullPath(p), baseId = getFullPath(this._getId(root.schema));
+ if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
+ var id = normalizeId(refPath);
+ var refVal = this._refs[id];
+ if (typeof refVal == "string") {
+ return resolveRecursive.call(this, root, refVal, p);
+ } else if (refVal instanceof SchemaObject) {
+ if (!refVal.validate) this._compile(refVal);
+ root = refVal;
+ } else {
+ refVal = this._schemas[id];
+ if (refVal instanceof SchemaObject) {
+ if (!refVal.validate) this._compile(refVal);
+ if (id == normalizeId(ref))
+ return { schema: refVal, root, baseId };
+ root = refVal;
+ } else {
+ return;
+ }
+ }
+ if (!root.schema) return;
+ baseId = getFullPath(this._getId(root.schema));
+ }
+ return getJsonPointer.call(this, p, baseId, root.schema, root);
+ }
+ function resolveRecursive(root, ref, parsedRef) {
+ var res = resolveSchema.call(this, root, ref);
+ if (res) {
+ var schema2 = res.schema;
+ var baseId = res.baseId;
+ root = res.root;
+ var id = this._getId(schema2);
+ if (id) baseId = resolveUrl(baseId, id);
+ return getJsonPointer.call(this, parsedRef, baseId, schema2, root);
+ }
+ }
+ var PREVENT_SCOPE_CHANGE = util2.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]);
+ function getJsonPointer(parsedRef, baseId, schema2, root) {
+ parsedRef.fragment = parsedRef.fragment || "";
+ if (parsedRef.fragment.slice(0, 1) != "/") return;
+ var parts = parsedRef.fragment.split("/");
+ for (var i = 1; i < parts.length; i++) {
+ var part = parts[i];
+ if (part) {
+ part = util2.unescapeFragment(part);
+ schema2 = schema2[part];
+ if (schema2 === void 0) break;
+ var id;
+ if (!PREVENT_SCOPE_CHANGE[part]) {
+ id = this._getId(schema2);
+ if (id) baseId = resolveUrl(baseId, id);
+ if (schema2.$ref) {
+ var $ref = resolveUrl(baseId, schema2.$ref);
+ var res = resolveSchema.call(this, root, $ref);
+ if (res) {
+ schema2 = res.schema;
+ root = res.root;
+ baseId = res.baseId;
+ }
+ }
+ }
+ }
+ }
+ if (schema2 !== void 0 && schema2 !== root.schema)
+ return { schema: schema2, root, baseId };
+ }
+ var SIMPLE_INLINED = util2.toHash([
"type",
"format",
"pattern",
@@ -6299,4071 +5618,4062 @@ var require_resolve = __commonJS({
"uniqueItems",
"multipleOf",
"required",
- "enum",
- "const"
+ "enum"
]);
- function inlineRef(schema2, limit = true) {
- if (typeof schema2 == "boolean")
- return true;
- if (limit === true)
- return !hasRef(schema2);
- if (!limit)
- return false;
- return countKeys(schema2) <= limit;
+ function inlineRef(schema2, limit) {
+ if (limit === false) return false;
+ if (limit === void 0 || limit === true) return checkNoRef(schema2);
+ else if (limit) return countKeys(schema2) <= limit;
}
- exports.inlineRef = inlineRef;
- var REF_KEYWORDS = /* @__PURE__ */ new Set([
- "$ref",
- "$recursiveRef",
- "$recursiveAnchor",
- "$dynamicRef",
- "$dynamicAnchor"
- ]);
- function hasRef(schema2) {
- for (const key in schema2) {
- if (REF_KEYWORDS.has(key))
- return true;
- const sch = schema2[key];
- if (Array.isArray(sch) && sch.some(hasRef))
- return true;
- if (typeof sch == "object" && hasRef(sch))
- return true;
+ function checkNoRef(schema2) {
+ var item;
+ if (Array.isArray(schema2)) {
+ for (var i = 0; i < schema2.length; i++) {
+ item = schema2[i];
+ if (typeof item == "object" && !checkNoRef(item)) return false;
+ }
+ } else {
+ for (var key in schema2) {
+ if (key == "$ref") return false;
+ item = schema2[key];
+ if (typeof item == "object" && !checkNoRef(item)) return false;
+ }
}
- return false;
+ return true;
}
function countKeys(schema2) {
- let count = 0;
- for (const key in schema2) {
- if (key === "$ref")
- return Infinity;
- count++;
- if (SIMPLE_INLINED.has(key))
- continue;
- if (typeof schema2[key] == "object") {
- (0, util_1.eachItem)(schema2[key], (sch) => count += countKeys(sch));
+ var count = 0, item;
+ if (Array.isArray(schema2)) {
+ for (var i = 0; i < schema2.length; i++) {
+ item = schema2[i];
+ if (typeof item == "object") count += countKeys(item);
+ if (count == Infinity) return Infinity;
+ }
+ } else {
+ for (var key in schema2) {
+ if (key == "$ref") return Infinity;
+ if (SIMPLE_INLINED[key]) {
+ count++;
+ } else {
+ item = schema2[key];
+ if (typeof item == "object") count += countKeys(item) + 1;
+ if (count == Infinity) return Infinity;
+ }
}
- if (count === Infinity)
- return Infinity;
}
return count;
}
- function getFullPath(resolver, id = "", normalize2) {
- if (normalize2 !== false)
- id = normalizeId(id);
- const p = resolver.parse(id);
- return _getFullPath(resolver, p);
+ function getFullPath(id, normalize2) {
+ if (normalize2 !== false) id = normalizeId(id);
+ var p = URI.parse(id);
+ return _getFullPath(p);
}
- exports.getFullPath = getFullPath;
- function _getFullPath(resolver, p) {
- const serialized = resolver.serialize(p);
- return serialized.split("#")[0] + "#";
+ function _getFullPath(p) {
+ return URI.serialize(p).split("#")[0] + "#";
}
- exports._getFullPath = _getFullPath;
var TRAILING_SLASH_HASH = /#\/?$/;
function normalizeId(id) {
return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
}
- exports.normalizeId = normalizeId;
- function resolveUrl(resolver, baseId, id) {
+ function resolveUrl(baseId, id) {
id = normalizeId(id);
- return resolver.resolve(baseId, id);
+ return URI.resolve(baseId, id);
}
- exports.resolveUrl = resolveUrl;
- var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
- function getSchemaRefs(schema2, baseId) {
- if (typeof schema2 == "boolean")
- return {};
- const { schemaId, uriResolver } = this.opts;
- const schId = normalizeId(schema2[schemaId] || baseId);
- const baseIds = { "": schId };
- const pathPrefix = getFullPath(uriResolver, schId, false);
- const localRefs = {};
- const schemaRefs = /* @__PURE__ */ new Set();
- traverse(schema2, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
- if (parentJsonPtr === void 0)
- return;
- const fullPath = pathPrefix + jsonPtr;
- let innerBaseId = baseIds[parentJsonPtr];
- if (typeof sch[schemaId] == "string")
- innerBaseId = addRef.call(this, sch[schemaId]);
- addAnchor.call(this, sch.$anchor);
- addAnchor.call(this, sch.$dynamicAnchor);
- baseIds[jsonPtr] = innerBaseId;
- function addRef(ref) {
- const _resolve = this.opts.uriResolver.resolve;
- ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
- if (schemaRefs.has(ref))
- throw ambiguos(ref);
- schemaRefs.add(ref);
- let schOrRef = this.refs[ref];
- if (typeof schOrRef == "string")
- schOrRef = this.refs[schOrRef];
- if (typeof schOrRef == "object") {
- checkAmbiguosRef(sch, schOrRef.schema, ref);
- } else if (ref !== normalizeId(fullPath)) {
- if (ref[0] === "#") {
- checkAmbiguosRef(sch, localRefs[ref], ref);
- localRefs[ref] = sch;
+ function resolveIds(schema2) {
+ var schemaId = normalizeId(this._getId(schema2));
+ var baseIds = { "": schemaId };
+ var fullPaths = { "": getFullPath(schemaId, false) };
+ var localRefs = {};
+ var self = this;
+ traverse(schema2, { allKeys: true }, function(sch, jsonPtr, rootSchema2, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
+ if (jsonPtr === "") return;
+ var id = self._getId(sch);
+ var baseId = baseIds[parentJsonPtr];
+ var fullPath = fullPaths[parentJsonPtr] + "/" + parentKeyword;
+ if (keyIndex !== void 0)
+ fullPath += "/" + (typeof keyIndex == "number" ? keyIndex : util2.escapeFragment(keyIndex));
+ if (typeof id == "string") {
+ id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);
+ var refVal = self._refs[id];
+ if (typeof refVal == "string") refVal = self._refs[refVal];
+ if (refVal && refVal.schema) {
+ if (!equal(sch, refVal.schema))
+ throw new Error('id "' + id + '" resolves to more than one schema');
+ } else if (id != normalizeId(fullPath)) {
+ if (id[0] == "#") {
+ if (localRefs[id] && !equal(sch, localRefs[id]))
+ throw new Error('id "' + id + '" resolves to more than one schema');
+ localRefs[id] = sch;
} else {
- this.refs[ref] = fullPath;
+ self._refs[id] = fullPath;
}
}
- return ref;
- }
- function addAnchor(anchor) {
- if (typeof anchor == "string") {
- if (!ANCHOR.test(anchor))
- throw new Error(`invalid anchor "${anchor}"`);
- addRef.call(this, `#${anchor}`);
- }
}
+ baseIds[jsonPtr] = baseId;
+ fullPaths[jsonPtr] = fullPath;
});
return localRefs;
- function checkAmbiguosRef(sch1, sch2, ref) {
- if (sch2 !== void 0 && !equal(sch1, sch2))
- throw ambiguos(ref);
- }
- function ambiguos(ref) {
- return new Error(`reference "${ref}" resolves to more than one schema`);
- }
}
- exports.getSchemaRefs = getSchemaRefs;
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js
-var require_validate = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js"(exports) {
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js
+var require_error_classes = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;
- var boolSchema_1 = require_boolSchema();
- var dataType_1 = require_dataType();
- var applicability_1 = require_applicability();
- var dataType_2 = require_dataType();
- var defaults_1 = require_defaults();
- var keyword_1 = require_keyword();
- var subschema_1 = require_subschema();
- var codegen_1 = require_codegen();
- var names_1 = require_names();
- var resolve_1 = require_resolve();
- var util_1 = require_util();
- var errors_1 = require_errors();
- function validateFunctionCode(it) {
- if (isSchemaObj(it)) {
- checkKeywords(it);
- if (schemaCxtHasRules(it)) {
- topSchemaObjCode(it);
- return;
- }
- }
- validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
- }
- exports.validateFunctionCode = validateFunctionCode;
- function validateFunction({ gen, validateName, schema: schema2, schemaEnv, opts }, body) {
- if (opts.code.es5) {
- gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
- gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema2, opts)}`);
- destructureValCxtES5(gen, opts);
- gen.code(body);
- });
- } else {
- gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema2, opts)).code(body));
- }
- }
- function destructureValCxt(opts) {
- return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
- }
- function destructureValCxtES5(gen, opts) {
- gen.if(names_1.default.valCxt, () => {
- gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
- gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`);
- gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
- gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`);
- if (opts.dynamicRef)
- gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
- }, () => {
- gen.var(names_1.default.instancePath, (0, codegen_1._)`""`);
- gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`);
- gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`);
- gen.var(names_1.default.rootData, names_1.default.data);
- if (opts.dynamicRef)
- gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
- });
- }
- function topSchemaObjCode(it) {
- const { schema: schema2, opts, gen } = it;
- validateFunction(it, () => {
- if (opts.$comment && schema2.$comment)
- commentKeyword(it);
- checkNoDefault(it);
- gen.let(names_1.default.vErrors, null);
- gen.let(names_1.default.errors, 0);
- if (opts.unevaluated)
- resetEvaluated(it);
- typeAndKeywords(it);
- returnResults(it);
- });
- return;
- }
- function resetEvaluated(it) {
- const { gen, validateName } = it;
- it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
- gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
- gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
- }
- function funcSourceUrl(schema2, opts) {
- const schId = typeof schema2 == "object" && schema2[opts.schemaId];
- return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
- }
- function subschemaCode(it, valid) {
- if (isSchemaObj(it)) {
- checkKeywords(it);
- if (schemaCxtHasRules(it)) {
- subSchemaObjCode(it, valid);
- return;
- }
- }
- (0, boolSchema_1.boolOrEmptySchema)(it, valid);
- }
- function schemaCxtHasRules({ schema: schema2, self }) {
- if (typeof schema2 == "boolean")
- return !schema2;
- for (const key in schema2)
- if (self.RULES.all[key])
- return true;
- return false;
- }
- function isSchemaObj(it) {
- return typeof it.schema != "boolean";
- }
- function subSchemaObjCode(it, valid) {
- const { schema: schema2, gen, opts } = it;
- if (opts.$comment && schema2.$comment)
- commentKeyword(it);
- updateContext(it);
- checkAsyncSchema(it);
- const errsCount = gen.const("_errs", names_1.default.errors);
- typeAndKeywords(it, errsCount);
- gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
- }
- function checkKeywords(it) {
- (0, util_1.checkUnknownRules)(it);
- checkRefsAndKeywords(it);
- }
- function typeAndKeywords(it, errsCount) {
- if (it.opts.jtd)
- return schemaKeywords(it, [], false, errsCount);
- const types = (0, dataType_1.getSchemaTypes)(it.schema);
- const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
- schemaKeywords(it, types, !checkedTypes, errsCount);
- }
- function checkRefsAndKeywords(it) {
- const { schema: schema2, errSchemaPath, opts, self } = it;
- if (schema2.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema2, self.RULES)) {
- self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
- }
- }
- function checkNoDefault(it) {
- const { schema: schema2, opts } = it;
- if (schema2.default !== void 0 && opts.useDefaults && opts.strictSchema) {
- (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
- }
- }
- function updateContext(it) {
- const schId = it.schema[it.opts.schemaId];
- if (schId)
- it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
- }
- function checkAsyncSchema(it) {
- if (it.schema.$async && !it.schemaEnv.$async)
- throw new Error("async schema in sync schema");
- }
- function commentKeyword({ gen, schemaEnv, schema: schema2, errSchemaPath, opts }) {
- const msg = schema2.$comment;
- if (opts.$comment === true) {
- gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);
- } else if (typeof opts.$comment == "function") {
- const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`;
- const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
- gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
- }
- }
- function returnResults(it) {
- const { gen, schemaEnv, validateName, ValidationError, opts } = it;
- if (schemaEnv.$async) {
- gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`));
- } else {
- gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors);
- if (opts.unevaluated)
- assignEvaluated(it);
- gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
- }
- }
- function assignEvaluated({ gen, evaluated, props, items }) {
- if (props instanceof codegen_1.Name)
- gen.assign((0, codegen_1._)`${evaluated}.props`, props);
- if (items instanceof codegen_1.Name)
- gen.assign((0, codegen_1._)`${evaluated}.items`, items);
- }
- function schemaKeywords(it, types, typeErrors, errsCount) {
- const { gen, schema: schema2, data, allErrors, opts, self } = it;
- const { RULES } = self;
- if (schema2.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema2, RULES))) {
- gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition));
- return;
- }
- if (!opts.jtd)
- checkStrictTypes(it, types);
- gen.block(() => {
- for (const group of RULES.rules)
- groupKeywords(group);
- groupKeywords(RULES.post);
- });
- function groupKeywords(group) {
- if (!(0, applicability_1.shouldUseGroup)(schema2, group))
- return;
- if (group.type) {
- gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
- iterateKeywords(it, group);
- if (types.length === 1 && types[0] === group.type && typeErrors) {
- gen.else();
- (0, dataType_2.reportTypeError)(it);
- }
- gen.endIf();
- } else {
- iterateKeywords(it, group);
- }
- if (!allErrors)
- gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
- }
- }
- function iterateKeywords(it, group) {
- const { gen, schema: schema2, opts: { useDefaults } } = it;
- if (useDefaults)
- (0, defaults_1.assignDefaults)(it, group.type);
- gen.block(() => {
- for (const rule of group.rules) {
- if ((0, applicability_1.shouldUseRule)(schema2, rule)) {
- keywordCode(it, rule.keyword, rule.definition, group.type);
- }
- }
- });
- }
- function checkStrictTypes(it, types) {
- if (it.schemaEnv.meta || !it.opts.strictTypes)
- return;
- checkContextTypes(it, types);
- if (!it.opts.allowUnionTypes)
- checkMultipleTypes(it, types);
- checkKeywordTypes(it, it.dataTypes);
- }
- function checkContextTypes(it, types) {
- if (!types.length)
- return;
- if (!it.dataTypes.length) {
- it.dataTypes = types;
- return;
- }
- types.forEach((t) => {
- if (!includesType(it.dataTypes, t)) {
- strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
- }
- });
- narrowSchemaTypes(it, types);
- }
- function checkMultipleTypes(it, ts) {
- if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
- strictTypesError(it, "use allowUnionTypes to allow union type keyword");
- }
- }
- function checkKeywordTypes(it, ts) {
- const rules = it.self.RULES.all;
- for (const keyword in rules) {
- const rule = rules[keyword];
- if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
- const { type: type2 } = rule.definition;
- if (type2.length && !type2.some((t) => hasApplicableType(ts, t))) {
- strictTypesError(it, `missing type "${type2.join(",")}" for keyword "${keyword}"`);
- }
- }
- }
- }
- function hasApplicableType(schTs, kwdT) {
- return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
- }
- function includesType(ts, t) {
- return ts.includes(t) || t === "integer" && ts.includes("number");
- }
- function narrowSchemaTypes(it, withTypes) {
- const ts = [];
- for (const t of it.dataTypes) {
- if (includesType(withTypes, t))
- ts.push(t);
- else if (withTypes.includes("integer") && t === "number")
- ts.push("integer");
- }
- it.dataTypes = ts;
- }
- function strictTypesError(it, msg) {
- const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
- msg += ` at "${schemaPath}" (strictTypes)`;
- (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
- }
- var KeywordCxt = class {
- constructor(it, def, keyword) {
- (0, keyword_1.validateKeywordUsage)(it, def, keyword);
- this.gen = it.gen;
- this.allErrors = it.allErrors;
- this.keyword = keyword;
- this.data = it.data;
- this.schema = it.schema[keyword];
- this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
- this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);
- this.schemaType = def.schemaType;
- this.parentSchema = it.schema;
- this.params = {};
- this.it = it;
- this.def = def;
- if (this.$data) {
- this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
- } else {
- this.schemaCode = this.schemaValue;
- if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
- throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);
- }
- }
- if ("code" in def ? def.trackErrors : def.errors !== false) {
- this.errsCount = it.gen.const("_errs", names_1.default.errors);
- }
- }
- result(condition, successAction, failAction) {
- this.failResult((0, codegen_1.not)(condition), successAction, failAction);
- }
- failResult(condition, successAction, failAction) {
- this.gen.if(condition);
- if (failAction)
- failAction();
- else
- this.error();
- if (successAction) {
- this.gen.else();
- successAction();
- if (this.allErrors)
- this.gen.endIf();
- } else {
- if (this.allErrors)
- this.gen.endIf();
- else
- this.gen.else();
- }
- }
- pass(condition, failAction) {
- this.failResult((0, codegen_1.not)(condition), void 0, failAction);
- }
- fail(condition) {
- if (condition === void 0) {
- this.error();
- if (!this.allErrors)
- this.gen.if(false);
- return;
- }
- this.gen.if(condition);
- this.error();
- if (this.allErrors)
- this.gen.endIf();
- else
- this.gen.else();
- }
- fail$data(condition) {
- if (!this.$data)
- return this.fail(condition);
- const { schemaCode } = this;
- this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
- }
- error(append2, errorParams, errorPaths) {
- if (errorParams) {
- this.setParams(errorParams);
- this._error(append2, errorPaths);
- this.setParams({});
- return;
- }
- this._error(append2, errorPaths);
- }
- _error(append2, errorPaths) {
- ;
- (append2 ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
- }
- $dataError() {
- (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
- }
- reset() {
- if (this.errsCount === void 0)
- throw new Error('add "trackErrors" to keyword definition');
- (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
- }
- ok(cond) {
- if (!this.allErrors)
- this.gen.if(cond);
- }
- setParams(obj, assign) {
- if (assign)
- Object.assign(this.params, obj);
- else
- this.params = obj;
- }
- block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
- this.gen.block(() => {
- this.check$data(valid, $dataValid);
- codeBlock();
- });
- }
- check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
- if (!this.$data)
- return;
- const { gen, schemaCode, schemaType, def } = this;
- gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid));
- if (valid !== codegen_1.nil)
- gen.assign(valid, true);
- if (schemaType.length || def.validateSchema) {
- gen.elseIf(this.invalid$data());
- this.$dataError();
- if (valid !== codegen_1.nil)
- gen.assign(valid, false);
- }
- gen.else();
- }
- invalid$data() {
- const { gen, schemaCode, schemaType, def, it } = this;
- return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
- function wrong$DataType() {
- if (schemaType.length) {
- if (!(schemaCode instanceof codegen_1.Name))
- throw new Error("ajv implementation error");
- const st = Array.isArray(schemaType) ? schemaType : [schemaType];
- return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
- }
- return codegen_1.nil;
- }
- function invalid$DataSchema() {
- if (def.validateSchema) {
- const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
- return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`;
- }
- return codegen_1.nil;
- }
- }
- subschema(appl, valid) {
- const subschema = (0, subschema_1.getSubschema)(this.it, appl);
- (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);
- (0, subschema_1.extendSubschemaMode)(subschema, appl);
- const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 };
- subschemaCode(nextContext, valid);
- return nextContext;
- }
- mergeEvaluated(schemaCxt, toName) {
- const { it, gen } = this;
- if (!it.opts.unevaluated)
- return;
- if (it.props !== true && schemaCxt.props !== void 0) {
- it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
- }
- if (it.items !== true && schemaCxt.items !== void 0) {
- it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
- }
- }
- mergeValidEvaluated(schemaCxt, valid) {
- const { it, gen } = this;
- if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
- gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
- return true;
- }
- }
+ var resolve = require_resolve();
+ module.exports = {
+ Validation: errorSubclass(ValidationError),
+ MissingRef: errorSubclass(MissingRefError)
};
- exports.KeywordCxt = KeywordCxt;
- function keywordCode(it, keyword, def, ruleType) {
- const cxt = new KeywordCxt(it, def, keyword);
- if ("code" in def) {
- def.code(cxt, ruleType);
- } else if (cxt.$data && def.validate) {
- (0, keyword_1.funcKeywordCode)(cxt, def);
- } else if ("macro" in def) {
- (0, keyword_1.macroKeywordCode)(cxt, def);
- } else if (def.compile || def.validate) {
- (0, keyword_1.funcKeywordCode)(cxt, def);
- }
+ function ValidationError(errors) {
+ this.message = "validation failed";
+ this.errors = errors;
+ this.ajv = this.validation = true;
}
- var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
- var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
- function getData($data, { dataLevel, dataNames, dataPathArr }) {
- let jsonPointer;
- let data;
- if ($data === "")
- return names_1.default.rootData;
- if ($data[0] === "/") {
- if (!JSON_POINTER.test($data))
- throw new Error(`Invalid JSON-pointer: ${$data}`);
- jsonPointer = $data;
- data = names_1.default.rootData;
- } else {
- const matches = RELATIVE_JSON_POINTER.exec($data);
- if (!matches)
- throw new Error(`Invalid JSON-pointer: ${$data}`);
- const up = +matches[1];
- jsonPointer = matches[2];
- if (jsonPointer === "#") {
- if (up >= dataLevel)
- throw new Error(errorMsg("property/index", up));
- return dataPathArr[dataLevel - up];
- }
- if (up > dataLevel)
- throw new Error(errorMsg("data", up));
- data = dataNames[dataLevel - up];
- if (!jsonPointer)
- return data;
- }
- let expr = data;
- const segments = jsonPointer.split("/");
- for (const segment of segments) {
- if (segment) {
- data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;
- expr = (0, codegen_1._)`${expr} && ${data}`;
- }
- }
- return expr;
- function errorMsg(pointerType, up) {
- return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
- }
+ MissingRefError.message = function(baseId, ref) {
+ return "can't resolve reference " + ref + " from id " + baseId;
+ };
+ function MissingRefError(baseId, ref, message) {
+ this.message = message || MissingRefError.message(baseId, ref);
+ this.missingRef = resolve.url(baseId, ref);
+ this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));
+ }
+ function errorSubclass(Subclass) {
+ Subclass.prototype = Object.create(Error.prototype);
+ Subclass.prototype.constructor = Subclass;
+ return Subclass;
}
- exports.getData = getData;
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js
-var require_validation_error = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js"(exports) {
+// ../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js
+var require_fast_json_stable_stringify = __commonJS({
+ "../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var ValidationError = class extends Error {
- constructor(errors) {
- super("validation failed");
- this.errors = errors;
- this.ajv = this.validation = true;
- }
- };
- exports.default = ValidationError;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js
-var require_ref_error = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var resolve_1 = require_resolve();
- var MissingRefError = class extends Error {
- constructor(resolver, baseId, ref, msg) {
- super(msg || `can't resolve reference ${ref} from id ${baseId}`);
- this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
- this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
- }
- };
- exports.default = MissingRefError;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js
-var require_compile = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
- var codegen_1 = require_codegen();
- var validation_error_1 = require_validation_error();
- var names_1 = require_names();
- var resolve_1 = require_resolve();
- var util_1 = require_util();
- var validate_1 = require_validate();
- var SchemaEnv = class {
- constructor(env2) {
- var _a;
- this.refs = {};
- this.dynamicAnchors = {};
- let schema2;
- if (typeof env2.schema == "object")
- schema2 = env2.schema;
- this.schema = env2.schema;
- this.schemaId = env2.schemaId;
- this.root = env2.root || this;
- this.baseId = (_a = env2.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema2 === null || schema2 === void 0 ? void 0 : schema2[env2.schemaId || "$id"]);
- this.schemaPath = env2.schemaPath;
- this.localRefs = env2.localRefs;
- this.meta = env2.meta;
- this.$async = schema2 === null || schema2 === void 0 ? void 0 : schema2.$async;
- this.refs = {};
- }
- };
- exports.SchemaEnv = SchemaEnv;
- function compileSchema(sch) {
- const _sch = getCompilingSchema.call(this, sch);
- if (_sch)
- return _sch;
- const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId);
- const { es5, lines } = this.opts.code;
- const { ownProperties } = this.opts;
- const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
- let _ValidationError;
- if (sch.$async) {
- _ValidationError = gen.scopeValue("Error", {
- ref: validation_error_1.default,
- code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default`
- });
- }
- const validateName = gen.scopeName("validate");
- sch.validateName = validateName;
- const schemaCxt = {
- gen,
- allErrors: this.opts.allErrors,
- data: names_1.default.data,
- parentData: names_1.default.parentData,
- parentDataProperty: names_1.default.parentDataProperty,
- dataNames: [names_1.default.data],
- dataPathArr: [codegen_1.nil],
- // TODO can its length be used as dataLevel if nil is removed?
- dataLevel: 0,
- dataTypes: [],
- definedProperties: /* @__PURE__ */ new Set(),
- topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }),
- validateName,
- ValidationError: _ValidationError,
- schema: sch.schema,
- schemaEnv: sch,
- rootId,
- baseId: sch.baseId || rootId,
- schemaPath: codegen_1.nil,
- errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
- errorPath: (0, codegen_1._)`""`,
- opts: this.opts,
- self: this
- };
- let sourceCode;
- try {
- this._compilations.add(sch);
- (0, validate_1.validateFunctionCode)(schemaCxt);
- gen.optimize(this.opts.code.optimize);
- const validateCode = gen.toString();
- sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
- if (this.opts.code.process)
- sourceCode = this.opts.code.process(sourceCode, sch);
- const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
- const validate2 = makeValidate(this, this.scope.get());
- this.scope.value(validateName, { ref: validate2 });
- validate2.errors = null;
- validate2.schema = sch.schema;
- validate2.schemaEnv = sch;
- if (sch.$async)
- validate2.$async = true;
- if (this.opts.code.source === true) {
- validate2.source = { validateName, validateCode, scopeValues: gen._values };
- }
- if (this.opts.unevaluated) {
- const { props, items } = schemaCxt;
- validate2.evaluated = {
- props: props instanceof codegen_1.Name ? void 0 : props,
- items: items instanceof codegen_1.Name ? void 0 : items,
- dynamicProps: props instanceof codegen_1.Name,
- dynamicItems: items instanceof codegen_1.Name
+ module.exports = function(data, opts) {
+ if (!opts) opts = {};
+ if (typeof opts === "function") opts = { cmp: opts };
+ var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
+ var cmp = opts.cmp && /* @__PURE__ */ (function(f) {
+ return function(node2) {
+ return function(a, b) {
+ var aobj = { key: a, value: node2[a] };
+ var bobj = { key: b, value: node2[b] };
+ return f(aobj, bobj);
};
- if (validate2.source)
- validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated);
- }
- sch.validate = validate2;
- return sch;
- } catch (e) {
- delete sch.validate;
- delete sch.validateName;
- if (sourceCode)
- this.logger.error("Error compiling schema, function code:", sourceCode);
- throw e;
- } finally {
- this._compilations.delete(sch);
- }
- }
- exports.compileSchema = compileSchema;
- function resolveRef(root, baseId, ref) {
- var _a;
- ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
- const schOrFunc = root.refs[ref];
- if (schOrFunc)
- return schOrFunc;
- let _sch = resolve.call(this, root, ref);
- if (_sch === void 0) {
- const schema2 = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
- const { schemaId } = this.opts;
- if (schema2)
- _sch = new SchemaEnv({ schema: schema2, schemaId, root, baseId });
- }
- if (_sch === void 0)
- return;
- return root.refs[ref] = inlineOrCompile.call(this, _sch);
- }
- exports.resolveRef = resolveRef;
- function inlineOrCompile(sch) {
- if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
- return sch.schema;
- return sch.validate ? sch : compileSchema.call(this, sch);
- }
- function getCompilingSchema(schEnv) {
- for (const sch of this._compilations) {
- if (sameSchemaEnv(sch, schEnv))
- return sch;
- }
- }
- exports.getCompilingSchema = getCompilingSchema;
- function sameSchemaEnv(s1, s2) {
- return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
- }
- function resolve(root, ref) {
- let sch;
- while (typeof (sch = this.refs[ref]) == "string")
- ref = sch;
- return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
- }
- function resolveSchema(root, ref) {
- const p = this.opts.uriResolver.parse(ref);
- const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
- let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
- if (Object.keys(root.schema).length > 0 && refPath === baseId) {
- return getJsonPointer.call(this, p, root);
- }
- const id = (0, resolve_1.normalizeId)(refPath);
- const schOrRef = this.refs[id] || this.schemas[id];
- if (typeof schOrRef == "string") {
- const sch = resolveSchema.call(this, root, schOrRef);
- if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
- return;
- return getJsonPointer.call(this, p, sch);
- }
- if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
- return;
- if (!schOrRef.validate)
- compileSchema.call(this, schOrRef);
- if (id === (0, resolve_1.normalizeId)(ref)) {
- const { schema: schema2 } = schOrRef;
- const { schemaId } = this.opts;
- const schId = schema2[schemaId];
- if (schId)
- baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
- return new SchemaEnv({ schema: schema2, schemaId, root, baseId });
- }
- return getJsonPointer.call(this, p, schOrRef);
- }
- exports.resolveSchema = resolveSchema;
- var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
- "properties",
- "patternProperties",
- "enum",
- "dependencies",
- "definitions"
- ]);
- function getJsonPointer(parsedRef, { baseId, schema: schema2, root }) {
- var _a;
- if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
- return;
- for (const part of parsedRef.fragment.slice(1).split("/")) {
- if (typeof schema2 === "boolean")
- return;
- const partSchema = schema2[(0, util_1.unescapeFragment)(part)];
- if (partSchema === void 0)
- return;
- schema2 = partSchema;
- const schId = typeof schema2 === "object" && schema2[this.opts.schemaId];
- if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
- baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
- }
- }
- let env2;
- if (typeof schema2 != "boolean" && schema2.$ref && !(0, util_1.schemaHasRulesButRef)(schema2, this.RULES)) {
- const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema2.$ref);
- env2 = resolveSchema.call(this, root, $ref);
- }
- const { schemaId } = this.opts;
- env2 = env2 || new SchemaEnv({ schema: schema2, schemaId, root, baseId });
- if (env2.schema !== env2.root.schema)
- return env2;
- return void 0;
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json
-var require_data = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json"(exports, module) {
- module.exports = {
- $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
- description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
- type: "object",
- required: ["$data"],
- properties: {
- $data: {
- type: "string",
- anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }]
- }
- },
- additionalProperties: false
- };
- }
-});
-
-// ../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js
-var require_utils = __commonJS({
- "../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js"(exports, module) {
- "use strict";
- var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
- var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
- function stringArrayToHexStripped(input) {
- let acc = "";
- let code = 0;
- let i = 0;
- for (i = 0; i < input.length; i++) {
- code = input[i].charCodeAt(0);
- if (code === 48) {
- continue;
- }
- if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
- return "";
- }
- acc += input[i];
- break;
- }
- for (i += 1; i < input.length; i++) {
- code = input[i].charCodeAt(0);
- if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
- return "";
- }
- acc += input[i];
- }
- return acc;
- }
- var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
- function consumeIsZone(buffer) {
- buffer.length = 0;
- return true;
- }
- function consumeHextets(buffer, address, output) {
- if (buffer.length) {
- const hex2 = stringArrayToHexStripped(buffer);
- if (hex2 !== "") {
- address.push(hex2);
- } else {
- output.error = true;
- return false;
- }
- buffer.length = 0;
- }
- return true;
- }
- function getIPV6(input) {
- let tokenCount = 0;
- const output = { error: false, address: "", zone: "" };
- const address = [];
- const buffer = [];
- let endipv6Encountered = false;
- let endIpv6 = false;
- let consume = consumeHextets;
- for (let i = 0; i < input.length; i++) {
- const cursor = input[i];
- if (cursor === "[" || cursor === "]") {
- continue;
- }
- if (cursor === ":") {
- if (endipv6Encountered === true) {
- endIpv6 = true;
- }
- if (!consume(buffer, address, output)) {
- break;
- }
- if (++tokenCount > 7) {
- output.error = true;
- break;
- }
- if (i > 0 && input[i - 1] === ":") {
- endipv6Encountered = true;
- }
- address.push(":");
- continue;
- } else if (cursor === "%") {
- if (!consume(buffer, address, output)) {
- break;
- }
- consume = consumeIsZone;
- } else {
- buffer.push(cursor);
- continue;
- }
- }
- if (buffer.length) {
- if (consume === consumeIsZone) {
- output.zone = buffer.join("");
- } else if (endIpv6) {
- address.push(buffer.join(""));
- } else {
- address.push(stringArrayToHexStripped(buffer));
- }
- }
- output.address = address.join("");
- return output;
- }
- function normalizeIPv6(host) {
- if (findToken(host, ":") < 2) {
- return { host, isIPV6: false };
- }
- const ipv62 = getIPV6(host);
- if (!ipv62.error) {
- let newHost = ipv62.address;
- let escapedHost = ipv62.address;
- if (ipv62.zone) {
- newHost += "%" + ipv62.zone;
- escapedHost += "%25" + ipv62.zone;
- }
- return { host: newHost, isIPV6: true, escapedHost };
- } else {
- return { host, isIPV6: false };
- }
- }
- function findToken(str, token) {
- let ind = 0;
- for (let i = 0; i < str.length; i++) {
- if (str[i] === token) ind++;
- }
- return ind;
- }
- function removeDotSegments(path) {
- let input = path;
- const output = [];
- let nextSlash = -1;
- let len = 0;
- while (len = input.length) {
- if (len === 1) {
- if (input === ".") {
- break;
- } else if (input === "/") {
- output.push("/");
- break;
- } else {
- output.push(input);
- break;
- }
- } else if (len === 2) {
- if (input[0] === ".") {
- if (input[1] === ".") {
- break;
- } else if (input[1] === "/") {
- input = input.slice(2);
- continue;
- }
- } else if (input[0] === "/") {
- if (input[1] === "." || input[1] === "/") {
- output.push("/");
- break;
- }
- }
- } else if (len === 3) {
- if (input === "/..") {
- if (output.length !== 0) {
- output.pop();
- }
- output.push("/");
- break;
- }
- }
- if (input[0] === ".") {
- if (input[1] === ".") {
- if (input[2] === "/") {
- input = input.slice(3);
- continue;
- }
- } else if (input[1] === "/") {
- input = input.slice(2);
- continue;
- }
- } else if (input[0] === "/") {
- if (input[1] === ".") {
- if (input[2] === "/") {
- input = input.slice(2);
- continue;
- } else if (input[2] === ".") {
- if (input[3] === "/") {
- input = input.slice(3);
- if (output.length !== 0) {
- output.pop();
- }
- continue;
- }
- }
- }
- }
- if ((nextSlash = input.indexOf("/", 1)) === -1) {
- output.push(input);
- break;
- } else {
- output.push(input.slice(0, nextSlash));
- input = input.slice(nextSlash);
- }
- }
- return output.join("");
- }
- function normalizeComponentEncoding(component, esc2) {
- const func = esc2 !== true ? escape : unescape;
- if (component.scheme !== void 0) {
- component.scheme = func(component.scheme);
- }
- if (component.userinfo !== void 0) {
- component.userinfo = func(component.userinfo);
- }
- if (component.host !== void 0) {
- component.host = func(component.host);
- }
- if (component.path !== void 0) {
- component.path = func(component.path);
- }
- if (component.query !== void 0) {
- component.query = func(component.query);
- }
- if (component.fragment !== void 0) {
- component.fragment = func(component.fragment);
- }
- return component;
- }
- function recomposeAuthority(component) {
- const uriTokens = [];
- if (component.userinfo !== void 0) {
- uriTokens.push(component.userinfo);
- uriTokens.push("@");
- }
- if (component.host !== void 0) {
- let host = unescape(component.host);
- if (!isIPv4(host)) {
- const ipV6res = normalizeIPv6(host);
- if (ipV6res.isIPV6 === true) {
- host = `[${ipV6res.escapedHost}]`;
- } else {
- host = component.host;
- }
- }
- uriTokens.push(host);
- }
- if (typeof component.port === "number" || typeof component.port === "string") {
- uriTokens.push(":");
- uriTokens.push(String(component.port));
- }
- return uriTokens.length ? uriTokens.join("") : void 0;
- }
- module.exports = {
- nonSimpleDomain,
- recomposeAuthority,
- normalizeComponentEncoding,
- removeDotSegments,
- isIPv4,
- isUUID,
- normalizeIPv6,
- stringArrayToHexStripped
- };
- }
-});
-
-// ../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js
-var require_schemes = __commonJS({
- "../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js"(exports, module) {
- "use strict";
- var { isUUID } = require_utils();
- var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
- var supportedSchemeNames = (
- /** @type {const} */
- [
- "http",
- "https",
- "ws",
- "wss",
- "urn",
- "urn:uuid"
- ]
- );
- function isValidSchemeName(name) {
- return supportedSchemeNames.indexOf(
- /** @type {*} */
- name
- ) !== -1;
- }
- function wsIsSecure(wsComponent) {
- if (wsComponent.secure === true) {
- return true;
- } else if (wsComponent.secure === false) {
- return false;
- } else if (wsComponent.scheme) {
- return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S");
- } else {
- return false;
- }
- }
- function httpParse(component) {
- if (!component.host) {
- component.error = component.error || "HTTP URIs must have a host.";
- }
- return component;
- }
- function httpSerialize(component) {
- const secure = String(component.scheme).toLowerCase() === "https";
- if (component.port === (secure ? 443 : 80) || component.port === "") {
- component.port = void 0;
- }
- if (!component.path) {
- component.path = "/";
- }
- return component;
- }
- function wsParse(wsComponent) {
- wsComponent.secure = wsIsSecure(wsComponent);
- wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : "");
- wsComponent.path = void 0;
- wsComponent.query = void 0;
- return wsComponent;
- }
- function wsSerialize(wsComponent) {
- if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") {
- wsComponent.port = void 0;
- }
- if (typeof wsComponent.secure === "boolean") {
- wsComponent.scheme = wsComponent.secure ? "wss" : "ws";
- wsComponent.secure = void 0;
- }
- if (wsComponent.resourceName) {
- const [path, query] = wsComponent.resourceName.split("?");
- wsComponent.path = path && path !== "/" ? path : void 0;
- wsComponent.query = query;
- wsComponent.resourceName = void 0;
- }
- wsComponent.fragment = void 0;
- return wsComponent;
- }
- function urnParse(urnComponent, options) {
- if (!urnComponent.path) {
- urnComponent.error = "URN can not be parsed";
- return urnComponent;
- }
- const matches = urnComponent.path.match(URN_REG);
- if (matches) {
- const scheme = options.scheme || urnComponent.scheme || "urn";
- urnComponent.nid = matches[1].toLowerCase();
- urnComponent.nss = matches[2];
- const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`;
- const schemeHandler = getSchemeHandler(urnScheme);
- urnComponent.path = void 0;
- if (schemeHandler) {
- urnComponent = schemeHandler.parse(urnComponent, options);
- }
- } else {
- urnComponent.error = urnComponent.error || "URN can not be parsed.";
- }
- return urnComponent;
- }
- function urnSerialize(urnComponent, options) {
- if (urnComponent.nid === void 0) {
- throw new Error("URN without nid cannot be serialized");
- }
- const scheme = options.scheme || urnComponent.scheme || "urn";
- const nid = urnComponent.nid.toLowerCase();
- const urnScheme = `${scheme}:${options.nid || nid}`;
- const schemeHandler = getSchemeHandler(urnScheme);
- if (schemeHandler) {
- urnComponent = schemeHandler.serialize(urnComponent, options);
- }
- const uriComponent = urnComponent;
- const nss = urnComponent.nss;
- uriComponent.path = `${nid || options.nid}:${nss}`;
- options.skipEscape = true;
- return uriComponent;
- }
- function urnuuidParse(urnComponent, options) {
- const uuidComponent = urnComponent;
- uuidComponent.uuid = uuidComponent.nss;
- uuidComponent.nss = void 0;
- if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
- uuidComponent.error = uuidComponent.error || "UUID is not valid.";
- }
- return uuidComponent;
- }
- function urnuuidSerialize(uuidComponent) {
- const urnComponent = uuidComponent;
- urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
- return urnComponent;
- }
- var http2 = (
- /** @type {SchemeHandler} */
- {
- scheme: "http",
- domainHost: true,
- parse: httpParse,
- serialize: httpSerialize
- }
- );
- var https = (
- /** @type {SchemeHandler} */
- {
- scheme: "https",
- domainHost: http2.domainHost,
- parse: httpParse,
- serialize: httpSerialize
- }
- );
- var ws = (
- /** @type {SchemeHandler} */
- {
- scheme: "ws",
- domainHost: true,
- parse: wsParse,
- serialize: wsSerialize
- }
- );
- var wss = (
- /** @type {SchemeHandler} */
- {
- scheme: "wss",
- domainHost: ws.domainHost,
- parse: ws.parse,
- serialize: ws.serialize
- }
- );
- var urn = (
- /** @type {SchemeHandler} */
- {
- scheme: "urn",
- parse: urnParse,
- serialize: urnSerialize,
- skipNormalize: true
- }
- );
- var urnuuid = (
- /** @type {SchemeHandler} */
- {
- scheme: "urn:uuid",
- parse: urnuuidParse,
- serialize: urnuuidSerialize,
- skipNormalize: true
- }
- );
- var SCHEMES = (
- /** @type {Record} */
- {
- http: http2,
- https,
- ws,
- wss,
- urn,
- "urn:uuid": urnuuid
- }
- );
- Object.setPrototypeOf(SCHEMES, null);
- function getSchemeHandler(scheme) {
- return scheme && (SCHEMES[
- /** @type {SchemeName} */
- scheme
- ] || SCHEMES[
- /** @type {SchemeName} */
- scheme.toLowerCase()
- ]) || void 0;
- }
- module.exports = {
- wsIsSecure,
- SCHEMES,
- isValidSchemeName,
- getSchemeHandler
- };
- }
-});
-
-// ../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js
-var require_fast_uri = __commonJS({
- "../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js"(exports, module) {
- "use strict";
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
- var { SCHEMES, getSchemeHandler } = require_schemes();
- function normalize2(uri, options) {
- if (typeof uri === "string") {
- uri = /** @type {T} */
- serialize(parse4(uri, options), options);
- } else if (typeof uri === "object") {
- uri = /** @type {T} */
- parse4(serialize(uri, options), options);
- }
- return uri;
- }
- function resolve(baseURI, relativeURI, options) {
- const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
- const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
- schemelessOptions.skipEscape = true;
- return serialize(resolved, schemelessOptions);
- }
- function resolveComponent(base, relative, options, skipNormalization) {
- const target = {};
- if (!skipNormalization) {
- base = parse4(serialize(base, options), options);
- relative = parse4(serialize(relative, options), options);
- }
- options = options || {};
- if (!options.tolerant && relative.scheme) {
- target.scheme = relative.scheme;
- target.userinfo = relative.userinfo;
- target.host = relative.host;
- target.port = relative.port;
- target.path = removeDotSegments(relative.path || "");
- target.query = relative.query;
- } else {
- if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
- target.userinfo = relative.userinfo;
- target.host = relative.host;
- target.port = relative.port;
- target.path = removeDotSegments(relative.path || "");
- target.query = relative.query;
- } else {
- if (!relative.path) {
- target.path = base.path;
- if (relative.query !== void 0) {
- target.query = relative.query;
- } else {
- target.query = base.query;
- }
- } else {
- if (relative.path[0] === "/") {
- target.path = removeDotSegments(relative.path);
- } else {
- if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
- target.path = "/" + relative.path;
- } else if (!base.path) {
- target.path = relative.path;
- } else {
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
- }
- target.path = removeDotSegments(target.path);
- }
- target.query = relative.query;
- }
- target.userinfo = base.userinfo;
- target.host = base.host;
- target.port = base.port;
- }
- target.scheme = base.scheme;
- }
- target.fragment = relative.fragment;
- return target;
- }
- function equal(uriA, uriB, options) {
- if (typeof uriA === "string") {
- uriA = unescape(uriA);
- uriA = serialize(normalizeComponentEncoding(parse4(uriA, options), true), { ...options, skipEscape: true });
- } else if (typeof uriA === "object") {
- uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
- }
- if (typeof uriB === "string") {
- uriB = unescape(uriB);
- uriB = serialize(normalizeComponentEncoding(parse4(uriB, options), true), { ...options, skipEscape: true });
- } else if (typeof uriB === "object") {
- uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
- }
- return uriA.toLowerCase() === uriB.toLowerCase();
- }
- function serialize(cmpts, opts) {
- const component = {
- host: cmpts.host,
- scheme: cmpts.scheme,
- userinfo: cmpts.userinfo,
- port: cmpts.port,
- path: cmpts.path,
- query: cmpts.query,
- nid: cmpts.nid,
- nss: cmpts.nss,
- uuid: cmpts.uuid,
- fragment: cmpts.fragment,
- reference: cmpts.reference,
- resourceName: cmpts.resourceName,
- secure: cmpts.secure,
- error: ""
- };
- const options = Object.assign({}, opts);
- const uriTokens = [];
- const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
- if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
- if (component.path !== void 0) {
- if (!options.skipEscape) {
- component.path = escape(component.path);
- if (component.scheme !== void 0) {
- component.path = component.path.split("%3A").join(":");
- }
- } else {
- component.path = unescape(component.path);
- }
- }
- if (options.reference !== "suffix" && component.scheme) {
- uriTokens.push(component.scheme, ":");
- }
- const authority = recomposeAuthority(component);
- if (authority !== void 0) {
- if (options.reference !== "suffix") {
- uriTokens.push("//");
- }
- uriTokens.push(authority);
- if (component.path && component.path[0] !== "/") {
- uriTokens.push("/");
- }
- }
- if (component.path !== void 0) {
- let s = component.path;
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
- s = removeDotSegments(s);
- }
- if (authority === void 0 && s[0] === "/" && s[1] === "/") {
- s = "/%2F" + s.slice(2);
- }
- uriTokens.push(s);
- }
- if (component.query !== void 0) {
- uriTokens.push("?", component.query);
- }
- if (component.fragment !== void 0) {
- uriTokens.push("#", component.fragment);
- }
- return uriTokens.join("");
- }
- var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
- function parse4(uri, opts) {
- const options = Object.assign({}, opts);
- const parsed2 = {
- scheme: void 0,
- userinfo: void 0,
- host: "",
- port: void 0,
- path: "",
- query: void 0,
- fragment: void 0
- };
- let isIP = false;
- if (options.reference === "suffix") {
- if (options.scheme) {
- uri = options.scheme + ":" + uri;
- } else {
- uri = "//" + uri;
- }
- }
- const matches = uri.match(URI_PARSE);
- if (matches) {
- parsed2.scheme = matches[1];
- parsed2.userinfo = matches[3];
- parsed2.host = matches[4];
- parsed2.port = parseInt(matches[5], 10);
- parsed2.path = matches[6] || "";
- parsed2.query = matches[7];
- parsed2.fragment = matches[8];
- if (isNaN(parsed2.port)) {
- parsed2.port = matches[5];
- }
- if (parsed2.host) {
- const ipv4result = isIPv4(parsed2.host);
- if (ipv4result === false) {
- const ipv6result = normalizeIPv6(parsed2.host);
- parsed2.host = ipv6result.host.toLowerCase();
- isIP = ipv6result.isIPV6;
- } else {
- isIP = true;
- }
- }
- if (parsed2.scheme === void 0 && parsed2.userinfo === void 0 && parsed2.host === void 0 && parsed2.port === void 0 && parsed2.query === void 0 && !parsed2.path) {
- parsed2.reference = "same-document";
- } else if (parsed2.scheme === void 0) {
- parsed2.reference = "relative";
- } else if (parsed2.fragment === void 0) {
- parsed2.reference = "absolute";
- } else {
- parsed2.reference = "uri";
- }
- if (options.reference && options.reference !== "suffix" && options.reference !== parsed2.reference) {
- parsed2.error = parsed2.error || "URI is not a " + options.reference + " reference.";
- }
- const schemeHandler = getSchemeHandler(options.scheme || parsed2.scheme);
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
- if (parsed2.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed2.host)) {
- try {
- parsed2.host = URL.domainToASCII(parsed2.host.toLowerCase());
- } catch (e) {
- parsed2.error = parsed2.error || "Host's domain name can not be converted to ASCII: " + e;
- }
- }
- }
- if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
- if (uri.indexOf("%") !== -1) {
- if (parsed2.scheme !== void 0) {
- parsed2.scheme = unescape(parsed2.scheme);
- }
- if (parsed2.host !== void 0) {
- parsed2.host = unescape(parsed2.host);
- }
- }
- if (parsed2.path) {
- parsed2.path = escape(unescape(parsed2.path));
- }
- if (parsed2.fragment) {
- parsed2.fragment = encodeURI(decodeURIComponent(parsed2.fragment));
- }
- }
- if (schemeHandler && schemeHandler.parse) {
- schemeHandler.parse(parsed2, options);
- }
- } else {
- parsed2.error = parsed2.error || "URI can not be parsed.";
- }
- return parsed2;
- }
- var fastUri = {
- SCHEMES,
- normalize: normalize2,
- resolve,
- resolveComponent,
- equal,
- serialize,
- parse: parse4
- };
- module.exports = fastUri;
- module.exports.default = fastUri;
- module.exports.fastUri = fastUri;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js
-var require_uri = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var uri = require_fast_uri();
- uri.code = 'require("ajv/dist/runtime/uri").default';
- exports.default = uri;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js
-var require_core = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
- var validate_1 = require_validate();
- Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
- return validate_1.KeywordCxt;
- } });
- var codegen_1 = require_codegen();
- Object.defineProperty(exports, "_", { enumerable: true, get: function() {
- return codegen_1._;
- } });
- Object.defineProperty(exports, "str", { enumerable: true, get: function() {
- return codegen_1.str;
- } });
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
- return codegen_1.stringify;
- } });
- Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
- return codegen_1.nil;
- } });
- Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
- return codegen_1.Name;
- } });
- Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
- return codegen_1.CodeGen;
- } });
- var validation_error_1 = require_validation_error();
- var ref_error_1 = require_ref_error();
- var rules_1 = require_rules();
- var compile_1 = require_compile();
- var codegen_2 = require_codegen();
- var resolve_1 = require_resolve();
- var dataType_1 = require_dataType();
- var util_1 = require_util();
- var $dataRefSchema = require_data();
- var uri_1 = require_uri();
- var defaultRegExp = (str, flags) => new RegExp(str, flags);
- defaultRegExp.code = "new RegExp";
- var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
- var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
- "validate",
- "serialize",
- "parse",
- "wrapper",
- "root",
- "schema",
- "keyword",
- "pattern",
- "formats",
- "validate$data",
- "func",
- "obj",
- "Error"
- ]);
- var removedOptions = {
- errorDataPath: "",
- format: "`validateFormats: false` can be used instead.",
- nullable: '"nullable" keyword is supported by default.',
- jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
- extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
- missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
- processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
- sourceCode: "Use option `code: {source: true}`",
- strictDefaults: "It is default now, see option `strict`.",
- strictKeywords: "It is default now, see option `strict`.",
- uniqueItems: '"uniqueItems" keyword is always validated.',
- unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
- cache: "Map is used as cache, schema object as key.",
- serialize: "Map is used as cache, schema object as key.",
- ajvErrors: "It is default now."
- };
- var deprecatedOptions = {
- ignoreKeywordsWithRef: "",
- jsPropertySyntax: "",
- unicode: '"minLength"/"maxLength" account for unicode characters by default.'
- };
- var MAX_EXPRESSION = 200;
- function requiredOptions(o) {
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
- const s = o.strict;
- const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
- const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
- const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
- const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
- return {
- strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
- strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
- strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
- strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
- strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
- code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
- loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
- loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
- meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
- messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
- inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
- schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
- addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
- validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
- validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
- unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
- int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
- uriResolver
- };
- }
- var Ajv2 = class {
- constructor(opts = {}) {
- this.schemas = {};
- this.refs = {};
- this.formats = {};
- this._compilations = /* @__PURE__ */ new Set();
- this._loading = {};
- this._cache = /* @__PURE__ */ new Map();
- opts = this.opts = { ...opts, ...requiredOptions(opts) };
- const { es5, lines } = this.opts.code;
- this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
- this.logger = getLogger(opts.logger);
- const formatOpt = opts.validateFormats;
- opts.validateFormats = false;
- this.RULES = (0, rules_1.getRules)();
- checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
- checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
- this._metaOpts = getMetaSchemaOptions.call(this);
- if (opts.formats)
- addInitialFormats.call(this);
- this._addVocabularies();
- this._addDefaultMetaSchema();
- if (opts.keywords)
- addInitialKeywords.call(this, opts.keywords);
- if (typeof opts.meta == "object")
- this.addMetaSchema(opts.meta);
- addInitialSchemas.call(this);
- opts.validateFormats = formatOpt;
- }
- _addVocabularies() {
- this.addKeyword("$async");
- }
- _addDefaultMetaSchema() {
- const { $data, meta, schemaId } = this.opts;
- let _dataRefSchema = $dataRefSchema;
- if (schemaId === "id") {
- _dataRefSchema = { ...$dataRefSchema };
- _dataRefSchema.id = _dataRefSchema.$id;
- delete _dataRefSchema.$id;
- }
- if (meta && $data)
- this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
- }
- defaultMeta() {
- const { meta, schemaId } = this.opts;
- return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : void 0;
- }
- validate(schemaKeyRef, data) {
- let v;
- if (typeof schemaKeyRef == "string") {
- v = this.getSchema(schemaKeyRef);
- if (!v)
- throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
- } else {
- v = this.compile(schemaKeyRef);
- }
- const valid = v(data);
- if (!("$async" in v))
- this.errors = v.errors;
- return valid;
- }
- compile(schema2, _meta) {
- const sch = this._addSchema(schema2, _meta);
- return sch.validate || this._compileSchemaEnv(sch);
- }
- compileAsync(schema2, meta) {
- if (typeof this.opts.loadSchema != "function") {
- throw new Error("options.loadSchema should be a function");
- }
- const { loadSchema } = this.opts;
- return runCompileAsync.call(this, schema2, meta);
- async function runCompileAsync(_schema, _meta) {
- await loadMetaSchema.call(this, _schema.$schema);
- const sch = this._addSchema(_schema, _meta);
- return sch.validate || _compileAsync.call(this, sch);
- }
- async function loadMetaSchema($ref) {
- if ($ref && !this.getSchema($ref)) {
- await runCompileAsync.call(this, { $ref }, true);
- }
- }
- async function _compileAsync(sch) {
- try {
- return this._compileSchemaEnv(sch);
- } catch (e) {
- if (!(e instanceof ref_error_1.default))
- throw e;
- checkLoaded.call(this, e);
- await loadMissingSchema.call(this, e.missingSchema);
- return _compileAsync.call(this, sch);
- }
- }
- function checkLoaded({ missingSchema: ref, missingRef }) {
- if (this.refs[ref]) {
- throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
- }
- }
- async function loadMissingSchema(ref) {
- const _schema = await _loadSchema.call(this, ref);
- if (!this.refs[ref])
- await loadMetaSchema.call(this, _schema.$schema);
- if (!this.refs[ref])
- this.addSchema(_schema, ref, meta);
- }
- async function _loadSchema(ref) {
- const p = this._loading[ref];
- if (p)
- return p;
- try {
- return await (this._loading[ref] = loadSchema(ref));
- } finally {
- delete this._loading[ref];
- }
- }
- }
- // Adds schema to the instance
- addSchema(schema2, key, _meta, _validateSchema = this.opts.validateSchema) {
- if (Array.isArray(schema2)) {
- for (const sch of schema2)
- this.addSchema(sch, void 0, _meta, _validateSchema);
- return this;
- }
- let id;
- if (typeof schema2 === "object") {
- const { schemaId } = this.opts;
- id = schema2[schemaId];
- if (id !== void 0 && typeof id != "string") {
- throw new Error(`schema ${schemaId} must be string`);
- }
- }
- key = (0, resolve_1.normalizeId)(key || id);
- this._checkUnique(key);
- this.schemas[key] = this._addSchema(schema2, _meta, key, _validateSchema, true);
- return this;
- }
- // Add schema that will be used to validate other schemas
- // options in META_IGNORE_OPTIONS are alway set to false
- addMetaSchema(schema2, key, _validateSchema = this.opts.validateSchema) {
- this.addSchema(schema2, key, true, _validateSchema);
- return this;
- }
- // Validate schema against its meta-schema
- validateSchema(schema2, throwOrLogError) {
- if (typeof schema2 == "boolean")
- return true;
- let $schema;
- $schema = schema2.$schema;
- if ($schema !== void 0 && typeof $schema != "string") {
- throw new Error("$schema must be a string");
- }
- $schema = $schema || this.opts.defaultMeta || this.defaultMeta();
- if (!$schema) {
- this.logger.warn("meta-schema not available");
- this.errors = null;
- return true;
- }
- const valid = this.validate($schema, schema2);
- if (!valid && throwOrLogError) {
- const message = "schema is invalid: " + this.errorsText();
- if (this.opts.validateSchema === "log")
- this.logger.error(message);
- else
- throw new Error(message);
- }
- return valid;
- }
- // Get compiled schema by `key` or `ref`.
- // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
- getSchema(keyRef) {
- let sch;
- while (typeof (sch = getSchEnv.call(this, keyRef)) == "string")
- keyRef = sch;
- if (sch === void 0) {
- const { schemaId } = this.opts;
- const root = new compile_1.SchemaEnv({ schema: {}, schemaId });
- sch = compile_1.resolveSchema.call(this, root, keyRef);
- if (!sch)
- return;
- this.refs[keyRef] = sch;
- }
- return sch.validate || this._compileSchemaEnv(sch);
- }
- // Remove cached schema(s).
- // If no parameter is passed all schemas but meta-schemas are removed.
- // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
- // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
- removeSchema(schemaKeyRef) {
- if (schemaKeyRef instanceof RegExp) {
- this._removeAllSchemas(this.schemas, schemaKeyRef);
- this._removeAllSchemas(this.refs, schemaKeyRef);
- return this;
- }
- switch (typeof schemaKeyRef) {
- case "undefined":
- this._removeAllSchemas(this.schemas);
- this._removeAllSchemas(this.refs);
- this._cache.clear();
- return this;
- case "string": {
- const sch = getSchEnv.call(this, schemaKeyRef);
- if (typeof sch == "object")
- this._cache.delete(sch.schema);
- delete this.schemas[schemaKeyRef];
- delete this.refs[schemaKeyRef];
- return this;
- }
- case "object": {
- const cacheKey = schemaKeyRef;
- this._cache.delete(cacheKey);
- let id = schemaKeyRef[this.opts.schemaId];
- if (id) {
- id = (0, resolve_1.normalizeId)(id);
- delete this.schemas[id];
- delete this.refs[id];
- }
- return this;
- }
- default:
- throw new Error("ajv.removeSchema: invalid parameter");
- }
- }
- // add "vocabulary" - a collection of keywords
- addVocabulary(definitions) {
- for (const def of definitions)
- this.addKeyword(def);
- return this;
- }
- addKeyword(kwdOrDef, def) {
- let keyword;
- if (typeof kwdOrDef == "string") {
- keyword = kwdOrDef;
- if (typeof def == "object") {
- this.logger.warn("these parameters are deprecated, see docs for addKeyword");
- def.keyword = keyword;
- }
- } else if (typeof kwdOrDef == "object" && def === void 0) {
- def = kwdOrDef;
- keyword = def.keyword;
- if (Array.isArray(keyword) && !keyword.length) {
- throw new Error("addKeywords: keyword must be string or non-empty array");
- }
- } else {
- throw new Error("invalid addKeywords parameters");
- }
- checkKeyword.call(this, keyword, def);
- if (!def) {
- (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));
- return this;
- }
- keywordMetaschema.call(this, def);
- const definition = {
- ...def,
- type: (0, dataType_1.getJSONTypes)(def.type),
- schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
};
- (0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
- return this;
- }
- getKeyword(keyword) {
- const rule = this.RULES.all[keyword];
- return typeof rule == "object" ? rule.definition : !!rule;
- }
- // Remove keyword
- removeKeyword(keyword) {
- const { RULES } = this;
- delete RULES.keywords[keyword];
- delete RULES.all[keyword];
- for (const group of RULES.rules) {
- const i = group.rules.findIndex((rule) => rule.keyword === keyword);
- if (i >= 0)
- group.rules.splice(i, 1);
+ })(opts.cmp);
+ var seen = [];
+ return (function stringify(node2) {
+ if (node2 && node2.toJSON && typeof node2.toJSON === "function") {
+ node2 = node2.toJSON();
}
- return this;
- }
- // Add format
- addFormat(name, format2) {
- if (typeof format2 == "string")
- format2 = new RegExp(format2);
- this.formats[name] = format2;
- return this;
- }
- errorsText(errors = this.errors, { separator: separator2 = ", ", dataVar = "data" } = {}) {
- if (!errors || errors.length === 0)
- return "No errors";
- return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator2 + msg);
- }
- $dataMetaSchema(metaSchema, keywordsJsonPointers) {
- const rules = this.RULES.all;
- metaSchema = JSON.parse(JSON.stringify(metaSchema));
- for (const jsonPointer of keywordsJsonPointers) {
- const segments = jsonPointer.split("/").slice(1);
- let keywords2 = metaSchema;
- for (const seg of segments)
- keywords2 = keywords2[seg];
- for (const key in rules) {
- const rule = rules[key];
- if (typeof rule != "object")
- continue;
- const { $data } = rule.definition;
- const schema2 = keywords2[key];
- if ($data && schema2)
- keywords2[key] = schemaOrData(schema2);
+ if (node2 === void 0) return;
+ if (typeof node2 == "number") return isFinite(node2) ? "" + node2 : "null";
+ if (typeof node2 !== "object") return JSON.stringify(node2);
+ var i, out;
+ if (Array.isArray(node2)) {
+ out = "[";
+ for (i = 0; i < node2.length; i++) {
+ if (i) out += ",";
+ out += stringify(node2[i]) || "null";
}
+ return out + "]";
}
- return metaSchema;
- }
- _removeAllSchemas(schemas, regex3) {
- for (const keyRef in schemas) {
- const sch = schemas[keyRef];
- if (!regex3 || regex3.test(keyRef)) {
- if (typeof sch == "string") {
- delete schemas[keyRef];
- } else if (sch && !sch.meta) {
- this._cache.delete(sch.schema);
- delete schemas[keyRef];
- }
- }
+ if (node2 === null) return "null";
+ if (seen.indexOf(node2) !== -1) {
+ if (cycles) return JSON.stringify("__cycle__");
+ throw new TypeError("Converting circular structure to JSON");
}
- }
- _addSchema(schema2, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
- let id;
- const { schemaId } = this.opts;
- if (typeof schema2 == "object") {
- id = schema2[schemaId];
- } else {
- if (this.opts.jtd)
- throw new Error("schema must be object");
- else if (typeof schema2 != "boolean")
- throw new Error("schema must be object or boolean");
+ var seenIndex = seen.push(node2) - 1;
+ var keys = Object.keys(node2).sort(cmp && cmp(node2));
+ out = "";
+ for (i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ var value2 = stringify(node2[key]);
+ if (!value2) continue;
+ if (out) out += ",";
+ out += JSON.stringify(key) + ":" + value2;
}
- let sch = this._cache.get(schema2);
- if (sch !== void 0)
- return sch;
- baseId = (0, resolve_1.normalizeId)(id || baseId);
- const localRefs = resolve_1.getSchemaRefs.call(this, schema2, baseId);
- sch = new compile_1.SchemaEnv({ schema: schema2, schemaId, meta, baseId, localRefs });
- this._cache.set(sch.schema, sch);
- if (addSchema && !baseId.startsWith("#")) {
- if (baseId)
- this._checkUnique(baseId);
- this.refs[baseId] = sch;
- }
- if (validateSchema)
- this.validateSchema(schema2, true);
- return sch;
- }
- _checkUnique(id) {
- if (this.schemas[id] || this.refs[id]) {
- throw new Error(`schema with key or id "${id}" already exists`);
- }
- }
- _compileSchemaEnv(sch) {
- if (sch.meta)
- this._compileMetaSchema(sch);
- else
- compile_1.compileSchema.call(this, sch);
- if (!sch.validate)
- throw new Error("ajv implementation error");
- return sch.validate;
- }
- _compileMetaSchema(sch) {
- const currentOpts = this.opts;
- this.opts = this._metaOpts;
- try {
- compile_1.compileSchema.call(this, sch);
- } finally {
- this.opts = currentOpts;
- }
- }
+ seen.splice(seenIndex, 1);
+ return "{" + out + "}";
+ })(data);
};
- Ajv2.ValidationError = validation_error_1.default;
- Ajv2.MissingRefError = ref_error_1.default;
- exports.default = Ajv2;
- function checkOptions(checkOpts, options, msg, log2 = "error") {
- for (const key in checkOpts) {
- const opt = key;
- if (opt in options)
- this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`);
- }
- }
- function getSchEnv(keyRef) {
- keyRef = (0, resolve_1.normalizeId)(keyRef);
- return this.schemas[keyRef] || this.refs[keyRef];
- }
- function addInitialSchemas() {
- const optsSchemas = this.opts.schemas;
- if (!optsSchemas)
- return;
- if (Array.isArray(optsSchemas))
- this.addSchema(optsSchemas);
- else
- for (const key in optsSchemas)
- this.addSchema(optsSchemas[key], key);
- }
- function addInitialFormats() {
- for (const name in this.opts.formats) {
- const format2 = this.opts.formats[name];
- if (format2)
- this.addFormat(name, format2);
- }
- }
- function addInitialKeywords(defs) {
- if (Array.isArray(defs)) {
- this.addVocabulary(defs);
- return;
- }
- this.logger.warn("keywords option as map is deprecated, pass array");
- for (const keyword in defs) {
- const def = defs[keyword];
- if (!def.keyword)
- def.keyword = keyword;
- this.addKeyword(def);
- }
- }
- function getMetaSchemaOptions() {
- const metaOpts = { ...this.opts };
- for (const opt of META_IGNORE_OPTIONS)
- delete metaOpts[opt];
- return metaOpts;
- }
- var noLogs = { log() {
- }, warn() {
- }, error() {
- } };
- function getLogger(logger) {
- if (logger === false)
- return noLogs;
- if (logger === void 0)
- return console;
- if (logger.log && logger.warn && logger.error)
- return logger;
- throw new Error("logger must implement log, warn and error methods");
- }
- var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
- function checkKeyword(keyword, def) {
- const { RULES } = this;
- (0, util_1.eachItem)(keyword, (kwd) => {
- if (RULES.keywords[kwd])
- throw new Error(`Keyword ${kwd} is already defined`);
- if (!KEYWORD_NAME.test(kwd))
- throw new Error(`Keyword ${kwd} has invalid name`);
- });
- if (!def)
- return;
- if (def.$data && !("code" in def || "validate" in def)) {
- throw new Error('$data keyword must have "code" or "validate" function');
- }
- }
- function addRule(keyword, definition, dataType) {
- var _a;
- const post = definition === null || definition === void 0 ? void 0 : definition.post;
- if (dataType && post)
- throw new Error('keyword with "post" flag cannot have "type"');
- const { RULES } = this;
- let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
- if (!ruleGroup) {
- ruleGroup = { type: dataType, rules: [] };
- RULES.rules.push(ruleGroup);
- }
- RULES.keywords[keyword] = true;
- if (!definition)
- return;
- const rule = {
- keyword,
- definition: {
- ...definition,
- type: (0, dataType_1.getJSONTypes)(definition.type),
- schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType)
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/validate.js
+var require_validate = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/validate.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_validate(it, $keyword, $ruleType) {
+ var out = "";
+ var $async = it.schema.$async === true, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, "$ref"), $id = it.self._getId(it.schema);
+ if (it.opts.strictKeywords) {
+ var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);
+ if ($unknownKwd) {
+ var $keywordsMsg = "unknown keyword: " + $unknownKwd;
+ if (it.opts.strictKeywords === "log") it.logger.warn($keywordsMsg);
+ else throw new Error($keywordsMsg);
}
- };
- if (definition.before)
- addBeforeRule.call(this, ruleGroup, rule, definition.before);
- else
- ruleGroup.rules.push(rule);
- RULES.all[keyword] = rule;
- (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
- }
- function addBeforeRule(ruleGroup, rule, before) {
- const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
- if (i >= 0) {
- ruleGroup.rules.splice(i, 0, rule);
+ }
+ if (it.isTop) {
+ out += " var validate = ";
+ if ($async) {
+ it.async = true;
+ out += "async ";
+ }
+ out += "function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ";
+ if ($id && (it.opts.sourceCode || it.opts.processCode)) {
+ out += " " + ("/*# sourceURL=" + $id + " */") + " ";
+ }
+ }
+ if (typeof it.schema == "boolean" || !($refKeywords || it.schema.$ref)) {
+ var $keyword = "false schema";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $errorKeyword;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ if (it.schema === false) {
+ if (it.isTop) {
+ $breakOnError = true;
+ } else {
+ out += " var " + $valid + " = false; ";
+ }
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "false schema") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'boolean schema is false' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: false , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ } else {
+ if (it.isTop) {
+ if ($async) {
+ out += " return data; ";
+ } else {
+ out += " validate.errors = null; return true; ";
+ }
+ } else {
+ out += " var " + $valid + " = true; ";
+ }
+ }
+ if (it.isTop) {
+ out += " }; return validate; ";
+ }
+ return out;
+ }
+ if (it.isTop) {
+ var $top = it.isTop, $lvl = it.level = 0, $dataLvl = it.dataLevel = 0, $data = "data";
+ it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
+ it.baseId = it.baseId || it.rootId;
+ delete it.isTop;
+ it.dataPathArr = [""];
+ if (it.schema.default !== void 0 && it.opts.useDefaults && it.opts.strictDefaults) {
+ var $defaultMsg = "default is ignored in the schema root";
+ if (it.opts.strictDefaults === "log") it.logger.warn($defaultMsg);
+ else throw new Error($defaultMsg);
+ }
+ out += " var vErrors = null; ";
+ out += " var errors = 0; ";
+ out += " if (rootData === undefined) rootData = data; ";
} else {
- ruleGroup.rules.push(rule);
- this.logger.warn(`rule ${before} is not defined`);
+ var $lvl = it.level, $dataLvl = it.dataLevel, $data = "data" + ($dataLvl || "");
+ if ($id) it.baseId = it.resolve.url(it.baseId, $id);
+ if ($async && !it.async) throw new Error("async schema in sync schema");
+ out += " var errs_" + $lvl + " = errors;";
}
- }
- function keywordMetaschema(def) {
- let { metaSchema } = def;
- if (metaSchema === void 0)
- return;
- if (def.$data && this.opts.$data)
- metaSchema = schemaOrData(metaSchema);
- def.validateSchema = this.compile(metaSchema, true);
- }
- var $dataRef = {
- $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
- };
- function schemaOrData(schema2) {
- return { anyOf: [schema2, $dataRef] };
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js
-var require_id = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var def = {
- keyword: "id",
- code() {
- throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js
-var require_ref = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.callRef = exports.getValidate = void 0;
- var ref_error_1 = require_ref_error();
- var code_1 = require_code2();
- var codegen_1 = require_codegen();
- var names_1 = require_names();
- var compile_1 = require_compile();
- var util_1 = require_util();
- var def = {
- keyword: "$ref",
- schemaType: "string",
- code(cxt) {
- const { gen, schema: $ref, it } = cxt;
- const { baseId, schemaEnv: env2, validateName, opts, self } = it;
- const { root } = env2;
- if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
- return callRootRef();
- const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
- if (schOrEnv === void 0)
- throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
- if (schOrEnv instanceof compile_1.SchemaEnv)
- return callValidate(schOrEnv);
- return inlineRefSchema(schOrEnv);
- function callRootRef() {
- if (env2 === root)
- return callRef(cxt, validateName, env2, env2.$async);
- const rootName = gen.scopeValue("root", { ref: root });
- return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
- }
- function callValidate(sch) {
- const v = getValidate(cxt, sch);
- callRef(cxt, v, sch, sch.$async);
- }
- function inlineRefSchema(sch) {
- const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
- const valid = gen.name("valid");
- const schCxt = cxt.subschema({
- schema: sch,
- dataTypes: [],
- schemaPath: codegen_1.nil,
- topSchemaRef: schName,
- errSchemaPath: $ref
- }, valid);
- cxt.mergeEvaluated(schCxt);
- cxt.ok(valid);
+ var $valid = "valid" + $lvl, $breakOnError = !it.opts.allErrors, $closingBraces1 = "", $closingBraces2 = "";
+ var $errorKeyword;
+ var $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema);
+ if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {
+ if ($typeIsArray) {
+ if ($typeSchema.indexOf("null") == -1) $typeSchema = $typeSchema.concat("null");
+ } else if ($typeSchema != "null") {
+ $typeSchema = [$typeSchema, "null"];
+ $typeIsArray = true;
}
}
- };
- function getValidate(cxt, sch) {
- const { gen } = cxt;
- return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
- }
- exports.getValidate = getValidate;
- function callRef(cxt, v, sch, $async) {
- const { gen, it } = cxt;
- const { allErrors, schemaEnv: env2, opts } = it;
- const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
- if ($async)
- callAsyncRef();
- else
- callSyncRef();
- function callAsyncRef() {
- if (!env2.$async)
- throw new Error("async schema referenced by sync schema");
- const valid = gen.let("valid");
- gen.try(() => {
- gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
- addEvaluatedFrom(v);
- if (!allErrors)
- gen.assign(valid, true);
- }, (e) => {
- gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
- addErrorsFrom(e);
- if (!allErrors)
- gen.assign(valid, false);
- });
- cxt.ok(valid);
+ if ($typeIsArray && $typeSchema.length == 1) {
+ $typeSchema = $typeSchema[0];
+ $typeIsArray = false;
}
- function callSyncRef() {
- cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
+ if (it.schema.$ref && $refKeywords) {
+ if (it.opts.extendRefs == "fail") {
+ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)');
+ } else if (it.opts.extendRefs !== true) {
+ $refKeywords = false;
+ it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
+ }
}
- function addErrorsFrom(source) {
- const errs = (0, codegen_1._)`${source}.errors`;
- gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
- gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
+ if (it.schema.$comment && it.opts.$comment) {
+ out += " " + it.RULES.all.$comment.code(it, "$comment");
}
- function addEvaluatedFrom(source) {
- var _a;
- if (!it.opts.unevaluated)
- return;
- const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
- if (it.props !== true) {
- if (schEvaluated && !schEvaluated.dynamicProps) {
- if (schEvaluated.props !== void 0) {
- it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
+ if ($typeSchema) {
+ if (it.opts.coerceTypes) {
+ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);
+ }
+ var $rulesGroup = it.RULES.types[$typeSchema];
+ if ($coerceToTypes || $typeIsArray || $rulesGroup === true || $rulesGroup && !$shouldUseGroup($rulesGroup)) {
+ var $schemaPath = it.schemaPath + ".type", $errSchemaPath = it.errSchemaPath + "/type";
+ var $schemaPath = it.schemaPath + ".type", $errSchemaPath = it.errSchemaPath + "/type", $method = $typeIsArray ? "checkDataTypes" : "checkDataType";
+ out += " if (" + it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true) + ") { ";
+ if ($coerceToTypes) {
+ var $dataType = "dataType" + $lvl, $coerced = "coerced" + $lvl;
+ out += " var " + $dataType + " = typeof " + $data + "; var " + $coerced + " = undefined; ";
+ if (it.opts.coerceTypes == "array") {
+ out += " if (" + $dataType + " == 'object' && Array.isArray(" + $data + ") && " + $data + ".length == 1) { " + $data + " = " + $data + "[0]; " + $dataType + " = typeof " + $data + "; if (" + it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers) + ") " + $coerced + " = " + $data + "; } ";
}
- } else {
- const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`);
- it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
- }
- }
- if (it.items !== true) {
- if (schEvaluated && !schEvaluated.dynamicItems) {
- if (schEvaluated.items !== void 0) {
- it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
+ out += " if (" + $coerced + " !== undefined) ; ";
+ var arr1 = $coerceToTypes;
+ if (arr1) {
+ var $type, $i = -1, l1 = arr1.length - 1;
+ while ($i < l1) {
+ $type = arr1[$i += 1];
+ if ($type == "string") {
+ out += " else if (" + $dataType + " == 'number' || " + $dataType + " == 'boolean') " + $coerced + " = '' + " + $data + "; else if (" + $data + " === null) " + $coerced + " = ''; ";
+ } else if ($type == "number" || $type == "integer") {
+ out += " else if (" + $dataType + " == 'boolean' || " + $data + " === null || (" + $dataType + " == 'string' && " + $data + " && " + $data + " == +" + $data + " ";
+ if ($type == "integer") {
+ out += " && !(" + $data + " % 1)";
+ }
+ out += ")) " + $coerced + " = +" + $data + "; ";
+ } else if ($type == "boolean") {
+ out += " else if (" + $data + " === 'false' || " + $data + " === 0 || " + $data + " === null) " + $coerced + " = false; else if (" + $data + " === 'true' || " + $data + " === 1) " + $coerced + " = true; ";
+ } else if ($type == "null") {
+ out += " else if (" + $data + " === '' || " + $data + " === 0 || " + $data + " === false) " + $coerced + " = null; ";
+ } else if (it.opts.coerceTypes == "array" && $type == "array") {
+ out += " else if (" + $dataType + " == 'string' || " + $dataType + " == 'number' || " + $dataType + " == 'boolean' || " + $data + " == null) " + $coerced + " = [" + $data + "]; ";
+ }
+ }
}
+ out += " else { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { type: '";
+ if ($typeIsArray) {
+ out += "" + $typeSchema.join(",");
+ } else {
+ out += "" + $typeSchema;
+ }
+ out += "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should be ";
+ if ($typeIsArray) {
+ out += "" + $typeSchema.join(",");
+ } else {
+ out += "" + $typeSchema;
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } if (" + $coerced + " !== undefined) { ";
+ var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : "parentDataProperty";
+ out += " " + $data + " = " + $coerced + "; ";
+ if (!$dataLvl) {
+ out += "if (" + $parentData + " !== undefined)";
+ }
+ out += " " + $parentData + "[" + $parentDataProperty + "] = " + $coerced + "; } ";
} else {
- const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`);
- it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { type: '";
+ if ($typeIsArray) {
+ out += "" + $typeSchema.join(",");
+ } else {
+ out += "" + $typeSchema;
+ }
+ out += "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should be ";
+ if ($typeIsArray) {
+ out += "" + $typeSchema.join(",");
+ } else {
+ out += "" + $typeSchema;
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
}
+ out += " } ";
}
}
- }
- exports.callRef = callRef;
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js
-var require_core2 = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var id_1 = require_id();
- var ref_1 = require_ref();
- var core3 = [
- "$schema",
- "$id",
- "$defs",
- "$vocabulary",
- { keyword: "$comment" },
- "definitions",
- id_1.default,
- ref_1.default
- ];
- exports.default = core3;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
-var require_limitNumber = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var ops = codegen_1.operators;
- var KWDs = {
- maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
- minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
- exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
- exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
- };
- var error41 = {
- message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
- params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
- };
- var def = {
- keyword: Object.keys(KWDs),
- type: "number",
- schemaType: "number",
- $data: true,
- error: error41,
- code(cxt) {
- const { keyword, data, schemaCode } = cxt;
- cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
-var require_multipleOf = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var error41 = {
- message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
- params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
- };
- var def = {
- keyword: "multipleOf",
- type: "number",
- schemaType: "number",
- $data: true,
- error: error41,
- code(cxt) {
- const { gen, data, schemaCode, it } = cxt;
- const prec = it.opts.multipleOfPrecision;
- const res = gen.let("res");
- const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
- cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/ucs2length.js
-var require_ucs2length = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- function ucs2length(str) {
- const len = str.length;
- let length = 0;
- let pos = 0;
- let value2;
- while (pos < len) {
- length++;
- value2 = str.charCodeAt(pos++);
- if (value2 >= 55296 && value2 <= 56319 && pos < len) {
- value2 = str.charCodeAt(pos);
- if ((value2 & 64512) === 56320)
- pos++;
+ if (it.schema.$ref && !$refKeywords) {
+ out += " " + it.RULES.all.$ref.code(it, "$ref") + " ";
+ if ($breakOnError) {
+ out += " } if (errors === ";
+ if ($top) {
+ out += "0";
+ } else {
+ out += "errs_" + $lvl;
+ }
+ out += ") { ";
+ $closingBraces2 += "}";
}
- }
- return length;
- }
- exports.default = ucs2length;
- ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js
-var require_limitLength = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var ucs2length_1 = require_ucs2length();
- var error41 = {
- message({ keyword, schemaCode }) {
- const comp = keyword === "maxLength" ? "more" : "fewer";
- return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
- },
- params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
- };
- var def = {
- keyword: ["maxLength", "minLength"],
- type: "string",
- schemaType: "number",
- $data: true,
- error: error41,
- code(cxt) {
- const { keyword, data, schemaCode, it } = cxt;
- const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
- const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;
- cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js
-var require_pattern = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var code_1 = require_code2();
- var codegen_1 = require_codegen();
- var error41 = {
- message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
- params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
- };
- var def = {
- keyword: "pattern",
- type: "string",
- schemaType: "string",
- $data: true,
- error: error41,
- code(cxt) {
- const { data, $data, schema: schema2, schemaCode, it } = cxt;
- const u = it.opts.unicodeRegExp ? "u" : "";
- const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema2);
- cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
-var require_limitProperties = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var error41 = {
- message({ keyword, schemaCode }) {
- const comp = keyword === "maxProperties" ? "more" : "fewer";
- return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
- },
- params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
- };
- var def = {
- keyword: ["maxProperties", "minProperties"],
- type: "object",
- schemaType: "number",
- $data: true,
- error: error41,
- code(cxt) {
- const { keyword, data, schemaCode } = cxt;
- const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
- cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js
-var require_required = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var code_1 = require_code2();
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var error41 = {
- message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
- params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
- };
- var def = {
- keyword: "required",
- type: "object",
- schemaType: "array",
- $data: true,
- error: error41,
- code(cxt) {
- const { gen, schema: schema2, schemaCode, data, $data, it } = cxt;
- const { opts } = it;
- if (!$data && schema2.length === 0)
- return;
- const useLoop = schema2.length >= opts.loopRequired;
- if (it.allErrors)
- allErrorsMode();
- else
- exitOnErrorMode();
- if (opts.strictRequired) {
- const props = cxt.parentSchema.properties;
- const { definedProperties } = cxt.it;
- for (const requiredKey of schema2) {
- if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {
- const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
- const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
- (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
+ } else {
+ var arr2 = it.RULES;
+ if (arr2) {
+ var $rulesGroup, i2 = -1, l2 = arr2.length - 1;
+ while (i2 < l2) {
+ $rulesGroup = arr2[i2 += 1];
+ if ($shouldUseGroup($rulesGroup)) {
+ if ($rulesGroup.type) {
+ out += " if (" + it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers) + ") { ";
+ }
+ if (it.opts.useDefaults) {
+ if ($rulesGroup.type == "object" && it.schema.properties) {
+ var $schema = it.schema.properties, $schemaKeys = Object.keys($schema);
+ var arr3 = $schemaKeys;
+ if (arr3) {
+ var $propertyKey, i3 = -1, l3 = arr3.length - 1;
+ while (i3 < l3) {
+ $propertyKey = arr3[i3 += 1];
+ var $sch = $schema[$propertyKey];
+ if ($sch.default !== void 0) {
+ var $passData = $data + it.util.getProperty($propertyKey);
+ if (it.compositeRule) {
+ if (it.opts.strictDefaults) {
+ var $defaultMsg = "default is ignored for: " + $passData;
+ if (it.opts.strictDefaults === "log") it.logger.warn($defaultMsg);
+ else throw new Error($defaultMsg);
+ }
+ } else {
+ out += " if (" + $passData + " === undefined ";
+ if (it.opts.useDefaults == "empty") {
+ out += " || " + $passData + " === null || " + $passData + " === '' ";
+ }
+ out += " ) " + $passData + " = ";
+ if (it.opts.useDefaults == "shared") {
+ out += " " + it.useDefault($sch.default) + " ";
+ } else {
+ out += " " + JSON.stringify($sch.default) + " ";
+ }
+ out += "; ";
+ }
+ }
+ }
+ }
+ } else if ($rulesGroup.type == "array" && Array.isArray(it.schema.items)) {
+ var arr4 = it.schema.items;
+ if (arr4) {
+ var $sch, $i = -1, l4 = arr4.length - 1;
+ while ($i < l4) {
+ $sch = arr4[$i += 1];
+ if ($sch.default !== void 0) {
+ var $passData = $data + "[" + $i + "]";
+ if (it.compositeRule) {
+ if (it.opts.strictDefaults) {
+ var $defaultMsg = "default is ignored for: " + $passData;
+ if (it.opts.strictDefaults === "log") it.logger.warn($defaultMsg);
+ else throw new Error($defaultMsg);
+ }
+ } else {
+ out += " if (" + $passData + " === undefined ";
+ if (it.opts.useDefaults == "empty") {
+ out += " || " + $passData + " === null || " + $passData + " === '' ";
+ }
+ out += " ) " + $passData + " = ";
+ if (it.opts.useDefaults == "shared") {
+ out += " " + it.useDefault($sch.default) + " ";
+ } else {
+ out += " " + JSON.stringify($sch.default) + " ";
+ }
+ out += "; ";
+ }
+ }
+ }
+ }
+ }
+ }
+ var arr5 = $rulesGroup.rules;
+ if (arr5) {
+ var $rule, i5 = -1, l5 = arr5.length - 1;
+ while (i5 < l5) {
+ $rule = arr5[i5 += 1];
+ if ($shouldUseRule($rule)) {
+ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);
+ if ($code) {
+ out += " " + $code + " ";
+ if ($breakOnError) {
+ $closingBraces1 += "}";
+ }
+ }
+ }
+ }
+ }
+ if ($breakOnError) {
+ out += " " + $closingBraces1 + " ";
+ $closingBraces1 = "";
+ }
+ if ($rulesGroup.type) {
+ out += " } ";
+ if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {
+ out += " else { ";
+ var $schemaPath = it.schemaPath + ".type", $errSchemaPath = it.errSchemaPath + "/type";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { type: '";
+ if ($typeIsArray) {
+ out += "" + $typeSchema.join(",");
+ } else {
+ out += "" + $typeSchema;
+ }
+ out += "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should be ";
+ if ($typeIsArray) {
+ out += "" + $typeSchema.join(",");
+ } else {
+ out += "" + $typeSchema;
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } ";
+ }
+ }
+ if ($breakOnError) {
+ out += " if (errors === ";
+ if ($top) {
+ out += "0";
+ } else {
+ out += "errs_" + $lvl;
+ }
+ out += ") { ";
+ $closingBraces2 += "}";
+ }
}
}
}
- function allErrorsMode() {
- if (useLoop || $data) {
- cxt.block$data(codegen_1.nil, loopAllRequired);
- } else {
- for (const prop of schema2) {
- (0, code_1.checkReportMissingProp)(cxt, prop);
- }
- }
- }
- function exitOnErrorMode() {
- const missing = gen.let("missing");
- if (useLoop || $data) {
- const valid = gen.let("valid", true);
- cxt.block$data(valid, () => loopUntilMissing(missing, valid));
- cxt.ok(valid);
- } else {
- gen.if((0, code_1.checkMissingProp)(cxt, schema2, missing));
- (0, code_1.reportMissingProp)(cxt, missing);
- gen.else();
- }
- }
- function loopAllRequired() {
- gen.forOf("prop", schemaCode, (prop) => {
- cxt.setParams({ missingProperty: prop });
- gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
- });
- }
- function loopUntilMissing(missing, valid) {
- cxt.setParams({ missingProperty: missing });
- gen.forOf(missing, schemaCode, () => {
- gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
- gen.if((0, codegen_1.not)(valid), () => {
- cxt.error();
- gen.break();
- });
- }, codegen_1.nil);
- }
}
+ if ($breakOnError) {
+ out += " " + $closingBraces2 + " ";
+ }
+ if ($top) {
+ if ($async) {
+ out += " if (errors === 0) return data; ";
+ out += " else throw new ValidationError(vErrors); ";
+ } else {
+ out += " validate.errors = vErrors; ";
+ out += " return errors === 0; ";
+ }
+ out += " }; return validate;";
+ } else {
+ out += " var " + $valid + " = errors === errs_" + $lvl + ";";
+ }
+ function $shouldUseGroup($rulesGroup2) {
+ var rules = $rulesGroup2.rules;
+ for (var i = 0; i < rules.length; i++)
+ if ($shouldUseRule(rules[i])) return true;
+ }
+ function $shouldUseRule($rule2) {
+ return it.schema[$rule2.keyword] !== void 0 || $rule2.implements && $ruleImplementsSomeKeyword($rule2);
+ }
+ function $ruleImplementsSomeKeyword($rule2) {
+ var impl = $rule2.implements;
+ for (var i = 0; i < impl.length; i++)
+ if (it.schema[impl[i]] !== void 0) return true;
+ }
+ return out;
};
- exports.default = def;
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js
-var require_limitItems = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) {
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js
+var require_compile = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var error41 = {
- message({ keyword, schemaCode }) {
- const comp = keyword === "maxItems" ? "more" : "fewer";
- return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
- },
- params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
- };
- var def = {
- keyword: ["maxItems", "minItems"],
- type: "array",
- schemaType: "number",
- $data: true,
- error: error41,
- code(cxt) {
- const { keyword, data, schemaCode } = cxt;
- const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
- cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js
-var require_equal = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
+ var resolve = require_resolve();
+ var util2 = require_util();
+ var errorClasses = require_error_classes();
+ var stableStringify = require_fast_json_stable_stringify();
+ var validateGenerator = require_validate();
+ var ucs2length = util2.ucs2length;
var equal = require_fast_deep_equal();
- equal.code = 'require("ajv/dist/runtime/equal").default';
- exports.default = equal;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
-var require_uniqueItems = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var dataType_1 = require_dataType();
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var equal_1 = require_equal();
- var error41 = {
- message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
- params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
- };
- var def = {
- keyword: "uniqueItems",
- type: "array",
- schemaType: "boolean",
- $data: true,
- error: error41,
- code(cxt) {
- const { gen, data, $data, schema: schema2, parentSchema, schemaCode, it } = cxt;
- if (!$data && !schema2)
- return;
- const valid = gen.let("valid");
- const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
- cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`);
- cxt.ok(valid);
- function validateUniqueItems() {
- const i = gen.let("i", (0, codegen_1._)`${data}.length`);
- const j = gen.let("j");
- cxt.setParams({ i, j });
- gen.assign(valid, true);
- gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
- }
- function canOptimize() {
- return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
- }
- function loopN(i, j) {
- const item = gen.name("item");
- const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
- const indices = gen.const("indices", (0, codegen_1._)`{}`);
- gen.for((0, codegen_1._)`;${i}--;`, () => {
- gen.let(item, (0, codegen_1._)`${data}[${i}]`);
- gen.if(wrongType, (0, codegen_1._)`continue`);
- if (itemTypes.length > 1)
- gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`);
- gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => {
- gen.assign(j, (0, codegen_1._)`${indices}[${item}]`);
- cxt.error();
- gen.assign(valid, false).break();
- }).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
- });
- }
- function loopN2(i, j) {
- const eql = (0, util_1.useFunc)(gen, equal_1.default);
- const outer = gen.name("outer");
- gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {
- cxt.error();
- gen.assign(valid, false).break(outer);
- })));
+ var ValidationError = errorClasses.Validation;
+ module.exports = compile;
+ function compile(schema2, root, localRefs, baseId) {
+ var self = this, opts = this._opts, refVal = [void 0], refs = {}, patterns = [], patternsHash = {}, defaults = [], defaultsHash = {}, customRules = [];
+ root = root || { schema: schema2, refVal, refs };
+ var c = checkCompiling.call(this, schema2, root, baseId);
+ var compilation = this._compilations[c.index];
+ if (c.compiling) return compilation.callValidate = callValidate;
+ var formats = this._formats;
+ var RULES = this.RULES;
+ try {
+ var v = localCompile(schema2, root, localRefs, baseId);
+ compilation.validate = v;
+ var cv = compilation.callValidate;
+ if (cv) {
+ cv.schema = v.schema;
+ cv.errors = null;
+ cv.refs = v.refs;
+ cv.refVal = v.refVal;
+ cv.root = v.root;
+ cv.$async = v.$async;
+ if (opts.sourceCode) cv.source = v.source;
}
+ return v;
+ } finally {
+ endCompiling.call(this, schema2, root, baseId);
}
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js
-var require_const = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var equal_1 = require_equal();
- var error41 = {
- message: "must be equal to constant",
- params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
- };
- var def = {
- keyword: "const",
- $data: true,
- error: error41,
- code(cxt) {
- const { gen, data, $data, schemaCode, schema: schema2 } = cxt;
- if ($data || schema2 && typeof schema2 == "object") {
- cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
- } else {
- cxt.fail((0, codegen_1._)`${schema2} !== ${data}`);
- }
+ function callValidate() {
+ var validate2 = compilation.validate;
+ var result = validate2.apply(this, arguments);
+ callValidate.errors = validate2.errors;
+ return result;
}
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js
-var require_enum = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var equal_1 = require_equal();
- var error41 = {
- message: "must be equal to one of the allowed values",
- params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
- };
- var def = {
- keyword: "enum",
- schemaType: "array",
- $data: true,
- error: error41,
- code(cxt) {
- const { gen, data, $data, schema: schema2, schemaCode, it } = cxt;
- if (!$data && schema2.length === 0)
- throw new Error("enum must have non-empty array");
- const useLoop = schema2.length >= it.opts.loopEnum;
- let eql;
- const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
- let valid;
- if (useLoop || $data) {
- valid = gen.let("valid");
- cxt.block$data(valid, loopEnum);
- } else {
- if (!Array.isArray(schema2))
- throw new Error("ajv implementation error");
- const vSchema = gen.const("vSchema", schemaCode);
- valid = (0, codegen_1.or)(...schema2.map((_x, i) => equalCode(vSchema, i)));
- }
- cxt.pass(valid);
- function loopEnum() {
- gen.assign(valid, false);
- gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
- }
- function equalCode(vSchema, i) {
- const sch = schema2[i];
- return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
- }
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js
-var require_validation = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var limitNumber_1 = require_limitNumber();
- var multipleOf_1 = require_multipleOf();
- var limitLength_1 = require_limitLength();
- var pattern_1 = require_pattern();
- var limitProperties_1 = require_limitProperties();
- var required_1 = require_required();
- var limitItems_1 = require_limitItems();
- var uniqueItems_1 = require_uniqueItems();
- var const_1 = require_const();
- var enum_1 = require_enum();
- var validation = [
- // number
- limitNumber_1.default,
- multipleOf_1.default,
- // string
- limitLength_1.default,
- pattern_1.default,
- // object
- limitProperties_1.default,
- required_1.default,
- // array
- limitItems_1.default,
- uniqueItems_1.default,
- // any
- { keyword: "type", schemaType: ["string", "array"] },
- { keyword: "nullable", schemaType: "boolean" },
- const_1.default,
- enum_1.default
- ];
- exports.default = validation;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
-var require_additionalItems = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.validateAdditionalItems = void 0;
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var error41 = {
- message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
- params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
- };
- var def = {
- keyword: "additionalItems",
- type: "array",
- schemaType: ["boolean", "object"],
- before: "uniqueItems",
- error: error41,
- code(cxt) {
- const { parentSchema, it } = cxt;
- const { items } = parentSchema;
- if (!Array.isArray(items)) {
- (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
- return;
- }
- validateAdditionalItems(cxt, items);
- }
- };
- function validateAdditionalItems(cxt, items) {
- const { gen, schema: schema2, data, keyword, it } = cxt;
- it.items = true;
- const len = gen.const("len", (0, codegen_1._)`${data}.length`);
- if (schema2 === false) {
- cxt.setParams({ len: items.length });
- cxt.pass((0, codegen_1._)`${len} <= ${items.length}`);
- } else if (typeof schema2 == "object" && !(0, util_1.alwaysValidSchema)(it, schema2)) {
- const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`);
- gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
- cxt.ok(valid);
- }
- function validateItems(valid) {
- gen.forRange("i", items.length, len, (i) => {
- cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
- if (!it.allErrors)
- gen.if((0, codegen_1.not)(valid), () => gen.break());
+ function localCompile(_schema, _root, localRefs2, baseId2) {
+ var isRoot = !_root || _root && _root.schema == _schema;
+ if (_root.schema != root.schema)
+ return compile.call(self, _schema, _root, localRefs2, baseId2);
+ var $async = _schema.$async === true;
+ var sourceCode = validateGenerator({
+ isTop: true,
+ schema: _schema,
+ isRoot,
+ baseId: baseId2,
+ root: _root,
+ schemaPath: "",
+ errSchemaPath: "#",
+ errorPath: '""',
+ MissingRefError: errorClasses.MissingRef,
+ RULES,
+ validate: validateGenerator,
+ util: util2,
+ resolve,
+ resolveRef,
+ usePattern,
+ useDefault,
+ useCustomRule,
+ opts,
+ formats,
+ logger: self.logger,
+ self
});
- }
- }
- exports.validateAdditionalItems = validateAdditionalItems;
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js
-var require_items = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.validateTuple = void 0;
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var code_1 = require_code2();
- var def = {
- keyword: "items",
- type: "array",
- schemaType: ["object", "array", "boolean"],
- before: "uniqueItems",
- code(cxt) {
- const { schema: schema2, it } = cxt;
- if (Array.isArray(schema2))
- return validateTuple(cxt, "additionalItems", schema2);
- it.items = true;
- if ((0, util_1.alwaysValidSchema)(it, schema2))
- return;
- cxt.ok((0, code_1.validateArray)(cxt));
- }
- };
- function validateTuple(cxt, extraItems, schArr = cxt.schema) {
- const { gen, parentSchema, data, keyword, it } = cxt;
- checkStrictTuple(parentSchema);
- if (it.opts.unevaluated && schArr.length && it.items !== true) {
- it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
- }
- const valid = gen.name("valid");
- const len = gen.const("len", (0, codegen_1._)`${data}.length`);
- schArr.forEach((sch, i) => {
- if ((0, util_1.alwaysValidSchema)(it, sch))
- return;
- gen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({
- keyword,
- schemaProp: i,
- dataProp: i
- }, valid));
- cxt.ok(valid);
- });
- function checkStrictTuple(sch) {
- const { opts, errSchemaPath } = it;
- const l = schArr.length;
- const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
- if (opts.strictTuples && !fullTuple) {
- const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
- (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
+ sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + sourceCode;
+ if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);
+ var validate2;
+ try {
+ var makeValidate = new Function(
+ "self",
+ "RULES",
+ "formats",
+ "root",
+ "refVal",
+ "defaults",
+ "customRules",
+ "equal",
+ "ucs2length",
+ "ValidationError",
+ sourceCode
+ );
+ validate2 = makeValidate(
+ self,
+ RULES,
+ formats,
+ root,
+ refVal,
+ defaults,
+ customRules,
+ equal,
+ ucs2length,
+ ValidationError
+ );
+ refVal[0] = validate2;
+ } catch (e) {
+ self.logger.error("Error compiling schema, function code:", sourceCode);
+ throw e;
}
- }
- }
- exports.validateTuple = validateTuple;
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
-var require_prefixItems = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var items_1 = require_items();
- var def = {
- keyword: "prefixItems",
- type: "array",
- schemaType: ["array"],
- before: "uniqueItems",
- code: (cxt) => (0, items_1.validateTuple)(cxt, "items")
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js
-var require_items2020 = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var code_1 = require_code2();
- var additionalItems_1 = require_additionalItems();
- var error41 = {
- message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
- params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
- };
- var def = {
- keyword: "items",
- type: "array",
- schemaType: ["object", "boolean"],
- before: "uniqueItems",
- error: error41,
- code(cxt) {
- const { schema: schema2, parentSchema, it } = cxt;
- const { prefixItems } = parentSchema;
- it.items = true;
- if ((0, util_1.alwaysValidSchema)(it, schema2))
- return;
- if (prefixItems)
- (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
- else
- cxt.ok((0, code_1.validateArray)(cxt));
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js
-var require_contains = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var error41 = {
- message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,
- params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
- };
- var def = {
- keyword: "contains",
- type: "array",
- schemaType: ["object", "boolean"],
- before: "uniqueItems",
- trackErrors: true,
- error: error41,
- code(cxt) {
- const { gen, schema: schema2, parentSchema, data, it } = cxt;
- let min;
- let max;
- const { minContains, maxContains } = parentSchema;
- if (it.opts.next) {
- min = minContains === void 0 ? 1 : minContains;
- max = maxContains;
- } else {
- min = 1;
- }
- const len = gen.const("len", (0, codegen_1._)`${data}.length`);
- cxt.setParams({ min, max });
- if (max === void 0 && min === 0) {
- (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
- return;
- }
- if (max !== void 0 && min > max) {
- (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
- cxt.fail();
- return;
- }
- if ((0, util_1.alwaysValidSchema)(it, schema2)) {
- let cond = (0, codegen_1._)`${len} >= ${min}`;
- if (max !== void 0)
- cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;
- cxt.pass(cond);
- return;
- }
- it.items = true;
- const valid = gen.name("valid");
- if (max === void 0 && min === 1) {
- validateItems(valid, () => gen.if(valid, () => gen.break()));
- } else if (min === 0) {
- gen.let(valid, true);
- if (max !== void 0)
- gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount);
- } else {
- gen.let(valid, false);
- validateItemsWithCount();
- }
- cxt.result(valid, () => cxt.reset());
- function validateItemsWithCount() {
- const schValid = gen.name("_valid");
- const count = gen.let("count", 0);
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
- }
- function validateItems(_valid, block) {
- gen.forRange("i", 0, len, (i) => {
- cxt.subschema({
- keyword: "contains",
- dataProp: i,
- dataPropType: util_1.Type.Num,
- compositeRule: true
- }, _valid);
- block();
- });
- }
- function checkLimits(count) {
- gen.code((0, codegen_1._)`${count}++`);
- if (max === void 0) {
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
- } else {
- gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
- if (min === 1)
- gen.assign(valid, true);
- else
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
- }
- }
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
-var require_dependencies = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var code_1 = require_code2();
- exports.error = {
- message: ({ params: { property, depsCount, deps } }) => {
- const property_ies = depsCount === 1 ? "property" : "properties";
- return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;
- },
- params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},
- missingProperty: ${missingProperty},
- depsCount: ${depsCount},
- deps: ${deps}}`
- // TODO change to reference
- };
- var def = {
- keyword: "dependencies",
- type: "object",
- schemaType: "object",
- error: exports.error,
- code(cxt) {
- const [propDeps, schDeps] = splitDependencies(cxt);
- validatePropertyDeps(cxt, propDeps);
- validateSchemaDeps(cxt, schDeps);
- }
- };
- function splitDependencies({ schema: schema2 }) {
- const propertyDeps = {};
- const schemaDeps = {};
- for (const key in schema2) {
- if (key === "__proto__")
- continue;
- const deps = Array.isArray(schema2[key]) ? propertyDeps : schemaDeps;
- deps[key] = schema2[key];
- }
- return [propertyDeps, schemaDeps];
- }
- function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
- const { gen, data, it } = cxt;
- if (Object.keys(propertyDeps).length === 0)
- return;
- const missing = gen.let("missing");
- for (const prop in propertyDeps) {
- const deps = propertyDeps[prop];
- if (deps.length === 0)
- continue;
- const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
- cxt.setParams({
- property: prop,
- depsCount: deps.length,
- deps: deps.join(", ")
- });
- if (it.allErrors) {
- gen.if(hasProperty, () => {
- for (const depProp of deps) {
- (0, code_1.checkReportMissingProp)(cxt, depProp);
- }
- });
- } else {
- gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
- (0, code_1.reportMissingProp)(cxt, missing);
- gen.else();
- }
- }
- }
- exports.validatePropertyDeps = validatePropertyDeps;
- function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
- const { gen, data, keyword, it } = cxt;
- const valid = gen.name("valid");
- for (const prop in schemaDeps) {
- if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
- continue;
- gen.if(
- (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties),
- () => {
- const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
- cxt.mergeValidEvaluated(schCxt, valid);
- },
- () => gen.var(valid, true)
- // TODO var
- );
- cxt.ok(valid);
- }
- }
- exports.validateSchemaDeps = validateSchemaDeps;
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
-var require_propertyNames = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var error41 = {
- message: "property name must be valid",
- params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
- };
- var def = {
- keyword: "propertyNames",
- type: "object",
- schemaType: ["object", "boolean"],
- error: error41,
- code(cxt) {
- const { gen, schema: schema2, data, it } = cxt;
- if ((0, util_1.alwaysValidSchema)(it, schema2))
- return;
- const valid = gen.name("valid");
- gen.forIn("key", data, (key) => {
- cxt.setParams({ propertyName: key });
- cxt.subschema({
- keyword: "propertyNames",
- data: key,
- dataTypes: ["string"],
- propertyName: key,
- compositeRule: true
- }, valid);
- gen.if((0, codegen_1.not)(valid), () => {
- cxt.error(true);
- if (!it.allErrors)
- gen.break();
- });
- });
- cxt.ok(valid);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
-var require_additionalProperties = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var code_1 = require_code2();
- var codegen_1 = require_codegen();
- var names_1 = require_names();
- var util_1 = require_util();
- var error41 = {
- message: "must NOT have additional properties",
- params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
- };
- var def = {
- keyword: "additionalProperties",
- type: ["object"],
- schemaType: ["boolean", "object"],
- allowUndefined: true,
- trackErrors: true,
- error: error41,
- code(cxt) {
- const { gen, schema: schema2, parentSchema, data, errsCount, it } = cxt;
- if (!errsCount)
- throw new Error("ajv implementation error");
- const { allErrors, opts } = it;
- it.props = true;
- if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema2))
- return;
- const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
- const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
- checkAdditionalProperties();
- cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
- function checkAdditionalProperties() {
- gen.forIn("key", data, (key) => {
- if (!props.length && !patProps.length)
- additionalPropertyCode(key);
- else
- gen.if(isAdditional(key), () => additionalPropertyCode(key));
- });
- }
- function isAdditional(key) {
- let definedProp;
- if (props.length > 8) {
- const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
- definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
- } else if (props.length) {
- definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
- } else {
- definedProp = codegen_1.nil;
- }
- if (patProps.length) {
- definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
- }
- return (0, codegen_1.not)(definedProp);
- }
- function deleteAdditional(key) {
- gen.code((0, codegen_1._)`delete ${data}[${key}]`);
- }
- function additionalPropertyCode(key) {
- if (opts.removeAdditional === "all" || opts.removeAdditional && schema2 === false) {
- deleteAdditional(key);
- return;
- }
- if (schema2 === false) {
- cxt.setParams({ additionalProperty: key });
- cxt.error();
- if (!allErrors)
- gen.break();
- return;
- }
- if (typeof schema2 == "object" && !(0, util_1.alwaysValidSchema)(it, schema2)) {
- const valid = gen.name("valid");
- if (opts.removeAdditional === "failing") {
- applyAdditionalSchema(key, valid, false);
- gen.if((0, codegen_1.not)(valid), () => {
- cxt.reset();
- deleteAdditional(key);
- });
- } else {
- applyAdditionalSchema(key, valid);
- if (!allErrors)
- gen.if((0, codegen_1.not)(valid), () => gen.break());
- }
- }
- }
- function applyAdditionalSchema(key, valid, errors) {
- const subschema = {
- keyword: "additionalProperties",
- dataProp: key,
- dataPropType: util_1.Type.Str
+ validate2.schema = _schema;
+ validate2.errors = null;
+ validate2.refs = refs;
+ validate2.refVal = refVal;
+ validate2.root = isRoot ? validate2 : _root;
+ if ($async) validate2.$async = true;
+ if (opts.sourceCode === true) {
+ validate2.source = {
+ code: sourceCode,
+ patterns,
+ defaults
};
- if (errors === false) {
- Object.assign(subschema, {
- compositeRule: true,
- createErrors: false,
- allErrors: false
- });
+ }
+ return validate2;
+ }
+ function resolveRef(baseId2, ref, isRoot) {
+ ref = resolve.url(baseId2, ref);
+ var refIndex = refs[ref];
+ var _refVal, refCode;
+ if (refIndex !== void 0) {
+ _refVal = refVal[refIndex];
+ refCode = "refVal[" + refIndex + "]";
+ return resolvedRef(_refVal, refCode);
+ }
+ if (!isRoot && root.refs) {
+ var rootRefId = root.refs[ref];
+ if (rootRefId !== void 0) {
+ _refVal = root.refVal[rootRefId];
+ refCode = addLocalRef(ref, _refVal);
+ return resolvedRef(_refVal, refCode);
}
- cxt.subschema(subschema, valid);
+ }
+ refCode = addLocalRef(ref);
+ var v2 = resolve.call(self, localCompile, root, ref);
+ if (v2 === void 0) {
+ var localSchema = localRefs && localRefs[ref];
+ if (localSchema) {
+ v2 = resolve.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId2);
+ }
+ }
+ if (v2 === void 0) {
+ removeLocalRef(ref);
+ } else {
+ replaceLocalRef(ref, v2);
+ return resolvedRef(v2, refCode);
}
}
- };
- exports.default = def;
+ function addLocalRef(ref, v2) {
+ var refId = refVal.length;
+ refVal[refId] = v2;
+ refs[ref] = refId;
+ return "refVal" + refId;
+ }
+ function removeLocalRef(ref) {
+ delete refs[ref];
+ }
+ function replaceLocalRef(ref, v2) {
+ var refId = refs[ref];
+ refVal[refId] = v2;
+ }
+ function resolvedRef(refVal2, code) {
+ return typeof refVal2 == "object" || typeof refVal2 == "boolean" ? { code, schema: refVal2, inline: true } : { code, $async: refVal2 && !!refVal2.$async };
+ }
+ function usePattern(regexStr) {
+ var index = patternsHash[regexStr];
+ if (index === void 0) {
+ index = patternsHash[regexStr] = patterns.length;
+ patterns[index] = regexStr;
+ }
+ return "pattern" + index;
+ }
+ function useDefault(value2) {
+ switch (typeof value2) {
+ case "boolean":
+ case "number":
+ return "" + value2;
+ case "string":
+ return util2.toQuotedString(value2);
+ case "object":
+ if (value2 === null) return "null";
+ var valueStr = stableStringify(value2);
+ var index = defaultsHash[valueStr];
+ if (index === void 0) {
+ index = defaultsHash[valueStr] = defaults.length;
+ defaults[index] = value2;
+ }
+ return "default" + index;
+ }
+ }
+ function useCustomRule(rule, schema3, parentSchema, it) {
+ if (self._opts.validateSchema !== false) {
+ var deps = rule.definition.dependencies;
+ if (deps && !deps.every(function(keyword) {
+ return Object.prototype.hasOwnProperty.call(parentSchema, keyword);
+ }))
+ throw new Error("parent schema must have all required keywords: " + deps.join(","));
+ var validateSchema = rule.definition.validateSchema;
+ if (validateSchema) {
+ var valid = validateSchema(schema3);
+ if (!valid) {
+ var message = "keyword schema is invalid: " + self.errorsText(validateSchema.errors);
+ if (self._opts.validateSchema == "log") self.logger.error(message);
+ else throw new Error(message);
+ }
+ }
+ }
+ var compile2 = rule.definition.compile, inline = rule.definition.inline, macro = rule.definition.macro;
+ var validate2;
+ if (compile2) {
+ validate2 = compile2.call(self, schema3, parentSchema, it);
+ } else if (macro) {
+ validate2 = macro.call(self, schema3, parentSchema, it);
+ if (opts.validateSchema !== false) self.validateSchema(validate2, true);
+ } else if (inline) {
+ validate2 = inline.call(self, it, rule.keyword, schema3, parentSchema);
+ } else {
+ validate2 = rule.definition.validate;
+ if (!validate2) return;
+ }
+ if (validate2 === void 0)
+ throw new Error('custom keyword "' + rule.keyword + '"failed to compile');
+ var index = customRules.length;
+ customRules[index] = validate2;
+ return {
+ code: "customRule" + index,
+ validate: validate2
+ };
+ }
+ }
+ function checkCompiling(schema2, root, baseId) {
+ var index = compIndex.call(this, schema2, root, baseId);
+ if (index >= 0) return { index, compiling: true };
+ index = this._compilations.length;
+ this._compilations[index] = {
+ schema: schema2,
+ root,
+ baseId
+ };
+ return { index, compiling: false };
+ }
+ function endCompiling(schema2, root, baseId) {
+ var i = compIndex.call(this, schema2, root, baseId);
+ if (i >= 0) this._compilations.splice(i, 1);
+ }
+ function compIndex(schema2, root, baseId) {
+ for (var i = 0; i < this._compilations.length; i++) {
+ var c = this._compilations[i];
+ if (c.schema == schema2 && c.root == root && c.baseId == baseId) return i;
+ }
+ return -1;
+ }
+ function patternCode(i, patterns) {
+ return "var pattern" + i + " = new RegExp(" + util2.toQuotedString(patterns[i]) + ");";
+ }
+ function defaultCode(i) {
+ return "var default" + i + " = defaults[" + i + "];";
+ }
+ function refValCode(i, refVal) {
+ return refVal[i] === void 0 ? "" : "var refVal" + i + " = refVal[" + i + "];";
+ }
+ function customRuleCode(i) {
+ return "var customRule" + i + " = customRules[" + i + "];";
+ }
+ function vars(arr, statement) {
+ if (!arr.length) return "";
+ var code = "";
+ for (var i = 0; i < arr.length; i++)
+ code += statement(i, arr);
+ return code;
+ }
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js
-var require_properties = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) {
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js
+var require_cache = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var validate_1 = require_validate();
- var code_1 = require_code2();
- var util_1 = require_util();
- var additionalProperties_1 = require_additionalProperties();
- var def = {
- keyword: "properties",
- type: "object",
- schemaType: "object",
- code(cxt) {
- const { gen, schema: schema2, parentSchema, data, it } = cxt;
- if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) {
- additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
+ var Cache = module.exports = function Cache2() {
+ this._cache = {};
+ };
+ Cache.prototype.put = function Cache_put(key, value2) {
+ this._cache[key] = value2;
+ };
+ Cache.prototype.get = function Cache_get(key) {
+ return this._cache[key];
+ };
+ Cache.prototype.del = function Cache_del(key) {
+ delete this._cache[key];
+ };
+ Cache.prototype.clear = function Cache_clear() {
+ this._cache = {};
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/formats.js
+var require_formats = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/formats.js"(exports, module) {
+ "use strict";
+ var util2 = require_util();
+ var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
+ var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+ var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
+ var 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;
+ var 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;
+ var URIREF = /^(?:[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;
+ var URITEMPLATE = /^(?:(?:[^\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;
+ var URL2 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
+ var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
+ var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
+ var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
+ var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
+ module.exports = formats;
+ function formats(mode) {
+ mode = mode == "full" ? "full" : "fast";
+ return util2.copy(formats[mode]);
+ }
+ formats.fast = {
+ // date: http://tools.ietf.org/html/rfc3339#section-5.6
+ date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
+ // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
+ time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
+ "date-time": /^\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,
+ // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
+ uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
+ "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
+ "uri-template": URITEMPLATE,
+ url: URL2,
+ // email (sources from jsen validator):
+ // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
+ // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
+ 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,
+ hostname: HOSTNAME,
+ // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
+ ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
+ // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
+ ipv6: /^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,
+ regex: regex3,
+ // uuid: http://tools.ietf.org/html/rfc4122
+ uuid: UUID,
+ // JSON-pointer: https://tools.ietf.org/html/rfc6901
+ // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
+ "json-pointer": JSON_POINTER,
+ "json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT,
+ // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
+ "relative-json-pointer": RELATIVE_JSON_POINTER
+ };
+ formats.full = {
+ date: date2,
+ time: time2,
+ "date-time": date_time,
+ uri,
+ "uri-reference": URIREF,
+ "uri-template": URITEMPLATE,
+ url: URL2,
+ 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,
+ hostname: HOSTNAME,
+ ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
+ ipv6: /^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,
+ regex: regex3,
+ uuid: UUID,
+ "json-pointer": JSON_POINTER,
+ "json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT,
+ "relative-json-pointer": RELATIVE_JSON_POINTER
+ };
+ function isLeapYear(year) {
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
+ }
+ function date2(str) {
+ var matches = str.match(DATE);
+ if (!matches) return false;
+ var year = +matches[1];
+ var month = +matches[2];
+ var day = +matches[3];
+ return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
+ }
+ function time2(str, full) {
+ var matches = str.match(TIME);
+ if (!matches) return false;
+ var hour = matches[1];
+ var minute = matches[2];
+ var second = matches[3];
+ var timeZone = matches[5];
+ return (hour <= 23 && minute <= 59 && second <= 59 || hour == 23 && minute == 59 && second == 60) && (!full || timeZone);
+ }
+ var DATE_TIME_SEPARATOR = /t|\s/i;
+ function date_time(str) {
+ var dateTime = str.split(DATE_TIME_SEPARATOR);
+ return dateTime.length == 2 && date2(dateTime[0]) && time2(dateTime[1], true);
+ }
+ var NOT_URI_FRAGMENT = /\/|:/;
+ function uri(str) {
+ return NOT_URI_FRAGMENT.test(str) && URI.test(str);
+ }
+ var Z_ANCHOR = /[^\\]\\Z/;
+ function regex3(str) {
+ if (Z_ANCHOR.test(str)) return false;
+ try {
+ new RegExp(str);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/ref.js
+var require_ref = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/ref.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_ref(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $async, $refCode;
+ if ($schema == "#" || $schema == "#/") {
+ if (it.isRoot) {
+ $async = it.async;
+ $refCode = "validate";
+ } else {
+ $async = it.root.schema.$async === true;
+ $refCode = "root.refVal[0]";
}
- const allProps = (0, code_1.allSchemaProperties)(schema2);
- for (const prop of allProps) {
- it.definedProperties.add(prop);
- }
- if (it.opts.unevaluated && allProps.length && it.props !== true) {
- it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
- }
- const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema2[p]));
- if (properties.length === 0)
- return;
- const valid = gen.name("valid");
- for (const prop of properties) {
- if (hasDefault(prop)) {
- applyPropertySchema(prop);
+ } else {
+ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
+ if ($refVal === void 0) {
+ var $message = it.MissingRefError.message(it.baseId, $schema);
+ if (it.opts.missingRefs == "fail") {
+ it.logger.error($message);
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '$ref' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { ref: '" + it.util.escapeQuotes($schema) + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'can\\'t resolve reference " + it.util.escapeQuotes($schema) + "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: " + it.util.toQuotedString($schema) + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ if ($breakOnError) {
+ out += " if (false) { ";
+ }
+ } else if (it.opts.missingRefs == "ignore") {
+ it.logger.warn($message);
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
} else {
- gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
- applyPropertySchema(prop);
- if (!it.allErrors)
- gen.else().var(valid, true);
- gen.endIf();
+ throw new it.MissingRefError(it.baseId, $schema, $message);
}
- cxt.it.definedProperties.add(prop);
- cxt.ok(valid);
- }
- function hasDefault(prop) {
- return it.opts.useDefaults && !it.compositeRule && schema2[prop].default !== void 0;
- }
- function applyPropertySchema(prop) {
- cxt.subschema({
- keyword: "properties",
- schemaProp: prop,
- dataProp: prop
- }, valid);
+ } else if ($refVal.inline) {
+ var $it = it.util.copy(it);
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ $it.schema = $refVal.schema;
+ $it.schemaPath = "";
+ $it.errSchemaPath = $schema;
+ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
+ out += " " + $code + " ";
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ }
+ } else {
+ $async = $refVal.$async === true || it.async && $refVal.$async !== false;
+ $refCode = $refVal.code;
}
}
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
-var require_patternProperties = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var code_1 = require_code2();
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var util_2 = require_util();
- var def = {
- keyword: "patternProperties",
- type: "object",
- schemaType: "object",
- code(cxt) {
- const { gen, schema: schema2, data, parentSchema, it } = cxt;
- const { opts } = it;
- const patterns = (0, code_1.allSchemaProperties)(schema2);
- const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema2[p]));
- if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
- return;
+ if ($refCode) {
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.opts.passContext) {
+ out += " " + $refCode + ".call(this, ";
+ } else {
+ out += " " + $refCode + "( ";
}
- const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
- const valid = gen.name("valid");
- if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
- it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
+ out += " " + $data + ", (dataPath || '')";
+ if (it.errorPath != '""') {
+ out += " + " + it.errorPath;
}
- const { props } = it;
- validatePatternProperties();
- function validatePatternProperties() {
- for (const pat of patterns) {
- if (checkProperties)
- checkMatchingProperties(pat);
- if (it.allErrors) {
- validateProperties(pat);
- } else {
- gen.var(valid, true);
- validateProperties(pat);
- gen.if(valid);
- }
+ var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : "parentDataProperty";
+ out += " , " + $parentData + " , " + $parentDataProperty + ", rootData) ";
+ var __callValidate = out;
+ out = $$outStack.pop();
+ if ($async) {
+ if (!it.async) throw new Error("async schema referenced by sync schema");
+ if ($breakOnError) {
+ out += " var " + $valid + "; ";
+ }
+ out += " try { await " + __callValidate + "; ";
+ if ($breakOnError) {
+ out += " " + $valid + " = true; ";
+ }
+ out += " } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ";
+ if ($breakOnError) {
+ out += " " + $valid + " = false; ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " if (" + $valid + ") { ";
+ }
+ } else {
+ out += " if (!" + __callValidate + ") { if (vErrors === null) vErrors = " + $refCode + ".errors; else vErrors = vErrors.concat(" + $refCode + ".errors); errors = vErrors.length; } ";
+ if ($breakOnError) {
+ out += " else { ";
}
}
- function checkMatchingProperties(pat) {
- for (const prop in checkProperties) {
- if (new RegExp(pat).test(prop)) {
- (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
- }
- }
- }
- function validateProperties(pat) {
- gen.forIn("key", data, (key) => {
- gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
- const alwaysValid = alwaysValidPatterns.includes(pat);
- if (!alwaysValid) {
- cxt.subschema({
- keyword: "patternProperties",
- schemaProp: pat,
- dataProp: key,
- dataPropType: util_2.Type.Str
- }, valid);
- }
- if (it.opts.unevaluated && props !== true) {
- gen.assign((0, codegen_1._)`${props}[${key}]`, true);
- } else if (!alwaysValid && !it.allErrors) {
- gen.if((0, codegen_1.not)(valid), () => gen.break());
- }
- });
- });
- }
}
+ return out;
};
- exports.default = def;
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js
-var require_not = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = require_util();
- var def = {
- keyword: "not",
- schemaType: ["object", "boolean"],
- trackErrors: true,
- code(cxt) {
- const { gen, schema: schema2, it } = cxt;
- if ((0, util_1.alwaysValidSchema)(it, schema2)) {
- cxt.fail();
- return;
- }
- const valid = gen.name("valid");
- cxt.subschema({
- keyword: "not",
- compositeRule: true,
- createErrors: false,
- allErrors: false
- }, valid);
- cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
- },
- error: { message: "must NOT be valid" }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
-var require_anyOf = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var code_1 = require_code2();
- var def = {
- keyword: "anyOf",
- schemaType: "array",
- trackErrors: true,
- code: code_1.validateUnion,
- error: { message: "must match a schema in anyOf" }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
-var require_oneOf = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var error41 = {
- message: "must match exactly one schema in oneOf",
- params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
- };
- var def = {
- keyword: "oneOf",
- schemaType: "array",
- trackErrors: true,
- error: error41,
- code(cxt) {
- const { gen, schema: schema2, parentSchema, it } = cxt;
- if (!Array.isArray(schema2))
- throw new Error("ajv implementation error");
- if (it.opts.discriminator && parentSchema.discriminator)
- return;
- const schArr = schema2;
- const valid = gen.let("valid", false);
- const passing = gen.let("passing", null);
- const schValid = gen.name("_valid");
- cxt.setParams({ passing });
- gen.block(validateOneOf);
- cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
- function validateOneOf() {
- schArr.forEach((sch, i) => {
- let schCxt;
- if ((0, util_1.alwaysValidSchema)(it, sch)) {
- gen.var(schValid, true);
- } else {
- schCxt = cxt.subschema({
- keyword: "oneOf",
- schemaProp: i,
- compositeRule: true
- }, schValid);
- }
- if (i > 0) {
- gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else();
- }
- gen.if(schValid, () => {
- gen.assign(valid, true);
- gen.assign(passing, i);
- if (schCxt)
- cxt.mergeEvaluated(schCxt, codegen_1.Name);
- });
- });
- }
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/allOf.js
var require_allOf = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) {
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/allOf.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = require_util();
- var def = {
- keyword: "allOf",
- schemaType: "array",
- code(cxt) {
- const { gen, schema: schema2, it } = cxt;
- if (!Array.isArray(schema2))
- throw new Error("ajv implementation error");
- const valid = gen.name("valid");
- schema2.forEach((sch, i) => {
- if ((0, util_1.alwaysValidSchema)(it, sch))
- return;
- const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
- cxt.ok(valid);
- cxt.mergeEvaluated(schCxt);
- });
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js
-var require_if = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var util_1 = require_util();
- var error41 = {
- message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
- params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
- };
- var def = {
- keyword: "if",
- schemaType: ["object", "boolean"],
- trackErrors: true,
- error: error41,
- code(cxt) {
- const { gen, parentSchema, it } = cxt;
- if (parentSchema.then === void 0 && parentSchema.else === void 0) {
- (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored');
+ module.exports = function generate_allOf(it, $keyword, $ruleType) {
+ var out = " ";
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $currentBaseId = $it.baseId, $allSchemasEmpty = true;
+ var arr1 = $schema;
+ if (arr1) {
+ var $sch, $i = -1, l1 = arr1.length - 1;
+ while ($i < l1) {
+ $sch = arr1[$i += 1];
+ if (it.opts.strictKeywords ? typeof $sch == "object" && Object.keys($sch).length > 0 || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)) {
+ $allSchemasEmpty = false;
+ $it.schema = $sch;
+ $it.schemaPath = $schemaPath + "[" + $i + "]";
+ $it.errSchemaPath = $errSchemaPath + "/" + $i;
+ out += " " + it.validate($it) + " ";
+ $it.baseId = $currentBaseId;
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ $closingBraces += "}";
+ }
+ }
}
- const hasThen = hasSchema(it, "then");
- const hasElse = hasSchema(it, "else");
- if (!hasThen && !hasElse)
- return;
- const valid = gen.let("valid", true);
- const schValid = gen.name("_valid");
- validateIf();
- cxt.reset();
- if (hasThen && hasElse) {
- const ifClause = gen.let("ifClause");
- cxt.setParams({ ifClause });
- gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
- } else if (hasThen) {
- gen.if(schValid, validateClause("then"));
+ }
+ if ($breakOnError) {
+ if ($allSchemasEmpty) {
+ out += " if (true) { ";
} else {
- gen.if((0, codegen_1.not)(schValid), validateClause("else"));
- }
- cxt.pass(valid, () => cxt.error(true));
- function validateIf() {
- const schCxt = cxt.subschema({
- keyword: "if",
- compositeRule: true,
- createErrors: false,
- allErrors: false
- }, schValid);
- cxt.mergeEvaluated(schCxt);
- }
- function validateClause(keyword, ifClause) {
- return () => {
- const schCxt = cxt.subschema({ keyword }, schValid);
- gen.assign(valid, schValid);
- cxt.mergeValidEvaluated(schCxt, valid);
- if (ifClause)
- gen.assign(ifClause, (0, codegen_1._)`${keyword}`);
- else
- cxt.setParams({ ifClause: keyword });
- };
+ out += " " + $closingBraces.slice(0, -1) + " ";
}
}
+ return out;
};
- function hasSchema(it, keyword) {
- const schema2 = it.schema[keyword];
- return schema2 !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema2);
- }
- exports.default = def;
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
-var require_thenElse = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) {
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/anyOf.js
+var require_anyOf = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/anyOf.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = require_util();
- var def = {
- keyword: ["then", "else"],
- schemaType: ["object", "boolean"],
- code({ keyword, parentSchema, it }) {
- if (parentSchema.if === void 0)
- (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
- }
- };
- exports.default = def;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js
-var require_applicator = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var additionalItems_1 = require_additionalItems();
- var prefixItems_1 = require_prefixItems();
- var items_1 = require_items();
- var items2020_1 = require_items2020();
- var contains_1 = require_contains();
- var dependencies_1 = require_dependencies();
- var propertyNames_1 = require_propertyNames();
- var additionalProperties_1 = require_additionalProperties();
- var properties_1 = require_properties();
- var patternProperties_1 = require_patternProperties();
- var not_1 = require_not();
- var anyOf_1 = require_anyOf();
- var oneOf_1 = require_oneOf();
- var allOf_1 = require_allOf();
- var if_1 = require_if();
- var thenElse_1 = require_thenElse();
- function getApplicator(draft2020 = false) {
- const applicator = [
- // any
- not_1.default,
- anyOf_1.default,
- oneOf_1.default,
- allOf_1.default,
- if_1.default,
- thenElse_1.default,
- // object
- propertyNames_1.default,
- additionalProperties_1.default,
- dependencies_1.default,
- properties_1.default,
- patternProperties_1.default
- ];
- if (draft2020)
- applicator.push(prefixItems_1.default, items2020_1.default);
- else
- applicator.push(additionalItems_1.default, items_1.default);
- applicator.push(contains_1.default);
- return applicator;
- }
- exports.default = getApplicator;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js
-var require_format = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var error41 = {
- message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
- params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
- };
- var def = {
- keyword: "format",
- type: ["number", "string"],
- schemaType: "string",
- $data: true,
- error: error41,
- code(cxt, ruleType) {
- const { gen, data, $data, schema: schema2, schemaCode, it } = cxt;
- const { opts, errSchemaPath, schemaEnv, self } = it;
- if (!opts.validateFormats)
- return;
- if ($data)
- validate$DataFormat();
- else
- validateFormat();
- function validate$DataFormat() {
- const fmts = gen.scopeValue("formats", {
- ref: self.formats,
- code: opts.code.formats
- });
- const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
- const fType = gen.let("fType");
- const format2 = gen.let("format");
- gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format2, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format2, fDef));
- cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
- function unknownFmt() {
- if (opts.strictSchema === false)
- return codegen_1.nil;
- return (0, codegen_1._)`${schemaCode} && !${format2}`;
- }
- function invalidFmt() {
- const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format2}(${data}) : ${format2}(${data}))` : (0, codegen_1._)`${format2}(${data})`;
- const validData = (0, codegen_1._)`(typeof ${format2} == "function" ? ${callFormat} : ${format2}.test(${data}))`;
- return (0, codegen_1._)`${format2} && ${format2} !== true && ${fType} === ${ruleType} && !${validData}`;
+ module.exports = function generate_anyOf(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $noEmptySchema = $schema.every(function($sch2) {
+ return it.opts.strictKeywords ? typeof $sch2 == "object" && Object.keys($sch2).length > 0 || $sch2 === false : it.util.schemaHasRules($sch2, it.RULES.all);
+ });
+ if ($noEmptySchema) {
+ var $currentBaseId = $it.baseId;
+ out += " var " + $errs + " = errors; var " + $valid + " = false; ";
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ var arr1 = $schema;
+ if (arr1) {
+ var $sch, $i = -1, l1 = arr1.length - 1;
+ while ($i < l1) {
+ $sch = arr1[$i += 1];
+ $it.schema = $sch;
+ $it.schemaPath = $schemaPath + "[" + $i + "]";
+ $it.errSchemaPath = $errSchemaPath + "/" + $i;
+ out += " " + it.validate($it) + " ";
+ $it.baseId = $currentBaseId;
+ out += " " + $valid + " = " + $valid + " || " + $nextValid + "; if (!" + $valid + ") { ";
+ $closingBraces += "}";
}
}
- function validateFormat() {
- const formatDef = self.formats[schema2];
- if (!formatDef) {
- unknownFormat();
- return;
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ out += " " + $closingBraces + " if (!" + $valid + ") { var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'anyOf' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should match some schema in anyOf' ";
}
- if (formatDef === true)
- return;
- const [fmtType, format2, fmtRef] = getFormat(formatDef);
- if (fmtType === ruleType)
- cxt.pass(validCondition());
- function unknownFormat() {
- if (opts.strictSchema === false) {
- self.logger.warn(unknownMsg());
- return;
- }
- throw new Error(unknownMsg());
- function unknownMsg() {
- return `unknown format "${schema2}" ignored in schema at path "${errSchemaPath}"`;
- }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
}
- function getFormat(fmtDef) {
- const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema2)}` : void 0;
- const fmt = gen.scopeValue("formats", { key: schema2, ref: fmtDef, code });
- if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
- return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
- }
- return ["string", fmtDef, fmt];
- }
- function validCondition() {
- if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
- if (!schemaEnv.$async)
- throw new Error("async format in sync schema");
- return (0, codegen_1._)`await ${fmtRef}(${data})`;
- }
- return typeof format2 == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError(vErrors); ";
+ } else {
+ out += " validate.errors = vErrors; return false; ";
}
}
+ out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } ";
+ if (it.opts.allErrors) {
+ out += " } ";
+ }
+ } else {
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
}
+ return out;
};
- exports.default = def;
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js
-var require_format2 = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js"(exports) {
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js
+var require_comment = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var format_1 = require_format();
- var format2 = [format_1.default];
- exports.default = format2;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js
-var require_metadata = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.contentVocabulary = exports.metadataVocabulary = void 0;
- exports.metadataVocabulary = [
- "title",
- "description",
- "default",
- "deprecated",
- "readOnly",
- "writeOnly",
- "examples"
- ];
- exports.contentVocabulary = [
- "contentMediaType",
- "contentEncoding",
- "contentSchema"
- ];
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js
-var require_draft7 = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var core_1 = require_core2();
- var validation_1 = require_validation();
- var applicator_1 = require_applicator();
- var format_1 = require_format2();
- var metadata_1 = require_metadata();
- var draft7Vocabularies = [
- core_1.default,
- validation_1.default,
- (0, applicator_1.default)(),
- format_1.default,
- metadata_1.metadataVocabulary,
- metadata_1.contentVocabulary
- ];
- exports.default = draft7Vocabularies;
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js
-var require_types = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.DiscrError = void 0;
- var DiscrError;
- (function(DiscrError2) {
- DiscrError2["Tag"] = "tag";
- DiscrError2["Mapping"] = "mapping";
- })(DiscrError || (exports.DiscrError = DiscrError = {}));
- }
-});
-
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js
-var require_discriminator = __commonJS({
- "../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var codegen_1 = require_codegen();
- var types_1 = require_types();
- var compile_1 = require_compile();
- var ref_error_1 = require_ref_error();
- var util_1 = require_util();
- var error41 = {
- message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
- params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
+ module.exports = function generate_comment(it, $keyword, $ruleType) {
+ var out = " ";
+ var $schema = it.schema[$keyword];
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $comment = it.util.toQuotedString($schema);
+ if (it.opts.$comment === true) {
+ out += " console.log(" + $comment + ");";
+ } else if (typeof it.opts.$comment == "function") {
+ out += " self._opts.$comment(" + $comment + ", " + it.util.toQuotedString($errSchemaPath) + ", validate.root.schema);";
+ }
+ return out;
};
- var def = {
- keyword: "discriminator",
- type: "object",
- schemaType: "object",
- error: error41,
- code(cxt) {
- const { gen, data, schema: schema2, parentSchema, it } = cxt;
- const { oneOf } = parentSchema;
- if (!it.opts.discriminator) {
- throw new Error("discriminator: requires discriminator option");
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/const.js
+var require_const = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/const.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_const(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ if (!$isData) {
+ out += " var schema" + $lvl + " = validate.schema" + $schemaPath + ";";
+ }
+ out += "var " + $valid + " = equal(" + $data + ", schema" + $lvl + "); if (!" + $valid + ") { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'const' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { allowedValue: schema" + $lvl + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should be equal to constant' ";
}
- const tagName = schema2.propertyName;
- if (typeof tagName != "string")
- throw new Error("discriminator: requires propertyName");
- if (schema2.mapping)
- throw new Error("discriminator: mapping is not supported");
- if (!oneOf)
- throw new Error("discriminator: requires oneOf keyword");
- const valid = gen.let("valid", false);
- const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);
- gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
- cxt.ok(valid);
- function validateMapping() {
- const mapping = getMapping();
- gen.if(false);
- for (const tagValue in mapping) {
- gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);
- gen.assign(valid, applyTagSchema(mapping[tagValue]));
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " }";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/contains.js
+var require_contains = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/contains.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_contains(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it.baseId, $nonEmptySchema = it.opts.strictKeywords ? typeof $schema == "object" && Object.keys($schema).length > 0 || $schema === false : it.util.schemaHasRules($schema, it.RULES.all);
+ out += "var " + $errs + " = errors;var " + $valid + ";";
+ if ($nonEmptySchema) {
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ $it.schema = $schema;
+ $it.schemaPath = $schemaPath;
+ $it.errSchemaPath = $errSchemaPath;
+ out += " var " + $nextValid + " = false; for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { ";
+ $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
+ var $passData = $data + "[" + $idx + "]";
+ $it.dataPathArr[$dataNxt] = $idx;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ out += " if (" + $nextValid + ") break; } ";
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ out += " " + $closingBraces + " if (!" + $nextValid + ") {";
+ } else {
+ out += " if (" + $data + ".length == 0) {";
+ }
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'contains' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should contain a valid item' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } else { ";
+ if ($nonEmptySchema) {
+ out += " errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } ";
+ }
+ if (it.opts.allErrors) {
+ out += " } ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/dependencies.js
+var require_dependencies = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/dependencies.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_dependencies(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it.opts.ownProperties;
+ for ($property in $schema) {
+ if ($property == "__proto__") continue;
+ var $sch = $schema[$property];
+ var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
+ $deps[$property] = $sch;
+ }
+ out += "var " + $errs + " = errors;";
+ var $currentErrorPath = it.errorPath;
+ out += "var missing" + $lvl + ";";
+ for (var $property in $propertyDeps) {
+ $deps = $propertyDeps[$property];
+ if ($deps.length) {
+ out += " if ( " + $data + it.util.getProperty($property) + " !== undefined ";
+ if ($ownProperties) {
+ out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($property) + "') ";
}
- gen.else();
- cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
- gen.endIf();
- }
- function applyTagSchema(schemaProp) {
- const _valid = gen.name("valid");
- const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
- cxt.mergeEvaluated(schCxt, codegen_1.Name);
- return _valid;
- }
- function getMapping() {
- var _a;
- const oneOfMapping = {};
- const topRequired = hasRequired(parentSchema);
- let tagRequired = true;
- for (let i = 0; i < oneOf.length; i++) {
- let sch = oneOf[i];
- if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
- const ref = sch.$ref;
- sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
- if (sch instanceof compile_1.SchemaEnv)
- sch = sch.schema;
- if (sch === void 0)
- throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
+ if ($breakOnError) {
+ out += " && ( ";
+ var arr1 = $deps;
+ if (arr1) {
+ var $propertyKey, $i = -1, l1 = arr1.length - 1;
+ while ($i < l1) {
+ $propertyKey = arr1[$i += 1];
+ if ($i) {
+ out += " || ";
+ }
+ var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop;
+ out += " ( ( " + $useData + " === undefined ";
+ if ($ownProperties) {
+ out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') ";
+ }
+ out += ") && (missing" + $lvl + " = " + it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) + ") ) ";
+ }
}
- const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
- if (typeof propSch != "object") {
- throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
+ out += ")) { ";
+ var $propertyPath = "missing" + $lvl, $missingProperty = "' + " + $propertyPath + " + '";
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + " + " + $propertyPath;
}
- tagRequired = tagRequired && (topRequired || hasRequired(sch));
- addMappings(propSch, i);
- }
- if (!tagRequired)
- throw new Error(`discriminator: "${tagName}" must be required`);
- return oneOfMapping;
- function hasRequired({ required: required2 }) {
- return Array.isArray(required2) && required2.includes(tagName);
- }
- function addMappings(sch, i) {
- if (sch.const) {
- addMapping(sch.const, i);
- } else if (sch.enum) {
- for (const tagValue of sch.enum) {
- addMapping(tagValue, i);
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", ")) + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should have ";
+ if ($deps.length == 1) {
+ out += "property " + it.util.escapeQuotes($deps[0]);
+ } else {
+ out += "properties " + it.util.escapeQuotes($deps.join(", "));
+ }
+ out += " when property " + it.util.escapeQuotes($property) + " is present' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
}
} else {
- throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ } else {
+ out += " ) { ";
+ var arr2 = $deps;
+ if (arr2) {
+ var $propertyKey, i2 = -1, l2 = arr2.length - 1;
+ while (i2 < l2) {
+ $propertyKey = arr2[i2 += 1];
+ var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop;
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
+ }
+ out += " if ( " + $useData + " === undefined ";
+ if ($ownProperties) {
+ out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') ";
+ }
+ out += ") { var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", ")) + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should have ";
+ if ($deps.length == 1) {
+ out += "property " + it.util.escapeQuotes($deps[0]);
+ } else {
+ out += "properties " + it.util.escapeQuotes($deps.join(", "));
+ }
+ out += " when property " + it.util.escapeQuotes($property) + " is present' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ";
+ }
}
}
- function addMapping(tagValue, i) {
- if (typeof tagValue != "string" || tagValue in oneOfMapping) {
- throw new Error(`discriminator: "${tagName}" values must be unique strings`);
- }
- oneOfMapping[tagValue] = i;
+ out += " } ";
+ if ($breakOnError) {
+ $closingBraces += "}";
+ out += " else { ";
}
}
}
+ it.errorPath = $currentErrorPath;
+ var $currentBaseId = $it.baseId;
+ for (var $property in $schemaDeps) {
+ var $sch = $schemaDeps[$property];
+ if (it.opts.strictKeywords ? typeof $sch == "object" && Object.keys($sch).length > 0 || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)) {
+ out += " " + $nextValid + " = true; if ( " + $data + it.util.getProperty($property) + " !== undefined ";
+ if ($ownProperties) {
+ out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($property) + "') ";
+ }
+ out += ") { ";
+ $it.schema = $sch;
+ $it.schemaPath = $schemaPath + it.util.getProperty($property);
+ $it.errSchemaPath = $errSchemaPath + "/" + it.util.escapeFragment($property);
+ out += " " + it.validate($it) + " ";
+ $it.baseId = $currentBaseId;
+ out += " } ";
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ $closingBraces += "}";
+ }
+ }
+ }
+ if ($breakOnError) {
+ out += " " + $closingBraces + " if (" + $errs + " == errors) {";
+ }
+ return out;
};
- exports.default = def;
}
});
-// ../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/json-schema-draft-07.json
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/enum.js
+var require_enum = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/enum.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_enum(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ var $i = "i" + $lvl, $vSchema = "schema" + $lvl;
+ if (!$isData) {
+ out += " var " + $vSchema + " = validate.schema" + $schemaPath + ";";
+ }
+ out += "var " + $valid + ";";
+ if ($isData) {
+ out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {";
+ }
+ out += "" + $valid + " = false;for (var " + $i + "=0; " + $i + "<" + $vSchema + ".length; " + $i + "++) if (equal(" + $data + ", " + $vSchema + "[" + $i + "])) { " + $valid + " = true; break; }";
+ if ($isData) {
+ out += " } ";
+ }
+ out += " if (!" + $valid + ") { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'enum' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { allowedValues: schema" + $lvl + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should be equal to one of the allowed values' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " }";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js
+var require_format = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_format(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ if (it.opts.format === false) {
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
+ return out;
+ }
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ var $unknownFormats = it.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats);
+ if ($isData) {
+ var $format = "format" + $lvl, $isObject = "isObject" + $lvl, $formatType = "formatType" + $lvl;
+ out += " var " + $format + " = formats[" + $schemaValue + "]; var " + $isObject + " = typeof " + $format + " == 'object' && !(" + $format + " instanceof RegExp) && " + $format + ".validate; var " + $formatType + " = " + $isObject + " && " + $format + ".type || 'string'; if (" + $isObject + ") { ";
+ if (it.async) {
+ out += " var async" + $lvl + " = " + $format + ".async; ";
+ }
+ out += " " + $format + " = " + $format + ".validate; } if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || ";
+ }
+ out += " (";
+ if ($unknownFormats != "ignore") {
+ out += " (" + $schemaValue + " && !" + $format + " ";
+ if ($allowUnknown) {
+ out += " && self._opts.unknownFormats.indexOf(" + $schemaValue + ") == -1 ";
+ }
+ out += ") || ";
+ }
+ out += " (" + $format + " && " + $formatType + " == '" + $ruleType + "' && !(typeof " + $format + " == 'function' ? ";
+ if (it.async) {
+ out += " (async" + $lvl + " ? await " + $format + "(" + $data + ") : " + $format + "(" + $data + ")) ";
+ } else {
+ out += " " + $format + "(" + $data + ") ";
+ }
+ out += " : " + $format + ".test(" + $data + "))))) {";
+ } else {
+ var $format = it.formats[$schema];
+ if (!$format) {
+ if ($unknownFormats == "ignore") {
+ it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
+ return out;
+ } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
+ return out;
+ } else {
+ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"');
+ }
+ }
+ var $isObject = typeof $format == "object" && !($format instanceof RegExp) && $format.validate;
+ var $formatType = $isObject && $format.type || "string";
+ if ($isObject) {
+ var $async = $format.async === true;
+ $format = $format.validate;
+ }
+ if ($formatType != $ruleType) {
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
+ return out;
+ }
+ if ($async) {
+ if (!it.async) throw new Error("async format in sync schema");
+ var $formatRef = "formats" + it.util.getProperty($schema) + ".validate";
+ out += " if (!(await " + $formatRef + "(" + $data + "))) { ";
+ } else {
+ out += " if (! ";
+ var $formatRef = "formats" + it.util.getProperty($schema);
+ if ($isObject) $formatRef += ".validate";
+ if (typeof $format == "function") {
+ out += " " + $formatRef + "(" + $data + ") ";
+ } else {
+ out += " " + $formatRef + ".test(" + $data + ") ";
+ }
+ out += ") { ";
+ }
+ }
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'format' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { format: ";
+ if ($isData) {
+ out += "" + $schemaValue;
+ } else {
+ out += "" + it.util.toQuotedString($schema);
+ }
+ out += " } ";
+ if (it.opts.messages !== false) {
+ out += ` , message: 'should match format "`;
+ if ($isData) {
+ out += "' + " + $schemaValue + " + '";
+ } else {
+ out += "" + it.util.escapeQuotes($schema);
+ }
+ out += `"' `;
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + it.util.toQuotedString($schema);
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/if.js
+var require_if = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/if.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_if(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $thenSch = it.schema["then"], $elseSch = it.schema["else"], $thenPresent = $thenSch !== void 0 && (it.opts.strictKeywords ? typeof $thenSch == "object" && Object.keys($thenSch).length > 0 || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), $elsePresent = $elseSch !== void 0 && (it.opts.strictKeywords ? typeof $elseSch == "object" && Object.keys($elseSch).length > 0 || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), $currentBaseId = $it.baseId;
+ if ($thenPresent || $elsePresent) {
+ var $ifClause;
+ $it.createErrors = false;
+ $it.schema = $schema;
+ $it.schemaPath = $schemaPath;
+ $it.errSchemaPath = $errSchemaPath;
+ out += " var " + $errs + " = errors; var " + $valid + " = true; ";
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ out += " " + it.validate($it) + " ";
+ $it.baseId = $currentBaseId;
+ $it.createErrors = true;
+ out += " errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } ";
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ if ($thenPresent) {
+ out += " if (" + $nextValid + ") { ";
+ $it.schema = it.schema["then"];
+ $it.schemaPath = it.schemaPath + ".then";
+ $it.errSchemaPath = it.errSchemaPath + "/then";
+ out += " " + it.validate($it) + " ";
+ $it.baseId = $currentBaseId;
+ out += " " + $valid + " = " + $nextValid + "; ";
+ if ($thenPresent && $elsePresent) {
+ $ifClause = "ifClause" + $lvl;
+ out += " var " + $ifClause + " = 'then'; ";
+ } else {
+ $ifClause = "'then'";
+ }
+ out += " } ";
+ if ($elsePresent) {
+ out += " else { ";
+ }
+ } else {
+ out += " if (!" + $nextValid + ") { ";
+ }
+ if ($elsePresent) {
+ $it.schema = it.schema["else"];
+ $it.schemaPath = it.schemaPath + ".else";
+ $it.errSchemaPath = it.errSchemaPath + "/else";
+ out += " " + it.validate($it) + " ";
+ $it.baseId = $currentBaseId;
+ out += " " + $valid + " = " + $nextValid + "; ";
+ if ($thenPresent && $elsePresent) {
+ $ifClause = "ifClause" + $lvl;
+ out += " var " + $ifClause + " = 'else'; ";
+ } else {
+ $ifClause = "'else'";
+ }
+ out += " } ";
+ }
+ out += " if (!" + $valid + ") { var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'if' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { failingKeyword: " + $ifClause + " } ";
+ if (it.opts.messages !== false) {
+ out += ` , message: 'should match "' + ` + $ifClause + ` + '" schema' `;
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError(vErrors); ";
+ } else {
+ out += " validate.errors = vErrors; return false; ";
+ }
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ } else {
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/items.js
+var require_items = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/items.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_items(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it.baseId;
+ out += "var " + $errs + " = errors;var " + $valid + ";";
+ if (Array.isArray($schema)) {
+ var $additionalItems = it.schema.additionalItems;
+ if ($additionalItems === false) {
+ out += " " + $valid + " = " + $data + ".length <= " + $schema.length + "; ";
+ var $currErrSchemaPath = $errSchemaPath;
+ $errSchemaPath = it.errSchemaPath + "/additionalItems";
+ out += " if (!" + $valid + ") { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'additionalItems' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schema.length + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should NOT have more than " + $schema.length + " items' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: false , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } ";
+ $errSchemaPath = $currErrSchemaPath;
+ if ($breakOnError) {
+ $closingBraces += "}";
+ out += " else { ";
+ }
+ }
+ var arr1 = $schema;
+ if (arr1) {
+ var $sch, $i = -1, l1 = arr1.length - 1;
+ while ($i < l1) {
+ $sch = arr1[$i += 1];
+ if (it.opts.strictKeywords ? typeof $sch == "object" && Object.keys($sch).length > 0 || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)) {
+ out += " " + $nextValid + " = true; if (" + $data + ".length > " + $i + ") { ";
+ var $passData = $data + "[" + $i + "]";
+ $it.schema = $sch;
+ $it.schemaPath = $schemaPath + "[" + $i + "]";
+ $it.errSchemaPath = $errSchemaPath + "/" + $i;
+ $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
+ $it.dataPathArr[$dataNxt] = $i;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ $closingBraces += "}";
+ }
+ }
+ }
+ }
+ if (typeof $additionalItems == "object" && (it.opts.strictKeywords ? typeof $additionalItems == "object" && Object.keys($additionalItems).length > 0 || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {
+ $it.schema = $additionalItems;
+ $it.schemaPath = it.schemaPath + ".additionalItems";
+ $it.errSchemaPath = it.errSchemaPath + "/additionalItems";
+ out += " " + $nextValid + " = true; if (" + $data + ".length > " + $schema.length + ") { for (var " + $idx + " = " + $schema.length + "; " + $idx + " < " + $data + ".length; " + $idx + "++) { ";
+ $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
+ var $passData = $data + "[" + $idx + "]";
+ $it.dataPathArr[$dataNxt] = $idx;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ if ($breakOnError) {
+ out += " if (!" + $nextValid + ") break; ";
+ }
+ out += " } } ";
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ $closingBraces += "}";
+ }
+ }
+ } else if (it.opts.strictKeywords ? typeof $schema == "object" && Object.keys($schema).length > 0 || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)) {
+ $it.schema = $schema;
+ $it.schemaPath = $schemaPath;
+ $it.errSchemaPath = $errSchemaPath;
+ out += " for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { ";
+ $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
+ var $passData = $data + "[" + $idx + "]";
+ $it.dataPathArr[$dataNxt] = $idx;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ if ($breakOnError) {
+ out += " if (!" + $nextValid + ") break; ";
+ }
+ out += " }";
+ }
+ if ($breakOnError) {
+ out += " " + $closingBraces + " if (" + $errs + " == errors) {";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limit.js
+var require_limit = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limit.js"(exports, module) {
+ "use strict";
+ module.exports = function generate__limit(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $errorKeyword;
+ var $data = "data" + ($dataLvl || "");
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ var $isMax = $keyword == "maximum", $exclusiveKeyword = $isMax ? "exclusiveMaximum" : "exclusiveMinimum", $schemaExcl = it.schema[$exclusiveKeyword], $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? "<" : ">", $notOp = $isMax ? ">" : "<", $errorKeyword = void 0;
+ if (!($isData || typeof $schema == "number" || $schema === void 0)) {
+ throw new Error($keyword + " must be number");
+ }
+ if (!($isDataExcl || $schemaExcl === void 0 || typeof $schemaExcl == "number" || typeof $schemaExcl == "boolean")) {
+ throw new Error($exclusiveKeyword + " must be number or boolean");
+ }
+ if ($isDataExcl) {
+ var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), $exclusive = "exclusive" + $lvl, $exclType = "exclType" + $lvl, $exclIsNumber = "exclIsNumber" + $lvl, $opExpr = "op" + $lvl, $opStr = "' + " + $opExpr + " + '";
+ out += " var schemaExcl" + $lvl + " = " + $schemaValueExcl + "; ";
+ $schemaValueExcl = "schemaExcl" + $lvl;
+ out += " var " + $exclusive + "; var " + $exclType + " = typeof " + $schemaValueExcl + "; if (" + $exclType + " != 'boolean' && " + $exclType + " != 'undefined' && " + $exclType + " != 'number') { ";
+ var $errorKeyword = $exclusiveKeyword;
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "_exclusiveLimit") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ";
+ if (it.opts.messages !== false) {
+ out += " , message: '" + $exclusiveKeyword + " should be boolean' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } else if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || ";
+ }
+ out += " " + $exclType + " == 'number' ? ( (" + $exclusive + " = " + $schemaValue + " === undefined || " + $schemaValueExcl + " " + $op + "= " + $schemaValue + ") ? " + $data + " " + $notOp + "= " + $schemaValueExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) : ( (" + $exclusive + " = " + $schemaValueExcl + " === true) ? " + $data + " " + $notOp + "= " + $schemaValue + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { var op" + $lvl + " = " + $exclusive + " ? '" + $op + "' : '" + $op + "='; ";
+ if ($schema === void 0) {
+ $errorKeyword = $exclusiveKeyword;
+ $errSchemaPath = it.errSchemaPath + "/" + $exclusiveKeyword;
+ $schemaValue = $schemaValueExcl;
+ $isData = $isDataExcl;
+ }
+ } else {
+ var $exclIsNumber = typeof $schemaExcl == "number", $opStr = $op;
+ if ($exclIsNumber && $isData) {
+ var $opExpr = "'" + $opStr + "'";
+ out += " if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || ";
+ }
+ out += " ( " + $schemaValue + " === undefined || " + $schemaExcl + " " + $op + "= " + $schemaValue + " ? " + $data + " " + $notOp + "= " + $schemaExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { ";
+ } else {
+ if ($exclIsNumber && $schema === void 0) {
+ $exclusive = true;
+ $errorKeyword = $exclusiveKeyword;
+ $errSchemaPath = it.errSchemaPath + "/" + $exclusiveKeyword;
+ $schemaValue = $schemaExcl;
+ $notOp += "=";
+ } else {
+ if ($exclIsNumber) $schemaValue = Math[$isMax ? "min" : "max"]($schemaExcl, $schema);
+ if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {
+ $exclusive = true;
+ $errorKeyword = $exclusiveKeyword;
+ $errSchemaPath = it.errSchemaPath + "/" + $exclusiveKeyword;
+ $notOp += "=";
+ } else {
+ $exclusive = false;
+ $opStr += "=";
+ }
+ }
+ var $opExpr = "'" + $opStr + "'";
+ out += " if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || ";
+ }
+ out += " " + $data + " " + $notOp + " " + $schemaValue + " || " + $data + " !== " + $data + ") { ";
+ }
+ }
+ $errorKeyword = $errorKeyword || $keyword;
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "_limit") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { comparison: " + $opExpr + ", limit: " + $schemaValue + ", exclusive: " + $exclusive + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should be " + $opStr + " ";
+ if ($isData) {
+ out += "' + " + $schemaValue;
+ } else {
+ out += "" + $schemaValue + "'";
+ }
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + $schema;
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitItems.js
+var require_limitItems = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitItems.js"(exports, module) {
+ "use strict";
+ module.exports = function generate__limitItems(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $errorKeyword;
+ var $data = "data" + ($dataLvl || "");
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ if (!($isData || typeof $schema == "number")) {
+ throw new Error($keyword + " must be number");
+ }
+ var $op = $keyword == "maxItems" ? ">" : "<";
+ out += "if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || ";
+ }
+ out += " " + $data + ".length " + $op + " " + $schemaValue + ") { ";
+ var $errorKeyword = $keyword;
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "_limitItems") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should NOT have ";
+ if ($keyword == "maxItems") {
+ out += "more";
+ } else {
+ out += "fewer";
+ }
+ out += " than ";
+ if ($isData) {
+ out += "' + " + $schemaValue + " + '";
+ } else {
+ out += "" + $schema;
+ }
+ out += " items' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + $schema;
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += "} ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitLength.js
+var require_limitLength = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitLength.js"(exports, module) {
+ "use strict";
+ module.exports = function generate__limitLength(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $errorKeyword;
+ var $data = "data" + ($dataLvl || "");
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ if (!($isData || typeof $schema == "number")) {
+ throw new Error($keyword + " must be number");
+ }
+ var $op = $keyword == "maxLength" ? ">" : "<";
+ out += "if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || ";
+ }
+ if (it.opts.unicode === false) {
+ out += " " + $data + ".length ";
+ } else {
+ out += " ucs2length(" + $data + ") ";
+ }
+ out += " " + $op + " " + $schemaValue + ") { ";
+ var $errorKeyword = $keyword;
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "_limitLength") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should NOT be ";
+ if ($keyword == "maxLength") {
+ out += "longer";
+ } else {
+ out += "shorter";
+ }
+ out += " than ";
+ if ($isData) {
+ out += "' + " + $schemaValue + " + '";
+ } else {
+ out += "" + $schema;
+ }
+ out += " characters' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + $schema;
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += "} ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitProperties.js
+var require_limitProperties = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitProperties.js"(exports, module) {
+ "use strict";
+ module.exports = function generate__limitProperties(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $errorKeyword;
+ var $data = "data" + ($dataLvl || "");
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ if (!($isData || typeof $schema == "number")) {
+ throw new Error($keyword + " must be number");
+ }
+ var $op = $keyword == "maxProperties" ? ">" : "<";
+ out += "if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || ";
+ }
+ out += " Object.keys(" + $data + ").length " + $op + " " + $schemaValue + ") { ";
+ var $errorKeyword = $keyword;
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "_limitProperties") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should NOT have ";
+ if ($keyword == "maxProperties") {
+ out += "more";
+ } else {
+ out += "fewer";
+ }
+ out += " than ";
+ if ($isData) {
+ out += "' + " + $schemaValue + " + '";
+ } else {
+ out += "" + $schema;
+ }
+ out += " properties' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + $schema;
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += "} ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/multipleOf.js
+var require_multipleOf = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/multipleOf.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_multipleOf(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ if (!($isData || typeof $schema == "number")) {
+ throw new Error($keyword + " must be number");
+ }
+ out += "var division" + $lvl + ";if (";
+ if ($isData) {
+ out += " " + $schemaValue + " !== undefined && ( typeof " + $schemaValue + " != 'number' || ";
+ }
+ out += " (division" + $lvl + " = " + $data + " / " + $schemaValue + ", ";
+ if (it.opts.multipleOfPrecision) {
+ out += " Math.abs(Math.round(division" + $lvl + ") - division" + $lvl + ") > 1e-" + it.opts.multipleOfPrecision + " ";
+ } else {
+ out += " division" + $lvl + " !== parseInt(division" + $lvl + ") ";
+ }
+ out += " ) ";
+ if ($isData) {
+ out += " ) ";
+ }
+ out += " ) { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'multipleOf' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { multipleOf: " + $schemaValue + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should be multiple of ";
+ if ($isData) {
+ out += "' + " + $schemaValue;
+ } else {
+ out += "" + $schemaValue + "'";
+ }
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + $schema;
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += "} ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/not.js
+var require_not = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/not.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_not(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ if (it.opts.strictKeywords ? typeof $schema == "object" && Object.keys($schema).length > 0 || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)) {
+ $it.schema = $schema;
+ $it.schemaPath = $schemaPath;
+ $it.errSchemaPath = $errSchemaPath;
+ out += " var " + $errs + " = errors; ";
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ $it.createErrors = false;
+ var $allErrorsOption;
+ if ($it.opts.allErrors) {
+ $allErrorsOption = $it.opts.allErrors;
+ $it.opts.allErrors = false;
+ }
+ out += " " + it.validate($it) + " ";
+ $it.createErrors = true;
+ if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ out += " if (" + $nextValid + ") { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should NOT be valid' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } ";
+ if (it.opts.allErrors) {
+ out += " } ";
+ }
+ } else {
+ out += " var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: {} ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should NOT be valid' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ if ($breakOnError) {
+ out += " if (false) { ";
+ }
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/oneOf.js
+var require_oneOf = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/oneOf.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_oneOf(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $currentBaseId = $it.baseId, $prevValid = "prevValid" + $lvl, $passingSchemas = "passingSchemas" + $lvl;
+ out += "var " + $errs + " = errors , " + $prevValid + " = false , " + $valid + " = false , " + $passingSchemas + " = null; ";
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ var arr1 = $schema;
+ if (arr1) {
+ var $sch, $i = -1, l1 = arr1.length - 1;
+ while ($i < l1) {
+ $sch = arr1[$i += 1];
+ if (it.opts.strictKeywords ? typeof $sch == "object" && Object.keys($sch).length > 0 || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)) {
+ $it.schema = $sch;
+ $it.schemaPath = $schemaPath + "[" + $i + "]";
+ $it.errSchemaPath = $errSchemaPath + "/" + $i;
+ out += " " + it.validate($it) + " ";
+ $it.baseId = $currentBaseId;
+ } else {
+ out += " var " + $nextValid + " = true; ";
+ }
+ if ($i) {
+ out += " if (" + $nextValid + " && " + $prevValid + ") { " + $valid + " = false; " + $passingSchemas + " = [" + $passingSchemas + ", " + $i + "]; } else { ";
+ $closingBraces += "}";
+ }
+ out += " if (" + $nextValid + ") { " + $valid + " = " + $prevValid + " = true; " + $passingSchemas + " = " + $i + "; }";
+ }
+ }
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ out += "" + $closingBraces + "if (!" + $valid + ") { var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'oneOf' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { passingSchemas: " + $passingSchemas + " } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should match exactly one schema in oneOf' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError(vErrors); ";
+ } else {
+ out += " validate.errors = vErrors; return false; ";
+ }
+ }
+ out += "} else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; }";
+ if (it.opts.allErrors) {
+ out += " } ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/pattern.js
+var require_pattern = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/pattern.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_pattern(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ var $regexp = $isData ? "(new RegExp(" + $schemaValue + "))" : it.usePattern($schema);
+ out += "if ( ";
+ if ($isData) {
+ out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || ";
+ }
+ out += " !" + $regexp + ".test(" + $data + ") ) { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'pattern' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { pattern: ";
+ if ($isData) {
+ out += "" + $schemaValue;
+ } else {
+ out += "" + it.util.toQuotedString($schema);
+ }
+ out += " } ";
+ if (it.opts.messages !== false) {
+ out += ` , message: 'should match pattern "`;
+ if ($isData) {
+ out += "' + " + $schemaValue + " + '";
+ } else {
+ out += "" + it.util.escapeQuotes($schema);
+ }
+ out += `"' `;
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + it.util.toQuotedString($schema);
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += "} ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/properties.js
+var require_properties = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/properties.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_properties(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ var $key = "key" + $lvl, $idx = "idx" + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = "data" + $dataNxt, $dataProperties = "dataProperties" + $lvl;
+ var $schemaKeys = Object.keys($schema || {}).filter(notProto), $pProperties = it.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties).filter(notProto), $aProperties = it.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, $additionalIsSchema = typeof $aProperties == "object" && Object.keys($aProperties).length, $removeAdditional = it.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId;
+ var $required = it.schema.required;
+ if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
+ var $requiredHash = it.util.toHash($required);
+ }
+ function notProto(p) {
+ return p !== "__proto__";
+ }
+ out += "var " + $errs + " = errors;var " + $nextValid + " = true;";
+ if ($ownProperties) {
+ out += " var " + $dataProperties + " = undefined;";
+ }
+ if ($checkAdditional) {
+ if ($ownProperties) {
+ out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; ";
+ } else {
+ out += " for (var " + $key + " in " + $data + ") { ";
+ }
+ if ($someProperties) {
+ out += " var isAdditional" + $lvl + " = !(false ";
+ if ($schemaKeys.length) {
+ if ($schemaKeys.length > 8) {
+ out += " || validate.schema" + $schemaPath + ".hasOwnProperty(" + $key + ") ";
+ } else {
+ var arr1 = $schemaKeys;
+ if (arr1) {
+ var $propertyKey, i1 = -1, l1 = arr1.length - 1;
+ while (i1 < l1) {
+ $propertyKey = arr1[i1 += 1];
+ out += " || " + $key + " == " + it.util.toQuotedString($propertyKey) + " ";
+ }
+ }
+ }
+ }
+ if ($pPropertyKeys.length) {
+ var arr2 = $pPropertyKeys;
+ if (arr2) {
+ var $pProperty, $i = -1, l2 = arr2.length - 1;
+ while ($i < l2) {
+ $pProperty = arr2[$i += 1];
+ out += " || " + it.usePattern($pProperty) + ".test(" + $key + ") ";
+ }
+ }
+ }
+ out += " ); if (isAdditional" + $lvl + ") { ";
+ }
+ if ($removeAdditional == "all") {
+ out += " delete " + $data + "[" + $key + "]; ";
+ } else {
+ var $currentErrorPath = it.errorPath;
+ var $additionalProperty = "' + " + $key + " + '";
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+ }
+ if ($noAdditional) {
+ if ($removeAdditional) {
+ out += " delete " + $data + "[" + $key + "]; ";
+ } else {
+ out += " " + $nextValid + " = false; ";
+ var $currErrSchemaPath = $errSchemaPath;
+ $errSchemaPath = it.errSchemaPath + "/additionalProperties";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'additionalProperties' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { additionalProperty: '" + $additionalProperty + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: '";
+ if (it.opts._errorDataPathProperty) {
+ out += "is an invalid additional property";
+ } else {
+ out += "should NOT have additional properties";
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: false , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ $errSchemaPath = $currErrSchemaPath;
+ if ($breakOnError) {
+ out += " break; ";
+ }
+ }
+ } else if ($additionalIsSchema) {
+ if ($removeAdditional == "failing") {
+ out += " var " + $errs + " = errors; ";
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ $it.schema = $aProperties;
+ $it.schemaPath = it.schemaPath + ".additionalProperties";
+ $it.errSchemaPath = it.errSchemaPath + "/additionalProperties";
+ $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+ var $passData = $data + "[" + $key + "]";
+ $it.dataPathArr[$dataNxt] = $key;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ out += " if (!" + $nextValid + ") { errors = " + $errs + "; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete " + $data + "[" + $key + "]; } ";
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ } else {
+ $it.schema = $aProperties;
+ $it.schemaPath = it.schemaPath + ".additionalProperties";
+ $it.errSchemaPath = it.errSchemaPath + "/additionalProperties";
+ $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+ var $passData = $data + "[" + $key + "]";
+ $it.dataPathArr[$dataNxt] = $key;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ if ($breakOnError) {
+ out += " if (!" + $nextValid + ") break; ";
+ }
+ }
+ }
+ it.errorPath = $currentErrorPath;
+ }
+ if ($someProperties) {
+ out += " } ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ $closingBraces += "}";
+ }
+ }
+ var $useDefaults = it.opts.useDefaults && !it.compositeRule;
+ if ($schemaKeys.length) {
+ var arr3 = $schemaKeys;
+ if (arr3) {
+ var $propertyKey, i3 = -1, l3 = arr3.length - 1;
+ while (i3 < l3) {
+ $propertyKey = arr3[i3 += 1];
+ var $sch = $schema[$propertyKey];
+ if (it.opts.strictKeywords ? typeof $sch == "object" && Object.keys($sch).length > 0 || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)) {
+ var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== void 0;
+ $it.schema = $sch;
+ $it.schemaPath = $schemaPath + $prop;
+ $it.errSchemaPath = $errSchemaPath + "/" + it.util.escapeFragment($propertyKey);
+ $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
+ $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ $code = it.util.varReplace($code, $nextData, $passData);
+ var $useData = $passData;
+ } else {
+ var $useData = $nextData;
+ out += " var " + $nextData + " = " + $passData + "; ";
+ }
+ if ($hasDefault) {
+ out += " " + $code + " ";
+ } else {
+ if ($requiredHash && $requiredHash[$propertyKey]) {
+ out += " if ( " + $useData + " === undefined ";
+ if ($ownProperties) {
+ out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') ";
+ }
+ out += ") { " + $nextValid + " = false; ";
+ var $currentErrorPath = it.errorPath, $currErrSchemaPath = $errSchemaPath, $missingProperty = it.util.escapeQuotes($propertyKey);
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
+ }
+ $errSchemaPath = it.errSchemaPath + "/required";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: '";
+ if (it.opts._errorDataPathProperty) {
+ out += "is a required property";
+ } else {
+ out += "should have required property \\'" + $missingProperty + "\\'";
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ $errSchemaPath = $currErrSchemaPath;
+ it.errorPath = $currentErrorPath;
+ out += " } else { ";
+ } else {
+ if ($breakOnError) {
+ out += " if ( " + $useData + " === undefined ";
+ if ($ownProperties) {
+ out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') ";
+ }
+ out += ") { " + $nextValid + " = true; } else { ";
+ } else {
+ out += " if (" + $useData + " !== undefined ";
+ if ($ownProperties) {
+ out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') ";
+ }
+ out += " ) { ";
+ }
+ }
+ out += " " + $code + " } ";
+ }
+ }
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ $closingBraces += "}";
+ }
+ }
+ }
+ }
+ if ($pPropertyKeys.length) {
+ var arr4 = $pPropertyKeys;
+ if (arr4) {
+ var $pProperty, i4 = -1, l4 = arr4.length - 1;
+ while (i4 < l4) {
+ $pProperty = arr4[i4 += 1];
+ var $sch = $pProperties[$pProperty];
+ if (it.opts.strictKeywords ? typeof $sch == "object" && Object.keys($sch).length > 0 || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)) {
+ $it.schema = $sch;
+ $it.schemaPath = it.schemaPath + ".patternProperties" + it.util.getProperty($pProperty);
+ $it.errSchemaPath = it.errSchemaPath + "/patternProperties/" + it.util.escapeFragment($pProperty);
+ if ($ownProperties) {
+ out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; ";
+ } else {
+ out += " for (var " + $key + " in " + $data + ") { ";
+ }
+ out += " if (" + it.usePattern($pProperty) + ".test(" + $key + ")) { ";
+ $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+ var $passData = $data + "[" + $key + "]";
+ $it.dataPathArr[$dataNxt] = $key;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ if ($breakOnError) {
+ out += " if (!" + $nextValid + ") break; ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " else " + $nextValid + " = true; ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " if (" + $nextValid + ") { ";
+ $closingBraces += "}";
+ }
+ }
+ }
+ }
+ }
+ if ($breakOnError) {
+ out += " " + $closingBraces + " if (" + $errs + " == errors) {";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/propertyNames.js
+var require_propertyNames = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/propertyNames.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_propertyNames(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $errs = "errs__" + $lvl;
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ out += "var " + $errs + " = errors;";
+ if (it.opts.strictKeywords ? typeof $schema == "object" && Object.keys($schema).length > 0 || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)) {
+ $it.schema = $schema;
+ $it.schemaPath = $schemaPath;
+ $it.errSchemaPath = $errSchemaPath;
+ var $key = "key" + $lvl, $idx = "idx" + $lvl, $i = "i" + $lvl, $invalidName = "' + " + $key + " + '", $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = "data" + $dataNxt, $dataProperties = "dataProperties" + $lvl, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId;
+ if ($ownProperties) {
+ out += " var " + $dataProperties + " = undefined; ";
+ }
+ if ($ownProperties) {
+ out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; ";
+ } else {
+ out += " for (var " + $key + " in " + $data + ") { ";
+ }
+ out += " var startErrs" + $lvl + " = errors; ";
+ var $passData = $key;
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ var $code = it.validate($it);
+ $it.baseId = $currentBaseId;
+ if (it.util.varOccurences($code, $nextData) < 2) {
+ out += " " + it.util.varReplace($code, $nextData, $passData) + " ";
+ } else {
+ out += " var " + $nextData + " = " + $passData + "; " + $code + " ";
+ }
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ out += " if (!" + $nextValid + ") { for (var " + $i + "=startErrs" + $lvl + "; " + $i + " 0 || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
+ $required[$required.length] = $property;
+ }
+ }
+ }
+ } else {
+ var $required = $schema;
+ }
+ }
+ if ($isData || $required.length) {
+ var $currentErrorPath = it.errorPath, $loopRequired = $isData || $required.length >= it.opts.loopRequired, $ownProperties = it.opts.ownProperties;
+ if ($breakOnError) {
+ out += " var missing" + $lvl + "; ";
+ if ($loopRequired) {
+ if (!$isData) {
+ out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; ";
+ }
+ var $i = "i" + $lvl, $propertyPath = "schema" + $lvl + "[" + $i + "]", $missingProperty = "' + " + $propertyPath + " + '";
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
+ }
+ out += " var " + $valid + " = true; ";
+ if ($isData) {
+ out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {";
+ }
+ out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { " + $valid + " = " + $data + "[" + $vSchema + "[" + $i + "]] !== undefined ";
+ if ($ownProperties) {
+ out += " && Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) ";
+ }
+ out += "; if (!" + $valid + ") break; } ";
+ if ($isData) {
+ out += " } ";
+ }
+ out += " if (!" + $valid + ") { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: '";
+ if (it.opts._errorDataPathProperty) {
+ out += "is a required property";
+ } else {
+ out += "should have required property \\'" + $missingProperty + "\\'";
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } else { ";
+ } else {
+ out += " if ( ";
+ var arr2 = $required;
+ if (arr2) {
+ var $propertyKey, $i = -1, l2 = arr2.length - 1;
+ while ($i < l2) {
+ $propertyKey = arr2[$i += 1];
+ if ($i) {
+ out += " || ";
+ }
+ var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop;
+ out += " ( ( " + $useData + " === undefined ";
+ if ($ownProperties) {
+ out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') ";
+ }
+ out += ") && (missing" + $lvl + " = " + it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) + ") ) ";
+ }
+ }
+ out += ") { ";
+ var $propertyPath = "missing" + $lvl, $missingProperty = "' + " + $propertyPath + " + '";
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + " + " + $propertyPath;
+ }
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: '";
+ if (it.opts._errorDataPathProperty) {
+ out += "is a required property";
+ } else {
+ out += "should have required property \\'" + $missingProperty + "\\'";
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } else { ";
+ }
+ } else {
+ if ($loopRequired) {
+ if (!$isData) {
+ out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; ";
+ }
+ var $i = "i" + $lvl, $propertyPath = "schema" + $lvl + "[" + $i + "]", $missingProperty = "' + " + $propertyPath + " + '";
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
+ }
+ if ($isData) {
+ out += " if (" + $vSchema + " && !Array.isArray(" + $vSchema + ")) { var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: '";
+ if (it.opts._errorDataPathProperty) {
+ out += "is a required property";
+ } else {
+ out += "should have required property \\'" + $missingProperty + "\\'";
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (" + $vSchema + " !== undefined) { ";
+ }
+ out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { if (" + $data + "[" + $vSchema + "[" + $i + "]] === undefined ";
+ if ($ownProperties) {
+ out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) ";
+ }
+ out += ") { var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: '";
+ if (it.opts._errorDataPathProperty) {
+ out += "is a required property";
+ } else {
+ out += "should have required property \\'" + $missingProperty + "\\'";
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ";
+ if ($isData) {
+ out += " } ";
+ }
+ } else {
+ var arr3 = $required;
+ if (arr3) {
+ var $propertyKey, i3 = -1, l3 = arr3.length - 1;
+ while (i3 < l3) {
+ $propertyKey = arr3[i3 += 1];
+ var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop;
+ if (it.opts._errorDataPathProperty) {
+ it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
+ }
+ out += " if ( " + $useData + " === undefined ";
+ if ($ownProperties) {
+ out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it.util.escapeQuotes($propertyKey) + "') ";
+ }
+ out += ") { var err = ";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } ";
+ if (it.opts.messages !== false) {
+ out += " , message: '";
+ if (it.opts._errorDataPathProperty) {
+ out += "is a required property";
+ } else {
+ out += "should have required property \\'" + $missingProperty + "\\'";
+ }
+ out += "' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ";
+ }
+ }
+ }
+ }
+ it.errorPath = $currentErrorPath;
+ } else if ($breakOnError) {
+ out += " if (true) {";
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/uniqueItems.js
+var require_uniqueItems = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/uniqueItems.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_uniqueItems(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ if (($schema || $isData) && it.opts.uniqueItems !== false) {
+ if ($isData) {
+ out += " var " + $valid + "; if (" + $schemaValue + " === false || " + $schemaValue + " === undefined) " + $valid + " = true; else if (typeof " + $schemaValue + " != 'boolean') " + $valid + " = false; else { ";
+ }
+ out += " var i = " + $data + ".length , " + $valid + " = true , j; if (i > 1) { ";
+ var $itemType = it.schema.items && it.schema.items.type, $typeIsArray = Array.isArray($itemType);
+ if (!$itemType || $itemType == "object" || $itemType == "array" || $typeIsArray && ($itemType.indexOf("object") >= 0 || $itemType.indexOf("array") >= 0)) {
+ out += " outer: for (;i--;) { for (j = i; j--;) { if (equal(" + $data + "[i], " + $data + "[j])) { " + $valid + " = false; break outer; } } } ";
+ } else {
+ out += " var itemIndices = {}, item; for (;i--;) { var item = " + $data + "[i]; ";
+ var $method = "checkDataType" + ($typeIsArray ? "s" : "");
+ out += " if (" + it.util[$method]($itemType, "item", it.opts.strictNumbers, true) + ") continue; ";
+ if ($typeIsArray) {
+ out += ` if (typeof item == 'string') item = '"' + item; `;
+ }
+ out += " if (typeof itemIndices[item] == 'number') { " + $valid + " = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ";
+ }
+ out += " } ";
+ if ($isData) {
+ out += " } ";
+ }
+ out += " if (!" + $valid + ") { ";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: 'uniqueItems' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { i: i, j: j } ";
+ if (it.opts.messages !== false) {
+ out += " , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";
+ }
+ if (it.opts.verbose) {
+ out += " , schema: ";
+ if ($isData) {
+ out += "validate.schema" + $schemaPath;
+ } else {
+ out += "" + $schema;
+ }
+ out += " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ out += " } ";
+ if ($breakOnError) {
+ out += " else { ";
+ }
+ } else {
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
+ }
+ return out;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js
+var require_dotjs = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js"(exports, module) {
+ "use strict";
+ module.exports = {
+ "$ref": require_ref(),
+ allOf: require_allOf(),
+ anyOf: require_anyOf(),
+ "$comment": require_comment(),
+ const: require_const(),
+ contains: require_contains(),
+ dependencies: require_dependencies(),
+ "enum": require_enum(),
+ format: require_format(),
+ "if": require_if(),
+ items: require_items(),
+ maximum: require_limit(),
+ minimum: require_limit(),
+ maxItems: require_limitItems(),
+ minItems: require_limitItems(),
+ maxLength: require_limitLength(),
+ minLength: require_limitLength(),
+ maxProperties: require_limitProperties(),
+ minProperties: require_limitProperties(),
+ multipleOf: require_multipleOf(),
+ not: require_not(),
+ oneOf: require_oneOf(),
+ pattern: require_pattern(),
+ properties: require_properties(),
+ propertyNames: require_propertyNames(),
+ required: require_required(),
+ uniqueItems: require_uniqueItems(),
+ validate: require_validate()
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/rules.js
+var require_rules = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/rules.js"(exports, module) {
+ "use strict";
+ var ruleModules = require_dotjs();
+ var toHash = require_util().toHash;
+ module.exports = function rules() {
+ var RULES = [
+ {
+ type: "number",
+ rules: [
+ { "maximum": ["exclusiveMaximum"] },
+ { "minimum": ["exclusiveMinimum"] },
+ "multipleOf",
+ "format"
+ ]
+ },
+ {
+ type: "string",
+ rules: ["maxLength", "minLength", "pattern", "format"]
+ },
+ {
+ type: "array",
+ rules: ["maxItems", "minItems", "items", "contains", "uniqueItems"]
+ },
+ {
+ type: "object",
+ rules: [
+ "maxProperties",
+ "minProperties",
+ "required",
+ "dependencies",
+ "propertyNames",
+ { "properties": ["additionalProperties", "patternProperties"] }
+ ]
+ },
+ { rules: ["$ref", "const", "enum", "not", "anyOf", "oneOf", "allOf", "if"] }
+ ];
+ var ALL = ["type", "$comment"];
+ var KEYWORDS = [
+ "$schema",
+ "$id",
+ "id",
+ "$data",
+ "$async",
+ "title",
+ "description",
+ "default",
+ "definitions",
+ "examples",
+ "readOnly",
+ "writeOnly",
+ "contentMediaType",
+ "contentEncoding",
+ "additionalItems",
+ "then",
+ "else"
+ ];
+ var TYPES = ["number", "integer", "string", "array", "object", "boolean", "null"];
+ RULES.all = toHash(ALL);
+ RULES.types = toHash(TYPES);
+ RULES.forEach(function(group) {
+ group.rules = group.rules.map(function(keyword) {
+ var implKeywords;
+ if (typeof keyword == "object") {
+ var key = Object.keys(keyword)[0];
+ implKeywords = keyword[key];
+ keyword = key;
+ implKeywords.forEach(function(k) {
+ ALL.push(k);
+ RULES.all[k] = true;
+ });
+ }
+ ALL.push(keyword);
+ var rule = RULES.all[keyword] = {
+ keyword,
+ code: ruleModules[keyword],
+ implements: implKeywords
+ };
+ return rule;
+ });
+ RULES.all.$comment = {
+ keyword: "$comment",
+ code: ruleModules.$comment
+ };
+ if (group.type) RULES.types[group.type] = group;
+ });
+ RULES.keywords = toHash(ALL.concat(KEYWORDS));
+ RULES.custom = {};
+ return RULES;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/data.js
+var require_data = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/data.js"(exports, module) {
+ "use strict";
+ var KEYWORDS = [
+ "multipleOf",
+ "maximum",
+ "exclusiveMaximum",
+ "minimum",
+ "exclusiveMinimum",
+ "maxLength",
+ "minLength",
+ "pattern",
+ "additionalItems",
+ "maxItems",
+ "minItems",
+ "uniqueItems",
+ "maxProperties",
+ "minProperties",
+ "required",
+ "additionalProperties",
+ "enum",
+ "format",
+ "const"
+ ];
+ module.exports = function(metaSchema, keywordsJsonPointers) {
+ for (var i = 0; i < keywordsJsonPointers.length; i++) {
+ metaSchema = JSON.parse(JSON.stringify(metaSchema));
+ var segments = keywordsJsonPointers[i].split("/");
+ var keywords2 = metaSchema;
+ var j;
+ for (j = 1; j < segments.length; j++)
+ keywords2 = keywords2[segments[j]];
+ for (j = 0; j < KEYWORDS.length; j++) {
+ var key = KEYWORDS[j];
+ var schema2 = keywords2[key];
+ if (schema2) {
+ keywords2[key] = {
+ anyOf: [
+ schema2,
+ { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }
+ ]
+ };
+ }
+ }
+ }
+ return metaSchema;
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js
+var require_async = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js"(exports, module) {
+ "use strict";
+ var MissingRefError = require_error_classes().MissingRef;
+ module.exports = compileAsync;
+ function compileAsync(schema2, meta, callback) {
+ var self = this;
+ if (typeof this._opts.loadSchema != "function")
+ throw new Error("options.loadSchema should be a function");
+ if (typeof meta == "function") {
+ callback = meta;
+ meta = void 0;
+ }
+ var p = loadMetaSchemaOf(schema2).then(function() {
+ var schemaObj = self._addSchema(schema2, void 0, meta);
+ return schemaObj.validate || _compileAsync(schemaObj);
+ });
+ if (callback) {
+ p.then(
+ function(v) {
+ callback(null, v);
+ },
+ callback
+ );
+ }
+ return p;
+ function loadMetaSchemaOf(sch) {
+ var $schema = sch.$schema;
+ return $schema && !self.getSchema($schema) ? compileAsync.call(self, { $ref: $schema }, true) : Promise.resolve();
+ }
+ function _compileAsync(schemaObj) {
+ try {
+ return self._compile(schemaObj);
+ } catch (e) {
+ if (e instanceof MissingRefError) return loadMissingSchema(e);
+ throw e;
+ }
+ function loadMissingSchema(e) {
+ var ref = e.missingSchema;
+ if (added(ref)) throw new Error("Schema " + ref + " is loaded but " + e.missingRef + " cannot be resolved");
+ var schemaPromise = self._loadingSchemas[ref];
+ if (!schemaPromise) {
+ schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);
+ schemaPromise.then(removePromise, removePromise);
+ }
+ return schemaPromise.then(function(sch) {
+ if (!added(ref)) {
+ return loadMetaSchemaOf(sch).then(function() {
+ if (!added(ref)) self.addSchema(sch, ref, void 0, meta);
+ });
+ }
+ }).then(function() {
+ return _compileAsync(schemaObj);
+ });
+ function removePromise() {
+ delete self._loadingSchemas[ref];
+ }
+ function added(ref2) {
+ return self._refs[ref2] || self._schemas[ref2];
+ }
+ }
+ }
+ }
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js
+var require_custom = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js"(exports, module) {
+ "use strict";
+ module.exports = function generate_custom(it, $keyword, $ruleType) {
+ var out = " ";
+ var $lvl = it.level;
+ var $dataLvl = it.dataLevel;
+ var $schema = it.schema[$keyword];
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+ var $errSchemaPath = it.errSchemaPath + "/" + $keyword;
+ var $breakOnError = !it.opts.allErrors;
+ var $errorKeyword;
+ var $data = "data" + ($dataLvl || "");
+ var $valid = "valid" + $lvl;
+ var $errs = "errs__" + $lvl;
+ var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue;
+ if ($isData) {
+ out += " var schema" + $lvl + " = " + it.util.getData($schema.$data, $dataLvl, it.dataPathArr) + "; ";
+ $schemaValue = "schema" + $lvl;
+ } else {
+ $schemaValue = $schema;
+ }
+ var $rule = this, $definition = "definition" + $lvl, $rDef = $rule.definition, $closingBraces = "";
+ var $compile, $inline, $macro, $ruleValidate, $validateCode;
+ if ($isData && $rDef.$data) {
+ $validateCode = "keywordValidate" + $lvl;
+ var $validateSchema = $rDef.validateSchema;
+ out += " var " + $definition + " = RULES.custom['" + $keyword + "'].definition; var " + $validateCode + " = " + $definition + ".validate;";
+ } else {
+ $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
+ if (!$ruleValidate) return;
+ $schemaValue = "validate.schema" + $schemaPath;
+ $validateCode = $ruleValidate.code;
+ $compile = $rDef.compile;
+ $inline = $rDef.inline;
+ $macro = $rDef.macro;
+ }
+ var $ruleErrs = $validateCode + ".errors", $i = "i" + $lvl, $ruleErr = "ruleErr" + $lvl, $asyncKeyword = $rDef.async;
+ if ($asyncKeyword && !it.async) throw new Error("async keyword in sync schema");
+ if (!($inline || $macro)) {
+ out += "" + $ruleErrs + " = null;";
+ }
+ out += "var " + $errs + " = errors;var " + $valid + ";";
+ if ($isData && $rDef.$data) {
+ $closingBraces += "}";
+ out += " if (" + $schemaValue + " === undefined) { " + $valid + " = true; } else { ";
+ if ($validateSchema) {
+ $closingBraces += "}";
+ out += " " + $valid + " = " + $definition + ".validateSchema(" + $schemaValue + "); if (" + $valid + ") { ";
+ }
+ }
+ if ($inline) {
+ if ($rDef.statements) {
+ out += " " + $ruleValidate.validate + " ";
+ } else {
+ out += " " + $valid + " = " + $ruleValidate.validate + "; ";
+ }
+ } else if ($macro) {
+ var $it = it.util.copy(it);
+ var $closingBraces = "";
+ $it.level++;
+ var $nextValid = "valid" + $it.level;
+ $it.schema = $ruleValidate.validate;
+ $it.schemaPath = "";
+ var $wasComposite = it.compositeRule;
+ it.compositeRule = $it.compositeRule = true;
+ var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
+ it.compositeRule = $it.compositeRule = $wasComposite;
+ out += " " + $code;
+ } else {
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ out += " " + $validateCode + ".call( ";
+ if (it.opts.passContext) {
+ out += "this";
+ } else {
+ out += "self";
+ }
+ if ($compile || $rDef.schema === false) {
+ out += " , " + $data + " ";
+ } else {
+ out += " , " + $schemaValue + " , " + $data + " , validate.schema" + it.schemaPath + " ";
+ }
+ out += " , (dataPath || '')";
+ if (it.errorPath != '""') {
+ out += " + " + it.errorPath;
+ }
+ var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : "parentDataProperty";
+ out += " , " + $parentData + " , " + $parentDataProperty + " , rootData ) ";
+ var def_callRuleValidate = out;
+ out = $$outStack.pop();
+ if ($rDef.errors === false) {
+ out += " " + $valid + " = ";
+ if ($asyncKeyword) {
+ out += "await ";
+ }
+ out += "" + def_callRuleValidate + "; ";
+ } else {
+ if ($asyncKeyword) {
+ $ruleErrs = "customErrors" + $lvl;
+ out += " var " + $ruleErrs + " = null; try { " + $valid + " = await " + def_callRuleValidate + "; } catch (e) { " + $valid + " = false; if (e instanceof ValidationError) " + $ruleErrs + " = e.errors; else throw e; } ";
+ } else {
+ out += " " + $ruleErrs + " = null; " + $valid + " = " + def_callRuleValidate + "; ";
+ }
+ }
+ }
+ if ($rDef.modifying) {
+ out += " if (" + $parentData + ") " + $data + " = " + $parentData + "[" + $parentDataProperty + "];";
+ }
+ out += "" + $closingBraces;
+ if ($rDef.valid) {
+ if ($breakOnError) {
+ out += " if (true) { ";
+ }
+ } else {
+ out += " if ( ";
+ if ($rDef.valid === void 0) {
+ out += " !";
+ if ($macro) {
+ out += "" + $nextValid;
+ } else {
+ out += "" + $valid;
+ }
+ } else {
+ out += " " + !$rDef.valid + " ";
+ }
+ out += ") { ";
+ $errorKeyword = $rule.keyword;
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ var $$outStack = $$outStack || [];
+ $$outStack.push(out);
+ out = "";
+ if (it.createErrors !== false) {
+ out += " { keyword: '" + ($errorKeyword || "custom") + "' , dataPath: (dataPath || '') + " + it.errorPath + " , schemaPath: " + it.util.toQuotedString($errSchemaPath) + " , params: { keyword: '" + $rule.keyword + "' } ";
+ if (it.opts.messages !== false) {
+ out += ` , message: 'should pass "` + $rule.keyword + `" keyword validation' `;
+ }
+ if (it.opts.verbose) {
+ out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it.schemaPath + " , data: " + $data + " ";
+ }
+ out += " } ";
+ } else {
+ out += " {} ";
+ }
+ var __err = out;
+ out = $$outStack.pop();
+ if (!it.compositeRule && $breakOnError) {
+ if (it.async) {
+ out += " throw new ValidationError([" + __err + "]); ";
+ } else {
+ out += " validate.errors = [" + __err + "]; return false; ";
+ }
+ } else {
+ out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
+ }
+ var def_customError = out;
+ out = $$outStack.pop();
+ if ($inline) {
+ if ($rDef.errors) {
+ if ($rDef.errors != "full") {
+ out += " for (var " + $i + "=" + $errs + "; " + $i + " this.addVocabulary(v));
- if (this.opts.discriminator)
- this.addKeyword(discriminator_1.default);
- }
- _addDefaultMetaSchema() {
- super._addDefaultMetaSchema();
- if (!this.opts.meta)
- return;
- const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema;
- this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
- this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
- }
- defaultMeta() {
- return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
- }
- };
- exports.Ajv = Ajv2;
- module.exports = exports = Ajv2;
- module.exports.Ajv = Ajv2;
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.default = Ajv2;
- var validate_1 = require_validate();
- Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
- return validate_1.KeywordCxt;
- } });
- var codegen_1 = require_codegen();
- Object.defineProperty(exports, "_", { enumerable: true, get: function() {
- return codegen_1._;
- } });
- Object.defineProperty(exports, "str", { enumerable: true, get: function() {
- return codegen_1.str;
- } });
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
- return codegen_1.stringify;
- } });
- Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
- return codegen_1.nil;
- } });
- Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
- return codegen_1.Name;
- } });
- Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
- return codegen_1.CodeGen;
- } });
- var validation_error_1 = require_validation_error();
- Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() {
- return validation_error_1.default;
- } });
- var ref_error_1 = require_ref_error();
- Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() {
- return ref_error_1.default;
- } });
- }
-});
-
-// ../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/formats.js
-var require_formats = __commonJS({
- "../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/formats.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
- function fmtDef(validate2, compare) {
- return { validate: validate2, compare };
- }
- exports.fullFormats = {
- // date: http://tools.ietf.org/html/rfc3339#section-5.6
- date: fmtDef(date2, compareDate),
- // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
- time: fmtDef(getTime(true), compareTime),
- "date-time": fmtDef(getDateTime(true), compareDateTime),
- "iso-time": fmtDef(getTime(), compareIsoTime),
- "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
- // duration: https://tools.ietf.org/html/rfc3339#appendix-A
- duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
- uri,
- "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,
- // uri-template: https://tools.ietf.org/html/rfc6570
- "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,
- // For the source: https://gist.github.com/dperini/729294
- // For test cases: https://mathiasbynens.be/demo/url-regex
- 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,
- 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,
- 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,
- // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
- 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)$/,
- 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,
- regex: regex3,
- // uuid: http://tools.ietf.org/html/rfc4122
- uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
- // JSON-pointer: https://tools.ietf.org/html/rfc6901
- // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
- "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
- "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
- // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
- "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
- // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
- // byte: https://github.com/miguelmota/is-base64
- byte,
- // signed 32 bit integer
- int32: { type: "number", validate: validateInt32 },
- // signed 64 bit integer
- int64: { type: "number", validate: validateInt64 },
- // C-type float
- float: { type: "number", validate: validateNumber },
- // C-type double
- double: { type: "number", validate: validateNumber },
- // hint to the UI to hide input strings
- password: true,
- // unchecked string payload
- binary: true
- };
- exports.fastFormats = {
- ...exports.fullFormats,
- date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
- time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
- "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),
- "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
- "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),
- // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
- uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
- "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
- // email (sources from jsen validator):
- // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
- // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
- 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
- };
- exports.formatNames = Object.keys(exports.fullFormats);
- function isLeapYear(year) {
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
- }
- var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
- var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- function date2(str) {
- const matches = DATE.exec(str);
- if (!matches)
- return false;
- const year = +matches[1];
- const month = +matches[2];
- const day = +matches[3];
- return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
- }
- function compareDate(d1, d2) {
- if (!(d1 && d2))
- return void 0;
- if (d1 > d2)
- return 1;
- if (d1 < d2)
- return -1;
- return 0;
- }
- var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
- function getTime(strictTimeZone) {
- return function time2(str) {
- const matches = TIME.exec(str);
- if (!matches)
- return false;
- const hr = +matches[1];
- const min = +matches[2];
- const sec = +matches[3];
- const tz = matches[4];
- const tzSign = matches[5] === "-" ? -1 : 1;
- const tzH = +(matches[6] || 0);
- const tzM = +(matches[7] || 0);
- if (tzH > 23 || tzM > 59 || strictTimeZone && !tz)
- return false;
- if (hr <= 23 && min <= 59 && sec < 60)
- return true;
- const utcMin = min - tzM * tzSign;
- const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
- return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
- };
- }
- function compareTime(s1, s2) {
- if (!(s1 && s2))
- return void 0;
- const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf();
- const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf();
- if (!(t1 && t2))
- return void 0;
- return t1 - t2;
- }
- function compareIsoTime(t1, t2) {
- if (!(t1 && t2))
- return void 0;
- const a1 = TIME.exec(t1);
- const a2 = TIME.exec(t2);
- if (!(a1 && a2))
- return void 0;
- t1 = a1[1] + a1[2] + a1[3];
- t2 = a2[1] + a2[2] + a2[3];
- if (t1 > t2)
- return 1;
- if (t1 < t2)
- return -1;
- return 0;
- }
- var DATE_TIME_SEPARATOR = /t|\s/i;
- function getDateTime(strictTimeZone) {
- const time2 = getTime(strictTimeZone);
- return function date_time(str) {
- const dateTime = str.split(DATE_TIME_SEPARATOR);
- return dateTime.length === 2 && date2(dateTime[0]) && time2(dateTime[1]);
- };
- }
- function compareDateTime(dt1, dt2) {
- if (!(dt1 && dt2))
- return void 0;
- const d1 = new Date(dt1).valueOf();
- const d2 = new Date(dt2).valueOf();
- if (!(d1 && d2))
- return void 0;
- return d1 - d2;
- }
- function compareIsoDateTime(dt1, dt2) {
- if (!(dt1 && dt2))
- return void 0;
- const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
- const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
- const res = compareDate(d1, d2);
- if (res === void 0)
- return void 0;
- return res || compareTime(t1, t2);
- }
- var NOT_URI_FRAGMENT = /\/|:/;
- var 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;
- function uri(str) {
- return NOT_URI_FRAGMENT.test(str) && URI.test(str);
- }
- var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
- function byte(str) {
- BYTE.lastIndex = 0;
- return BYTE.test(str);
- }
- var MIN_INT32 = -(2 ** 31);
- var MAX_INT32 = 2 ** 31 - 1;
- function validateInt32(value2) {
- return Number.isInteger(value2) && value2 <= MAX_INT32 && value2 >= MIN_INT32;
- }
- function validateInt64(value2) {
- return Number.isInteger(value2);
- }
- function validateNumber() {
- return true;
- }
- var Z_ANCHOR = /[^\\]\\Z/;
- function regex3(str) {
- if (Z_ANCHOR.test(str))
- return false;
- try {
- new RegExp(str);
- return true;
- } catch (e) {
- return false;
- }
- }
- }
-});
-
-// ../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/limit.js
-var require_limit = __commonJS({
- "../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/limit.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.formatLimitDefinition = void 0;
- var ajv_1 = require_ajv();
- var codegen_1 = require_codegen();
- var ops = codegen_1.operators;
- var KWDs = {
- formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
- formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
- formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
- formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
- };
- var error41 = {
- message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`,
- params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
- };
- exports.formatLimitDefinition = {
- keyword: Object.keys(KWDs),
- type: "string",
- schemaType: "string",
- $data: true,
- error: error41,
- code(cxt) {
- const { gen, data, schemaCode, keyword, it } = cxt;
- const { opts, self } = it;
- if (!opts.validateFormats)
- return;
- const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, "format");
- if (fCxt.$data)
- validate$DataFormat();
- else
- validateFormat();
- function validate$DataFormat() {
- const fmts = gen.scopeValue("formats", {
- ref: self.formats,
- code: opts.code.formats
- });
- const fmt = gen.const("fmt", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`);
- cxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != "object"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
+ var metaSchema = require_json_schema_draft_07();
+ module.exports = {
+ $id: "https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",
+ definitions: {
+ simpleTypes: metaSchema.definitions.simpleTypes
+ },
+ type: "object",
+ dependencies: {
+ schema: ["validate"],
+ $data: ["validate"],
+ statements: ["inline"],
+ valid: { not: { required: ["macro"] } }
+ },
+ properties: {
+ type: metaSchema.properties.type,
+ schema: { type: "boolean" },
+ statements: { type: "boolean" },
+ dependencies: {
+ type: "array",
+ items: { type: "string" }
+ },
+ metaSchema: { type: "object" },
+ modifying: { type: "boolean" },
+ valid: { type: "boolean" },
+ $data: { type: "boolean" },
+ async: { type: "boolean" },
+ errors: {
+ anyOf: [
+ { type: "boolean" },
+ { const: "full" }
+ ]
}
- function validateFormat() {
- const format2 = fCxt.schema;
- const fmtDef = self.formats[format2];
- if (!fmtDef || fmtDef === true)
- return;
- if (typeof fmtDef != "object" || fmtDef instanceof RegExp || typeof fmtDef.compare != "function") {
- throw new Error(`"${keyword}": format "${format2}" does not define "compare" function`);
+ }
+ };
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/keyword.js
+var require_keyword = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/keyword.js"(exports, module) {
+ "use strict";
+ var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
+ var customRuleCode = require_custom();
+ var definitionSchema = require_definition_schema();
+ module.exports = {
+ add: addKeyword,
+ get: getKeyword,
+ remove: removeKeyword,
+ validate: validateKeyword
+ };
+ function addKeyword(keyword, definition) {
+ var RULES = this.RULES;
+ if (RULES.keywords[keyword])
+ throw new Error("Keyword " + keyword + " is already defined");
+ if (!IDENTIFIER.test(keyword))
+ throw new Error("Keyword " + keyword + " is not a valid identifier");
+ if (definition) {
+ this.validateKeyword(definition, true);
+ var dataType = definition.type;
+ if (Array.isArray(dataType)) {
+ for (var i = 0; i < dataType.length; i++)
+ _addRule(keyword, dataType[i], definition);
+ } else {
+ _addRule(keyword, dataType, definition);
+ }
+ var metaSchema = definition.metaSchema;
+ if (metaSchema) {
+ if (definition.$data && this._opts.$data) {
+ metaSchema = {
+ anyOf: [
+ metaSchema,
+ { "$ref": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }
+ ]
+ };
}
- const fmt = gen.scopeValue("formats", {
- key: format2,
- ref: fmtDef,
- code: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format2)}` : void 0
- });
- cxt.fail$data(compareCode(fmt));
+ definition.validateSchema = this.compile(metaSchema, true);
}
- function compareCode(fmt) {
- return (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
+ }
+ RULES.keywords[keyword] = RULES.all[keyword] = true;
+ function _addRule(keyword2, dataType2, definition2) {
+ var ruleGroup;
+ for (var i2 = 0; i2 < RULES.length; i2++) {
+ var rg = RULES[i2];
+ if (rg.type == dataType2) {
+ ruleGroup = rg;
+ break;
+ }
+ }
+ if (!ruleGroup) {
+ ruleGroup = { type: dataType2, rules: [] };
+ RULES.push(ruleGroup);
+ }
+ var rule = {
+ keyword: keyword2,
+ definition: definition2,
+ custom: true,
+ code: customRuleCode,
+ implements: definition2.implements
+ };
+ ruleGroup.rules.push(rule);
+ RULES.custom[keyword2] = rule;
+ }
+ return this;
+ }
+ function getKeyword(keyword) {
+ var rule = this.RULES.custom[keyword];
+ return rule ? rule.definition : this.RULES.keywords[keyword] || false;
+ }
+ function removeKeyword(keyword) {
+ var RULES = this.RULES;
+ delete RULES.keywords[keyword];
+ delete RULES.all[keyword];
+ delete RULES.custom[keyword];
+ for (var i = 0; i < RULES.length; i++) {
+ var rules = RULES[i].rules;
+ for (var j = 0; j < rules.length; j++) {
+ if (rules[j].keyword == keyword) {
+ rules.splice(j, 1);
+ break;
+ }
+ }
+ }
+ return this;
+ }
+ function validateKeyword(definition, throwError2) {
+ validateKeyword.errors = null;
+ var v = this._validateKeyword = this._validateKeyword || this.compile(definitionSchema, true);
+ if (v(definition)) return true;
+ validateKeyword.errors = v.errors;
+ if (throwError2)
+ throw new Error("custom keyword definition is invalid: " + this.errorsText(v.errors));
+ else
+ return false;
+ }
+ }
+});
+
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/data.json
+var require_data2 = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/data.json"(exports, module) {
+ module.exports = {
+ $schema: "http://json-schema.org/draft-07/schema#",
+ $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
+ description: "Meta-schema for $data reference (JSON Schema extension proposal)",
+ type: "object",
+ required: ["$data"],
+ properties: {
+ $data: {
+ type: "string",
+ anyOf: [
+ { format: "relative-json-pointer" },
+ { format: "json-pointer" }
+ ]
}
},
- dependencies: ["format"]
+ additionalProperties: false
};
- var formatLimitPlugin = (ajv) => {
- ajv.addKeyword(exports.formatLimitDefinition);
- return ajv;
- };
- exports.default = formatLimitPlugin;
}
});
-// ../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/index.js
-var require_dist = __commonJS({
- "../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/index.js"(exports, module) {
+// ../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/ajv.js
+var require_ajv = __commonJS({
+ "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/ajv.js"(exports, module) {
"use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var formats_1 = require_formats();
- var limit_1 = require_limit();
- var codegen_1 = require_codegen();
- var fullName = new codegen_1.Name("fullFormats");
- var fastName = new codegen_1.Name("fastFormats");
- var formatsPlugin = (ajv, opts = { keywords: true }) => {
- if (Array.isArray(opts)) {
- addFormats(ajv, opts, formats_1.fullFormats, fullName);
- return ajv;
- }
- const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
- const list = opts.formats || formats_1.formatNames;
- addFormats(ajv, list, formats, exportName);
- if (opts.keywords)
- (0, limit_1.default)(ajv);
- return ajv;
- };
- formatsPlugin.get = (name, mode = "full") => {
- const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
- const f = formats[name];
- if (!f)
- throw new Error(`Unknown format "${name}"`);
- return f;
- };
- function addFormats(ajv, list, fs, exportName) {
- var _a;
- var _b;
- (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
- for (const f of list)
- ajv.addFormat(f, fs[f]);
+ var compileSchema = require_compile();
+ var resolve = require_resolve();
+ var Cache = require_cache();
+ var SchemaObject = require_schema_obj();
+ var stableStringify = require_fast_json_stable_stringify();
+ var formats = require_formats();
+ var rules = require_rules();
+ var $dataMetaSchema = require_data();
+ var util2 = require_util();
+ module.exports = Ajv2;
+ Ajv2.prototype.validate = validate2;
+ Ajv2.prototype.compile = compile;
+ Ajv2.prototype.addSchema = addSchema;
+ Ajv2.prototype.addMetaSchema = addMetaSchema;
+ Ajv2.prototype.validateSchema = validateSchema;
+ Ajv2.prototype.getSchema = getSchema;
+ Ajv2.prototype.removeSchema = removeSchema;
+ Ajv2.prototype.addFormat = addFormat2;
+ Ajv2.prototype.errorsText = errorsText;
+ Ajv2.prototype._addSchema = _addSchema;
+ Ajv2.prototype._compile = _compile;
+ Ajv2.prototype.compileAsync = require_async();
+ var customKeyword = require_keyword();
+ Ajv2.prototype.addKeyword = customKeyword.add;
+ Ajv2.prototype.getKeyword = customKeyword.get;
+ Ajv2.prototype.removeKeyword = customKeyword.remove;
+ Ajv2.prototype.validateKeyword = customKeyword.validate;
+ var errorClasses = require_error_classes();
+ Ajv2.ValidationError = errorClasses.Validation;
+ Ajv2.MissingRefError = errorClasses.MissingRef;
+ Ajv2.$dataMetaSchema = $dataMetaSchema;
+ var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
+ var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes", "strictDefaults"];
+ var META_SUPPORT_DATA = ["/properties"];
+ function Ajv2(opts) {
+ if (!(this instanceof Ajv2)) return new Ajv2(opts);
+ opts = this._opts = util2.copy(opts) || {};
+ setLogger(this);
+ this._schemas = {};
+ this._refs = {};
+ this._fragments = {};
+ this._formats = formats(opts.format);
+ this._cache = opts.cache || new Cache();
+ this._loadingSchemas = {};
+ this._compilations = [];
+ this.RULES = rules();
+ this._getId = chooseGetId(opts);
+ opts.loopRequired = opts.loopRequired || Infinity;
+ if (opts.errorDataPath == "property") opts._errorDataPathProperty = true;
+ if (opts.serialize === void 0) opts.serialize = stableStringify;
+ this._metaOpts = getMetaSchemaOptions(this);
+ if (opts.formats) addInitialFormats(this);
+ if (opts.keywords) addInitialKeywords(this);
+ addDefaultMetaSchema(this);
+ if (typeof opts.meta == "object") this.addMetaSchema(opts.meta);
+ if (opts.nullable) this.addKeyword("nullable", { metaSchema: { type: "boolean" } });
+ addInitialSchemas(this);
+ }
+ function validate2(schemaKeyRef, data) {
+ var v;
+ if (typeof schemaKeyRef == "string") {
+ v = this.getSchema(schemaKeyRef);
+ if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
+ } else {
+ var schemaObj = this._addSchema(schemaKeyRef);
+ v = schemaObj.validate || this._compile(schemaObj);
+ }
+ var valid = v(data);
+ if (v.$async !== true) this.errors = v.errors;
+ return valid;
+ }
+ function compile(schema2, _meta) {
+ var schemaObj = this._addSchema(schema2, void 0, _meta);
+ return schemaObj.validate || this._compile(schemaObj);
+ }
+ function addSchema(schema2, key, _skipValidation, _meta) {
+ if (Array.isArray(schema2)) {
+ for (var i = 0; i < schema2.length; i++) this.addSchema(schema2[i], void 0, _skipValidation, _meta);
+ return this;
+ }
+ var id = this._getId(schema2);
+ if (id !== void 0 && typeof id != "string")
+ throw new Error("schema id must be string");
+ key = resolve.normalizeId(key || id);
+ checkUnique(this, key);
+ this._schemas[key] = this._addSchema(schema2, _skipValidation, _meta, true);
+ return this;
+ }
+ function addMetaSchema(schema2, key, skipValidation) {
+ this.addSchema(schema2, key, skipValidation, true);
+ return this;
+ }
+ function validateSchema(schema2, throwOrLogError) {
+ var $schema = schema2.$schema;
+ if ($schema !== void 0 && typeof $schema != "string")
+ throw new Error("$schema must be a string");
+ $schema = $schema || this._opts.defaultMeta || defaultMeta(this);
+ if (!$schema) {
+ this.logger.warn("meta-schema not available");
+ this.errors = null;
+ return true;
+ }
+ var valid = this.validate($schema, schema2);
+ if (!valid && throwOrLogError) {
+ var message = "schema is invalid: " + this.errorsText();
+ if (this._opts.validateSchema == "log") this.logger.error(message);
+ else throw new Error(message);
+ }
+ return valid;
+ }
+ function defaultMeta(self) {
+ var meta = self._opts.meta;
+ self._opts.defaultMeta = typeof meta == "object" ? self._getId(meta) || meta : self.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0;
+ return self._opts.defaultMeta;
+ }
+ function getSchema(keyRef) {
+ var schemaObj = _getSchemaObj(this, keyRef);
+ switch (typeof schemaObj) {
+ case "object":
+ return schemaObj.validate || this._compile(schemaObj);
+ case "string":
+ return this.getSchema(schemaObj);
+ case "undefined":
+ return _getSchemaFragment(this, keyRef);
+ }
+ }
+ function _getSchemaFragment(self, ref) {
+ var res = resolve.schema.call(self, { schema: {} }, ref);
+ if (res) {
+ var schema2 = res.schema, root = res.root, baseId = res.baseId;
+ var v = compileSchema.call(self, schema2, root, void 0, baseId);
+ self._fragments[ref] = new SchemaObject({
+ ref,
+ fragment: true,
+ schema: schema2,
+ root,
+ baseId,
+ validate: v
+ });
+ return v;
+ }
+ }
+ function _getSchemaObj(self, keyRef) {
+ keyRef = resolve.normalizeId(keyRef);
+ return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
+ }
+ function removeSchema(schemaKeyRef) {
+ if (schemaKeyRef instanceof RegExp) {
+ _removeAllSchemas(this, this._schemas, schemaKeyRef);
+ _removeAllSchemas(this, this._refs, schemaKeyRef);
+ return this;
+ }
+ switch (typeof schemaKeyRef) {
+ case "undefined":
+ _removeAllSchemas(this, this._schemas);
+ _removeAllSchemas(this, this._refs);
+ this._cache.clear();
+ return this;
+ case "string":
+ var schemaObj = _getSchemaObj(this, schemaKeyRef);
+ if (schemaObj) this._cache.del(schemaObj.cacheKey);
+ delete this._schemas[schemaKeyRef];
+ delete this._refs[schemaKeyRef];
+ return this;
+ case "object":
+ var serialize = this._opts.serialize;
+ var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;
+ this._cache.del(cacheKey);
+ var id = this._getId(schemaKeyRef);
+ if (id) {
+ id = resolve.normalizeId(id);
+ delete this._schemas[id];
+ delete this._refs[id];
+ }
+ }
+ return this;
+ }
+ function _removeAllSchemas(self, schemas, regex3) {
+ for (var keyRef in schemas) {
+ var schemaObj = schemas[keyRef];
+ if (!schemaObj.meta && (!regex3 || regex3.test(keyRef))) {
+ self._cache.del(schemaObj.cacheKey);
+ delete schemas[keyRef];
+ }
+ }
+ }
+ function _addSchema(schema2, skipValidation, meta, shouldAddSchema) {
+ if (typeof schema2 != "object" && typeof schema2 != "boolean")
+ throw new Error("schema should be object or boolean");
+ var serialize = this._opts.serialize;
+ var cacheKey = serialize ? serialize(schema2) : schema2;
+ var cached3 = this._cache.get(cacheKey);
+ if (cached3) return cached3;
+ shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
+ var id = resolve.normalizeId(this._getId(schema2));
+ if (id && shouldAddSchema) checkUnique(this, id);
+ var willValidate = this._opts.validateSchema !== false && !skipValidation;
+ var recursiveMeta;
+ if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema2.$schema)))
+ this.validateSchema(schema2, true);
+ var localRefs = resolve.ids.call(this, schema2);
+ var schemaObj = new SchemaObject({
+ id,
+ schema: schema2,
+ localRefs,
+ cacheKey,
+ meta
+ });
+ if (id[0] != "#" && shouldAddSchema) this._refs[id] = schemaObj;
+ this._cache.put(cacheKey, schemaObj);
+ if (willValidate && recursiveMeta) this.validateSchema(schema2, true);
+ return schemaObj;
+ }
+ function _compile(schemaObj, root) {
+ if (schemaObj.compiling) {
+ schemaObj.validate = callValidate;
+ callValidate.schema = schemaObj.schema;
+ callValidate.errors = null;
+ callValidate.root = root ? root : callValidate;
+ if (schemaObj.schema.$async === true)
+ callValidate.$async = true;
+ return callValidate;
+ }
+ schemaObj.compiling = true;
+ var currentOpts;
+ if (schemaObj.meta) {
+ currentOpts = this._opts;
+ this._opts = this._metaOpts;
+ }
+ var v;
+ try {
+ v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs);
+ } catch (e) {
+ delete schemaObj.validate;
+ throw e;
+ } finally {
+ schemaObj.compiling = false;
+ if (schemaObj.meta) this._opts = currentOpts;
+ }
+ schemaObj.validate = v;
+ schemaObj.refs = v.refs;
+ schemaObj.refVal = v.refVal;
+ schemaObj.root = v.root;
+ return v;
+ function callValidate() {
+ var _validate = schemaObj.validate;
+ var result = _validate.apply(this, arguments);
+ callValidate.errors = _validate.errors;
+ return result;
+ }
+ }
+ function chooseGetId(opts) {
+ switch (opts.schemaId) {
+ case "auto":
+ return _get$IdOrId;
+ case "id":
+ return _getId;
+ default:
+ return _get$Id;
+ }
+ }
+ function _getId(schema2) {
+ if (schema2.$id) this.logger.warn("schema $id ignored", schema2.$id);
+ return schema2.id;
+ }
+ function _get$Id(schema2) {
+ if (schema2.id) this.logger.warn("schema id ignored", schema2.id);
+ return schema2.$id;
+ }
+ function _get$IdOrId(schema2) {
+ if (schema2.$id && schema2.id && schema2.$id != schema2.id)
+ throw new Error("schema $id is different from id");
+ return schema2.$id || schema2.id;
+ }
+ function errorsText(errors, options) {
+ errors = errors || this.errors;
+ if (!errors) return "No errors";
+ options = options || {};
+ var separator2 = options.separator === void 0 ? ", " : options.separator;
+ var dataVar = options.dataVar === void 0 ? "data" : options.dataVar;
+ var text = "";
+ for (var i = 0; i < errors.length; i++) {
+ var e = errors[i];
+ if (e) text += dataVar + e.dataPath + " " + e.message + separator2;
+ }
+ return text.slice(0, -separator2.length);
+ }
+ function addFormat2(name, format2) {
+ if (typeof format2 == "string") format2 = new RegExp(format2);
+ this._formats[name] = format2;
+ return this;
+ }
+ function addDefaultMetaSchema(self) {
+ var $dataSchema;
+ if (self._opts.$data) {
+ $dataSchema = require_data2();
+ self.addMetaSchema($dataSchema, $dataSchema.$id, true);
+ }
+ if (self._opts.meta === false) return;
+ var metaSchema = require_json_schema_draft_07();
+ if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);
+ self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
+ self._refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
+ }
+ function addInitialSchemas(self) {
+ var optsSchemas = self._opts.schemas;
+ if (!optsSchemas) return;
+ if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);
+ else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);
+ }
+ function addInitialFormats(self) {
+ for (var name in self._opts.formats) {
+ var format2 = self._opts.formats[name];
+ self.addFormat(name, format2);
+ }
+ }
+ function addInitialKeywords(self) {
+ for (var name in self._opts.keywords) {
+ var keyword = self._opts.keywords[name];
+ self.addKeyword(name, keyword);
+ }
+ }
+ function checkUnique(self, id) {
+ if (self._schemas[id] || self._refs[id])
+ throw new Error('schema with key or id "' + id + '" already exists');
+ }
+ function getMetaSchemaOptions(self) {
+ var metaOpts = util2.copy(self._opts);
+ for (var i = 0; i < META_IGNORE_OPTIONS.length; i++)
+ delete metaOpts[META_IGNORE_OPTIONS[i]];
+ return metaOpts;
+ }
+ function setLogger(self) {
+ var logger = self._opts.logger;
+ if (logger === false) {
+ self.logger = { log: noop3, warn: noop3, error: noop3 };
+ } else {
+ if (logger === void 0) logger = console;
+ if (!(typeof logger == "object" && logger.log && logger.warn && logger.error))
+ throw new Error("logger must implement log, warn and error methods");
+ self.logger = logger;
+ }
+ }
+ function noop3() {
}
- module.exports = exports = formatsPlugin;
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.default = formatsPlugin;
}
});
@@ -11208,7 +10664,7 @@ var require_timers = __commonJS({
});
// ../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/errors.js
-var require_errors2 = __commonJS({
+var require_errors = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/errors.js"(exports, module) {
"use strict";
var kUndiciError = Symbol.for("undici.error.UND_ERR");
@@ -11873,7 +11329,7 @@ var require_util3 = __commonJS({
var { stringify } = __require("node:querystring");
var { EventEmitter: EE } = __require("node:events");
var timers = require_timers();
- var { InvalidArgumentError, ConnectTimeoutError } = require_errors2();
+ var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
var { headerNameLowerCasedRecord } = require_constants();
var { tree } = require_tree();
var [nodeMajor, nodeMinor] = process.versions.node.split(".", 2).map((v) => Number(v));
@@ -12668,7 +12124,7 @@ var require_request = __commonJS({
var {
InvalidArgumentError,
NotSupportedError
- } = require_errors2();
+ } = require_errors();
var assert2 = __require("node:assert");
var {
isValidHTTPToken,
@@ -13004,7 +12460,7 @@ var require_request = __commonJS({
var require_wrap_handler = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/handler/wrap-handler.js"(exports, module) {
"use strict";
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
module.exports = class WrapHandler {
#handler;
constructor(handler2) {
@@ -13124,7 +12580,7 @@ var require_unwrap_handler = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/handler/unwrap-handler.js"(exports, module) {
"use strict";
var { parseHeaders } = require_util3();
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var kResume = Symbol("resume");
var UnwrapController = class {
#paused = false;
@@ -13209,7 +12665,7 @@ var require_dispatcher_base = __commonJS({
ClientDestroyedError,
ClientClosedError,
InvalidArgumentError
- } = require_errors2();
+ } = require_errors();
var { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require_symbols();
var kOnDestroyed = Symbol("onDestroyed");
var kOnClosed = Symbol("onClosed");
@@ -13345,7 +12801,7 @@ var require_connect = __commonJS({
var net = __require("node:net");
var assert2 = __require("node:assert");
var util2 = require_util3();
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var tls;
var SessionCache = class WeakSessionCache {
constructor(maxCachedSessions) {
@@ -13448,7 +12904,7 @@ var require_connect = __commonJS({
});
// ../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/llhttp/utils.js
-var require_utils2 = __commonJS({
+var require_utils = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/llhttp/utils.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -13469,7 +12925,7 @@ var require_constants2 = __commonJS({
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SPECIAL_HEADERS = exports.MINOR = exports.MAJOR = exports.HTAB_SP_VCHAR_OBS_TEXT = exports.QUOTED_STRING = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.HEX = exports.URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.STATUSES_HTTP = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.HEADER_STATE = exports.FINISH = exports.STATUSES = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
- var utils_1 = require_utils2();
+ var utils_1 = require_utils();
exports.ERROR = {
OK: 0,
INTERNAL: 1,
@@ -16858,7 +16314,7 @@ var require_client_h1 = __commonJS({
BodyTimeoutError,
HTTPParserError,
ResponseExceededMaxSizeError
- } = require_errors2();
+ } = require_errors();
var {
kUrl,
kReset,
@@ -18010,7 +17466,7 @@ var require_client_h2 = __commonJS({
RequestAbortedError,
SocketError,
InformationalError
- } = require_errors2();
+ } = require_errors();
var {
kUrl,
kReset,
@@ -18611,7 +18067,7 @@ var require_client = __commonJS({
InvalidArgumentError,
InformationalError,
ClientDestroyedError
- } = require_errors2();
+ } = require_errors();
var buildConnector = require_connect();
var {
kUrl,
@@ -19340,7 +18796,7 @@ var require_pool = __commonJS({
var Client2 = require_client();
var {
InvalidArgumentError
- } = require_errors2();
+ } = require_errors();
var util2 = require_util3();
var { kUrl } = require_symbols();
var buildConnector = require_connect();
@@ -19434,7 +18890,7 @@ var require_balanced_pool = __commonJS({
var {
BalancedPoolMissingUpstreamError,
InvalidArgumentError
- } = require_errors2();
+ } = require_errors();
var {
PoolBase,
kClients,
@@ -19574,7 +19030,7 @@ var require_balanced_pool = __commonJS({
var require_agent = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/dispatcher/agent.js"(exports, module) {
"use strict";
- var { InvalidArgumentError, MaxOriginsReachedError } = require_errors2();
+ var { InvalidArgumentError, MaxOriginsReachedError } = require_errors();
var { kClients, kRunning, kClose, kDestroy, kDispatch, kUrl } = require_symbols();
var DispatcherBase = require_dispatcher_base();
var Pool = require_pool();
@@ -19709,7 +19165,7 @@ var require_proxy_agent = __commonJS({
var Agent = require_agent();
var Pool = require_pool();
var DispatcherBase = require_dispatcher_base();
- var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors2();
+ var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors();
var buildConnector = require_connect();
var Client2 = require_client();
var kAgent = Symbol("proxy agent");
@@ -20058,7 +19514,7 @@ var require_retry_handler = __commonJS({
"use strict";
var assert2 = __require("node:assert");
var { kRetryHandlerDefaultRetry } = require_symbols();
- var { RequestRetryError } = require_errors2();
+ var { RequestRetryError } = require_errors();
var WrapHandler = require_wrap_handler();
var {
isDisturbed,
@@ -20403,7 +19859,7 @@ var require_h2c_client = __commonJS({
"use strict";
var { connect } = __require("node:net");
var { kClose, kDestroy } = require_symbols();
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var util2 = require_util3();
var Client2 = require_client();
var DispatcherBase = require_dispatcher_base();
@@ -20498,7 +19954,7 @@ var require_readable = __commonJS({
"use strict";
var assert2 = __require("node:assert");
var { Readable } = __require("node:stream");
- var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors2();
+ var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors();
var util2 = require_util3();
var { ReadableStreamFrom } = require_util3();
var kConsume = Symbol("kConsume");
@@ -20901,7 +20357,7 @@ var require_api_request = __commonJS({
var assert2 = __require("node:assert");
var { AsyncResource } = __require("node:async_hooks");
var { Readable } = require_readable();
- var { InvalidArgumentError, RequestAbortedError } = require_errors2();
+ var { InvalidArgumentError, RequestAbortedError } = require_errors();
var util2 = require_util3();
function noop3() {
}
@@ -21076,7 +20532,7 @@ var require_abort_signal = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/api/abort-signal.js"(exports, module) {
"use strict";
var { addAbortListener } = require_util3();
- var { RequestAbortedError } = require_errors2();
+ var { RequestAbortedError } = require_errors();
var kListener = Symbol("kListener");
var kSignal = Symbol("kSignal");
function abort(self) {
@@ -21130,7 +20586,7 @@ var require_api_stream = __commonJS({
var assert2 = __require("node:assert");
var { finished } = __require("node:stream");
var { AsyncResource } = __require("node:async_hooks");
- var { InvalidArgumentError, InvalidReturnValueError } = require_errors2();
+ var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
var util2 = require_util3();
var { addSignal, removeSignal } = require_abort_signal();
function noop3() {
@@ -21299,7 +20755,7 @@ var require_api_pipeline = __commonJS({
InvalidArgumentError,
InvalidReturnValueError,
RequestAbortedError
- } = require_errors2();
+ } = require_errors();
var util2 = require_util3();
var { addSignal, removeSignal } = require_abort_signal();
function noop3() {
@@ -21489,7 +20945,7 @@ var require_api_pipeline = __commonJS({
var require_api_upgrade = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/api/api-upgrade.js"(exports, module) {
"use strict";
- var { InvalidArgumentError, SocketError } = require_errors2();
+ var { InvalidArgumentError, SocketError } = require_errors();
var { AsyncResource } = __require("node:async_hooks");
var assert2 = __require("node:assert");
var util2 = require_util3();
@@ -21584,7 +21040,7 @@ var require_api_connect = __commonJS({
"use strict";
var assert2 = __require("node:assert");
var { AsyncResource } = __require("node:async_hooks");
- var { InvalidArgumentError, SocketError } = require_errors2();
+ var { InvalidArgumentError, SocketError } = require_errors();
var util2 = require_util3();
var { addSignal, removeSignal } = require_abort_signal();
var ConnectHandler = class extends AsyncResource {
@@ -21685,7 +21141,7 @@ var require_api = __commonJS({
var require_mock_errors = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/mock/mock-errors.js"(exports, module) {
"use strict";
- var { UndiciError } = require_errors2();
+ var { UndiciError } = require_errors();
var kMockNotMatchedError = Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");
var MockNotMatchedError = class extends UndiciError {
constructor(message) {
@@ -21762,7 +21218,7 @@ var require_mock_utils = __commonJS({
isPromise
}
} = __require("node:util");
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
function matchValue(match2, value2) {
if (typeof match2 === "string") {
return match2 === value2;
@@ -22100,7 +21556,7 @@ var require_mock_interceptor = __commonJS({
kMockDispatch,
kIgnoreTrailingSlash
} = require_mock_symbols();
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var { serializePathWithQuery } = require_util3();
var MockScope = class {
constructor(mockDispatch) {
@@ -22269,7 +21725,7 @@ var require_mock_client = __commonJS({
} = require_mock_symbols();
var { MockInterceptor } = require_mock_interceptor();
var Symbols = require_symbols();
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var MockClient = class extends Client2 {
constructor(origin, opts) {
if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") {
@@ -22316,7 +21772,7 @@ var require_mock_call_history = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/mock/mock-call-history.js"(exports, module) {
"use strict";
var { kMockCallHistoryAddLog } = require_mock_symbols();
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
function handleFilterCallsWithOptions(criteria, options, handler2, store) {
switch (options.operator) {
case "OR":
@@ -22530,7 +21986,7 @@ var require_mock_pool = __commonJS({
} = require_mock_symbols();
var { MockInterceptor } = require_mock_interceptor();
var Symbols = require_symbols();
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var MockPool = class extends Pool {
constructor(origin, opts) {
if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") {
@@ -22640,7 +22096,7 @@ var require_mock_agent = __commonJS({
var MockClient = require_mock_client();
var MockPool = require_mock_pool();
var { matchValue, normalizeSearchParams, buildAndValidateMockOptions } = require_mock_utils();
- var { InvalidArgumentError, UndiciError } = require_errors2();
+ var { InvalidArgumentError, UndiciError } = require_errors();
var Dispatcher = require_dispatcher();
var PendingInterceptorsFormatter = require_pending_interceptors_formatter();
var { MockCallHistory } = require_mock_call_history();
@@ -22799,7 +22255,7 @@ ${pendingInterceptorsFormatter.format(pending)}`.trim()
var require_snapshot_utils = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/mock/snapshot-utils.js"(exports, module) {
"use strict";
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
function createHeaderFilters(matchOptions = {}) {
const { ignoreHeaders = [], excludeHeaders = [], matchHeaders = [], caseSensitive = false } = matchOptions;
return {
@@ -22891,7 +22347,7 @@ var require_snapshot_recorder = __commonJS({
var { writeFile, readFile, mkdir } = __require("node:fs/promises");
var { dirname, resolve } = __require("node:path");
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
- var { InvalidArgumentError, UndiciError } = require_errors2();
+ var { InvalidArgumentError, UndiciError } = require_errors();
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
function formatRequestKey(opts, headerFilters, matchOptions = {}) {
const url2 = new URL(opts.path, opts.origin);
@@ -23261,7 +22717,7 @@ var require_snapshot_agent = __commonJS({
var MockAgent = require_mock_agent();
var { SnapshotRecorder } = require_snapshot_recorder();
var WrapHandler = require_wrap_handler();
- var { InvalidArgumentError, UndiciError } = require_errors2();
+ var { InvalidArgumentError, UndiciError } = require_errors();
var { validateSnapshotMode } = require_snapshot_utils();
var kSnapshotRecorder = Symbol("kSnapshotRecorder");
var kSnapshotMode = Symbol("kSnapshotMode");
@@ -23546,7 +23002,7 @@ var require_global2 = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/global.js"(exports, module) {
"use strict";
var globalDispatcher = Symbol.for("undici.globalDispatcher.1");
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var Agent = require_agent();
if (getGlobalDispatcher() === void 0) {
setGlobalDispatcher(new Agent());
@@ -23651,7 +23107,7 @@ var require_redirect_handler = __commonJS({
var util2 = require_util3();
var { kBodyUsed } = require_symbols();
var assert2 = __require("node:assert");
- var { InvalidArgumentError } = require_errors2();
+ var { InvalidArgumentError } = require_errors();
var EE = __require("node:events");
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
var kBody = Symbol("body");
@@ -23831,7 +23287,7 @@ var require_response_error = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/interceptor/response-error.js"(exports, module) {
"use strict";
var DecoratorHandler = require_decorator_handler();
- var { ResponseError } = require_errors2();
+ var { ResponseError } = require_errors();
var ResponseErrorHandler = class extends DecoratorHandler {
#statusCode;
#contentType;
@@ -23936,7 +23392,7 @@ var require_retry = __commonJS({
var require_dump = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/interceptor/dump.js"(exports, module) {
"use strict";
- var { InvalidArgumentError, RequestAbortedError } = require_errors2();
+ var { InvalidArgumentError, RequestAbortedError } = require_errors();
var DecoratorHandler = require_decorator_handler();
var DumpHandler = class extends DecoratorHandler {
#maxSize = 1024 * 1024;
@@ -24025,7 +23481,7 @@ var require_dns = __commonJS({
var { isIP } = __require("node:net");
var { lookup } = __require("node:dns");
var DecoratorHandler = require_decorator_handler();
- var { InvalidArgumentError, InformationalError } = require_errors2();
+ var { InvalidArgumentError, InformationalError } = require_errors();
var maxInt = Math.pow(2, 31) - 1;
var DNSInstance = class {
#maxTTL = 0;
@@ -24354,7 +23810,7 @@ var require_dns = __commonJS({
});
// ../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/util/cache.js
-var require_cache2 = __commonJS({
+var require_cache3 = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/util/cache.js"(exports, module) {
"use strict";
var {
@@ -25111,7 +24567,7 @@ var require_cache_handler = __commonJS({
parseCacheControlHeader,
parseVaryHeader,
isEtagUsable
- } = require_cache2();
+ } = require_cache3();
var { parseHttpDate } = require_date();
function noop3() {
}
@@ -25417,7 +24873,7 @@ var require_memory_cache_store = __commonJS({
"use strict";
var { Writable } = __require("node:stream");
var { EventEmitter: EventEmitter2 } = __require("node:events");
- var { assertCacheKey, assertCacheValue } = require_cache2();
+ var { assertCacheKey, assertCacheValue } = require_cache3();
var MemoryCacheStore = class extends EventEmitter2 {
#maxCount = 1024;
#maxSize = 104857600;
@@ -25676,7 +25132,7 @@ var require_cache_revalidation_handler = __commonJS({
});
// ../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/interceptor/cache.js
-var require_cache3 = __commonJS({
+var require_cache4 = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/interceptor/cache.js"(exports, module) {
"use strict";
var assert2 = __require("node:assert");
@@ -25685,8 +25141,8 @@ var require_cache3 = __commonJS({
var CacheHandler = require_cache_handler();
var MemoryCacheStore = require_memory_cache_store();
var CacheRevalidationHandler = require_cache_revalidation_handler();
- var { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader } = require_cache2();
- var { AbortError } = require_errors2();
+ var { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader } = require_cache3();
+ var { AbortError } = require_errors();
function needsRevalidation(result, cacheControlDirectives) {
if (cacheControlDirectives?.["no-cache"]) {
return true;
@@ -26188,7 +25644,7 @@ var require_sqlite_cache_store = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/cache/sqlite-cache-store.js"(exports, module) {
"use strict";
var { Writable } = __require("node:stream");
- var { assertCacheKey, assertCacheValue } = require_cache2();
+ var { assertCacheKey, assertCacheValue } = require_cache3();
var DatabaseSync;
var VERSION9 = 3;
var MAX_ENTRY_SIZE = 2 * 1e3 * 1e3 * 1e3;
@@ -29405,7 +28861,7 @@ var require_util5 = __commonJS({
});
// ../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/cache/cache.js
-var require_cache4 = __commonJS({
+var require_cache5 = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/cache/cache.js"(exports, module) {
"use strict";
var assert2 = __require("node:assert");
@@ -29957,7 +29413,7 @@ var require_cache4 = __commonJS({
var require_cachestorage = __commonJS({
"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/cache/cachestorage.js"(exports, module) {
"use strict";
- var { Cache } = require_cache4();
+ var { Cache } = require_cache5();
var { webidl } = require_webidl();
var { kEnumerableProperty } = require_util3();
var { kConstruct } = require_symbols();
@@ -33183,7 +32639,7 @@ var require_undici = __commonJS({
var EnvHttpProxyAgent = require_env_http_proxy_agent();
var RetryAgent = require_retry_agent();
var H2CClient = require_h2c_client();
- var errors = require_errors2();
+ var errors = require_errors();
var util2 = require_util3();
var { InvalidArgumentError } = errors;
var api = require_api();
@@ -33217,7 +32673,7 @@ var require_undici = __commonJS({
retry: require_retry(),
dump: require_dump(),
dns: require_dns(),
- cache: require_cache3(),
+ cache: require_cache4(),
decompress: require_decompress()
};
module.exports.cacheStores = {
@@ -33788,27 +33244,27 @@ var require_uri_templates = __commonJS({
}
});
-// ../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js
+// ../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js
var arktype_C_GObzDh_exports = {};
__export(arktype_C_GObzDh_exports, {
getToJsonSchemaFn: () => getToJsonSchemaFn
});
var getToJsonSchemaFn;
var init_arktype_C_GObzDh = __esm({
- "../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js"() {
+ "../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js"() {
getToJsonSchemaFn = async () => (schema2) => schema2.toJsonSchema();
}
});
-// ../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect-BqN--3bg.js
-var effect_BqN_3bg_exports = {};
-__export(effect_BqN_3bg_exports, {
+// ../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect--zg3C1LQ.js
+var effect_zg3C1LQ_exports = {};
+__export(effect_zg3C1LQ_exports, {
getToJsonSchemaFn: () => getToJsonSchemaFn2
});
var getToJsonSchemaFn2;
-var init_effect_BqN_3bg = __esm({
- "../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect-BqN--3bg.js"() {
- init_index_CLFto6T2();
+var init_effect_zg3C1LQ = __esm({
+ "../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect--zg3C1LQ.js"() {
+ init_index_CAcLDIRJ();
getToJsonSchemaFn2 = async () => {
const { JSONSchema } = await tryImport(import("effect"), "effect");
return (schema2) => JSONSchema.make(schema2);
@@ -33816,15 +33272,15 @@ var init_effect_BqN_3bg = __esm({
}
});
-// ../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-DT-CKDzo.js
-var sury_DT_CKDzo_exports = {};
-__export(sury_DT_CKDzo_exports, {
+// ../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-s6Akl-oc.js
+var sury_s6Akl_oc_exports = {};
+__export(sury_s6Akl_oc_exports, {
getToJsonSchemaFn: () => getToJsonSchemaFn3
});
var getToJsonSchemaFn3;
-var init_sury_DT_CKDzo = __esm({
- "../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-DT-CKDzo.js"() {
- init_index_CLFto6T2();
+var init_sury_s6Akl_oc = __esm({
+ "../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-s6Akl-oc.js"() {
+ init_index_CAcLDIRJ();
getToJsonSchemaFn3 = async () => {
const { toJSONSchema: toJSONSchema2 } = await tryImport(import("sury"), "sury");
return (schema2) => toJSONSchema2(schema2);
@@ -33832,15 +33288,15 @@ var init_sury_DT_CKDzo = __esm({
}
});
-// ../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-CR9aQ3tY.js
-var valibot_CR9aQ3tY_exports = {};
-__export(valibot_CR9aQ3tY_exports, {
+// ../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-DBCeetIe.js
+var valibot_DBCeetIe_exports = {};
+__export(valibot_DBCeetIe_exports, {
getToJsonSchemaFn: () => getToJsonSchemaFn4
});
var getToJsonSchemaFn4;
-var init_valibot_CR9aQ3tY = __esm({
- "../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-CR9aQ3tY.js"() {
- init_index_CLFto6T2();
+var init_valibot_DBCeetIe = __esm({
+ "../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-DBCeetIe.js"() {
+ init_index_CAcLDIRJ();
getToJsonSchemaFn4 = async () => {
const { toJsonSchema: toJsonSchema2 } = await tryImport(import("@valibot/to-json-schema"), "@valibot/to-json-schema");
return (schema2) => toJsonSchema2(schema2);
@@ -45730,15 +45186,15 @@ var init_esm = __esm({
}
});
-// ../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-DRPNNiyo.js
-var zod_DRPNNiyo_exports = {};
-__export(zod_DRPNNiyo_exports, {
+// ../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-Bw_60DVU.js
+var zod_Bw_60DVU_exports = {};
+__export(zod_Bw_60DVU_exports, {
getToJsonSchemaFn: () => getToJsonSchemaFn5
});
var getToJsonSchemaFn5;
-var init_zod_DRPNNiyo = __esm({
- "../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-DRPNNiyo.js"() {
- init_index_CLFto6T2();
+var init_zod_Bw_60DVU = __esm({
+ "../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-Bw_60DVU.js"() {
+ init_index_CAcLDIRJ();
getToJsonSchemaFn5 = async () => {
let zodV4toJSONSchema = (_schema) => {
throw new Error(`xsschema: Missing zod v4 dependencies "zod". see ${missingDependenciesUrl}`);
@@ -45748,7 +45204,7 @@ var init_zod_DRPNNiyo = __esm({
};
try {
const { toJSONSchema: toJSONSchema2 } = await Promise.resolve().then(() => (init_core2(), core_exports2));
- zodV4toJSONSchema = (schema2) => toJSONSchema2(schema2, { target: "draft-7" });
+ zodV4toJSONSchema = toJSONSchema2;
} catch (err) {
if (err instanceof Error)
console.error(err.message);
@@ -45770,10 +45226,10 @@ var init_zod_DRPNNiyo = __esm({
}
});
-// ../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CLFto6T2.js
+// ../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CAcLDIRJ.js
var missingDependenciesUrl, tryImport, getToJsonSchemaFn6, toJsonSchema;
-var init_index_CLFto6T2 = __esm({
- "../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CLFto6T2.js"() {
+var init_index_CAcLDIRJ = __esm({
+ "../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CAcLDIRJ.js"() {
missingDependenciesUrl = "https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies";
tryImport = async (result, name) => {
try {
@@ -45787,13 +45243,13 @@ var init_index_CLFto6T2 = __esm({
case "arktype":
return Promise.resolve().then(() => (init_arktype_C_GObzDh(), arktype_C_GObzDh_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
case "effect":
- return Promise.resolve().then(() => (init_effect_BqN_3bg(), effect_BqN_3bg_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
+ return Promise.resolve().then(() => (init_effect_zg3C1LQ(), effect_zg3C1LQ_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
case "sury":
- return Promise.resolve().then(() => (init_sury_DT_CKDzo(), sury_DT_CKDzo_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
+ return Promise.resolve().then(() => (init_sury_s6Akl_oc(), sury_s6Akl_oc_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
case "valibot":
- return Promise.resolve().then(() => (init_valibot_CR9aQ3tY(), valibot_CR9aQ3tY_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
+ return Promise.resolve().then(() => (init_valibot_DBCeetIe(), valibot_DBCeetIe_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
case "zod":
- return Promise.resolve().then(() => (init_zod_DRPNNiyo(), zod_DRPNNiyo_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
+ return Promise.resolve().then(() => (init_zod_Bw_60DVU(), zod_Bw_60DVU_exports)).then(async ({ getToJsonSchemaFn: getToJsonSchemaFn22 }) => getToJsonSchemaFn22());
default:
throw new Error(`xsschema: Unsupported schema vendor "${vendor}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`);
}
@@ -45899,7 +45355,7 @@ var require_fast_content_type_parse = __commonJS({
});
// ../node_modules/.pnpm/@actions+core@1.11.1/node_modules/@actions/core/lib/utils.js
-var require_utils3 = __commonJS({
+var require_utils2 = __commonJS({
"../node_modules/.pnpm/@actions+core@1.11.1/node_modules/@actions/core/lib/utils.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -45964,7 +45420,7 @@ var require_command = __commonJS({
Object.defineProperty(exports, "__esModule", { value: true });
exports.issue = exports.issueCommand = void 0;
var os = __importStar(__require("os"));
- var utils_1 = require_utils3();
+ var utils_1 = require_utils2();
function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL);
@@ -46052,7 +45508,7 @@ var require_file_command = __commonJS({
var crypto2 = __importStar(__require("crypto"));
var fs = __importStar(__require("fs"));
var os = __importStar(__require("os"));
- var utils_1 = require_utils3();
+ var utils_1 = require_utils2();
function issueFileCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
@@ -46470,7 +45926,7 @@ var require_symbols2 = __commonJS({
});
// ../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/errors.js
-var require_errors3 = __commonJS({
+var require_errors2 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/errors.js"(exports, module) {
"use strict";
var UndiciError = class extends Error {
@@ -46808,7 +46264,7 @@ var require_util9 = __commonJS({
var { IncomingMessage } = __require("http");
var stream = __require("stream");
var net = __require("net");
- var { InvalidArgumentError } = require_errors3();
+ var { InvalidArgumentError } = require_errors2();
var { Blob: Blob2 } = __require("buffer");
var nodeUtil = __require("util");
var { stringify } = __require("querystring");
@@ -51194,7 +50650,7 @@ var require_body2 = __commonJS({
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`;
const prefix = `--${boundary}\r
Content-Disposition: form-data`;
- const escape2 = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
+ const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
const normalizeLinefeeds = (value2) => value2.replace(/\r?\n|\r/g, "\r\n");
const blobParts = [];
const rn = new Uint8Array([13, 10]);
@@ -51202,14 +50658,14 @@ Content-Disposition: form-data`;
let hasUnknownSizeValue = false;
for (const [name, value2] of object2) {
if (typeof value2 === "string") {
- const chunk2 = textEncoder.encode(prefix + `; name="${escape2(normalizeLinefeeds(name))}"\r
+ const chunk2 = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"\r
\r
${normalizeLinefeeds(value2)}\r
`);
blobParts.push(chunk2);
length += chunk2.byteLength;
} else {
- const chunk2 = textEncoder.encode(`${prefix}; name="${escape2(normalizeLinefeeds(name))}"` + (value2.name ? `; filename="${escape2(value2.name)}"` : "") + `\r
+ const chunk2 = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value2.name ? `; filename="${escape(value2.name)}"` : "") + `\r
Content-Type: ${value2.type || "application/octet-stream"}\r
\r
`);
@@ -51502,7 +50958,7 @@ var require_request3 = __commonJS({
var {
InvalidArgumentError,
NotSupportedError
- } = require_errors3();
+ } = require_errors2();
var assert2 = __require("assert");
var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols2();
var util2 = require_util9();
@@ -51894,7 +51350,7 @@ var require_dispatcher_base2 = __commonJS({
ClientDestroyedError,
ClientClosedError,
InvalidArgumentError
- } = require_errors3();
+ } = require_errors2();
var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols2();
var kDestroyed = Symbol("destroyed");
var kClosed = Symbol("closed");
@@ -52055,7 +51511,7 @@ var require_connect2 = __commonJS({
var net = __require("net");
var assert2 = __require("assert");
var util2 = require_util9();
- var { InvalidArgumentError, ConnectTimeoutError } = require_errors3();
+ var { InvalidArgumentError, ConnectTimeoutError } = require_errors2();
var tls;
var SessionCache;
if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
@@ -52205,7 +51661,7 @@ var require_connect2 = __commonJS({
});
// ../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/utils.js
-var require_utils4 = __commonJS({
+var require_utils3 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/utils.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -52230,7 +51686,7 @@ var require_constants8 = __commonJS({
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
- var utils_1 = require_utils4();
+ var utils_1 = require_utils3();
var ERROR;
(function(ERROR2) {
ERROR2[ERROR2["OK"] = 0] = "OK";
@@ -52552,7 +52008,7 @@ var require_RedirectHandler = __commonJS({
var util2 = require_util9();
var { kBodyUsed } = require_symbols2();
var assert2 = __require("assert");
- var { InvalidArgumentError } = require_errors3();
+ var { InvalidArgumentError } = require_errors2();
var EE = __require("events");
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
var kBody = Symbol("body");
@@ -52756,7 +52212,7 @@ var require_client2 = __commonJS({
HTTPParserError,
ResponseExceededMaxSizeError,
ClientDestroyedError
- } = require_errors3();
+ } = require_errors2();
var buildConnector = require_connect2();
var {
kUrl,
@@ -54696,7 +54152,7 @@ var require_pool2 = __commonJS({
var Client2 = require_client2();
var {
InvalidArgumentError
- } = require_errors3();
+ } = require_errors2();
var util2 = require_util9();
var { kUrl, kInterceptors } = require_symbols2();
var buildConnector = require_connect2();
@@ -54779,7 +54235,7 @@ var require_balanced_pool2 = __commonJS({
var {
BalancedPoolMissingUpstreamError,
InvalidArgumentError
- } = require_errors3();
+ } = require_errors2();
var {
PoolBase,
kClients,
@@ -54953,7 +54409,7 @@ var require_dispatcher_weakref = __commonJS({
var require_agent2 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/agent.js"(exports, module) {
"use strict";
- var { InvalidArgumentError } = require_errors3();
+ var { InvalidArgumentError } = require_errors2();
var { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols2();
var DispatcherBase = require_dispatcher_base2();
var Pool = require_pool2();
@@ -55073,7 +54529,7 @@ var require_readable2 = __commonJS({
"use strict";
var assert2 = __require("assert");
var { Readable } = __require("stream");
- var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors3();
+ var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors2();
var util2 = require_util9();
var { ReadableStreamFrom, toUSVString } = require_util9();
var Blob2;
@@ -55325,7 +54781,7 @@ var require_util11 = __commonJS({
var assert2 = __require("assert");
var {
ResponseStatusCodeError
- } = require_errors3();
+ } = require_errors2();
var { toUSVString } = require_util9();
async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) {
assert2(body);
@@ -55366,7 +54822,7 @@ var require_util11 = __commonJS({
var require_abort_signal2 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/abort-signal.js"(exports, module) {
var { addAbortListener } = require_util9();
- var { RequestAbortedError } = require_errors3();
+ var { RequestAbortedError } = require_errors2();
var kListener = Symbol("kListener");
var kSignal = Symbol("kSignal");
function abort(self) {
@@ -55419,7 +54875,7 @@ var require_api_request2 = __commonJS({
var {
InvalidArgumentError,
RequestAbortedError
- } = require_errors3();
+ } = require_errors2();
var util2 = require_util9();
var { getResolveErrorBodyCallback } = require_util11();
var { AsyncResource } = __require("async_hooks");
@@ -55574,7 +55030,7 @@ var require_api_stream2 = __commonJS({
InvalidArgumentError,
InvalidReturnValueError,
RequestAbortedError
- } = require_errors3();
+ } = require_errors2();
var util2 = require_util9();
var { getResolveErrorBodyCallback } = require_util11();
var { AsyncResource } = __require("async_hooks");
@@ -55752,7 +55208,7 @@ var require_api_pipeline2 = __commonJS({
InvalidArgumentError,
InvalidReturnValueError,
RequestAbortedError
- } = require_errors3();
+ } = require_errors2();
var util2 = require_util9();
var { AsyncResource } = __require("async_hooks");
var { addSignal, removeSignal } = require_abort_signal2();
@@ -55941,7 +55397,7 @@ var require_api_pipeline2 = __commonJS({
var require_api_upgrade2 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-upgrade.js"(exports, module) {
"use strict";
- var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors3();
+ var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors2();
var { AsyncResource } = __require("async_hooks");
var util2 = require_util9();
var { addSignal, removeSignal } = require_abort_signal2();
@@ -56032,7 +55488,7 @@ var require_api_connect2 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-connect.js"(exports, module) {
"use strict";
var { AsyncResource } = __require("async_hooks");
- var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors3();
+ var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors2();
var util2 = require_util9();
var { addSignal, removeSignal } = require_abort_signal2();
var ConnectHandler = class extends AsyncResource {
@@ -56130,7 +55586,7 @@ var require_api2 = __commonJS({
var require_mock_errors2 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-errors.js"(exports, module) {
"use strict";
- var { UndiciError } = require_errors3();
+ var { UndiciError } = require_errors2();
var MockNotMatchedError = class _MockNotMatchedError extends UndiciError {
constructor(message) {
super(message);
@@ -56467,7 +55923,7 @@ var require_mock_interceptor2 = __commonJS({
kContentLength,
kMockDispatch
} = require_mock_symbols2();
- var { InvalidArgumentError } = require_errors3();
+ var { InvalidArgumentError } = require_errors2();
var { buildURL } = require_util9();
var MockScope = class {
constructor(mockDispatch) {
@@ -56633,7 +56089,7 @@ var require_mock_client2 = __commonJS({
} = require_mock_symbols2();
var { MockInterceptor } = require_mock_interceptor2();
var Symbols = require_symbols2();
- var { InvalidArgumentError } = require_errors3();
+ var { InvalidArgumentError } = require_errors2();
var MockClient = class extends Client2 {
constructor(origin, opts) {
super(origin, opts);
@@ -56686,7 +56142,7 @@ var require_mock_pool2 = __commonJS({
} = require_mock_symbols2();
var { MockInterceptor } = require_mock_interceptor2();
var Symbols = require_symbols2();
- var { InvalidArgumentError } = require_errors3();
+ var { InvalidArgumentError } = require_errors2();
var MockPool = class extends Pool {
constructor(origin, opts) {
super(origin, opts);
@@ -56811,7 +56267,7 @@ var require_mock_agent2 = __commonJS({
var MockClient = require_mock_client2();
var MockPool = require_mock_pool2();
var { matchValue, buildMockOptions } = require_mock_utils2();
- var { InvalidArgumentError, UndiciError } = require_errors3();
+ var { InvalidArgumentError, UndiciError } = require_errors2();
var Dispatcher = require_dispatcher2();
var Pluralizer = require_pluralizer();
var PendingInterceptorsFormatter = require_pending_interceptors_formatter2();
@@ -56939,7 +56395,7 @@ var require_proxy_agent2 = __commonJS({
var Agent = require_agent2();
var Pool = require_pool2();
var DispatcherBase = require_dispatcher_base2();
- var { InvalidArgumentError, RequestAbortedError } = require_errors3();
+ var { InvalidArgumentError, RequestAbortedError } = require_errors2();
var buildConnector = require_connect2();
var kAgent = Symbol("proxy agent");
var kClient = Symbol("proxy client");
@@ -57087,7 +56543,7 @@ var require_RetryHandler = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RetryHandler.js"(exports, module) {
var assert2 = __require("assert");
var { kRetryHandlerDefaultRetry } = require_symbols2();
- var { RequestRetryError } = require_errors3();
+ var { RequestRetryError } = require_errors2();
var { isDisturbed, parseHeaders, parseRangeHeader } = require_util9();
function calculateRetryAfterHeader(retryAfter) {
const current = Date.now();
@@ -57354,7 +56810,7 @@ var require_global4 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/global.js"(exports, module) {
"use strict";
var globalDispatcher = Symbol.for("undici.globalDispatcher.1");
- var { InvalidArgumentError } = require_errors3();
+ var { InvalidArgumentError } = require_errors2();
var Agent = require_agent2();
if (getGlobalDispatcher() === void 0) {
setGlobalDispatcher(new Agent());
@@ -60715,7 +60171,7 @@ var require_util13 = __commonJS({
});
// ../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cache.js
-var require_cache5 = __commonJS({
+var require_cache6 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cache.js"(exports, module) {
"use strict";
var { kConstruct } = require_symbols5();
@@ -61251,7 +60707,7 @@ var require_cachestorage2 = __commonJS({
"../node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cachestorage.js"(exports, module) {
"use strict";
var { kConstruct } = require_symbols5();
- var { Cache } = require_cache5();
+ var { Cache } = require_cache6();
var { webidl } = require_webidl2();
var { kEnumerableProperty } = require_util9();
var CacheStorage = class _CacheStorage {
@@ -63024,7 +62480,7 @@ var require_undici2 = __commonJS({
"use strict";
var Client2 = require_client2();
var Dispatcher = require_dispatcher2();
- var errors = require_errors3();
+ var errors = require_errors2();
var Pool = require_pool2();
var BalancedPool = require_balanced_pool2();
var Agent = require_agent2();
@@ -63915,7 +63371,7 @@ var require_oidc_utils = __commonJS({
exports.OidcClient = void 0;
var http_client_1 = require_lib2();
var auth_1 = require_auth();
- var core_1 = require_core3();
+ var core_1 = require_core();
var OidcClient = class _OidcClient {
static createHttpClient(allowRetry = true, maxRetry = 10) {
const requestOptions = {
@@ -65453,7 +64909,7 @@ var require_platform = __commonJS({
});
// ../node_modules/.pnpm/@actions+core@1.11.1/node_modules/@actions/core/lib/core.js
-var require_core3 = __commonJS({
+var require_core = __commonJS({
"../node_modules/.pnpm/@actions+core@1.11.1/node_modules/@actions/core/lib/core.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
@@ -65514,7 +64970,7 @@ var require_core3 = __commonJS({
exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
var command_1 = require_command();
var file_command_1 = require_file_command();
- var utils_1 = require_utils3();
+ var utils_1 = require_utils2();
var os = __importStar(__require("os"));
var path = __importStar(__require("path"));
var oidc_utils_1 = require_oidc_utils();
@@ -65681,7 +65137,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
}
});
-// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.21.1/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
+// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
init_zod();
var LATEST_PROTOCOL_VERSION = "2025-06-18";
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-03-26", "2024-11-05", "2024-10-07"];
@@ -66629,7 +66085,7 @@ var McpError = class extends Error {
}
};
-// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.21.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
+// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
var Protocol = class {
constructor(_options) {
@@ -67010,82 +66466,14 @@ function mergeCapabilities(base, additional) {
}, { ...base });
}
-// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.21.1/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
+// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
var import_ajv = __toESM(require_ajv(), 1);
-var import_ajv_formats = __toESM(require_dist(), 1);
-function createDefaultAjvInstance() {
- const ajv = new import_ajv.Ajv({
- strict: false,
- validateFormats: true,
- validateSchema: false,
- allErrors: true
- });
- const addFormats = import_ajv_formats.default;
- addFormats(ajv);
- return ajv;
-}
-var AjvJsonSchemaValidator = class {
- /**
- * Create an AJV validator
- *
- * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.
- *
- * @example
- * ```typescript
- * // Use default configuration (recommended for most cases)
- * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
- * const validator = new AjvJsonSchemaValidator();
- *
- * // Or provide custom AJV instance for advanced configuration
- * import { Ajv } from 'ajv';
- * import addFormats from 'ajv-formats';
- *
- * const ajv = new Ajv({ validateFormats: true });
- * addFormats(ajv);
- * const validator = new AjvJsonSchemaValidator(ajv);
- * ```
- */
- constructor(ajv) {
- this._ajv = ajv !== null && ajv !== void 0 ? ajv : createDefaultAjvInstance();
- }
- /**
- * Create a validator for the given JSON Schema
- *
- * The validator is compiled once and can be reused multiple times.
- * If the schema has an $id, it will be cached by AJV automatically.
- *
- * @param schema - Standard JSON Schema object
- * @returns A validator function that validates input data
- */
- getValidator(schema2) {
- var _a;
- const ajvValidator = "$id" in schema2 && typeof schema2.$id === "string" ? (_a = this._ajv.getSchema(schema2.$id)) !== null && _a !== void 0 ? _a : this._ajv.compile(schema2) : this._ajv.compile(schema2);
- return (input) => {
- const valid = ajvValidator(input);
- if (valid) {
- return {
- valid: true,
- data: input,
- errorMessage: void 0
- };
- } else {
- return {
- valid: false,
- data: void 0,
- errorMessage: this._ajv.errorsText(ajvValidator.errors)
- };
- }
- };
- }
-};
-
-// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.21.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
var Server = class extends Protocol {
/**
* Initializes this server with the given name and version information.
*/
constructor(_serverInfo, options) {
- var _a, _b;
+ var _a;
super(options);
this._serverInfo = _serverInfo;
this._loggingLevels = /* @__PURE__ */ new Map();
@@ -67096,7 +66484,6 @@ var Server = class extends Protocol {
};
this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {};
this._instructions = options === null || options === void 0 ? void 0 : options.instructions;
- this._jsonSchemaValidator = (_b = options === null || options === void 0 ? void 0 : options.jsonSchemaValidator) !== null && _b !== void 0 ? _b : new AjvJsonSchemaValidator();
this.setRequestHandler(InitializeRequestSchema, (request2) => this._oninitialize(request2));
this.setNotificationHandler(InitializedNotificationSchema, () => {
var _a2;
@@ -67248,18 +66635,19 @@ var Server = class extends Protocol {
}
async elicitInput(params, options) {
const result = await this.request({ method: "elicitation/create", params }, ElicitResultSchema, options);
- if (result.action === "accept" && result.content && params.requestedSchema) {
+ if (result.action === "accept" && result.content) {
try {
- const validator = this._jsonSchemaValidator.getValidator(params.requestedSchema);
- const validationResult = validator(result.content);
- if (!validationResult.valid) {
- throw new McpError(ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);
+ const ajv = new import_ajv.default();
+ const validate2 = ajv.compile(params.requestedSchema);
+ const isValid3 = validate2(result.content);
+ if (!isValid3) {
+ throw new McpError(ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${ajv.errorsText(validate2.errors)}`);
}
} catch (error41) {
if (error41 instanceof McpError) {
throw error41;
}
- throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error41 instanceof Error ? error41.message : String(error41)}`);
+ throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error41}`);
}
}
return result;
@@ -67300,10 +66688,10 @@ var Server = class extends Protocol {
}
};
-// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.21.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
+// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
import process2 from "node:process";
-// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.21.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
+// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
var ReadBuffer = class {
append(chunk) {
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
@@ -67331,7 +66719,7 @@ function serializeMessage(message) {
return JSON.stringify(message) + "\n";
}
-// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.21.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
+// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
var StdioServerTransport = class {
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
this._stdin = _stdin;
@@ -67395,7 +66783,7 @@ var StdioServerTransport = class {
}
};
-// ../node_modules/.pnpm/fastmcp@3.22.0_arktype@2.1.25_effect@3.16.12/node_modules/fastmcp/dist/FastMCP.js
+// ../node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.25_effect@3.16.12/node_modules/fastmcp/dist/FastMCP.js
import { EventEmitter } from "events";
// ../node_modules/.pnpm/fuse.js@7.1.0/node_modules/fuse.js/dist/fuse.mjs
@@ -68717,7 +68105,7 @@ Fuse.config = Config;
register(ExtendedSearch);
}
-// ../node_modules/.pnpm/mcp-proxy@5.10.0/node_modules/mcp-proxy/dist/stdio-DF5lH8jj.js
+// ../node_modules/.pnpm/mcp-proxy@5.9.0/node_modules/mcp-proxy/dist/stdio-CsjPjeWC.js
import { createRequire } from "node:module";
import { randomUUID } from "node:crypto";
import { URL as URL$1 } from "url";
@@ -82955,47 +82343,6 @@ var cleanupServer = async (server2, onClose) => {
console.error("[mcp-proxy] error closing server", error41);
}
};
-var applyCorsHeaders = (req, res, corsOptions) => {
- if (!req.headers.origin) return;
- const defaultCorsOptions = {
- allowedHeaders: "Content-Type, Authorization, Accept, Mcp-Session-Id, Last-Event-Id",
- credentials: true,
- exposedHeaders: ["Mcp-Session-Id"],
- methods: [
- "GET",
- "POST",
- "OPTIONS"
- ],
- origin: "*"
- };
- let finalCorsOptions;
- if (corsOptions === false) return;
- else if (corsOptions === true || corsOptions === void 0) finalCorsOptions = defaultCorsOptions;
- else finalCorsOptions = {
- ...defaultCorsOptions,
- ...corsOptions
- };
- try {
- const origin = new URL(req.headers.origin);
- let allowedOrigin = "*";
- if (finalCorsOptions.origin) {
- if (typeof finalCorsOptions.origin === "string") allowedOrigin = finalCorsOptions.origin;
- else if (Array.isArray(finalCorsOptions.origin)) allowedOrigin = finalCorsOptions.origin.includes(origin.origin) ? origin.origin : "false";
- else if (typeof finalCorsOptions.origin === "function") allowedOrigin = finalCorsOptions.origin(origin.origin) ? origin.origin : "false";
- }
- if (allowedOrigin !== "false") res.setHeader("Access-Control-Allow-Origin", allowedOrigin);
- if (finalCorsOptions.credentials !== void 0) res.setHeader("Access-Control-Allow-Credentials", finalCorsOptions.credentials.toString());
- if (finalCorsOptions.methods) res.setHeader("Access-Control-Allow-Methods", finalCorsOptions.methods.join(", "));
- if (finalCorsOptions.allowedHeaders) {
- const allowedHeaders = typeof finalCorsOptions.allowedHeaders === "string" ? finalCorsOptions.allowedHeaders : finalCorsOptions.allowedHeaders.join(", ");
- res.setHeader("Access-Control-Allow-Headers", allowedHeaders);
- }
- if (finalCorsOptions.exposedHeaders) res.setHeader("Access-Control-Expose-Headers", finalCorsOptions.exposedHeaders.join(", "));
- if (finalCorsOptions.maxAge !== void 0) res.setHeader("Access-Control-Max-Age", finalCorsOptions.maxAge.toString());
- } catch (error41) {
- console.error("[mcp-proxy] error parsing origin", error41);
- }
-};
var handleStreamRequest = async ({ activeTransports, authenticate, createServer, enableJsonResponse, endpoint: endpoint2, eventStore, oauth, onClose, onConnect, req, res, stateless }) => {
if (req.method === "POST" && new URL(req.url, "http://localhost").pathname === endpoint2) {
try {
@@ -83235,7 +82582,7 @@ var handleSSERequest = async ({ activeTransports, createServer, endpoint: endpoi
}
return false;
};
-var startHTTPServer = async ({ apiKey, authenticate, cors, createServer, enableJsonResponse, eventStore, host = "::", oauth, onClose, onConnect, onUnhandledRequest, port, sseEndpoint = "/sse", stateless, streamEndpoint = "/mcp" }) => {
+var startHTTPServer = async ({ apiKey, authenticate, createServer, enableJsonResponse, eventStore, host = "::", oauth, onClose, onConnect, onUnhandledRequest, port, sseEndpoint = "/sse", stateless, streamEndpoint = "/mcp" }) => {
const activeSSETransports = {};
const activeStreamTransports = {};
const authMiddleware = new AuthenticationMiddleware({
@@ -83243,7 +82590,16 @@ var startHTTPServer = async ({ apiKey, authenticate, cors, createServer, enableJ
oauth
});
const httpServer = http.createServer(async (req, res) => {
- applyCorsHeaders(req, res, cors);
+ if (req.headers.origin) try {
+ const origin = new URL(req.headers.origin);
+ res.setHeader("Access-Control-Allow-Origin", origin.origin);
+ res.setHeader("Access-Control-Allow-Credentials", "true");
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept, Mcp-Session-Id, Last-Event-Id");
+ res.setHeader("Access-Control-Expose-Headers", "Mcp-Session-Id");
+ } catch (error41) {
+ console.error("[mcp-proxy] error parsing origin", error41);
+ }
if (req.method === "OPTIONS") {
res.writeHead(204);
res.end();
@@ -83304,7 +82660,7 @@ var startHTTPServer = async ({ apiKey, authenticate, cors, createServer, enableJ
});
} };
};
-var require_uri_all = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js": ((exports, module) => {
+var require_uri_all2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js": ((exports, module) => {
(function(global$1, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global$1.URI = global$1.URI || {});
})(exports, (function(exports$1) {
@@ -84363,7 +83719,7 @@ var require_util2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6
return str.replace(/~1/g, "/").replace(/~0/g, "~");
}
}) });
-var require_schema_obj = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js": ((exports, module) => {
+var require_schema_obj2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js": ((exports, module) => {
var util$4 = require_util2();
module.exports = SchemaObject$2;
function SchemaObject$2(obj) {
@@ -84442,7 +83798,7 @@ var require_json_schema_traverse2 = /* @__PURE__ */ __commonJS2({ "node_modules/
}
}) });
var require_resolve2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/resolve.js": ((exports, module) => {
- var URI$1 = require_uri_all(), equal$1 = require_fast_deep_equal2(), util$3 = require_util2(), SchemaObject$1 = require_schema_obj(), traverse = require_json_schema_traverse2();
+ var URI$1 = require_uri_all2(), equal$1 = require_fast_deep_equal2(), util$3 = require_util2(), SchemaObject$1 = require_schema_obj2(), traverse = require_json_schema_traverse2();
module.exports = resolve$3;
resolve$3.normalizeId = normalizeId;
resolve$3.fullPath = getFullPath;
@@ -84641,7 +83997,7 @@ var require_resolve2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.1
return localRefs;
}
}) });
-var require_error_classes = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js": ((exports, module) => {
+var require_error_classes2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js": ((exports, module) => {
var resolve$2 = require_resolve2();
module.exports = {
Validation: errorSubclass(ValidationError$1),
@@ -84666,7 +84022,7 @@ var require_error_classes = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/aj
return Subclass;
}
}) });
-var require_fast_json_stable_stringify = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js": ((exports, module) => {
+var require_fast_json_stable_stringify2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js": ((exports, module) => {
module.exports = function(data, opts) {
if (!opts) opts = {};
if (typeof opts === "function") opts = { cmp: opts };
@@ -85062,7 +84418,7 @@ var require_validate2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.
};
}) });
var require_compile2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js": ((exports, module) => {
- var resolve$1 = require_resolve2(), util$2 = require_util2(), errorClasses$1 = require_error_classes(), stableStringify$1 = require_fast_json_stable_stringify();
+ var resolve$1 = require_resolve2(), util$2 = require_util2(), errorClasses$1 = require_error_classes2(), stableStringify$1 = require_fast_json_stable_stringify2();
var validateGenerator = require_validate2();
var ucs2length = util$2.ucs2length;
var equal = require_fast_deep_equal2();
@@ -85313,7 +84669,7 @@ var require_compile2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.1
return code;
}
}) });
-var require_cache = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js": ((exports, module) => {
+var require_cache2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js": ((exports, module) => {
var Cache$1 = module.exports = function Cache$2() {
this._cache = {};
};
@@ -85618,7 +84974,7 @@ var require_anyOf2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.
return out;
};
}) });
-var require_comment = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js": ((exports, module) => {
+var require_comment2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js": ((exports, module) => {
module.exports = function generate_comment(it, $keyword, $ruleType) {
var out = " ";
var $schema = it.schema[$keyword];
@@ -85891,7 +85247,7 @@ var require_enum2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6
return out;
};
}) });
-var require_format3 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js": ((exports, module) => {
+var require_format2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js": ((exports, module) => {
module.exports = function generate_format(it, $keyword, $ruleType) {
var out = " ";
var $lvl = it.level;
@@ -87192,17 +86548,17 @@ var require_uniqueItems2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv
return out;
};
}) });
-var require_dotjs = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js": ((exports, module) => {
+var require_dotjs2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js": ((exports, module) => {
module.exports = {
"$ref": require_ref2(),
allOf: require_allOf2(),
anyOf: require_anyOf2(),
- "$comment": require_comment(),
+ "$comment": require_comment2(),
const: require_const2(),
contains: require_contains2(),
dependencies: require_dependencies2(),
"enum": require_enum2(),
- format: require_format3(),
+ format: require_format2(),
"if": require_if2(),
items: require_items2(),
maximum: require__limit(),
@@ -87225,7 +86581,7 @@ var require_dotjs = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6
};
}) });
var require_rules2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/rules.js": ((exports, module) => {
- var ruleModules = require_dotjs(), toHash = require_util2().toHash;
+ var ruleModules = require_dotjs2(), toHash = require_util2().toHash;
module.exports = function rules$1() {
var RULES = [
{
@@ -87377,8 +86733,8 @@ var require_data$1 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.
return metaSchema$1;
};
}) });
-var require_async = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js": ((exports, module) => {
- var MissingRefError = require_error_classes().MissingRef;
+var require_async2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js": ((exports, module) => {
+ var MissingRefError = require_error_classes2().MissingRef;
module.exports = compileAsync;
function compileAsync(schema2, meta, callback) {
var self = this;
@@ -87431,7 +86787,7 @@ var require_async = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6
}
}
}) });
-var require_custom = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js": ((exports, module) => {
+var require_custom2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js": ((exports, module) => {
module.exports = function generate_custom(it, $keyword, $ruleType) {
var out = " ";
var $lvl = it.level;
@@ -87719,7 +87075,7 @@ var require_json_schema_draft_072 = /* @__PURE__ */ __commonJS2({ "node_modules/
"default": true
};
}) });
-var require_definition_schema = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/definition_schema.js": ((exports, module) => {
+var require_definition_schema2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/definition_schema.js": ((exports, module) => {
var metaSchema = require_json_schema_draft_072();
module.exports = {
$id: "https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",
@@ -87750,8 +87106,8 @@ var require_definition_schema = /* @__PURE__ */ __commonJS2({ "node_modules/.pnp
}) });
var require_keyword2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/keyword.js": ((exports, module) => {
var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
- var customRuleCode = require_custom();
- var definitionSchema = require_definition_schema();
+ var customRuleCode = require_custom2();
+ var definitionSchema = require_definition_schema2();
module.exports = {
add: addKeyword,
get: getKeyword,
@@ -87829,7 +87185,7 @@ var require_keyword2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.1
else return false;
}
}) });
-var require_data2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/data.json": ((exports, module) => {
+var require_data3 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/data.json": ((exports, module) => {
module.exports = {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
@@ -87844,7 +87200,7 @@ var require_data2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6
};
}) });
var require_ajv2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/ajv.js": ((exports, module) => {
- var compileSchema = require_compile2(), resolve = require_resolve2(), Cache = require_cache(), SchemaObject = require_schema_obj(), stableStringify = require_fast_json_stable_stringify(), formats = require_formats2(), rules = require_rules2(), $dataMetaSchema = require_data$1(), util2 = require_util2();
+ var compileSchema = require_compile2(), resolve = require_resolve2(), Cache = require_cache2(), SchemaObject = require_schema_obj2(), stableStringify = require_fast_json_stable_stringify2(), formats = require_formats2(), rules = require_rules2(), $dataMetaSchema = require_data$1(), util2 = require_util2();
module.exports = Ajv$2;
Ajv$2.prototype.validate = validate2;
Ajv$2.prototype.compile = compile;
@@ -87857,13 +87213,13 @@ var require_ajv2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/
Ajv$2.prototype.errorsText = errorsText;
Ajv$2.prototype._addSchema = _addSchema;
Ajv$2.prototype._compile = _compile;
- Ajv$2.prototype.compileAsync = require_async();
+ Ajv$2.prototype.compileAsync = require_async2();
var customKeyword = require_keyword2();
Ajv$2.prototype.addKeyword = customKeyword.add;
Ajv$2.prototype.getKeyword = customKeyword.get;
Ajv$2.prototype.removeKeyword = customKeyword.remove;
Ajv$2.prototype.validateKeyword = customKeyword.validate;
- var errorClasses = require_error_classes();
+ var errorClasses = require_error_classes2();
Ajv$2.ValidationError = errorClasses.Validation;
Ajv$2.MissingRefError = errorClasses.MissingRef;
Ajv$2.$dataMetaSchema = $dataMetaSchema;
@@ -88130,7 +87486,7 @@ var require_ajv2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/
function addDefaultMetaSchema(self) {
var $dataSchema;
if (self._opts.$data) {
- $dataSchema = require_data2();
+ $dataSchema = require_data3();
self.addMetaSchema($dataSchema, $dataSchema.$id, true);
}
if (self._opts.meta === false) return;
@@ -88184,7 +87540,7 @@ var require_ajv2 = /* @__PURE__ */ __commonJS2({ "node_modules/.pnpm/ajv@6.12.6/
var import_ajv$1 = /* @__PURE__ */ __toESM2(require_ajv2(), 1);
var import_ajv2 = /* @__PURE__ */ __toESM2(require_ajv2(), 1);
-// ../node_modules/.pnpm/mcp-proxy@5.10.0/node_modules/mcp-proxy/dist/index.js
+// ../node_modules/.pnpm/mcp-proxy@5.9.0/node_modules/mcp-proxy/dist/index.js
var ParseError = class extends Error {
constructor(message, options) {
super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
@@ -88783,15 +88139,15 @@ var EventSourceParserStream = class extends TransformStream {
}
};
-// ../node_modules/.pnpm/fastmcp@3.22.0_arktype@2.1.25_effect@3.16.12/node_modules/fastmcp/dist/FastMCP.js
+// ../node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.25_effect@3.16.12/node_modules/fastmcp/dist/FastMCP.js
var import_undici = __toESM(require_undici(), 1);
var import_uri_templates = __toESM(require_uri_templates(), 1);
import { setTimeout as delay } from "timers/promises";
-// ../node_modules/.pnpm/xsschema@0.4.0-beta.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index.js
-init_index_CLFto6T2();
+// ../node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_effect@3.16.12_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index.js
+init_index_CAcLDIRJ();
-// ../node_modules/.pnpm/fastmcp@3.22.0_arktype@2.1.25_effect@3.16.12/node_modules/fastmcp/dist/FastMCP.js
+// ../node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.25_effect@3.16.12/node_modules/fastmcp/dist/FastMCP.js
init_zod();
var FastMCPError = class extends Error {
constructor(message) {
@@ -89081,53 +88437,9 @@ ${e instanceof Error ? e.stack : JSON.stringify(e)}`
throw error41;
}
}
- promptsListChanged(prompts) {
- this.#prompts = [];
- for (const prompt of prompts) {
- this.addPrompt(prompt);
- }
- this.setupPromptHandlers(prompts);
- this.triggerListChangedNotification("notifications/prompts/list_changed");
- }
async requestSampling(message, options) {
return this.#server.createMessage(message, options);
}
- resourcesListChanged(resources) {
- this.#resources = [];
- for (const resource of resources) {
- this.addResource(resource);
- }
- this.setupResourceHandlers(resources);
- this.triggerListChangedNotification("notifications/resources/list_changed");
- }
- resourceTemplatesListChanged(resourceTemplates) {
- this.#resourceTemplates = [];
- for (const resourceTemplate of resourceTemplates) {
- this.addResourceTemplate(resourceTemplate);
- }
- this.setupResourceTemplateHandlers(resourceTemplates);
- this.triggerListChangedNotification("notifications/resources/list_changed");
- }
- toolsListChanged(tools) {
- const allowedTools = tools.filter(
- (tool2) => tool2.canAccess ? tool2.canAccess(this.#auth) : true
- );
- this.setupToolHandlers(allowedTools);
- this.triggerListChangedNotification("notifications/tools/list_changed");
- }
- async triggerListChangedNotification(method) {
- try {
- await this.#server.notification({
- method
- });
- } catch (error41) {
- this.#logger.error(
- `[FastMCP error] failed to send ${method} notification.
-
-${error41 instanceof Error ? error41.stack : JSON.stringify(error41)}`
- );
- }
- }
waitForReady() {
if (this.isReady) {
return Promise.resolve();
@@ -89705,9 +89017,6 @@ var FastMCP = class extends FastMCPEventEmitter {
this.#authenticate = options.authenticate;
this.#logger = options.logger || console;
}
- get serverState() {
- return this.#serverState;
- }
get sessions() {
return this.#sessions;
}
@@ -89718,102 +89027,31 @@ var FastMCP = class extends FastMCPEventEmitter {
#prompts = [];
#resources = [];
#resourcesTemplates = [];
- #serverState = "stopped";
#sessions = [];
#tools = [];
/**
* Adds a prompt to the server.
*/
addPrompt(prompt) {
- this.#prompts = this.#prompts.filter((p) => p.name !== prompt.name);
this.#prompts.push(prompt);
- if (this.#serverState === "running") {
- this.#promptsListChanged(this.#prompts);
- }
- }
- /**
- * Adds prompts to the server.
- */
- addPrompts(prompts) {
- const newPromptNames = new Set(prompts.map((prompt) => prompt.name));
- this.#prompts = this.#prompts.filter((p) => !newPromptNames.has(p.name));
- this.#prompts.push(...prompts);
- if (this.#serverState === "running") {
- this.#promptsListChanged(this.#prompts);
- }
}
/**
* Adds a resource to the server.
*/
addResource(resource) {
- this.#resources = this.#resources.filter((r) => r.name !== resource.name);
this.#resources.push(resource);
- if (this.#serverState === "running") {
- this.#resourcesListChanged(this.#resources);
- }
- }
- /**
- * Adds resources to the server.
- */
- addResources(resources) {
- const newResourceNames = new Set(
- resources.map((resource) => resource.name)
- );
- this.#resources = this.#resources.filter(
- (r) => !newResourceNames.has(r.name)
- );
- this.#resources.push(...resources);
- if (this.#serverState === "running") {
- this.#resourcesListChanged(this.#resources);
- }
}
/**
* Adds a resource template to the server.
*/
addResourceTemplate(resource) {
- this.#resourcesTemplates = this.#resourcesTemplates.filter(
- (t) => t.name !== resource.name
- );
this.#resourcesTemplates.push(resource);
- if (this.#serverState === "running") {
- this.#resourceTemplatesListChanged(this.#resourcesTemplates);
- }
- }
- /**
- * Adds resource templates to the server.
- */
- addResourceTemplates(resources) {
- const newResourceTemplateNames = new Set(
- resources.map((resource) => resource.name)
- );
- this.#resourcesTemplates = this.#resourcesTemplates.filter(
- (t) => !newResourceTemplateNames.has(t.name)
- );
- this.#resourcesTemplates.push(...resources);
- if (this.#serverState === "running") {
- this.#resourceTemplatesListChanged(this.#resourcesTemplates);
- }
}
/**
* Adds a tool to the server.
*/
addTool(tool2) {
- this.#tools = this.#tools.filter((t) => t.name !== tool2.name);
this.#tools.push(tool2);
- if (this.#serverState === "running") {
- this.#toolsListChanged(this.#tools);
- }
- }
- /**
- * Adds tools to the server.
- */
- addTools(tools) {
- const newToolNames = new Set(tools.map((tool2) => tool2.name));
- this.#tools = this.#tools.filter((t) => !newToolNames.has(t.name));
- this.#tools.push(...tools);
- if (this.#serverState === "running") {
- this.#toolsListChanged(this.#tools);
- }
}
/**
* Embeds a resource by URI, making it easy to include resources in tool responses.
@@ -89864,90 +89102,6 @@ var FastMCP = class extends FastMCPEventEmitter {
}
throw new UnexpectedStateError(`Resource not found: ${uri}`, { uri });
}
- /**
- * Removes a prompt from the server.
- */
- removePrompt(name) {
- this.#prompts = this.#prompts.filter((p) => p.name !== name);
- if (this.#serverState === "running") {
- this.#promptsListChanged(this.#prompts);
- }
- }
- /**
- * Removes prompts from the server.
- */
- removePrompts(names) {
- for (const name of names) {
- this.#prompts = this.#prompts.filter((p) => p.name !== name);
- }
- if (this.#serverState === "running") {
- this.#promptsListChanged(this.#prompts);
- }
- }
- /**
- * Removes a resource from the server.
- */
- removeResource(name) {
- this.#resources = this.#resources.filter((r) => r.name !== name);
- if (this.#serverState === "running") {
- this.#resourcesListChanged(this.#resources);
- }
- }
- /**
- * Removes resources from the server.
- */
- removeResources(names) {
- for (const name of names) {
- this.#resources = this.#resources.filter((r) => r.name !== name);
- }
- if (this.#serverState === "running") {
- this.#resourcesListChanged(this.#resources);
- }
- }
- /**
- * Removes a resource template from the server.
- */
- removeResourceTemplate(name) {
- this.#resourcesTemplates = this.#resourcesTemplates.filter(
- (t) => t.name !== name
- );
- if (this.#serverState === "running") {
- this.#resourceTemplatesListChanged(this.#resourcesTemplates);
- }
- }
- /**
- * Removes resource templates from the server.
- */
- removeResourceTemplates(names) {
- for (const name of names) {
- this.#resourcesTemplates = this.#resourcesTemplates.filter(
- (t) => t.name !== name
- );
- }
- if (this.#serverState === "running") {
- this.#resourceTemplatesListChanged(this.#resourcesTemplates);
- }
- }
- /**
- * Removes a tool from the server.
- */
- removeTool(name) {
- this.#tools = this.#tools.filter((t) => t.name !== name);
- if (this.#serverState === "running") {
- this.#toolsListChanged(this.#tools);
- }
- }
- /**
- * Removes tools from the server.
- */
- removeTools(names) {
- for (const name of names) {
- this.#tools = this.#tools.filter((t) => t.name !== name);
- }
- if (this.#serverState === "running") {
- this.#toolsListChanged(this.#tools);
- }
- }
/**
* Starts the server.
*/
@@ -90004,7 +89158,6 @@ var FastMCP = class extends FastMCPEventEmitter {
this.emit("connect", {
session
});
- this.#serverState = "running";
} else if (config2.transportType === "httpStream") {
const httpConfig = config2.httpStream;
if (httpConfig.stateless) {
@@ -90086,7 +89239,6 @@ var FastMCP = class extends FastMCPEventEmitter {
`[FastMCP info] server is running on HTTP Stream at http://${httpConfig.host}:${httpConfig.port}${httpConfig.endpoint}`
);
}
- this.#serverState = "running";
} else {
throw new Error("Invalid transport type");
}
@@ -90098,7 +89250,6 @@ var FastMCP = class extends FastMCPEventEmitter {
if (this.#httpStreamServer) {
await this.#httpStreamServer.close();
}
- this.#serverState = "stopped";
}
/**
* Creates a new FastMCPSession instance with the current configuration.
@@ -90239,14 +89390,6 @@ var FastMCP = class extends FastMCPEventEmitter {
}
return { transportType: "stdio" };
}
- /**
- * Notifies all sessions that the prompts list has changed.
- */
- #promptsListChanged(prompts) {
- for (const session of this.#sessions) {
- session.promptsListChanged(prompts);
- }
- }
#removeSession(session) {
const sessionIndex = this.#sessions.indexOf(session);
if (sessionIndex !== -1) {
@@ -90256,30 +89399,6 @@ var FastMCP = class extends FastMCPEventEmitter {
});
}
}
- /**
- * Notifies all sessions that the resources list has changed.
- */
- #resourcesListChanged(resources) {
- for (const session of this.#sessions) {
- session.resourcesListChanged(resources);
- }
- }
- /**
- * Notifies all sessions that the resource templates list has changed.
- */
- #resourceTemplatesListChanged(templates) {
- for (const session of this.#sessions) {
- session.resourceTemplatesListChanged(templates);
- }
- }
- /**
- * Notifies all sessions that the tools list has changed.
- */
- #toolsListChanged(tools) {
- for (const session of this.#sessions) {
- session.toolsListChanged(tools);
- }
- }
};
// ../node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/arrays.js
@@ -98758,7 +97877,7 @@ function Collection() {
}
var before_after_hook_default = { Singular, Collection };
-// ../node_modules/.pnpm/@octokit+endpoint@11.0.2/node_modules/@octokit/endpoint/dist-bundle/index.js
+// ../node_modules/.pnpm/@octokit+endpoint@11.0.1/node_modules/@octokit/endpoint/dist-bundle/index.js
var VERSION = "0.0.0-development";
var userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
var DEFAULTS = {
@@ -99071,10 +98190,10 @@ function withDefaults(oldDefaults, newDefaults) {
}
var endpoint = withDefaults(null, DEFAULTS);
-// ../node_modules/.pnpm/@octokit+request@10.0.6/node_modules/@octokit/request/dist-bundle/index.js
+// ../node_modules/.pnpm/@octokit+request@10.0.5/node_modules/@octokit/request/dist-bundle/index.js
var import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);
-// ../node_modules/.pnpm/@octokit+request-error@7.0.2/node_modules/@octokit/request-error/dist-src/index.js
+// ../node_modules/.pnpm/@octokit+request-error@7.0.1/node_modules/@octokit/request-error/dist-src/index.js
var RequestError = class extends Error {
name;
/**
@@ -99113,8 +98232,8 @@ var RequestError = class extends Error {
}
};
-// ../node_modules/.pnpm/@octokit+request@10.0.6/node_modules/@octokit/request/dist-bundle/index.js
-var VERSION2 = "10.0.6";
+// ../node_modules/.pnpm/@octokit+request@10.0.5/node_modules/@octokit/request/dist-bundle/index.js
+var VERSION2 = "10.0.5";
var defaults_default = {
headers: {
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
@@ -99287,7 +98406,7 @@ function withDefaults2(oldEndpoint, newDefaults) {
}
var request = withDefaults2(endpoint, defaults_default);
-// ../node_modules/.pnpm/@octokit+graphql@9.0.3/node_modules/@octokit/graphql/dist-bundle/index.js
+// ../node_modules/.pnpm/@octokit+graphql@9.0.2/node_modules/@octokit/graphql/dist-bundle/index.js
var VERSION3 = "0.0.0-development";
function _buildMessageForResponseErrors(data) {
return `Request failed due to following response errors:
@@ -99439,10 +98558,10 @@ var createTokenAuth = function createTokenAuth2(token) {
});
};
-// ../node_modules/.pnpm/@octokit+core@7.0.6/node_modules/@octokit/core/dist-src/version.js
-var VERSION4 = "7.0.6";
+// ../node_modules/.pnpm/@octokit+core@7.0.5/node_modules/@octokit/core/dist-src/version.js
+var VERSION4 = "7.0.5";
-// ../node_modules/.pnpm/@octokit+core@7.0.6/node_modules/@octokit/core/dist-src/index.js
+// ../node_modules/.pnpm/@octokit+core@7.0.5/node_modules/@octokit/core/dist-src/index.js
var noop2 = () => {
};
var consoleWarn = console.warn.bind(console);
@@ -99576,10 +98695,10 @@ var Octokit = class {
auth;
};
-// ../node_modules/.pnpm/@octokit+plugin-request-log@6.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/version.js
+// ../node_modules/.pnpm/@octokit+plugin-request-log@6.0.0_@octokit+core@7.0.5/node_modules/@octokit/plugin-request-log/dist-src/version.js
var VERSION5 = "6.0.0";
-// ../node_modules/.pnpm/@octokit+plugin-request-log@6.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/index.js
+// ../node_modules/.pnpm/@octokit+plugin-request-log@6.0.0_@octokit+core@7.0.5/node_modules/@octokit/plugin-request-log/dist-src/index.js
function requestLog(octokit) {
octokit.hook.wrap("request", (request2, options) => {
octokit.log.debug("request", options);
@@ -99603,7 +98722,7 @@ function requestLog(octokit) {
}
requestLog.VERSION = VERSION5;
-// ../node_modules/.pnpm/@octokit+plugin-paginate-rest@14.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js
+// ../node_modules/.pnpm/@octokit+plugin-paginate-rest@13.2.0_@octokit+core@7.0.5/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js
var VERSION6 = "0.0.0-development";
function normalizePaginatedListResponse(response) {
if (!response.data) {
@@ -99719,10 +98838,10 @@ function paginateRest(octokit) {
}
paginateRest.VERSION = VERSION6;
-// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
-var VERSION7 = "17.0.0";
+// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@16.1.0_@octokit+core@7.0.5/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
+var VERSION7 = "16.1.0";
-// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
+// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@16.1.0_@octokit+core@7.0.5/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
var Endpoints = {
actions: {
addCustomLabelsToSelfHostedRunnerForOrg: [
@@ -99781,12 +98900,6 @@ var Endpoints = {
deleteArtifact: [
"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
],
- deleteCustomImageFromOrg: [
- "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
- ],
- deleteCustomImageVersionFromOrg: [
- "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
- ],
deleteEnvironmentSecret: [
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
],
@@ -99860,12 +98973,6 @@ var Endpoints = {
"GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
],
getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
- getCustomImageForOrg: [
- "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
- ],
- getCustomImageVersionForOrg: [
- "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
- ],
getCustomOidcSubClaimForRepo: [
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
],
@@ -99945,12 +99052,6 @@ var Endpoints = {
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
],
listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
- listCustomImageVersionsForOrg: [
- "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"
- ],
- listCustomImagesForOrg: [
- "GET /orgs/{org}/actions/hosted-runners/images/custom"
- ],
listEnvironmentSecrets: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"
],
@@ -100209,12 +99310,6 @@ var Endpoints = {
getGithubActionsBillingUser: [
"GET /users/{username}/settings/billing/actions"
],
- getGithubBillingPremiumRequestUsageReportOrg: [
- "GET /organizations/{org}/settings/billing/premium_request/usage"
- ],
- getGithubBillingPremiumRequestUsageReportUser: [
- "GET /users/{username}/settings/billing/premium_request/usage"
- ],
getGithubBillingUsageReportOrg: [
"GET /organizations/{org}/settings/billing/usage"
],
@@ -100582,51 +99677,6 @@ var Endpoints = {
exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
},
emojis: { get: ["GET /emojis"] },
- enterpriseTeamMemberships: {
- add: [
- "PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
- ],
- bulkAdd: [
- "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"
- ],
- bulkRemove: [
- "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"
- ],
- get: [
- "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
- ],
- list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],
- remove: [
- "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
- ]
- },
- enterpriseTeamOrganizations: {
- add: [
- "PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
- ],
- bulkAdd: [
- "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"
- ],
- bulkRemove: [
- "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"
- ],
- delete: [
- "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
- ],
- getAssignment: [
- "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
- ],
- getAssignments: [
- "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"
- ]
- },
- enterpriseTeams: {
- create: ["POST /enterprises/{enterprise}/teams"],
- delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"],
- get: ["GET /enterprises/{enterprise}/teams/{team_slug}"],
- list: ["GET /enterprises/{enterprise}/teams"],
- update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"]
- },
gists: {
checkIsStarred: ["GET /gists/{gist_id}/star"],
create: ["POST /gists"],
@@ -100896,34 +99946,14 @@ var Endpoints = {
],
createInvitation: ["POST /orgs/{org}/invitations"],
createIssueType: ["POST /orgs/{org}/issue-types"],
- createWebhook: ["POST /orgs/{org}/hooks"],
- customPropertiesForOrgsCreateOrUpdateOrganizationValues: [
- "PATCH /organizations/{org}/org-properties/values"
- ],
- customPropertiesForOrgsGetOrganizationValues: [
- "GET /organizations/{org}/org-properties/values"
- ],
- customPropertiesForReposCreateOrUpdateOrganizationDefinition: [
- "PUT /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [
- "PATCH /orgs/{org}/properties/schema"
- ],
- customPropertiesForReposCreateOrUpdateOrganizationValues: [
+ createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
+ createOrUpdateCustomPropertiesValuesForRepos: [
"PATCH /orgs/{org}/properties/values"
],
- customPropertiesForReposDeleteOrganizationDefinition: [
- "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- customPropertiesForReposGetOrganizationDefinition: [
- "GET /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- customPropertiesForReposGetOrganizationDefinitions: [
- "GET /orgs/{org}/properties/schema"
- ],
- customPropertiesForReposGetOrganizationValues: [
- "GET /orgs/{org}/properties/values"
+ createOrUpdateCustomProperty: [
+ "PUT /orgs/{org}/properties/schema/{custom_property_name}"
],
+ createWebhook: ["POST /orgs/{org}/hooks"],
delete: ["DELETE /orgs/{org}"],
deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"],
deleteAttestationsById: [
@@ -100934,18 +99964,10 @@ var Endpoints = {
],
deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"],
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
- disableSelectedRepositoryImmutableReleasesOrganization: [
- "DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
- ],
- enableSelectedRepositoryImmutableReleasesOrganization: [
- "PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
- ],
get: ["GET /orgs/{org}"],
- getImmutableReleasesSettings: [
- "GET /orgs/{org}/settings/immutable-releases"
- ],
- getImmutableReleasesSettingsRepositories: [
- "GET /orgs/{org}/settings/immutable-releases/repositories"
+ getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
+ getCustomProperty: [
+ "GET /orgs/{org}/properties/schema/{custom_property_name}"
],
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
@@ -100964,12 +99986,12 @@ var Endpoints = {
listArtifactStorageRecords: [
"GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"
],
- listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"],
listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"],
listAttestationsBulk: [
"POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"
],
listBlockedUsers: ["GET /orgs/{org}/blocks"],
+ listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
listForAuthenticatedUser: ["GET /user/orgs"],
listForUser: ["GET /users/{username}/orgs"],
@@ -101007,6 +100029,9 @@ var Endpoints = {
redeliverWebhookDelivery: [
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
],
+ removeCustomProperty: [
+ "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
+ ],
removeMember: ["DELETE /orgs/{org}/members/{username}"],
removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
removeOutsideCollaborator: [
@@ -101040,12 +100065,6 @@ var Endpoints = {
revokeOrgRoleUser: [
"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
],
- setImmutableReleasesSettings: [
- "PUT /orgs/{org}/settings/immutable-releases"
- ],
- setImmutableReleasesSettingsRepositories: [
- "PUT /orgs/{org}/settings/immutable-releases/repositories"
- ],
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
setPublicMembershipForAuthenticatedUser: [
"PUT /orgs/{org}/public_members/{username}"
@@ -101167,42 +100186,40 @@ var Endpoints = {
},
projects: {
addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"],
- addItemForUser: [
- "POST /users/{username}/projectsV2/{project_number}/items"
- ],
+ addItemForUser: ["POST /users/{user_id}/projectsV2/{project_number}/items"],
deleteItemForOrg: [
"DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
],
deleteItemForUser: [
- "DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"
+ "DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}"
],
getFieldForOrg: [
"GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"
],
getFieldForUser: [
- "GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"
+ "GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}"
],
getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"],
- getForUser: ["GET /users/{username}/projectsV2/{project_number}"],
+ getForUser: ["GET /users/{user_id}/projectsV2/{project_number}"],
getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],
getUserItem: [
- "GET /users/{username}/projectsV2/{project_number}/items/{item_id}"
+ "GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}"
],
listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"],
listFieldsForUser: [
- "GET /users/{username}/projectsV2/{project_number}/fields"
+ "GET /users/{user_id}/projectsV2/{project_number}/fields"
],
listForOrg: ["GET /orgs/{org}/projectsV2"],
listForUser: ["GET /users/{username}/projectsV2"],
listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"],
listItemsForUser: [
- "GET /users/{username}/projectsV2/{project_number}/items"
+ "GET /users/{user_id}/projectsV2/{project_number}/items"
],
updateItemForOrg: [
"PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
],
updateItemForUser: [
- "PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"
+ "PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}"
]
},
pulls: {
@@ -101365,7 +100382,6 @@ var Endpoints = {
"GET /repos/{owner}/{repo}/automated-security-fixes"
],
checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
- checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"],
checkPrivateVulnerabilityReporting: [
"GET /repos/{owner}/{repo}/private-vulnerability-reporting"
],
@@ -101401,6 +100417,9 @@ var Endpoints = {
createForAuthenticatedUser: ["POST /user/repos"],
createFork: ["POST /repos/{owner}/{repo}/forks"],
createInOrg: ["POST /orgs/{org}/repos"],
+ createOrUpdateCustomPropertiesValues: [
+ "PATCH /repos/{owner}/{repo}/properties/values"
+ ],
createOrUpdateEnvironment: [
"PUT /repos/{owner}/{repo}/environments/{environment_name}"
],
@@ -101414,12 +100433,6 @@ var Endpoints = {
"POST /repos/{template_owner}/{template_repo}/generate"
],
createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
- customPropertiesForReposCreateOrUpdateRepositoryValues: [
- "PATCH /repos/{owner}/{repo}/properties/values"
- ],
- customPropertiesForReposGetRepositoryValues: [
- "GET /repos/{owner}/{repo}/properties/values"
- ],
declineInvitation: [
"DELETE /user/repository_invitations/{invitation_id}",
{},
@@ -101474,9 +100487,6 @@ var Endpoints = {
disableDeploymentProtectionRule: [
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
],
- disableImmutableReleases: [
- "DELETE /repos/{owner}/{repo}/immutable-releases"
- ],
disablePrivateVulnerabilityReporting: [
"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
],
@@ -101493,7 +100503,6 @@ var Endpoints = {
enableAutomatedSecurityFixes: [
"PUT /repos/{owner}/{repo}/automated-security-fixes"
],
- enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"],
enablePrivateVulnerabilityReporting: [
"PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
],
@@ -101545,6 +100554,7 @@ var Endpoints = {
getCustomDeploymentProtectionRule: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
],
+ getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
getDeploymentBranchPolicy: [
@@ -101762,7 +100772,13 @@ var Endpoints = {
search: {
code: ["GET /search/code"],
commits: ["GET /search/commits"],
- issuesAndPullRequests: ["GET /search/issues"],
+ issuesAndPullRequests: [
+ "GET /search/issues",
+ {},
+ {
+ deprecated: "octokit.rest.search.issuesAndPullRequests() is deprecated, see https://docs.github.com/rest/search/search#search-issues-and-pull-requests"
+ }
+ ],
labels: ["GET /search/labels"],
repos: ["GET /search/repositories"],
topics: ["GET /search/topics"],
@@ -101776,6 +100792,9 @@ var Endpoints = {
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
],
getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],
+ listAlertsForEnterprise: [
+ "GET /enterprises/{enterprise}/secret-scanning/alerts"
+ ],
listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
listLocationsForAlert: [
@@ -102014,7 +101033,7 @@ var Endpoints = {
};
var endpoints_default = Endpoints;
-// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
+// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@16.1.0_@octokit+core@7.0.5/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
var endpointMethodsMap = /* @__PURE__ */ new Map();
for (const [scope2, endpoints] of Object.entries(endpoints_default)) {
for (const [methodName, endpoint2] of Object.entries(endpoints)) {
@@ -102137,7 +101156,7 @@ function decorate(octokit, scope2, methodName, defaults, decorations) {
return Object.assign(withDecorations, requestWithDefaults);
}
-// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
+// ../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@16.1.0_@octokit+core@7.0.5/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
function restEndpointMethods(octokit) {
const api = endpointsToMethods(octokit);
return {
@@ -102154,10 +101173,10 @@ function legacyRestEndpointMethods(octokit) {
}
legacyRestEndpointMethods.VERSION = VERSION7;
-// ../node_modules/.pnpm/@octokit+rest@22.0.1/node_modules/@octokit/rest/dist-src/version.js
-var VERSION8 = "22.0.1";
+// ../node_modules/.pnpm/@octokit+rest@22.0.0/node_modules/@octokit/rest/dist-src/version.js
+var VERSION8 = "22.0.0";
-// ../node_modules/.pnpm/@octokit+rest@22.0.1/node_modules/@octokit/rest/dist-src/index.js
+// ../node_modules/.pnpm/@octokit+rest@22.0.0/node_modules/@octokit/rest/dist-src/index.js
var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults(
{
userAgent: `octokit-rest.js/${VERSION8}`
@@ -102165,10 +101184,10 @@ var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRes
);
// utils/github.ts
-var core2 = __toESM(require_core3(), 1);
+var core2 = __toESM(require_core(), 1);
// utils/cli.ts
-var core = __toESM(require_core3(), 1);
+var core = __toESM(require_core(), 1);
var isGitHubActions = !!process.env.GITHUB_ACTIONS;
var isDebugEnabled = process.env.LOG_LEVEL === "debug";
function startGroup2(name) {
@@ -102674,6 +101693,10 @@ addTools(server, [
server.start();
/*! Bundled license information:
+uri-js/dist/es5/uri.all.js:
+mcp-proxy/dist/stdio-CsjPjeWC.js:
+ (** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
+
undici/lib/web/fetch/body.js:
undici/lib/fetch/body.js:
(*! formdata-polyfill. MIT License. Jimmy Wärting *)
@@ -102682,13 +101705,10 @@ undici/lib/web/websocket/frame.js:
undici/lib/websocket/frame.js:
(*! ws. MIT License. Einar Otto Stangvik *)
-mcp-proxy/dist/stdio-DF5lH8jj.js:
+mcp-proxy/dist/stdio-CsjPjeWC.js:
(*!
* depd
* Copyright(c) 2014-2018 Douglas Christopher Wilson
* MIT Licensed
*)
-
-mcp-proxy/dist/stdio-DF5lH8jj.js:
- (** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
*/