docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,6 @@
import { ZodDefaultDef } from "zod/v3";
import { JsonSchema7Type } from "../parseTypes.js";
import { Refs } from "../Refs.js";
export declare function parseDefaultDef(_def: ZodDefaultDef, refs: Refs): JsonSchema7Type & {
default: any;
};
@@ -0,0 +1,264 @@
/**
* @fileoverview Rule to disallow returning values from Promise executor functions
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const functionTypesToCheck = new Set([
"ArrowFunctionExpression",
"FunctionExpression",
]);
/**
* Determines whether the given function node is used as a Promise executor.
* @param {ASTNode} node The node to check.
* @param {SourceCode} sourceCode Source code to which the node belongs.
* @returns {boolean} `true` if the node is a Promise executor.
*/
function isPromiseExecutor(node, sourceCode) {
const parent = node.parent;
return (
parent.type === "NewExpression" &&
parent.arguments[0] === node &&
parent.callee.type === "Identifier" &&
parent.callee.name === "Promise" &&
sourceCode.isGlobalReference(parent.callee)
);
}
/**
* Checks if the given node is a void expression.
* @param {ASTNode} node The node to check.
* @returns {boolean} - `true` if the node is a void expression
*/
function expressionIsVoid(node) {
return node.type === "UnaryExpression" && node.operator === "void";
}
/**
* Fixes the linting error by prepending "void " to the given node
* @param {Object} sourceCode context given by context.sourceCode
* @param {ASTNode} node The node to fix.
* @param {Object} fixer The fixer object provided by ESLint.
* @returns {Array<Object>} - An array of fix objects to apply to the node.
*/
function voidPrependFixer(sourceCode, node, fixer) {
const requiresParens =
// prepending `void ` will fail if the node has a lower precedence than void
astUtils.getPrecedence(node) <
astUtils.getPrecedence({
type: "UnaryExpression",
operator: "void",
}) &&
// check if there are parentheses around the node to avoid redundant parentheses
!astUtils.isParenthesised(sourceCode, node);
// avoid parentheses issues
const returnOrArrowToken = sourceCode.getTokenBefore(
node,
node.parent.type === "ArrowFunctionExpression"
? astUtils.isArrowToken
: // isReturnToken
token => token.type === "Keyword" && token.value === "return",
);
const firstToken = sourceCode.getTokenAfter(returnOrArrowToken);
const prependSpace =
// is return token, as => allows void to be adjacent
returnOrArrowToken.value === "return" &&
// If two tokens (return and "(") are adjacent
returnOrArrowToken.range[1] === firstToken.range[0];
return [
fixer.insertTextBefore(
firstToken,
`${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`,
),
fixer.insertTextAfter(node, requiresParens ? ")" : ""),
];
}
/**
* Fixes the linting error by `wrapping {}` around the given node's body.
* @param {Object} sourceCode context given by context.sourceCode
* @param {ASTNode} node The node to fix.
* @param {Object} fixer The fixer object provided by ESLint.
* @returns {Array<Object>} - An array of fix objects to apply to the node.
*/
function curlyWrapFixer(sourceCode, node, fixer) {
// https://github.com/eslint/eslint/pull/17282#issuecomment-1592795923
const arrowToken = sourceCode.getTokenBefore(
node.body,
astUtils.isArrowToken,
);
const firstToken = sourceCode.getTokenAfter(arrowToken);
const lastToken = sourceCode.getLastToken(node);
return [
fixer.insertTextBefore(firstToken, "{"),
fixer.insertTextAfter(lastToken, "}"),
];
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
allowVoid: false,
},
],
docs: {
description:
"Disallow returning values from Promise executor functions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-promise-executor-return",
},
hasSuggestions: true,
schema: [
{
type: "object",
properties: {
allowVoid: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
returnsValue:
"Return values from promise executor functions cannot be read.",
// arrow and function suggestions
prependVoid: "Prepend `void` to the expression.",
// only arrow suggestions
wrapBraces: "Wrap the expression in `{}`.",
},
},
create(context) {
let funcInfo = null;
const sourceCode = context.sourceCode;
const [{ allowVoid }] = context.options;
return {
onCodePathStart(_, node) {
funcInfo = {
upper: funcInfo,
shouldCheck:
functionTypesToCheck.has(node.type) &&
isPromiseExecutor(node, sourceCode),
};
if (
// Is a Promise executor
funcInfo.shouldCheck &&
node.type === "ArrowFunctionExpression" &&
node.expression &&
// Except void
!(allowVoid && expressionIsVoid(node.body))
) {
const suggest = [];
// prevent useless refactors
if (allowVoid) {
suggest.push({
messageId: "prependVoid",
fix(fixer) {
return voidPrependFixer(
sourceCode,
node.body,
fixer,
);
},
});
}
// Do not suggest wrapping an unnamed FunctionExpression in braces as that would be invalid syntax.
if (
!(
node.body.type === "FunctionExpression" &&
!node.body.id
)
) {
suggest.push({
messageId: "wrapBraces",
fix(fixer) {
return curlyWrapFixer(sourceCode, node, fixer);
},
});
}
context.report({
node: node.body,
messageId: "returnsValue",
suggest,
});
}
},
onCodePathEnd() {
funcInfo = funcInfo.upper;
},
ReturnStatement(node) {
if (!(funcInfo.shouldCheck && node.argument)) {
return;
}
// node is `return <expression>`
if (!allowVoid) {
context.report({ node, messageId: "returnsValue" });
return;
}
if (expressionIsVoid(node.argument)) {
return;
}
// allowVoid && !expressionIsVoid
context.report({
node,
messageId: "returnsValue",
suggest: [
{
messageId: "prependVoid",
fix(fixer) {
return voidPrependFixer(
sourceCode,
node.argument,
fixer,
);
},
},
],
});
},
};
},
};
@@ -0,0 +1,30 @@
import { Manifest } from '../manifest.cjs';
import { MakeRouteMatch } from '../Matches.cjs';
export interface DehydratedMatch {
i: MakeRouteMatch['id'];
b?: MakeRouteMatch['__beforeLoadContext'];
l?: MakeRouteMatch['loaderData'];
e?: MakeRouteMatch['error'];
u: MakeRouteMatch['updatedAt'];
s: MakeRouteMatch['status'];
ssr?: MakeRouteMatch['ssr'];
g?: true;
}
export interface DehydratedRouter {
manifest: Manifest | undefined;
dehydratedData?: any;
lastMatchId?: string;
matches: Array<DehydratedMatch>;
}
export interface TsrSsrGlobal {
router?: DehydratedRouter;
h: () => void;
e: () => void;
c: () => void;
p: (script: () => void) => void;
buffer: Array<() => void>;
t?: Map<string, (value: any) => any>;
initialized?: boolean;
hydrated?: boolean;
streamEnded?: boolean;
}
@@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _asyncGeneratorDelegate;
var _OverloadYield = require("./OverloadYield.js");
function _asyncGeneratorDelegate(inner) {
var iter = {},
waiting = false;
function pump(key, value) {
waiting = true;
value = new Promise(function (resolve) {
resolve(inner[key](value));
});
return {
done: false,
value: new _OverloadYield.default(value, 1)
};
}
iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () {
return this;
};
iter.next = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("next", value);
};
if (typeof inner["throw"] === "function") {
iter["throw"] = function (value) {
if (waiting) {
waiting = false;
throw value;
}
return pump("throw", value);
};
}
if (typeof inner["return"] === "function") {
iter["return"] = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("return", value);
};
}
return iter;
}
//# sourceMappingURL=asyncGeneratorDelegate.js.map
@@ -0,0 +1,492 @@
import { mediaTypeEssence } from '../shared/mediaType.js';
import { createFetchWithInit, fetchLeavingRedirects, fetchWithinOrigin, followWithinOrigin, normalizeHeaders, unfollowedRedirect } from '../shared/transport.js';
import { isInitializedNotification, isJSONRPCRequest, isJSONRPCResultResponse, JSONRPCMessageSchema } from '../types.js';
import { auth, extractWWWAuthenticateParams, UnauthorizedError } from './auth.js';
import { EventSourceParserStream } from 'eventsource-parser/stream';
// Default reconnection options for StreamableHTTP connections
const DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
initialReconnectionDelay: 1000,
maxReconnectionDelay: 30000,
reconnectionDelayGrowFactor: 1.5,
maxRetries: 2
};
export class StreamableHTTPError extends Error {
constructor(code, message) {
super(`Streamable HTTP error: ${message}`);
this.code = code;
}
}
/**
* Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification.
* It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events
* for receiving messages.
*/
export class StreamableHTTPClientTransport {
constructor(url, opts) {
this._hasCompletedAuthFlow = false; // Circuit breaker: detect auth success followed by immediate 401
this._url = url;
this._resourceMetadataUrl = undefined;
this._scope = undefined;
this._requestInit = opts?.requestInit;
this._authProvider = opts?.authProvider;
this._fetch = opts?.fetch;
this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit);
this._followRedirects = opts?.redirectPolicy === 'follow';
if (this._followRedirects) {
this._fetch = fetchLeavingRedirects(this._fetch);
this._fetchWithInit = fetchLeavingRedirects(this._fetchWithInit);
}
this._sessionId = opts?.sessionId;
this._reconnectionOptions = opts?.reconnectionOptions ?? DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS;
}
/** Error text for a redirect `response` that was not followed, or `undefined` for any other response. */
_unfollowedRedirect(response, url) {
const text = unfollowedRedirect(response, url);
return text && !this._followRedirects ? `${text} (redirectPolicy: 'same-origin')` : text;
}
async _authThenStart() {
if (!this._authProvider) {
throw new UnauthorizedError('No auth provider');
}
let result;
try {
result = await auth(this._authProvider, {
serverUrl: this._url,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetchWithInit
});
}
catch (error) {
this.onerror?.(error);
throw error;
}
if (result !== 'AUTHORIZED') {
throw new UnauthorizedError();
}
return await this._startOrAuthSse({ resumptionToken: undefined });
}
async _commonHeaders() {
const headers = {};
if (this._authProvider) {
const tokens = await this._authProvider.tokens();
if (tokens) {
headers['Authorization'] = `Bearer ${tokens.access_token}`;
}
}
if (this._sessionId) {
headers['mcp-session-id'] = this._sessionId;
}
if (this._protocolVersion) {
headers['mcp-protocol-version'] = this._protocolVersion;
}
const extraHeaders = normalizeHeaders(this._requestInit?.headers);
return new Headers({
...headers,
...extraHeaders
});
}
async _startOrAuthSse(options) {
const { resumptionToken } = options;
try {
// Try to open an initial SSE stream with GET to listen for server messages
// This is optional according to the spec - server may not support it
const headers = await this._commonHeaders();
headers.set('Accept', 'text/event-stream');
// Include Last-Event-ID header for resumable streams if provided
if (resumptionToken) {
headers.set('last-event-id', resumptionToken);
}
const fetchFn = this._fetch ?? fetch;
const init = { method: 'GET', headers, signal: this._abortController?.signal };
// A response that is not a redirect is used as it arrives, so reading the stream starts as early as before.
let response = await fetchFn(this._url, this._followRedirects ? init : { ...init, redirect: 'manual' });
const followed = this._followRedirects ? undefined : followWithinOrigin(fetchFn, this._url, init, response);
if (followed) {
response = await followed;
}
if (!response.ok) {
await response.body?.cancel();
if (response.status === 401 && this._authProvider) {
// Need to authenticate
return await this._authThenStart();
}
// 405 indicates that the server does not offer an SSE stream at GET endpoint
// This is an expected case that should not trigger an error
if (response.status === 405) {
return;
}
throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${this._unfollowedRedirect(response, this._url) ?? response.statusText}`);
}
this._handleSseStream(response.body, options, true);
}
catch (error) {
this.onerror?.(error);
throw error;
}
}
/**
* Calculates the next reconnection delay using backoff algorithm
*
* @param attempt Current reconnection attempt count for the specific stream
* @returns Time to wait in milliseconds before next reconnection attempt
*/
_getNextReconnectionDelay(attempt) {
// Use server-provided retry value if available
if (this._serverRetryMs !== undefined) {
return this._serverRetryMs;
}
// Fall back to exponential backoff
const initialDelay = this._reconnectionOptions.initialReconnectionDelay;
const growFactor = this._reconnectionOptions.reconnectionDelayGrowFactor;
const maxDelay = this._reconnectionOptions.maxReconnectionDelay;
// Cap at maximum delay
return Math.min(initialDelay * Math.pow(growFactor, attempt), maxDelay);
}
/**
* Schedule a reconnection attempt using server-provided retry interval or backoff
*
* @param lastEventId The ID of the last received event for resumability
* @param attemptCount Current reconnection attempt count for this specific stream
*/
_scheduleReconnection(options, attemptCount = 0) {
// Use provided options or default options
const maxRetries = this._reconnectionOptions.maxRetries;
// Check if we've exceeded maximum retry attempts
if (attemptCount >= maxRetries) {
this.onerror?.(new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`));
return;
}
// Calculate next delay based on current attempt count
const delay = this._getNextReconnectionDelay(attemptCount);
// Schedule the reconnection
this._reconnectionTimeout = setTimeout(() => {
// Use the last event ID to resume where we left off
this._startOrAuthSse(options).catch(error => {
this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`));
// Schedule another attempt if this one failed, incrementing the attempt counter
this._scheduleReconnection(options, attemptCount + 1);
});
}, delay);
}
_handleSseStream(stream, options, isReconnectable) {
if (!stream) {
return;
}
const { onresumptiontoken, replayMessageId } = options;
let lastEventId;
// Track whether we've received a priming event (event with ID)
// Per spec, server SHOULD send a priming event with ID before closing
let hasPrimingEvent = false;
// Track whether we've received a response - if so, no need to reconnect
// Reconnection is for when server disconnects BEFORE sending response
let receivedResponse = false;
const processStream = async () => {
// this is the closest we can get to trying to catch network errors
// if something happens reader will throw
try {
// Create a pipeline: binary stream -> text decoder -> SSE parser
const reader = stream
.pipeThrough(new TextDecoderStream())
.pipeThrough(new EventSourceParserStream({
onRetry: (retryMs) => {
// Capture server-provided retry value for reconnection timing
this._serverRetryMs = retryMs;
}
}))
.getReader();
while (true) {
const { value: event, done } = await reader.read();
if (done) {
break;
}
// Update last event ID if provided
if (event.id) {
lastEventId = event.id;
// Mark that we've received a priming event - stream is now resumable
hasPrimingEvent = true;
onresumptiontoken?.(event.id);
}
// Skip events with no data (priming events, keep-alives)
if (!event.data) {
continue;
}
if (!event.event || event.event === 'message') {
try {
const message = JSONRPCMessageSchema.parse(JSON.parse(event.data));
if (isJSONRPCResultResponse(message)) {
// Mark that we received a response - no need to reconnect for this request
receivedResponse = true;
if (replayMessageId !== undefined) {
message.id = replayMessageId;
}
}
this.onmessage?.(message);
}
catch (error) {
this.onerror?.(error);
}
}
}
// Handle graceful server-side disconnect
// Server may close connection after sending event ID and retry field
// Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID)
// BUT don't reconnect if we already received a response - the request is complete
const canResume = isReconnectable || hasPrimingEvent;
const needsReconnect = canResume && !receivedResponse;
if (needsReconnect && this._abortController && !this._abortController.signal.aborted) {
this._scheduleReconnection({
resumptionToken: lastEventId,
onresumptiontoken,
replayMessageId
}, 0);
}
}
catch (error) {
// Handle stream errors - likely a network disconnect
this.onerror?.(new Error(`SSE stream disconnected: ${error}`));
// Attempt to reconnect if the stream disconnects unexpectedly and we aren't closing
// Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID)
// BUT don't reconnect if we already received a response - the request is complete
const canResume = isReconnectable || hasPrimingEvent;
const needsReconnect = canResume && !receivedResponse;
if (needsReconnect && this._abortController && !this._abortController.signal.aborted) {
// Use the exponential backoff reconnection strategy
try {
this._scheduleReconnection({
resumptionToken: lastEventId,
onresumptiontoken,
replayMessageId
}, 0);
}
catch (error) {
this.onerror?.(new Error(`Failed to reconnect: ${error instanceof Error ? error.message : String(error)}`));
}
}
}
};
processStream();
}
async start() {
if (this._abortController) {
throw new Error('StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.');
}
this._abortController = new AbortController();
}
/**
* Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
*/
async finishAuth(authorizationCode) {
if (!this._authProvider) {
throw new UnauthorizedError('No auth provider');
}
const result = await auth(this._authProvider, {
serverUrl: this._url,
authorizationCode,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetchWithInit
});
if (result !== 'AUTHORIZED') {
throw new UnauthorizedError('Failed to authorize');
}
}
async close() {
if (this._reconnectionTimeout) {
clearTimeout(this._reconnectionTimeout);
this._reconnectionTimeout = undefined;
}
this._abortController?.abort();
this.onclose?.();
}
async send(message, options) {
try {
const { resumptionToken, onresumptiontoken } = options || {};
if (resumptionToken) {
// If we have at last event ID, we need to reconnect the SSE stream
this._startOrAuthSse({ resumptionToken, replayMessageId: isJSONRPCRequest(message) ? message.id : undefined }).catch(err => this.onerror?.(err));
return;
}
const headers = await this._commonHeaders();
headers.set('content-type', 'application/json');
headers.set('accept', 'application/json, text/event-stream');
const init = {
...this._requestInit,
method: 'POST',
headers,
body: JSON.stringify(message),
signal: this._abortController?.signal
};
const response = await fetchWithinOrigin(this._fetch ?? fetch)(this._url, init);
// Handle session ID received during initialization
const sessionId = response.headers.get('mcp-session-id');
if (sessionId) {
this._sessionId = sessionId;
}
if (!response.ok) {
const text = await response.text().catch(() => null);
if (response.status === 401 && this._authProvider) {
// Prevent infinite recursion when server returns 401 after successful auth
if (this._hasCompletedAuthFlow) {
throw new StreamableHTTPError(401, 'Server returned 401 after successful authentication');
}
const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
this._resourceMetadataUrl = resourceMetadataUrl;
this._scope = scope;
const result = await auth(this._authProvider, {
serverUrl: this._url,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetchWithInit
});
if (result !== 'AUTHORIZED') {
throw new UnauthorizedError();
}
// Mark that we completed auth flow
this._hasCompletedAuthFlow = true;
// Purposely _not_ awaited, so we don't call onerror twice
return this.send(message);
}
if (response.status === 403 && this._authProvider) {
const { resourceMetadataUrl, scope, error } = extractWWWAuthenticateParams(response);
if (error === 'insufficient_scope') {
const wwwAuthHeader = response.headers.get('WWW-Authenticate');
// Check if we've already tried upscoping with this header to prevent infinite loops.
if (this._lastUpscopingHeader === wwwAuthHeader) {
throw new StreamableHTTPError(403, 'Server returned 403 after trying upscoping');
}
if (scope) {
this._scope = scope;
}
if (resourceMetadataUrl) {
this._resourceMetadataUrl = resourceMetadataUrl;
}
// Mark that upscoping was tried.
this._lastUpscopingHeader = wwwAuthHeader ?? undefined;
const result = await auth(this._authProvider, {
serverUrl: this._url,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetch
});
if (result !== 'AUTHORIZED') {
throw new UnauthorizedError();
}
return this.send(message);
}
}
throw new StreamableHTTPError(response.status, `Error POSTing to endpoint: ${this._unfollowedRedirect(response, this._url) ?? text}`);
}
// Reset auth loop flag on successful response
this._hasCompletedAuthFlow = false;
this._lastUpscopingHeader = undefined;
// If the response is 202 Accepted, there's no body to process
if (response.status === 202) {
await response.body?.cancel();
// if the accepted notification is initialized, we start the SSE stream
// if it's supported by the server
if (isInitializedNotification(message)) {
// Start without a lastEventId since this is a fresh connection
this._startOrAuthSse({ resumptionToken: undefined }).catch(err => this.onerror?.(err));
}
return;
}
// Get original message(s) for detecting request IDs
const messages = Array.isArray(message) ? message : [message];
const hasRequests = messages.filter(msg => 'method' in msg && 'id' in msg && msg.id !== undefined).length > 0;
// Check the response type (parsed media type — see mediaTypeEssence)
const contentType = response.headers.get('content-type');
const responseMediaType = mediaTypeEssence(contentType);
if (hasRequests) {
if (responseMediaType === 'text/event-stream') {
// Handle SSE stream responses for requests
// We use the same handler as standalone streams, which now supports
// reconnection with the last event ID
this._handleSseStream(response.body, { onresumptiontoken }, false);
}
else if (responseMediaType === 'application/json') {
// For non-streaming servers, we might get direct JSON responses
const data = await response.json();
const responseMessages = Array.isArray(data)
? data.map(msg => JSONRPCMessageSchema.parse(msg))
: [JSONRPCMessageSchema.parse(data)];
for (const msg of responseMessages) {
this.onmessage?.(msg);
}
}
else {
await response.body?.cancel();
throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType}`);
}
}
else {
// No requests in message but got 200 OK - still need to release connection
await response.body?.cancel();
}
}
catch (error) {
this.onerror?.(error);
throw error;
}
}
get sessionId() {
return this._sessionId;
}
/**
* Terminates the current session by sending a DELETE request to the server.
*
* Clients that no longer need a particular session
* (e.g., because the user is leaving the client application) SHOULD send an
* HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly
* terminate the session.
*
* The server MAY respond with HTTP 405 Method Not Allowed, indicating that
* the server does not allow clients to terminate sessions.
*/
async terminateSession() {
if (!this._sessionId) {
return; // No session to terminate
}
try {
const headers = await this._commonHeaders();
const init = {
...this._requestInit,
method: 'DELETE',
headers,
signal: this._abortController?.signal
};
const response = await fetchWithinOrigin(this._fetch ?? fetch)(this._url, init);
await response.body?.cancel();
// We specifically handle 405 as a valid response according to the spec,
// meaning the server does not support explicit session termination
if (!response.ok && response.status !== 405) {
throw new StreamableHTTPError(response.status, `Failed to terminate session: ${this._unfollowedRedirect(response, this._url) ?? response.statusText}`);
}
this._sessionId = undefined;
}
catch (error) {
this.onerror?.(error);
throw error;
}
}
setProtocolVersion(version) {
this._protocolVersion = version;
}
get protocolVersion() {
return this._protocolVersion;
}
/**
* Resume an SSE stream from a previous event ID.
* Opens a GET SSE connection with Last-Event-ID header to replay missed events.
*
* @param lastEventId The event ID to resume from
* @param options Optional callback to receive new resumption tokens
*/
async resumeStream(lastEventId, options) {
await this._startOrAuthSse({
resumptionToken: lastEventId,
onresumptiontoken: options?.onresumptiontoken
});
}
}
//# sourceMappingURL=streamableHttp.js.map
@@ -0,0 +1,47 @@
{
"name": "@radix-ui/primitive",
"version": "1.1.5",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"devDependencies": {
"typescript": "^5.9.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git",
"directory": "packages/core/primitive"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "oxlint --max-warnings 0 src",
"clean": "rm -rf dist",
"reset": "rm -rf dist node_modules",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"propertyNames.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/propertyNames.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,MAAM,CAAC,YAAY,GAAG;CAChE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE/B,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7B,GAAG,CAAC,SAAS,CAAC,EAAC,YAAY,EAAE,GAAG,EAAC,CAAC,CAAA;YAClC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,eAAe;gBACxB,IAAI,EAAE,GAAG;gBACT,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,YAAY,EAAE,GAAG;gBACjB,aAAa,EAAE,IAAI;aACpB,EACD,KAAK,CACN,CAAA;YACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;gBACtB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACf,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;YAChC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"limit.js","sourceRoot":"","sources":["../src/limit.ts"],"names":[],"mappings":";;;AAWA,6BAA8B;AAC9B,sDAA2E;AAM3E,MAAM,GAAG,GAAG,mBAAS,CAAA;AAErB,MAAM,IAAI,GAA4D;IACpE,aAAa,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACvD,aAAa,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACvD,sBAAsB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;IAC/D,sBAAsB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;CAChE,CAAA;AAID,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,aAAa,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,IAAI,UAAU,EAAE;IAC9F,MAAM,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAChC,IAAA,WAAC,EAAA,gBAAgB,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,YAAY,UAAU,GAAG;CACvE,CAAA;AAEY,QAAA,qBAAqB,GAA0B;IAC1D,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAChD,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QACvB,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAM;QAEjC,MAAM,IAAI,GAAG,IAAI,gBAAU,CAAC,EAAE,EAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QACrF,IAAI,IAAI,CAAC,KAAK;YAAE,mBAAmB,EAAE,CAAA;;YAChC,cAAc,EAAE,CAAA;QAErB,SAAS,mBAAmB;YAC1B,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE;gBACrC,GAAG,EAAE,IAAI,CAAC,OAAO;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO;aACxB,CAAC,CAAA;YACF,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,CAAA;YAC5D,GAAG,CAAC,SAAS,CACX,IAAA,YAAE,EACA,IAAA,WAAC,EAAA,UAAU,GAAG,cAAc,EAC5B,IAAA,WAAC,EAAA,GAAG,GAAG,oBAAoB,EAC3B,IAAA,WAAC,EAAA,UAAU,GAAG,wBAAwB,EACtC,WAAW,CAAC,GAAG,CAAC,CACjB,CACF,CAAA;QACH,CAAC;QAED,SAAS,cAAc;YACrB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAgB,CAAA;YACpC,MAAM,MAAM,GAA4B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAC5D,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,IAAI;gBAAE,OAAM;YACtC,IACE,OAAO,MAAM,IAAI,QAAQ;gBACzB,MAAM,YAAY,MAAM;gBACxB,OAAO,MAAM,CAAC,OAAO,IAAI,UAAU,EACnC;gBACA,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,cAAc,MAAM,sCAAsC,CAAC,CAAA;aACvF;YACD,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE;gBACpC,GAAG,EAAE,MAAM;gBACX,GAAG,EAAE,MAAM;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;aACpF,CAAC,CAAA;YAEF,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QACjC,CAAC;QAED,SAAS,WAAW,CAAC,GAAS;YAC5B,OAAO,IAAA,WAAC,EAAA,GAAG,GAAG,YAAY,IAAI,KAAK,UAAU,KAAK,IAAI,CAAC,OAAc,CAAC,CAAC,IAAI,IAAI,CAAA;QACjF,CAAC;IACH,CAAC;IACD,YAAY,EAAE,CAAC,QAAQ,CAAC;CACzB,CAAA;AAED,MAAM,iBAAiB,GAAsB,CAAC,GAAQ,EAAO,EAAE;IAC7D,GAAG,CAAC,UAAU,CAAC,6BAAqB,CAAC,CAAA;IACrC,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,kBAAe,iBAAiB,CAAA"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_yO","33":"T","164":"_FB","388":"_I"},C:{"1":"_XJ _dQ","164":"_bQ _3D","676":"_US"},D:{"1":"_zO","33":"T","164":"_v"},E:{"1":"_uC","164":"_BH"},F:{"1":"_bJ","2":"_T","33":"PC _bP","164":"_QJ _tL"},G:{"1":"_7B","164":"_XE"},H:{"2":"1D"},I:{"1":"I","164":"_G"},J:{"164":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"A","388":"B"},O:{"1":"bC"},P:{"1":"_yD","164":"_WE"},Q:{"164":"JE"},R:{"1":"KE"},S:{"1":"ME","164":"LE"}},B:5,C:"CSS Appearance",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-right-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015-2017 Evgeny Poberezkin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateTuple = void 0;
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const code_1 = require("../code");
const def = {
keyword: "items",
type: "array",
schemaType: ["object", "array", "boolean"],
before: "uniqueItems",
code(cxt) {
const { schema, it } = cxt;
if (Array.isArray(schema))
return validateTuple(cxt, "additionalItems", schema);
it.items = true;
if ((0, util_1.alwaysValidSchema)(it, schema))
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);
}
}
}
exports.validateTuple = validateTuple;
exports.default = def;
//# sourceMappingURL=items.js.map
@@ -0,0 +1,2 @@
'use strict';
require('../register')('when', {Promise: require('when').Promise})
@@ -0,0 +1 @@
{"version":3,"file":"martini.js","sources":["../../../src/icons/martini.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Martini\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAyMmg4IiAvPgogIDxwYXRoIGQ9Ik0xMiAxMXYxMSIgLz4KICA8cGF0aCBkPSJtMTkgMy03IDgtNy04WiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/martini\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Martini = createLucideIcon('Martini', [\n ['path', { d: 'M8 22h8', key: 'rmew8v' }],\n ['path', { d: 'M12 11v11', key: 'ur9y6a' }],\n ['path', { d: 'm19 3-7 8-7-8Z', key: '1sgpiw' }],\n]);\n\nexport default Martini;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const TvMinimalPlay = createLucideIcon("TvMinimalPlay", [
[
"path",
{
d: "M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",
key: "1pctta"
}
],
["path", { d: "M7 21h10", key: "1b0cd5" }],
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }]
]);
export { TvMinimalPlay as default };
//# sourceMappingURL=tv-minimal-play.js.map
@@ -0,0 +1 @@
{"version":3,"file":"voicemail.js","sources":["../../../src/icons/voicemail.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Voicemail\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI2IiBjeT0iMTIiIHI9IjQiIC8+CiAgPGNpcmNsZSBjeD0iMTgiIGN5PSIxMiIgcj0iNCIgLz4KICA8bGluZSB4MT0iNiIgeDI9IjE4IiB5MT0iMTYiIHkyPSIxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/voicemail\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Voicemail = createLucideIcon('Voicemail', [\n ['circle', { cx: '6', cy: '12', r: '4', key: '1ehtga' }],\n ['circle', { cx: '18', cy: '12', r: '4', key: '4vafl8' }],\n ['line', { x1: '6', x2: '18', y1: '16', y2: '16', key: 'pmt8us' }],\n]);\n\nexport default Voicemail;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,159 @@
import { f as createRule, g as import_ast_utils } from "../utils.js";
var space_in_parens_default = createRule({
name: "space-in-parens",
meta: {
type: "layout",
docs: { description: "Enforce consistent spacing inside parentheses" },
fixable: "whitespace",
schema: [{
type: "string",
enum: ["always", "never"]
}, {
type: "object",
properties: { exceptions: {
type: "array",
items: {
type: "string",
enum: [
"{}",
"[]",
"()",
"empty"
]
},
uniqueItems: true
} },
additionalProperties: false
}],
defaultOptions: ["never"],
messages: {
missingOpeningSpace: "There must be a space after this paren.",
missingClosingSpace: "There must be a space before this paren.",
rejectedOpeningSpace: "There should be no space after this paren.",
rejectedClosingSpace: "There should be no space before this paren."
}
},
create(context, [style, { exceptions: exceptionsArrayOptions = [] } = {}]) {
const ALWAYS = style === "always";
const options = {
braceException: false,
bracketException: false,
parenException: false,
empty: false
};
let exceptions = {
openers: [],
closers: []
};
if (exceptionsArrayOptions.length) {
options.braceException = exceptionsArrayOptions.includes("{}");
options.bracketException = exceptionsArrayOptions.includes("[]");
options.parenException = exceptionsArrayOptions.includes("()");
options.empty = exceptionsArrayOptions.includes("empty");
}
function getExceptions() {
const openers = [];
const closers = [];
if (options.braceException) {
openers.push("{");
closers.push("}");
}
if (options.bracketException) {
openers.push("[");
closers.push("]");
}
if (options.parenException) {
openers.push("(");
closers.push(")");
}
if (options.empty) {
openers.push(")");
closers.push("(");
}
return {
openers,
closers
};
}
const sourceCode = context.sourceCode;
function isOpenerException(token) {
return exceptions.openers.includes(token.value);
}
function isCloserException(token) {
return exceptions.closers.includes(token.value);
}
function openerMissingSpace(openingParenToken, tokenAfterOpeningParen) {
if (sourceCode.isSpaceBetween(openingParenToken, tokenAfterOpeningParen)) return false;
if (!options.empty && (0, import_ast_utils.isClosingParenToken)(tokenAfterOpeningParen)) return false;
if (ALWAYS) return !isOpenerException(tokenAfterOpeningParen);
return isOpenerException(tokenAfterOpeningParen);
}
function openerRejectsSpace(openingParenToken, tokenAfterOpeningParen) {
if (!(0, import_ast_utils.isTokenOnSameLine)(openingParenToken, tokenAfterOpeningParen)) return false;
if (tokenAfterOpeningParen.type === "Line") return false;
if (!sourceCode.isSpaceBetween(openingParenToken, tokenAfterOpeningParen)) return false;
if (ALWAYS) return isOpenerException(tokenAfterOpeningParen);
return !isOpenerException(tokenAfterOpeningParen);
}
function closerMissingSpace(tokenBeforeClosingParen, closingParenToken) {
if (sourceCode.isSpaceBetween(tokenBeforeClosingParen, closingParenToken)) return false;
if (!options.empty && (0, import_ast_utils.isOpeningParenToken)(tokenBeforeClosingParen)) return false;
if (ALWAYS) return !isCloserException(tokenBeforeClosingParen);
return isCloserException(tokenBeforeClosingParen);
}
function closerRejectsSpace(tokenBeforeClosingParen, closingParenToken) {
if (!(0, import_ast_utils.isTokenOnSameLine)(tokenBeforeClosingParen, closingParenToken)) return false;
if (!sourceCode.isSpaceBetween(tokenBeforeClosingParen, closingParenToken)) return false;
if (ALWAYS) return isCloserException(tokenBeforeClosingParen);
return !isCloserException(tokenBeforeClosingParen);
}
return { Program: function checkParenSpaces(node) {
exceptions = getExceptions();
const tokens = sourceCode.tokensAndComments;
tokens.forEach((token, i) => {
const prevToken = tokens[i - 1];
const nextToken = tokens[i + 1];
if (!(0, import_ast_utils.isOpeningParenToken)(token) && !(0, import_ast_utils.isClosingParenToken)(token)) return;
if (token.value === "(" && openerMissingSpace(token, nextToken)) context.report({
node,
loc: token.loc,
messageId: "missingOpeningSpace",
fix(fixer) {
return fixer.insertTextAfter(token, " ");
}
});
if (token.value === "(" && openerRejectsSpace(token, nextToken)) context.report({
node,
loc: {
start: token.loc.end,
end: nextToken.loc.start
},
messageId: "rejectedOpeningSpace",
fix(fixer) {
return fixer.removeRange([token.range[1], nextToken.range[0]]);
}
});
if (token.value === ")" && closerMissingSpace(prevToken, token)) context.report({
node,
loc: token.loc,
messageId: "missingClosingSpace",
fix(fixer) {
return fixer.insertTextBefore(token, " ");
}
});
if (token.value === ")" && closerRejectsSpace(prevToken, token)) context.report({
node,
loc: {
start: prevToken.loc.end,
end: token.loc.start
},
messageId: "rejectedClosingSpace",
fix(fixer) {
return fixer.removeRange([prevToken.range[1], token.range[0]]);
}
});
});
} };
}
});
export { space_in_parens_default as t };
@@ -0,0 +1,183 @@
import { URIComponent } from "fast-uri";
import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from "../compile/codegen";
import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from "../compile";
import type { JSONType } from "../compile/rules";
import type { KeywordCxt } from "../compile/validate";
import type Ajv from "../core";
interface _SchemaObject {
id?: string;
$id?: string;
$schema?: string;
[x: string]: any;
}
export interface SchemaObject extends _SchemaObject {
id?: string;
$id?: string;
$schema?: string;
$async?: false;
[x: string]: any;
}
export interface AsyncSchema extends _SchemaObject {
$async: true;
}
export type AnySchemaObject = SchemaObject | AsyncSchema;
export type Schema = SchemaObject | boolean;
export type AnySchema = Schema | AsyncSchema;
export type SchemaMap = {
[Key in string]?: AnySchema;
};
export interface SourceCode {
validateName: ValueScopeName;
validateCode: string;
scopeValues: ScopeValueSets;
evaluated?: Code;
}
export interface DataValidationCxt<T extends string | number = string | number> {
instancePath: string;
parentData: {
[K in T]: any;
};
parentDataProperty: T;
rootData: Record<string, any> | any[];
dynamicAnchors: {
[Ref in string]?: ValidateFunction;
};
}
export interface ValidateFunction<T = unknown> {
(this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T;
errors?: null | ErrorObject[];
evaluated?: Evaluated;
schema: AnySchema;
schemaEnv: SchemaEnv;
source?: SourceCode;
}
export interface JTDParser<T = unknown> {
(json: string): T | undefined;
message?: string;
position?: number;
}
export type EvaluatedProperties = {
[K in string]?: true;
} | true;
export type EvaluatedItems = number | true;
export interface Evaluated {
props?: EvaluatedProperties;
items?: EvaluatedItems;
dynamicProps: boolean;
dynamicItems: boolean;
}
export interface AsyncValidateFunction<T = unknown> extends ValidateFunction<T> {
(...args: Parameters<ValidateFunction<T>>): Promise<T>;
$async: true;
}
export type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {
keyword: K;
instancePath: string;
schemaPath: string;
params: P;
propertyName?: string;
message?: string;
schema?: S;
parentSchema?: AnySchemaObject;
data?: unknown;
}
export type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>;
interface _KeywordDef {
keyword: string | string[];
type?: JSONType | JSONType[];
schemaType?: JSONType | JSONType[];
allowUndefined?: boolean;
$data?: boolean;
implements?: string[];
before?: string;
post?: boolean;
metaSchema?: AnySchemaObject;
validateSchema?: AnyValidateFunction;
dependencies?: string[];
error?: KeywordErrorDefinition;
$dataError?: KeywordErrorDefinition;
}
export interface CodeKeywordDefinition extends _KeywordDef {
code: (cxt: KeywordCxt, ruleType?: string) => void;
trackErrors?: boolean;
}
export type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
export type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
export interface DataValidateFunction {
(...args: Parameters<ValidateFunction>): boolean | Promise<any>;
errors?: Partial<ErrorObject>[];
}
export interface SchemaValidateFunction {
(schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise<any>;
errors?: Partial<ErrorObject>[];
}
export interface FuncKeywordDefinition extends _KeywordDef {
validate?: SchemaValidateFunction | DataValidateFunction;
compile?: CompileKeywordFunc;
schema?: boolean;
modifying?: boolean;
async?: boolean;
valid?: boolean;
errors?: boolean | "full";
}
export interface MacroKeywordDefinition extends FuncKeywordDefinition {
macro: MacroKeywordFunc;
}
export type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
export type AddedKeywordDefinition = KeywordDefinition & {
type: JSONType[];
schemaType: JSONType[];
};
export interface KeywordErrorDefinition {
message: string | Code | ((cxt: KeywordErrorCxt) => string | Code);
params?: Code | ((cxt: KeywordErrorCxt) => Code);
}
export type Vocabulary = (KeywordDefinition | string)[];
export interface KeywordErrorCxt {
gen: CodeGen;
keyword: string;
data: Name;
$data?: string | false;
schema: any;
parentSchema?: AnySchemaObject;
schemaCode: Code | number | boolean;
schemaValue: Code | number | boolean;
schemaType?: JSONType[];
errsCount?: Name;
params: KeywordCxtParams;
it: SchemaCxt;
}
export type KeywordCxtParams = {
[P in string]?: Code | string | number;
};
export type FormatValidator<T extends string | number> = (data: T) => boolean;
export type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
export type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
export interface FormatDefinition<T extends string | number> {
type?: T extends string ? "string" | undefined : "number";
validate: FormatValidator<T> | (T extends string ? string | RegExp : never);
async?: false | undefined;
compare?: FormatCompare<T>;
}
export interface AsyncFormatDefinition<T extends string | number> {
type?: T extends string ? "string" | undefined : "number";
validate: AsyncFormatValidator<T>;
async: true;
compare?: FormatCompare<T>;
}
export type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
export type Format = AddedFormat | string;
export interface RegExpEngine {
(pattern: string, u: string): RegExpLike;
code: string;
}
export interface RegExpLike {
test: (s: string) => boolean;
}
export interface UriResolver {
parse(uri: string): URIComponent;
resolve(base: string, path: string): string;
serialize(component: URIComponent): string;
}
export {};
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './panel-top-dashed.js';
//# sourceMappingURL=panel-top-inactive.js.map
@@ -0,0 +1,142 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
file: { unit: "பைட்டுகள்", verb: "கொண்டிருக்க வேண்டும்" },
array: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
set: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
map: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "உள்ளீடு",
email: "மின்னஞ்சல் முகவரி",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO தேதி நேரம்",
date: "ISO தேதி",
time: "ISO நேரம்",
duration: "ISO கால அளவு",
ipv4: "IPv4 முகவரி",
ipv6: "IPv6 முகவரி",
mac: "MAC முகவரி",
cidrv4: "IPv4 வரம்பு",
cidrv6: "IPv6 வரம்பு",
base64: "base64-encoded சரம்",
base64url: "base64url-encoded சரம்",
json_string: "JSON சரம்",
e164: "E.164 எண்",
credit_card: "கடன் அட்டை எண்",
currency_code: "நாணயக் குறியீடு",
iban: "IBAN",
jwt: "JWT",
template_literal: "input",
};
const TypeDictionary = {
nan: "NaN",
number: "எண்",
array: "அணி",
null: "வெறுமை",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${issue.expected}, பெறப்பட்டது ${received}`;
}
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${expected}, பெறப்பட்டது ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${util.stringifyPrimitive(issue.values[0])}`;
return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${util.joinValues(issue.values, "|")} இல் ஒன்று`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "உறுப்புகள்"} ஆக இருக்க வேண்டும்`;
}
return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ஆக இருக்க வேண்டும்`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ஆக இருக்க வேண்டும்`; //
}
return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ஆக இருக்க வேண்டும்`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `தவறான சரம்: "${_issue.prefix}" இல் தொடங்க வேண்டும்`;
if (_issue.format === "ends_with")
return `தவறான சரம்: "${_issue.suffix}" இல் முடிவடைய வேண்டும்`;
if (_issue.format === "includes")
return `தவறான சரம்: "${_issue.includes}" ஐ உள்ளடக்க வேண்டும்`;
if (_issue.format === "regex")
return `தவறான சரம்: ${_issue.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;
return `தவறான ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `தவறான எண்: ${issue.divisor} இன் பலமாக இருக்க வேண்டும்`;
case "unrecognized_keys":
return `அடையாளம் தெரியாத விசை${issue.keys.length > 1 ? "கள்" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} இல் தவறான விசை`;
case "invalid_union":
return "தவறான உள்ளீடு";
case "invalid_element":
return `${issue.origin} இல் தவறான மதிப்பு`;
default:
return `தவறான உள்ளீடு`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,22 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es2025" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
@@ -0,0 +1 @@
{"version":3,"names":["setFunctionName","fn","name","prefix","description","Object","defineProperty","configurable","value","_"],"sources":["../../src/helpers/setFunctionName.ts"],"sourcesContent":["/* @minVersion 7.23.6 */\n\n// https://tc39.es/ecma262/#sec-setfunctionname\nexport default function setFunctionName<T extends Function>(\n fn: T,\n name: symbol | string,\n prefix?: string,\n): T {\n if (typeof name === \"symbol\") {\n // Here `undefined` is possible, we check for it in the next line.\n name = name.description!;\n name = name ? \"[\" + name + \"]\" : \"\";\n }\n // In some older browsers .name was non-configurable, here we catch any\n // errors thrown by defineProperty.\n try {\n Object.defineProperty(fn, \"name\", {\n configurable: true,\n value: prefix ? prefix + \" \" + name : name,\n });\n } catch (_) {}\n return fn;\n}\n"],"mappings":";;;;;;AAGe,SAASA,eAAeA,CACrCC,EAAK,EACLC,IAAqB,EACrBC,MAAe,EACZ;EACH,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE;IAE5BA,IAAI,GAAGA,IAAI,CAACE,WAAY;IACxBF,IAAI,GAAGA,IAAI,GAAG,GAAG,GAAGA,IAAI,GAAG,GAAG,GAAG,EAAE;EACrC;EAGA,IAAI;IACFG,MAAM,CAACC,cAAc,CAACL,EAAE,EAAE,MAAM,EAAE;MAChCM,YAAY,EAAE,IAAI;MAClBC,KAAK,EAAEL,MAAM,GAAGA,MAAM,GAAG,GAAG,GAAGD,IAAI,GAAGA;IACxC,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOO,CAAC,EAAE,CAAC;EACb,OAAOR,EAAE;AACX","ignoreList":[]}
@@ -0,0 +1,26 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BookOpenText = createLucideIcon("BookOpenText", [
["path", { d: "M12 7v14", key: "1akyts" }],
["path", { d: "M16 12h2", key: "7q9ll5" }],
["path", { d: "M16 8h2", key: "msurwy" }],
[
"path",
{
d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
key: "ruj8y"
}
],
["path", { d: "M6 12h2", key: "32wvfc" }],
["path", { d: "M6 8h2", key: "30oboj" }]
]);
export { BookOpenText as default };
//# sourceMappingURL=book-open-text.js.map
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,179 @@
import { RouteIds } from './routeInfo.cjs';
import { AnyRouter } from './router.cjs';
export type Awaitable<T> = T | Promise<T>;
export type NoInfer<T> = [T][T extends any ? 0 : never];
export type IsAny<TValue, TYesResult, TNoResult = TValue> = 1 extends 0 & TValue ? TYesResult : TNoResult;
export type PickAsRequired<TValue, TKey extends keyof TValue> = Omit<TValue, TKey> & Required<Pick<TValue, TKey>>;
export type PickRequired<T> = {
[K in keyof T as undefined extends T[K] ? never : K]: T[K];
};
export type PickOptional<T> = {
[K in keyof T as undefined extends T[K] ? K : never]: T[K];
};
export type WithoutEmpty<T> = T extends any ? ({} extends T ? never : T) : never;
export type Expand<T> = T extends object ? T extends infer O ? O extends Function ? O : {
[K in keyof O]: O[K];
} : never : T;
export type DeepPartial<T> = T extends object ? {
[P in keyof T]?: DeepPartial<T[P]>;
} : T;
export type MakeDifferenceOptional<TLeft, TRight> = keyof TLeft & keyof TRight extends never ? TRight : Omit<TRight, keyof TLeft & keyof TRight> & {
[K in keyof TLeft & keyof TRight]?: TRight[K];
};
export type IsUnion<T, U extends T = T> = (T extends any ? (U extends T ? false : true) : never) extends false ? false : true;
export type IsNonEmptyObject<T> = T extends object ? keyof T extends never ? false : true : false;
export type Assign<TLeft, TRight> = TLeft extends any ? TRight extends any ? IsNonEmptyObject<TLeft> extends false ? TRight : IsNonEmptyObject<TRight> extends false ? TLeft : keyof TLeft & keyof TRight extends never ? TLeft & TRight : Omit<TLeft, keyof TRight> & TRight : never : never;
export type IntersectAssign<TLeft, TRight> = TLeft extends any ? TRight extends any ? IsNonEmptyObject<TLeft> extends false ? TRight : IsNonEmptyObject<TRight> extends false ? TLeft : TRight & TLeft : never : never;
export type Timeout = ReturnType<typeof setTimeout>;
export type Updater<TPrevious, TResult = TPrevious> = TResult | ((prev?: TPrevious) => TResult);
export type NonNullableUpdater<TPrevious, TResult = TPrevious> = TResult | ((prev: TPrevious) => TResult);
export type ExtractObjects<TUnion> = TUnion extends MergeAllPrimitive ? never : TUnion;
export type PartialMergeAllObject<TUnion> = ExtractObjects<TUnion> extends infer TObj ? [TObj] extends [never] ? never : {
[TKey in TObj extends any ? keyof TObj : never]?: TObj extends any ? TKey extends keyof TObj ? TObj[TKey] : never : never;
} : never;
export type MergeAllPrimitive = ReadonlyArray<any> | number | string | bigint | boolean | symbol | undefined | null;
export type ExtractPrimitives<TUnion> = TUnion extends MergeAllPrimitive ? TUnion : TUnion extends object ? never : TUnion;
export type PartialMergeAll<TUnion> = ExtractPrimitives<TUnion> | PartialMergeAllObject<TUnion>;
export type Constrain<T, TConstraint, TDefault = TConstraint> = (T extends TConstraint ? T : never) | TDefault;
export type ConstrainLiteral<T, TConstraint, TDefault = TConstraint> = (T & TConstraint) | TDefault;
/**
* To be added to router types
*/
export type UnionToIntersection<T> = (T extends any ? (arg: T) => any : never) extends (arg: infer T) => any ? T : never;
/**
* Merges everything in a union into one object.
* This mapped type is homomorphic which means it preserves stuff! :)
*/
export type MergeAllObjects<TUnion, TIntersected = UnionToIntersection<ExtractObjects<TUnion>>> = [keyof TIntersected] extends [never] ? never : {
[TKey in keyof TIntersected]: TUnion extends any ? TUnion[TKey & keyof TUnion] : never;
};
export type MergeAll<TUnion> = MergeAllObjects<TUnion> | ExtractPrimitives<TUnion>;
export type ValidateJSON<T> = ((...args: Array<any>) => any) extends T ? unknown extends T ? never : 'Function is not serializable' : {
[K in keyof T]: ValidateJSON<T[K]>;
};
export type LooseReturnType<T> = T extends (...args: Array<any>) => infer TReturn ? TReturn : never;
export type LooseAsyncReturnType<T> = T extends (...args: Array<any>) => infer TReturn ? TReturn extends Promise<infer TReturn> ? TReturn : TReturn : never;
/**
* Return the last element of an array.
* Intended for non-empty arrays used within router internals.
*/
export declare function last<T>(arr: ReadonlyArray<T>): T | undefined;
/**
* Apply a value-or-updater to a previous value.
* Accepts either a literal value or a function of the previous value.
*/
export declare function functionalUpdate<TPrevious, TResult = TPrevious>(updater: Updater<TPrevious, TResult> | NonNullableUpdater<TPrevious, TResult>, previous: TPrevious): TResult;
export declare function hasKeys(obj: Record<string, unknown>): boolean;
export declare const nullReplaceEqualDeep: typeof replaceEqualDeep;
/**
* This function returns `prev` if `_next` is deeply equal.
* If not, it will replace any deeply equal children of `b` with those of `a`.
* This can be used for structural sharing between immutable JSON values for example.
* Do not use this with signals
*/
export declare function replaceEqualDeep<T>(prev: any, _next: T, _makeObj?: () => {}, _depth?: number): T;
export declare function isPlainObject(o: any): boolean;
/**
* Check if a value is a "plain" array (no extra enumerable keys).
*/
export declare function isPlainArray(value: unknown): value is Array<unknown>;
/**
* Perform a deep equality check with options for partial comparison and
* ignoring `undefined` values. Optimized for router state comparisons.
*/
export declare function deepEqual(a: any, b: any, opts?: {
partial?: boolean;
ignoreUndefined?: boolean;
}): boolean;
export type StringLiteral<T> = T extends string ? string extends T ? string : T : never;
export type ThrowOrOptional<T, TThrow extends boolean> = TThrow extends true ? T : T | undefined;
export type StrictOrFrom<TRouter extends AnyRouter, TFrom, TStrict extends boolean = true> = TStrict extends false ? {
from?: never;
strict: TStrict;
} : {
from: ConstrainLiteral<TFrom, RouteIds<TRouter['routeTree']>>;
strict?: TStrict;
};
export type ThrowConstraint<TStrict extends boolean, TThrow extends boolean> = TStrict extends false ? (TThrow extends true ? never : TThrow) : TThrow;
export type ControlledPromise<T> = Promise<T> & {
resolve: (value: T) => void;
reject: (value: any) => void;
status: 'pending' | 'resolved' | 'rejected';
value?: T;
};
/**
* Create a promise with exposed resolve/reject and status fields.
* Useful for coordinating async router lifecycle operations.
*/
export declare function createControlledPromise<T>(onResolve?: (value: T) => void): ControlledPromise<T>;
/**
* Heuristically detect dynamic import "module not found" errors
* across major browsers for lazy route component handling.
*/
export declare function isModuleNotFoundError(error: any): boolean;
export declare function isPromise<T>(value: Promise<Awaited<T>> | T): value is Promise<Awaited<T>>;
export declare function findLast<T>(array: ReadonlyArray<T>, predicate: (item: T) => boolean): T | undefined;
/**
* Default list of URL protocols to allow in links, redirects, and navigation.
* Any absolute URL protocol not in this list is treated as dangerous by default.
*/
export declare const DEFAULT_PROTOCOL_ALLOWLIST: string[];
/**
* Check if a URL string uses a protocol that is not in the allowlist.
* Returns true for blocked protocols like javascript:, blob:, data:, etc.
*
* The URL constructor correctly normalizes:
* - Mixed case (JavaScript: → javascript:)
* - Whitespace/control characters (java\nscript: → javascript:)
* - Leading whitespace
*
* For relative URLs (no protocol), returns false (safe).
*
* @param url - The URL string to check
* @param allowlist - Set of protocols to allow
* @returns true if the URL uses a protocol that is not allowed
*/
export declare function isDangerousProtocol(url: string, allowlist: Set<string>): boolean;
/**
* Escape HTML special characters in a string to prevent XSS attacks
* when embedding strings in script tags during SSR.
*
* This is essential for preventing XSS vulnerabilities when user-controlled
* content is embedded in inline scripts.
*/
export declare function escapeHtml(str: string): string;
export declare function decodePath(path: string): {
path: string;
handledProtocolRelativeURL: boolean;
};
/**
* Encodes a path the same way `new URL()` would, but without the overhead of full URL parsing.
*
* This function encodes:
* - Whitespace characters (spaces → %20, tabs → %09, etc.)
* - Non-ASCII/Unicode characters (emojis, accented characters, etc.)
*
* It preserves:
* - Already percent-encoded sequences (won't double-encode %2F, %25, etc.)
* - ASCII special characters valid in URL paths (@, $, &, +, etc.)
* - Forward slashes as path separators
*
* Used to generate proper href values for SSR without constructing URL objects.
*
* @example
* encodePathLikeUrl('/path/file name.pdf') // '/path/file%20name.pdf'
* encodePathLikeUrl('/path/日本語') // '/path/%E6%97%A5%E6%9C%AC%E8%AA%9E'
* encodePathLikeUrl('/path/already%20encoded') // '/path/already%20encoded' (preserved)
*/
export declare function encodePathLikeUrl(path: string): string;
/**
* Builds the dev-mode CSS styles URL for route-scoped CSS collection.
* Used by HeadContent components in all framework implementations to construct
* the URL for the `/@tanstack-start/styles.css` endpoint.
*
* @param basepath - The router's basepath (may or may not have leading slash)
* @param routeIds - Array of matched route IDs to include in the CSS collection
* @returns The full URL path for the dev styles CSS endpoint
*/
export declare function buildDevStylesUrl(basepath: string, routeIds: Array<string>): string;
export declare function arraysEqual<T>(a: Array<T>, b: Array<T>): boolean;
@@ -0,0 +1,7 @@
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
/**
* Contains all of `recommended`, as well as additional strict rules that can also catch bugs.
* @see {@link https://typescript-eslint.io/users/configs#strict}
*/
declare const _default: (plugin: FlatConfig.Plugin, parser: FlatConfig.Parser) => FlatConfig.ConfigArray;
export default _default;
@@ -0,0 +1,13 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2019_object = void 0;
const base_config_1 = require("./base-config");
const es2015_iterable_1 = require("./es2015.iterable");
exports.es2019_object = {
libs: [es2015_iterable_1.es2015_iterable],
variables: [['ObjectConstructor', base_config_1.TYPE]],
};
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","getQualifiedName","node","isIdentifier","name","id","qualification","removeTypeDuplicates","nodesIn","nodes","Array","from","generics","Map","bases","typeGroups","Set","types","i","length","includes","isAnyTypeAnnotation","isFlowBaseAnnotation","set","type","isUnionTypeAnnotation","has","push","add","isGenericTypeAnnotation","existing","get","typeParameters","params","baseType","genericName"],"sources":["../../../src/modifications/flow/removeTypeDuplicates.ts"],"sourcesContent":["import {\n isAnyTypeAnnotation,\n isGenericTypeAnnotation,\n isUnionTypeAnnotation,\n isFlowBaseAnnotation,\n isIdentifier,\n} from \"../../validators/generated/index.ts\";\nimport type * as t from \"../../index.ts\";\n\nfunction getQualifiedName(node: t.GenericTypeAnnotation[\"id\"]): string {\n return isIdentifier(node)\n ? node.name\n : `${node.id.name}.${getQualifiedName(node.qualification)}`;\n}\n\n/**\n * Dedupe type annotations.\n */\nexport default function removeTypeDuplicates(\n nodesIn: readonly (t.FlowType | false | null | undefined)[],\n): t.FlowType[] {\n const nodes = Array.from(nodesIn);\n\n const generics = new Map<string, t.GenericTypeAnnotation>();\n const bases = new Map<t.FlowBaseAnnotation[\"type\"], t.FlowBaseAnnotation>();\n\n // store union type groups to circular references\n const typeGroups = new Set<t.FlowType[]>();\n\n const types: t.FlowType[] = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n // detect duplicates\n if (types.includes(node)) {\n continue;\n }\n\n // this type matches anything\n if (isAnyTypeAnnotation(node)) {\n return [node];\n }\n\n if (isFlowBaseAnnotation(node)) {\n bases.set(node.type, node);\n continue;\n }\n\n if (isUnionTypeAnnotation(node)) {\n if (!typeGroups.has(node.types)) {\n nodes.push(...node.types);\n typeGroups.add(node.types);\n }\n continue;\n }\n\n // find a matching generic type and merge and deduplicate the type parameters\n if (isGenericTypeAnnotation(node)) {\n const name = getQualifiedName(node.id);\n\n if (generics.has(name)) {\n let existing: t.Flow = generics.get(name);\n if (existing.typeParameters) {\n if (node.typeParameters) {\n existing.typeParameters.params.push(...node.typeParameters.params);\n existing.typeParameters.params = removeTypeDuplicates(\n existing.typeParameters.params,\n );\n }\n } else {\n existing = node.typeParameters;\n }\n } else {\n generics.set(name, node);\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n // add back in bases\n for (const [, baseType] of bases) {\n types.push(baseType);\n }\n\n // add back in generics\n for (const [, genericName] of generics) {\n types.push(genericName);\n }\n\n return types;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASA,SAASC,gBAAgBA,CAACC,IAAmC,EAAU;EACrE,OAAO,IAAAC,mBAAY,EAACD,IAAI,CAAC,GACrBA,IAAI,CAACE,IAAI,GACT,GAAGF,IAAI,CAACG,EAAE,CAACD,IAAI,IAAIH,gBAAgB,CAACC,IAAI,CAACI,aAAa,CAAC,EAAE;AAC/D;AAKe,SAASC,oBAAoBA,CAC1CC,OAA2D,EAC7C;EACd,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAACH,OAAO,CAAC;EAEjC,MAAMI,QAAQ,GAAG,IAAIC,GAAG,CAAkC,CAAC;EAC3D,MAAMC,KAAK,GAAG,IAAID,GAAG,CAAqD,CAAC;EAG3E,MAAME,UAAU,GAAG,IAAIC,GAAG,CAAe,CAAC;EAE1C,MAAMC,KAAmB,GAAG,EAAE;EAE9B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGT,KAAK,CAACU,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,MAAMhB,IAAI,GAAGO,KAAK,CAACS,CAAC,CAAC;IACrB,IAAI,CAAChB,IAAI,EAAE;IAGX,IAAIe,KAAK,CAACG,QAAQ,CAAClB,IAAI,CAAC,EAAE;MACxB;IACF;IAGA,IAAI,IAAAmB,0BAAmB,EAACnB,IAAI,CAAC,EAAE;MAC7B,OAAO,CAACA,IAAI,CAAC;IACf;IAEA,IAAI,IAAAoB,2BAAoB,EAACpB,IAAI,CAAC,EAAE;MAC9BY,KAAK,CAACS,GAAG,CAACrB,IAAI,CAACsB,IAAI,EAAEtB,IAAI,CAAC;MAC1B;IACF;IAEA,IAAI,IAAAuB,4BAAqB,EAACvB,IAAI,CAAC,EAAE;MAC/B,IAAI,CAACa,UAAU,CAACW,GAAG,CAACxB,IAAI,CAACe,KAAK,CAAC,EAAE;QAC/BR,KAAK,CAACkB,IAAI,CAAC,GAAGzB,IAAI,CAACe,KAAK,CAAC;QACzBF,UAAU,CAACa,GAAG,CAAC1B,IAAI,CAACe,KAAK,CAAC;MAC5B;MACA;IACF;IAGA,IAAI,IAAAY,8BAAuB,EAAC3B,IAAI,CAAC,EAAE;MACjC,MAAME,IAAI,GAAGH,gBAAgB,CAACC,IAAI,CAACG,EAAE,CAAC;MAEtC,IAAIO,QAAQ,CAACc,GAAG,CAACtB,IAAI,CAAC,EAAE;QACtB,IAAI0B,QAAgB,GAAGlB,QAAQ,CAACmB,GAAG,CAAC3B,IAAI,CAAC;QACzC,IAAI0B,QAAQ,CAACE,cAAc,EAAE;UAC3B,IAAI9B,IAAI,CAAC8B,cAAc,EAAE;YACvBF,QAAQ,CAACE,cAAc,CAACC,MAAM,CAACN,IAAI,CAAC,GAAGzB,IAAI,CAAC8B,cAAc,CAACC,MAAM,CAAC;YAClEH,QAAQ,CAACE,cAAc,CAACC,MAAM,GAAG1B,oBAAoB,CACnDuB,QAAQ,CAACE,cAAc,CAACC,MAC1B,CAAC;UACH;QACF,CAAC,MAAM;UACLH,QAAQ,GAAG5B,IAAI,CAAC8B,cAAc;QAChC;MACF,CAAC,MAAM;QACLpB,QAAQ,CAACW,GAAG,CAACnB,IAAI,EAAEF,IAAI,CAAC;MAC1B;MAEA;IACF;IAEAe,KAAK,CAACU,IAAI,CAACzB,IAAI,CAAC;EAClB;EAGA,KAAK,MAAM,GAAGgC,QAAQ,CAAC,IAAIpB,KAAK,EAAE;IAChCG,KAAK,CAACU,IAAI,CAACO,QAAQ,CAAC;EACtB;EAGA,KAAK,MAAM,GAAGC,WAAW,CAAC,IAAIvB,QAAQ,EAAE;IACtCK,KAAK,CAACU,IAAI,CAACQ,WAAW,CAAC;EACzB;EAEA,OAAOlB,KAAK;AACd","iLine truncated
@@ -0,0 +1 @@
{"version":3,"names":["_isReactComponent","require","_isCompatTag","_buildChildren","_assertNode","_index","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_createTypeAnnotationBasedOnTypeof","_createFlowUnionType","_createTSUnionType","_productions","_index2","_cloneNode","_clone","_cloneDeep","_cloneDeepWithoutLoc","_cloneWithoutLoc","_addComment","_addComments","_inheritInnerComments","_inheritLeadingComments","_inheritsComments","_inheritTrailingComments","_removeComments","_index3","_index4","_ensureBlock","_toBindingIdentifierName","_toBlock","_toComputedKey","_toExpression","_toIdentifier","_toKeyAlias","_toStatement","_valueToNode","_index5","_appendToMemberExpression","_inherits","_prependToMemberExpression","_removeProperties","_removePropertiesDeep","_removeTypeDuplicates","_getAssignmentIdentifiers","_getBindingIdentifiers","_getOuterBindingIdentifiers","_getFunctionName","_traverse","_traverseFast","_shallowEqual","_is","_isBinding","_isBlockScoped","_isImmutable","_isLet","_isNode","_isNodesEquivalent","_isPlaceholderType","_isReferenced","_isScope","_isSpecifierDefault","_isType","_isValidES3Identifier","_isValidIdentifier","_isVar","_matchesPattern","_validate","_buildMatchMemberExpression","_index6","_deprecationWarning","_toSequenceExpression","react","isReactComponent","isCompatTag","buildChildren","toSequenceExpression","process","env","BABEL_TYPES_8_BREAKING","console","warn"],"sources":["../src/index.ts"],"sourcesContent":["import isReactComponent from \"./validators/react/isReactComponent.ts\";\nimport isCompatTag from \"./validators/react/isCompatTag.ts\";\nimport buildChildren from \"./builders/react/buildChildren.ts\";\n\n// asserts\nexport { default as assertNode } from \"./asserts/assertNode.ts\";\nexport * from \"./asserts/generated/index.ts\";\n\n// builders\nexport { default as createTypeAnnotationBasedOnTypeof } from \"./builders/flow/createTypeAnnotationBasedOnTypeof.ts\";\n/** @deprecated use createFlowUnionType instead */\nexport { default as createUnionTypeAnnotation } from \"./builders/flow/createFlowUnionType.ts\";\nexport { default as createFlowUnionType } from \"./builders/flow/createFlowUnionType.ts\";\nexport { default as createTSUnionType } from \"./builders/typescript/createTSUnionType.ts\";\nexport * from \"./builders/productions.ts\";\nexport * from \"./builders/generated/index.ts\"; // includes AST types\n\n// clone\nexport { default as cloneNode } from \"./clone/cloneNode.ts\";\nexport { default as clone } from \"./clone/clone.ts\";\nexport { default as cloneDeep } from \"./clone/cloneDeep.ts\";\nexport { default as cloneDeepWithoutLoc } from \"./clone/cloneDeepWithoutLoc.ts\";\nexport { default as cloneWithoutLoc } from \"./clone/cloneWithoutLoc.ts\";\n\n// comments\nexport { default as addComment } from \"./comments/addComment.ts\";\nexport { default as addComments } from \"./comments/addComments.ts\";\nexport { default as inheritInnerComments } from \"./comments/inheritInnerComments.ts\";\nexport { default as inheritLeadingComments } from \"./comments/inheritLeadingComments.ts\";\nexport { default as inheritsComments } from \"./comments/inheritsComments.ts\";\nexport { default as inheritTrailingComments } from \"./comments/inheritTrailingComments.ts\";\nexport { default as removeComments } from \"./comments/removeComments.ts\";\n\n// constants\nexport * from \"./constants/generated/index.ts\";\nexport * from \"./constants/index.ts\";\n\n// converters\nexport { default as ensureBlock } from \"./converters/ensureBlock.ts\";\nexport { default as toBindingIdentifierName } from \"./converters/toBindingIdentifierName.ts\";\nexport { default as toBlock } from \"./converters/toBlock.ts\";\nexport { default as toComputedKey } from \"./converters/toComputedKey.ts\";\nexport { default as toExpression } from \"./converters/toExpression.ts\";\nexport { default as toIdentifier } from \"./converters/toIdentifier.ts\";\nexport { default as toKeyAlias } from \"./converters/toKeyAlias.ts\";\nexport { default as toStatement } from \"./converters/toStatement.ts\";\nexport { default as valueToNode } from \"./converters/valueToNode.ts\";\n\n// definitions\nexport * from \"./definitions/index.ts\";\n\n// modifications\nexport { default as appendToMemberExpression } from \"./modifications/appendToMemberExpression.ts\";\nexport { default as inherits } from \"./modifications/inherits.ts\";\nexport { default as prependToMemberExpression } from \"./modifications/prependToMemberExpression.ts\";\nexport {\n default as removeProperties,\n type Options as RemovePropertiesOptions,\n} from \"./modifications/removeProperties.ts\";\nexport { default as removePropertiesDeep } from \"./modifications/removePropertiesDeep.ts\";\nexport { default as removeTypeDuplicates } from \"./modifications/flow/removeTypeDuplicates.ts\";\n\n// retrievers\nexport { default as getAssignmentIdentifiers } from \"./retrievers/getAsLine truncated
@@ -0,0 +1,16 @@
function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {
const index = Array.from(children)
.sort((a, b) => a.sortNodePosition(b))
.indexOf(child);
const numChildren = children.size;
const maxStaggerDuration = (numChildren - 1) * staggerChildren;
const delayIsFunction = typeof delayChildren === "function";
return delayIsFunction
? delayChildren(index, numChildren)
: staggerDirection === 1
? index * staggerChildren
: maxStaggerDuration - index * staggerChildren;
}
export { calcChildStagger };
//# sourceMappingURL=calc-child-stagger.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"inbox.js","sources":["../../../src/icons/inbox.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Inbox\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIyMiAxMiAxNiAxMiAxNCAxNSAxMCAxNSA4IDEyIDIgMTIiIC8+CiAgPHBhdGggZD0iTTUuNDUgNS4xMSAyIDEydjZhMiAyIDAgMCAwIDIgMmgxNmEyIDIgMCAwIDAgMi0ydi02bC0zLjQ1LTYuODlBMiAyIDAgMCAwIDE2Ljc2IDRINy4yNGEyIDIgMCAwIDAtMS43OSAxLjExeiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/inbox\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Inbox = createLucideIcon('Inbox', [\n ['polyline', { points: '22 12 16 12 14 15 10 15 8 12 2 12', key: 'o97t9d' }],\n [\n 'path',\n {\n d: 'M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z',\n key: 'oot6mr',\n },\n ],\n]);\n\nexport default Inbox;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3E,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"mail-check.js","sources":["../../../src/icons/mail-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MailCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMTNWNmEyIDIgMCAwIDAtMi0ySDRhMiAyIDAgMCAwLTIgMnYxMmMwIDEuMS45IDIgMiAyaDgiIC8+CiAgPHBhdGggZD0ibTIyIDctOC45NyA1LjdhMS45NCAxLjk0IDAgMCAxLTIuMDYgMEwyIDciIC8+CiAgPHBhdGggZD0ibTE2IDE5IDIgMiA0LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/mail-check\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MailCheck = createLucideIcon('MailCheck', [\n ['path', { d: 'M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8', key: '12jkf8' }],\n ['path', { d: 'm22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7', key: '1ocrg3' }],\n ['path', { d: 'm16 19 2 2 4-4', key: '1b14m6' }],\n]);\n\nexport default MailCheck;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,65 @@
import type { ProjectServiceOptions } from '@typescript-eslint/types';
import type * as ts from 'typescript/lib/tsserverlibrary';
/**
* Shortcut type to refer to TypeScript's server ProjectService.
*/
export type TypeScriptProjectService = ts.server.ProjectService;
/**
* A created Project Service instance, as well as metadata on its creation.
*/
export interface ProjectServiceAndMetadata {
/**
* Files allowed to be loaded from the default project, if any were specified.
*/
allowDefaultProject: string[] | undefined;
/**
* The performance.now() timestamp of the last reload of the project service.
*/
lastReloadTimestamp: number;
/**
* The maximum number of files that can be matched by the default project.
*/
maximumDefaultProjectFileMatchCount: number;
/**
* The created TypeScript Project Service instance.
*/
service: TypeScriptProjectService;
}
/**
* Settings to create a new Project Service instance with {@link createProjectService}.
*/
export interface CreateProjectServiceSettings {
/**
* Granular options to configure the project service.
*/
options?: ProjectServiceOptions;
/**
* How aggressively (and slowly) to parse JSDoc comments.
*/
jsDocParsingMode?: ts.JSDocParsingMode;
/**
* Root directory for the tsconfig.json file, if not the current directory.
*/
tsconfigRootDir?: string;
/**
* Custom project service host.
*
* @default `ts.sys` with stub watchers
*/
host?: Partial<ts.server.ServerHost>;
}
/**
* Creates a new Project Service instance, as well as metadata on its creation.
* @param settings Settings to create a new Project Service instance.
* @returns A new Project Service instance, as well as metadata on its creation.
* @example
* ```ts
* import { createProjectService } from '@typescript-eslint/project-service';
*
* const { service } = createProjectService();
*
* service.openClientFile('index.ts');
* ```
*/
export declare function createProjectService({ host, jsDocParsingMode, options: optionsRaw, tsconfigRootDir, }?: CreateProjectServiceSettings): ProjectServiceAndMetadata;
export { type ProjectServiceOptions } from '@typescript-eslint/types';
@@ -0,0 +1 @@
{"version":3,"file":"panels-top-left.js","sources":["../../../src/icons/panels-top-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelsTopLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0zIDloMTgiIC8+CiAgPHBhdGggZD0iTTkgMjFWOSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/panels-top-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst PanelsTopLeft = createLucideIcon('PanelsTopLeft', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M3 9h18', key: '1pudct' }],\n ['path', { d: 'M9 21V9', key: '1oto5p' }],\n]);\n\nexport default PanelsTopLeft;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,85 @@
{
"name": "use-callback-ref",
"version": "1.3.3",
"description": "The same useRef, but with callback",
"main": "dist/es5/index.js",
"jsnext:main": "dist/es2015/index.js",
"module": "dist/es2015/index.js",
"types": "dist/es5/index.d.ts",
"module:es2019": "dist/es2019/index.js",
"sideEffects": false,
"scripts": {
"dev": "lib-builder dev",
"test": "jest",
"test:ci": "jest --runInBand --coverage",
"build": "lib-builder build && yarn size:report",
"release": "yarn build && yarn test",
"size": "npx size-limit",
"size:report": "npx size-limit --json > .size.json",
"lint": "lib-builder lint",
"format": "lib-builder format",
"update": "lib-builder update",
"prepublish": "yarn build && yarn changelog",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"changelog:rewrite": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
},
"repository": "https://github.com/theKashey/use-callback-ref/",
"author": "theKashey <thekashey@gmail.com>",
"license": "MIT",
"dependencies": {
"tslib": "^2.0.0"
},
"devDependencies": {
"@size-limit/preset-small-lib": "^11.0.2",
"size-limit": "^11.0.2",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@theuiteam/lib-builder": "^0.3.0",
"jest-environment-jsdom": "^29.7.0"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"engines": {
"node": ">=10"
},
"files": [
"dist"
],
"keywords": [
"react",
"hook",
"useRef",
"createRef",
"merge refs"
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"eslint --fix",
"git add"
],
"*.{js,css,json,md}": [
"prettier --write",
"git add"
]
},
"prettier": {
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
}
@@ -0,0 +1 @@
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
@@ -0,0 +1,12 @@
import type { TSESLint } from '@typescript-eslint/utils';
export type MessageIds = 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax';
export type Options = [
{
builtinGlobals?: boolean;
ignoreDeclarationMerge?: boolean;
}
];
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,10 @@
/**
* Re-exports of task-related types from the MCP protocol spec.
* WARNING: These APIs are experimental and may change without notice.
*
* These types are defined in types.ts (matching the protocol spec) and
* re-exported here for convenience when working with experimental task features.
*/
export { TaskCreationParamsSchema, RelatedTaskMetadataSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema } from '../../types.js';
export type { Task, TaskCreationParams, RelatedTaskMetadata, CreateTaskResult, TaskStatusNotificationParams, TaskStatusNotification, GetTaskRequest, GetTaskResult, GetTaskPayloadRequest, ListTasksRequest, ListTasksResult, CancelTaskRequest, CancelTaskResult } from '../../types.js';
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,29 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ShieldOff = createLucideIcon("ShieldOff", [
["path", { d: "m2 2 20 20", key: "1ooewy" }],
[
"path",
{
d: "M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",
key: "1jlk70"
}
],
[
"path",
{
d: "M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",
key: "18rp1v"
}
]
]);
export { ShieldOff as default };
//# sourceMappingURL=shield-off.js.map
@@ -0,0 +1,95 @@
/**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function is(x, y) {
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
}
function useSyncExternalStore$2(subscribe, getSnapshot) {
didWarnOld18Alpha ||
void 0 === React.startTransition ||
((didWarnOld18Alpha = !0),
console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
));
var value = getSnapshot();
if (!didWarnUncachedGetSnapshot) {
var cachedValue = getSnapshot();
objectIs(value, cachedValue) ||
(console.error(
"The result of getSnapshot should be cached to avoid an infinite loop"
),
(didWarnUncachedGetSnapshot = !0));
}
cachedValue = useState({
inst: { value: value, getSnapshot: getSnapshot }
});
var inst = cachedValue[0].inst,
forceUpdate = cachedValue[1];
useLayoutEffect(
function () {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
},
[subscribe, value, getSnapshot]
);
useEffect(
function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
return subscribe(function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
});
},
[subscribe]
);
useDebugValue(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error) {
return !0;
}
}
function useSyncExternalStore$1(subscribe, getSnapshot) {
return getSnapshot();
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React = require("react"),
objectIs = "function" === typeof Object.is ? Object.is : is,
useState = React.useState,
useEffect = React.useEffect,
useLayoutEffect = React.useLayoutEffect,
useDebugValue = React.useDebugValue,
didWarnOld18Alpha = !1,
didWarnUncachedGetSnapshot = !1,
shim =
"undefined" === typeof window ||
"undefined" === typeof window.document ||
"undefined" === typeof window.document.createElement
? useSyncExternalStore$1
: useSyncExternalStore$2;
exports.useSyncExternalStore =
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
@@ -0,0 +1 @@
{"version":3,"file":"fence.js","sources":["../../../src/icons/fence.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Fence\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAzIDIgNXYxNWMwIC42LjQgMSAxIDFoMmMuNiAwIDEtLjQgMS0xVjVaIiAvPgogIDxwYXRoIGQ9Ik02IDhoNCIgLz4KICA8cGF0aCBkPSJNNiAxOGg0IiAvPgogIDxwYXRoIGQ9Im0xMiAzLTIgMnYxNWMwIC42LjQgMSAxIDFoMmMuNiAwIDEtLjQgMS0xVjVaIiAvPgogIDxwYXRoIGQ9Ik0xNCA4aDQiIC8+CiAgPHBhdGggZD0iTTE0IDE4aDQiIC8+CiAgPHBhdGggZD0ibTIwIDMtMiAydjE1YzAgLjYuNCAxIDEgMWgyYy42IDAgMS0uNCAxLTFWNVoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/fence\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Fence = createLucideIcon('Fence', [\n ['path', { d: 'M4 3 2 5v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z', key: '1n2rgs' }],\n ['path', { d: 'M6 8h4', key: 'utf9t1' }],\n ['path', { d: 'M6 18h4', key: '12yh4b' }],\n ['path', { d: 'm12 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z', key: '3ha7mj' }],\n ['path', { d: 'M14 8h4', key: '1r8wg2' }],\n ['path', { d: 'M14 18h4', key: '1t3kbu' }],\n ['path', { d: 'm20 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z', key: 'dfd4e2' }],\n]);\n\nexport default Fence;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
import type * as ts from 'typescript';
import type { ParseSettings } from '../parseSettings';
import type { ASTAndDefiniteProgram } from './shared';
/**
* @param parseSettings Internal settings for parsing the file
* @returns If found, the source file corresponding to the code and the containing program
*/
export declare function createProjectProgram(parseSettings: ParseSettings, programsForProjects: readonly ts.Program[]): ASTAndDefiniteProgram;
@@ -0,0 +1,59 @@
# ms
![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)
Use this package to easily convert various time formats to milliseconds.
## Examples
```js
ms('2 days') // 172800000
ms('1d') // 86400000
ms('10h') // 36000000
ms('2.5 hrs') // 9000000
ms('2h') // 7200000
ms('1m') // 60000
ms('5s') // 5000
ms('1y') // 31557600000
ms('100') // 100
ms('-3 days') // -259200000
ms('-1h') // -3600000
ms('-200') // -200
```
### Convert from Milliseconds
```js
ms(60000) // "1m"
ms(2 * 60000) // "2m"
ms(-3 * 60000) // "-3m"
ms(ms('10 hours')) // "10h"
```
### Time Format Written-Out
```js
ms(60000, { long: true }) // "1 minute"
ms(2 * 60000, { long: true }) // "2 minutes"
ms(-3 * 60000, { long: true }) // "-3 minutes"
ms(ms('10 hours'), { long: true }) // "10 hours"
```
## Features
- Works both in [Node.js](https://nodejs.org) and in the browser
- If a number is supplied to `ms`, a string with a unit is returned
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
## Related Packages
- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
## Caught a Bug?
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
As always, you can run the tests using: `npm test`
@@ -0,0 +1,651 @@
import { globalRegistry } from "./registries.js";
import { assignProp } from "./util.js";
function assignProps(target, ...sources) {
for (const source of sources) {
for (const key of Reflect.ownKeys(source)) {
if (Object.prototype.propertyIsEnumerable.call(source, key)) {
assignProp(target, key, source[key]);
}
}
}
return target;
}
// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {
// return {
// processor: inputs.processor,
// metadataRegistry: inputs.metadata ?? globalRegistry,
// target: inputs.target ?? "draft-2020-12",
// unrepresentable: inputs.unrepresentable ?? "throw",
// };
// }
export function initializeContext(params) {
// Normalize target: convert old non-hyphenated versions to hyphenated versions
let target = params?.target ?? "draft-2020-12";
if (target === "draft-4")
target = "draft-04";
if (target === "draft-7")
target = "draft-07";
return {
processors: params.processors ?? {},
metadataRegistry: params?.metadata ?? globalRegistry,
target,
unrepresentable: params?.unrepresentable ?? "throw",
override: params?.override ?? (() => { }),
io: params?.io ?? "output",
counter: 0,
seen: new Map(),
sharedDefsExtractedFor: undefined,
sharedEmitDoneFor: undefined,
cycles: params?.cycles ?? "ref",
reused: params?.reused ?? "inline",
intersections: [],
deferred: [],
external: params?.external ?? undefined,
};
}
/**
* Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws
* `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a
* custom JSON Schema was written into `json`, in which case the caller must not write its own.
*/
export function handleUnrepresentable(schema, ctx, json, params, message) {
const result = typeof ctx.unrepresentable === "function"
? ctx.unrepresentable({ zodSchema: schema, path: params.path, message })
: ctx.unrepresentable;
if (result === "any")
return false;
if (result === undefined || result === "throw")
throw new Error(message);
Object.assign(json, result);
return true;
}
// never rename this back to `process`: bundler polyfills inject a top-level `const process` that a lexical declaration of the same name collides with (#6397)
export function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
var _a;
const def = schema._zod.def;
// check for schema in seens
const seen = ctx.seen.get(schema);
if (seen) {
seen.count++;
// check if cycle
const isCycle = _params.schemaPath.includes(schema);
if (isCycle) {
seen.cycle = _params.path;
}
return seen.schema;
}
// initialize
const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };
ctx.seen.set(schema, result);
ctx.sharedDefsExtractedFor = undefined;
ctx.sharedEmitDoneFor = undefined;
// custom method overrides default behavior
const overrideSchema = schema._zod.toJSONSchema?.();
if (overrideSchema) {
result.schema = overrideSchema;
}
else {
const params = {
..._params,
schemaPath: [..._params.schemaPath, schema],
path: _params.path,
};
if (schema._zod.processJSONSchema) {
schema._zod.processJSONSchema(ctx, result.schema, params);
}
else {
const _json = result.schema;
const processor = ctx.processors[def.type];
if (!processor) {
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
}
processor(schema, ctx, _json, params);
}
const parent = schema._zod.parent;
if (parent) {
// Also set ref if processor didn't (for inheritance)
if (!result.ref)
result.ref = parent;
processSchema(parent, ctx, params);
ctx.seen.get(parent).isParent = true;
}
}
// metadata
const meta = ctx.metadataRegistry.get(schema);
if (meta)
assignProps(result.schema, meta);
if (ctx.io === "input" && isTransforming(schema)) {
// examples/defaults only apply to output type of pipe
delete result.schema.examples;
delete result.schema.default;
}
// set prefault as default
if (ctx.io === "input" && "_prefault" in result.schema)
(_a = result.schema).default ?? (_a.default = result.schema._prefault);
delete result.schema._prefault;
// pulling fresh from ctx.seen in case it was overwritten
const _result = ctx.seen.get(schema);
return _result.schema;
}
/** @deprecated Renamed to `processSchema`. An export alias declares no binding, so it is safe to keep. */
export { processSchema as process };
// Escape a reference token for use in a JSON Pointer fragment (RFC 6901): `~` becomes `~0` and `/` becomes `~1`. The `~` replacement must run first.
function encodeJSONPointerSegment(segment) {
return segment.replace(/~/g, "~0").replace(/\//g, "~1");
}
export function extractDefs(ctx, schema
// params: EmitParams
) {
// iterate over seen map;
const root = ctx.seen.get(schema);
if (!root)
throw new Error("Unprocessed schema. This is a bug in Zod.");
// With `external` set, every registered schema resolves through the external branch of `makeURI`, so the root branch below produces the same ref the external branch would — this pass is identical whichever schema it is called with, and only needs to run once.
if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)
return;
// Track ids to detect duplicates across different schemas
const idToSchema = new Map();
for (const entry of ctx.seen.entries()) {
const id = ctx.metadataRegistry.get(entry[0])?.id;
if (id) {
const existing = idToSchema.get(id);
if (existing && existing !== entry[0]) {
throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
}
idToSchema.set(id, entry[0]);
}
}
// returns a ref to the schema defId will be empty if the ref points to an external schema (or #)
const makeURI = (entry) => {
// comparing the seen objects because sometimes multiple schemas map to the same seen object. e.g. lazy
// external is configured
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
if (ctx.external) {
const externalId = ctx.external.registry.get(entry[0])?.id; // ?? "__shared";// `__schema${ctx.counter++}`;
// check if schema is in the external registry
const uriGenerator = ctx.external.uri ?? ((id) => id);
if (externalId) {
return { ref: uriGenerator(externalId) };
}
// otherwise, add to __shared
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
entry[1].defId = id; // set defId so it will be reused if needed
return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };
}
const uriPrefix = `#`;
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
// an id-less root has nowhere to be extracted to, so it stays inline and self-references as `#`
if (entry[1] === root && !entry[1].schema.id) {
return { ref: uriPrefix };
}
// self-contained schema
const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };
};
// stored cached version in `def` property remove all properties, set $ref
const extractToDef = (entry) => {
// if the schema is already a reference, do not extract it
if (entry[1].schema.$ref) {
return;
}
const seen = entry[1];
const { ref, defId } = makeURI(entry);
seen.def = { ...seen.schema };
// defId won't be set if the schema is a reference to an external schema or if the schema is the root schema
if (defId)
seen.defId = defId;
// wipe away all properties except $ref
const schema = seen.schema;
for (const key in schema) {
delete schema[key];
}
schema.$ref = ref;
};
// throw on cycles
// break cycles
if (ctx.cycles === "throw") {
for (const entry of ctx.seen.entries()) {
const seen = entry[1];
if (seen.cycle) {
throw new Error("Cycle detected: " +
`#/${seen.cycle?.join("/")}/<root>` +
'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.');
}
}
}
// extract schemas into $defs
for (const entry of ctx.seen.entries()) {
const seen = entry[1];
// convert root schema to # $ref
if (schema === entry[0]) {
extractToDef(entry); // this has special handling for the root schema
continue;
}
// extract schemas that are in the external registry
if (ctx.external) {
const ext = ctx.external.registry.get(entry[0])?.id;
if (schema !== entry[0] && ext) {
extractToDef(entry);
continue;
}
}
// extract schemas with `id` meta
const id = ctx.metadataRegistry.get(entry[0])?.id;
if (id) {
extractToDef(entry);
continue;
}
// break cycles
if (seen.cycle) {
// any
extractToDef(entry);
continue;
}
// extract reused schemas
if (seen.count > 1) {
if (ctx.reused === "ref") {
extractToDef(entry);
}
}
}
if (ctx.external)
ctx.sharedDefsExtractedFor = ctx.external;
}
/** Rewrites `anyOf: [{type: "a"}, {type: "b"}]` to `type: ["a", "b"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so "exactly one" and "at least one" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */
function compactTypeUnion(schema) {
const options = schema.anyOf;
if (!Array.isArray(options) || options.length === 0 || schema.type !== undefined)
return;
const types = [];
for (const option of options) {
if (!option || typeof option !== "object")
return;
// A branch that is itself a compactible union folds into this one — nested `anyOf` and a flat `type` array say the same thing. Compacting it first also makes the result independent of the order this pass walks the seen map in.
compactTypeUnion(option);
const keys = Object.keys(option);
if (keys.length !== 1 || keys[0] !== "type")
return;
const type = option.type;
for (const member of Array.isArray(type) ? type : [type]) {
if (typeof member !== "string")
return;
if (!types.includes(member))
types.push(member);
}
}
delete schema.anyOf;
// A `type` array must be non-empty and unique (metaschema); a single member is spelled as a bare string.
schema.type = types.length === 1 ? types[0] : types;
}
/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,
* an annotation like `description` — makes a member unfoldable, so a constraint this does not
* understand leaves the `allOf` alone instead of being silently dropped or misattributed. */
const FOLDABLE_KEYS = new Set(["type", "properties", "required", "additionalProperties"]);
const UNION_KEYS = ["oneOf", "anyOf"];
/** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */
function undeclaredConstraint(member) {
const extra = member.additionalProperties;
if (extra === undefined || extra === false || typeof extra !== "object" || extra === null)
return null;
return Object.keys(extra).length ? extra : null;
}
/** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */
function foldObjects(members) {
const objects = [];
for (const member of members) {
// A boolean subschema is legal JSON Schema and carries no keywords to fold.
if (typeof member !== "object" || member.type !== "object")
return null;
for (const key in member) {
if (!FOLDABLE_KEYS.has(key))
return null;
}
objects.push(member);
}
const properties = {};
const required = new Set();
for (const object of objects) {
for (const key in object.properties) {
// `in` would report a `__proto__` key as already present via the prototype chain and skip it.
if (Object.prototype.hasOwnProperty.call(properties, key))
continue;
// Every member constrains this key: the ones that declare it say how, and a `catchall` member constrains it too even though it does not name it. The key has to satisfy all of them, which is the same intersection one level down.
const parts = [];
for (const other of objects) {
const part = other.properties?.[key] ?? undeclaredConstraint(other);
if (part === null || part === undefined)
continue;
if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))
parts.push(part);
}
const merged = parts.length === 1
? parts[0]
: (foldObjects(parts) ?? { allOf: parts });
assignProp(properties, key, merged);
}
for (const key of object.required ?? [])
required.add(key);
}
const folded = { type: "object", properties };
if (required.size)
folded.required = [...required];
// A key no member declares is rejected only when every member rejects it, so the fold is closed only when every member is. Otherwise it carries whatever the `catchall` members demand of such a key.
if (objects.every((object) => object.additionalProperties === false)) {
folded.additionalProperties = false;
}
else {
const constraints = [];
for (const object of objects) {
const constraint = undeclaredConstraint(object);
if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint)))
constraints.push(constraint);
}
if (constraints.length === 1)
folded.additionalProperties = constraints[0];
else if (constraints.length > 1)
folded.additionalProperties = { allOf: constraints };
}
return folded;
}
/** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two
* closed object members reject each other's keys and the schema validates nothing. Zod's parser
* pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when
* *every* side rejects it — so the emitted schema has to pool them too, and folding the members
* into one object is the encoding that says so on every target.
*
* This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`
* machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it
* keeps its reference and its own closedness rather than being inlined as a stale copy. */
function foldIntersection(json) {
const allOf = json.allOf;
if (!Array.isArray(allOf) || allOf.length < 2)
return;
// An `override` runs before this pass and may have written object keywords onto the intersection itself. Those are deliberate, so decline rather than overwrite them.
for (const key of FOLDABLE_KEYS)
if (key in json)
return;
// An intersection distributes over a union: `A & (X | Y)` is `(A & X) | (A & Y)`. Only the first union is distributed over; a second one stays among the members every branch folds against, where it fails the object check and declines the whole intersection rather than multiplying out.
const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
let folded = null;
if (!unions.length) {
folded = foldObjects(allOf);
}
else {
const union = unions[0];
const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));
if (Object.keys(union).length !== 1)
return;
const rest = allOf.filter((m) => m !== union);
const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));
if (branches.some((b) => !b))
return;
folded = { [keyword]: branches };
}
if (!folded)
return;
delete json.allOf;
assignProps(json, folded);
}
export function finalize(ctx, schema) {
const root = ctx.seen.get(schema);
if (!root)
throw new Error("Unprocessed schema. This is a bug in Zod.");
// flatten refs - inherit properties from parent schemas
const flattenRef = (zodSchema) => {
const seen = ctx.seen.get(zodSchema);
// already processed
if (seen.ref === null)
return;
const schema = seen.def ?? seen.schema;
const _cached = { ...schema };
const ref = seen.ref;
seen.ref = null; // prevent infinite recursion
if (ref) {
flattenRef(ref);
const refSeen = ctx.seen.get(ref);
const refSchema = refSeen.schema;
// merge referenced schema into current
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
// older drafts can't combine $ref with other properties
schema.allOf = schema.allOf ?? [];
schema.allOf.push(refSchema);
}
else {
assignProps(schema, refSchema);
}
// restore child's own properties (child wins)
assignProps(schema, _cached);
const isParentRef = zodSchema._zod.parent === ref;
// For parent chain, child is a refinement - remove parent-only properties
if (isParentRef) {
for (const key in schema) {
if (key === "$ref" || key === "allOf")
continue;
if (!(key in _cached)) {
delete schema[key];
}
}
}
// When ref was extracted to $defs, remove properties that match the definition
if (refSchema.$ref && refSeen.def) {
for (const key in schema) {
if (key === "$ref" || key === "allOf")
continue;
if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {
delete schema[key];
}
}
}
}
// If parent was extracted (has $ref), propagate $ref to this schema. This handles cases like: readonly().meta({id}).describe() where processor sets ref to innerType but parent should be referenced
const parent = zodSchema._zod.parent;
if (parent && parent !== ref) {
// Ensure parent is processed first so its def has inherited properties
flattenRef(parent);
const parentSeen = ctx.seen.get(parent);
if (parentSeen?.schema.$ref) {
schema.$ref = parentSeen.schema.$ref;
// De-duplicate with parent's definition
if (parentSeen.def) {
for (const key in schema) {
if (key === "$ref" || key === "allOf")
continue;
if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {
delete schema[key];
}
}
}
}
}
// execute overrides
ctx.override({
zodSchema: zodSchema,
jsonSchema: schema,
path: seen.path ?? [],
});
};
// Flattening walks the whole map and clears each `ref` as it goes, so a second call over the same map is a no-op scan. Skip it outright once it has run for a registry conversion.
if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
for (const entry of [...ctx.seen.entries()].reverse()) {
flattenRef(entry[0]);
}
if (ctx.target !== "openapi-3.0") {
for (const entry of ctx.seen.entries()) {
compactTypeUnion(entry[1].def ?? entry[1].schema);
}
}
for (const rewrite of ctx.deferred)
rewrite();
// After flattening, every member that was extracted is a `$ref`, so the fold sees the final shape. A schema that inherits an intersection — through `z.lazy`, or any `ref` chain — holds the same `allOf` array, so fold by array identity to catch every copy.
if (ctx.intersections.length) {
const carriers = new Map();
for (const seen of ctx.seen.values()) {
for (const json of [seen.schema, seen.def]) {
const allOf = json?.allOf;
if (!Array.isArray(allOf))
continue;
const existing = carriers.get(allOf);
if (existing)
existing.push(json);
else
carriers.set(allOf, [json]);
}
}
for (const allOf of ctx.intersections) {
for (const json of carriers.get(allOf) ?? [])
foldIntersection(json);
}
}
}
const result = {};
if (ctx.target === "draft-2020-12") {
result.$schema = "https://json-schema.org/draft/2020-12/schema";
}
else if (ctx.target === "draft-07") {
result.$schema = "http://json-schema.org/draft-07/schema#";
}
else if (ctx.target === "draft-04") {
result.$schema = "http://json-schema.org/draft-04/schema#";
}
else if (ctx.target === "openapi-3.0") {
// OpenAPI 3.0 schema objects should not include a $schema property
}
else {
// Arbitrary string values are allowed but won't have a $schema property set
}
if (ctx.external?.uri) {
const id = ctx.external.registry.get(schema)?.id;
if (!id)
throw new Error("Schema is missing an `id` property");
result.$id = ctx.external.uri(id);
}
// when the root was extracted into $defs, `root.schema` is the `$ref` wrapper and `root.def` is the body that now lives under $defs
assignProps(result, root.defId ? root.schema : (root.def ?? root.schema));
// The `id` in `.meta()` is a Zod-specific registration tag used to extract schemas into $defs — it is not user-facing JSON Schema metadata. Strip it from the output body where it would otherwise leak. The id is preserved implicitly via the $defs key (and via $ref paths).
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
if (rootMetaId !== undefined && result.id === rootMetaId)
delete result.id;
// build defs object. With `external`, `defs` is the shared object every schema writes into, so the same entries are reassigned on every call. Without it, `defs` is fresh per call and must be rebuilt.
const defs = ctx.external?.defs ?? {};
if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
for (const entry of ctx.seen.entries()) {
const seen = entry[1];
if (seen.def && seen.defId) {
if (seen.def.id === seen.defId)
delete seen.def.id;
assignProp(defs, seen.defId, seen.def);
}
}
}
if (ctx.external)
ctx.sharedEmitDoneFor = ctx.external;
// set definitions in result
if (ctx.external) {
}
else {
if (Object.keys(defs).length > 0) {
if (ctx.target === "draft-2020-12") {
result.$defs = defs;
}
else {
result.definitions = defs;
}
}
}
try {
// this "finalizes" this schema and ensures all cycles are removed each call to finalize() is functionally independent though the seen map is shared
const finalized = JSON.parse(JSON.stringify(result));
Object.defineProperty(finalized, "~standard", {
value: {
...schema["~standard"],
jsonSchema: {
input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
output: createStandardJSONSchemaMethod(schema, "output", ctx.processors),
},
},
enumerable: false,
writable: false,
});
return finalized;
}
catch (_err) {
throw new Error("Error converting schema to JSON.");
}
}
function isTransforming(_schema, _ctx) {
const ctx = _ctx ?? { seen: new Set() };
if (ctx.seen.has(_schema))
return false;
ctx.seen.add(_schema);
const def = _schema._zod.def;
if (def.type === "transform")
return true;
if (def.type === "array")
return isTransforming(def.element, ctx);
if (def.type === "set")
return isTransforming(def.valueType, ctx);
if (def.type === "lazy")
return isTransforming(def.getter(), ctx);
if (def.type === "promise" ||
def.type === "optional" ||
def.type === "nonoptional" ||
def.type === "nullable" ||
def.type === "readonly" ||
def.type === "default" ||
def.type === "prefault" ||
def.type === "catch") {
return isTransforming(def.innerType, ctx);
}
if (def.type === "intersection") {
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
}
if (def.type === "record" || def.type === "map") {
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
}
if (def.type === "pipe") {
if (_schema._zod.traits.has("$ZodCodec"))
return true;
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
}
if (def.type === "object") {
for (const key in def.shape) {
if (isTransforming(def.shape[key], ctx))
return true;
}
return false;
}
if (def.type === "union") {
for (const option of def.options) {
if (isTransforming(option, ctx))
return true;
}
return false;
}
if (def.type === "tuple") {
for (const item of def.items) {
if (isTransforming(item, ctx))
return true;
}
if (def.rest && isTransforming(def.rest, ctx))
return true;
return false;
}
return false;
}
/**
* Creates a toJSONSchema method for a schema instance.
* This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
*/
export const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
const ctx = initializeContext({ ...params, processors });
processSchema(schema, ctx);
extractDefs(ctx, schema);
return finalize(ctx, schema);
};
export const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
const { libraryOptions, target } = params ?? {};
const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });
processSchema(schema, ctx);
extractDefs(ctx, schema);
return finalize(ctx, schema);
};
@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/semver`
# Summary
This package contains type definitions for semver (https://github.com/npm/node-semver).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver.
### Additional Details
* Last updated: Wed, 03 Sep 2025 15:02:33 GMT
* Dependencies: none
# Credits
These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), [BendingBender](https://github.com/BendingBender), [Lucian Buzzo](https://github.com/LucianBuzzo), [Klaus Meinhardt](https://github.com/ajafff), [ExE Boss](https://github.com/ExE-Boss), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
@@ -0,0 +1 @@
{"version":3,"file":"stream.cjs","sources":["../src/stream.ts"],"sourcesContent":["import {createParser} from './parse.ts'\nimport type {EventSourceMessage, EventSourceParser} from './types.ts'\n\n/**\n * Options for the EventSourceParserStream.\n *\n * @public\n */\nexport interface StreamOptions {\n /**\n * Behavior when a parsing error occurs.\n *\n * - A custom function can be provided to handle the error.\n * - `'terminate'` will error the stream and stop parsing.\n * - Any other value will ignore the error and continue parsing.\n *\n * @defaultValue `undefined`\n */\n onError?: ('terminate' | ((error: Error) => void)) | undefined\n\n /**\n * Callback for when a reconnection interval is sent from the server.\n *\n * @param retry - The number of milliseconds to wait before reconnecting.\n */\n onRetry?: ((retry: number) => void) | undefined\n\n /**\n * Callback for when a comment is encountered in the stream.\n *\n * @param comment - The comment encountered in the stream.\n */\n onComment?: ((comment: string) => void) | undefined\n\n /**\n * Maximum number of characters the parser is allowed to buffer across calls to `feed()`.\n * See {@link ParserConfig.maxBufferSize} for details.\n *\n * When the limit is exceeded, the stream is always errored (regardless of the `onError`\n * setting) since the underlying parser is unrecoverable without a `reset()`.\n *\n * @defaultValue `undefined` (unbounded)\n */\n maxBufferSize?: number | undefined\n}\n\n/**\n * A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`.\n *\n * @example Basic usage\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream())\n * ```\n *\n * @example Terminate stream on parsing errors\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream({onError: 'terminate'}))\n * ```\n *\n * @public\n */\nexport class EventSourceParserStream extends TransformStream<string, EventSourceMessage> {\n constructor({onError, onRetry, onComment, maxBufferSize}: StreamOptions = {}) {\n let parser!: EventSourceParser\n\n super({\n start(controller) {\n parser = createParser({\n onEvent: (event) => {\n controller.enqueue(event)\n },\n onError(error) {\n if (typeof onError === 'function') {\n onError(error)\n }\n\n // `max-buffer-size-exceeded` is fatal — the parser is unusable until\n // `reset()`, which the stream wrapper has no way to call. Always\n // terminate the stream in that case so consumers see the meaningful\n // `ParseError` instead of an opaque \"cannot feed terminated parser\"\n // throw from the next chunk.\n if (onError === 'terminate' || error.type === 'max-buffer-size-exceeded') {\n controller.error(error)\n }\n\n // Ignore by default\n },\n onRetry,\n onComment,\n maxBufferSize,\n })\n },\n transform(chunk) {\n parser.feed(chunk)\n },\n })\n }\n}\n\nexport {type ErrorType, ParseError} from './errors.ts'\nexport type {EventSourceMessage} from './types.ts'\n"],"names":["createParser"],"mappings":";;;AAmEO,MAAM,gCAAgC,gBAA4C;AAAA,EACvF,YAAY,EAAC,SAAS,SAAS,WAAW,cAAA,IAAgC,IAAI;AAC5E,QAAI;AAEJ,UAAM;AAAA,MACJ,MAAM,YAAY;AAChB,iBAASA,MAAAA,aAAa;AAAA,UACpB,SAAS,CAAC,UAAU;AAClB,uBAAW,QAAQ,KAAK;AAAA,UAC1B;AAAA,UACA,QAAQ,OAAO;AACT,mBAAO,WAAY,cACrB,QAAQ,KAAK,IAQX,YAAY,eAAe,MAAM,SAAS,+BAC5C,WAAW,MAAM,KAAK;AAAA,UAI1B;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACA,UAAU,OAAO;AACf,eAAO,KAAK,KAAK;AAAA,MACnB;AAAA,IAAA,CACD;AAAA,EACH;AACF;;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_hO","260":"_lQ"},D:{"1":"_H _DC","2":"_IC","324":"_KD"},E:{"2":"_qB","132":"_pB"},F:{"1":"_HI","2":"_9G","324":"_dC _WN"},G:{"2":"_M"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"260":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_yB","2":"J","132":"_mJ"},Q:{"1":"JE"},R:{"1":"KE"},S:{"260":"_C"}},B:5,C:"Media Capture from DOM Elements API",D:true};
@@ -0,0 +1,3 @@
declare const _default: Uint16Array;
export default _default;
//# sourceMappingURL=decode-data-html.d.ts.map
@@ -0,0 +1,7 @@
import { Env, MiddlewareHandler } from "../../types.js";
import { ServeStaticOptions } from "./serve-static.js";
//#region src/adapter/cloudflare-workers/serve-static-module.d.ts
declare const module: <E extends Env = Env>(options: Omit<ServeStaticOptions<E>, "namespace">) => MiddlewareHandler;
//#endregion
export { module as serveStatic };
export {};
@@ -0,0 +1,15 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ChevronLeft = createLucideIcon("ChevronLeft", [
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
]);
export { ChevronLeft as default };
//# sourceMappingURL=chevron-left.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_7F","2":"_5D"},D:{"1":"_4G","2":"_vF","33":"_hN"},E:{"1":"_JB","2":"_RB"},F:{"1":"_6G","2":"_QK"},G:{"1":"_9","2":"_iB"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:5,C:"Gamepad API",D:true};
@@ -0,0 +1,20 @@
(The MIT License)
Copyright (c) 2017, Ryan Zimmerman <opensrc@ryanzim.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"file":"lamp-floor.js","sources":["../../../src/icons/lamp-floor.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LampFloor\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAyaDZsMyA3SDZsMy03WiIgLz4KICA8cGF0aCBkPSJNMTIgOXYxMyIgLz4KICA8cGF0aCBkPSJNOSAyMmg2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/lamp-floor\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst LampFloor = createLucideIcon('LampFloor', [\n ['path', { d: 'M9 2h6l3 7H6l3-7Z', key: 'wcx6mj' }],\n ['path', { d: 'M12 9v13', key: '3n1su1' }],\n ['path', { d: 'M9 22h6', key: '1rlq3v' }],\n]);\n\nexport default LampFloor;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,35 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Waves = createLucideIcon("Waves", [
[
"path",
{
d: "M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",
key: "knzxuh"
}
],
[
"path",
{
d: "M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",
key: "2jd2cc"
}
],
[
"path",
{
d: "M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",
key: "rd2r6e"
}
]
]);
export { Waves as default };
//# sourceMappingURL=waves.js.map
@@ -0,0 +1,231 @@
/**
* OAuth provider extensions for specialized authentication flows.
*
* This module provides ready-to-use OAuthClientProvider implementations
* for common machine-to-machine authentication scenarios.
*/
import { OAuthClientInformation, OAuthClientMetadata, OAuthTokens } from '../shared/auth.js';
import { AddClientAuthentication, OAuthClientProvider } from './auth.js';
/**
* Helper to produce a private_key_jwt client authentication function.
*
* Usage:
* const addClientAuth = createPrivateKeyJwtAuth({ issuer, subject, privateKey, alg, audience? });
* // pass addClientAuth as provider.addClientAuthentication implementation
*/
export declare function createPrivateKeyJwtAuth(options: {
issuer: string;
subject: string;
privateKey: string | Uint8Array | Record<string, unknown>;
alg: string;
audience?: string | URL;
lifetimeSeconds?: number;
claims?: Record<string, unknown>;
}): AddClientAuthentication;
/**
* Options for creating a ClientCredentialsProvider.
*/
export interface ClientCredentialsProviderOptions {
/**
* The client_id for this OAuth client.
*/
clientId: string;
/**
* The client_secret for client_secret_basic authentication.
*/
clientSecret: string;
/**
* Optional client name for metadata.
*/
clientName?: string;
/**
* Space-separated scopes values requested by the client.
*/
scope?: string;
/**
* The issuer URL of the authorization server these credentials were registered with.
* When set, `auth()` only presents them to that authorization server and throws if the
* MCP server advertises a different URL (one trailing slash aside).
*
* Omitting it is deprecated: the credentials then go to whichever authorization server
* the MCP server advertises first.
*/
expectedIssuer?: string;
}
/**
* OAuth provider for client_credentials grant with client_secret_basic authentication.
*
* This provider is designed for machine-to-machine authentication where
* the client authenticates using a client_id and client_secret.
*
* @example
* const provider = new ClientCredentialsProvider({
* clientId: 'my-client',
* clientSecret: 'my-secret',
* expectedIssuer: 'https://auth.example.com'
* });
*
* const transport = new StreamableHTTPClientTransport(serverUrl, {
* authProvider: provider
* });
*/
export declare class ClientCredentialsProvider implements OAuthClientProvider {
private _tokens?;
private _clientInfo;
private _clientMetadata;
constructor(options: ClientCredentialsProviderOptions & {
expectedIssuer: string;
});
/** @deprecated Pass `expectedIssuer` so the credentials are only sent to that authorization server. */
constructor(options: ClientCredentialsProviderOptions);
get redirectUrl(): undefined;
get clientMetadata(): OAuthClientMetadata;
clientInformation(): OAuthClientInformation;
saveClientInformation(info: OAuthClientInformation): void;
tokens(): OAuthTokens | undefined;
saveTokens(tokens: OAuthTokens): void;
redirectToAuthorization(): void;
saveCodeVerifier(): void;
codeVerifier(): string;
prepareTokenRequest(scope?: string): URLSearchParams;
}
/**
* Options for creating a PrivateKeyJwtProvider.
*/
export interface PrivateKeyJwtProviderOptions {
/**
* The client_id for this OAuth client.
*/
clientId: string;
/**
* The private key for signing JWT assertions.
* Can be a PEM string, Uint8Array, or JWK object.
*/
privateKey: string | Uint8Array | Record<string, unknown>;
/**
* The algorithm to use for signing (e.g., 'RS256', 'ES256').
*/
algorithm: string;
/**
* Optional client name for metadata.
*/
clientName?: string;
/**
* Optional JWT lifetime in seconds (default: 300).
*/
jwtLifetimeSeconds?: number;
/**
* Space-separated scopes values requested by the client.
*/
scope?: string;
/**
* The issuer URL of the authorization server these credentials were registered with.
* When set, `auth()` only presents them to that authorization server and throws if the
* MCP server advertises a different URL (one trailing slash aside).
*
* Omitting it is deprecated: the credentials then go to whichever authorization server
* the MCP server advertises first.
*/
expectedIssuer?: string;
}
/**
* OAuth provider for client_credentials grant with private_key_jwt authentication.
*
* This provider is designed for machine-to-machine authentication where
* the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2).
*
* @example
* const provider = new PrivateKeyJwtProvider({
* clientId: 'my-client',
* privateKey: pemEncodedPrivateKey,
* algorithm: 'RS256',
* expectedIssuer: 'https://auth.example.com'
* });
*
* const transport = new StreamableHTTPClientTransport(serverUrl, {
* authProvider: provider
* });
*/
export declare class PrivateKeyJwtProvider implements OAuthClientProvider {
private _tokens?;
private _clientInfo;
private _clientMetadata;
addClientAuthentication: AddClientAuthentication;
constructor(options: PrivateKeyJwtProviderOptions & {
expectedIssuer: string;
});
/** @deprecated Pass `expectedIssuer` so the credentials are only sent to that authorization server. */
constructor(options: PrivateKeyJwtProviderOptions);
get redirectUrl(): undefined;
get clientMetadata(): OAuthClientMetadata;
clientInformation(): OAuthClientInformation;
saveClientInformation(info: OAuthClientInformation): void;
tokens(): OAuthTokens | undefined;
saveTokens(tokens: OAuthTokens): void;
redirectToAuthorization(): void;
saveCodeVerifier(): void;
codeVerifier(): string;
prepareTokenRequest(scope?: string): URLSearchParams;
}
/**
* Options for creating a StaticPrivateKeyJwtProvider.
*/
export interface StaticPrivateKeyJwtProviderOptions {
/**
* The client_id for this OAuth client.
*/
clientId: string;
/**
* A pre-built JWT client assertion to use for authentication.
*
* This token should already contain the appropriate claims
* (iss, sub, aud, exp, etc.) and be signed by the client's key.
*/
jwtBearerAssertion: string;
/**
* Optional client name for metadata.
*/
clientName?: string;
/**
* Space-separated scopes values requested by the client.
*/
scope?: string;
/**
* The issuer URL of the authorization server these credentials were registered with.
* When set, `auth()` only presents them to that authorization server and throws if the
* MCP server advertises a different URL (one trailing slash aside).
*
* Omitting it is deprecated: the credentials then go to whichever authorization server
* the MCP server advertises first.
*/
expectedIssuer?: string;
}
/**
* OAuth provider for client_credentials grant with a static private_key_jwt assertion.
*
* This provider mirrors {@link PrivateKeyJwtProvider} but instead of constructing and
* signing a JWT on each request, it accepts a pre-built JWT assertion string and
* uses it directly for authentication.
*/
export declare class StaticPrivateKeyJwtProvider implements OAuthClientProvider {
private _tokens?;
private _clientInfo;
private _clientMetadata;
addClientAuthentication: AddClientAuthentication;
constructor(options: StaticPrivateKeyJwtProviderOptions & {
expectedIssuer: string;
});
/** @deprecated Pass `expectedIssuer` so the credentials are only sent to that authorization server. */
constructor(options: StaticPrivateKeyJwtProviderOptions);
get redirectUrl(): undefined;
get clientMetadata(): OAuthClientMetadata;
clientInformation(): OAuthClientInformation;
saveClientInformation(info: OAuthClientInformation): void;
tokens(): OAuthTokens | undefined;
saveTokens(tokens: OAuthTokens): void;
redirectToAuthorization(): void;
saveCodeVerifier(): void;
codeVerifier(): string;
prepareTokenRequest(scope?: string): URLSearchParams;
}
//# sourceMappingURL=auth-extensions.d.ts.map
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","_cloneNode","_removePropertiesDeep","toKeyAlias","node","key","alias","kind","increment","isIdentifier","name","isStringLiteral","JSON","stringify","value","removePropertiesDeep","cloneNode","computed","static","uid","Number","MAX_SAFE_INTEGER"],"sources":["../../src/converters/toKeyAlias.ts"],"sourcesContent":["import {\n isIdentifier,\n isStringLiteral,\n} from \"../validators/generated/index.ts\";\nimport cloneNode from \"../clone/cloneNode.ts\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function toKeyAlias(\n node: t.Method | t.Property,\n key: t.Node = node.key,\n): string {\n let alias;\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.kind`\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.computed`\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.static`\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function () {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAGe,SAASG,UAAUA,CAChCC,IAA2B,EAC3BC,GAAW,GAAGD,IAAI,CAACC,GAAG,EACd;EACR,IAAIC,KAAK;EAGT,IAAIF,IAAI,CAACG,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAOJ,UAAU,CAACK,SAAS,CAAC,CAAC,GAAG,EAAE;EACpC,CAAC,MAAM,IAAI,IAAAC,mBAAY,EAACJ,GAAG,CAAC,EAAE;IAC5BC,KAAK,GAAGD,GAAG,CAACK,IAAI;EAClB,CAAC,MAAM,IAAI,IAAAC,sBAAe,EAACN,GAAG,CAAC,EAAE;IAC/BC,KAAK,GAAGM,IAAI,CAACC,SAAS,CAACR,GAAG,CAACS,KAAK,CAAC;EACnC,CAAC,MAAM;IACLR,KAAK,GAAGM,IAAI,CAACC,SAAS,CAAC,IAAAE,6BAAoB,EAAC,IAAAC,kBAAS,EAACX,GAAG,CAAC,CAAC,CAAC;EAC9D;EAGA,IAAID,IAAI,CAACa,QAAQ,EAAE;IACjBX,KAAK,GAAG,IAAIA,KAAK,GAAG;EACtB;EAGA,IAAIF,IAAI,CAACc,MAAM,EAAE;IACfZ,KAAK,GAAG,UAAUA,KAAK,EAAE;EAC3B;EAEA,OAAOA,KAAK;AACd;AAEAH,UAAU,CAACgB,GAAG,GAAG,CAAC;AAElBhB,UAAU,CAACK,SAAS,GAAG,YAAY;EACjC,IAAIL,UAAU,CAACgB,GAAG,IAAIC,MAAM,CAACC,gBAAgB,EAAE;IAC7C,OAAQlB,UAAU,CAACgB,GAAG,GAAG,CAAC;EAC5B,CAAC,MAAM;IACL,OAAOhB,UAAU,CAACgB,GAAG,EAAE;EACzB;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,124 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_http_exception = require("../../http-exception.js");
const require_helper_cookie_index = require("../../helper/cookie/index.js");
const require_utils_jwt_index = require("../../utils/jwt/index.js");
//#region src/middleware/jwt/jwt.ts
/**
* JWT Auth Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/jwt}
*
* @param {object} options - The options for the JWT middleware.
* @param {SignatureKey} options.secret - A value of your secret key.
* @param {string} [options.cookie] - If this value is set, then the value is retrieved from the cookie header using that value as a key, which is then validated as a token.
* @param {SignatureAlgorithm} options.alg - An algorithm type that is used for verifying (required). Available types are `HS256` | `HS384` | `HS512` | `RS256` | `RS384` | `RS512` | `PS256` | `PS384` | `PS512` | `ES256` | `ES384` | `ES512` | `EdDSA`.
* @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'.
* @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL.
* @param {VerifyOptions} [options.verification] - Additional options for JWT payload verification.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.use(
* '/auth/*',
* jwt({
* secret: 'it-is-very-secret',
* alg: 'HS256',
* headerName: 'x-custom-auth-header', // Optional, default is 'Authorization'
* })
* )
*
* app.get('/auth/page', (c) => {
* return c.text('You are authorized')
* })
* ```
*/
const jwt = (options) => {
const verifyOpts = options.verification || {};
if (!options || !options.secret) throw new Error("JWT auth middleware requires options for \"secret\"");
if (!options.alg) throw new Error("JWT auth middleware requires options for \"alg\"");
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");
return async function jwt(ctx, next) {
const headerName = options.headerName || "Authorization";
const credentials = ctx.req.raw.headers.get(headerName);
let token;
if (credentials) {
const parts = credentials.split(/\s+/);
if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") {
const errDescription = "invalid credentials structure";
throw new require_http_exception.HTTPException(401, {
message: errDescription,
res: unauthorizedResponse({
ctx,
error: "invalid_request",
errDescription,
realm: options.realm
})
});
} else token = parts[1];
} else if (options.cookie) {
if (typeof options.cookie == "string") token = require_helper_cookie_index.getCookie(ctx, options.cookie);
else if (options.cookie.secret) {
if (options.cookie.prefixOptions) token = await require_helper_cookie_index.getSignedCookie(ctx, options.cookie.secret, options.cookie.key, options.cookie.prefixOptions);
else token = await require_helper_cookie_index.getSignedCookie(ctx, options.cookie.secret, options.cookie.key);
} else if (options.cookie.prefixOptions) token = require_helper_cookie_index.getCookie(ctx, options.cookie.key, options.cookie.prefixOptions);
else token = require_helper_cookie_index.getCookie(ctx, options.cookie.key);
}
if (!token) {
const errDescription = "no authorization included in request";
throw new require_http_exception.HTTPException(401, {
message: errDescription,
res: unauthorizedResponse({
ctx,
error: "invalid_request",
errDescription,
realm: options.realm
})
});
}
let payload;
let cause;
try {
payload = await require_utils_jwt_index.Jwt.verify(token, options.secret, {
alg: options.alg,
...verifyOpts
});
} catch (e) {
cause = e;
}
if (!payload) throw new require_http_exception.HTTPException(401, {
message: "Unauthorized",
res: unauthorizedResponse({
ctx,
error: "invalid_token",
statusText: "Unauthorized",
errDescription: "token verification failure",
realm: options.realm
}),
cause
});
ctx.set("jwtPayload", payload);
await next();
};
};
function unauthorizedResponse(opts) {
const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "\\\"");
const errDescription = opts.errDescription.replace(/"/g, "\\\"");
return new Response("Unauthorized", {
status: 401,
statusText: opts.statusText,
headers: { "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` }
});
}
const verifyWithJwks = require_utils_jwt_index.Jwt.verifyWithJwks;
const verify = require_utils_jwt_index.Jwt.verify;
const decode = require_utils_jwt_index.Jwt.decode;
const sign = require_utils_jwt_index.Jwt.sign;
//#endregion
exports.decode = decode;
exports.jwt = jwt;
exports.sign = sign;
exports.verify = verify;
exports.verifyWithJwks = verifyWithJwks;
@@ -0,0 +1,139 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('dot-notation');
const defaultOptions = [
{
allowIndexSignaturePropertyAccess: false,
allowKeywords: true,
allowPattern: '',
allowPrivateClassPropertyAccess: false,
allowProtectedClassPropertyAccess: false,
},
];
exports.default = (0, util_1.createRule)({
name: 'dot-notation',
meta: {
type: 'suggestion',
defaultOptions,
docs: {
description: 'Enforce dot notation whenever possible',
extendsBaseRule: true,
frozen: true,
recommended: 'stylistic',
requiresTypeChecking: true,
},
fixable: baseRule.meta.fixable,
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages,
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowIndexSignaturePropertyAccess: {
type: 'boolean',
description: 'Whether to allow accessing properties matching an index signature with array notation.',
},
allowKeywords: {
type: 'boolean',
description: 'Whether to allow keywords such as ["class"]`.',
},
allowPattern: {
type: 'string',
description: 'Regular expression of names to allow.',
},
allowPrivateClassPropertyAccess: {
type: 'boolean',
description: 'Whether to allow accessing class members marked as `private` with array notation.',
},
allowProtectedClassPropertyAccess: {
type: 'boolean',
description: 'Whether to allow accessing class members marked as `protected` with array notation.',
},
},
},
],
},
defaultOptions,
create(context, [options]) {
const rules = baseRule.create(context);
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
const allowPrivateClassPropertyAccess = options.allowPrivateClassPropertyAccess;
const allowProtectedClassPropertyAccess = options.allowProtectedClassPropertyAccess;
const allowIndexSignaturePropertyAccess = (options.allowIndexSignaturePropertyAccess ?? false) ||
tsutils.isCompilerOptionEnabled(services.program.getCompilerOptions(), 'noPropertyAccessFromIndexSignature');
return {
MemberExpression(node) {
if ((allowPrivateClassPropertyAccess ||
allowProtectedClassPropertyAccess ||
allowIndexSignaturePropertyAccess) &&
node.computed) {
// for perf reasons - only fetch symbols if we have to
const propertySymbol = services.getSymbolAtLocation(node.property) ??
services
.getTypeAtLocation(node.object)
.getNonNullableType()
.getProperties()
.find(propertySymbol => node.property.type === utils_1.AST_NODE_TYPES.Literal &&
propertySymbol.escapedName === node.property.value);
const modifierKind = (0, util_1.getModifiers)(propertySymbol?.getDeclarations()?.[0])?.[0].kind;
if ((allowPrivateClassPropertyAccess &&
modifierKind === ts.SyntaxKind.PrivateKeyword) ||
(allowProtectedClassPropertyAccess &&
modifierKind === ts.SyntaxKind.ProtectedKeyword)) {
return;
}
if (propertySymbol == null && allowIndexSignaturePropertyAccess) {
const objectType = services
.getTypeAtLocation(node.object)
.getNonNullableType();
const indexInfos = checker.getIndexInfosOfType(objectType);
if (indexInfos.some(info => tsutils.isTypeFlagSet(info.keyType, ts.TypeFlags.StringLike))) {
return;
}
}
}
rules.MemberExpression(node);
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareArrowOutDownRight = createLucideIcon("SquareArrowOutDownRight", [
["path", { d: "M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6", key: "14rsvq" }],
["path", { d: "m21 21-9-9", key: "1et2py" }],
["path", { d: "M21 15v6h-6", key: "1jko0i" }]
]);
export { SquareArrowOutDownRight as default };
//# sourceMappingURL=square-arrow-out-down-right.js.map
@@ -0,0 +1,27 @@
extends: eslint:recommended
env:
node: true
browser: true
rules:
block-scoped-var: 2
complexity: [2, 13]
curly: [2, multi-or-nest, consistent]
dot-location: [2, property]
dot-notation: 2
indent: [2, 2, SwitchCase: 1]
linebreak-style: [2, unix]
new-cap: 2
no-console: [2, allow: [warn, error]]
no-else-return: 2
no-eq-null: 2
no-fallthrough: 2
no-invalid-this: 2
no-return-assign: 2
no-shadow: 1
no-trailing-spaces: 2
no-use-before-define: [2, nofunc]
quotes: [2, single, avoid-escape]
semi: [2, always]
strict: [2, global]
valid-jsdoc: [2, requireReturn: false]
no-control-regex: 0
@@ -0,0 +1 @@
{"version":3,"file":"shield-plus.js","sources":["../../../src/icons/shield-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ShieldPlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTNjMCA1LTMuNSA3LjUtNy42NiA4Ljk1YTEgMSAwIDAgMS0uNjctLjAxQzcuNSAyMC41IDQgMTggNCAxM1Y2YTEgMSAwIDAgMSAxLTFjMiAwIDQuNS0xLjIgNi4yNC0yLjcyYTEuMTcgMS4xNyAwIDAgMSAxLjUyIDBDMTQuNTEgMy44MSAxNyA1IDE5IDVhMSAxIDAgMCAxIDEgMXoiIC8+CiAgPHBhdGggZD0iTTkgMTJoNiIgLz4KICA8cGF0aCBkPSJNMTIgOXY2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/shield-plus\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ShieldPlus = createLucideIcon('ShieldPlus', [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n key: 'oel41y',\n },\n ],\n ['path', { d: 'M9 12h6', key: '1c52cq' }],\n ['path', { d: 'M12 9v6', key: '199k2o' }],\n]);\n\nexport default ShieldPlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAChD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,43 @@
import { expect, test } from "vitest";
import * as z from "zod/mini";
declare module "zod/v4/core" {
interface $ZodType {
/** @deprecated */
_core(): string;
}
}
test("prototype extension", () => {
z.core.$ZodType.prototype._core = function () {
return "_core";
};
// should pass
const result = z.string()._core();
expect(result).toBe("_core");
// expectTypeOf<typeof result>().toEqualTypeOf<string>();
// clean up
z.ZodMiniType.prototype._core = undefined;
});
declare module "zod/v4/mini" {
interface ZodMiniType {
/** @deprecated */
_mini(): string;
}
}
test("prototype extension", () => {
z.ZodMiniType.prototype._mini = function () {
return "_mini";
};
// should pass
const result = z.string()._mini();
expect(result).toBe("_mini");
// clean up
z.ZodMiniType.prototype._mini = undefined;
});
@@ -0,0 +1 @@
{"version":3,"file":"ajvProvider-CgI-5L6O.d.mts","names":["URIComponent","_CodeOrName","UsedNames","IDENTIFIER","RegExp","Name","_Code","CodeItem","Record","Code","SafeExpr","nil","CodeArg","_","TemplateStringsArray","str","addCodeArg","strConcat","stringify","safeStringify","getProperty","getEsmExportName","regexpCode","Code","Name","NameGroup","NameValue","ValueReference","ScopeOptions","Set","Scope","ValueScopeOptions","ScopeStore","Record","ScopeValues","ValueScopeName","Map","ScopeValueSets","UsedValueState","UsedScopeValues","varKinds","prefixes","parent","ScopePath","property","itemIndex","VSOptions","ValueScope","ScopeValueSets","NameValue","ValueScope","ValueScopeName","_Code","Code","Name","Scope","_","str","strConcat","nil","getProperty","stringify","regexpCode","ScopeStore","varKinds","SafeExpr","Block","operators","CodeGenOptions","CodeGen","not","T","and","or","AddedKeywordDefinition","_jsonTypes","JSONType","isJSONType","ValidationTypes","RuleGroup","ValidationRules","Rule","getRules","AnySchema","EvaluatedProperties","EvaluatedItems","SchemaCxt","SchemaObjCxt","Code","Name","CodeGen","Rule","ValidationRules","toHash","T","alwaysValidSchema","checkUnknownRules","schemaHasRules","schemaHasRulesButRef","schemaRefOrVal","topSchemaRef","schemaPath","unescapeFragment","escapeFragment","escapeJsonPointer","unescapeJsonPointer","eachItem","SomeEvaluated","MergeEvaluatedFunc","Exclude","MergeEvaluated","mergeEvaluated","evaluatedPropsToName","setEvaluated","useFunc","Type","getErrorPath","checkStrictMode","AnySchema","SchemaObjCxt","Code","Name","Type","JSONType","SubschemaContext","SubschemaArgs","Set","Partial","getSubschema","keyword","schemaProp","schema","schemaPath","errSchemaPath","topSchemaRef","extendSubschemaData","dataProp","dpType","data","dataTypes","propertyName","extendSubschemaMode","jtdDiscriminator","jtdMetadata","compositeRule","createErrors","allErrors","KeywordErrorCxt","KeywordErrorDefinition","CodeGen","Code","Name","keywordError","keyword$DataError","ErrorPaths","reportError","reportExtraError","resetErrorsCount","extendErrors","gen","keyword","schemaValue","data","errsCount","it","AddedKeywordDefinition","AnySchemaObject","KeywordErrorCxt","KeywordCxtParams","SchemaCxt","SchemaObjCxt","SubschemaArgs","Code","Name","CodeGen","JSONType","ErrorPaths","validateFunctionCode","KeywordCxt","getData","dataLevel","dataNames","dataPathArr","StrictNullChecksWrapper","Name","Type","UnionToIntersection","U","SomeJSONSchema","Known","UncheckedJSONSchemaType","UncheckedPartialSchema","T","Partial","PartialSchema","JSONType","IsPartial","NumberKeywords","StringKeywords","K","Nullable","Record","UncheckedPropertiesSchema","Omit","UncheckedRequiredMembers","JSONSchemaType","PropertiesSchema","RequiredMembers","NumberType","StringType","SomeJTDSchemaType","Record","RequiredKeys","T","K","OptionalKeys","IsUnion_","U","IsUnion","TypeEquality","E","NullTypeEquality","EnumString","IsEnum","IsElements","IsValues","IsRecord","Union","IsEmptyRecord","JTDSchemaType","D","Exclude","Date","V","M","Omit","JTDDataDef","S","JTDDataType","ErrorObject","ValidationError","Partial","Error","default","UriResolver","MissingRefError","Error","default","Format","FormatDefinition","AsyncFormatDefinition","KeywordDefinition","KeywordErrorDefinition","CodeKeywordDefinition","MacroKeywordDefinition","FuncKeywordDefinition","Vocabulary","Schema","SchemaObject","AnySchemaObject","AsyncSchema","AnySchema","ValidateFunction","AsyncValidateFunction","AnyValidateFunction","ErrorObject","ErrorNoParams","SchemaCxt","SchemaObjCxt","Plugin","Opts","Ajv","KeywordCxt","DefinedError","JSONType","JSONSchemaType","JTDSchemaType","SomeJTDSchemaType","JTDDataType","_","str","stringify","nil","Name","Code","CodeGen","CodeGenOptions","AddedKeywordDefinition","AddedFormat","RegExpEngine","UriResolver","ValidationError","MissingRefError","ValidationRules","SchemaEnv","ValueScope","Options","CurrentOptions","DeprecatedOptions","Logger","Promise","CodeOptions","InstanceCodeOptions","RequiredInstanceOptions","K","NonNullable","InstanceOptions","T","N","Set","RegExp","separator","dataVar","ErrorsTextOptions","default","AnySchema","AnySchemaObject","UriResolver","Ajv","URIComponent","LocalRefs","inlineRef","getFullPath","_getFullPath","normalizeId","resolveUrl","getSchemaRefs","AnySchema","AnySchemaObject","AnyValidateFunction","EvaluatedProperties","EvaluatedItems","Ajv","InstanceOptions","CodeGen","Name","Code","ValueScopeName","LocalRefs","JSONType","SchemaRefs","SchemaEnv","SchemaCxt","Set","SchemaObjCxt","SchemaEnvArgs","compileSchema","resolveRef","getCompilingSchema","resolveSchema","URIComponent","CodeGen","Code","Name","ScopeValueSets","ValueScopeName","SchemaEnv","SchemaCxt","SchemaObjCxt","JSONType","KeywordCxt","Ajv","_SchemaObject","SchemaObject","AsyncSchema","AnySchemaObject","Schema","AnySchema","SchemaMap","SourceCode","DataValidationCxt","T","Record","ValidateFunction","ErrorObject","Evaluated","JTDParser","EvaluatedPropertieLine truncated
@@ -0,0 +1,64 @@
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.org/issue5752
TODO(bradnelson): Consider dropping this when we drop XP support.
"""
import xml.dom.minidom
def _Replacement_write_data(writer, data, is_attrib=False):
"""Writes datachars to writer."""
data = data.replace("&", "&amp;").replace("<", "&lt;")
data = data.replace('"', "&quot;").replace(">", "&gt;")
if is_attrib:
data = data.replace("\r", "&#xD;").replace("\n", "&#xA;").replace("\t", "&#x9;")
writer.write(data)
def _Replacement_writexml(self, writer, indent="", addindent="", newl=""):
# indent = current indentation
# addindent = indentation to add to higher levels
# newl = newline string
writer.write(indent + "<" + self.tagName)
attrs = self._get_attributes()
a_names = sorted(attrs.keys())
for a_name in a_names:
writer.write(' %s="' % a_name)
_Replacement_write_data(writer, attrs[a_name].value, is_attrib=True)
writer.write('"')
if self.childNodes:
writer.write(">%s" % newl)
for node in self.childNodes:
node.writexml(writer, indent + addindent, addindent, newl)
writer.write(f"{indent}</{self.tagName}>{newl}")
else:
writer.write("/>%s" % newl)
class XmlFix:
"""Object to manage temporary patching of xml.dom.minidom."""
def __init__(self):
# Preserve current xml.dom.minidom functions.
self.write_data = xml.dom.minidom._write_data
self.writexml = xml.dom.minidom.Element.writexml
# Inject replacement versions of a function and a method.
xml.dom.minidom._write_data = _Replacement_write_data
xml.dom.minidom.Element.writexml = _Replacement_writexml
def Cleanup(self):
if self.write_data:
xml.dom.minidom._write_data = self.write_data
xml.dom.minidom.Element.writexml = self.writexml
self.write_data = None
def __del__(self):
self.Cleanup()
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FileClock = createLucideIcon("FileClock", [
["path", { d: "M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3", key: "37hlfg" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["circle", { cx: "8", cy: "16", r: "6", key: "10v15b" }],
["path", { d: "M9.5 17.5 8 16.25V14", key: "1o80t2" }]
]);
export { FileClock as default };
//# sourceMappingURL=file-clock.js.map
@@ -0,0 +1,62 @@
# side-channel-map <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Store information about any JS value in a side channel, using a Map.
Warning: if the `key` is an object, this implementation will leak memory until you `delete` it.
Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy.
## Getting started
```sh
npm install --save side-channel-map
```
## Usage/Examples
```js
const assert = require('assert');
const getSideChannelMap = require('side-channel-map');
const channel = getSideChannelMap();
const key = {};
assert.equal(channel.has(key), false);
assert.throws(() => channel.assert(key), TypeError);
channel.set(key, 42);
channel.assert(key); // does not throw
assert.equal(channel.has(key), true);
assert.equal(channel.get(key), 42);
channel.delete(key);
assert.equal(channel.has(key), false);
assert.throws(() => channel.assert(key), TypeError);
```
## Tests
Clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/side-channel-map
[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-map.svg
[deps-svg]: https://david-dm.org/ljharb/side-channel-map.svg
[deps-url]: https://david-dm.org/ljharb/side-channel-map
[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-map/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/side-channel-map#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/side-channel-map.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/side-channel-map.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/side-channel-map.svg
[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-map
[codecov-image]: https://codecov.io/gh/ljharb/side-channel-map/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-map/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-map
[actions-url]: https://github.com/ljharb/side-channel-map/actions
@@ -0,0 +1,3 @@
# `react-switch`
View docs [here](https://radix-ui.com/primitives/docs/components/switch).
@@ -0,0 +1,3 @@
import type { Vocabulary } from "../../types";
declare const core: Vocabulary;
export default core;
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ArrowBigUpDash = createLucideIcon("ArrowBigUpDash", [
["path", { d: "M9 19h6", key: "456am0" }],
["path", { d: "M9 15v-3H5l7-7 7 7h-4v3H9z", key: "1r2uve" }]
]);
export { ArrowBigUpDash as default };
//# sourceMappingURL=arrow-big-up-dash.js.map
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _initializerWarningHelper;
function _initializerWarningHelper(descriptor, context) {
throw new Error("Decorating class property failed. Please ensure that " + "transform-class-properties is enabled and runs after the decorators transform.");
}
//# sourceMappingURL=initializerWarningHelper.js.map
@@ -0,0 +1,11 @@
'use strict';
var sequenceMatcher = options => {
return {
warning: options.translations.warnings.sequences,
suggestions: [options.translations.suggestions.sequences]
};
};
module.exports = sequenceMatcher;
//# sourceMappingURL=feedback.cjs.map
@@ -0,0 +1,43 @@
export declare const xmlReplacer: RegExp;
export declare const getCodePoint: (c: string, index: number) => number;
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using XML entities.
*
* If a character has no equivalent entity, a
* numeric hexadecimal reference (eg. `&#xfc;`) will be used.
*/
export declare function encodeXML(input: string): string;
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using numeric hexadecimal reference (eg. `&#xfc;`).
*
* Have a look at `escapeUTF8` if you want a more concise output at the expense
* of reduced transportability.
*
* @param data String to escape.
*/
export declare const escape: typeof encodeXML;
/**
* Encodes all characters not valid in XML documents using XML entities.
*
* Note that the output will be character-set dependent.
*
* @param data String to escape.
*/
export declare const escapeUTF8: (data: string) => string;
/**
* Encodes all characters that have to be escaped in HTML attributes,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
export declare const escapeAttribute: (data: string) => string;
/**
* Encodes all characters that have to be escaped in HTML text,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
export declare const escapeText: (data: string) => string;
//# sourceMappingURL=escape.d.ts.map
@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-namespace-keyword',
meta: {
type: 'suggestion',
docs: {
description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules',
recommended: 'recommended',
},
fixable: 'code',
messages: {
useNamespace: "Use 'namespace' instead of 'module' to declare custom TypeScript modules.",
},
schema: [],
},
defaultOptions: [],
create(context) {
return {
TSModuleDeclaration(node) {
// Do nothing if the name is a string.
if (node.id.type === utils_1.AST_NODE_TYPES.Literal) {
return;
}
// Get tokens of the declaration header.
const moduleType = context.sourceCode.getTokenBefore(node.id);
if (moduleType?.type === utils_1.AST_TOKEN_TYPES.Identifier &&
moduleType.value === 'module') {
context.report({
node,
messageId: 'useNamespace',
fix(fixer) {
return fixer.replaceText(moduleType, 'namespace');
},
});
}
},
};
},
});
@@ -0,0 +1,107 @@
import { MiddlewareHandler } from "../../types.js";
import { Context } from "../../context.js";
import { PermissionsPolicyDirective } from "./permissions-policy.js";
//#region src/middleware/secure-headers/secure-headers.d.ts
export type SecureHeadersVariables = {
secureHeadersNonce?: string;
};
export type ContentSecurityPolicyOptionHandler = (ctx: Context, directive: string) => string;
type ContentSecurityPolicyOptionValue = (string | ContentSecurityPolicyOptionHandler)[];
interface ContentSecurityPolicyOptions {
defaultSrc?: ContentSecurityPolicyOptionValue;
baseUri?: ContentSecurityPolicyOptionValue;
childSrc?: ContentSecurityPolicyOptionValue;
connectSrc?: ContentSecurityPolicyOptionValue;
fontSrc?: ContentSecurityPolicyOptionValue;
formAction?: ContentSecurityPolicyOptionValue;
frameAncestors?: ContentSecurityPolicyOptionValue;
frameSrc?: ContentSecurityPolicyOptionValue;
imgSrc?: ContentSecurityPolicyOptionValue;
manifestSrc?: ContentSecurityPolicyOptionValue;
mediaSrc?: ContentSecurityPolicyOptionValue;
objectSrc?: ContentSecurityPolicyOptionValue;
reportTo?: string;
reportUri?: string | string[];
sandbox?: ContentSecurityPolicyOptionValue;
scriptSrc?: ContentSecurityPolicyOptionValue;
scriptSrcAttr?: ContentSecurityPolicyOptionValue;
scriptSrcElem?: ContentSecurityPolicyOptionValue;
styleSrc?: ContentSecurityPolicyOptionValue;
styleSrcAttr?: ContentSecurityPolicyOptionValue;
styleSrcElem?: ContentSecurityPolicyOptionValue;
upgradeInsecureRequests?: ContentSecurityPolicyOptionValue;
workerSrc?: ContentSecurityPolicyOptionValue;
requireTrustedTypesFor?: ContentSecurityPolicyOptionValue;
trustedTypes?: ContentSecurityPolicyOptionValue;
}
interface ReportToOptions {
group: string;
max_age: number;
endpoints: ReportToEndpoint[];
}
interface ReportToEndpoint {
url: string;
}
interface ReportingEndpointOptions {
name: string;
url: string;
}
type PermissionsPolicyValue = '*' | 'self' | 'src' | 'none' | string;
type PermissionsPolicyOptions = Partial<Record<PermissionsPolicyDirective, PermissionsPolicyValue[] | boolean>>;
type overridableHeader = boolean | string;
interface SecureHeadersOptions {
contentSecurityPolicy?: ContentSecurityPolicyOptions;
contentSecurityPolicyReportOnly?: ContentSecurityPolicyOptions;
crossOriginEmbedderPolicy?: overridableHeader;
crossOriginResourcePolicy?: overridableHeader;
crossOriginOpenerPolicy?: overridableHeader;
originAgentCluster?: overridableHeader;
referrerPolicy?: overridableHeader;
reportingEndpoints?: ReportingEndpointOptions[];
reportTo?: ReportToOptions[];
strictTransportSecurity?: overridableHeader;
xContentTypeOptions?: overridableHeader;
xDnsPrefetchControl?: overridableHeader;
xDownloadOptions?: overridableHeader;
xFrameOptions?: overridableHeader;
xPermittedCrossDomainPolicies?: overridableHeader;
xXssProtection?: overridableHeader;
removePoweredBy?: boolean;
permissionsPolicy?: PermissionsPolicyOptions;
}
export declare const NONCE: ContentSecurityPolicyOptionHandler;
/**
* Secure Headers Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/secure-headers}
*
* @param {Partial<SecureHeadersOptions>} [customOptions] - The options for the secure headers middleware.
* @param {ContentSecurityPolicyOptions} [customOptions.contentSecurityPolicy] - Settings for the Content-Security-Policy header.
* @param {ContentSecurityPolicyOptions} [customOptions.contentSecurityPolicyReportOnly] - Settings for the Content-Security-Policy-Report-Only header.
* @param {overridableHeader} [customOptions.crossOriginEmbedderPolicy=false] - Settings for the Cross-Origin-Embedder-Policy header.
* @param {overridableHeader} [customOptions.crossOriginResourcePolicy=true] - Settings for the Cross-Origin-Resource-Policy header.
* @param {overridableHeader} [customOptions.crossOriginOpenerPolicy=true] - Settings for the Cross-Origin-Opener-Policy header.
* @param {overridableHeader} [customOptions.originAgentCluster=true] - Settings for the Origin-Agent-Cluster header.
* @param {overridableHeader} [customOptions.referrerPolicy=true] - Settings for the Referrer-Policy header.
* @param {ReportingEndpointOptions[]} [customOptions.reportingEndpoints] - Settings for the Reporting-Endpoints header.
* @param {ReportToOptions[]} [customOptions.reportTo] - Settings for the Report-To header.
* @param {overridableHeader} [customOptions.strictTransportSecurity=true] - Settings for the Strict-Transport-Security header.
* @param {overridableHeader} [customOptions.xContentTypeOptions=true] - Settings for the X-Content-Type-Options header.
* @param {overridableHeader} [customOptions.xDnsPrefetchControl=true] - Settings for the X-DNS-Prefetch-Control header.
* @param {overridableHeader} [customOptions.xDownloadOptions=true] - Settings for the X-Download-Options header.
* @param {overridableHeader} [customOptions.xFrameOptions=true] - Settings for the X-Frame-Options header.
* @param {overridableHeader} [customOptions.xPermittedCrossDomainPolicies=true] - Settings for the X-Permitted-Cross-Domain-Policies header.
* @param {overridableHeader} [customOptions.xXssProtection=true] - Settings for the X-XSS-Protection header.
* @param {boolean} [customOptions.removePoweredBy=true] - Settings for remove X-Powered-By header.
* @param {PermissionsPolicyOptions} [customOptions.permissionsPolicy] - Settings for the Permissions-Policy header.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
* app.use(secureHeaders())
* ```
*/
export declare const secureHeaders: (customOptions?: SecureHeadersOptions) => MiddlewareHandler;
//#endregion
export {};
@@ -0,0 +1,144 @@
import type CJSImportProcessor from "../CJSImportProcessor";
import type { Options } from "../index";
import type NameManager from "../NameManager";
import { JSXRole } from "../parser/tokenizer";
import type TokenProcessor from "../TokenProcessor";
import { type JSXPragmaInfo } from "../util/getJSXPragmaInfo";
import type RootTransformer from "./RootTransformer";
import Transformer from "./Transformer";
export default class JSXTransformer extends Transformer {
readonly rootTransformer: RootTransformer;
readonly tokens: TokenProcessor;
readonly importProcessor: CJSImportProcessor | null;
readonly nameManager: NameManager;
readonly options: Options;
jsxPragmaInfo: JSXPragmaInfo;
jsxImportSource: string;
isAutomaticRuntime: boolean;
lastLineNumber: number;
lastIndex: number;
filenameVarName: string | null;
esmAutomaticImportNameResolutions: {
[name: string]: string;
};
cjsAutomaticModuleNameResolutions: {
[path: string]: string;
};
constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, importProcessor: CJSImportProcessor | null, nameManager: NameManager, options: Options);
process(): boolean;
getPrefixCode(): string;
processJSXTag(): void;
getElementLocationCode(firstTokenStart: number): string;
/**
* Get the line number for this source position. This is calculated lazily and
* must be called in increasing order by index.
*/
getLineNumberForIndex(index: number): number;
/**
* Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is
* the primary transformation for the automatic transform.
*
* Example:
* <div a={1} key={2}>Hello{x}</div>
* becomes
* jsxs('div', {a: 1, children: ["Hello", x]}, 2)
*/
transformTagToJSXFunc(elementLocationCode: string | null, jsxRole: JSXRole): void;
/**
* Convert the current JSX element to a createElement call. In the classic
* runtime, this is the only case. In the automatic runtime, this is called
* as a fallback in some situations.
*
* Example:
* <div a={1} key={2}>Hello{x}</div>
* becomes
* React.createElement('div', {a: 1, key: 2}, "Hello", x)
*/
transformTagToCreateElement(elementLocationCode: string | null): void;
/**
* Get the code for the relevant function for this context: jsx, jsxs,
* or jsxDEV. The following open-paren is included as well.
*
* These functions are only used for the automatic runtime, so they are always
* auto-imported, but the auto-import will be either CJS or ESM based on the
* target module format.
*/
getJSXFuncInvocationCode(isStatic: boolean): string;
/**
* Return the code to use for the createElement function, e.g.
* `React.createElement`, including the following open-paren.
*
* This is the main function to use for the classic runtime. For the
* automatic runtime, this function is used as a fallback function to
* preserve behavior when there is a prop spread followed by an explicit
* key. In that automatic runtime case, the function should be automatically
* imported.
*/
getCreateElementInvocationCode(): string;
/**
* Return the code to use as the component when compiling a shorthand
* fragment, e.g. `React.Fragment`.
*
* This may be called from either the classic or automatic runtime, and
* the value should be auto-imported for the automatic runtime.
*/
getFragmentCode(): string;
/**
* Return code that invokes the given function.
*
* When the imports transform is enabled, use the CJSImportTransformer
* strategy of using `.call(void 0, ...` to avoid passing a `this` value in a
* situation that would otherwise look like a method call.
*/
claimAutoImportedFuncInvocation(funcName: string, importPathSuffix: string): string;
claimAutoImportedName(funcName: string, importPathSuffix: string): string;
/**
* Process the first part of a tag, before any props.
*/
processTagIntro(): void;
/**
* Starting at the beginning of the props, add the props argument to
* React.createElement, including the comma before it.
*/
processPropsObjectWithDevInfo(elementLocationCode: string | null): void;
/**
* Transform the core part of the props, assuming that a { has already been
* inserted before us and that a } will be inserted after us.
*
* If extractKeyCode is true (i.e. when using any jsx... function), any prop
* named "key" has its code captured and returned rather than being emitted to
* the output code. This shifts line numbers, and emitting the code later will
* correct line numbers again. If no key is found or if extractKeyCode is
* false, this function returns null.
*/
processProps(extractKeyCode: boolean): string | null;
processPropName(propName: string): void;
processPropValue(): void;
processStringPropValue(): void;
/**
* Starting in the middle of the props object literal, produce an additional
* prop for the children and close the object literal.
*/
processAutomaticChildrenAndEndProps(jsxRole: JSXRole): void;
/**
* Transform children into a comma-separated list, which will be either
* arguments to createElement or array elements of a children prop.
*/
processChildren(needsInitialComma: boolean): void;
/**
* Turn a JSX text element into a string literal, or nothing at all if the JSX
* text resolves to the empty string.
*
* Returns true if a string literal is emitted, false otherwise.
*/
processChildTextElement(needsComma: boolean): boolean;
getDevSource(elementLocationCode: string): string;
getFilenameVarName(): string;
}
/**
* Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart.
*
* Really only treat anything starting with a-z as tag names. `_`, `$`, `é`
* should be treated as component names
*/
export declare function startsWithLowerCase(s: string): boolean;