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,427 @@
/**
* 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.
*
* @flow strict
* @format
*/
import type {HermesNode} from './HermesAST';
import type {ParserOptions} from './ParserOptions';
import HermesASTAdapter from './HermesASTAdapter';
import {getModuleDocblock} from './getModuleDocblock';
declare var BigInt: ?(value: $FlowFixMe) => mixed;
export default class HermesToESTreeAdapter extends HermesASTAdapter {
+code: string;
constructor(options: ParserOptions, code: string) {
super(options);
this.code = code;
}
fixSourceLocation(node: HermesNode): void {
const loc = node.loc;
if (loc == null) {
return;
}
node.loc = {
source: this.sourceFilename ?? null,
start: loc.start,
end: loc.end,
};
node.range = [loc.rangeStart, loc.rangeEnd];
delete node.start;
delete node.end;
}
mapNode(node: HermesNode): HermesNode {
this.fixSourceLocation(node);
switch (node.type) {
case 'Program':
return this.mapProgram(node);
case 'NullLiteral':
return this.mapNullLiteral(node);
case 'BooleanLiteral':
case 'StringLiteral':
case 'NumericLiteral':
case 'JSXStringLiteral':
return this.mapSimpleLiteral(node);
case 'BigIntLiteral':
return this.mapBigIntLiteral(node);
case 'RegExpLiteral':
return this.mapRegExpLiteral(node);
case 'Empty':
return this.mapEmpty(node);
case 'TemplateElement':
return this.mapTemplateElement(node);
case 'BigIntLiteralTypeAnnotation':
return this.mapBigIntLiteralTypeAnnotation(node);
case 'GenericTypeAnnotation':
return this.mapGenericTypeAnnotation(node);
case 'ImportDeclaration':
return this.mapImportDeclaration(node);
case 'ImportSpecifier':
return this.mapImportSpecifier(node);
case 'ExportDefaultDeclaration':
return this.mapExportDefaultDeclaration(node);
case 'ExportNamedDeclaration':
return this.mapExportNamedDeclaration(node);
case 'ExportAllDeclaration':
return this.mapExportAllDeclaration(node);
case 'Property':
return this.mapProperty(node);
case 'FunctionDeclaration':
case 'FunctionExpression':
case 'ArrowFunctionExpression':
return this.mapFunction(node);
case 'PrivateName':
return this.mapPrivateName(node);
case 'ClassProperty':
case 'ClassPrivateProperty':
return this.mapClassProperty(node);
case 'MemberExpression':
case 'OptionalMemberExpression':
case 'CallExpression':
case 'OptionalCallExpression':
return this.mapChainExpression(node);
default:
return this.mapNodeDefault(node);
}
}
mapProgram(node: HermesNode): HermesNode {
const nodeDefault = this.mapNodeDefault(node);
node.sourceType = this.getSourceType();
node.docblock = getModuleDocblock(nodeDefault);
return nodeDefault;
}
mapSimpleLiteral(node: HermesNode): HermesNode {
return {
type: 'Literal',
loc: node.loc,
range: node.range,
value: node.value,
raw: this.code.slice(node.range[0], node.range[1]),
literalType: (() => {
switch (node.type) {
case 'NullLiteral':
return 'null';
case 'BooleanLiteral':
return 'boolean';
case 'StringLiteral':
case 'JSXStringLiteral':
return 'string';
case 'NumericLiteral':
return 'numeric';
case 'BigIntLiteral':
return 'bigint';
case 'RegExpLiteral':
return 'regexp';
}
return null;
})(),
};
}
mapBigIntLiteral(node: HermesNode): HermesNode {
const newNode = this.mapSimpleLiteral(node);
return {
...newNode,
...this.getBigIntLiteralValue(node.bigint),
};
}
mapNullLiteral(node: HermesNode): HermesNode {
return {
...this.mapSimpleLiteral(node),
value: null,
};
}
mapRegExpLiteral(node: HermesNode): HermesNode {
const {pattern, flags} = node;
// Create RegExp value if possible. This can fail when the flags are invalid.
let value;
try {
value = new RegExp(pattern, flags);
} catch (e) {
value = null;
}
return {
...this.mapSimpleLiteral(node),
value,
regex: {
pattern,
flags,
},
};
}
mapBigIntLiteralTypeAnnotation(node: HermesNode): HermesNode {
return {
...node,
...this.getBigIntLiteralValue(node.raw),
};
}
mapTemplateElement(node: HermesNode): HermesNode {
return {
type: 'TemplateElement',
loc: node.loc,
range: node.range,
tail: node.tail,
value: {
cooked: node.cooked,
raw: node.raw,
},
};
}
mapGenericTypeAnnotation(node: HermesNode): HermesNode {
// Convert simple `this` generic type to ThisTypeAnnotation
if (
node.typeParameters == null &&
node.id.type === 'Identifier' &&
node.id.name === 'this'
) {
return {
type: 'ThisTypeAnnotation',
loc: node.loc,
range: node.range,
};
}
return this.mapNodeDefault(node);
}
mapProperty(nodeUnprocessed: HermesNode): HermesNode {
const node = this.mapNodeDefault(nodeUnprocessed);
if (
node.value.type === 'FunctionExpression' &&
(node.method || node.kind !== 'init')
) {
node.value.loc.start = node.key.loc.end;
node.value.range[0] = node.key.range[1];
}
return node;
}
mapComment(node: HermesNode): HermesNode {
if (node.type === 'CommentBlock') {
node.type = 'Block';
} else if (node.type === 'CommentLine') {
node.type = 'Line';
}
return node;
}
mapFunction(nodeUnprocessed: HermesNode): HermesNode {
const node = this.mapNodeDefault(nodeUnprocessed);
switch (node.type) {
// This prop should ideally only live on `ArrowFunctionExpression` but to
// match espree output we place it on all functions types.
case 'FunctionDeclaration':
case 'FunctionExpression':
node.expression = false;
return node;
case 'ArrowFunctionExpression':
node.expression = node.body.type !== 'BlockStatement';
return node;
}
return node;
}
mapChainExpression(nodeUnprocessed: HermesNode): HermesNode {
/*
NOTE - In the below comments `MemberExpression` and `CallExpression`
are completely interchangable. For terseness we just reference
one each time.
*/
/*
Hermes uses the old babel-style AST:
```
(one?.two).three?.four;
^^^^^^^^^^^^^^^^^^^^^^ OptionalMemberExpression
^^^^^^^^^^^^^^^^ MemberExpression
^^^^^^^^ OptionalMemberExpression
```
We need to convert it to the ESTree representation:
```
(one?.two).three?.four;
^^^^^^^^^^^^^^^^^^^^^^ ChainExpression
^^^^^^^^^^^^^^^^^^^^^^ MemberExpression[optional = true]
^^^^^^^^^^^^^^^^ MemberExpression[optional = false]
^^^^^^^^ ChainExpression
^^^^^^^^ MemberExpression[optional = true]
```
We do this by converting the AST and its children (depth first), and then unwrapping
the resulting AST as appropriate.
Put another way:
1) traverse to the leaf
2) if the current node is an `OptionalMemberExpression`:
a) if the `.object` is a `ChainExpression`:
i) unwrap the child (`node.object = child.expression`)
b) convert this node to a `MemberExpression[optional = true]`
c) wrap this node (`node = ChainExpression[expression = node]`)
3) if the current node is a `MemberExpression`:
a) convert this node to a `MemberExpression[optional = true]`
*/
const node = this.mapNodeDefault(nodeUnprocessed);
const {child, childKey, isOptional} = ((): {
child: HermesNode,
childKey: string,
isOptional: boolean,
} => {
const isOptional: boolean = node.optional === true;
if (node.type.endsWith('MemberExpression')) {
return {
child: node.object,
childKey: 'object',
isOptional,
};
} else if (node.type.endsWith('CallExpression')) {
return {
child: node.callee,
childKey: 'callee',
isOptional,
};
} else {
return {
child: node.expression,
childKey: 'expression',
isOptional: false,
};
}
})();
const isChildUnwrappable =
child.type === 'ChainExpression' &&
// (x?.y).z is semantically different to `x?.y.z`.
// In the un-parenthesised case `.z` is only executed if and only if `x?.y` returns a non-nullish value.
// In the parenthesised case, `.z` is **always** executed, regardless of the return of `x?.y`.
// As such the AST is different between the two cases.
//
// In the hermes AST - any member part of a non-short-circuited optional chain is represented with `OptionalMemberExpression`
// so if we see a `MemberExpression`, then we know we've hit a parenthesis boundary.
node.type !== 'MemberExpression' &&
node.type !== 'CallExpression';
if (node.type.startsWith('Optional')) {
node.type = node.type.replace('Optional', '');
node.optional = isOptional;
} else {
node.optional = false;
}
if (!isChildUnwrappable && !isOptional) {
return node;
}
if (isChildUnwrappable) {
const newChild = child.expression;
node[childKey] = newChild;
}
return {
type: 'ChainExpression',
expression: node,
loc: node.loc,
range: node.range,
};
}
mapClassProperty(nodeUnprocessed: HermesNode): HermesNode {
const node = this.mapNodeDefault(nodeUnprocessed);
const key = (() => {
if (node.type === 'ClassPrivateProperty') {
const key = this.mapNodeDefault(node.key);
return {
type: 'PrivateIdentifier',
name: key.name,
range: key.range,
loc: key.loc,
};
}
return node.key;
})();
return {
...node,
computed: node.type === 'ClassPrivateProperty' ? false : node.computed,
key,
type: 'PropertyDefinition',
};
}
mapPrivateName(node: HermesNode): HermesNode {
return {
type: 'PrivateIdentifier',
name: node.id.name,
// estree the location refers to the entire string including the hash token
range: node.range,
loc: node.loc,
};
}
mapExportNamedDeclaration(nodeUnprocessed: HermesNode): HermesNode {
const node = super.mapExportNamedDeclaration(nodeUnprocessed);
const namespaceSpecifier = node.specifiers.find(
spec => spec.type === 'ExportNamespaceSpecifier',
);
if (namespaceSpecifier != null) {
if (node.specifiers.length !== 1) {
// this should already a hermes parser error - but let's be absolutely sure we're aligned with the spec
throw new Error('Cannot use an export all with any other specifiers');
}
return {
type: 'ExportAllDeclaration',
source: node.source,
exportKind: node.exportKind ?? 'value',
exported: namespaceSpecifier.exported,
range: node.range,
loc: node.loc,
};
}
return node;
}
mapExportAllDeclaration(nodeUnprocessed: HermesNode): HermesNode {
const node = super.mapExportAllDeclaration(nodeUnprocessed);
node.exported = node.exported ?? null;
return node;
}
}
@@ -0,0 +1,19 @@
/**
* dd-resizable-handle.ts 12.6.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/
import { GridItemHTMLElement } from './gridstack';
export interface DDResizableHandleOpt {
element?: string | HTMLElement;
start?: (event: MouseEvent) => void;
move?: (event: MouseEvent) => void;
stop?: (event: MouseEvent) => void;
}
export declare class DDResizableHandle {
protected host: GridItemHTMLElement;
protected dir: string;
protected option: DDResizableHandleOpt;
constructor(host: GridItemHTMLElement, dir: string, option: DDResizableHandleOpt);
/** call this when resize handle needs to be removed and cleaned up */
destroy(): DDResizableHandle;
}
@@ -0,0 +1,12 @@
# @zxcvbn-ts/dictionary-compression
This repository provides utilities for compression and decompression to optimize the bundle size of zxcvbn-ts language packages. It helps reduce the package size for both NPM downloads and client-side usage.
## Purpose
The primary goal of this repository is to centralize the compression logic used across all zxcvbn-ts language packages. This avoids duplication of code and ensures that language packages remain lightweight.
## Usage
By default, all zxcvbn-ts language packages already include this functionality. As a user of zxcvbn-ts, you do not need to interact with or directly use this repository. It serves as a shared resource for the language packages themselves, not for end-users.
## Why This Repository?
Without this repository, each zxcvbn-ts language package would need to include its own compression and decompression logic, leading to larger bundle sizes. By consolidating this logic here, we ensure a more efficient and maintainable approach to handling language package compression.
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2025_full: LibDefinition;
@@ -0,0 +1,51 @@
import { SearchSchemaInput } from './route.js';
export interface StandardSchemaValidatorProps<TInput, TOutput> {
readonly types?: StandardSchemaValidatorTypes<TInput, TOutput> | undefined;
readonly validate: AnyStandardSchemaValidate;
}
export interface StandardSchemaValidator<TInput, TOutput> {
readonly '~standard': StandardSchemaValidatorProps<TInput, TOutput>;
}
export type AnyStandardSchemaValidator = StandardSchemaValidator<any, any>;
export interface StandardSchemaValidatorTypes<TInput, TOutput> {
readonly input: TInput;
readonly output: TOutput;
}
export interface AnyStandardSchemaValidateSuccess {
readonly value: any;
readonly issues?: undefined;
}
export interface AnyStandardSchemaValidateFailure {
readonly issues: ReadonlyArray<AnyStandardSchemaValidateIssue>;
}
export interface AnyStandardSchemaValidateIssue {
readonly message: string;
}
export interface AnyStandardSchemaValidateInput {
readonly value: any;
}
export type AnyStandardSchemaValidate = (value: unknown) => (AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure) | Promise<AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure>;
export interface ValidatorObj<TInput, TOutput> {
parse: ValidatorFn<TInput, TOutput>;
}
export type AnyValidatorObj = ValidatorObj<any, any>;
export interface ValidatorAdapter<TInput, TOutput> {
types: {
input: TInput;
output: TOutput;
};
parse: (input: unknown) => TOutput;
}
export type AnyValidatorAdapter = ValidatorAdapter<any, any>;
export type AnyValidatorFn = ValidatorFn<any, any>;
export type ValidatorFn<TInput, TOutput> = (input: TInput) => TOutput;
export type Validator<TInput, TOutput> = ValidatorObj<TInput, TOutput> | ValidatorFn<TInput, TOutput> | ValidatorAdapter<TInput, TOutput> | StandardSchemaValidator<TInput, TOutput> | undefined;
export type AnyValidator = Validator<any, any>;
export type AnySchema = {};
export type DefaultValidator = Validator<Record<string, unknown>, AnySchema>;
export type ResolveSearchValidatorInputFn<TValidator> = TValidator extends (input: infer TSchemaInput) => any ? TSchemaInput extends SearchSchemaInput ? Omit<TSchemaInput, keyof SearchSchemaInput> : ResolveValidatorOutputFn<TValidator> : AnySchema;
export type ResolveSearchValidatorInput<TValidator> = TValidator extends AnyStandardSchemaValidator ? NonNullable<TValidator['~standard']['types']>['input'] : TValidator extends AnyValidatorAdapter ? TValidator['types']['input'] : TValidator extends AnyValidatorObj ? ResolveSearchValidatorInputFn<TValidator['parse']> : ResolveSearchValidatorInputFn<TValidator>;
export type ResolveValidatorInputFn<TValidator> = TValidator extends (input: infer TInput) => any ? TInput : undefined;
export type ResolveValidatorInput<TValidator> = TValidator extends AnyStandardSchemaValidator ? NonNullable<TValidator['~standard']['types']>['input'] : TValidator extends AnyValidatorAdapter ? TValidator['types']['input'] : TValidator extends AnyValidatorObj ? ResolveValidatorInputFn<TValidator['parse']> : ResolveValidatorInputFn<TValidator>;
export type ResolveValidatorOutputFn<TValidator> = TValidator extends (...args: any) => infer TSchema ? TSchema : AnySchema;
export type ResolveValidatorOutput<TValidator> = unknown extends TValidator ? TValidator : TValidator extends AnyStandardSchemaValidator ? NonNullable<TValidator['~standard']['types']>['output'] : TValidator extends AnyValidatorAdapter ? TValidator['types']['output'] : TValidator extends AnyValidatorObj ? ResolveValidatorOutputFn<TValidator['parse']> : ResolveValidatorOutputFn<TValidator>;
@@ -0,0 +1,9 @@
import Range = require("../classes/range");
import semver = require("../index");
/**
* Return true if the subRange range is entirely contained by the superRange range.
*/
declare function subset(sub: string | Range, dom: string | Range, options?: semver.RangeOptions): boolean;
export = subset;
@@ -0,0 +1 @@
{"version":3,"file":"file-pie-chart.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,72 @@
{
"name": "@isaacs/fs-minipass",
"version": "4.0.1",
"main": "./dist/commonjs/index.js",
"scripts": {
"prepare": "tshy",
"pretest": "npm run prepare",
"test": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"format": "prettier --write . --loglevel warn",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
},
"keywords": [],
"author": "Isaac Z. Schlueter",
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/npm/fs-minipass.git"
},
"description": "fs read and write streams based on minipass",
"dependencies": {
"minipass": "^7.0.4"
},
"devDependencies": {
"@types/node": "^20.11.30",
"mutate-fs": "^2.1.1",
"prettier": "^3.2.5",
"tap": "^18.7.1",
"tshy": "^1.12.0",
"typedoc": "^0.25.12"
},
"files": [
"dist"
],
"engines": {
"node": ">=18.0.0"
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"types": "./dist/commonjs/index.d.ts",
"type": "module",
"prettier": {
"semi": false,
"printWidth": 75,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_zF","2":"_OC"},D:{"1":"_7D","2":"J"},E:{"1":"_DB","2":"_e"},F:{"1":"_0F","2":"_1G"},G:{"1":"_8C","2":"_1"},H:{"130":"1D"},I:{"130":"_P"},J:{"2":"_B"},K:{"1":"H","130":"_D"},L:{"132":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"130":"bC"},P:{"130":"J","132":"_U"},Q:{"132":"JE"},R:{"132":"KE"},S:{"1":"ME","2":"LE"}},B:1,C:"Multiple file selection",D:true};
@@ -0,0 +1,3 @@
import { Unpack, UnpackSync } from './unpack.js';
export declare const extract: import("./make-command.js").TarCommand<Unpack, UnpackSync>;
//# sourceMappingURL=extract.d.ts.map
@@ -0,0 +1,582 @@
'use strict'
const {
InvalidArgumentError,
NotSupportedError
} = require('./errors')
const assert = require('node:assert')
const {
isValidHTTPToken,
isValidHeaderValue,
isStream,
destroy,
isBuffer,
isFormDataLike,
isIterable,
hasSafeIterator,
isBlobLike,
serializePathWithQuery,
parseHeaders,
assertRequestHandler,
getServerName,
normalizedMethodRecords,
getProtocolFromUrlString
} = require('./util')
const { channels } = require('./diagnostics.js')
const { headerNameLowerCasedRecord } = require('./constants')
// Verifies that a given path is valid does not contain control chars \x00 to \x20
const invalidPathRegex = /[^\u0021-\u00ff]/
function isValidContentLengthHeaderValue (val) {
if (typeof val !== 'string' || val.length === 0) {
return false
}
for (let i = 0; i < val.length; i++) {
const charCode = val.charCodeAt(i)
if (charCode < 48 || charCode > 57) {
return false
}
}
return true
}
const kHandler = Symbol('handler')
const kController = Symbol('controller')
const kResume = Symbol('resume')
class RequestController {
#paused = false
#reason = null
#aborted = false
#abort
[kResume] = null
rawHeaders = null
rawTrailers = null
constructor (abort) {
this.#abort = abort
}
pause () {
this.#paused = true
}
resume () {
if (this.#paused) {
this.#paused = false
this[kResume]?.()
}
}
abort (reason) {
if (!this.#aborted) {
this.#aborted = true
this.#reason = reason
this.#abort(reason)
}
}
get aborted () {
return this.#aborted
}
get reason () {
return this.#reason
}
get paused () {
return this.#paused
}
}
class Request {
constructor (origin, {
path,
method,
body,
headers,
query,
idempotent,
blocking,
upgrade,
headersTimeout,
bodyTimeout,
reset,
expectContinue,
servername,
throwOnError,
maxRedirections,
typeOfService
}, handler) {
if (typeof path !== 'string') {
throw new InvalidArgumentError('path must be a string')
} else if (
path[0] !== '/' &&
!(path.startsWith('http://') || path.startsWith('https://')) &&
method !== 'CONNECT'
) {
throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
} else if (invalidPathRegex.test(path)) {
throw new InvalidArgumentError('invalid request path')
}
if (typeof method !== 'string') {
throw new InvalidArgumentError('method must be a string')
} else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {
throw new InvalidArgumentError('invalid request method')
}
if (upgrade && typeof upgrade !== 'string') {
throw new InvalidArgumentError('upgrade must be a string')
}
if (upgrade && !isValidHeaderValue(upgrade)) {
throw new InvalidArgumentError('invalid upgrade header')
}
if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
throw new InvalidArgumentError('invalid headersTimeout')
}
if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
throw new InvalidArgumentError('invalid bodyTimeout')
}
if (reset != null && typeof reset !== 'boolean') {
throw new InvalidArgumentError('invalid reset')
}
if (expectContinue != null && typeof expectContinue !== 'boolean') {
throw new InvalidArgumentError('invalid expectContinue')
}
if (throwOnError != null) {
throw new InvalidArgumentError('invalid throwOnError')
}
if (maxRedirections != null && maxRedirections !== 0) {
throw new InvalidArgumentError('maxRedirections is not supported, use the redirect interceptor')
}
if (typeOfService != null && (!Number.isInteger(typeOfService) || typeOfService < 0 || typeOfService > 255)) {
throw new InvalidArgumentError('typeOfService must be an integer between 0 and 255')
}
this.headersTimeout = headersTimeout
this.bodyTimeout = bodyTimeout
this.method = method
this.typeOfService = typeOfService
this.abort = null
if (body == null) {
this.body = null
} else if (isStream(body)) {
this.body = body
const rState = this.body._readableState
if (!rState || !rState.autoDestroy) {
this.endHandler = function autoDestroy () {
destroy(this)
}
this.body.on('end', this.endHandler)
}
this.errorHandler = err => {
if (this.abort) {
this.abort(err)
} else {
this.error = err
}
}
this.body.on('error', this.errorHandler)
} else if (isBuffer(body)) {
this.body = body.byteLength ? body : null
} else if (ArrayBuffer.isView(body)) {
this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
} else if (body instanceof ArrayBuffer) {
this.body = body.byteLength ? Buffer.from(body) : null
} else if (typeof body === 'string') {
this.body = body.length ? Buffer.from(body) : null
} else if (isFormDataLike(body)) {
if (!isUndiciFormData(body)) {
throw new InvalidArgumentError('body must be a FormData created by this undici package instance; FormData from other sources, such as the built-in FormData provided by Node.js, is not supported')
}
this.body = body
} else if (isIterable(body) || isBlobLike(body)) {
this.body = body
} else {
throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
}
this.completed = false
this.aborted = false
this.upgrade = upgrade || null
this.path = query ? serializePathWithQuery(path, query) : path
// TODO: shall we maybe standardize it to an URL object?
this.origin = origin
this.protocol = getProtocolFromUrlString(origin)
this.idempotent = idempotent == null
? method === 'HEAD' || method === 'GET' || method === 'QUERY'
: idempotent
this.blocking = blocking ?? this.method !== 'HEAD'
this.reset = reset == null ? null : reset
this.host = null
this.contentLength = null
this.contentType = null
this.headers = []
// Only for H2
this.expectContinue = expectContinue != null ? expectContinue : false
if (Array.isArray(headers)) {
if (headers.length % 2 !== 0) {
throw new InvalidArgumentError('headers array must be even')
}
for (let i = 0; i < headers.length; i += 2) {
processHeader(this, headers[i], headers[i + 1])
}
} else if (headers && typeof headers === 'object') {
if (hasSafeIterator(headers)) {
for (const header of headers) {
if (!Array.isArray(header) || header.length !== 2) {
throw new InvalidArgumentError('headers must be in key-value pair format')
}
processHeader(this, header[0], header[1])
}
} else {
const keys = Object.keys(headers)
for (let i = 0; i < keys.length; ++i) {
processHeader(this, keys[i], headers[keys[i]])
}
}
} else if (headers != null) {
throw new InvalidArgumentError('headers must be an object or an array')
}
assertRequestHandler(handler, method, upgrade)
this.servername = servername || getServerName(this.host) || null
this[kHandler] = handler
if (channels.create.hasSubscribers) {
channels.create.publish({ request: this })
}
}
onBodySent (chunk) {
if (channels.bodyChunkSent.hasSubscribers) {
channels.bodyChunkSent.publish({ request: this, chunk })
}
if (this[kHandler].onBodySent) {
try {
return this[kHandler].onBodySent(chunk)
} catch (err) {
this.abort(err)
}
}
}
onRequestSent () {
if (channels.bodySent.hasSubscribers) {
channels.bodySent.publish({ request: this })
}
if (this[kHandler].onRequestSent) {
try {
return this[kHandler].onRequestSent()
} catch (err) {
this.abort(err)
}
}
}
onRequestStart (abort, context) {
assert(!this.aborted)
assert(!this.completed)
this[kController] = new RequestController(abort)
if (this.error) {
this[kController].abort(this.error)
return
}
this.abort = abort
return this[kHandler].onRequestStart(this[kController], context)
}
onResponseStarted () {
return this[kHandler].onResponseStarted?.()
}
onResponseStart (statusCode, headers, resume, statusText) {
assert(!this.aborted)
assert(!this.completed)
if (channels.headers.hasSubscribers) {
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
}
const controller = this[kController]
if (controller) {
controller[kResume] = resume
controller.rawHeaders = headers
}
const parsedHeaders = Array.isArray(headers) ? parseHeaders(headers) : headers
try {
this[kHandler].onResponseStart?.(controller, statusCode, parsedHeaders, statusText)
return !controller?.paused
} catch (err) {
this.abort(err)
return false
}
}
onResponseData (chunk) {
assert(!this.aborted)
assert(!this.completed)
if (channels.bodyChunkReceived.hasSubscribers) {
channels.bodyChunkReceived.publish({ request: this, chunk })
}
const controller = this[kController]
try {
this[kHandler].onResponseData?.(controller, chunk)
return !controller?.paused
} catch (err) {
this.abort(err)
return false
}
}
/**
* @param {number} statusCode
* @param {Buffer[]|string[]|import('../../types/header.d.ts').IncomingHttpHeaders} headers
* @param {import('node:stream').Duplex} socket
* @param {string} [statusText]
*/
onRequestUpgrade (statusCode, headers, socket, statusText = '') {
this.onFinally()
assert(!this.aborted)
assert(!this.completed)
if (channels.headers.hasSubscribers) {
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
}
const controller = this[kController]
if (controller) {
controller.rawHeaders = headers
}
const parsedHeaders = Array.isArray(headers) ? parseHeaders(headers) : headers
const result = this[kHandler].onRequestUpgrade?.(controller, statusCode, parsedHeaders, socket)
if (!this.aborted) {
this.completed = true
if (channels.trailers.hasSubscribers) {
channels.trailers.publish({ request: this, trailers: [] })
}
}
return result
}
onResponseEnd (trailers) {
this.onFinally()
assert(!this.aborted)
assert(!this.completed)
this.completed = true
if (channels.trailers.hasSubscribers) {
channels.trailers.publish({ request: this, trailers })
}
const controller = this[kController]
if (controller) {
controller.rawTrailers = trailers
}
const parsedTrailers = Array.isArray(trailers) ? parseHeaders(trailers) : trailers
try {
return this[kHandler].onResponseEnd?.(controller, parsedTrailers)
} catch (err) {
// TODO (fix): This might be a bad idea?
this.onResponseError(err)
}
}
onResponseError (error) {
this.onFinally()
if (channels.error.hasSubscribers) {
channels.error.publish({ request: this, error })
}
if (this.aborted) {
return
}
this.aborted = true
const controller = this[kController]
return this[kHandler].onResponseError?.(controller, error)
}
onFinally () {
if (this.errorHandler) {
this.body.off('error', this.errorHandler)
this.errorHandler = null
}
if (this.endHandler) {
this.body.off('end', this.endHandler)
this.endHandler = null
}
}
addHeader (key, value) {
processHeader(this, key, value)
return this
}
}
function processHeader (request, key, val) {
if (val && (typeof val === 'object' && !Array.isArray(val))) {
throw new InvalidArgumentError(`invalid ${key} header`)
} else if (val === undefined) {
return
}
let headerName = headerNameLowerCasedRecord[key]
if (headerName === undefined) {
headerName = key.toLowerCase()
if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {
throw new InvalidArgumentError('invalid header key')
}
}
if (Array.isArray(val)) {
const arr = []
for (let i = 0; i < val.length; i++) {
if (typeof val[i] === 'string') {
if (!isValidHeaderValue(val[i])) {
throw new InvalidArgumentError(`invalid ${key} header`)
}
arr.push(val[i])
} else if (val[i] === null) {
arr.push('')
} else if (typeof val[i] === 'object') {
throw new InvalidArgumentError(`invalid ${key} header`)
} else {
// Coerce primitives (and reject unsafe coercions such as functions
// with a crafted toString/Symbol.toPrimitive).
const str = `${val[i]}`
if (!isValidHeaderValue(str)) {
throw new InvalidArgumentError(`invalid ${key} header`)
}
arr.push(str)
}
}
val = arr
} else if (typeof val === 'string') {
if (!isValidHeaderValue(val)) {
throw new InvalidArgumentError(`invalid ${key} header`)
}
} else if (val === null) {
val = ''
} else {
// Coerce primitives (and reject unsafe coercions such as functions
// with a crafted toString/Symbol.toPrimitive).
val = `${val}`
if (!isValidHeaderValue(val)) {
throw new InvalidArgumentError(`invalid ${key} header`)
}
}
if (headerName === 'host') {
if (request.host !== null) {
throw new InvalidArgumentError('duplicate host header')
}
if (typeof val !== 'string') {
throw new InvalidArgumentError('invalid host header')
}
// Consumed by Client
request.host = val
} else if (headerName === 'content-length') {
if (request.contentLength !== null) {
throw new InvalidArgumentError('duplicate content-length header')
}
if (!isValidContentLengthHeaderValue(val)) {
throw new InvalidArgumentError('invalid content-length header')
}
request.contentLength = parseInt(val, 10)
} else if (request.contentType === null && headerName === 'content-type') {
request.contentType = val
request.headers.push(key, val)
} else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {
throw new InvalidArgumentError(`invalid ${headerName} header`)
} else if (headerName === 'connection') {
// Per RFC 7230 Section 6.1, Connection header can contain
// a comma-separated list of connection option tokens (header names)
const value = typeof val === 'string' ? val : null
if (value === null) {
throw new InvalidArgumentError('invalid connection header')
}
for (const token of value.toLowerCase().split(',')) {
const trimmed = token.trim()
if (!isValidHTTPToken(trimmed)) {
throw new InvalidArgumentError('invalid connection header')
}
if (trimmed === 'close') {
request.reset = true
}
}
} else if (headerName === 'expect') {
throw new NotSupportedError('expect header not supported')
} else {
request.headers.push(key, val)
}
}
let isFormData
function isUndiciFormData (body) {
if (isFormData === undefined) {
require('../web/fetch/formdata')
isFormData = require('../web/webidl').webidl.is.FormData
}
return isFormData(body)
}
module.exports = Request
@@ -0,0 +1 @@
{"version":3,"file":"thumbs-down.js","sources":["../../../src/icons/thumbs-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ThumbsDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMTRWMiIgLz4KICA8cGF0aCBkPSJNOSAxOC4xMiAxMCAxNEg0LjE3YTIgMiAwIDAgMS0xLjkyLTIuNTZsMi4zMy04QTIgMiAwIDAgMSA2LjUgMkgyMGEyIDIgMCAwIDEgMiAydjhhMiAyIDAgMCAxLTIgMmgtMi43NmEyIDIgMCAwIDAtMS43OSAxLjExTDEyIDIyYTMuMTMgMy4xMyAwIDAgMS0zLTMuODhaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/thumbs-down\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 ThumbsDown = createLucideIcon('ThumbsDown', [\n ['path', { d: 'M17 14V2', key: '8ymqnk' }],\n [\n 'path',\n {\n d: 'M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z',\n key: 'm61m77',\n },\n ],\n]);\n\nexport default ThumbsDown;\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,CAAA,CAChD,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,CACzC,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;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":"receipt-russian-ruble.js","sources":["../../../src/icons/receipt-russian-ruble.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ReceiptRussianRuble\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAydjIwbDItMSAyIDEgMi0xIDIgMSAyLTEgMiAxIDItMSAyIDFWMmwtMiAxLTItMS0yIDEtMi0xLTIgMS0yLTEtMiAxWiIgLz4KICA8cGF0aCBkPSJNOCAxNWg1IiAvPgogIDxwYXRoIGQ9Ik04IDExaDVhMiAyIDAgMSAwIDAtNGgtM3YxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/receipt-russian-ruble\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 ReceiptRussianRuble = createLucideIcon('ReceiptRussianRuble', [\n [\n 'path',\n { d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z', key: 'q3az6g' },\n ],\n ['path', { d: 'M8 15h5', key: 'vxg57a' }],\n ['path', { d: 'M8 11h5a2 2 0 1 0 0-4h-3v10', key: '1usi5u' }],\n]);\n\nexport default ReceiptRussianRuble;\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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,iBAAiB,qBAAuB,CAAA,CAAA,CAAA;AAAA,CAClE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAChG,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,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -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 Repeat = createLucideIcon("Repeat", [
["path", { d: "m17 2 4 4-4 4", key: "nntrym" }],
["path", { d: "M3 11v-1a4 4 0 0 1 4-4h14", key: "84bu3i" }],
["path", { d: "m7 22-4-4 4-4", key: "1wqhfi" }],
["path", { d: "M21 13v1a4 4 0 0 1-4 4H3", key: "1rx37r" }]
]);
export { Repeat as default };
//# sourceMappingURL=repeat.js.map
@@ -0,0 +1 @@
{"version":3,"file":"text-cursor.js","sources":["../../../src/icons/text-cursor.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TextCursor\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMjJoLTFhNCA0IDAgMCAxLTQtNFY2YTQgNCAwIDAgMSA0LTRoMSIgLz4KICA8cGF0aCBkPSJNNyAyMmgxYTQgNCAwIDAgMCA0LTR2LTEiIC8+CiAgPHBhdGggZD0iTTcgMmgxYTQgNCAwIDAgMSA0IDR2MSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/text-cursor\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 TextCursor = createLucideIcon('TextCursor', [\n ['path', { d: 'M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1', key: 'uvaxm9' }],\n ['path', { d: 'M7 22h1a4 4 0 0 0 4-4v-1', key: '11xy8d' }],\n ['path', { d: 'M7 2h1a4 4 0 0 1 4 4v1', key: '1uw06m' }],\n]);\n\nexport default TextCursor;\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,CAAA,CAChD,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,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,4 @@
export declare const stylesheetSingleton: () => {
add: (style: string) => void;
remove: () => void;
};
@@ -0,0 +1 @@
module.exports={C:{"60":0.00438,"115":0.16191,"120":0.38071,"121":0.60826,"138":0.00438,"140":0.01313,"143":0.03938,"150":0.00875,"152":0.00875,"153":0.01313,"154":0.10502,"155":0.43322,"156":0.47261,"157":0.01313,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 139 141 142 144 145 146 147 148 149 151 158 159 160 3.5 3.6"},D:{"62":0.00875,"63":0.00438,"64":0.00438,"65":0.00438,"68":0.00438,"70":0.00875,"73":0.00438,"75":0.00438,"79":0.00438,"81":0.00438,"83":0.00875,"87":0.03501,"88":0.00438,"91":0.00875,"92":0.00438,"101":0.0175,"103":0.33695,"104":0.32382,"105":0.30194,"106":0.31945,"107":0.30194,"108":0.32382,"109":0.84019,"110":0.30194,"111":0.37196,"112":0.29757,"115":0.00875,"116":0.60389,"117":0.31507,"118":0.60389,"119":0.66078,"120":0.93646,"122":0.10502,"123":0.03063,"124":0.31945,"126":0.00875,"127":0.0175,"128":0.01313,"129":0.00438,"130":0.00438,"131":0.62139,"132":0.00875,"133":0.69141,"134":0.07002,"135":0.14441,"136":0.08314,"137":0.07877,"138":0.15754,"139":0.0919,"140":0.0919,"141":0.0919,"142":0.30194,"143":0.05251,"144":0.21005,"145":0.04376,"146":0.07002,"147":0.02626,"148":0.27131,"149":0.21442,"150":0.28006,"151":2.81377,"152":6.81781,"153":5.80695,"154":1.0021,"155":0.04376,"156":0.01313,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 66 67 69 71 72 74 76 77 78 80 84 85 86 89 90 93 94 95 96 97 98 99 100 102 113 114 121 125 157"},F:{"51":0.00438,"52":0.00438,"53":0.00438,"54":0.00438,"55":0.00438,"56":0.00438,"57":0.00438,"90":0.00438,"95":0.03501,"100":0.00438,"101":0.02626,"134":0.21442,"135":0.63452,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 96 97 98 99 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 133 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"100":0.00438,"109":0.03063,"119":0.35446,"120":0.40697,"135":0.00438,"144":0.01313,"147":0.00875,"148":0.00875,"149":0.00438,"150":0.06126,"151":0.13566,"152":1.40907,"153":1.31718,"154":0.4201,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 122 123 124 125 126 127 128 129 130 131 132 133 134 136 137 138 139 140 141 142 143 145 146"},E:{"27":0.47698,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 13.1 15.1 15.2-15.3 17.0 27.1 TP","11.1":0.00438,"14.1":0.00438,"15.4":0.07439,"15.5":0.0919,"15.6":0.22755,"16.0":0.00438,"16.1":0.07439,"16.2":0.03938,"16.3":0.04814,"16.4":0.01313,"16.5":0.02188,"16.6":0.23193,"17.1":0.16191,"17.2":0.00438,"17.3":0.02188,"17.4":0.08314,"17.5":0.03501,"17.6":0.24506,"18.0":0.00875,"18.1":0.04376,"18.2":0.02626,"18.3":0.10065,"18.4":0.09627,"18.5-18.7":0.05689,"26.0":0.06564,"26.1":0.08314,"26.2":0.13566,"26.3":0.07439,"26.4":0.06126,"26.5":0.59514,"26.6":3.05445,"27.2":0.00438},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00315,"5.0-5.1":0.00315,"6.0-6.1":0,"7.0-7.1":0.0063,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.03152,"11.0-11.2":0.00315,"11.3-11.4":0.0063,"12.0-12.1":0,"12.2-12.5":0.08196,"13.0-13.1":0,"13.2":0.01576,"13.3":0,"13.4-13.7":0.00315,"14.0-14.4":0.01261,"14.5-14.8":0.01891,"15.0-15.1":0.01891,"15.2-15.3":0.01261,"15.4":0.01576,"15.5":0.01891,"15.6-15.8":0.40979,"16.0":0.03152,"16.1":0.05674,"16.2":0.03152,"16.3":0.06935,"16.4":0.01576,"16.5":0.02522,"16.6-16.7":0.57056,"17.0":0.02207,"17.1":0.03152,"17.2":0.03152,"17.3":0.04728,"17.4":0.0662,"17.5":0.12924,"17.6-17.7":0.33414,"18.0":0.06935,"18.1":0.1387,"18.2":0.18914,"18.3":0.32783,"18.4":0.2049,"18.5-18.7":4.23347,"26.0":0.2049,"26.1":0.20805,"26.2":0.54219,"26.3":0.58632,"26.4":0.42871,"26.5":2.8717,"26.6":17.71881,"27.0":1.35862,"27.1":0,"27.2":0.03467},P:{"4":0.01807,"23":0.00904,"24":0.00904,"25":0.01807,"28":0.00904,"29":0.04519,"30":1.13869,_:"20 21 22 26 27 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.06326},I:{"0":0.00562,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":1.65346,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":21.73714},R:{_:"0"},M:{"0":0.12373},Q:{"14.9":0.01125},O:{"0":0.61302},H:{all:0}};
@@ -0,0 +1 @@
{"version":3,"file":"chevrons-down.js","sources":["../../../src/icons/chevrons-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChevronsDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyA2IDUgNSA1LTUiIC8+CiAgPHBhdGggZD0ibTcgMTMgNSA1IDUtNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chevrons-down\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 ChevronsDown = createLucideIcon('ChevronsDown', [\n ['path', { d: 'm7 6 5 5 5-5', key: '1lc07p' }],\n ['path', { d: 'm7 13 5 5 5-5', key: '1d48rs' }],\n]);\n\nexport default ChevronsDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,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,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"scroll-restoration-inline.cjs","names":[],"sources":["../../src/scroll-restoration-inline.ts?script-string"],"sourcesContent":["export default function (options: {\n storageKey: string\n key?: string\n behavior?: ScrollToOptions['behavior']\n shouldScrollRestoration?: boolean\n}) {\n let byKey\n\n try {\n byKey = JSON.parse(sessionStorage.getItem(options.storageKey) || '{}')\n } catch (error) {\n console.error(error)\n return\n }\n\n const resolvedKey = options.key || window.history.state?.__TSR_key\n const elementEntries = resolvedKey ? byKey[resolvedKey] : undefined\n\n if (\n options.shouldScrollRestoration &&\n elementEntries &&\n typeof elementEntries === 'object' &&\n Object.keys(elementEntries).length > 0\n ) {\n for (const elementSelector in elementEntries) {\n const entry = elementEntries[elementSelector]\n\n if (!entry || typeof entry !== 'object') {\n continue\n }\n\n const scrollX = entry.scrollX\n const scrollY = entry.scrollY\n\n if (!Number.isFinite(scrollX) || !Number.isFinite(scrollY)) {\n continue\n }\n\n if (elementSelector === 'window') {\n window.scrollTo({\n top: scrollY,\n left: scrollX,\n behavior: options.behavior,\n })\n } else if (elementSelector) {\n let element\n\n try {\n element = document.querySelector(elementSelector)\n } catch {\n continue\n }\n\n if (element) {\n element.scrollLeft = scrollX\n element.scrollTop = scrollY\n }\n }\n }\n\n return\n }\n\n const hash = window.location.hash.split('#', 2)[1]\n\n if (hash) {\n const hashScrollIntoViewOptions =\n window.history.state?.__hashScrollIntoViewOptions ?? true\n\n if (hashScrollIntoViewOptions) {\n const el = document.getElementById(hash)\n if (el) {\n el.scrollIntoView(hashScrollIntoViewOptions)\n }\n }\n\n return\n }\n\n window.scrollTo({ top: 0, left: 0, behavior: options.behavior })\n}\n"],"mappings":";AAAA,IAAA,oCAAe"}
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneWithoutLoc;
var _cloneNode = require("./cloneNode.js");
function cloneWithoutLoc(node) {
return (0, _cloneNode.default)(node, false, true);
}
//# sourceMappingURL=cloneWithoutLoc.js.map
@@ -0,0 +1,20 @@
/**
* @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 Notebook = createLucideIcon("Notebook", [
["path", { d: "M2 6h4", key: "aawbzj" }],
["path", { d: "M2 10h4", key: "l0bgd4" }],
["path", { d: "M2 14h4", key: "1gsvsf" }],
["path", { d: "M2 18h4", key: "1bu2t1" }],
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", key: "1nb95v" }],
["path", { d: "M16 2v20", key: "rotuqe" }]
]);
export { Notebook as default };
//# sourceMappingURL=notebook.js.map
@@ -0,0 +1,20 @@
import { formatErrorMessage } from './format-error-message.mjs';
let warning = () => { };
let invariant = () => { };
if (typeof process !== "undefined" &&
process.env?.NODE_ENV !== "production") {
warning = (check, message, errorCode) => {
if (!check && typeof console !== "undefined") {
console.warn(formatErrorMessage(message, errorCode));
}
};
invariant = (check, message, errorCode) => {
if (!check) {
throw new Error(formatErrorMessage(message, errorCode));
}
};
}
export { invariant, warning };
//# sourceMappingURL=errors.mjs.map
@@ -0,0 +1,26 @@
/**
* Check if the value is a plain object
*
* 校验是否是一个普通对象
*
* @example
* ```js
* import { isPlainObject } from 'is-what-type';
*
* isPlainObject({}); // true
* isPlainObject({ key: 'value' }); // true
* isPlainObject([]); // false
* isPlainObject(null); // false
* isPlainObject(undefined); // false
* isPlainObject(function() {}); // false
* isPlainObject(new Date()); // false
* isPlainObject(new (class {})()); // false
*
* function Fn() {}
* isPlainObject(new Fn()); // false
* ```
*
* @param value The value to check
* @returns `true` if the value is a plain object, else `false`
*/
export declare function isPlainObject<T = object>(value: unknown): value is T;
@@ -0,0 +1 @@
{"version":3,"file":"getCleanPasswords.mjs","sources":["../../../../../../src/matcher/dictionary/variants/matching/unmunger/getCleanPasswords.ts"],"sourcesContent":[null],"names":["CleanPasswords","constructor","substr","limit","trieRoot","buffer","finalPasswords","getAllPossibleSubsAtIndex","index","nodes","cur","i","length","character","charAt","getChild","push","helper","onlyFullSub","isFullSub","subIndex","changes","lastSubLetter","consecutiveSubCount","password","join","isFullSubstitution","hasSubs","sub","parents","isTerminal","letters","subs","letter","newSubs","concat","substitution","pop","firstChar","getAll","undefined","getCleanPasswords"],"mappings":"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"}
@@ -0,0 +1 @@
{"version":3,"file":"shopping-cart.js","sources":["../../../src/icons/shopping-cart.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ShoppingCart\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iMjEiIHI9IjEiIC8+CiAgPGNpcmNsZSBjeD0iMTkiIGN5PSIyMSIgcj0iMSIgLz4KICA8cGF0aCBkPSJNMi4wNSAyLjA1aDJsMi42NiAxMi40MmEyIDIgMCAwIDAgMiAxLjU4aDkuNzhhMiAyIDAgMCAwIDEuOTUtMS41N2wxLjY1LTcuNDNINS4xMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/shopping-cart\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 ShoppingCart = createLucideIcon('ShoppingCart', [\n ['circle', { cx: '8', cy: '21', r: '1', key: 'jimo8o' }],\n ['circle', { cx: '19', cy: '21', r: '1', key: '13723u' }],\n [\n 'path',\n {\n d: 'M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12',\n key: '9zh506',\n },\n ],\n]);\n\nexport default ShoppingCart;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,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,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;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":"pause-octagon.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,213 @@
/**
* JOSE module errors and error codes
*
* @module
*/
import type * as types from '../types.d.ts';
/**
* A generic Error that all other JOSE specific Error subclasses extend.
*
*/
export declare class JOSEError extends Error {
/**
* A unique error code for the particular error subclass.
*
* @ignore
*/
static code: string;
/** A unique error code for {@link JOSEError}. */
code: string;
/** @ignore */
constructor(message?: string, options?: {
cause?: unknown;
});
}
/**
* An error subclass thrown when a JWT Claim Set member validation fails.
*
*/
export declare class JWTClaimValidationFailed extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWTClaimValidationFailed}. */
code: string;
/** The Claim for which the validation failed. */
claim: string;
/** Reason code for the validation failure. */
reason: string;
/**
* The parsed JWT Claims Set (aka payload). Other JWT claims may or may not have been verified at
* this point. The JSON Web Signature (JWS) or a JSON Web Encryption (JWE) structures' integrity
* has however been verified. Claims Set verification happens after the JWS Signature or JWE
* Decryption processes.
*/
payload: types.JWTPayload;
/** @ignore */
constructor(message: string, payload: types.JWTPayload, claim?: string, reason?: string);
}
/**
* An error subclass thrown when a JWT is expired.
*
*/
export declare class JWTExpired extends JOSEError implements JWTClaimValidationFailed {
/** @ignore */
static code: string;
/** A unique error code for {@link JWTExpired}. */
code: string;
/** The Claim for which the validation failed. */
claim: string;
/** Reason code for the validation failure. */
reason: string;
/**
* The parsed JWT Claims Set (aka payload). Other JWT claims may or may not have been verified at
* this point. The JSON Web Signature (JWS) or a JSON Web Encryption (JWE) structures' integrity
* has however been verified. Claims Set verification happens after the JWS Signature or JWE
* Decryption processes.
*/
payload: types.JWTPayload;
/** @ignore */
constructor(message: string, payload: types.JWTPayload, claim?: string, reason?: string);
}
/**
* An error subclass thrown when a JOSE Algorithm is not allowed per developer preference.
*
*/
export declare class JOSEAlgNotAllowed extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JOSEAlgNotAllowed}. */
code: string;
}
/**
* An error subclass thrown when a particular feature or algorithm is not supported by this
* implementation or JOSE in general.
*
*/
export declare class JOSENotSupported extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JOSENotSupported}. */
code: string;
}
/**
* An error subclass thrown when a JWE ciphertext decryption fails.
*
*/
export declare class JWEDecryptionFailed extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWEDecryptionFailed}. */
code: string;
/** @ignore */
constructor(message?: string, options?: {
cause?: unknown;
});
}
/**
* An error subclass thrown when a JWE is invalid.
*
*/
export declare class JWEInvalid extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWEInvalid}. */
code: string;
}
/**
* An error subclass thrown when a JWS is invalid.
*
*/
export declare class JWSInvalid extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWSInvalid}. */
code: string;
}
/**
* An error subclass thrown when a JWT is invalid.
*
*/
export declare class JWTInvalid extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWTInvalid}. */
code: string;
}
/**
* An error subclass thrown when a JWK is invalid.
*
*/
export declare class JWKInvalid extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWKInvalid}. */
code: string;
}
/**
* An error subclass thrown when a JWKS is invalid.
*
*/
export declare class JWKSInvalid extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWKSInvalid}. */
code: string;
}
/**
* An error subclass thrown when no keys match from a JWKS.
*
*/
export declare class JWKSNoMatchingKey extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWKSNoMatchingKey}. */
code: string;
/** @ignore */
constructor(message?: string, options?: {
cause?: unknown;
});
}
/**
* An error subclass thrown when multiple keys match from a JWKS.
*
*/
export declare class JWKSMultipleMatchingKeys extends JOSEError {
/** @ignore */
[Symbol.asyncIterator]: () => AsyncIterableIterator<types.CryptoKey>;
/** @ignore */
static code: string;
/** A unique error code for {@link JWKSMultipleMatchingKeys}. */
code: string;
/** @ignore */
constructor(message?: string, options?: {
cause?: unknown;
});
}
/**
* Timeout was reached when retrieving the JWKS response.
*
*/
export declare class JWKSTimeout extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWKSTimeout}. */
code: string;
/** @ignore */
constructor(message?: string, options?: {
cause?: unknown;
});
}
/**
* An error subclass thrown when JWS signature verification fails.
*
*/
export declare class JWSSignatureVerificationFailed extends JOSEError {
/** @ignore */
static code: string;
/** A unique error code for {@link JWSSignatureVerificationFailed}. */
code: string;
/** @ignore */
constructor(message?: string, options?: {
cause?: unknown;
});
}
@@ -0,0 +1,21 @@
# The MIT License (MIT)
Copyright © Héctor Molinero Fernández
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,43 @@
// Adapted from https://gist.github.com/mjackson/5311256
function hueToRgb(p, q, t) {
if (t < 0)
t += 1;
if (t > 1)
t -= 1;
if (t < 1 / 6)
return p + (q - p) * 6 * t;
if (t < 1 / 2)
return q;
if (t < 2 / 3)
return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
function hslaToRgba({ hue, saturation, lightness, alpha }) {
hue /= 360;
saturation /= 100;
lightness /= 100;
let red = 0;
let green = 0;
let blue = 0;
if (!saturation) {
red = green = blue = lightness;
}
else {
const q = lightness < 0.5
? lightness * (1 + saturation)
: lightness + saturation - lightness * saturation;
const p = 2 * lightness - q;
red = hueToRgb(p, q, hue + 1 / 3);
green = hueToRgb(p, q, hue);
blue = hueToRgb(p, q, hue - 1 / 3);
}
return {
red: Math.round(red * 255),
green: Math.round(green * 255),
blue: Math.round(blue * 255),
alpha,
};
}
export { hslaToRgba };
//# sourceMappingURL=hsla-to-rgba.mjs.map
@@ -0,0 +1,74 @@
{
"name": "esbuild",
"version": "0.28.1",
"description": "An extremely fast JavaScript and CSS bundler and minifier.",
"repository": {
"type": "git",
"url": "git+https://github.com/evanw/esbuild.git"
},
"scripts": {
"postinstall": "node install.js"
},
"main": "lib/main.js",
"types": "lib/main.d.ts",
"engines": {
"node": ">=18"
},
"bin": {
"esbuild": "bin/esbuild"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.28.1",
"@esbuild/android-arm": "0.28.1",
"@esbuild/android-arm64": "0.28.1",
"@esbuild/android-x64": "0.28.1",
"@esbuild/darwin-arm64": "0.28.1",
"@esbuild/darwin-x64": "0.28.1",
"@esbuild/freebsd-arm64": "0.28.1",
"@esbuild/freebsd-x64": "0.28.1",
"@esbuild/linux-arm": "0.28.1",
"@esbuild/linux-arm64": "0.28.1",
"@esbuild/linux-ia32": "0.28.1",
"@esbuild/linux-loong64": "0.28.1",
"@esbuild/linux-mips64el": "0.28.1",
"@esbuild/linux-ppc64": "0.28.1",
"@esbuild/linux-riscv64": "0.28.1",
"@esbuild/linux-s390x": "0.28.1",
"@esbuild/linux-x64": "0.28.1",
"@esbuild/netbsd-arm64": "0.28.1",
"@esbuild/netbsd-x64": "0.28.1",
"@esbuild/openbsd-arm64": "0.28.1",
"@esbuild/openbsd-x64": "0.28.1",
"@esbuild/openharmony-arm64": "0.28.1",
"@esbuild/sunos-x64": "0.28.1",
"@esbuild/win32-arm64": "0.28.1",
"@esbuild/win32-ia32": "0.28.1",
"@esbuild/win32-x64": "0.28.1"
},
"license": "MIT",
"esbuild.binaryHashes": {
"@esbuild/aix-ppc64/bin/esbuild": "0dd860154344f94b7a9367e64ffc2bc5b89a4313b4a399e5127cdc4ff5000303",
"@esbuild/android-arm64/bin/esbuild": "087671da02d323e7915fafc13567c0929192633ed544bd8adee9bc020fddf5b4",
"@esbuild/darwin-arm64/bin/esbuild": "e2dc9a52440a2a34f09434a2f4843cb1e30f84e40dcf238976ec61ef8cd7f36a",
"@esbuild/darwin-x64/bin/esbuild": "dd53ccf32f9b5b3ab30d41388ef1fc8f81c44ca57ee7a32a7364a1753308d009",
"@esbuild/freebsd-arm64/bin/esbuild": "5fef5a5ef24d9660d7711b756be5ddeba1fb3ca8dd62d703682ebb9fab3b68b0",
"@esbuild/freebsd-x64/bin/esbuild": "4427a8cbfa0661943ccfef2606a65b35f3411ac73e447e86f7732aace61e4609",
"@esbuild/linux-arm/bin/esbuild": "a2d93f7a8b1c9f91d47beec987888b4765c890501b6274f4bdff4061a5e0d9fd",
"@esbuild/linux-arm64/bin/esbuild": "51e829ba36f36be6d9aea6e329ddc4f9350302339b16aaca96a3cb97f64a8ebb",
"@esbuild/linux-ia32/bin/esbuild": "9cd7515a75d6f96b0aa055861cf987498315428088cd6d18de5082f904ae5794",
"@esbuild/linux-loong64/bin/esbuild": "73fa76af9b13f7a27fdb20673b8c2af927fe1511d14e51edeb4b7b71f7f03d0e",
"@esbuild/linux-mips64el/bin/esbuild": "d734787abc3c99d95242805047fe32da85a5822f04bf33d766a966bf5fd85488",
"@esbuild/linux-ppc64/bin/esbuild": "90709144617c2adf8f6c14937f03b114c259de0b9309666e3a9d89a1fb266d04",
"@esbuild/linux-riscv64/bin/esbuild": "86df35a46bedde8b756edb6565a1df7b5a832ad74dd0e179608cbf6509a2582a",
"@esbuild/linux-s390x/bin/esbuild": "f8cad0db35132e5ac3065c4345c36e7ffe18fdc98417a61bcf5a95a6c694e57c",
"@esbuild/linux-x64/bin/esbuild": "0c6588b092a2c291a72bab90659f3c9e0e25e0fe59c9ac12b4dae4d945e5548c",
"@esbuild/netbsd-arm64/bin/esbuild": "490cfdac2d96d5608d91cf55bdf4052bbde7013dafe87ec7adc7784778ad4d4c",
"@esbuild/netbsd-x64/bin/esbuild": "c61e0e4c553a4986fd0e9d63a0425e93be831ff7b13bfb8a564368fb7590f85d",
"@esbuild/openbsd-arm64/bin/esbuild": "f9d814698e26c09c3f90d4c103cbdf3832c9f2c841d64a93889d63d23da9b8cf",
"@esbuild/openbsd-x64/bin/esbuild": "2e30dce11f7236aa362c1c57212cc696f51472169aa417f30e9b641f3b7dcade",
"@esbuild/sunos-x64/bin/esbuild": "770e0d2bc930b1a1d19d3f43243ff8f393efddb599e7f5843160feacd253267d",
"@esbuild/win32-arm64/esbuild.exe": "bfb8798ab678f1ce4a723739f4a3eabab3244d7a04eeb12be2eb9f58095c13ef",
"@esbuild/win32-ia32/esbuild.exe": "8fa99b6e0945830fce8d7e208fdb21763aa4aea875751f4a0eec7f6e262af1dd",
"@esbuild/win32-x64/esbuild.exe": "ec02ee9b14ab332416fedd10614dfb80eed5304d94f67745067c011934a8c3c3"
}
}
@@ -0,0 +1,43 @@
export var ContextualKeyword; (function (ContextualKeyword) {
const NONE = 0; ContextualKeyword[ContextualKeyword["NONE"] = NONE] = "NONE";
const _abstract = NONE + 1; ContextualKeyword[ContextualKeyword["_abstract"] = _abstract] = "_abstract";
const _accessor = _abstract + 1; ContextualKeyword[ContextualKeyword["_accessor"] = _accessor] = "_accessor";
const _as = _accessor + 1; ContextualKeyword[ContextualKeyword["_as"] = _as] = "_as";
const _assert = _as + 1; ContextualKeyword[ContextualKeyword["_assert"] = _assert] = "_assert";
const _asserts = _assert + 1; ContextualKeyword[ContextualKeyword["_asserts"] = _asserts] = "_asserts";
const _async = _asserts + 1; ContextualKeyword[ContextualKeyword["_async"] = _async] = "_async";
const _await = _async + 1; ContextualKeyword[ContextualKeyword["_await"] = _await] = "_await";
const _checks = _await + 1; ContextualKeyword[ContextualKeyword["_checks"] = _checks] = "_checks";
const _constructor = _checks + 1; ContextualKeyword[ContextualKeyword["_constructor"] = _constructor] = "_constructor";
const _declare = _constructor + 1; ContextualKeyword[ContextualKeyword["_declare"] = _declare] = "_declare";
const _enum = _declare + 1; ContextualKeyword[ContextualKeyword["_enum"] = _enum] = "_enum";
const _exports = _enum + 1; ContextualKeyword[ContextualKeyword["_exports"] = _exports] = "_exports";
const _from = _exports + 1; ContextualKeyword[ContextualKeyword["_from"] = _from] = "_from";
const _get = _from + 1; ContextualKeyword[ContextualKeyword["_get"] = _get] = "_get";
const _global = _get + 1; ContextualKeyword[ContextualKeyword["_global"] = _global] = "_global";
const _implements = _global + 1; ContextualKeyword[ContextualKeyword["_implements"] = _implements] = "_implements";
const _infer = _implements + 1; ContextualKeyword[ContextualKeyword["_infer"] = _infer] = "_infer";
const _interface = _infer + 1; ContextualKeyword[ContextualKeyword["_interface"] = _interface] = "_interface";
const _is = _interface + 1; ContextualKeyword[ContextualKeyword["_is"] = _is] = "_is";
const _keyof = _is + 1; ContextualKeyword[ContextualKeyword["_keyof"] = _keyof] = "_keyof";
const _mixins = _keyof + 1; ContextualKeyword[ContextualKeyword["_mixins"] = _mixins] = "_mixins";
const _module = _mixins + 1; ContextualKeyword[ContextualKeyword["_module"] = _module] = "_module";
const _namespace = _module + 1; ContextualKeyword[ContextualKeyword["_namespace"] = _namespace] = "_namespace";
const _of = _namespace + 1; ContextualKeyword[ContextualKeyword["_of"] = _of] = "_of";
const _opaque = _of + 1; ContextualKeyword[ContextualKeyword["_opaque"] = _opaque] = "_opaque";
const _out = _opaque + 1; ContextualKeyword[ContextualKeyword["_out"] = _out] = "_out";
const _override = _out + 1; ContextualKeyword[ContextualKeyword["_override"] = _override] = "_override";
const _private = _override + 1; ContextualKeyword[ContextualKeyword["_private"] = _private] = "_private";
const _protected = _private + 1; ContextualKeyword[ContextualKeyword["_protected"] = _protected] = "_protected";
const _proto = _protected + 1; ContextualKeyword[ContextualKeyword["_proto"] = _proto] = "_proto";
const _public = _proto + 1; ContextualKeyword[ContextualKeyword["_public"] = _public] = "_public";
const _readonly = _public + 1; ContextualKeyword[ContextualKeyword["_readonly"] = _readonly] = "_readonly";
const _require = _readonly + 1; ContextualKeyword[ContextualKeyword["_require"] = _require] = "_require";
const _satisfies = _require + 1; ContextualKeyword[ContextualKeyword["_satisfies"] = _satisfies] = "_satisfies";
const _set = _satisfies + 1; ContextualKeyword[ContextualKeyword["_set"] = _set] = "_set";
const _static = _set + 1; ContextualKeyword[ContextualKeyword["_static"] = _static] = "_static";
const _symbol = _static + 1; ContextualKeyword[ContextualKeyword["_symbol"] = _symbol] = "_symbol";
const _type = _symbol + 1; ContextualKeyword[ContextualKeyword["_type"] = _type] = "_type";
const _unique = _type + 1; ContextualKeyword[ContextualKeyword["_unique"] = _unique] = "_unique";
const _using = _unique + 1; ContextualKeyword[ContextualKeyword["_using"] = _using] = "_using";
})(ContextualKeyword || (ContextualKeyword = {}));
@@ -0,0 +1 @@
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,cAAc,CA4DpH"}
@@ -0,0 +1,2 @@
export { getKeys } from './get-keys';
export { visitorKeys, type VisitorKeys } from './visitor-keys';
@@ -0,0 +1,133 @@
import { decodeBase64 } from "../encode.js";
import { getRuntimeKey } from "../../helper/adapter/index.js";
import { JwtAlgorithmNotImplemented } from "./types.js";
import { utf8Encoder } from "./utf8.js";
//#region src/utils/jwt/jws.ts
/**
* @module
* JSON Web Signature (JWS)
* https://datatracker.ietf.org/doc/html/rfc7515
*/
async function signing(privateKey, alg, data) {
const algorithm = getKeyAlgorithm(alg);
const cryptoKey = await importPrivateKey(privateKey, algorithm);
return await crypto.subtle.sign(algorithm, cryptoKey, data);
}
async function verifying(publicKey, alg, signature, data) {
const algorithm = getKeyAlgorithm(alg);
const cryptoKey = await importPublicKey(publicKey, algorithm);
return await crypto.subtle.verify(algorithm, cryptoKey, signature, data);
}
function pemToBinary(pem) {
return decodeBase64(pem.replace(/-+(BEGIN|END).*?-+/g, "").replace(/\s/g, ""));
}
async function importPrivateKey(key, alg) {
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");
if (isCryptoKey(key)) {
if (key.type !== "private" && key.type !== "secret") throw new Error(`unexpected key type: CryptoKey.type is ${key.type}, expected private or secret`);
return key;
}
const usages = ["sign"];
if (typeof key === "object") return await crypto.subtle.importKey("jwk", key, alg, false, usages);
if (key.includes("PRIVATE")) return await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, false, usages);
return await crypto.subtle.importKey("raw", utf8Encoder.encode(key), alg, false, usages);
}
async function importPublicKey(key, alg) {
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");
if (isCryptoKey(key)) {
if (key.type === "public" || key.type === "secret") return key;
key = await exportPublicJwkFrom(key);
}
if (typeof key === "string" && key.includes("PRIVATE")) key = await exportPublicJwkFrom(await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, true, ["sign"]));
const usages = ["verify"];
if (typeof key === "object") return await crypto.subtle.importKey("jwk", key, alg, false, usages);
if (key.includes("PUBLIC")) return await crypto.subtle.importKey("spki", pemToBinary(key), alg, false, usages);
return await crypto.subtle.importKey("raw", utf8Encoder.encode(key), alg, false, usages);
}
async function exportPublicJwkFrom(privateKey) {
if (privateKey.type !== "private") throw new Error(`unexpected key type: ${privateKey.type}`);
if (!privateKey.extractable) throw new Error("unexpected private key is unextractable");
const jwk = await crypto.subtle.exportKey("jwk", privateKey);
const { kty } = jwk;
const { alg, e, n } = jwk;
const { crv, x, y } = jwk;
return {
kty,
alg,
e,
n,
crv,
x,
y,
key_ops: ["verify"]
};
}
function getKeyAlgorithm(name) {
switch (name) {
case "HS256": return {
name: "HMAC",
hash: { name: "SHA-256" }
};
case "HS384": return {
name: "HMAC",
hash: { name: "SHA-384" }
};
case "HS512": return {
name: "HMAC",
hash: { name: "SHA-512" }
};
case "RS256": return {
name: "RSASSA-PKCS1-v1_5",
hash: { name: "SHA-256" }
};
case "RS384": return {
name: "RSASSA-PKCS1-v1_5",
hash: { name: "SHA-384" }
};
case "RS512": return {
name: "RSASSA-PKCS1-v1_5",
hash: { name: "SHA-512" }
};
case "PS256": return {
name: "RSA-PSS",
hash: { name: "SHA-256" },
saltLength: 32
};
case "PS384": return {
name: "RSA-PSS",
hash: { name: "SHA-384" },
saltLength: 48
};
case "PS512": return {
name: "RSA-PSS",
hash: { name: "SHA-512" },
saltLength: 64
};
case "ES256": return {
name: "ECDSA",
hash: { name: "SHA-256" },
namedCurve: "P-256"
};
case "ES384": return {
name: "ECDSA",
hash: { name: "SHA-384" },
namedCurve: "P-384"
};
case "ES512": return {
name: "ECDSA",
hash: { name: "SHA-512" },
namedCurve: "P-521"
};
case "EdDSA": return {
name: "Ed25519",
namedCurve: "Ed25519"
};
default: throw new JwtAlgorithmNotImplemented(name);
}
}
function isCryptoKey(key) {
if (getRuntimeKey() === "node" && !!crypto.webcrypto) return key instanceof crypto.webcrypto.CryptoKey;
return key instanceof CryptoKey;
}
//#endregion
export { signing, verifying };
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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,5 @@
/**
* Render body script tags collected from route matches and SSR manifests.
* Should be placed near the end of the document body.
*/
export declare const Scripts: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_5O","2":"_I","194":"_mG","260":"_UM _dI _xH"},C:{"2":"_S"},D:{"1":"_9K _l","2":"_9H","194":"_ZL","260":"_UM _dI _xH"},E:{"2":"_R"},F:{"1":"_jO","2":"_1F","194":"_xJ","260":"_GS _MB"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:7,C:"File System Access API",D:true};
@@ -0,0 +1,73 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
{{## def.validateIfClause:_clause:
{{
$it.schema = it.schema['_clause'];
$it.schemaPath = it.schemaPath + '._clause';
$it.errSchemaPath = it.errSchemaPath + '/_clause';
}}
{{# def.insertSubschemaCode }}
{{=$valid}} = {{=$nextValid}};
{{? $thenPresent && $elsePresent }}
{{ $ifClause = 'ifClause' + $lvl; }}
var {{=$ifClause}} = '_clause';
{{??}}
{{ $ifClause = '\'_clause\''; }}
{{?}}
#}}
{{
var $thenSch = it.schema['then']
, $elseSch = it.schema['else']
, $thenPresent = $thenSch !== undefined && {{# def.nonEmptySchema:$thenSch }}
, $elsePresent = $elseSch !== undefined && {{# def.nonEmptySchema:$elseSch }}
, $currentBaseId = $it.baseId;
}}
{{? $thenPresent || $elsePresent }}
{{
var $ifClause;
$it.createErrors = false;
$it.schema = $schema;
$it.schemaPath = $schemaPath;
$it.errSchemaPath = $errSchemaPath;
}}
var {{=$errs}} = errors;
var {{=$valid}} = true;
{{# def.setCompositeRule }}
{{# def.insertSubschemaCode }}
{{ $it.createErrors = true; }}
{{# def.resetErrors }}
{{# def.resetCompositeRule }}
{{? $thenPresent }}
if ({{=$nextValid}}) {
{{# def.validateIfClause:then }}
}
{{? $elsePresent }}
else {
{{?}}
{{??}}
if (!{{=$nextValid}}) {
{{?}}
{{? $elsePresent }}
{{# def.validateIfClause:else }}
}
{{?}}
if (!{{=$valid}}) {
{{# def.extraError:'if' }}
}
{{? $breakOnError }} else { {{?}}
{{??}}
{{? $breakOnError }}
if (true) {
{{?}}
{{?}}
@@ -0,0 +1,115 @@
import { c as McpServerFactory, pt as Transport, yr as JSONRPCMessage } from "./createMcpHandler-D4NN8WsG.mjs";
import { Readable, Writable } from "node:stream";
//#region src/server/serveStdio.d.ts
/** Options for {@linkcode serveStdio}. */
interface ServeStdioOptions {
/**
* How a 2025-era opening (an `initialize` request, or any claim-less
* message) is handled:
*
* - `'serve'` (default) — the connection is pinned to a 2025-era instance
* from the same factory and served exactly as a hand-wired stdio server
* serves it today.
* - `'reject'` — the opening request is answered with the
* unsupported-protocol-version error naming the supported modern
* revisions (claim-less notifications are dropped); the connection
* stays open for a modern opening.
*/
legacy?: 'serve' | 'reject';
/**
* Bring your own transport (for example a `StdioServerTransport`
* constructed over a Unix domain socket or TCP stream, per the stdio
* binding's custom-transport guidance). Defaults to a
* {@linkcode StdioServerTransport} over the current process's stdio. The
* entry owns the transport: it starts it, receives every inbound message,
* and closes it when the connection ends.
*/
transport?: Transport;
/** Callback for out-of-band errors (reporting only; it never alters what is written to the wire). */
onerror?: (error: Error) => void;
/**
* Reject a new `subscriptions/listen` with `-32603` 'Subscription limit
* reached' (in-band, before the ack) when this many subscriptions are
* already open on this connection.
* @default 1024
*/
maxSubscriptions?: number;
}
/** The handle returned by {@linkcode serveStdio}. */
interface StdioServerHandle {
/** Tears the connection down: closes the pinned instance (if any) and the underlying transport. */
close(): Promise<void>;
}
/**
* Serves MCP over stdio from a server factory, owning the era decision for
* the connection: the opening exchange selects the era, ONE instance from the
* factory is pinned for the connection lifetime, and everything after passes
* straight through to it. See the module documentation for the opening rules.
*
* ```ts
* import { serveStdio } from '@modelcontextprotocol/server/stdio';
*
* serveStdio(() => {
* const server = new McpServer({ name: 'my-server', version: '1.0.0' }, { capabilities: { tools: {} } });
* // register tools/resources/prompts once — the same factory serves both eras
* return server;
* });
* ```
*/
declare function serveStdio(factory: McpServerFactory, options?: ServeStdioOptions): StdioServerHandle;
//#endregion
//#region src/server/stdio.d.ts
/**
* Server transport for stdio: this communicates with an MCP client by reading from the current process' `stdin` and writing to `stdout`.
*
* This transport is only available in Node.js environments.
*
* When the client closes its end of the pipe (stdin reaches end-of-file), the transport
* closes itself and fires `onclose`, per the MCP stdio binding's guidance that servers
* should exit promptly when their standard input is closed. A server that holds no other
* keep-alive handles will then exit naturally. Requests still in flight when stdin ends are
* aborted and not answered; a client that expects responses keeps stdin open until it has
* read them.
*
* @example
* ```ts source="./stdio.examples.ts#StdioServerTransport_basicUsage"
* const server = new McpServer({ name: 'my-server', version: '1.0.0' });
* const transport = new StdioServerTransport();
* await server.connect(transport);
* ```
*/
declare class StdioServerTransport implements Transport {
private _stdin;
private _stdout;
private _readBuffer;
private _started;
private _closed;
constructor(_stdin?: Readable, _stdout?: Writable, options?: {
/**
* Maximum size of the read buffer in bytes. If a single message exceeds
* this size the transport will emit an error and close.
*
* Defaults to 10 MB.
*/
maxBufferSize?: number;
});
onclose?: () => void;
onerror?: (error: Error) => void;
onmessage?: (message: JSONRPCMessage) => void;
_ondata: (chunk: Buffer) => void;
_onerror: (error: Error) => void;
_onstdouterror: (error: Error) => void;
_onstdinclose: () => void;
/**
* Starts listening for messages on `stdin`.
*/
start(): Promise<void>;
private processReadBuffer;
close(): Promise<void>;
send(message: JSONRPCMessage): Promise<void>;
}
//#endregion
export { type ServeStdioOptions, type StdioServerHandle, StdioServerTransport, serveStdio };
//# sourceMappingURL=stdio.d.mts.map
@@ -0,0 +1,98 @@
import { AnyRouter, Constrain, LinkOptions, RegisteredRouter, RoutePaths } from '@tanstack/router-core';
import { ReactNode } from 'react';
import { ValidateLinkOptions, ValidateLinkOptionsArray } from './typePrimitives.cjs';
import * as React from 'react';
/**
* Build anchor-like props for declarative navigation and preloading.
*
* Returns stable `href`, event handlers and accessibility props derived from
* router options and active state. Used internally by `Link` and custom links.
*
* Options cover `to`, `params`, `search`, `hash`, `state`, `preload`,
* `activeProps`, `inactiveProps`, and more.
*
* @returns React anchor props suitable for `<a>` or custom components.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook
*/
export declare function useLinkProps<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>, forwardedRef?: React.ForwardedRef<Element>): React.ComponentPropsWithRef<'a'>;
type UseLinkReactProps<TComp> = TComp extends keyof React.JSX.IntrinsicElements ? React.JSX.IntrinsicElements[TComp] : TComp extends React.ComponentType<any> ? React.ComponentPropsWithoutRef<TComp> & React.RefAttributes<React.ComponentRef<TComp>> : never;
export type UseLinkPropsOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string | undefined = '.', TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = '.'> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & UseLinkReactProps<'a'>;
export type ActiveLinkOptions<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & ActiveLinkOptionProps<TComp>;
type ActiveLinkProps<TComp> = Partial<LinkComponentReactProps<TComp> & {
[key: `data-${string}`]: unknown;
}>;
export interface ActiveLinkOptionProps<TComp = 'a'> {
/**
* A function that returns additional props for the `active` state of this link.
* These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)
*/
activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>);
/**
* A function that returns additional props for the `inactive` state of this link.
* These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)
*/
inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>);
}
export type LinkProps<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & LinkPropsChildren;
export interface LinkPropsChildren {
children?: React.ReactNode | ((state: {
isActive: boolean;
isTransitioning: boolean;
}) => React.ReactNode);
}
type LinkComponentReactProps<TComp> = Omit<UseLinkReactProps<TComp>, keyof CreateLinkProps>;
export type LinkComponentProps<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkComponentReactProps<TComp> & LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
export type CreateLinkProps = LinkProps<any, any, string, string, string, string>;
export type LinkComponent<in out TComp, in out TDefaultFrom extends string = string> = <TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = TDefaultFrom, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => React.ReactElement;
export interface LinkComponentRoute<in out TDefaultFrom extends string = string> {
defaultFrom: TDefaultFrom;
<TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, const TMaskTo extends string = ''>(props: LinkComponentProps<'a', TRouter, this['defaultFrom'], TTo, this['defaultFrom'], TMaskTo>): React.ReactElement;
}
/**
* Creates a typed Link-like component that preserves TanStack Router's
* navigation semantics and type-safety while delegating rendering to the
* provided host component.
*
* Useful for integrating design system anchors/buttons while keeping
* router-aware props (eg. `to`, `params`, `search`, `preload`).
*
* @param Comp The host component to render (eg. a design-system Link/Button)
* @returns A router-aware component with the same API as `Link`.
* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link
*/
export declare function createLink<const TComp>(Comp: Constrain<TComp, any, (props: CreateLinkProps) => ReactNode>): LinkComponent<TComp>;
/**
* A strongly-typed anchor component for declarative navigation.
* Handles path, search, hash and state updates with optional route preloading
* and active-state styling.
*
* Props:
* - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)
* - `preloadDelay`: Delay in ms before preloading on hover
* - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive
* - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation
* - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation
* - `ignoreBlocker`: Bypass registered blockers
*
* @returns An anchor-like element that navigates without full page reloads.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent
*/
export declare const Link: LinkComponent<'a'>;
export type LinkOptionsFnOptions<TOptions, TComp, TRouter extends AnyRouter = RegisteredRouter> = TOptions extends ReadonlyArray<any> ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp> : ValidateLinkOptions<TRouter, TOptions, string, TComp>;
export type LinkOptionsFn<TComp> = <const TOptions, TRouter extends AnyRouter = RegisteredRouter>(options: LinkOptionsFnOptions<TOptions, TComp, TRouter>) => TOptions;
/**
* Validate and reuse navigation options for `Link`, `navigate` or `redirect`.
* Accepts a literal options object and returns it typed for later spreading.
* @example
* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions
*/
export declare const linkOptions: LinkOptionsFn<'a'>;
export {};
/**
* Type-check a literal object for use with `Link`, `navigate` or `redirect`.
* Use to validate and reuse navigation options across your app.
* @example
* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions
*/
@@ -0,0 +1,47 @@
"use client";
import { routerContext } from "./routerContext.js";
import { Matches } from "./Matches.js";
import { hasKeys } from "@tanstack/router-core";
import "react";
import { jsx } from "react/jsx-runtime";
//#region src/RouterProvider.tsx
/**
* Low-level provider that places the router into React context and optionally
* updates router options from props. Most apps should use `RouterProvider`.
*/
function RouterContextProvider({ router, children, ...rest }) {
if (hasKeys(rest)) router.update({
...router.options,
...rest,
context: {
...router.options.context,
...rest.context
}
});
const provider = /* @__PURE__ */ jsx(routerContext.Provider, {
value: router,
children
});
if (router.options.Wrap) return /* @__PURE__ */ jsx(router.options.Wrap, { children: provider });
return provider;
}
/**
* Top-level component that renders the active route matches and provides the
* router to the React tree via context.
*
* Accepts the same options as `createRouter` via props to update the router
* instance after creation.
*
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
*/
function RouterProvider({ router, ...rest }) {
return /* @__PURE__ */ jsx(RouterContextProvider, {
router,
...rest,
children: /* @__PURE__ */ jsx(Matches, {})
});
}
//#endregion
export { RouterContextProvider, RouterProvider };
//# sourceMappingURL=RouterProvider.js.map
@@ -0,0 +1 @@
module.exports={C:{"52":0.00506,"53":0.00506,"55":0.00506,"57":0.00506,"59":0.00506,"63":0.00506,"66":0.00506,"67":0.00506,"115":0.07087,"120":1.60972,"121":3.12325,"123":0.01012,"124":0.02531,"125":0.01012,"129":0.00506,"132":0.00506,"135":0.10124,"136":0.00506,"137":0.00506,"140":0.05568,"142":0.00506,"147":0.00506,"149":0.00506,"150":0.03037,"152":0.0405,"153":0.03037,"154":0.1063,"155":0.31384,"156":0.25816,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 54 56 58 60 61 62 64 65 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 128 130 131 133 134 138 139 141 143 144 145 146 148 151 157 158 159 160 3.5 3.6"},D:{"50":0.00506,"53":0.00506,"54":0.00506,"55":0.00506,"56":0.00506,"60":0.00506,"61":0.00506,"62":0.01519,"63":0.00506,"64":0.01012,"65":0.00506,"66":0.01012,"67":0.00506,"68":0.01012,"69":0.01012,"70":0.01012,"71":0.00506,"72":0.00506,"73":0.01012,"74":0.00506,"75":0.01012,"76":0.00506,"77":0.00506,"79":0.01519,"81":0.01519,"83":0.01012,"86":0.0405,"87":0.01519,"93":0.00506,"95":0.01012,"98":0.05062,"101":0.03543,"103":0.48595,"104":0.46064,"105":0.47077,"106":0.46064,"107":0.4657,"108":0.44546,"109":0.64794,"110":0.46064,"111":0.46064,"112":0.46064,"113":0.01519,"114":0.05062,"116":0.95166,"117":0.4657,"118":2.34371,"119":3.184,"120":3.71045,"121":0.01012,"122":0.02025,"123":0.01012,"124":0.4657,"125":0.00506,"126":0.01519,"127":0.00506,"128":0.01519,"130":0.00506,"131":0.93141,"132":0.00506,"133":1.06302,"134":0.18729,"135":0.20754,"136":0.17717,"137":0.2126,"138":0.34928,"139":0.20248,"140":0.21767,"141":0.19742,"142":0.63781,"143":0.04556,"144":0.01519,"145":0.10124,"146":0.65806,"147":0.03037,"148":0.16705,"149":0.70362,"150":0.43027,"151":1.35155,"152":4.71778,"153":2.86003,"154":0.77955,"155":0.03543,"156":0.01519,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 51 52 57 58 59 78 80 84 85 88 89 90 91 92 94 96 97 99 100 102 115 129 157"},F:{"32":0.00506,"40":0.00506,"46":0.01012,"50":0.00506,"51":0.00506,"52":0.00506,"53":0.01012,"54":0.01012,"55":0.01012,"56":0.01519,"57":0.00506,"58":0.00506,"72":0.00506,"87":0.00506,"89":0.00506,"91":0.00506,"95":0.00506,"100":0.00506,"101":0.00506,"105":0.01012,"106":0.01519,"107":0.01012,"113":0.00506,"114":0.00506,"116":0.00506,"119":0.00506,"120":0.00506,"121":0.00506,"133":0.01012,"134":0.09618,"135":0.5062,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 34 35 36 37 38 39 41 42 43 44 45 47 48 49 60 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 90 92 93 94 96 97 98 99 102 103 104 108 109 110 111 112 115 117 118 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.00506,"18":0.00506,"89":0.00506,"92":0.01519,"100":0.00506,"109":0.00506,"119":1.57934,"120":1.6249,"122":0.01519,"123":0.00506,"124":0.00506,"133":0.00506,"138":0.00506,"139":0.00506,"140":0.00506,"145":0.00506,"146":0.00506,"147":0.01012,"148":0.01012,"149":0.00506,"150":0.04556,"151":0.13667,"152":1.878,"153":1.02252,"154":0.24298,_:"12 13 14 15 16 79 80 81 83 84 85 86 87 88 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 125 126 127 128 129 130 131 132 134 135 136 137 141 142 143 144"},E:{"11":0.00506,"27":0.05062,_:"4 5 6 7 8 9 10 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 18.4 26.0 27.1 27.2 TP","11.1":0.00506,"13.1":0.00506,"14.1":0.00506,"15.6":0.05568,"16.6":0.02025,"17.1":0.01012,"17.2":0.00506,"17.3":0.00506,"17.4":0.01012,"17.5":0.00506,"17.6":0.03543,"18.0":0.01012,"18.1":0.00506,"18.2":0.18729,"18.3":0.01012,"18.5-18.7":0.00506,"26.1":0.00506,"26.2":0.03037,"26.3":0.01519,"26.4":0.01012,"26.5":0.03543,"26.6":0.19742},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00095,"5.0-5.1":0.00095,"6.0-6.1":0,"7.0-7.1":0.0019,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00951,"11.0-11.2":0.00095,"11.3-11.4":0.0019,"12.0-12.1":0,"12.2-12.5":0.02473,"13.0-13.1":0,"13.2":0.00476,"13.3":0,"13.4-13.7":0.00095,"14.0-14.4":0.0038,"14.5-14.8":0.00571,"15.0-15.1":0.00571,"15.2-15.3":0.0038,"15.4":0.00476,"15.5":0.00571,"15.6-15.8":0.12364,"16.0":0.00951,"16.1":0.01712,"16.2":0.00951,"16.3":0.02092,"16.4":0.00476,"16.5":0.00761,"16.6-16.7":0.17214,"17.0":0.00666,"17.1":0.00951,"17.2":0.00951,"17.3":0.01427,"17.4":0.01997,"17.5":0.03899,"17.6-17.7":0.10081,"18.0":0.02092,"18.1":0.04185,"18.2":0.05706,"18.3":0.09891,"18.4":0.06182,"18.5-18.7":1.27727,"26.0":0.06182,"26.1":0.06277,"26.2":0.16358,"26.3":0.1769,"26.4":0.12934,"26.5":0.86641,"26.6":5.3459,"27.0":0.40991,"27.1":0,"27.2":0.01046},P:{"4":0.05515,"22":0.01838,"23":0.00919,"24":0.01838,"25":0.00919,"26":0.03676,"27":0.02757,"28":0.11Line truncated
@@ -0,0 +1,46 @@
/**
* @fileoverview Helpers for counting errors and warnings in lint messages.
* @author Nicholas C. Zakas
* @author Blake Sager
*/
"use strict";
/**
* It will calculate the error and warning count for collection of messages per file
* @param {LintMessage[]} messages Collection of messages
* @returns {Object} Contains the stats
*/
function calculateStatsPerFile(messages) {
const stat = {
errorCount: 0,
fatalErrorCount: 0,
warningCount: 0,
fixableErrorCount: 0,
fixableWarningCount: 0,
};
for (let i = 0; i < messages.length; i++) {
const message = messages[i];
if (message.fatal || message.severity === 2) {
stat.errorCount++;
if (message.fatal) {
stat.fatalErrorCount++;
}
if (message.fix) {
stat.fixableErrorCount++;
}
} else {
stat.warningCount++;
if (message.fix) {
stat.fixableWarningCount++;
}
}
}
return stat;
}
module.exports = {
calculateStatsPerFile,
};
@@ -0,0 +1,135 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_encode = require("../encode.js");
const require_helper_adapter_index = require("../../helper/adapter/index.js");
const require_utils_jwt_types = require("./types.js");
const require_utils_jwt_utf8 = require("./utf8.js");
//#region src/utils/jwt/jws.ts
/**
* @module
* JSON Web Signature (JWS)
* https://datatracker.ietf.org/doc/html/rfc7515
*/
async function signing(privateKey, alg, data) {
const algorithm = getKeyAlgorithm(alg);
const cryptoKey = await importPrivateKey(privateKey, algorithm);
return await crypto.subtle.sign(algorithm, cryptoKey, data);
}
async function verifying(publicKey, alg, signature, data) {
const algorithm = getKeyAlgorithm(alg);
const cryptoKey = await importPublicKey(publicKey, algorithm);
return await crypto.subtle.verify(algorithm, cryptoKey, signature, data);
}
function pemToBinary(pem) {
return require_utils_encode.decodeBase64(pem.replace(/-+(BEGIN|END).*?-+/g, "").replace(/\s/g, ""));
}
async function importPrivateKey(key, alg) {
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");
if (isCryptoKey(key)) {
if (key.type !== "private" && key.type !== "secret") throw new Error(`unexpected key type: CryptoKey.type is ${key.type}, expected private or secret`);
return key;
}
const usages = ["sign"];
if (typeof key === "object") return await crypto.subtle.importKey("jwk", key, alg, false, usages);
if (key.includes("PRIVATE")) return await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, false, usages);
return await crypto.subtle.importKey("raw", require_utils_jwt_utf8.utf8Encoder.encode(key), alg, false, usages);
}
async function importPublicKey(key, alg) {
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");
if (isCryptoKey(key)) {
if (key.type === "public" || key.type === "secret") return key;
key = await exportPublicJwkFrom(key);
}
if (typeof key === "string" && key.includes("PRIVATE")) key = await exportPublicJwkFrom(await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, true, ["sign"]));
const usages = ["verify"];
if (typeof key === "object") return await crypto.subtle.importKey("jwk", key, alg, false, usages);
if (key.includes("PUBLIC")) return await crypto.subtle.importKey("spki", pemToBinary(key), alg, false, usages);
return await crypto.subtle.importKey("raw", require_utils_jwt_utf8.utf8Encoder.encode(key), alg, false, usages);
}
async function exportPublicJwkFrom(privateKey) {
if (privateKey.type !== "private") throw new Error(`unexpected key type: ${privateKey.type}`);
if (!privateKey.extractable) throw new Error("unexpected private key is unextractable");
const jwk = await crypto.subtle.exportKey("jwk", privateKey);
const { kty } = jwk;
const { alg, e, n } = jwk;
const { crv, x, y } = jwk;
return {
kty,
alg,
e,
n,
crv,
x,
y,
key_ops: ["verify"]
};
}
function getKeyAlgorithm(name) {
switch (name) {
case "HS256": return {
name: "HMAC",
hash: { name: "SHA-256" }
};
case "HS384": return {
name: "HMAC",
hash: { name: "SHA-384" }
};
case "HS512": return {
name: "HMAC",
hash: { name: "SHA-512" }
};
case "RS256": return {
name: "RSASSA-PKCS1-v1_5",
hash: { name: "SHA-256" }
};
case "RS384": return {
name: "RSASSA-PKCS1-v1_5",
hash: { name: "SHA-384" }
};
case "RS512": return {
name: "RSASSA-PKCS1-v1_5",
hash: { name: "SHA-512" }
};
case "PS256": return {
name: "RSA-PSS",
hash: { name: "SHA-256" },
saltLength: 32
};
case "PS384": return {
name: "RSA-PSS",
hash: { name: "SHA-384" },
saltLength: 48
};
case "PS512": return {
name: "RSA-PSS",
hash: { name: "SHA-512" },
saltLength: 64
};
case "ES256": return {
name: "ECDSA",
hash: { name: "SHA-256" },
namedCurve: "P-256"
};
case "ES384": return {
name: "ECDSA",
hash: { name: "SHA-384" },
namedCurve: "P-384"
};
case "ES512": return {
name: "ECDSA",
hash: { name: "SHA-512" },
namedCurve: "P-521"
};
case "EdDSA": return {
name: "Ed25519",
namedCurve: "Ed25519"
};
default: throw new require_utils_jwt_types.JwtAlgorithmNotImplemented(name);
}
}
function isCryptoKey(key) {
if (require_helper_adapter_index.getRuntimeKey() === "node" && !!crypto.webcrypto) return key instanceof crypto.webcrypto.CryptoKey;
return key instanceof CryptoKey;
}
//#endregion
exports.signing = signing;
exports.verifying = verifying;
@@ -0,0 +1,358 @@
import { AlignedPlacement } from '@floating-ui/core';
import { Alignment } from '@floating-ui/core';
import type { ArrowOptions as ArrowOptions_2 } from '@floating-ui/core';
import type { AutoPlacementOptions as AutoPlacementOptions_2 } from '@floating-ui/core';
import { Axis } from '@floating-ui/core';
import { ClientRectObject } from '@floating-ui/core';
import type { ComputePositionConfig as ComputePositionConfig_2 } from '@floating-ui/core';
import { ComputePositionReturn } from '@floating-ui/core';
import { Coords } from '@floating-ui/core';
import type { detectOverflow as detectOverflow_2 } from '@floating-ui/core';
import type { DetectOverflowOptions as DetectOverflowOptions_2 } from '@floating-ui/core';
import { Dimensions } from '@floating-ui/core';
import { ElementContext } from '@floating-ui/core';
import { ElementRects } from '@floating-ui/core';
import type { FlipOptions as FlipOptions_2 } from '@floating-ui/core';
import { getOverflowAncestors } from '@floating-ui/utils/dom';
import type { HideOptions as HideOptions_2 } from '@floating-ui/core';
import { InlineOptions } from '@floating-ui/core';
import { Length } from '@floating-ui/core';
import { LimitShiftOptions } from '@floating-ui/core';
import type { Middleware as Middleware_2 } from '@floating-ui/core';
import { MiddlewareData } from '@floating-ui/core';
import { MiddlewareReturn } from '@floating-ui/core';
import type { MiddlewareState as MiddlewareState_2 } from '@floating-ui/core';
import { Padding } from '@floating-ui/core';
import { Placement } from '@floating-ui/core';
import { Rect } from '@floating-ui/core';
import { RootBoundary } from '@floating-ui/core';
import type { ShiftOptions as ShiftOptions_2 } from '@floating-ui/core';
import { Side } from '@floating-ui/core';
import { SideObject } from '@floating-ui/core';
import type { SizeOptions as SizeOptions_2 } from '@floating-ui/core';
import { Strategy } from '@floating-ui/core';
export { AlignedPlacement }
export { Alignment }
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* @see https://floating-ui.com/docs/arrow
*/
export declare const arrow: (options: ArrowOptions | Derivable<ArrowOptions>) => Middleware;
export declare type ArrowOptions = Prettify<Omit<ArrowOptions_2, 'element'> & {
element: Element;
}>;
/**
* Optimizes the visibility of the floating element by choosing the placement
* that has the most space available automatically, without needing to specify a
* preferred placement. Alternative to `flip`.
* @see https://floating-ui.com/docs/autoPlacement
*/
export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable<AutoPlacementOptions>) => Middleware;
export declare type AutoPlacementOptions = Prettify<Omit<AutoPlacementOptions_2, 'boundary'> & DetectOverflowOptions>;
/**
* Automatically updates the position of the floating element when necessary.
* Should only be called when the floating element is mounted on the DOM or
* visible on the screen.
* @returns cleanup function that should be invoked when the floating element is
* removed from the DOM or hidden from the screen.
* @see https://floating-ui.com/docs/autoUpdate
*/
export declare function autoUpdate(reference: ReferenceElement, floating: FloatingElement | null, update: () => void, options?: AutoUpdateOptions): () => void;
export declare interface AutoUpdateOptions {
/**
* Whether to update the position when an overflow ancestor is scrolled.
* @default true
*/
ancestorScroll?: boolean;
/**
* Whether to update the position when an overflow ancestor is resized. This
* uses the native `resize` event.
* @default true
*/
ancestorResize?: boolean;
/**
* Whether to update the position when either the reference or floating
* elements resized. This uses a `ResizeObserver`.
* @default true
*/
elementResize?: boolean;
/**
* Whether to update the position when the reference relocated on the screen
* due to layout shift.
* @default true
*/
layoutShift?: boolean;
/**
* Whether to update on every animation frame if necessary. Only use if you
* need to update the position in response to an animation using transforms.
* @default false
*/
animationFrame?: boolean;
}
export { Axis }
/**
* The clipping boundary area of the floating element.
*/
export declare type Boundary = 'clippingAncestors' | Element | Array<Element> | Rect;
export { ClientRectObject }
/**
* Computes the `x` and `y` coordinates that will place the floating element
* next to a given reference element.
*/
export declare const computePosition: (reference: ReferenceElement, floating: FloatingElement, options?: Partial<ComputePositionConfig>) => Promise<ComputePositionReturn>;
export declare type ComputePositionConfig = Prettify<Omit<ComputePositionConfig_2, 'middleware' | 'platform'> & {
/**
* Array of middleware objects to modify the positioning or provide data for
* rendering.
*/
middleware?: Array<Middleware | null | undefined | false>;
/**
* Custom or extended platform object.
*/
platform?: Platform;
}>;
export { ComputePositionReturn }
export { Coords }
export declare type Derivable<T> = (state: MiddlewareState) => T;
/**
* Resolves with an object of overflow side offsets that determine how much the
* element is overflowing a given clipping boundary on each side.
* - positive = overflowing the boundary by that number of pixels
* - negative = how many pixels left before it will overflow
* - 0 = lies flush with the boundary
* @see https://floating-ui.com/docs/detectOverflow
*/
export declare const detectOverflow: (state: MiddlewareState, options?: DetectOverflowOptions | Derivable<DetectOverflowOptions>) => Promise<SideObject>;
export declare type DetectOverflowOptions = Prettify<Omit<DetectOverflowOptions_2, 'boundary'> & {
boundary?: Boundary;
}>;
export { Dimensions }
export { ElementContext }
export { ElementRects }
export declare interface Elements {
reference: ReferenceElement;
floating: FloatingElement;
}
/**
* Optimizes the visibility of the floating element by flipping the `placement`
* in order to keep it in view when the preferred placement(s) will overflow the
* clipping boundary. Alternative to `autoPlacement`.
* @see https://floating-ui.com/docs/flip
*/
export declare const flip: (options?: FlipOptions | Derivable<FlipOptions>) => Middleware;
export declare type FlipOptions = Prettify<Omit<FlipOptions_2, 'boundary'> & DetectOverflowOptions>;
export declare type FloatingElement = HTMLElement;
export { getOverflowAncestors }
/**
* Provides data to hide the floating element in applicable situations, such as
* when it is not in the same clipping context as the reference element.
* @see https://floating-ui.com/docs/hide
*/
export declare const hide: (options?: HideOptions | Derivable<HideOptions>) => Middleware;
export declare type HideOptions = Prettify<Omit<HideOptions_2, 'boundary'> & DetectOverflowOptions>;
/**
* Provides improved positioning for inline reference elements that can span
* over multiple lines, such as hyperlinks or range selections.
* @see https://floating-ui.com/docs/inline
*/
export declare const inline: (options?: InlineOptions | Derivable<InlineOptions>) => Middleware;
export { InlineOptions }
export { Length }
/**
* Built-in `limiter` that will stop `shift()` at a certain point.
*/
export declare const limitShift: (options?: LimitShiftOptions | Derivable<LimitShiftOptions>) => {
options: any;
fn: (state: MiddlewareState) => Coords;
};
export { LimitShiftOptions }
export declare type Middleware = Prettify<Omit<Middleware_2, 'fn'> & {
fn(state: MiddlewareState): Promisable<MiddlewareReturn>;
}>;
/**
* @deprecated use `MiddlewareState` instead.
*/
export declare type MiddlewareArguments = MiddlewareState;
export { MiddlewareData }
export { MiddlewareReturn }
export declare type MiddlewareState = Prettify<Omit<MiddlewareState_2, 'elements'> & {
elements: Elements;
}>;
export declare interface NodeScroll {
scrollLeft: number;
scrollTop: number;
}
/**
* Modifies the placement by translating the floating element along the
* specified axes.
* A number (shorthand for `mainAxis` or distance), or an axes configuration
* object may be passed.
* @see https://floating-ui.com/docs/offset
*/
export declare const offset: (options?: OffsetOptions) => Middleware;
export declare type OffsetOptions = OffsetValue | Derivable<OffsetValue>;
declare type OffsetValue = number | {
/**
* The axis that runs along the side of the floating element. Represents
* the distance (gutter or margin) between the reference and floating
* element.
* @default 0
*/
mainAxis?: number;
/**
* The axis that runs along the alignment of the floating element.
* Represents the skidding between the reference and floating element.
* @default 0
*/
crossAxis?: number;
/**
* The same axis as `crossAxis` but applies only to aligned placements
* and inverts the `end` alignment. When set to a number, it overrides the
* `crossAxis` value.
*
* A positive number will move the floating element in the direction of
* the opposite edge to the one that is aligned, while a negative number
* the reverse.
* @default null
*/
alignmentAxis?: number | null;
};
export { Padding }
export { Placement }
export declare interface Platform {
getElementRects: (args: {
reference: ReferenceElement;
floating: FloatingElement;
strategy: Strategy;
}) => Promisable<ElementRects>;
getClippingRect: (args: {
element: Element;
boundary: Boundary;
rootBoundary: RootBoundary;
strategy: Strategy;
}) => Promisable<Rect>;
getDimensions: (element: Element) => Promisable<Dimensions>;
convertOffsetParentRelativeRectToViewportRelativeRect: (args: {
elements?: Elements;
rect: Rect;
offsetParent: Element;
strategy: Strategy;
}) => Promisable<Rect>;
getOffsetParent: (element: Element, polyfill?: (element: HTMLElement) => Element | null) => Promisable<Element | Window>;
isElement: (value: unknown) => Promisable<boolean>;
getDocumentElement: (element: Element) => Promisable<HTMLElement>;
getClientRects: (element: Element) => Promisable<Array<ClientRectObject>>;
isRTL: (element: Element) => Promisable<boolean>;
getScale: (element: HTMLElement) => Promisable<{
x: number;
y: number;
}>;
detectOverflow?: typeof detectOverflow_2;
}
export declare const platform: Platform;
declare type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
declare type Promisable<T> = T | Promise<T>;
export { Rect }
export declare type ReferenceElement = Element | VirtualElement;
export { RootBoundary }
/**
* Optimizes the visibility of the floating element by shifting it in order to
* keep it in view when it will overflow the clipping boundary.
* @see https://floating-ui.com/docs/shift
*/
export declare const shift: (options?: ShiftOptions | Derivable<ShiftOptions>) => Middleware;
export declare type ShiftOptions = Prettify<Omit<ShiftOptions_2, 'boundary'> & DetectOverflowOptions>;
export { Side }
export { SideObject }
/**
* Provides data that allows you to change the size of the floating element —
* for instance, prevent it from overflowing the clipping boundary or match the
* width of the reference element.
* @see https://floating-ui.com/docs/size
*/
export declare const size: (options?: SizeOptions | Derivable<SizeOptions>) => Middleware;
export declare type SizeOptions = Prettify<Omit<SizeOptions_2, 'apply' | 'boundary'> & DetectOverflowOptions & {
/**
* Function that is called to perform style mutations to the floating element
* to change its size.
* @default undefined
*/
apply?(args: MiddlewareState & {
availableWidth: number;
availableHeight: number;
}): Promisable<void>;
}>;
export { Strategy }
/**
* Custom positioning reference element.
* @see https://floating-ui.com/docs/virtual-elements
*/
export declare interface VirtualElement {
getBoundingClientRect(): ClientRectObject;
getClientRects?(): Array<ClientRectObject> | DOMRectList;
contextElement?: Element;
}
export { }
@@ -0,0 +1,36 @@
import { pathToFileURL } from 'node:url';
import { r as resolveModule } from './index.BCY_7LL2.js';
import { resolve } from 'pathe';
import { ModuleRunner } from 'vite/module-runner';
class NativeModuleRunner extends ModuleRunner {
/**
* @internal
*/
mocker;
constructor(root, mocker) {
super({
hmr: false,
sourcemapInterceptor: false,
transport: { invoke() {
throw new Error("Unexpected `invoke`");
} }
});
this.root = root;
this.mocker = mocker;
if (mocker) Object.defineProperty(globalThis, "__vitest_mocker__", {
configurable: true,
writable: true,
value: mocker
});
}
async import(moduleId) {
const path = resolveModule(moduleId, { paths: [this.root] }) ?? resolve(this.root, moduleId);
// resolveModule doesn't keep the query params, so we need to add them back
let queryParams = "";
if (moduleId.includes("?") && !path.includes("?")) queryParams = moduleId.slice(moduleId.indexOf("?"));
return import(pathToFileURL(path + queryParams).toString());
}
}
export { NativeModuleRunner as N };
@@ -0,0 +1,40 @@
import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types";
import type { SchemaCxt, SchemaObjCxt } from ".";
import { Code, Name, CodeGen } from "./codegen";
import type { Rule, ValidationRules } from "./rules";
export declare function toHash<T extends string = string>(arr: T[]): {
[K in T]?: true;
};
export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void;
export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void;
export declare function schemaHasRules(schema: AnySchema, rules: {
[Key in string]?: boolean | Rule;
}): boolean;
export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean;
export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean;
export declare function unescapeFragment(str: string): string;
export declare function escapeFragment(str: string | number): string;
export declare function escapeJsonPointer(str: string | number): string;
export declare function unescapeJsonPointer(str: string): string;
export declare function eachItem<T>(xs: T | T[], f: (x: T) => void): void;
type SomeEvaluated = EvaluatedProperties | EvaluatedItems;
type MergeEvaluatedFunc<T extends SomeEvaluated> = (gen: CodeGen, from: Name | T, to: Name | Exclude<T, true> | undefined, toName?: typeof Name) => Name | T;
interface MergeEvaluated {
props: MergeEvaluatedFunc<EvaluatedProperties>;
items: MergeEvaluatedFunc<EvaluatedItems>;
}
export declare const mergeEvaluated: MergeEvaluated;
export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name;
export declare function setEvaluated(gen: CodeGen, props: Name, ps: {
[K in string]?: true;
}): void;
export declare function useFunc(gen: CodeGen, f: {
code: string;
}): Name;
export declare enum Type {
Num = 0,
Str = 1
}
export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string;
export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void;
export {};
@@ -0,0 +1,171 @@
import * as z from 'zod/v4';
import express from 'express';
import { rateLimit } from 'express-rate-limit';
import { allowedMethods } from '../middleware/allowedMethods.js';
import { InvalidRequestError, InvalidClientError, ServerError, TooManyRequestsError, OAuthError } from '../errors.js';
const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]']);
/**
* Validates a requested redirect_uri against a registered one.
*
* Per RFC 8252 §7.3 (OAuth 2.0 for Native Apps), authorization servers MUST
* allow any port for loopback redirect URIs (localhost, 127.0.0.1, [::1]) to
* accommodate native clients that obtain an ephemeral port from the OS. For
* non-loopback URIs, exact match is required.
*
* @see https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
*/
export function redirectUriMatches(requested, registered) {
if (requested === registered) {
return true;
}
let req, reg;
try {
req = new URL(requested);
reg = new URL(registered);
}
catch {
return false;
}
// Port relaxation only applies when both URIs target a loopback host.
if (!LOOPBACK_HOSTS.has(req.hostname) || !LOOPBACK_HOSTS.has(reg.hostname)) {
return false;
}
// RFC 8252 relaxes the port only — scheme, host, path, and query must
// still match exactly. Note: hostname must match exactly too (the RFC
// does not allow localhost↔127.0.0.1 cross-matching).
return req.protocol === reg.protocol && req.hostname === reg.hostname && req.pathname === reg.pathname && req.search === reg.search;
}
// Parameters that must be validated in order to issue redirects.
const ClientAuthorizationParamsSchema = z.object({
client_id: z.string(),
redirect_uri: z
.string()
.optional()
.refine(value => value === undefined || URL.canParse(value), { message: 'redirect_uri must be a valid URL' })
});
// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI.
const RequestAuthorizationParamsSchema = z.object({
response_type: z.literal('code'),
code_challenge: z.string(),
code_challenge_method: z.literal('S256'),
scope: z.string().optional(),
state: z.string().optional(),
resource: z.string().url().optional()
});
export function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
// Create a router to apply middleware
const router = express.Router();
router.use(allowedMethods(['GET', 'POST']));
router.use(express.urlencoded({ extended: false }));
// Apply rate limiting unless explicitly disabled
if (rateLimitConfig !== false) {
router.use(rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // 100 requests per windowMs
standardHeaders: true,
legacyHeaders: false,
message: new TooManyRequestsError('You have exceeded the rate limit for authorization requests').toResponseObject(),
...rateLimitConfig
}));
}
router.all('/', async (req, res) => {
res.setHeader('Cache-Control', 'no-store');
// In the authorization flow, errors are split into two categories:
// 1. Pre-redirect errors (direct response with 400)
// 2. Post-redirect errors (redirect with error parameters)
// Phase 1: Validate client_id and redirect_uri. Any errors here must be direct responses.
let client_id, redirect_uri, client;
try {
const result = ClientAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query);
if (!result.success) {
throw new InvalidRequestError(result.error.message);
}
client_id = result.data.client_id;
redirect_uri = result.data.redirect_uri;
client = await provider.clientsStore.getClient(client_id);
if (!client) {
throw new InvalidClientError('Invalid client_id');
}
if (redirect_uri !== undefined) {
const requested = redirect_uri;
if (!client.redirect_uris.some(registered => redirectUriMatches(requested, registered))) {
throw new InvalidRequestError('Unregistered redirect_uri');
}
}
else if (client.redirect_uris.length === 1) {
redirect_uri = client.redirect_uris[0];
}
else {
throw new InvalidRequestError('redirect_uri must be specified when client has multiple registered URIs');
}
}
catch (error) {
// Pre-redirect errors - return direct response
//
// These don't need to be JSON encoded, as they'll be displayed in a user
// agent, but OTOH they all represent exceptional situations (arguably,
// "programmer error"), so presenting a nice HTML page doesn't help the
// user anyway.
if (error instanceof OAuthError) {
const status = error instanceof ServerError ? 500 : 400;
res.status(status).json(error.toResponseObject());
}
else {
const serverError = new ServerError('Internal Server Error');
res.status(500).json(serverError.toResponseObject());
}
return;
}
// Phase 2: Validate other parameters. Any errors here should go into redirect responses.
let state;
try {
// Parse and validate authorization parameters
const parseResult = RequestAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query);
if (!parseResult.success) {
throw new InvalidRequestError(parseResult.error.message);
}
const { scope, code_challenge, resource } = parseResult.data;
state = parseResult.data.state;
// Validate scopes
let requestedScopes = [];
if (scope !== undefined) {
requestedScopes = scope.split(' ');
}
// All validation passed, proceed with authorization
await provider.authorize(client, {
state,
scopes: requestedScopes,
redirectUri: redirect_uri,
codeChallenge: code_challenge,
resource: resource ? new URL(resource) : undefined
}, res);
}
catch (error) {
// Post-redirect errors - redirect with error parameters
if (error instanceof OAuthError) {
res.redirect(302, createErrorRedirect(redirect_uri, error, state));
}
else {
const serverError = new ServerError('Internal Server Error');
res.redirect(302, createErrorRedirect(redirect_uri, serverError, state));
}
}
});
return router;
}
/**
* Helper function to create redirect URL with error parameters
*/
function createErrorRedirect(redirectUri, error, state) {
const errorUrl = new URL(redirectUri);
errorUrl.searchParams.set('error', error.errorCode);
errorUrl.searchParams.set('error_description', error.message);
if (error.errorUri) {
errorUrl.searchParams.set('error_uri', error.errorUri);
}
if (state) {
errorUrl.searchParams.set('state', state);
}
return errorUrl.href;
}
//# sourceMappingURL=authorize.js.map
@@ -0,0 +1 @@
{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,141 @@
class CleanPasswords {
constructor({
substr,
limit,
trieRoot
}) {
this.buffer = [];
this.finalPasswords = [];
this.substr = substr;
this.limit = limit;
this.trieRoot = trieRoot;
}
getAllPossibleSubsAtIndex(index) {
const nodes = [];
let cur = this.trieRoot;
for (let i = index; i < this.substr.length; i += 1) {
const character = this.substr.charAt(i);
cur = cur.getChild(character);
if (!cur) {
break;
}
nodes.push(cur);
}
return nodes;
}
// eslint-disable-next-line complexity,max-statements
helper({
onlyFullSub,
isFullSub,
index,
subIndex,
changes,
lastSubLetter,
consecutiveSubCount
}) {
if (this.finalPasswords.length >= this.limit) {
return;
}
if (index === this.substr.length) {
if (onlyFullSub === isFullSub) {
this.finalPasswords.push({
password: this.buffer.join(''),
changes,
isFullSubstitution: onlyFullSub
});
}
return;
}
// first, exhaust all possible substitutions at this index
const nodes = [...this.getAllPossibleSubsAtIndex(index)];
let hasSubs = false;
// iterate backward to get wider substitutions first
for (let i = index + nodes.length - 1; i >= index; i -= 1) {
const cur = nodes[i - index];
const sub = cur.parents.join('');
if (cur.isTerminal()) {
// Skip if this would be a 4th or more consecutive substitution of the same letter
// this should work in all language as there shouldn't be the same letter more than four times in a row
// So we can ignore the rest to save calculation time
if (lastSubLetter === sub && consecutiveSubCount >= 3) {
continue;
}
hasSubs = true;
const letters = cur.subs;
for (const letter of letters) {
this.buffer.push(letter);
const newSubs = changes.concat({
i: subIndex,
letter,
substitution: sub
});
// recursively build the rest of the string
this.helper({
onlyFullSub,
isFullSub,
index: index + sub.length,
subIndex: subIndex + letter.length,
changes: newSubs,
lastSubLetter: sub,
consecutiveSubCount: lastSubLetter === sub ? consecutiveSubCount + 1 : 1
});
// backtrack by ignoring the added postfix
this.buffer.pop();
if (this.finalPasswords.length >= this.limit) {
return;
}
}
}
}
// next, generate all combos without doing a substitution at this index
// if a partial substitution is requested or there are no substitutions at this index
if (!onlyFullSub || !hasSubs) {
const firstChar = this.substr.charAt(index);
this.buffer.push(firstChar);
this.helper({
onlyFullSub,
isFullSub: isFullSub && !hasSubs,
index: index + 1,
subIndex: subIndex + 1,
changes,
lastSubLetter,
consecutiveSubCount
});
this.buffer.pop();
}
}
getAll() {
// only full substitution
this.helper({
onlyFullSub: true,
isFullSub: true,
index: 0,
subIndex: 0,
changes: [],
lastSubLetter: undefined,
consecutiveSubCount: 0
});
// only partial substitution
this.helper({
onlyFullSub: false,
isFullSub: true,
index: 0,
subIndex: 0,
changes: [],
lastSubLetter: undefined,
consecutiveSubCount: 0
});
return this.finalPasswords;
}
}
const getCleanPasswords = (password, limit, trieRoot) => {
const helper = new CleanPasswords({
substr: password,
limit,
trieRoot
});
return helper.getAll();
};
export { getCleanPasswords as default };
//# sourceMappingURL=getCleanPasswords.mjs.map
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function isNumber(value) {
return typeof value === "number" && value === value;
}
exports.isNumber = isNumber;
@@ -0,0 +1,6 @@
"use strict";
const addDays = require("./addDays.js");
function subDays(date, days) {
return addDays(date, -days);
}
module.exports = subDays;
@@ -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 MapPinCheck = createLucideIcon("MapPinCheck", [
[
"path",
{
d: "M19.43 12.935c.357-.967.57-1.955.57-2.935a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 1.202 0 32.197 32.197 0 0 0 .813-.728",
key: "1dq61d"
}
],
["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }],
["path", { d: "m16 18 2 2 4-4", key: "1mkfmb" }]
]);
export { MapPinCheck as default };
//# sourceMappingURL=map-pin-check.js.map
@@ -0,0 +1,195 @@
/**
* 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.
*
*
* @format
*/
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.deepCloneNode = deepCloneNode;
exports.nodeWith = nodeWith;
exports.removeNodeOnParent = removeNodeOnParent;
exports.replaceNodeOnParent = replaceNodeOnParent;
exports.setParentPointersInDirectChildren = setParentPointersInDirectChildren;
exports.shallowCloneNode = shallowCloneNode;
exports.updateAllParentPointers = updateAllParentPointers;
var _astArrayMutationHelpers = require("./astArrayMutationHelpers");
var _getVisitorKeys = require("../traverse/getVisitorKeys");
var _SimpleTraverser = require("../traverse/SimpleTraverser");
function getParentKey(target, parent, visitorKeys) {
if (parent == null) {
throw new Error(`Expected parent node to be set on "${target.type}"`);
}
for (const key of (0, _getVisitorKeys.getVisitorKeys)(parent, visitorKeys)) {
if ((0, _getVisitorKeys.isNode)( // $FlowExpectedError[prop-missing]
parent[key])) {
if (parent[key] === target) {
return {
type: 'single',
node: parent,
key
};
}
} else if (Array.isArray(parent[key])) {
for (let i = 0; i < parent[key].length; i += 1) {
// $FlowExpectedError[invalid-tuple-index]
const current = parent[key][i];
if (current === target) {
return {
type: 'array',
node: parent,
key,
targetIndex: i
};
}
}
}
} // this shouldn't happen ever
throw new Error(`Expected to find the ${target.type} as a direct child of the ${parent.type}.`);
}
/**
* Replace a node with a new node within an AST (via the parent pointer).
*/
function replaceNodeOnParent(originalNode, originalNodeParent, nodeToReplaceWith, visitorKeys) {
const replacementParent = getParentKey(originalNode, originalNodeParent, visitorKeys);
const parent = replacementParent.node;
if (replacementParent.type === 'array') {
// $FlowExpectedError[prop-missing]
parent[replacementParent.key] = (0, _astArrayMutationHelpers.replaceInArray)( // $FlowExpectedError[prop-missing]
parent[replacementParent.key], replacementParent.targetIndex, [nodeToReplaceWith]);
} else {
// $FlowExpectedError[prop-missing]
parent[replacementParent.key] = nodeToReplaceWith;
}
}
/**
* Remove a node from the AST its connected to (via the parent pointer).
*/
function removeNodeOnParent(originalNode, originalNodeParent, visitorKeys) {
const replacementParent = getParentKey(originalNode, originalNodeParent, visitorKeys);
const parent = replacementParent.node;
if (replacementParent.type === 'array') {
// $FlowExpectedError[prop-missing]
parent[replacementParent.key] = (0, _astArrayMutationHelpers.removeFromArray)( // $FlowExpectedError[prop-missing]
parent[replacementParent.key], replacementParent.targetIndex);
} else {
// $FlowExpectedError[prop-missing]
parent[replacementParent.key] = null;
}
}
/**
* Corrects the parent pointers in direct children of the given node.
*/
function setParentPointersInDirectChildren(node, visitorKeys) {
for (const key of (0, _getVisitorKeys.getVisitorKeys)(node, visitorKeys)) {
if ((0, _getVisitorKeys.isNode)(node[key])) {
// $FlowExpectedError[cannot-write]
node[key].parent = node;
} else if (Array.isArray(node[key])) {
for (const child of node[key]) {
child.parent = node;
}
}
}
}
/**
* Traverses the entire subtree to ensure the parent pointers are set correctly.
*/
function updateAllParentPointers(node, visitorKeys) {
_SimpleTraverser.SimpleTraverser.traverse(node, {
enter(node, parent) {
// $FlowExpectedError[cannot-write]
node.parent = parent;
},
leave() {},
visitorKeys
});
}
/**
* Clone node and add new props.
*
* This will only create a new object if the overrides actually result in a change.
*/
function nodeWith(node, overrideProps, visitorKeys) {
// Check if this will actually result in a change, maintaining referential equality is important.
const willBeUnchanged = Object.entries(overrideProps).every(([key, value]) => {
const node_ = node;
if (Array.isArray(value)) {
return Array.isArray(node_[key]) ? (0, _astArrayMutationHelpers.arrayIsEqual)(node_[key], value) : false;
}
return node_[key] === value;
});
if (willBeUnchanged) {
return node;
} // Create new node.
// $FlowExpectedError[cannot-spread-interface]
const newNode = { ...node,
...overrideProps
}; // Ensure parent pointers are correctly set within this nodes children.
setParentPointersInDirectChildren(newNode, visitorKeys);
return newNode;
}
/**
* Shallow clones node, providing a new reference for an existing node.
*/
function shallowCloneNode(node, visitorKeys) {
// $FlowExpectedError[cannot-spread-interface]
const newNode = { ...node
}; // Ensure parent pointers are correctly set within this nodes children.
setParentPointersInDirectChildren(newNode, visitorKeys);
return newNode;
}
/**
* Deeply clones node and its entire tree.
*/
function deepCloneNode(node, visitorKeys) {
const clone = JSON.parse(JSON.stringify(node, (key, value) => {
// null out parent pointers
if (key === 'parent') {
return undefined;
}
return value;
}));
updateAllParentPointers(clone, visitorKeys);
return clone;
}
@@ -0,0 +1,10 @@
'use strict';
module.exports = [
'.js',
'.cjs',
'.mjs',
'.ts',
'.tsx',
'.jsx'
];
@@ -0,0 +1,21 @@
import semver = require("../index");
import Comparator = require("./comparator");
import SemVer = require("./semver");
declare class Range {
constructor(range: string | Range, optionsOrLoose?: boolean | semver.RangeOptions);
range: string;
raw: string;
loose: boolean;
options: semver.Options;
includePrerelease: boolean;
format(): string;
inspect(): string;
set: ReadonlyArray<readonly Comparator[]>;
parseRange(range: string): readonly Comparator[];
test(version: string | SemVer): boolean;
intersects(range: Range, optionsOrLoose?: boolean | semver.Options): boolean;
}
export = Range;
@@ -0,0 +1,88 @@
let _fs
try {
_fs = require('graceful-fs')
} catch (_) {
_fs = require('fs')
}
const universalify = require('universalify')
const { stringify, stripBom } = require('./utils')
async function _readFile (file, options = {}) {
if (typeof options === 'string') {
options = { encoding: options }
}
const fs = options.fs || _fs
const shouldThrow = 'throws' in options ? options.throws : true
let data = await universalify.fromCallback(fs.readFile)(file, options)
data = stripBom(data)
let obj
try {
obj = JSON.parse(data, options ? options.reviver : null)
} catch (err) {
if (shouldThrow) {
err.message = `${file}: ${err.message}`
throw err
} else {
return null
}
}
return obj
}
const readFile = universalify.fromPromise(_readFile)
function readFileSync (file, options = {}) {
if (typeof options === 'string') {
options = { encoding: options }
}
const fs = options.fs || _fs
const shouldThrow = 'throws' in options ? options.throws : true
try {
let content = fs.readFileSync(file, options)
content = stripBom(content)
return JSON.parse(content, options.reviver)
} catch (err) {
if (shouldThrow) {
err.message = `${file}: ${err.message}`
throw err
} else {
return null
}
}
}
async function _writeFile (file, obj, options = {}) {
const fs = options.fs || _fs
const str = stringify(obj, options)
await universalify.fromCallback(fs.writeFile)(file, str, options)
}
const writeFile = universalify.fromPromise(_writeFile)
function writeFileSync (file, obj, options = {}) {
const fs = options.fs || _fs
const str = stringify(obj, options)
// not sure if fs.writeFileSync returns anything, but just in case
return fs.writeFileSync(file, str, options)
}
// NOTE: do not change this export format; required for ESM compat
// see https://github.com/jprichardson/node-jsonfile/pull/162 for details
module.exports = {
readFile,
readFileSync,
writeFile,
writeFileSync
}
@@ -0,0 +1,26 @@
{
"name": "@oxc-project/types",
"version": "0.139.0",
"description": "Types for Oxc AST nodes",
"keywords": [
"AST",
"Parser"
],
"homepage": "https://oxc.rs",
"bugs": "https://github.com/oxc-project/oxc/issues",
"license": "MIT",
"author": "Boshen and oxc contributors",
"repository": {
"type": "git",
"url": "git+https://github.com/oxc-project/oxc.git",
"directory": "npm/oxc-types"
},
"funding": {
"url": "https://github.com/sponsors/Boshen"
},
"files": [
"types.d.ts"
],
"type": "module",
"types": "types.d.ts"
}
@@ -0,0 +1,22 @@
/**
* @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 House = createLucideIcon("House", [
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
[
"path",
{
d: "M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
key: "1d0kgt"
}
]
]);
export { House as default };
//# sourceMappingURL=house.js.map
@@ -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 Move3d = createLucideIcon("Move3d", [
["path", { d: "M5 3v16h16", key: "1mqmf9" }],
["path", { d: "m5 19 6-6", key: "jh6hbb" }],
["path", { d: "m2 6 3-3 3 3", key: "tkyvxa" }],
["path", { d: "m18 16 3 3-3 3", key: "1d4glt" }]
]);
export { Move3d as default };
//# sourceMappingURL=move-3d.js.map
@@ -0,0 +1 @@
module.exports={C:{"121":0.21147,"155":0.1596,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 156 157 158 159 160 3.5 3.6"},D:{"75":0.63641,"77":0.05387,"83":0.05387,"110":0.05387,"111":0.05387,"114":0.05387,"118":0.79601,"119":0.26534,"120":0.21147,"124":0.05387,"131":0.05387,"133":0.10574,"134":0.05387,"135":0.3192,"136":0.10574,"137":0.05387,"139":0.05387,"142":0.05387,"148":0.05387,"149":1.27281,"150":0.95561,"151":2.06882,"152":4.9875,"153":2.33415,"156":0.05387,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 78 79 80 81 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 112 113 115 116 117 121 122 123 125 126 127 128 129 130 132 138 140 141 143 144 145 146 147 154 155 157"},F:{"135":0.21147,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 133 134 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"120":0.05387,"150":0.05387,"151":0.05387,"152":0.95561,"153":0.63641,"154":0.21147,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149"},E:{_:"4 5 6 7 8 9 10 11 12 13 14 15 27 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 16.6 17.0 17.1 17.2 17.3 17.4 17.5 17.6 18.0 18.1 18.2 18.3 18.4 18.5-18.7 26.0 26.1 26.2 26.3 26.4 26.5 27.1 27.2 TP","26.6":0.3192},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00051,"5.0-5.1":0.00051,"6.0-6.1":0,"7.0-7.1":0.00102,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00512,"11.0-11.2":0.00051,"11.3-11.4":0.00102,"12.0-12.1":0,"12.2-12.5":0.0133,"13.0-13.1":0,"13.2":0.00256,"13.3":0,"13.4-13.7":0.00051,"14.0-14.4":0.00205,"14.5-14.8":0.00307,"15.0-15.1":0.00307,"15.2-15.3":0.00205,"15.4":0.00256,"15.5":0.00307,"15.6-15.8":0.0665,"16.0":0.00512,"16.1":0.00921,"16.2":0.00512,"16.3":0.01125,"16.4":0.00256,"16.5":0.00409,"16.6-16.7":0.09259,"17.0":0.00358,"17.1":0.00512,"17.2":0.00512,"17.3":0.00767,"17.4":0.01074,"17.5":0.02097,"17.6-17.7":0.05422,"18.0":0.01125,"18.1":0.02251,"18.2":0.03069,"18.3":0.0532,"18.4":0.03325,"18.5-18.7":0.68697,"26.0":0.03325,"26.1":0.03376,"26.2":0.08798,"26.3":0.09514,"26.4":0.06957,"26.5":0.46599,"26.6":2.87525,"27.0":0.22046,"27.1":0,"27.2":0.00563},P:{"27":0.02488,"29":0.05474,"30":0.47273,_:"4 20 21 22 23 24 25 26 28 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.11207,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":73.65185},R:{_:"0"},M:{"0":0.83252},Q:{_:"14.9"},O:{"0":1.00063},H:{all:0}};