docs: 创建专业的项目 README 文档

详细说明:
- 添加完整的项目介绍和架构说明
- 包含 7 个 AI Agent 的详细介绍
- 添加技术栈和 Mermaid 架构图
- 完善安装和使用指南
- 添加开发指南和 Git 工作流
- 新增 Windows 快速部署文档
- 更新前端组件和启动脚本
- 添加多种环境配置文件

修改的文件:
- 新增 README.md 主文档
- 新增 doc/ 目录及部署文档
- 更新前端演示系统组件
- 添加多个启动脚本变体
- 配置文件优化

影响的功能模块:
- 项目文档体系
- 部署和启动流程
- 前端展示系统
- 环境配置管理
This commit is contained in:
Yep_Q
2025-09-14 18:53:27 +08:00
parent 750af2692a
commit 2fcaf21842
154 changed files with 113964 additions and 36 deletions

View File

@@ -29,7 +29,9 @@
"Bash(kill:*)",
"Bash(env)",
"mcp__ide__getDiagnostics",
"Bash(npm install:*)"
"Bash(npm install:*)",
"mcp__serena__read_memory",
"Bash(git add:*)"
],
"deny": [],
"ask": [],

324
README.md Normal file
View File

@@ -0,0 +1,324 @@
# 🚀 n8n 展会策划 AI 多智能体演示系统
<div align="center">
<img src="https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png" alt="n8n logo" width="200"/>
**基于 n8n 工作流自动化平台的 AI 多智能体协作演示系统**
[![n8n Version](https://img.shields.io/badge/n8n-v1.109.2-orange)](https://n8n.io)
[![Language](https://img.shields.io/badge/Language-中文-red)](README.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE)
[![Status](https://img.shields.io/badge/Status-Active-success)](https://github.com)
</div>
---
## 📖 项目概述
这是一个集成了 **n8n 工作流自动化平台****AI 多智能体协作系统** 的展会策划演示项目。项目展示了如何使用 n8n 编排多个 AI Agent 协同工作,自动生成专业的展会策划方案。
### ✨ 核心特性
- 🤖 **7 个专业 AI Agent** 协同工作,覆盖展会策划全流程
- 🎯 **n8n 中文版** 完整汉化3465+ 行专业翻译
- 🎨 **现代化 Web 界面** React 18 + TypeScript + Tailwind CSS
-**实时执行展示** 终端风格输出,打字机效果
- 📊 **可视化工作流** 嵌入式 n8n 流程图实时展示
- 🚀 **一键启动** 智能启动脚本,自动环境检测
---
## 🏗️ 项目架构
```mermaid
graph TB
subgraph "前端展示层"
A[React 展示界面<br/>端口: 4173]
B[静态展会网站<br/>端口: 8080]
end
subgraph "工作流引擎"
C[n8n 工作流平台<br/>端口: 5678]
D[中文翻译模块]
end
subgraph "AI Agent 层"
E[信息检索专家]
F[设计专家]
G[财务预算专家]
H[格式编辑专家]
I[活动执行专家]
J[营销宣传专家]
K[会展策划专家]
end
A --> C
B --> C
C --> D
C --> E & F & G & H & I & J & K
style A fill:#646cff,color:#fff
style C fill:#ff6d5a,color:#fff
style E fill:#10b981,color:#fff
style F fill:#10b981,color:#fff
style G fill:#10b981,color:#fff
style H fill:#10b981,color:#fff
style I fill:#10b981,color:#fff
style J fill:#10b981,color:#fff
style K fill:#10b981,color:#fff
```
---
## 📁 项目结构
```
2025-09-08_n8nDEMO演示/
├── 📂 n8n-n8n-1.109.2/ # n8n 核心源码(中文版)
│ ├── packages/ # monorepo 包结构
│ │ ├── cli/ # CLI 和后端服务
│ │ ├── core/ # 工作流执行引擎
│ │ ├── editor-ui/ # Vue 3 前端应用
│ │ ├── nodes-base/ # 内置节点集成
│ │ └── @n8n/i18n/ # 国际化(含中文)
│ ├── start.sh # 智能启动脚本
│ └── LAUNCH.md # 启动指南文档
├── 📂 web_frontend/ # 前端应用
│ ├── exhibition-demo/ # React 演示系统
│ │ ├── src/
│ │ │ ├── pages/ # 页面组件
│ │ │ ├── components/ # UI 组件
│ │ │ └── store/ # 状态管理
│ │ └── package.json
│ │
│ └── web_result/ # 静态展会网站
│ ├── index.html # 首页
│ ├── pages/ # 功能页面
│ └── data/ # 展会资源
├── 📂 doc/ # 项目文档
└── 📄 CLAUDE.md # AI 开发助手配置
```
---
## 🚀 快速开始
### 前置要求
- **Node.js** >= 18.0.0
- **pnpm** >= 8.0.0
- **Git**
- 8GB+ 内存推荐
### 1⃣ 克隆项目
```bash
git clone [your-repo-url]
cd 2025-09-08_n8nDEMO演示
```
### 2⃣ 启动 n8n 工作流平台
```bash
# 进入 n8n 目录
cd n8n-n8n-1.109.2
# 方式一:使用智能启动脚本(推荐)
./start.sh
# 方式二:开发模式(支持热更新)
./start.sh -d
# 方式三:手动启动
pnpm install
pnpm build
pnpm start
```
访问 http://localhost:5678 - n8n 工作流编辑器(中文界面)
### 3⃣ 启动展示前端
```bash
# React 演示系统
cd web_frontend/exhibition-demo
pnpm install
pnpm dev # 开发模式 (端口 5173)
pnpm preview # 生产预览 (端口 4173)
# 静态展会网站
cd web_frontend/web_result
./start.sh # 启动 Node.js 服务器 (端口 8080)
```
---
## 🤖 AI Agent 团队
| Agent | 模型 | 职责 | 关键能力 |
|-------|------|------|----------|
| 🔍 **信息检索专家** | DeepSeek Chat | 市场调研 | 数据收集、竞品分析、趋势预测 |
| 🎨 **设计专家** | Google Gemini | 视觉设计 | 空间布局、品牌形象、3D建模 |
| 💰 **财务预算专家** | DeepSeek Chat | 成本核算 | 预算规划、ROI分析、资源优化 |
| 📝 **格式编辑专家** | DeepSeek Chat | 文档处理 | 格式规范、内容优化、排版美化 |
| ⚡ **活动执行专家** | DeepSeek Chat | 执行管理 | 时间线规划、任务分配、风险控制 |
| 📢 **营销宣传专家** | DeepSeek Chat | 品牌推广 | 媒体策略、内容营销、社交传播 |
| 🎯 **会展策划专家** | 多模型融合 | 中央协调 | 方案整合、决策支持、质量把控 |
---
## 💻 技术栈
### 后端技术
- **n8n Core** - 工作流自动化引擎
- **Node.js** + **TypeScript** - 运行环境
- **Express** - Web 服务器
- **TypeORM** - 数据库 ORM
- **SQLite/PostgreSQL** - 数据存储
### 前端技术
- **React 18** - UI 框架
- **Vue 3** - n8n 编辑器
- **TypeScript** - 类型安全
- **Tailwind CSS** - 样式框架
- **Framer Motion** - 动画库
- **Zustand** - 状态管理
- **Vite** - 构建工具
### AI 集成
- **DeepSeek API** - 主力 AI 模型
- **Google Gemini** - 创意设计
- **LangChain** - AI 编排框架
---
## 📚 核心功能
### 1. AI 多智能体协作
- 7 个专业 Agent 并行工作
- 智能任务分配和协调
- 实时状态同步和结果整合
### 2. 工作流可视化
- 实时流程图展示
- 节点执行状态追踪
- 数据流向可视化
### 3. 终端模拟系统
- 真实打字机效果30-40字/秒)
- 进度条卡顿模拟15%, 40%, 68%, 90%
- 多媒体内容支持(文本、图片、数据表)
### 4. 成果展示
- 68页专业策划文档
- 3分钟快速生成
- 30% ROI 提升预期
---
## 🛠️ 开发指南
### 环境变量配置
创建 `.env` 文件:
```env
# n8n 配置
N8N_DEFAULT_LOCALE=zh-CN
N8N_SECURE_COOKIE=false
N8N_PORT=5678
# 前端配置
VITE_API_URL=http://localhost:5678
VITE_WS_URL=ws://localhost:5678
```
### 常用命令
```bash
# n8n 相关
pnpm build # 构建所有包
pnpm dev # 开发模式
pnpm test # 运行测试
pnpm lint # 代码检查
pnpm typecheck # 类型检查
# 前端相关
pnpm dev # 开发服务器
pnpm build # 生产构建
pnpm preview # 预览构建
```
### Git 工作流
```bash
# 工作分支
git checkout My_N8N
# 提交规范
git add .
git commit -m "feat: 新功能描述
详细说明:
- 完成的工作
- 修改的文件
- 影响的模块"
```
---
## 📈 项目亮点
-**完整中文化** - n8n 界面 100% 汉化3465+ 行专业翻译
-**智能启动** - 一键启动脚本,自动环境检测和依赖安装
-**现代化 UI** - 深色主题、Glass Morphism、响应式设计
-**真实演示** - 模拟真实 AI 执行过程,包含进度和状态
-**生产就绪** - 完整的错误处理、日志记录、性能优化
-**易于扩展** - 模块化架构,便于添加新 Agent 和功能
---
## 🤝 贡献指南
欢迎贡献代码、报告问题或提出建议!
1. Fork 项目
2. 创建功能分支 (`git checkout -b feature/AmazingFeature`)
3. 提交更改 (`git commit -m 'feat: Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 开启 Pull Request
---
## 📄 许可证
本项目基于 [Apache License 2.0](LICENSE) 开源。
n8n 核心代码遵循 [n8n 公平代码许可证](https://github.com/n8n-io/n8n/blob/master/LICENSE.md)。
---
## 🙏 致谢
- [n8n.io](https://n8n.io) - 强大的工作流自动化平台
- [n8n-i18n-chinese](https://github.com/xushengfeng/n8n-i18n-chinese) - 中文翻译项目
- DeepSeek & Google Gemini - AI 模型支持
- 所有贡献者和使用者
---
## 📞 联系方式
- 项目维护:[Your Name]
- Email[your.email@example.com]
- Issues[GitHub Issues](https://github.com/your-repo/issues)
---
<div align="center">
<b>🌟 如果这个项目对你有帮助,请给个 Star🌟</b>
Made with ❤️ by [Your Team]
</div>

View File

7
doc/快速部署.md Normal file
View File

@@ -0,0 +1,7 @@
# 项目概述
这个项目是一个DuoDuo Agent演示Demo
它是由3个项目组合部署而成
- **n8n-n8n-1.109.2**这个N8N版本是经过中文编译过后的版本目前在mac上可以正常运行但是在windows上只能运行英文版已经尝试过很多次无法完美解决在windows上运行n8n中文版本
- **web_frontend/exhibition-demo**这个是启动的主体,一半先打开的是这个,

22
n8n-n8n-1.109.2/.env.demo Normal file
View File

@@ -0,0 +1,22 @@
# n8n 演示模式配置
N8N_DEFAULT_LOCALE=zh-CN
N8N_HOST=0.0.0.0
N8N_PORT=5678
N8N_EDITOR_BASE_URL=http://192.168.2.90:5678
WEBHOOK_URL=http://192.168.2.90:5678
N8N_PROTOCOL=http
# 跳过所有认证和设置
N8N_BASIC_AUTH_ACTIVE=false
N8N_AUTH_EXCLUDE_ENDPOINTS=/**
N8N_USER_MANAGEMENT_DISABLED=true
N8N_SKIP_OWNER_SETUP=true
# CORS配置
N8N_CORS_ENABLED=true
N8N_CORS_ORIGINS=*
N8N_CORS_ALLOW_CREDENTIALS=true
# 禁用遥测
N8N_DIAGNOSTICS_DISABLED=true
N8N_TELEMETRY_DISABLED=true

33
n8n-n8n-1.109.2/.env.lan Normal file
View File

@@ -0,0 +1,33 @@
# n8n 局域网完整访问配置
N8N_DEFAULT_LOCALE=zh-CN
N8N_HOST=0.0.0.0
N8N_PORT=5678
N8N_EDITOR_BASE_URL=http://192.168.2.90:5678
WEBHOOK_URL=http://192.168.2.90:5678
N8N_PROTOCOL=http
# 认证配置(开发环境 - 禁用认证)
N8N_BASIC_AUTH_ACTIVE=false
N8N_AUTH_EXCLUDE_ENDPOINTS=/**
N8N_SKIP_AUTH_ROUTES=true
# Cookie配置
N8N_SECURE_COOKIE=false
N8N_SESSION_COOKIE_SAME_SITE=none
N8N_SESSION_COOKIE_SECURE=false
N8N_SESSION_COOKIE_DOMAIN=
# CORS配置开发环境 - 允许所有)
N8N_CORS_ENABLED=true
N8N_CORS_ORIGINS=*
N8N_CORS_ALLOW_HEADERS=*
N8N_CORS_ALLOW_METHODS=*
# WebSocket
N8N_PUSH_BACKEND=websocket
# 其他
N8N_RUNNERS_ENABLED=true
N8N_BLOCK_ENV_ACCESS_IN_NODE=false
DB_SQLITE_POOL_SIZE=5
N8N_PUBLIC_API_DISABLED=false

View File

@@ -0,0 +1,12 @@
# n8n 局域网访问配置
N8N_DEFAULT_LOCALE=zh-CN
N8N_HOST=0.0.0.0
N8N_PORT=5678
N8N_EDITOR_BASE_URL=http://192.168.2.90:5678
WEBHOOK_URL=http://192.168.2.90:5678
N8N_PROTOCOL=http
N8N_SECURE_COOKIE=false
N8N_SESSION_COOKIE_SAME_SITE=lax
N8N_SESSION_COOKIE_SECURE=false
N8N_CORS_ENABLED=true
N8N_CORS_ORIGINS=http://localhost:5678,http://192.168.2.90:5678,http://127.0.0.1:5678

View File

@@ -21,3 +21,14 @@ Editor is now accessible via:
http://localhost:5678
(node:40550) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
2025-09-10T00:35:45.301Z [Rudder] error: Response error code: ECONNRESET
2025-09-10T00:35:45.603Z [Rudder] error: Response error code: ECONNRESET
2025-09-10T00:35:46.159Z [Rudder] error: Response error code: ECONNRESET
2025-09-10T00:35:47.491Z [Rudder] error: Error: ECONNRESET
read ECONNRESET
read ECONNRESET
read ECONNRESET
read ECONNRESET
2025-09-10T12:58:36.048Z [Rudder] error: Response error code: ECONNABORTED
2025-09-10T12:58:36.162Z [Rudder] error: Error: ECONNABORTED
timeout of 300000ms exceeded

View File

@@ -0,0 +1,28 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (4F9N-zA_uFRqmJ75qypmz)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://localhost:5678
(node:49958) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Received SIGINT. Shutting down...
[Task Runner]: Received SIGINT signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,33 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (oEtIj0jgSWkCBQhozMDoR)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://0.0.0.0:5678
(node:69119) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
401 Wrong username or password. Do you have caps lock on?
401 Wrong username or password. Do you have caps lock on?
401 Wrong username or password. Do you have caps lock on?
401 Wrong username or password. Do you have caps lock on?
401 Wrong username or password. Do you have caps lock on?
Received SIGINT. Shutting down...
[Task Runner]: Received SIGINT signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,29 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (FAATlXvqOFr7SpAMV3Kqk)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.90:5678
(node:77801) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
ELIFECYCLE Command failed.
Received SIGTERM. Shutting down...
[Task Runner]: Received SIGTERM signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,29 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (RSKxAE8DU9N7qA7DJVPY5)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.90:5678
(node:23582) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Received SIGTERM. Shutting down...
ELIFECYCLE Command failed.
[Task Runner]: Received SIGTERM signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,29 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (r84e-hWgfM8-CszbqCXQz)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.90:5678
(node:91211) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Received SIGTERM. Shutting down...
ELIFECYCLE Command failed.
[Task Runner]: Received SIGTERM signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,13 @@
TypeError: Missing parameter name at 6: https://git.new/pathToRegexpError
at name (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:153:13)
at lexer (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:168:21)
at lexer.next (<anonymous>)
at Iter.peek (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:188:32)
at Iter.tryConsume (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:195:24)
at Iter.text (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:213:26)
at consume (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:285:23)
at parse (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:320:18)
at /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:503:40
at Array.map (<anonymous>)
Exiting due to an error.
Missing parameter name at 6: https://git.new/pathToRegexpError

View File

@@ -0,0 +1,27 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (yDuRRwdAj5IA99mGUsiZB)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.90:5678
Received SIGTERM. Shutting down...
ELIFECYCLE Command failed.
[Task Runner]: Received SIGTERM signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,13 @@
TypeError: Missing parameter name at 6: https://git.new/pathToRegexpError
at name (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:153:13)
at lexer (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:168:21)
at lexer.next (<anonymous>)
at Iter.peek (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:188:32)
at Iter.tryConsume (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:195:24)
at Iter.text (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:213:26)
at consume (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:285:23)
at parse (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:320:18)
at /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:503:40
at Array.map (<anonymous>)
Exiting due to an error.
Missing parameter name at 6: https://git.new/pathToRegexpError

View File

@@ -0,0 +1,14 @@
Last session crashed
TypeError: Missing parameter name at 6: https://git.new/pathToRegexpError
at name (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:153:13)
at lexer (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:168:21)
at lexer.next (<anonymous>)
at Iter.peek (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:188:32)
at Iter.tryConsume (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:195:24)
at Iter.text (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:213:26)
at consume (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:285:23)
at parse (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:320:18)
at /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/node_modules/.pnpm/path-to-regexp@8.2.0/node_modules/path-to-regexp/src/index.ts:503:40
at Array.map (<anonymous>)
Exiting due to an error.
Missing parameter name at 6: https://git.new/pathToRegexpError

View File

@@ -0,0 +1,26 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (b6PND0Z4f9GgE0juaQeP1)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.99:5678
Received SIGINT. Shutting down...
[Task Runner]: Received SIGINT signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,28 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (1hOQAq-h909KUxBXkmhn7)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.99:5678
(node:58147) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Received SIGINT. Shutting down...
[Task Runner]: Received SIGINT signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,30 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (wa1VyRbNhURLEvq_8nhWo)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.99:5678
(node:65389) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Owner was set up successfully
User survey updated successfully
Received SIGINT. Shutting down...
[Task Runner]: Received SIGINT signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,29 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (ytJpIM_Gno8mBYVVY08SV)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.99:5678
(node:37966) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Cannot set properties of undefined (setting 'runIndex')
Received SIGINT. Shutting down...
[Task Runner]: Received SIGINT signal, shutting down...
[Task Runner]: Task runner stopped
Stopping n8n...

View File

@@ -0,0 +1,216 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Initializing n8n process
n8n ready on ::, port 5678
Migrations in progress, please do NOT stop the process.
Starting migration InitialMigration1588102412422
Finished migration InitialMigration1588102412422
Starting migration WebhookModel1592445003908
Finished migration WebhookModel1592445003908
Starting migration CreateIndexStoppedAt1594825041918
Finished migration CreateIndexStoppedAt1594825041918
Starting migration MakeStoppedAtNullable1607431743769
Finished migration MakeStoppedAtNullable1607431743769
Starting migration AddWebhookId1611071044839
Finished migration AddWebhookId1611071044839
Starting migration CreateTagEntity1617213344594
Finished migration CreateTagEntity1617213344594
Starting migration UniqueWorkflowNames1620821879465
Finished migration UniqueWorkflowNames1620821879465
Starting migration AddWaitColumn1621707690587
Finished migration AddWaitColumn1621707690587
Starting migration UpdateWorkflowCredentials1630330987096
Finished migration UpdateWorkflowCredentials1630330987096
Starting migration AddExecutionEntityIndexes1644421939510
Finished migration AddExecutionEntityIndexes1644421939510
Starting migration CreateUserManagement1646992772331
Finished migration CreateUserManagement1646992772331
Starting migration LowerCaseUserEmail1648740597343
Finished migration LowerCaseUserEmail1648740597343
Starting migration CommunityNodes1652254514001
Finished migration CommunityNodes1652254514001
Starting migration AddUserSettings1652367743993
Finished migration AddUserSettings1652367743993
Starting migration AddAPIKeyColumn1652905585850
Finished migration AddAPIKeyColumn1652905585850
Starting migration IntroducePinData1654089251344
Finished migration IntroducePinData1654089251344
Starting migration AddNodeIds1658930531669
Finished migration AddNodeIds1658930531669
Starting migration AddJsonKeyPinData1659888469333
Finished migration AddJsonKeyPinData1659888469333
Starting migration CreateCredentialsUserRole1660062385367
Finished migration CreateCredentialsUserRole1660062385367
Starting migration CreateWorkflowsEditorRole1663755770892
Finished migration CreateWorkflowsEditorRole1663755770892
Starting migration WorkflowStatistics1664196174000
Finished migration WorkflowStatistics1664196174000
Starting migration CreateCredentialUsageTable1665484192211
Finished migration CreateCredentialUsageTable1665484192211
Starting migration RemoveCredentialUsageTable1665754637024
Finished migration RemoveCredentialUsageTable1665754637024
Starting migration AddWorkflowVersionIdColumn1669739707124
Finished migration AddWorkflowVersionIdColumn1669739707124
Starting migration AddTriggerCountColumn1669823906993
Finished migration AddTriggerCountColumn1669823906993
Starting migration MessageEventBusDestinations1671535397530
Finished migration MessageEventBusDestinations1671535397530
Starting migration RemoveWorkflowDataLoadedFlag1671726148419
Finished migration RemoveWorkflowDataLoadedFlag1671726148419
Starting migration DeleteExecutionsWithWorkflows1673268682475
Finished migration DeleteExecutionsWithWorkflows1673268682475
Starting migration AddStatusToExecutions1674138566000
Finished migration AddStatusToExecutions1674138566000
Starting migration CreateLdapEntities1674509946020
Finished migration CreateLdapEntities1674509946020
Starting migration PurgeInvalidWorkflowConnections1675940580449
Finished migration PurgeInvalidWorkflowConnections1675940580449
Starting migration MigrateExecutionStatus1676996103000
Finished migration MigrateExecutionStatus1676996103000
Starting migration UpdateRunningExecutionStatus1677237073720
Finished migration UpdateRunningExecutionStatus1677237073720
Starting migration CreateVariables1677501636752
Finished migration CreateVariables1677501636752
Starting migration CreateExecutionMetadataTable1679416281777
Finished migration CreateExecutionMetadataTable1679416281777
Starting migration AddUserActivatedProperty1681134145996
Finished migration AddUserActivatedProperty1681134145996
Starting migration RemoveSkipOwnerSetup1681134145997
Finished migration RemoveSkipOwnerSetup1681134145997
Starting migration MigrateIntegerKeysToString1690000000002
Finished migration MigrateIntegerKeysToString1690000000002
Starting migration SeparateExecutionData1690000000010
Finished migration SeparateExecutionData1690000000010
Starting migration FixMissingIndicesFromStringIdMigration1690000000020
Finished migration FixMissingIndicesFromStringIdMigration1690000000020
Starting migration RemoveResetPasswordColumns1690000000030
Finished migration RemoveResetPasswordColumns1690000000030
Starting migration AddMfaColumns1690000000030
Finished migration AddMfaColumns1690000000030
Starting migration CreateWorkflowNameIndex1691088862123
Finished migration CreateWorkflowNameIndex1691088862123
Starting migration CreateWorkflowHistoryTable1692967111175
Finished migration CreateWorkflowHistoryTable1692967111175
Starting migration ExecutionSoftDelete1693491613982
Finished migration ExecutionSoftDelete1693491613982
Starting migration DisallowOrphanExecutions1693554410387
Finished migration DisallowOrphanExecutions1693554410387
Starting migration AddWorkflowMetadata1695128658538
Finished migration AddWorkflowMetadata1695128658538
Starting migration ModifyWorkflowHistoryNodesAndConnections1695829275184
Finished migration ModifyWorkflowHistoryNodesAndConnections1695829275184
Starting migration AddGlobalAdminRole1700571993961
Finished migration AddGlobalAdminRole1700571993961
Starting migration DropRoleMapping1705429061930
Finished migration DropRoleMapping1705429061930
Starting migration RemoveFailedExecutionStatus1711018413374
Finished migration RemoveFailedExecutionStatus1711018413374
Starting migration MoveSshKeysToDatabase1711390882123
[MoveSshKeysToDatabase1711390882123] No SSH keys in filesystem, skipping
Finished migration MoveSshKeysToDatabase1711390882123
Starting migration RemoveNodesAccess1712044305787
Finished migration RemoveNodesAccess1712044305787
Starting migration CreateProject1714133768519
Finished migration CreateProject1714133768519
Starting migration MakeExecutionStatusNonNullable1714133768521
Finished migration MakeExecutionStatusNonNullable1714133768521
Starting migration AddActivatedAtUserSetting1717498465931
Finished migration AddActivatedAtUserSetting1717498465931
Starting migration AddConstraintToExecutionMetadata1720101653148
Finished migration AddConstraintToExecutionMetadata1720101653148
Starting migration CreateInvalidAuthTokenTable1723627610222
Finished migration CreateInvalidAuthTokenTable1723627610222
Starting migration RefactorExecutionIndices1723796243146
Finished migration RefactorExecutionIndices1723796243146
Starting migration CreateAnnotationTables1724753530828
Finished migration CreateAnnotationTables1724753530828
Starting migration AddApiKeysTable1724951148974
Finished migration AddApiKeysTable1724951148974
Starting migration CreateProcessedDataTable1726606152711
Finished migration CreateProcessedDataTable1726606152711
Starting migration SeparateExecutionCreationFromStart1727427440136
Finished migration SeparateExecutionCreationFromStart1727427440136
Starting migration AddMissingPrimaryKeyOnAnnotationTagMapping1728659839644
Finished migration AddMissingPrimaryKeyOnAnnotationTagMapping1728659839644
Starting migration UpdateProcessedDataValueColumnToText1729607673464
Finished migration UpdateProcessedDataValueColumnToText1729607673464
Starting migration AddProjectIcons1729607673469
Finished migration AddProjectIcons1729607673469
Starting migration CreateTestDefinitionTable1730386903556
Finished migration CreateTestDefinitionTable1730386903556
Starting migration AddDescriptionToTestDefinition1731404028106
Finished migration AddDescriptionToTestDefinition1731404028106
Starting migration MigrateTestDefinitionKeyToString1731582748663
Finished migration MigrateTestDefinitionKeyToString1731582748663
Starting migration CreateTestMetricTable1732271325258
Finished migration CreateTestMetricTable1732271325258
Starting migration CreateTestRun1732549866705
Finished migration CreateTestRun1732549866705
Starting migration AddMockedNodesColumnToTestDefinition1733133775640
Finished migration AddMockedNodesColumnToTestDefinition1733133775640
Starting migration AddManagedColumnToCredentialsTable1734479635324
Finished migration AddManagedColumnToCredentialsTable1734479635324
Starting migration AddStatsColumnsToTestRun1736172058779
Finished migration AddStatsColumnsToTestRun1736172058779
Starting migration CreateTestCaseExecutionTable1736947513045
Finished migration CreateTestCaseExecutionTable1736947513045
Starting migration AddErrorColumnsToTestRuns1737715421462
Finished migration AddErrorColumnsToTestRuns1737715421462
Starting migration CreateFolderTable1738709609940
Finished migration CreateFolderTable1738709609940
Starting migration CreateAnalyticsTables1739549398681
Finished migration CreateAnalyticsTables1739549398681
Starting migration UpdateParentFolderIdColumn1740445074052
Finished migration UpdateParentFolderIdColumn1740445074052
Starting migration RenameAnalyticsToInsights1741167584277
Finished migration RenameAnalyticsToInsights1741167584277
Starting migration AddScopesColumnToApiKeys1742918400000
Finished migration AddScopesColumnToApiKeys1742918400000
Starting migration ClearEvaluation1745322634000
Finished migration ClearEvaluation1745322634000
Starting migration AddWorkflowStatisticsRootCount1745587087521
Finished migration AddWorkflowStatisticsRootCount1745587087521
Starting migration AddWorkflowArchivedColumn1745934666076
Finished migration AddWorkflowArchivedColumn1745934666076
Starting migration DropRoleTable1745934666077
Finished migration DropRoleTable1745934666077
Starting migration AddProjectDescriptionColumn1747824239000
Finished migration AddProjectDescriptionColumn1747824239000
Starting migration AddLastActiveAtColumnToUser1750252139166
Finished migration AddLastActiveAtColumnToUser1750252139166
Starting migration AddScopeTables1750252139166
Finished migration AddScopeTables1750252139166
Starting migration AddRolesTables1750252139167
Finished migration AddRolesTables1750252139167
Starting migration LinkRoleToUserTable1750252139168
Finished migration LinkRoleToUserTable1750252139168
Starting migration AddInputsOutputsToTestCaseExecution1752669793000
Finished migration AddInputsOutputsToTestCaseExecution1752669793000
Starting migration CreateDataStoreTables1754475614601
Finished migration CreateDataStoreTables1754475614601
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
Updating 120 scopes...
Scopes updated successfully.
Updating 3 global roles...
global roles updated successfully.
Updating 4 project roles...
project roles updated successfully.
Updating 2 credential roles...
credential roles updated successfully.
Updating 2 workflow roles...
workflow roles updated successfully.
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (y9ljtbjF0HQIvaLhWCb84)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.90:5678

View File

@@ -0,0 +1,22 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/core/src/instance-settings/instance-settings.ts:227
.update(encryptionKey.slice(Math.round(encryptionKey.length / 2)))
^
TypeError: Cannot read properties of undefined (reading 'slice')
at InstanceSettings.generateInstanceId (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/core/src/instance-settings/instance-settings.ts:227:26)
at new InstanceSettings (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/core/src/instance-settings/instance-settings.ts:68:26)
at ContainerClass.get (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/@n8n/di/src/di.ts:104:16)
at CommunityPackagesModule.loadDir (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/cli/src/modules/community-packages/community-packages.module.ts:37:30)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at ModuleRegistry.loadModules (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/@n8n/backend-common/src/modules/module-registry.ts:92:20)
at CommandRegistry.execute (/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/cli/src/command-registry.ts:43:3)
at /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/cli/bin/n8n:63:2
ELIFECYCLE Command failed with exit code 1.

View File

@@ -0,0 +1,79 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
15:28:10.512 warn Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false. { "file": "instance-settings.js", "function": "ensureSettingsFilePermissions" }
15:28:10.513 debug User settings loaded from: /Users/xiaoqi/.n8n/config { "file": "instance-settings.js", "function": "loadOrCreate" }
15:28:11.560 debug Received CLI command { "execPath": "/Users/xiaoqi/.nvm/versions/node/v22.18.0/bin/node", "scriptPath": "/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/cli/bin/n8n", "args": [], "flags": { }, "file": "cli-parser.js", "function": "parse" }
15:28:11.562 info Initializing n8n process { "file": "start.js", "function": "init" }
15:28:11.633 debug Lazy-loading nodes and credentials from n8n-nodes-base { "nodes": 482, "credentials": 385, "file": "lazy-package-directory-loader.js", "function": "loadAll" }
15:28:11.639 debug Lazy-loading nodes and credentials from @n8n/n8n-nodes-langchain { "nodes": 101, "credentials": 23, "file": "lazy-package-directory-loader.js", "function": "loadAll" }
15:28:11.753 info n8n ready on ::, port 5678 { "file": "abstract-server.js", "function": "init" }
15:28:11.777 info n8n Task Broker ready on 127.0.0.1, port 5679 { "file": "task-broker-server.js", "function": "setupHttpServer" }
15:28:11.829 info Initializing AuthRolesService... { "file": "auth.roles.service.js", "function": "init" }
15:28:11.836 debug No scopes to update. { "file": "auth.roles.service.js", "function": "syncScopes" }
15:28:11.843 debug No global roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
15:28:11.844 debug No project roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
15:28:11.844 debug No credential roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
15:28:11.844 debug No workflow roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
15:28:11.844 info AuthRolesService initialized successfully. { "file": "auth.roles.service.js", "function": "init" }
15:28:11.846 debug [license SDK] initializing for deviceFingerprint ae3350da9cb7f10f65d772716d59f5bd404f92cc574010d8d1736b89b12fb451 { "scopes": ["license"], "file": "LicenseManager.js", "function": "log" }
15:28:11.848 info [license SDK] Skipping renewal on init: license cert is not initialized { "scopes": ["license"], "file": "LicenseManager.js", "function": "log" }
15:28:11.848 debug License initialized { "scopes": ["license"], "file": "license.js", "function": "init" }
15:28:11.848 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
15:28:11.849 debug Started tracking waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "startTracking" }
15:28:11.849 debug Wait tracker init complete { "file": "start.js", "function": "init" }
15:28:11.851 debug Binary data service init complete { "file": "start.js", "function": "init" }
15:28:11.851 debug Data deduplication service init complete { "file": "start.js", "function": "init" }
15:28:11.852 debug External hooks init complete { "file": "start.js", "function": "init" }
15:28:11.852 debug Workflow history init complete { "file": "start.js", "function": "init" }
15:28:11.855 debug Test runner cleanup complete { "file": "start.js", "function": "init" }
15:28:12.245 debug Started flushing timer { "scopes": ["insights"], "file": "insights-collection.service.js", "function": "startFlushingTimer" }
15:28:12.245 debug Started compaction timer { "scopes": ["insights"], "file": "insights-compaction.service.js", "function": "startCompactionTimer" }
15:28:12.245 debug Started pruning timer { "scopes": ["insights"], "file": "insights-pruning.service.js", "function": "startPruningTimer" }
15:28:12.245 debug Initialized module "insights" { "file": "module-registry.js", "function": "initModules" }
15:28:12.245 debug Skipped init for unlicensed module "external-secrets" { "file": "module-registry.js", "function": "initModules" }
15:28:12.248 debug Initialized module "community-packages" { "file": "module-registry.js", "function": "initModules" }
15:28:12.663 info Registered runner "JS Task Runner" (3G5_GxmpWdyA8rSpLiYT0)  { "file": "task-broker-ws-server.js", "function": "onMessage" }
15:28:12.951 debug OIDC login is disabled. { "file": "oidc.service.ee.js", "function": "init" }
15:28:12.971 debug Initializing event bus... { "file": "message-event-bus.js", "function": "initialize" }
15:28:12.974 debug Initializing event writer { "file": "message-event-bus.js", "function": "initialize" }
15:28:12.975 debug Checking for unsent event messages { "file": "message-event-bus.js", "function": "initialize" }
15:28:12.976 debug Start logging into /Users/xiaoqi/.n8n/n8nEventLog.log  { "file": "message-event-bus.js", "function": "initialize" }
15:28:12.977 debug MessageEventBus initialized { "file": "message-event-bus.js", "function": "initialize" }
15:28:12.977 info Version: 1.109.2 { "file": "abstract-server.js", "function": "start" }
15:28:12.978 info Locale: zh-CN { "file": "abstract-server.js", "function": "start" }
15:28:12.978 debug Server ID: main-B8vKucS2vNrm2HFN { "file": "server.js", "function": "start" }
15:28:12.978 debug Soft-deletion every 60 minutes { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "scheduleRollingSoftDeletions" }
15:28:12.978 debug Hard-deletion in next 15 minutes { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "scheduleNextHardDeletion" }
15:28:12.978 debug Started pruning timers { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "startPruning" }
2025-09-11T07:28:12.980Z [Rudder] debug: in flush
2025-09-11T07:28:12.981Z [Rudder] debug: no existing flush timer, creating new one
15:28:13.006 info 
Editor is now accessible via:
http://192.168.2.90:5678 { "file": "base-command.js", "function": "log" }
15:28:16.129 debug Skipped browserId check on /rest/push { "file": "auth.service.js", "function": "resolveJwt" }
15:28:16.130 debug Add editor-UI session { "pushRef": "9pqpx0tz24", "file": "abstract.push.js", "function": "add" }
2025-09-11T07:28:22.983Z [Rudder] debug: in flush
2025-09-11T07:28:22.984Z [Rudder] debug: cancelling existing flushTimer...
15:29:11.848 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
(node:2116) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
15:30:11.847 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
2025-09-11T07:31:10.881Z [Rudder] debug: no existing flush timer, creating new one
15:31:11.599 debug Skipped browserId check on /rest/push { "file": "auth.service.js", "function": "resolveJwt" }
15:31:11.599 debug Add editor-UI session { "pushRef": "f8wwyvn8h5", "file": "abstract.push.js", "function": "add" }
15:31:11.847 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
2025-09-11T07:31:20.882Z [Rudder] debug: in flush
2025-09-11T07:31:20.882Z [Rudder] debug: cancelling existing flushTimer...
15:32:11.849 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
15:33:11.851 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
15:34:11.851 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
15:35:11.852 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
15:36:11.852 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
sh: line 1: 2116 Killed: 9 ./n8n
ELIFECYCLE Command failed with exit code 137.

View File

@@ -0,0 +1,64 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
17:18:33.626 warn Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false. { "file": "instance-settings.js", "function": "ensureSettingsFilePermissions" }
17:18:33.628 debug User settings loaded from: /Users/xiaoqi/.n8n/config { "file": "instance-settings.js", "function": "loadOrCreate" }
17:18:34.634 debug Received CLI command { "execPath": "/Users/xiaoqi/.nvm/versions/node/v22.18.0/bin/node", "scriptPath": "/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/cli/bin/n8n", "args": [], "flags": { }, "file": "cli-parser.js", "function": "parse" }
17:18:34.636 info Initializing n8n process { "file": "start.js", "function": "init" }
17:18:34.705 debug Lazy-loading nodes and credentials from n8n-nodes-base { "nodes": 482, "credentials": 385, "file": "lazy-package-directory-loader.js", "function": "loadAll" }
17:18:34.712 debug Lazy-loading nodes and credentials from @n8n/n8n-nodes-langchain { "nodes": 101, "credentials": 23, "file": "lazy-package-directory-loader.js", "function": "loadAll" }
17:18:34.834 info n8n ready on ::, port 5678 { "file": "abstract-server.js", "function": "init" }
17:18:34.858 info n8n Task Broker ready on 127.0.0.1, port 5679 { "file": "task-broker-server.js", "function": "setupHttpServer" }
17:18:34.902 info Initializing AuthRolesService... { "file": "auth.roles.service.js", "function": "init" }
17:18:34.906 debug No scopes to update. { "file": "auth.roles.service.js", "function": "syncScopes" }
17:18:34.912 debug No global roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:18:34.912 debug No project roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:18:34.912 debug No credential roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:18:34.912 debug No workflow roles to update. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:18:34.912 info AuthRolesService initialized successfully. { "file": "auth.roles.service.js", "function": "init" }
17:18:34.913 debug [license SDK] initializing for deviceFingerprint ae3350da9cb7f10f65d772716d59f5bd404f92cc574010d8d1736b89b12fb451 { "scopes": ["license"], "file": "LicenseManager.js", "function": "log" }
17:18:34.914 info [license SDK] Skipping renewal on init: license cert is not initialized { "scopes": ["license"], "file": "LicenseManager.js", "function": "log" }
17:18:34.914 debug License initialized { "scopes": ["license"], "file": "license.js", "function": "init" }
17:18:34.914 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
17:18:34.915 debug Started tracking waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "startTracking" }
17:18:34.915 debug Wait tracker init complete { "file": "start.js", "function": "init" }
17:18:34.917 debug Binary data service init complete { "file": "start.js", "function": "init" }
17:18:34.917 debug Data deduplication service init complete { "file": "start.js", "function": "init" }
17:18:34.917 debug External hooks init complete { "file": "start.js", "function": "init" }
17:18:34.917 debug Workflow history init complete { "file": "start.js", "function": "init" }
17:18:34.919 debug Test runner cleanup complete { "file": "start.js", "function": "init" }
17:18:35.232 debug Started flushing timer { "scopes": ["insights"], "file": "insights-collection.service.js", "function": "startFlushingTimer" }
17:18:35.233 debug Started compaction timer { "scopes": ["insights"], "file": "insights-compaction.service.js", "function": "startCompactionTimer" }
17:18:35.233 debug Started pruning timer { "scopes": ["insights"], "file": "insights-pruning.service.js", "function": "startPruningTimer" }
17:18:35.233 debug Initialized module "insights" { "file": "module-registry.js", "function": "initModules" }
17:18:35.233 debug Skipped init for unlicensed module "external-secrets" { "file": "module-registry.js", "function": "initModules" }
17:18:35.236 debug Initialized module "community-packages" { "file": "module-registry.js", "function": "initModules" }
17:18:35.532 info Registered runner "JS Task Runner" (6ddx_e3bRtA0JIeFrYegv)  { "file": "task-broker-ws-server.js", "function": "onMessage" }
17:18:35.705 debug OIDC login is disabled. { "file": "oidc.service.ee.js", "function": "init" }
17:18:35.727 debug Initializing event bus... { "file": "message-event-bus.js", "function": "initialize" }
17:18:35.730 debug Initializing event writer { "file": "message-event-bus.js", "function": "initialize" }
17:18:35.731 debug Checking for unsent event messages { "file": "message-event-bus.js", "function": "initialize" }
17:18:35.746 debug Start logging into /Users/xiaoqi/.n8n/n8nEventLog.log  { "file": "message-event-bus.js", "function": "initialize" }
17:18:35.747 debug MessageEventBus initialized { "file": "message-event-bus.js", "function": "initialize" }
17:18:35.748 info Version: 1.109.2 { "file": "abstract-server.js", "function": "start" }
17:18:35.748 info Locale: zh-CN { "file": "abstract-server.js", "function": "start" }
17:18:35.748 debug Server ID: main-j8W4blAUcFAaagOo { "file": "server.js", "function": "start" }
17:18:35.748 debug Soft-deletion every 60 minutes { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "scheduleRollingSoftDeletions" }
17:18:35.748 debug Hard-deletion in next 15 minutes { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "scheduleNextHardDeletion" }
17:18:35.748 debug Started pruning timers { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "startPruning" }
2025-09-11T09:18:35.750Z [Rudder] debug: in flush
2025-09-11T09:18:35.751Z [Rudder] debug: no existing flush timer, creating new one
17:18:35.776 info 
Editor is now accessible via:
http://192.168.2.90:5678 { "file": "base-command.js", "function": "log" }
17:18:40.207 debug Skipped browserId check on /rest/push { "file": "auth.service.js", "function": "resolveJwt" }
17:18:40.208 debug Add editor-UI session { "pushRef": "9pqpx0tz24", "file": "abstract.push.js", "function": "add" }
2025-09-11T09:18:45.752Z [Rudder] debug: in flush
2025-09-11T09:18:45.752Z [Rudder] debug: cancelling existing flushTimer...
(node:88836) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

View File

@@ -0,0 +1,288 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
17:20:48.648 warn Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false. { "file": "instance-settings.js", "function": "ensureSettingsFilePermissions" }
17:20:48.649 debug User settings loaded from: /Users/xiaoqi/.n8n/config { "file": "instance-settings.js", "function": "loadOrCreate" }
17:20:49.385 debug Received CLI command { "execPath": "/Users/xiaoqi/.nvm/versions/node/v22.18.0/bin/node", "scriptPath": "/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2/packages/cli/bin/n8n", "args": [], "flags": { }, "file": "cli-parser.js", "function": "parse" }
17:20:49.387 info Initializing n8n process { "file": "start.js", "function": "init" }
17:20:49.450 debug Lazy-loading nodes and credentials from n8n-nodes-base { "nodes": 482, "credentials": 385, "file": "lazy-package-directory-loader.js", "function": "loadAll" }
17:20:49.456 debug Lazy-loading nodes and credentials from @n8n/n8n-nodes-langchain { "nodes": 101, "credentials": 23, "file": "lazy-package-directory-loader.js", "function": "loadAll" }
17:20:49.562 info n8n ready on ::, port 5678 { "file": "abstract-server.js", "function": "init" }
17:20:49.570 warn Migrations in progress, please do NOT stop the process. { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.570 info Starting migration InitialMigration1588102412422 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.571 info Finished migration InitialMigration1588102412422 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.573 info Starting migration WebhookModel1592445003908 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.574 info Finished migration WebhookModel1592445003908 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.574 info Starting migration CreateIndexStoppedAt1594825041918 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.575 info Finished migration CreateIndexStoppedAt1594825041918 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.575 info Starting migration MakeStoppedAtNullable1607431743769 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.575 info Finished migration MakeStoppedAtNullable1607431743769 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.576 info Starting migration AddWebhookId1611071044839 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.577 info Finished migration AddWebhookId1611071044839 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.578 info Starting migration CreateTagEntity1617213344594 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.580 info Finished migration CreateTagEntity1617213344594 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.581 info Starting migration UniqueWorkflowNames1620821879465 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.581 info Finished migration UniqueWorkflowNames1620821879465 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.582 info Starting migration AddWaitColumn1621707690587 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.583 info Finished migration AddWaitColumn1621707690587 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.583 info Starting migration UpdateWorkflowCredentials1630330987096 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.584 info Finished migration UpdateWorkflowCredentials1630330987096 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.585 info Starting migration AddExecutionEntityIndexes1644421939510 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.585 info Finished migration AddExecutionEntityIndexes1644421939510 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.586 info Starting migration CreateUserManagement1646992772331 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.588 info Finished migration CreateUserManagement1646992772331 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.589 info Starting migration LowerCaseUserEmail1648740597343 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.589 info Finished migration LowerCaseUserEmail1648740597343 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.589 info Starting migration CommunityNodes1652254514001 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.589 info Finished migration CommunityNodes1652254514001 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.590 info Starting migration AddUserSettings1652367743993 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.591 info Finished migration AddUserSettings1652367743993 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.591 info Starting migration AddAPIKeyColumn1652905585850 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.592 info Finished migration AddAPIKeyColumn1652905585850 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.593 info Starting migration IntroducePinData1654089251344 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.593 info Finished migration IntroducePinData1654089251344 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.594 info Starting migration AddNodeIds1658930531669 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.594 info Finished migration AddNodeIds1658930531669 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.594 info Starting migration AddJsonKeyPinData1659888469333 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.594 info Finished migration AddJsonKeyPinData1659888469333 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.595 info Starting migration CreateCredentialsUserRole1660062385367 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.595 info Finished migration CreateCredentialsUserRole1660062385367 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.595 info Starting migration CreateWorkflowsEditorRole1663755770892 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.595 info Finished migration CreateWorkflowsEditorRole1663755770892 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.596 info Starting migration WorkflowStatistics1664196174000 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.596 info Finished migration WorkflowStatistics1664196174000 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.597 info Starting migration CreateCredentialUsageTable1665484192211 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.597 info Finished migration CreateCredentialUsageTable1665484192211 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.597 info Starting migration RemoveCredentialUsageTable1665754637024 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.597 info Finished migration RemoveCredentialUsageTable1665754637024 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.598 info Starting migration AddWorkflowVersionIdColumn1669739707124 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.598 info Finished migration AddWorkflowVersionIdColumn1669739707124 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.598 info Starting migration AddTriggerCountColumn1669823906993 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.599 info Finished migration AddTriggerCountColumn1669823906993 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.599 info Starting migration MessageEventBusDestinations1671535397530 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.599 info Finished migration MessageEventBusDestinations1671535397530 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.600 info Starting migration RemoveWorkflowDataLoadedFlag1671726148419 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.600 info Finished migration RemoveWorkflowDataLoadedFlag1671726148419 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.601 info Starting migration DeleteExecutionsWithWorkflows1673268682475 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.602 info Finished migration DeleteExecutionsWithWorkflows1673268682475 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.603 info Starting migration AddStatusToExecutions1674138566000 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.603 info Finished migration AddStatusToExecutions1674138566000 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.604 info Starting migration CreateLdapEntities1674509946020 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.604 info Finished migration CreateLdapEntities1674509946020 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.604 info Starting migration PurgeInvalidWorkflowConnections1675940580449 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.605 info Finished migration PurgeInvalidWorkflowConnections1675940580449 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.606 info Starting migration MigrateExecutionStatus1676996103000 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.606 info Finished migration MigrateExecutionStatus1676996103000 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.606 info Starting migration UpdateRunningExecutionStatus1677237073720 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.607 info Finished migration UpdateRunningExecutionStatus1677237073720 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.607 info Starting migration CreateVariables1677501636752 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.607 info Finished migration CreateVariables1677501636752 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.607 info Starting migration CreateExecutionMetadataTable1679416281777 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.608 info Finished migration CreateExecutionMetadataTable1679416281777 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.608 info Starting migration AddUserActivatedProperty1681134145996 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.609 info Finished migration AddUserActivatedProperty1681134145996 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.609 info Starting migration RemoveSkipOwnerSetup1681134145997 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.609 info Finished migration RemoveSkipOwnerSetup1681134145997 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.609 info Starting migration MigrateIntegerKeysToString1690000000002 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.610 debug Pruning was requested, but was not enabled { "file": "1690000000002-MigrateIntegerKeysToString.js", "function": "pruneExecutionsData" }
17:20:49.619 info Finished migration MigrateIntegerKeysToString1690000000002 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.620 info Starting migration SeparateExecutionData1690000000010 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.622 info Finished migration SeparateExecutionData1690000000010 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.622 info Starting migration FixMissingIndicesFromStringIdMigration1690000000020 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.622 info Finished migration FixMissingIndicesFromStringIdMigration1690000000020 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.623 info Starting migration RemoveResetPasswordColumns1690000000030 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.627 info Finished migration RemoveResetPasswordColumns1690000000030 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.628 info Starting migration AddMfaColumns1690000000030 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.630 info Finished migration AddMfaColumns1690000000030 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.630 info Starting migration CreateWorkflowNameIndex1691088862123 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.631 info Finished migration CreateWorkflowNameIndex1691088862123 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.631 info Starting migration CreateWorkflowHistoryTable1692967111175 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.632 info Finished migration CreateWorkflowHistoryTable1692967111175 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.632 info Starting migration ExecutionSoftDelete1693491613982 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.635 info Finished migration ExecutionSoftDelete1693491613982 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.636 info Starting migration DisallowOrphanExecutions1693554410387 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.639 info Finished migration DisallowOrphanExecutions1693554410387 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.641 info Starting migration AddWorkflowMetadata1695128658538 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.642 info Finished migration AddWorkflowMetadata1695128658538 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.643 info Starting migration ModifyWorkflowHistoryNodesAndConnections1695829275184 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.646 info Finished migration ModifyWorkflowHistoryNodesAndConnections1695829275184 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.647 info Starting migration AddGlobalAdminRole1700571993961 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.647 info Finished migration AddGlobalAdminRole1700571993961 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.647 info Starting migration DropRoleMapping1705429061930 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.665 info Finished migration DropRoleMapping1705429061930 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.665 info Starting migration RemoveFailedExecutionStatus1711018413374 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.666 info Finished migration RemoveFailedExecutionStatus1711018413374 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.666 info Starting migration MoveSshKeysToDatabase1711390882123 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.666 info [MoveSshKeysToDatabase1711390882123] No SSH keys in filesystem, skipping { "file": "1711390882123-MoveSshKeysToDatabase.js", "function": "up" }
17:20:49.666 info Finished migration MoveSshKeysToDatabase1711390882123 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.667 info Starting migration RemoveNodesAccess1712044305787 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.668 info Finished migration RemoveNodesAccess1712044305787 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.669 info Starting migration CreateProject1714133768519 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.681 info Finished migration CreateProject1714133768519 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.682 info Starting migration MakeExecutionStatusNonNullable1714133768521 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.684 info Finished migration MakeExecutionStatusNonNullable1714133768521 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.684 info Starting migration AddActivatedAtUserSetting1717498465931 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.685 info Finished migration AddActivatedAtUserSetting1717498465931 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.685 info Starting migration AddConstraintToExecutionMetadata1720101653148 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.687 info Finished migration AddConstraintToExecutionMetadata1720101653148 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.687 info Starting migration CreateInvalidAuthTokenTable1723627610222 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.687 info Finished migration CreateInvalidAuthTokenTable1723627610222 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.688 info Starting migration RefactorExecutionIndices1723796243146 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.689 info Finished migration RefactorExecutionIndices1723796243146 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.689 info Starting migration CreateAnnotationTables1724753530828 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.690 info Finished migration CreateAnnotationTables1724753530828 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.690 info Starting migration AddApiKeysTable1724951148974 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.692 info Finished migration AddApiKeysTable1724951148974 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.693 info Starting migration CreateProcessedDataTable1726606152711 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.693 info Finished migration CreateProcessedDataTable1726606152711 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.694 info Starting migration SeparateExecutionCreationFromStart1727427440136 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.697 info Finished migration SeparateExecutionCreationFromStart1727427440136 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.697 info Starting migration AddMissingPrimaryKeyOnAnnotationTagMapping1728659839644 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.698 info Finished migration AddMissingPrimaryKeyOnAnnotationTagMapping1728659839644 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.698 info Starting migration UpdateProcessedDataValueColumnToText1729607673464 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.702 info Finished migration UpdateProcessedDataValueColumnToText1729607673464 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.703 info Starting migration AddProjectIcons1729607673469 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.705 info Finished migration AddProjectIcons1729607673469 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.705 info Starting migration CreateTestDefinitionTable1730386903556 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.706 info Finished migration CreateTestDefinitionTable1730386903556 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.706 info Starting migration AddDescriptionToTestDefinition1731404028106 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.708 info Finished migration AddDescriptionToTestDefinition1731404028106 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.708 info Starting migration MigrateTestDefinitionKeyToString1731582748663 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.710 info Finished migration MigrateTestDefinitionKeyToString1731582748663 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.711 info Starting migration CreateTestMetricTable1732271325258 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.711 info Finished migration CreateTestMetricTable1732271325258 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.711 info Starting migration CreateTestRun1732549866705 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.712 info Finished migration CreateTestRun1732549866705 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.712 info Starting migration AddMockedNodesColumnToTestDefinition1733133775640 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.713 info Finished migration AddMockedNodesColumnToTestDefinition1733133775640 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.713 info Starting migration AddManagedColumnToCredentialsTable1734479635324 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.714 info Finished migration AddManagedColumnToCredentialsTable1734479635324 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.714 info Starting migration AddStatsColumnsToTestRun1736172058779 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.716 info Finished migration AddStatsColumnsToTestRun1736172058779 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.717 info Starting migration CreateTestCaseExecutionTable1736947513045 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.717 info Finished migration CreateTestCaseExecutionTable1736947513045 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.718 info Starting migration AddErrorColumnsToTestRuns1737715421462 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.719 info Finished migration AddErrorColumnsToTestRuns1737715421462 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.721 info Starting migration CreateFolderTable1738709609940 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.722 info Finished migration CreateFolderTable1738709609940 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.723 info Starting migration CreateAnalyticsTables1739549398681 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.723 info Finished migration CreateAnalyticsTables1739549398681 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.724 info Starting migration UpdateParentFolderIdColumn1740445074052 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.726 info Finished migration UpdateParentFolderIdColumn1740445074052 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.726 info Starting migration RenameAnalyticsToInsights1741167584277 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.729 info Finished migration RenameAnalyticsToInsights1741167584277 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.730 info Starting migration AddScopesColumnToApiKeys1742918400000 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.733 info Finished migration AddScopesColumnToApiKeys1742918400000 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.733 info Starting migration ClearEvaluation1745322634000 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.736 info Finished migration ClearEvaluation1745322634000 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.736 info Starting migration AddWorkflowStatisticsRootCount1745587087521 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.737 info Finished migration AddWorkflowStatisticsRootCount1745587087521 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.737 info Starting migration AddWorkflowArchivedColumn1745934666076 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.738 info Finished migration AddWorkflowArchivedColumn1745934666076 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.739 info Starting migration DropRoleTable1745934666077 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.739 info Finished migration DropRoleTable1745934666077 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.740 info Starting migration AddProjectDescriptionColumn1747824239000 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.740 info Finished migration AddProjectDescriptionColumn1747824239000 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.741 info Starting migration AddLastActiveAtColumnToUser1750252139166 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.741 info Finished migration AddLastActiveAtColumnToUser1750252139166 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.742 info Starting migration AddScopeTables1750252139166 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.742 info Finished migration AddScopeTables1750252139166 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.743 info Starting migration AddRolesTables1750252139167 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.744 info Finished migration AddRolesTables1750252139167 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.744 info Starting migration LinkRoleToUserTable1750252139168 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.749 info Finished migration LinkRoleToUserTable1750252139168 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.750 info Starting migration AddInputsOutputsToTestCaseExecution1752669793000 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.752 info Finished migration AddInputsOutputsToTestCaseExecution1752669793000 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.752 info Starting migration CreateDataStoreTables1754475614601 { "file": "migration-helpers.js", "function": "logMigrationStart" }
17:20:49.753 info Finished migration CreateDataStoreTables1754475614601 { "file": "migration-helpers.js", "function": "logMigrationEnd" }
17:20:49.769 info n8n Task Broker ready on 127.0.0.1, port 5679 { "file": "task-broker-server.js", "function": "setupHttpServer" }
17:20:49.800 info Initializing AuthRolesService... { "file": "auth.roles.service.js", "function": "init" }
17:20:49.801 info Updating 120 scopes... { "file": "auth.roles.service.js", "function": "syncScopes" }
17:20:49.810 info Scopes updated successfully. { "file": "auth.roles.service.js", "function": "syncScopes" }
17:20:49.812 info Updating 3 global roles... { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.820 info global roles updated successfully. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.823 info Updating 4 project roles... { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.828 info project roles updated successfully. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.828 info Updating 2 credential roles... { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.830 info credential roles updated successfully. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.830 info Updating 2 workflow roles... { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.832 info workflow roles updated successfully. { "file": "auth.roles.service.js", "function": "syncRoles" }
17:20:49.832 info AuthRolesService initialized successfully. { "file": "auth.roles.service.js", "function": "init" }
17:20:49.832 debug [license SDK] initializing for deviceFingerprint ae3350da9cb7f10f65d772716d59f5bd404f92cc574010d8d1736b89b12fb451 { "scopes": ["license"], "file": "LicenseManager.js", "function": "log" }
17:20:49.833 info [license SDK] Skipping renewal on init: license cert is not initialized { "scopes": ["license"], "file": "LicenseManager.js", "function": "log" }
17:20:49.833 debug License initialized { "scopes": ["license"], "file": "license.js", "function": "init" }
17:20:49.833 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
17:20:49.834 debug Started tracking waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "startTracking" }
17:20:49.834 debug Wait tracker init complete { "file": "start.js", "function": "init" }
17:20:49.835 debug Binary data service init complete { "file": "start.js", "function": "init" }
17:20:49.835 debug Data deduplication service init complete { "file": "start.js", "function": "init" }
17:20:49.835 debug External hooks init complete { "file": "start.js", "function": "init" }
17:20:49.835 debug Workflow history init complete { "file": "start.js", "function": "init" }
17:20:49.836 debug Test runner cleanup complete { "file": "start.js", "function": "init" }
17:20:50.134 debug Started flushing timer { "scopes": ["insights"], "file": "insights-collection.service.js", "function": "startFlushingTimer" }
17:20:50.134 debug Started compaction timer { "scopes": ["insights"], "file": "insights-compaction.service.js", "function": "startCompactionTimer" }
17:20:50.135 debug Started pruning timer { "scopes": ["insights"], "file": "insights-pruning.service.js", "function": "startPruningTimer" }
17:20:50.135 debug Initialized module "insights" { "file": "module-registry.js", "function": "initModules" }
17:20:50.135 debug Skipped init for unlicensed module "external-secrets" { "file": "module-registry.js", "function": "initModules" }
17:20:50.137 debug Initialized module "community-packages" { "file": "module-registry.js", "function": "initModules" }
17:20:50.533 info Registered runner "JS Task Runner" (_jpYCeYiputJbJjKgp9_L)  { "file": "task-broker-ws-server.js", "function": "onMessage" }
17:20:50.534 debug OIDC login is disabled. { "file": "oidc.service.ee.js", "function": "init" }
17:20:50.597 debug Initializing event bus... { "file": "message-event-bus.js", "function": "initialize" }
17:20:50.598 debug Initializing event writer { "file": "message-event-bus.js", "function": "initialize" }
17:20:50.600 debug Checking for unsent event messages { "file": "message-event-bus.js", "function": "initialize" }
17:20:50.601 debug Start logging into /Users/xiaoqi/.n8n/n8nEventLog.log  { "file": "message-event-bus.js", "function": "initialize" }
17:20:50.601 debug MessageEventBus initialized { "file": "message-event-bus.js", "function": "initialize" }
17:20:50.602 info Version: 1.109.2 { "file": "abstract-server.js", "function": "start" }
17:20:50.602 info Locale: zh-CN { "file": "abstract-server.js", "function": "start" }
17:20:50.602 debug Server ID: main-CzyJ1d0MkDl62WYs { "file": "server.js", "function": "start" }
17:20:50.603 debug Soft-deletion every 60 minutes { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "scheduleRollingSoftDeletions" }
17:20:50.603 debug Hard-deletion in next 15 minutes { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "scheduleNextHardDeletion" }
17:20:50.603 debug Started pruning timers { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "startPruning" }
2025-09-11T09:20:50.604Z [Rudder] debug: in flush
2025-09-11T09:20:50.605Z [Rudder] debug: no existing flush timer, creating new one
17:20:50.629 info 
Editor is now accessible via:
http://192.168.2.90:5678 { "file": "base-command.js", "function": "log" }
2025-09-11T09:21:00.606Z [Rudder] debug: in flush
2025-09-11T09:21:00.607Z [Rudder] debug: cancelling existing flushTimer...
(node:96237) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
17:21:49.834 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
17:22:49.836 debug Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
17:23:29.331 info Received SIGTERM. Shutting down... { "file": "base-command.js" }
17:23:29.332 debug Shutting down component "License.shutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "Push.onShutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "ActiveWorkflowManager.removeAllTriggerAndPollerBasedWorkflows()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "AbstractServer.onShutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "ChatService.shutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "ChatServer.shutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "ExecutionsPruningService.shutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Stopped pruning timers { "scopes": ["pruning"], "file": "executions-pruning.service.js", "function": "stopPruning" }
17:23:29.332 debug Shutting down component "InsightsModule.shutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "ExternalSecretsModule.shutdown()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.332 debug Shutting down component "TaskRunnerModule.stop()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
17:23:29.333 debug Shutting down component "TaskRunnerProcess.stop()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
ELIFECYCLE Command failed.
17:23:29.367 debug License shut down { "scopes": ["license"], "file": "license.js", "function": "shutdown" }
17:23:29.367 debug Stopped flushing timer { "scopes": ["insights"], "file": "insights-collection.service.js", "function": "stopFlushingTimer" }
17:23:29.367 debug Flushing remaining insights before shutdown { "scopes": ["insights"], "file": "insights-collection.service.js", "function": "shutdown" }
17:23:29.367 debug External secrets manager shut down { "scopes": ["external-secrets"], "file": "external-secrets-manager.ee.js", "function": "shutdown" }
17:23:29.368 debug Stopped compaction timer { "scopes": ["insights"], "file": "insights-compaction.service.js", "function": "stopCompactionTimer" }
17:23:29.368 debug Stopped pruning timer { "scopes": ["insights"], "file": "insights-pruning.service.js", "function": "stopPruningTimer" }
17:23:29.368 debug Deregistered runner "_jpYCeYiputJbJjKgp9_L" { "file": "task-broker-ws-server.js", "function": "removeConnection" }
17:23:29.368 info [Task Runner]: Received SIGTERM signal, shutting down... { "scopes": ["task-runner"], "file": "forward-to-logger.js" }
17:23:29.369 info [Task Runner]: Task runner stopped { "scopes": ["task-runner"], "file": "forward-to-logger.js" }
17:23:29.372 debug Shutting down component "Telemetry.stopTracking()" { "file": "shutdown.service.js", "function": "shutdownComponent" }
2025-09-11T09:23:29.373Z [Rudder] debug: in flush
2025-09-11T09:23:29.373Z [Rudder] debug: queue is empty, but a flush already exists
17:23:29.374 info 
Stopping n8n... { "file": "start.js", "function": "stopProcess" }
17:23:29.374 debug Stopped tracking waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "stopTracking" }
2025-09-11T09:23:29.374Z [Rudder] debug: no existing flush timer, creating new one
17:23:29.374 debug Shutting down event writer... { "file": "message-event-bus.js", "function": "close" }
17:23:29.376 debug EventBus shut down. { "file": "message-event-bus.js", "function": "close" }

View File

@@ -0,0 +1,23 @@
> n8n-monorepo@1.109.2 start /Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/n8n-n8n-1.109.2
> run-script-os
> n8n-monorepo@1.109.2 start:default
> cd packages/cli/bin && ./n8n
Permissions 0644 for n8n settings file /Users/xiaoqi/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Initializing AuthRolesService...
AuthRolesService initialized successfully.
[license SDK] Skipping renewal on init: license cert is not initialized
Registered runner "JS Task Runner" (0K_a3KeF4PxVhGtRq-MW_)
Version: 1.109.2
Locale: zh-CN
Editor is now accessible via:
http://192.168.2.90:5678
(node:89507) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

248
n8n-n8n-1.109.2/start-demo.sh Executable file
View File

@@ -0,0 +1,248 @@
#!/bin/bash
# n8n 演示模式启动脚本 - 完全跳过设置
# 仅用于演示和测试
set -e
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# 打印函数
print_info() { echo -e "${BLUE}[信息]${NC} $1"; }
print_success() { echo -e "${GREEN}[成功]${NC} $1"; }
print_warning() { echo -e "${YELLOW}[警告]${NC} $1"; }
print_error() { echo -e "${RED}[错误]${NC} $1"; }
# 获取局域网IP
get_lan_ip() {
if [[ "$OSTYPE" == "darwin"* ]]; then
ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}'
else
hostname -I | awk '{print $1}'
fi
}
# 停止现有进程
stop_existing() {
print_info "正在停止现有的 n8n 进程..."
pkill -f "n8n" 2>/dev/null || true
pkill -f "pnpm" 2>/dev/null || true
sleep 2
print_success "已清理现有进程"
}
# 创建预配置的数据库
setup_demo_database() {
print_info "设置演示数据库..."
# 备份现有数据库
if [ -f "$HOME/.n8n/database.sqlite" ]; then
cp "$HOME/.n8n/database.sqlite" "$HOME/.n8n/database.sqlite.backup.$(date +%Y%m%d%H%M%S)"
print_info "已备份现有数据库"
fi
# 创建配置文件
mkdir -p "$HOME/.n8n"
# 创建一个已初始化的配置
cat > "$HOME/.n8n/config" << 'EOF'
{
"instanceId": "demo-instance",
"version": "1.109.2",
"isNpmAvailable": false,
"skipOwnerSetup": true
}
EOF
print_success "演示配置已创建"
}
# 主函数
main() {
echo -e "${BLUE}╔════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ n8n 演示模式启动脚本 ║${NC}"
echo -e "${BLUE}╚════════════════════════════════════════╝${NC}"
echo
# 切换到n8n目录
cd "$(dirname "$0")"
# 停止现有进程
stop_existing
# 设置演示数据库
setup_demo_database
# 获取IP地址
LAN_IP=$(get_lan_ip)
if [ -z "$LAN_IP" ]; then
print_error "无法获取局域网IP地址"
exit 1
fi
print_success "检测到局域网IP: $LAN_IP"
# 设置环境变量 - 演示模式
print_info "配置演示模式环境变量..."
# 基础配置
export N8N_DEFAULT_LOCALE=zh-CN
export N8N_HOST=0.0.0.0
export N8N_PORT=5678
export N8N_LOG_LEVEL=error # 只显示错误,减少日志
# URL配置
export N8N_EDITOR_BASE_URL="http://${LAN_IP}:5678"
export WEBHOOK_URL="http://${LAN_IP}:5678"
export N8N_PROTOCOL=http
# 完全跳过认证和设置
export N8N_BASIC_AUTH_ACTIVE=false
export N8N_AUTH_EXCLUDE_ENDPOINTS="/**"
export N8N_USER_MANAGEMENT_DISABLED=true
export N8N_SKIP_OWNER_SETUP=true
export N8N_DEPLOYMENT_TYPE=demo
export N8N_PUBLIC_API_DISABLED=false
export N8N_PUBLIC_API_ENDPOINT="http://${LAN_IP}:5678/api"
# Cookie和Session配置 - 最宽松
export N8N_SECURE_COOKIE=false
export N8N_SESSION_COOKIE_SAME_SITE=none
export N8N_SESSION_COOKIE_SECURE=false
export N8N_SESSION_COOKIE_DOMAIN=""
# CORS配置 - 允许所有
export N8N_CORS_ENABLED=true
export N8N_CORS_ORIGINS="*"
export N8N_CORS_ALLOW_HEADERS="*"
export N8N_CORS_ALLOW_METHODS="*"
export N8N_CORS_ALLOW_CREDENTIALS=true
# WebSocket配置
export N8N_PUSH_BACKEND=websocket
# 性能优化
export N8N_RUNNERS_ENABLED=true
export N8N_BLOCK_ENV_ACCESS_IN_NODE=false
export DB_SQLITE_POOL_SIZE=10
export N8N_WORKFLOW_TAGS_DISABLED=false
export N8N_PERSONALIZATION_ENABLED=false
export N8N_DIAGNOSTICS_ENABLED=false
export N8N_VERSION_NOTIFICATIONS_ENABLED=false
# 禁用遥测
export N8N_DIAGNOSTICS_DISABLED=true
export N8N_TELEMETRY_DISABLED=true
print_success "演示环境变量配置完成"
# 创建演示配置文件
cat > .env.demo << EOF
# n8n 演示模式配置
N8N_DEFAULT_LOCALE=zh-CN
N8N_HOST=0.0.0.0
N8N_PORT=5678
N8N_EDITOR_BASE_URL=http://${LAN_IP}:5678
WEBHOOK_URL=http://${LAN_IP}:5678
N8N_PROTOCOL=http
# 跳过所有认证和设置
N8N_BASIC_AUTH_ACTIVE=false
N8N_AUTH_EXCLUDE_ENDPOINTS=/**
N8N_USER_MANAGEMENT_DISABLED=true
N8N_SKIP_OWNER_SETUP=true
# CORS配置
N8N_CORS_ENABLED=true
N8N_CORS_ORIGINS=*
N8N_CORS_ALLOW_CREDENTIALS=true
# 禁用遥测
N8N_DIAGNOSTICS_DISABLED=true
N8N_TELEMETRY_DISABLED=true
EOF
print_info "已生成配置文件 .env.demo"
# 检查构建状态
if [ ! -d "packages/cli/dist" ]; then
print_warning "项目需要构建,正在构建..."
pnpm build > build.log 2>&1 || {
print_error "构建失败,查看 build.log"
exit 1
}
fi
# 启动n8n
print_info "正在启动 n8n 演示模式..."
# 创建日志文件
LOG_FILE="n8n-demo-$(date +%Y%m%d-%H%M%S).log"
# 启动命令(带错误过滤)
pnpm start 2>&1 | grep -v "401" | grep -v "Unauthorized" | tee "$LOG_FILE" &
N8N_PID=$!
# 等待启动
echo -n "等待服务启动"
for i in {1..30}; do
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
break
fi
echo -n "."
sleep 1
done
echo
# 检查启动状态
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
print_success "n8n 演示模式启动成功!"
echo
echo -e "${GREEN}╔════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ n8n 演示模式 ║${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 🏠 本地访问:"
echo -e "${GREEN}${NC} ${BLUE}http://localhost:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 🌐 局域网访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 📱 移动设备访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} ✅ 无需注册或登录"
echo -e "${GREEN}${NC} ✅ 直接创建工作流"
echo -e "${GREEN}${NC} ✅ 适合演示和测试"
echo -e "${GREEN}${NC} ⚠️ 仅用于开发环境"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 进程PID: ${YELLOW}$N8N_PID${NC}"
echo -e "${GREEN}${NC} 日志文件: ${YELLOW}$LOG_FILE${NC}"
echo -e "${GREEN}${NC} 界面语言: 中文"
echo -e "${GREEN}╚════════════════════════════════════════╝${NC}"
echo
print_success "所有设置已完成,无需任何认证即可使用!"
echo
print_info "按 Ctrl+C 停止服务"
# 捕获退出信号
trap 'print_info "正在停止 n8n..."; kill $N8N_PID 2>/dev/null; exit 0' INT
# 保持运行
wait $N8N_PID
else
print_error "n8n 启动失败"
echo "查看日志: $LOG_FILE"
tail -20 "$LOG_FILE"
exit 1
fi
}
# 运行
main "$@"

221
n8n-n8n-1.109.2/start-final.sh Executable file
View File

@@ -0,0 +1,221 @@
#!/bin/bash
# n8n 最终无认证启动脚本
# 完全跳过所有认证和设置
set -e
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# 打印函数
print_info() { echo -e "${BLUE}[信息]${NC} $1"; }
print_success() { echo -e "${GREEN}[成功]${NC} $1"; }
print_warning() { echo -e "${YELLOW}[警告]${NC} $1"; }
print_error() { echo -e "${RED}[错误]${NC} $1"; }
# 获取局域网IP
get_lan_ip() {
if [[ "$OSTYPE" == "darwin"* ]]; then
ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}'
else
hostname -I | awk '{print $1}'
fi
}
# 主函数
main() {
echo -e "${BLUE}╔════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ n8n 无认证模式启动 ║${NC}"
echo -e "${BLUE}╚════════════════════════════════════════╝${NC}"
echo
# 切换到n8n目录
cd "$(dirname "$0")"
# 停止所有现有进程
print_info "停止现有 n8n 进程..."
pkill -f "n8n" 2>/dev/null || true
pkill -f "pnpm" 2>/dev/null || true
sleep 2
# 清理旧数据
print_info "清理旧配置和数据..."
rm -f ~/.n8n/config
rm -f ~/.n8n/database.sqlite*
rm -f ~/.n8n/*.json
# 创建必要的目录
mkdir -p ~/.n8n
# 创建预配置文件,跳过所有设置
print_info "创建跳过设置的配置..."
cat > ~/.n8n/.n8n-config << 'EOF'
{
"instanceId": "demo-instance",
"encryptionKey": "n8n-demo-key-2024",
"skipOwnerSetup": true,
"isNpmAvailable": false,
"database": {
"type": "sqlite",
"sqlite": {
"database": "database.sqlite"
}
}
}
EOF
# 获取IP地址
LAN_IP=$(get_lan_ip)
if [ -z "$LAN_IP" ]; then
print_error "无法获取局域网IP地址"
exit 1
fi
print_success "检测到局域网IP: $LAN_IP"
# 构建项目(如果需要)
if [ ! -d "packages/cli/dist" ]; then
print_warning "项目需要构建,正在构建..."
pnpm build > build.log 2>&1 || {
print_error "构建失败"
tail -20 build.log
exit 1
}
print_success "构建完成"
fi
# 设置所有必要的环境变量
print_info "配置环境变量..."
# 导出所有环境变量
export NODE_ENV=production
export N8N_DEFAULT_LOCALE=zh-CN
export N8N_HOST=0.0.0.0
export N8N_PORT=5678
export N8N_PROTOCOL=http
# URL配置
export N8N_EDITOR_BASE_URL="http://${LAN_IP}:5678"
export WEBHOOK_URL="http://${LAN_IP}:5678"
export N8N_WEBHOOK_URL="http://${LAN_IP}:5678"
# 完全禁用认证
export N8N_BASIC_AUTH_ACTIVE=false
export N8N_USER_MANAGEMENT_DISABLED=true
export N8N_SKIP_OWNER_SETUP=true
export N8N_AUTH_SKIP_OWNER_SETUP=true
export N8N_DEPLOYMENT_TYPE=n8n-internal
export N8N_PERSONALIZATION_ENABLED=false
# 禁用所有安全检查
export N8N_SECURE_COOKIE=false
export N8N_SESSION_COOKIE_SECURE=false
export N8N_SESSION_COOKIE_SAME_SITE=none
export N8N_SESSION_COOKIE_DOMAIN=""
# CORS配置 - 允许所有
export N8N_CORS_ENABLED=true
export N8N_CORS_ORIGINS="*"
export N8N_CORS_ALLOW_HEADERS="*"
export N8N_CORS_ALLOW_METHODS="*"
export N8N_CORS_ALLOW_CREDENTIALS=true
# 加密密钥
export N8N_ENCRYPTION_KEY="n8n-demo-key-2024"
# 公共API
export N8N_PUBLIC_API_DISABLED=false
export N8N_PUBLIC_API_ENDPOINT="http://${LAN_IP}:5678/api"
# 其他配置
export N8N_PUSH_BACKEND=websocket
export N8N_WORKFLOW_TAGS_DISABLED=false
export N8N_DIAGNOSTICS_ENABLED=false
export N8N_VERSION_NOTIFICATIONS_ENABLED=false
export N8N_TELEMETRY_DISABLED=true
export N8N_DIAGNOSTICS_DISABLED=true
export N8N_HIRING_BANNER_ENABLED=false
export N8N_LOG_LEVEL=error
export N8N_LOG_OUTPUT=console
export N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false
# 数据库配置
export DB_TYPE=sqlite
export DB_SQLITE_DATABASE=~/.n8n/database.sqlite
# 任务运行器
export N8N_RUNNERS_ENABLED=true
export N8N_BLOCK_ENV_ACCESS_IN_NODE=false
print_success "环境变量配置完成"
# 创建启动日志
LOG_FILE="n8n-$(date +%Y%m%d-%H%M%S).log"
# 启动n8n
print_info "正在启动 n8n..."
# 直接运行CLI
node packages/cli/bin/n8n 2>&1 | tee "$LOG_FILE" &
N8N_PID=$!
# 等待启动
echo -n "等待服务启动"
for i in {1..30}; do
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
break
fi
echo -n "."
sleep 1
done
echo
# 检查启动状态
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
print_success "n8n 启动成功!"
echo
echo -e "${GREEN}╔════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ n8n 无认证模式运行中 ║${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 🏠 本地访问:"
echo -e "${GREEN}${NC} ${BLUE}http://localhost:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 🌐 局域网访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 📱 移动设备访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} ✅ 无需任何认证"
echo -e "${GREEN}${NC} ✅ 直接创建工作流"
echo -e "${GREEN}${NC} ✅ 支持局域网访问"
echo -e "${GREEN}${NC} ⚠️ 仅用于开发/演示"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 进程PID: ${YELLOW}$N8N_PID${NC}"
echo -e "${GREEN}${NC} 日志文件: ${YELLOW}$LOG_FILE${NC}"
echo -e "${GREEN}╚════════════════════════════════════════╝${NC}"
echo
print_info "按 Ctrl+C 停止服务"
# 捕获退出信号
trap 'print_info "正在停止 n8n..."; kill $N8N_PID 2>/dev/null; exit 0' INT
# 保持运行
wait $N8N_PID
else
print_error "n8n 启动失败"
echo "查看日志: $LOG_FILE"
tail -20 "$LOG_FILE"
exit 1
fi
}
# 运行
main "$@"

224
n8n-n8n-1.109.2/start-lan.sh Executable file
View File

@@ -0,0 +1,224 @@
#!/bin/bash
# n8n 局域网完整访问解决方案
# 解决认证、Cookie和CORS问题
set -e
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# 打印函数
print_info() { echo -e "${BLUE}[信息]${NC} $1"; }
print_success() { echo -e "${GREEN}[成功]${NC} $1"; }
print_warning() { echo -e "${YELLOW}[警告]${NC} $1"; }
print_error() { echo -e "${RED}[错误]${NC} $1"; }
# 获取局域网IP
get_lan_ip() {
if [[ "$OSTYPE" == "darwin"* ]]; then
ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}'
else
hostname -I | awk '{print $1}'
fi
}
# 停止现有进程
stop_existing() {
print_info "正在停止现有的 n8n 进程..."
pkill -f "pnpm.*dev" 2>/dev/null || true
pkill -f "pnpm.*start" 2>/dev/null || true
pkill -f "n8n" 2>/dev/null || true
sleep 2
print_success "已清理现有进程"
}
# 主函数
main() {
print_info "n8n 局域网完整访问解决方案"
# 切换到n8n目录
cd "$(dirname "$0")"
# 停止现有进程
stop_existing
# 获取IP地址
LAN_IP=$(get_lan_ip)
if [ -z "$LAN_IP" ]; then
print_error "无法获取局域网IP地址"
exit 1
fi
print_success "检测到局域网IP: $LAN_IP"
# 设置环境变量 - 修复认证问题的关键配置
print_info "配置认证和会话环境变量..."
# 基础配置
export N8N_DEFAULT_LOCALE=zh-CN
export N8N_HOST=0.0.0.0
export N8N_PORT=5678
export N8N_LOG_LEVEL=debug
# URL配置 - 统一使用IP地址
export N8N_EDITOR_BASE_URL="http://${LAN_IP}:5678"
export WEBHOOK_URL="http://${LAN_IP}:5678"
export N8N_PROTOCOL=http
# 关键:禁用认证(开发环境)
export N8N_BASIC_AUTH_ACTIVE=false
export N8N_AUTH_EXCLUDE_ENDPOINTS="/**"
# Cookie和Session配置 - 关键配置
export N8N_SECURE_COOKIE=false
export N8N_SESSION_COOKIE_SAME_SITE=none
export N8N_SESSION_COOKIE_SECURE=false
export N8N_SESSION_COOKIE_DOMAIN=""
export N8N_SESSION_COOKIE_NAME=n8n.sessionId
# CORS配置 - 允许所有源(开发环境)
export N8N_CORS_ENABLED=true
export N8N_CORS_ORIGINS="*"
export N8N_CORS_ALLOW_HEADERS="*"
export N8N_CORS_ALLOW_METHODS="*"
# WebSocket配置
export N8N_PUSH_BACKEND=websocket
# 其他优化
export N8N_RUNNERS_ENABLED=true
export N8N_BLOCK_ENV_ACCESS_IN_NODE=false
export DB_SQLITE_POOL_SIZE=5
export N8N_SKIP_AUTH_ROUTES=true
export N8N_PUBLIC_API_DISABLED=false
# 创建数据目录(如果不存在)
if [ ! -d "$HOME/.n8n" ]; then
mkdir -p "$HOME/.n8n"
print_info "创建了 n8n 数据目录"
fi
print_success "环境变量配置完成"
# 创建.env文件作为备份
cat > .env.lan << EOF
# n8n 局域网完整访问配置
N8N_DEFAULT_LOCALE=zh-CN
N8N_HOST=0.0.0.0
N8N_PORT=5678
N8N_EDITOR_BASE_URL=http://${LAN_IP}:5678
WEBHOOK_URL=http://${LAN_IP}:5678
N8N_PROTOCOL=http
# 认证配置(开发环境 - 禁用认证)
N8N_BASIC_AUTH_ACTIVE=false
N8N_AUTH_EXCLUDE_ENDPOINTS=/**
N8N_SKIP_AUTH_ROUTES=true
# Cookie配置
N8N_SECURE_COOKIE=false
N8N_SESSION_COOKIE_SAME_SITE=none
N8N_SESSION_COOKIE_SECURE=false
N8N_SESSION_COOKIE_DOMAIN=
# CORS配置开发环境 - 允许所有)
N8N_CORS_ENABLED=true
N8N_CORS_ORIGINS=*
N8N_CORS_ALLOW_HEADERS=*
N8N_CORS_ALLOW_METHODS=*
# WebSocket
N8N_PUSH_BACKEND=websocket
# 其他
N8N_RUNNERS_ENABLED=true
N8N_BLOCK_ENV_ACCESS_IN_NODE=false
DB_SQLITE_POOL_SIZE=5
N8N_PUBLIC_API_DISABLED=false
EOF
print_info "已生成配置文件 .env.lan"
# 检查构建状态
if [ ! -d "packages/cli/dist" ]; then
print_warning "项目需要构建,正在构建..."
pnpm build > build.log 2>&1 || {
print_error "构建失败,查看 build.log"
exit 1
}
fi
# 启动n8n
print_info "正在启动 n8n开发模式无需认证..."
# 创建日志文件
LOG_FILE="n8n-lan-$(date +%Y%m%d-%H%M%S).log"
# 启动命令
pnpm start > "$LOG_FILE" 2>&1 &
N8N_PID=$!
# 等待启动
echo -n "等待服务启动"
for i in {1..30}; do
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
break
fi
echo -n "."
sleep 1
done
echo
# 检查启动状态
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
print_success "n8n 启动成功!"
echo
echo -e "${GREEN}╔════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ n8n 局域网访问信息(开发模式) ║${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 🏠 本地访问:"
echo -e "${GREEN}${NC} ${BLUE}http://localhost:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 🌐 局域网访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 📱 移动设备访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 模式: ${YELLOW}开发模式(无需认证)${NC}"
echo -e "${GREEN}${NC} 进程PID: ${YELLOW}$N8N_PID${NC}"
echo -e "${GREEN}${NC} 日志文件: ${YELLOW}$LOG_FILE${NC}"
echo -e "${GREEN}${NC} 界面语言: 中文"
echo -e "${GREEN}╚════════════════════════════════════════╝${NC}"
echo
print_warning "注意事项:"
echo " ✓ 开发模式已禁用认证,任何人都可以访问"
echo " ✓ 局域网访问直接使用: http://${LAN_IP}:5678"
echo " ✓ 无需登录即可使用"
echo " ✓ 确保防火墙允许 5678 端口"
echo " ✓ 生产环境请勿使用此配置!"
echo
print_info "按 Ctrl+C 停止服务"
# 捕获退出信号
trap 'print_info "正在停止 n8n..."; kill $N8N_PID 2>/dev/null; exit 0' INT
# 显示日志
tail -f "$LOG_FILE"
else
print_error "n8n 启动失败"
echo "查看日志: $LOG_FILE"
tail -20 "$LOG_FILE"
exit 1
fi
}
# 运行
main "$@"

185
n8n-n8n-1.109.2/start-network.sh Executable file
View File

@@ -0,0 +1,185 @@
#!/bin/bash
# n8n 局域网访问优化版启动脚本
# 解决Cookie、CORS和认证问题
set -e
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# 打印函数
print_info() { echo -e "${BLUE}[信息]${NC} $1"; }
print_success() { echo -e "${GREEN}[成功]${NC} $1"; }
print_warning() { echo -e "${YELLOW}[警告]${NC} $1"; }
print_error() { echo -e "${RED}[错误]${NC} $1"; }
# 获取局域网IP
get_lan_ip() {
if [[ "$OSTYPE" == "darwin"* ]]; then
ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}'
else
hostname -I | awk '{print $1}'
fi
}
# 停止现有进程
stop_existing() {
print_info "正在停止现有的 n8n 进程..."
pkill -f "pnpm.*dev" 2>/dev/null || true
pkill -f "pnpm.*start" 2>/dev/null || true
pkill -f "n8n" 2>/dev/null || true
sleep 2
print_success "已清理现有进程"
}
# 主函数
main() {
print_info "n8n 局域网访问配置启动器"
# 切换到n8n目录
cd "$(dirname "$0")"
# 停止现有进程
stop_existing
# 获取IP地址
LAN_IP=$(get_lan_ip)
if [ -z "$LAN_IP" ]; then
print_error "无法获取局域网IP地址"
exit 1
fi
print_success "检测到局域网IP: $LAN_IP"
# 设置环境变量
print_info "配置环境变量..."
# 基础配置
export N8N_DEFAULT_LOCALE=zh-CN
export N8N_HOST=0.0.0.0
export N8N_PORT=5678
# URL配置 - 关键必须设置正确的URL
export N8N_EDITOR_BASE_URL="http://${LAN_IP}:5678"
export WEBHOOK_URL="http://${LAN_IP}:5678"
export N8N_PROTOCOL=http
# Cookie和Session配置
export N8N_SECURE_COOKIE=false
export N8N_SESSION_COOKIE_SAME_SITE=lax
export N8N_SESSION_COOKIE_SECURE=false
# CORS配置
export N8N_CORS_ENABLED=true
export N8N_CORS_ORIGINS="http://localhost:5678,http://${LAN_IP}:5678,http://127.0.0.1:5678"
# 认证配置
export N8N_AUTH_EXCLUDE_ENDPOINTS="rest/health,/healthz,/metrics"
export N8N_PUSH_BACKEND=websocket
# 其他优化
export N8N_RUNNERS_ENABLED=true
export N8N_BLOCK_ENV_ACCESS_IN_NODE=false
export DB_SQLITE_POOL_SIZE=5
print_success "环境变量配置完成"
# 创建.env文件作为备份
cat > .env.network << EOF
# n8n 局域网访问配置
N8N_DEFAULT_LOCALE=zh-CN
N8N_HOST=0.0.0.0
N8N_PORT=5678
N8N_EDITOR_BASE_URL=http://${LAN_IP}:5678
WEBHOOK_URL=http://${LAN_IP}:5678
N8N_PROTOCOL=http
N8N_SECURE_COOKIE=false
N8N_SESSION_COOKIE_SAME_SITE=lax
N8N_SESSION_COOKIE_SECURE=false
N8N_CORS_ENABLED=true
N8N_CORS_ORIGINS=http://localhost:5678,http://${LAN_IP}:5678,http://127.0.0.1:5678
EOF
print_info "已生成配置文件 .env.network"
# 检查构建状态
if [ ! -d "packages/cli/dist" ]; then
print_warning "项目需要构建,正在构建..."
pnpm build > build.log 2>&1 || {
print_error "构建失败,查看 build.log"
exit 1
}
fi
# 启动n8n
print_info "正在启动 n8n..."
# 创建日志文件
LOG_FILE="n8n-network-$(date +%Y%m%d-%H%M%S).log"
# 启动命令
pnpm start > "$LOG_FILE" 2>&1 &
N8N_PID=$!
# 等待启动
echo -n "等待服务启动"
for i in {1..30}; do
if curl -s "http://localhost:5678/rest/health" >/dev/null 2>&1; then
break
fi
echo -n "."
sleep 1
done
echo
# 检查启动状态
if curl -s "http://localhost:5678/rest/health" >/dev/null 2>&1; then
print_success "n8n 启动成功!"
echo
echo -e "${GREEN}╔════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ n8n 局域网访问信息 ║${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 🏠 本地访问:"
echo -e "${GREEN}${NC} ${BLUE}http://localhost:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 🌐 局域网访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 📱 移动设备访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 进程PID: ${YELLOW}$N8N_PID${NC}"
echo -e "${GREEN}${NC} 日志文件: ${YELLOW}$LOG_FILE${NC}"
echo -e "${GREEN}${NC} 界面语言: 中文"
echo -e "${GREEN}╚════════════════════════════════════════╝${NC}"
echo
print_warning "重要提示:"
echo " ✓ 局域网访问请统一使用: http://${LAN_IP}:5678"
echo " ✓ 不要混用 localhost 和 IP 地址"
echo " ✓ 首次访问需要创建管理员账户"
echo " ✓ 确保防火墙允许 5678 端口"
echo
print_info "按 Ctrl+C 停止服务"
# 捕获退出信号
trap 'print_info "正在停止 n8n..."; kill $N8N_PID 2>/dev/null; exit 0' INT
# 显示日志
tail -f "$LOG_FILE"
else
print_error "n8n 启动失败"
echo "查看日志: $LOG_FILE"
tail -20 "$LOG_FILE"
exit 1
fi
}
# 运行
main "$@"

217
n8n-n8n-1.109.2/start-noauth.sh Executable file
View File

@@ -0,0 +1,217 @@
#!/bin/bash
# n8n 完全无认证启动脚本(开发用)
# 警告:仅用于开发环境!
set -e
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# 打印函数
print_info() { echo -e "${BLUE}[信息]${NC} $1"; }
print_success() { echo -e "${GREEN}[成功]${NC} $1"; }
print_warning() { echo -e "${YELLOW}[警告]${NC} $1"; }
print_error() { echo -e "${RED}[错误]${NC} $1"; }
# 获取局域网IP
get_lan_ip() {
if [[ "$OSTYPE" == "darwin"* ]]; then
ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}'
else
hostname -I | awk '{print $1}'
fi
}
# 停止现有进程
stop_existing() {
print_info "正在停止现有的 n8n 进程..."
pkill -f "n8n" 2>/dev/null || true
sleep 2
print_success "已清理现有进程"
}
# 备份并清空用户数据(可选)
handle_auth() {
if [ -f "$HOME/.n8n/database.sqlite" ]; then
print_warning "检测到已存在用户数据库"
echo "选择操作:"
echo "1) 保留现有用户(需要登录)"
echo "2) 备份并重置(无需登录)"
echo "3) 直接使用测试账号"
read -p "请选择 (1/2/3): " choice
case $choice in
2)
print_info "备份现有数据库..."
cp "$HOME/.n8n/database.sqlite" "$HOME/.n8n/database.sqlite.backup.$(date +%Y%m%d%H%M%S)"
rm -f "$HOME/.n8n/database.sqlite"*
print_success "数据库已备份并重置"
;;
3)
print_info "将使用测试账号信息:"
echo -e "${GREEN}邮箱: admin@test.com${NC}"
echo -e "${GREEN}密码: n8n123456${NC}"
;;
*)
print_info "保留现有用户数据"
;;
esac
fi
}
# 主函数
main() {
print_info "n8n 开发环境快速启动(可选无认证)"
# 切换到n8n目录
cd "$(dirname "$0")"
# 停止现有进程
stop_existing
# 处理认证
handle_auth
# 获取IP地址
LAN_IP=$(get_lan_ip)
if [ -z "$LAN_IP" ]; then
print_error "无法获取局域网IP地址"
exit 1
fi
print_success "检测到局域网IP: $LAN_IP"
# 设置环境变量
print_info "配置环境变量..."
# 基础配置
export N8N_DEFAULT_LOCALE=zh-CN
export N8N_HOST=0.0.0.0
export N8N_PORT=5678
export N8N_LOG_LEVEL=info
# URL配置
export N8N_EDITOR_BASE_URL="http://${LAN_IP}:5678"
export WEBHOOK_URL="http://${LAN_IP}:5678"
export N8N_PROTOCOL=http
# 如果没有用户数据库,完全禁用认证
if [ ! -f "$HOME/.n8n/database.sqlite" ]; then
export N8N_BASIC_AUTH_ACTIVE=false
export N8N_AUTH_EXCLUDE_ENDPOINTS="/**"
export N8N_USER_MANAGEMENT_DISABLED=true
print_warning "无用户模式:完全禁用认证"
else
# 有用户数据库保持标准认证但优化CORS
export N8N_USER_MANAGEMENT_DISABLED=false
print_info "标准模式:需要使用账号登录"
fi
# Cookie和Session配置
export N8N_SECURE_COOKIE=false
export N8N_SESSION_COOKIE_SAME_SITE=none
export N8N_SESSION_COOKIE_SECURE=false
# CORS配置
export N8N_CORS_ENABLED=true
export N8N_CORS_ORIGINS="*"
# 其他优化
export N8N_PUSH_BACKEND=websocket
export N8N_RUNNERS_ENABLED=true
export N8N_BLOCK_ENV_ACCESS_IN_NODE=false
export DB_SQLITE_POOL_SIZE=5
print_success "环境变量配置完成"
# 检查构建状态
if [ ! -d "packages/cli/dist" ]; then
print_warning "项目需要构建,正在构建..."
pnpm build > build.log 2>&1 || {
print_error "构建失败,查看 build.log"
exit 1
}
fi
# 启动n8n
print_info "正在启动 n8n..."
# 创建日志文件
LOG_FILE="n8n-dev-$(date +%Y%m%d-%H%M%S).log"
# 启动命令
pnpm start > "$LOG_FILE" 2>&1 &
N8N_PID=$!
# 等待启动
echo -n "等待服务启动"
for i in {1..30}; do
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
break
fi
echo -n "."
sleep 1
done
echo
# 检查启动状态
if curl -s "http://localhost:5678" >/dev/null 2>&1; then
print_success "n8n 启动成功!"
echo
echo -e "${GREEN}╔════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ n8n 开发环境信息 ║${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 🏠 本地访问:"
echo -e "${GREEN}${NC} ${BLUE}http://localhost:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 🌐 局域网访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${LAN_IP}:5678${NC}"
echo -e "${GREEN}${NC}"
if [ ! -f "$HOME/.n8n/database.sqlite" ]; then
echo -e "${GREEN}${NC} 模式: ${YELLOW}无认证模式${NC}"
echo -e "${GREEN}${NC} 说明: 直接访问,无需登录"
else
echo -e "${GREEN}${NC} 模式: ${YELLOW}标准认证模式${NC}"
echo -e "${GREEN}${NC} 说明: 使用已有账号登录"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 测试账号(如果创建过):"
echo -e "${GREEN}${NC} 邮箱: admin@test.com"
echo -e "${GREEN}${NC} 密码: n8n123456"
fi
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 进程PID: ${YELLOW}$N8N_PID${NC}"
echo -e "${GREEN}${NC} 日志文件: ${YELLOW}$LOG_FILE${NC}"
echo -e "${GREEN}${NC} 界面语言: 中文"
echo -e "${GREEN}╚════════════════════════════════════════╝${NC}"
echo
print_warning "提示:"
echo " ✓ 确保防火墙允许 5678 端口"
echo " ✓ 如需重置用户,删除 ~/.n8n/database.sqlite"
echo " ✓ 生产环境请使用标准认证!"
echo
print_info "按 Ctrl+C 停止服务"
# 捕获退出信号
trap 'print_info "正在停止 n8n..."; kill $N8N_PID 2>/dev/null; exit 0' INT
# 显示日志
tail -f "$LOG_FILE"
else
print_error "n8n 启动失败"
echo "查看日志: $LOG_FILE"
tail -20 "$LOG_FILE"
exit 1
fi
}
# 运行
main "$@"

View File

@@ -0,0 +1,322 @@
#!/bin/bash
# n8n 优化版启动脚本 - 解决所有警告
# 作者: 小齐
# 最后更新: 2025-09-11
set -e
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# 打印函数
print_info() { echo -e "${BLUE}[信息]${NC} $1"; }
print_success() { echo -e "${GREEN}[成功]${NC} $1"; }
print_warning() { echo -e "${YELLOW}[警告]${NC} $1"; }
print_error() { echo -e "${RED}[错误]${NC} $1"; }
# 显示启动横幅
show_banner() {
echo -e "${BLUE}"
echo "╔══════════════════════════════════════╗"
echo "║ n8n 中文版优化启动脚本 ║"
echo "║ 版本: n8n-1.109.2 (无警告版) ║"
echo "║ 维护者: xiaoqi ║"
echo "╚══════════════════════════════════════╝"
echo -e "${NC}"
}
# 修复配置文件权限
fix_permissions() {
print_info "检查配置文件权限..."
# 检查并修复 .n8n 目录权限
if [ -d "$HOME/.n8n" ]; then
if [ -f "$HOME/.n8n/config" ]; then
chmod 600 "$HOME/.n8n/config"
print_success "配置文件权限已修复"
fi
else
mkdir -p "$HOME/.n8n"
touch "$HOME/.n8n/config"
chmod 600 "$HOME/.n8n/config"
print_success "创建并设置了配置文件权限"
fi
}
# 检查依赖
check_dependencies() {
print_info "正在检查系统依赖..."
if ! command -v node &> /dev/null; then
print_error "Node.js 未安装或未在 PATH 中"
exit 1
fi
if ! command -v pnpm &> /dev/null; then
print_error "pnpm 未安装或未在 PATH 中"
print_info "请先安装 pnpm: npm install -g pnpm"
exit 1
fi
print_success "依赖检查通过"
}
# 检查端口占用
check_port() {
local port=5678
if lsof -Pi :$port -sTCP:LISTEN -t >/dev/null 2>&1; then
print_warning "端口 $port 已被占用"
print_info "正在查看占用进程..."
lsof -i :$port | head -5
read -p "是否杀死占用进程?(y/N): " kill_process
if [[ $kill_process =~ ^[Yy]$ ]]; then
print_info "正在终止占用进程..."
lsof -ti:$port | xargs kill -9 2>/dev/null || true
sleep 1
print_success "进程已终止"
else
print_error "无法启动 n8n端口被占用"
exit 1
fi
fi
}
# 停止现有的 n8n 进程
stop_existing() {
print_info "正在停止现有的 n8n 进程..."
pkill -f "pnpm.*dev" 2>/dev/null || true
pkill -f "pnpm.*start" 2>/dev/null || true
pkill -f "turbo.*dev" 2>/dev/null || true
pkill -f "n8n" 2>/dev/null || true
sleep 2
print_success "已停止现有进程"
}
# 设置环境变量
setup_environment() {
print_info "正在设置优化的环境变量..."
# 获取局域网IP地址
local lan_ip=""
if [[ "$OSTYPE" == "darwin"* ]]; then
lan_ip=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}')
else
lan_ip=$(hostname -I | awk '{print $1}')
fi
# 基础配置
export N8N_DEFAULT_LOCALE=zh-CN
export N8N_HOST=0.0.0.0
export N8N_PORT=5678
# 权限配置 - 解决权限警告
export N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
# 安全配置
export N8N_SECURE_COOKIE=false
export N8N_SESSION_COOKIE_SAME_SITE=lax
export N8N_SESSION_COOKIE_SECURE=false
# 性能优化
export DB_SQLITE_POOL_SIZE=5
export N8N_RUNNERS_ENABLED=true
export N8N_BLOCK_ENV_ACCESS_IN_NODE=false
# Node.js 优化 - 避免废弃警告
export NODE_NO_WARNINGS=1
export NODE_OPTIONS="--no-deprecation"
# 设置URL
if [ -n "$lan_ip" ]; then
export N8N_EDITOR_BASE_URL="http://${lan_ip}:5678"
export WEBHOOK_URL="http://${lan_ip}:5678"
export N8N_PROTOCOL=http
fi
# CORS配置
export N8N_CORS_ENABLED=true
if [ -n "$lan_ip" ]; then
export N8N_CORS_ORIGINS="http://localhost:5678,http://${lan_ip}:5678,http://127.0.0.1:5678"
fi
print_success "环境变量已优化设置"
echo " - 中文界面: 已启用"
echo " - 权限检查: 已启用"
echo " - 废弃警告: 已禁用"
echo " - 网络监听: 0.0.0.0:5678"
if [ -n "$lan_ip" ]; then
echo " - 局域网IP: ${lan_ip}"
fi
}
# 检查构建状态
check_build() {
if [ ! -d "packages/cli/dist" ] || [ ! -d "packages/core/dist" ]; then
print_warning "检测到项目需要构建"
read -p "是否现在构建项目?(y/N): " build_project
if [[ $build_project =~ ^[Yy]$ ]]; then
print_info "正在构建项目..."
pnpm build > build.log 2>&1 &
BUILD_PID=$!
while kill -0 $BUILD_PID 2>/dev/null; do
echo -n "."
sleep 2
done
echo
if wait $BUILD_PID; then
print_success "项目构建完成"
else
print_error "构建失败,请查看 build.log"
tail -20 build.log
exit 1
fi
fi
fi
}
# 启动 n8n
start_n8n() {
print_info "正在启动优化版 n8n 中文版..."
# 创建日志文件
local log_file="n8n-$(date +%Y%m%d-%H%M%S).log"
# 启动 n8n带优化参数
echo -e "${GREEN}正在启动 n8n 服务(无警告模式)...${NC}"
NODE_NO_WARNINGS=1 NODE_OPTIONS="--no-deprecation" pnpm start > "$log_file" 2>&1 &
N8N_PID=$!
# 等待启动
echo -n "等待 n8n 启动"
for i in {1..30}; do
if curl -s http://localhost:5678 >/dev/null 2>&1; then
break
fi
echo -n "."
sleep 1
done
echo
# 检查是否启动成功
if curl -s http://localhost:5678 >/dev/null 2>&1; then
print_success "n8n 启动成功!"
# 获取局域网IP地址
local lan_ip=""
if [[ "$OSTYPE" == "darwin"* ]]; then
lan_ip=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}')
else
lan_ip=$(hostname -I | awk '{print $1}')
fi
echo
echo -e "${GREEN}╔════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ n8n 启动信息 ║${NC}"
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 📱 本地访问:"
echo -e "${GREEN}${NC} ${BLUE}http://localhost:5678${NC}"
echo -e "${GREEN}${NC}"
if [ -n "$lan_ip" ]; then
echo -e "${GREEN}${NC} 🌐 局域网访问:"
echo -e "${GREEN}${NC} ${BLUE}http://${lan_ip}:5678${NC}"
echo -e "${GREEN}${NC}"
echo -e "${GREEN}${NC} 📌 提示: 统一使用以下地址"
echo -e "${GREEN}${NC} ${BLUE}http://${lan_ip}:5678${NC}"
fi
echo -e "${GREEN}╠════════════════════════════════════════╣${NC}"
echo -e "${GREEN}${NC} 🌏 界面语言: ${GREEN}中文 (zh-CN)${NC}"
echo -e "${GREEN}${NC} 📋 进程 PID: ${YELLOW}$N8N_PID${NC}"
echo -e "${GREEN}${NC} 📝 日志文件: ${YELLOW}$log_file${NC}"
echo -e "${GREEN}${NC} ✅ 无警告模式: ${GREEN}已启用${NC}"
echo -e "${GREEN}╚════════════════════════════════════════╝${NC}"
echo
print_info "使用 Ctrl+C 停止服务"
if [ -n "$lan_ip" ]; then
echo
print_success "优化项:"
echo " ✓ 配置文件权限已修复"
echo " ✓ Node.js 废弃警告已禁用"
echo " ✓ 局域网访问已配置"
echo " ✓ CORS 已正确设置"
fi
# 保持脚本运行并显示日志(过滤警告)
trap 'print_info "正在停止 n8n..."; kill $N8N_PID 2>/dev/null; exit 0' INT
tail -f "$log_file" | grep -v "DeprecationWarning" | grep -v "DEP0060"
else
print_error "n8n 启动失败"
print_info "查看日志文件: $log_file"
tail -20 "$log_file"
exit 1
fi
}
# 检查并切换到正确目录
check_and_change_directory() {
local current_dir="$(pwd)"
local script_path="$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || echo "$0")"
local script_dir="$(dirname "$script_path")"
if [[ -f "package.json" && -d "packages" ]]; then
print_info "检测到当前已在 n8n 项目目录"
return 0
fi
if [[ "$script_dir" == *"n8n-n8n-1.109.2"* ]]; then
print_info "切换到脚本所在的 n8n 项目目录: $script_dir"
cd "$script_dir" || {
print_error "无法切换到目录: $script_dir"
exit 1
}
print_success "已切换到正确的 n8n 项目目录"
return 0
fi
print_error "未找到 n8n 项目目录"
exit 1
}
# 主函数
main() {
# 显示横幅
show_banner
# 检查并切换到正确目录
check_and_change_directory
# 修复权限
fix_permissions
# 检查依赖
check_dependencies
# 检查端口
check_port
# 停止现有进程
stop_existing
# 设置环境变量
setup_environment
# 检查构建状态
check_build
# 正常启动
start_n8n
}
# 运行主函数
main "$@"

View File

@@ -0,0 +1,34 @@
@echo off
echo ================================================
echo Starting n8n with Windows Configuration
echo ================================================
REM 设置环境变量
set N8N_PORT=5678
set N8N_HOST=0.0.0.0
set N8N_PROTOCOL=http
set N8N_CORS_ENABLED=true
set N8N_CORS_ORIGINS=http://localhost:*,http://192.168.*.*:*,http://127.0.0.1:*
set N8N_USER_MANAGEMENT_DISABLED=true
set N8N_SKIP_OWNER_SETUP=true
set N8N_PUSH_BACKEND=websocket
set WEBHOOK_URL=http://localhost:5678
set N8N_DEFAULT_LOCALE=zh-CN
set N8N_LOG_LEVEL=error
set N8N_DIAGNOSTICS_ENABLED=false
set N8N_ENCRYPTION_KEY=your-encryption-key-here
echo.
echo Configuration:
echo - Port: %N8N_PORT%
echo - CORS: Enabled for all local/LAN access
echo - Authentication: Disabled
echo - Language: Chinese
echo - WebSocket: Enabled
echo.
REM 启动 n8n
echo Starting n8n...
pnpm start
pause

View File

@@ -99,16 +99,44 @@ stop_existing() {
setup_environment() {
print_info "正在设置环境变量..."
# 获取局域网IP地址
local lan_ip=""
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
lan_ip=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}')
else
# Linux
lan_ip=$(hostname -I | awk '{print $1}')
fi
export N8N_DEFAULT_LOCALE=zh-CN
export N8N_SECURE_COOKIE=false
export DB_SQLITE_POOL_SIZE=5
export N8N_RUNNERS_ENABLED=true
export N8N_BLOCK_ENV_ACCESS_IN_NODE=false
export N8N_HOST=0.0.0.0
export N8N_PORT=5678
# 设置Webhook URL和Editor URL以支持局域网访问
if [ -n "$lan_ip" ]; then
export N8N_EDITOR_BASE_URL="http://${lan_ip}:5678"
export WEBHOOK_URL="http://${lan_ip}:5678"
export N8N_PROTOCOL=http
fi
# Session和Cookie配置
export N8N_SESSION_COOKIE_SAME_SITE=none
export N8N_SESSION_COOKIE_SECURE=false
print_success "环境变量已设置"
echo " - N8N_DEFAULT_LOCALE=zh-CN"
echo " - N8N_SECURE_COOKIE=false"
echo " - DB_SQLITE_POOL_SIZE=5"
echo " - N8N_HOST=0.0.0.0 (监听所有网络接口)"
echo " - N8N_PORT=5678"
if [ -n "$lan_ip" ]; then
echo " - N8N_EDITOR_BASE_URL=http://${lan_ip}:5678"
fi
echo " - Session配置已优化以支持局域网访问"
}
# 检查构建状态
@@ -166,9 +194,25 @@ start_n8n() {
# 检查是否启动成功
if curl -s http://localhost:5678 >/dev/null 2>&1; then
print_success "n8n 启动成功!"
# 获取局域网IP地址
local lan_ip=""
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
lan_ip=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}')
else
# Linux
lan_ip=$(hostname -I | awk '{print $1}')
fi
echo
echo -e "${GREEN}========== 启动信息 ==========${NC}"
echo -e "📱 访问地址: ${BLUE}http://localhost:5678${NC}"
echo -e "📱 本地访问: ${BLUE}http://localhost:5678${NC}"
if [ -n "$lan_ip" ]; then
echo -e "🌐 局域网访问: ${BLUE}http://${lan_ip}:5678${NC}"
echo -e "📌 提示: 局域网访问请使用 ${BLUE}http://${lan_ip}:5678${NC} 完整地址"
echo -e " 避免使用 localhost 或 127.0.0.1"
fi
echo -e "🌏 界面语言: ${GREEN}中文 (zh-CN)${NC}"
echo -e "📋 进程 PID: ${YELLOW}$N8N_PID${NC}"
echo -e "📝 日志文件: ${YELLOW}$log_file${NC}"
@@ -176,6 +220,14 @@ start_n8n() {
echo
print_info "使用 Ctrl+C 停止服务"
if [ -n "$lan_ip" ]; then
echo
print_warning "局域网访问注意事项:"
echo " 1. 确保防火墙允许 5678 端口"
echo " 2. 首次访问需要创建账户"
echo " 3. 使用同一个IP地址保持登录状态"
fi
# 保持脚本运行并显示日志
trap 'print_info "正在停止 n8n..."; kill $N8N_PID 2>/dev/null; exit 0' INT
tail -f "$log_file"

View File

@@ -0,0 +1,5 @@
# Development environment variables for Windows
VITE_N8N_API_URL=http://localhost:5678
VITE_N8N_WEBHOOK_URL=http://localhost:5678
VITE_API_TIMEOUT=30000
VITE_ENABLE_MOCK=false

View File

@@ -739,6 +739,12 @@
"@types/unist": "*"
}
},
"node_modules/@types/history": {
"version": "4.7.11",
"resolved": "https://registry.npmmirror.com/@types/history/-/history-4.7.11.tgz",
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==",
"license": "MIT"
},
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz",
@@ -787,6 +793,27 @@
"@types/react": "^18.0.0"
}
},
"node_modules/@types/react-router": {
"version": "5.1.20",
"resolved": "https://registry.npmmirror.com/@types/react-router/-/react-router-5.1.20.tgz",
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
"license": "MIT",
"dependencies": {
"@types/history": "^4.7.11",
"@types/react": "*"
}
},
"node_modules/@types/react-router-dom": {
"version": "5.3.3",
"resolved": "https://registry.npmmirror.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
"license": "MIT",
"dependencies": {
"@types/history": "^4.7.11",
"@types/react": "*",
"@types/react-router": "*"
}
},
"node_modules/@types/react-syntax-highlighter": {
"version": "15.5.13",
"resolved": "https://registry.npmmirror.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-15.5.13.tgz",
@@ -1479,6 +1506,15 @@
"dev": true,
"license": "MIT"
},
"node_modules/cookie": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/cookie/-/cookie-1.0.2.tgz",
"integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -4082,6 +4118,44 @@
"node": ">=0.10.0"
}
},
"node_modules/react-router": {
"version": "7.8.2",
"resolved": "https://registry.npmmirror.com/react-router/-/react-router-7.8.2.tgz",
"integrity": "sha512-7M2fR1JbIZ/jFWqelpvSZx+7vd7UlBTfdZqf6OSdF9g6+sfdqJDAWcak6ervbHph200ePlu+7G8LdoiC3ReyAQ==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
"set-cookie-parser": "^2.6.0"
},
"engines": {
"node": ">=20.0.0"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
},
"peerDependenciesMeta": {
"react-dom": {
"optional": true
}
}
},
"node_modules/react-router-dom": {
"version": "7.8.2",
"resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-7.8.2.tgz",
"integrity": "sha512-Z4VM5mKDipal2jQ385H6UBhiiEDlnJPx6jyWsTYoZQdl5TrjxEV2a9yl3Fi60NBJxYzOTGTTHXPi0pdizvTwow==",
"license": "MIT",
"dependencies": {
"react-router": "7.8.2"
},
"engines": {
"node": ">=20.0.0"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
}
},
"node_modules/react-syntax-highlighter": {
"version": "15.6.6",
"resolved": "https://registry.npmmirror.com/react-syntax-highlighter/-/react-syntax-highlighter-15.6.6.tgz",
@@ -4417,6 +4491,12 @@
"node": ">=10"
}
},
"node_modules/set-cookie-parser": {
"version": "2.7.1",
"resolved": "https://registry.npmmirror.com/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
"integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==",
"license": "MIT"
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz",

View File

@@ -1,55 +1,55 @@
{
"hash": "2eebceef",
"hash": "7b894699",
"configHash": "5f016d5e",
"lockfileHash": "662c075f",
"browserHash": "cf40b14a",
"lockfileHash": "7b7824c4",
"browserHash": "625ea9bb",
"optimized": {
"react": {
"src": "../../react/index.js",
"file": "react.js",
"fileHash": "a5e17042",
"fileHash": "7de44a71",
"needsInterop": true
},
"react-dom": {
"src": "../../react-dom/index.js",
"file": "react-dom.js",
"fileHash": "eb4d93a2",
"fileHash": "2bb06014",
"needsInterop": true
},
"react/jsx-dev-runtime": {
"src": "../../react/jsx-dev-runtime.js",
"file": "react_jsx-dev-runtime.js",
"fileHash": "8839cb68",
"fileHash": "0ea84e66",
"needsInterop": true
},
"react/jsx-runtime": {
"src": "../../react/jsx-runtime.js",
"file": "react_jsx-runtime.js",
"fileHash": "5635dd32",
"fileHash": "d6a1a9e6",
"needsInterop": true
},
"framer-motion": {
"src": "../../framer-motion/dist/es/index.mjs",
"file": "framer-motion.js",
"fileHash": "0538efda",
"fileHash": "9d0adc99",
"needsInterop": false
},
"lucide-react": {
"src": "../../lucide-react/dist/esm/lucide-react.js",
"file": "lucide-react.js",
"fileHash": "f015b5b0",
"fileHash": "c846d0f1",
"needsInterop": false
},
"react-dom/client": {
"src": "../../react-dom/client.js",
"file": "react-dom_client.js",
"fileHash": "ae1f5112",
"fileHash": "561101ec",
"needsInterop": true
},
"zustand": {
"src": "../../zustand/esm/index.mjs",
"file": "zustand.js",
"fileHash": "57bafffc",
"fileHash": "c042c8bf",
"needsInterop": false
}
},

View File

@@ -0,0 +1,17 @@
declare global {
// Some users of this package are don't use "dom" libs
interface EventTarget {}
interface EventListener {}
interface EventListenerObject {}
}
export const isExtraneousPopstateEvent: boolean;
export function addEventListener(node: EventTarget, event: string, listener: EventListener | EventListenerObject): void;
export function removeEventListener(
node: EventTarget,
event: string,
listener: EventListener | EventListenerObject,
): void;
export function getConfirmation(message: string, callback: (result: boolean) => void): void;
export function supportsHistory(): boolean;
export function supportsGoWithoutReloadUsingHash(): boolean;

View File

@@ -0,0 +1 @@
export const canUseDOM: boolean;

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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

View File

@@ -0,0 +1,9 @@
import { Path, LocationState, LocationKey, Location, LocationDescriptor } from './index';
export function locationsAreEqual<S = LocationState>(lv: LocationDescriptor<S>, rv: LocationDescriptor<S>): boolean;
export function createLocation<S = LocationState>(
path: LocationDescriptor<S>,
state?: S,
key?: LocationKey,
currentLocation?: Location<S>,
): Location<S>;

View File

@@ -0,0 +1,9 @@
import { Path, Location, LocationDescriptorObject } from './index';
export function addLeadingSlash(path: Path): Path;
export function stripLeadingSlash(path: Path): Path;
export function hasBasename(path: Path): boolean;
export function stripBasename(path: Path, prefix: string): Path;
export function stripTrailingSlash(path: Path): Path;
export function parsePath(path: Path): Location;
export function createPath<S>(location: LocationDescriptorObject<S>): Path;

View File

@@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/history`
# Summary
This package contains type definitions for history (https://github.com/mjackson/history).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/history.
### Additional Details
* Last updated: Sun, 16 Jan 2022 17:31:24 GMT
* Dependencies: none
* Global values: `History`
# Credits
These definitions were written by [Sergey Buturlakin](https://github.com/sergey-buturlakin), [Nathan Brown](https://github.com/ngbrown), [Young Rok Kim](https://github.com/rokoroku), and [Daniel Nixon](https://github.com/danielnixon).

View File

@@ -0,0 +1,11 @@
import { History, LocationState } from './index';
import { getConfirmation } from './DOMUtils';
export interface BrowserHistoryBuildOptions {
basename?: string | undefined;
forceRefresh?: boolean | undefined;
getUserConfirmation?: typeof getConfirmation | undefined;
keyLength?: number | undefined;
}
export default function createBrowserHistory<S = LocationState>(options?: BrowserHistoryBuildOptions): History<S>;

View File

@@ -0,0 +1,12 @@
import { History, LocationState } from './index';
import { getConfirmation } from './DOMUtils';
export type HashType = 'hashbang' | 'noslash' | 'slash';
export interface HashHistoryBuildOptions {
basename?: string | undefined;
hashType?: HashType | undefined;
getUserConfirmation?: typeof getConfirmation | undefined;
}
export default function createHashHistory<S = LocationState>(options?: HashHistoryBuildOptions): History<S>;

View File

@@ -0,0 +1,19 @@
import { History, Location, LocationState } from './index';
import { getConfirmation } from './DOMUtils';
export type InitialEntry = string | Partial<Location>;
export interface MemoryHistoryBuildOptions {
getUserConfirmation?: typeof getConfirmation | undefined;
initialEntries?: InitialEntry[] | undefined;
initialIndex?: number | undefined;
keyLength?: number | undefined;
}
export interface MemoryHistory<HistoryLocationState = LocationState> extends History<HistoryLocationState> {
index: number;
entries: Location<HistoryLocationState>[];
canGo(n: number): boolean;
}
export default function createMemoryHistory<S = LocationState>(options?: MemoryHistoryBuildOptions): MemoryHistory<S>;

View File

@@ -0,0 +1,20 @@
import { Location, Action, LocationListener, LocationState, UnregisterCallback } from './index';
import { getConfirmation } from './DOMUtils';
export type PromptFunction<S = LocationState> = (location: Location<S>, action: Action) => any;
export type Prompt<S = LocationState> = PromptFunction<S> | boolean;
export interface TransitionManager<S = LocationState> {
setPrompt(nextPrompt?: Prompt<S>): UnregisterCallback;
appendListener(listener: LocationListener<S>): UnregisterCallback;
notifyListeners(location: Location<S>, action: Action): void;
confirmTransitionTo(
location: Location<S>,
action: Action,
getUserConfirmation: typeof getConfirmation,
callback: (result: boolean) => void,
): void;
}
export default function createTransitionManager<S = LocationState>(): TransitionManager<S>;

View File

@@ -0,0 +1,95 @@
// Type definitions for history 4.7.2
// Project: https://github.com/mjackson/history
// Definitions by: Sergey Buturlakin <https://github.com/sergey-buturlakin>, Nathan Brown <https://github.com/ngbrown>, Young Rok Kim <https://github.com/rokoroku>, Daniel Nixon <https://github.com/danielnixon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export as namespace History;
export type Action = 'PUSH' | 'POP' | 'REPLACE';
export type UnregisterCallback = () => void;
export interface History<HistoryLocationState = LocationState> {
length: number;
action: Action;
location: Location<HistoryLocationState>;
push(location: Path | LocationDescriptor<HistoryLocationState>, state?: HistoryLocationState): void;
replace(location: Path | LocationDescriptor<HistoryLocationState>, state?: HistoryLocationState): void;
go(n: number): void;
goBack(): void;
goForward(): void;
block(prompt?: boolean | string | TransitionPromptHook<HistoryLocationState>): UnregisterCallback;
listen(listener: LocationListener<HistoryLocationState>): UnregisterCallback;
createHref(location: LocationDescriptorObject<HistoryLocationState>): Href;
}
export interface Location<S = LocationState> {
pathname: Pathname;
search: Search;
state: S;
hash: Hash;
key?: LocationKey | undefined;
}
export interface LocationDescriptorObject<S = LocationState> {
pathname?: Pathname | undefined;
search?: Search | undefined;
state?: S | undefined;
hash?: Hash | undefined;
key?: LocationKey | undefined;
}
export namespace History {
export type LocationDescriptor<S = LocationState> = Path | LocationDescriptorObject<S>;
export type LocationKey = string;
export type LocationListener<S = LocationState> = (location: Location<S>, action: Action) => void;
export type LocationState = unknown;
export type Path = string;
export type Pathname = string;
export type Search = string;
export type TransitionHook<S = LocationState> = (location: Location<S>, callback: (result: any) => void) => any;
export type TransitionPromptHook<S = LocationState> = (
location: Location<S>,
action: Action,
) => string | false | void;
export type Hash = string;
export type Href = string;
}
export type LocationDescriptor<S = LocationState> = History.LocationDescriptor<S>;
export type LocationKey = History.LocationKey;
export type LocationListener<S = LocationState> = History.LocationListener<S>;
export type LocationState = History.LocationState;
export type Path = History.Path;
export type Pathname = History.Pathname;
export type Search = History.Search;
export type TransitionHook<S = LocationState> = History.TransitionHook<S>;
export type TransitionPromptHook<S = LocationState> = History.TransitionPromptHook<S>;
export type Hash = History.Hash;
export type Href = History.Href;
import { default as createBrowserHistory } from './createBrowserHistory';
import { default as createHashHistory } from './createHashHistory';
import { default as createMemoryHistory } from './createMemoryHistory';
import { createLocation, locationsAreEqual } from './LocationUtils';
import { parsePath, createPath } from './PathUtils';
// Global usage, without modules, needs the small trick, because lib.d.ts
// already has `history` and `History` global definitions:
// var createHistory = ((window as any).History as HistoryModule.Module).createHistory;
export interface Module {
createBrowserHistory: typeof createBrowserHistory;
createHashHistory: typeof createHashHistory;
createMemoryHistory: typeof createMemoryHistory;
createLocation: typeof createLocation;
locationsAreEqual: typeof locationsAreEqual;
parsePath: typeof parsePath;
createPath: typeof createPath;
}
export * from './createBrowserHistory';
export * from './createHashHistory';
export * from './createMemoryHistory';
export { createLocation, locationsAreEqual } from './LocationUtils';
export { parsePath, createPath } from './PathUtils';
export { createBrowserHistory, createHashHistory, createMemoryHistory };

View File

@@ -0,0 +1,40 @@
{
"name": "@types/history",
"version": "4.7.11",
"description": "TypeScript definitions for history",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/history",
"license": "MIT",
"contributors": [
{
"name": "Sergey Buturlakin",
"url": "https://github.com/sergey-buturlakin",
"githubUsername": "sergey-buturlakin"
},
{
"name": "Nathan Brown",
"url": "https://github.com/ngbrown",
"githubUsername": "ngbrown"
},
{
"name": "Young Rok Kim",
"url": "https://github.com/rokoroku",
"githubUsername": "rokoroku"
},
{
"name": "Daniel Nixon",
"url": "https://github.com/danielnixon",
"githubUsername": "danielnixon"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/history"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "141516ba36ab9f2b221dc957cba4ac21d9a06776c05786e6773c5581f8cf7455",
"typeScriptVersion": "3.8"
}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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

View File

@@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/react-router-dom`
# Summary
This package contains type definitions for react-router-dom (https://github.com/ReactTraining/react-router).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-dom.
### Additional Details
* Last updated: Tue, 18 Jan 2022 22:01:52 GMT
* Dependencies: [@types/react-router](https://npmjs.com/package/@types/react-router), [@types/react](https://npmjs.com/package/@types/react), [@types/history](https://npmjs.com/package/@types/history)
* Global values: none
# Credits
These definitions were written by [Huy Nguyen](https://github.com/huy-nguyen), [Philip Jackson](https://github.com/p-jackson), [John Reilly](https://github.com/johnnyreilly), [Sebastian Silbermann](https://github.com/eps1lon), [Daniel Nixon](https://github.com/danielnixon), [Tony Ward](https://github.com/ynotdraw), and [Pirasis Leelatanon](https://github.com/1pete).

View File

@@ -0,0 +1,98 @@
// Type definitions for react-router-dom 5.3
// Project: https://github.com/ReactTraining/react-router
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>
// Philip Jackson <https://github.com/p-jackson>
// John Reilly <https://github.com/johnnyreilly>
// Sebastian Silbermann <https://github.com/eps1lon>
// Daniel Nixon <https://github.com/danielnixon>
// Tony Ward <https://github.com/ynotdraw>
// Pirasis Leelatanon <https://github.com/1pete>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
import { match } from 'react-router';
import * as React from 'react';
import * as H from 'history';
export {
generatePath,
PromptProps,
Prompt,
MemoryRouterProps,
MemoryRouter,
RedirectProps,
Redirect,
RouteChildrenProps,
RouteComponentProps,
RouteProps,
Route,
RouterProps,
Router,
StaticRouterProps,
StaticRouter,
SwitchProps,
Switch,
match,
matchPath,
withRouter,
RouterChildContext,
useHistory,
useLocation,
useParams,
useRouteMatch,
} from 'react-router';
export interface BrowserRouterProps {
basename?: string | undefined;
children?: React.ReactNode;
getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined;
forceRefresh?: boolean | undefined;
keyLength?: number | undefined;
}
export class BrowserRouter extends React.Component<BrowserRouterProps, any> {}
export interface HashRouterProps {
basename?: string | undefined;
children?: React.ReactNode;
getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined;
hashType?: 'slash' | 'noslash' | 'hashbang' | undefined;
}
export class HashRouter extends React.Component<HashRouterProps, any> {}
export interface LinkProps<S = H.LocationState> extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
component?: React.ComponentType<any> | undefined;
to: H.LocationDescriptor<S> | ((location: H.Location<S>) => H.LocationDescriptor<S>);
replace?: boolean | undefined;
innerRef?: React.Ref<HTMLAnchorElement> | undefined;
}
export function Link<S = H.LocationState>(
...params: Parameters<Link<S>>
): ReturnType<Link<S>>;
export interface Link<S = H.LocationState>
extends React.ForwardRefExoticComponent<
React.PropsWithoutRef<LinkProps<S>> & React.RefAttributes<HTMLAnchorElement>
> {}
export interface NavLinkProps<S = H.LocationState> extends Omit<LinkProps<S>, "className" | "style"> {
activeClassName?: string | undefined;
activeStyle?: React.CSSProperties | undefined;
exact?: boolean | undefined;
strict?: boolean | undefined;
isActive?<Params extends { [K in keyof Params]?: string }>(match: match<Params> | null, location: H.Location<S>): boolean;
location?: H.Location<S> | undefined;
className?: string | ((isActive: boolean) => string) | undefined;
style?:
| React.CSSProperties
| ((isActive: boolean) => React.CSSProperties)
| undefined;
sensitive?: boolean | undefined;
}
export function NavLink<S = H.LocationState>(
// TODO: Define this as ...params: Parameters<NavLink<S>> when only TypeScript >= 3.1 support is needed.
props: React.PropsWithoutRef<NavLinkProps<S>> & React.RefAttributes<HTMLAnchorElement>,
): ReturnType<NavLink<S>>;
export interface NavLink<S = H.LocationState>
extends React.ForwardRefExoticComponent<
React.PropsWithoutRef<NavLinkProps<S>> & React.RefAttributes<HTMLAnchorElement>
> {}

View File

@@ -0,0 +1,59 @@
{
"name": "@types/react-router-dom",
"version": "5.3.3",
"description": "TypeScript definitions for react-router-dom",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-dom",
"license": "MIT",
"contributors": [
{
"name": "Huy Nguyen",
"url": "https://github.com/huy-nguyen",
"githubUsername": "huy-nguyen"
},
{
"name": "Philip Jackson",
"url": "https://github.com/p-jackson",
"githubUsername": "p-jackson"
},
{
"name": "John Reilly",
"url": "https://github.com/johnnyreilly",
"githubUsername": "johnnyreilly"
},
{
"name": "Sebastian Silbermann",
"url": "https://github.com/eps1lon",
"githubUsername": "eps1lon"
},
{
"name": "Daniel Nixon",
"url": "https://github.com/danielnixon",
"githubUsername": "danielnixon"
},
{
"name": "Tony Ward",
"url": "https://github.com/ynotdraw",
"githubUsername": "ynotdraw"
},
{
"name": "Pirasis Leelatanon",
"url": "https://github.com/1pete",
"githubUsername": "1pete"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/react-router-dom"
},
"scripts": {},
"dependencies": {
"@types/history": "^4.7.11",
"@types/react": "*",
"@types/react-router": "*"
},
"typesPublisherContentHash": "e0755682335fcda35af55012c81f34c3082bd681570954c4a515a7ada37f06af",
"typeScriptVersion": "3.8"
}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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

View File

@@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/react-router`
# Summary
This package contains type definitions for React Router (https://github.com/ReactTraining/react-router).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router.
### Additional Details
* Last updated: Fri, 23 Dec 2022 11:02:45 GMT
* Dependencies: [@types/history](https://npmjs.com/package/@types/history), [@types/react](https://npmjs.com/package/@types/react)
* Global values: none
# Credits
These definitions were written by [Sergey Buturlakin](https://github.com/sergey-buturlakin), [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17), [Nathan Brown](https://github.com/ngbrown), [Alex Wendland](https://github.com/awendland), [Kostya Esmukov](https://github.com/KostyaEsmukov), [John Reilly](https://github.com/johnnyreilly), [Karol Janyst](https://github.com/LKay), [Dovydas Navickas](https://github.com/DovydasNavickas), [Huy Nguyen](https://github.com/huy-nguyen), [Jérémy Fauvel](https://github.com/grmiade), [Daniel Roth](https://github.com/DaIgeb), [Egor Shulga](https://github.com/egorshulga), [Rahul Raina](https://github.com/rraina), [Duong Tran](https://github.com/t49tran), [Ben Smith](https://github.com/8enSmith), [Wesley Tsai](https://github.com/wezleytsai), [Sebastian Silbermann](https://github.com/eps1lon), [Nicholas Hehr](https://github.com/HipsterBrown), and [Pawel Fajfer](https://github.com/pawfa).

View File

@@ -0,0 +1,198 @@
// Type definitions for React Router 5.1
// Project: https://github.com/ReactTraining/react-router
// Definitions by: Sergey Buturlakin <https://github.com/sergey-buturlakin>
// Yuichi Murata <https://github.com/mrk21>
// Václav Ostrožlík <https://github.com/vasek17>
// Nathan Brown <https://github.com/ngbrown>
// Alex Wendland <https://github.com/awendland>
// Kostya Esmukov <https://github.com/KostyaEsmukov>
// John Reilly <https://github.com/johnnyreilly>
// Karol Janyst <https://github.com/LKay>
// Dovydas Navickas <https://github.com/DovydasNavickas>
// Huy Nguyen <https://github.com/huy-nguyen>
// Jérémy Fauvel <https://github.com/grmiade>
// Daniel Roth <https://github.com/DaIgeb>
// Egor Shulga <https://github.com/egorshulga>
// Rahul Raina <https://github.com/rraina>
// Duong Tran <https://github.com/t49tran>
// Ben Smith <https://github.com/8enSmith>
// Wesley Tsai <https://github.com/wezleytsai>
// Sebastian Silbermann <https://github.com/eps1lon>
// Nicholas Hehr <https://github.com/HipsterBrown>
// Pawel Fajfer <https://github.com/pawfa>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
import * as H from 'history';
// This is the type of the context object that will be passed down to all children of
// a `Router` component:
export interface RouterChildContext<Params extends { [K in keyof Params]?: string } = {}> {
router: {
history: H.History;
route: {
location: H.Location;
match: match<Params>;
};
};
}
export interface MemoryRouterProps {
children?: React.ReactNode;
initialEntries?: H.LocationDescriptor[] | undefined;
initialIndex?: number | undefined;
getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined;
keyLength?: number | undefined;
}
export class MemoryRouter extends React.Component<MemoryRouterProps, any> {}
export interface PromptProps {
message: string | ((location: H.Location, action: H.Action) => string | boolean);
when?: boolean | undefined;
}
export class Prompt extends React.Component<PromptProps, any> {}
export interface RedirectProps {
to: H.LocationDescriptor;
push?: boolean | undefined;
from?: string | undefined;
path?: string | undefined;
exact?: boolean | undefined;
strict?: boolean | undefined;
}
export class Redirect extends React.Component<RedirectProps, any> {}
export interface StaticContext {
statusCode?: number | undefined;
}
export interface RouteComponentProps<
Params extends { [K in keyof Params]?: string } = {},
C extends StaticContext = StaticContext,
S = H.LocationState,
> {
history: H.History<S>;
location: H.Location<S>;
match: match<Params>;
staticContext?: C | undefined;
}
export interface RouteChildrenProps<Params extends { [K in keyof Params]?: string } = {}, S = H.LocationState> {
history: H.History;
location: H.Location<S>;
match: match<Params> | null;
}
export interface RouteProps<
Path extends string = string,
Params extends { [K: string]: string | undefined } = ExtractRouteParams<Path, string>,
> {
location?: H.Location | undefined;
component?: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any> | undefined;
render?: ((props: RouteComponentProps<Params>) => React.ReactNode) | undefined;
children?: ((props: RouteChildrenProps<Params>) => React.ReactNode) | React.ReactNode | undefined;
path?: Path | readonly Path[] | undefined;
exact?: boolean | undefined;
sensitive?: boolean | undefined;
strict?: boolean | undefined;
}
export class Route<T extends {} = {}, Path extends string = string> extends React.Component<
RouteProps<Path> & OmitNative<T, keyof RouteProps>,
any
> {}
export interface RouterProps {
children?: React.ReactNode;
history: H.History;
}
export class Router extends React.Component<RouterProps, any> {}
export interface StaticRouterContext extends StaticContext {
url?: string | undefined;
action?: 'PUSH' | 'REPLACE' | undefined;
location?: object | undefined;
}
export interface StaticRouterProps {
basename?: string | undefined;
children?: React.ReactNode;
location?: string | object | undefined;
context?: StaticRouterContext | undefined;
}
export class StaticRouter extends React.Component<StaticRouterProps, any> {}
export interface SwitchProps {
children?: React.ReactNode | undefined;
location?: H.Location | undefined;
}
export class Switch extends React.Component<SwitchProps, any> {}
export interface match<Params extends { [K in keyof Params]?: string } = {}> {
params: Params;
isExact: boolean;
path: string;
url: string;
}
// Omit taken from https://github.com/Microsoft/TypeScript/issues/28339#issuecomment-467220238
export type Omit<T, K extends keyof T> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
// Newer Omit type: as the previous one is being exported, removing it would be a breaking change
export type OmitNative<T, K extends string | number | symbol> = { [P in Exclude<keyof T, K>]: T[P] };
export function matchPath<Params extends { [K in keyof Params]?: string }>(
pathname: string,
props: string | string[] | RouteProps,
parent?: match<Params> | null,
): match<Params> | null;
export type ExtractRouteOptionalParam<T extends string, U = string | number | boolean> = T extends `${infer Param}?`
? { [k in Param]?: U }
: T extends `${infer Param}*`
? { [k in Param]?: U }
: T extends `${infer Param}+`
? { [k in Param]: U }
: { [k in T]: U };
export type ExtractRouteParams<T extends string, U = string | number | boolean> = string extends T
? { [k in string]?: U }
: T extends `${infer _Start}:${infer ParamWithOptionalRegExp}/${infer Rest}`
? ParamWithOptionalRegExp extends `${infer Param}(${infer _RegExp})${infer Modifier extends '?' | '+' | '*' | ''}`
? ExtractRouteOptionalParam<`${Param}${Modifier}`, U> & ExtractRouteParams<Rest, U>
: ExtractRouteOptionalParam<ParamWithOptionalRegExp, U> & ExtractRouteParams<Rest, U>
: T extends `${infer _Start}:${infer ParamWithOptionalRegExp}`
? ParamWithOptionalRegExp extends `${infer Param}(${infer _RegExp})${infer Modifier extends '?' | '+' | '*' | ''}`
? ExtractRouteOptionalParam<`${Param}${Modifier}`, U>
: ExtractRouteOptionalParam<ParamWithOptionalRegExp, U>
: {};
export function generatePath<S extends string>(path: S, params?: ExtractRouteParams<S>): string;
export type WithRouterProps<C extends React.ComponentType<any>> = C extends React.ComponentClass
? { wrappedComponentRef?: React.Ref<InstanceType<C>> | undefined }
: {};
export interface WithRouterStatics<C extends React.ComponentType<any>> {
WrappedComponent: C;
}
// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes
// they are decorating. Due to this, if you are using @withRouter decorator in your code,
// you will see a bunch of errors from TypeScript. The current workaround is to use withRouter() as a function call
// on a separate line instead of as a decorator.
export function withRouter<P extends RouteComponentProps<any>, C extends React.ComponentType<P>>(
component: C & React.ComponentType<P>,
): React.ComponentClass<Omit<P, keyof RouteComponentProps<any>> & WithRouterProps<C>> & WithRouterStatics<C>;
export const __RouterContext: React.Context<RouteComponentProps>;
export function useHistory<HistoryLocationState = H.LocationState>(): H.History<HistoryLocationState>;
export function useLocation<S = H.LocationState>(): H.Location<S>;
export function useParams<Params extends { [K in keyof Params]?: string } = {}>(): Params;
export function useRouteMatch<Params extends { [K in keyof Params]?: string } = {}>(): match<Params>;
export function useRouteMatch<Params extends { [K in keyof Params]?: string } = {}>(
path: string | string[] | RouteProps,
): match<Params> | null;

View File

@@ -0,0 +1,130 @@
{
"name": "@types/react-router",
"version": "5.1.20",
"description": "TypeScript definitions for React Router",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router",
"license": "MIT",
"contributors": [
{
"name": "Sergey Buturlakin",
"url": "https://github.com/sergey-buturlakin",
"githubUsername": "sergey-buturlakin"
},
{
"name": "Yuichi Murata",
"url": "https://github.com/mrk21",
"githubUsername": "mrk21"
},
{
"name": "Václav Ostrožlík",
"url": "https://github.com/vasek17",
"githubUsername": "vasek17"
},
{
"name": "Nathan Brown",
"url": "https://github.com/ngbrown",
"githubUsername": "ngbrown"
},
{
"name": "Alex Wendland",
"url": "https://github.com/awendland",
"githubUsername": "awendland"
},
{
"name": "Kostya Esmukov",
"url": "https://github.com/KostyaEsmukov",
"githubUsername": "KostyaEsmukov"
},
{
"name": "John Reilly",
"url": "https://github.com/johnnyreilly",
"githubUsername": "johnnyreilly"
},
{
"name": "Karol Janyst",
"url": "https://github.com/LKay",
"githubUsername": "LKay"
},
{
"name": "Dovydas Navickas",
"url": "https://github.com/DovydasNavickas",
"githubUsername": "DovydasNavickas"
},
{
"name": "Huy Nguyen",
"url": "https://github.com/huy-nguyen",
"githubUsername": "huy-nguyen"
},
{
"name": "Jérémy Fauvel",
"url": "https://github.com/grmiade",
"githubUsername": "grmiade"
},
{
"name": "Daniel Roth",
"url": "https://github.com/DaIgeb",
"githubUsername": "DaIgeb"
},
{
"name": "Egor Shulga",
"url": "https://github.com/egorshulga",
"githubUsername": "egorshulga"
},
{
"name": "Rahul Raina",
"url": "https://github.com/rraina",
"githubUsername": "rraina"
},
{
"name": "Duong Tran",
"url": "https://github.com/t49tran",
"githubUsername": "t49tran"
},
{
"name": "Ben Smith",
"url": "https://github.com/8enSmith",
"githubUsername": "8enSmith"
},
{
"name": "Wesley Tsai",
"url": "https://github.com/wezleytsai",
"githubUsername": "wezleytsai"
},
{
"name": "Sebastian Silbermann",
"url": "https://github.com/eps1lon",
"githubUsername": "eps1lon"
},
{
"name": "Nicholas Hehr",
"url": "https://github.com/HipsterBrown",
"githubUsername": "HipsterBrown"
},
{
"name": "Pawel Fajfer",
"url": "https://github.com/pawfa",
"githubUsername": "pawfa"
}
],
"main": "",
"types": "index.d.ts",
"typesVersions": {
"<=4.6": {
"*": [
"ts4.6/*"
]
}
},
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/react-router"
},
"scripts": {},
"dependencies": {
"@types/history": "^4.7.11",
"@types/react": "*"
},
"typesPublisherContentHash": "471509be13705fc944e92092c64b94ac19712efd46cd3b0bfe38faefb539955f",
"typeScriptVersion": "4.2"
}

View File

@@ -0,0 +1,173 @@
import * as React from 'react';
import * as H from 'history';
// This is the type of the context object that will be passed down to all children of
// a `Router` component:
export interface RouterChildContext<Params extends { [K in keyof Params]?: string } = {}> {
router: {
history: H.History;
route: {
location: H.Location;
match: match<Params>;
};
};
}
export interface MemoryRouterProps {
children?: React.ReactNode;
initialEntries?: H.LocationDescriptor[] | undefined;
initialIndex?: number | undefined;
getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined;
keyLength?: number | undefined;
}
export class MemoryRouter extends React.Component<MemoryRouterProps, any> {}
export interface PromptProps {
message: string | ((location: H.Location, action: H.Action) => string | boolean);
when?: boolean | undefined;
}
export class Prompt extends React.Component<PromptProps, any> {}
export interface RedirectProps {
to: H.LocationDescriptor;
push?: boolean | undefined;
from?: string | undefined;
path?: string | undefined;
exact?: boolean | undefined;
strict?: boolean | undefined;
}
export class Redirect extends React.Component<RedirectProps, any> {}
export interface StaticContext {
statusCode?: number | undefined;
}
export interface RouteComponentProps<
Params extends { [K in keyof Params]?: string } = {},
C extends StaticContext = StaticContext,
S = H.LocationState,
> {
history: H.History<S>;
location: H.Location<S>;
match: match<Params>;
staticContext?: C | undefined;
}
export interface RouteChildrenProps<Params extends { [K in keyof Params]?: string } = {}, S = H.LocationState> {
history: H.History;
location: H.Location<S>;
match: match<Params> | null;
}
export interface RouteProps<
Path extends string = string,
Params extends { [K: string]: string | undefined } = ExtractRouteParams<Path, string>,
> {
location?: H.Location | undefined;
component?: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any> | undefined;
render?: ((props: RouteComponentProps<Params>) => React.ReactNode) | undefined;
children?: ((props: RouteChildrenProps<Params>) => React.ReactNode) | React.ReactNode | undefined;
path?: Path | readonly Path[] | undefined;
exact?: boolean | undefined;
sensitive?: boolean | undefined;
strict?: boolean | undefined;
}
export class Route<T extends {} = {}, Path extends string = string> extends React.Component<
RouteProps<Path> & OmitNative<T, keyof RouteProps>,
any
> {}
export interface RouterProps {
children?: React.ReactNode;
history: H.History;
}
export class Router extends React.Component<RouterProps, any> {}
export interface StaticRouterContext extends StaticContext {
url?: string | undefined;
action?: 'PUSH' | 'REPLACE' | undefined;
location?: object | undefined;
}
export interface StaticRouterProps {
basename?: string | undefined;
children?: React.ReactNode;
location?: string | object | undefined;
context?: StaticRouterContext | undefined;
}
export class StaticRouter extends React.Component<StaticRouterProps, any> {}
export interface SwitchProps {
children?: React.ReactNode | undefined;
location?: H.Location | undefined;
}
export class Switch extends React.Component<SwitchProps, any> {}
export interface match<Params extends { [K in keyof Params]?: string } = {}> {
params: Params;
isExact: boolean;
path: string;
url: string;
}
// Omit taken from https://github.com/Microsoft/TypeScript/issues/28339#issuecomment-467220238
export type Omit<T, K extends keyof T> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
// Newer Omit type: as the previous one is being exported, removing it would be a breaking change
export type OmitNative<T, K extends string | number | symbol> = { [P in Exclude<keyof T, K>]: T[P] };
export function matchPath<Params extends { [K in keyof Params]?: string }>(
pathname: string,
props: string | string[] | RouteProps,
parent?: match<Params> | null,
): match<Params> | null;
export type ExtractRouteOptionalParam<T extends string, U = string | number | boolean> = T extends `${infer Param}?`
? { [k in Param]?: U }
: T extends `${infer Param}*`
? { [k in Param]?: U }
: T extends `${infer Param}+`
? { [k in Param]: U }
: { [k in T]: U };
export type ExtractRouteParams<T extends string, U = string | number | boolean> = string extends T
? { [k in string]?: U }
: T extends `${infer _Start}:${infer ParamWithOptionalRegExp}/${infer Rest}`
? ParamWithOptionalRegExp extends `${infer Param}(${infer _RegExp})`
? ExtractRouteOptionalParam<Param, U> & ExtractRouteParams<Rest, U>
: ExtractRouteOptionalParam<ParamWithOptionalRegExp, U> & ExtractRouteParams<Rest, U>
: T extends `${infer _Start}:${infer ParamWithOptionalRegExp}`
? ParamWithOptionalRegExp extends `${infer Param}(${infer _RegExp})`
? ExtractRouteOptionalParam<Param, U>
: ExtractRouteOptionalParam<ParamWithOptionalRegExp, U>
: {};
export function generatePath<S extends string>(path: S, params?: ExtractRouteParams<S>): string;
export type WithRouterProps<C extends React.ComponentType<any>> = C extends React.ComponentClass
? { wrappedComponentRef?: React.Ref<InstanceType<C>> | undefined }
: {};
export interface WithRouterStatics<C extends React.ComponentType<any>> {
WrappedComponent: C;
}
// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes
// they are decorating. Due to this, if you are using @withRouter decorator in your code,
// you will see a bunch of errors from TypeScript. The current workaround is to use withRouter() as a function call
// on a separate line instead of as a decorator.
export function withRouter<P extends RouteComponentProps<any>, C extends React.ComponentType<P>>(
component: C & React.ComponentType<P>,
): React.ComponentClass<Omit<P, keyof RouteComponentProps<any>> & WithRouterProps<C>> & WithRouterStatics<C>;
export const __RouterContext: React.Context<RouteComponentProps>;
export function useHistory<HistoryLocationState = H.LocationState>(): H.History<HistoryLocationState>;
export function useLocation<S = H.LocationState>(): H.Location<S>;
export function useParams<Params extends { [K in keyof Params]?: string } = {}>(): Params;
export function useRouteMatch<Params extends { [K in keyof Params]?: string } = {}>(): match<Params>;
export function useRouteMatch<Params extends { [K in keyof Params]?: string } = {}>(
path: string | string[] | RouteProps,
): match<Params> | null;

View File

@@ -0,0 +1,24 @@
(The MIT License)
Copyright (c) 2012-2014 Roman Shtylman <shtylman@gmail.com>
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.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.

View File

@@ -0,0 +1,248 @@
# cookie
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Build Status][ci-image]][ci-url]
[![Coverage Status][coverage-image]][coverage-url]
Basic HTTP cookie parser and serializer for HTTP servers.
## Installation
```sh
$ npm install cookie
```
## API
```js
const cookie = require("cookie");
// import * as cookie from 'cookie';
```
### cookie.parse(str, options)
Parse a HTTP `Cookie` header string and returning an object of all cookie name-value pairs.
The `str` argument is the string representing a `Cookie` header value and `options` is an
optional object containing additional parsing options.
```js
const cookies = cookie.parse("foo=bar; equation=E%3Dmc%5E2");
// { foo: 'bar', equation: 'E=mc^2' }
```
#### Options
`cookie.parse` accepts these properties in the options object.
##### decode
Specifies a function that will be used to decode a [cookie-value](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1).
Since the value of a cookie has a limited character set (and must be a simple string), this function can be used to decode
a previously-encoded cookie value into a JavaScript string.
The default function is the global `decodeURIComponent`, wrapped in a `try..catch`. If an error
is thrown it will return the cookie's original value. If you provide your own encode/decode
scheme you must ensure errors are appropriately handled.
### cookie.serialize(name, value, options)
Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the
name for the cookie, the `value` argument is the value to set the cookie to, and the `options`
argument is an optional object containing additional serialization options.
```js
const setCookie = cookie.serialize("foo", "bar");
// foo=bar
```
#### Options
`cookie.serialize` accepts these properties in the options object.
##### encode
Specifies a function that will be used to encode a [cookie-value](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1).
Since value of a cookie has a limited character set (and must be a simple string), this function can be used to encode
a value into a string suited for a cookie's value, and should mirror `decode` when parsing.
The default function is the global `encodeURIComponent`.
##### maxAge
Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.2).
The [cookie storage model specification](https://tools.ietf.org/html/rfc6265#section-5.3) states that if both `expires` and
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
so if both are set, they should point to the same date and time.
##### expires
Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.1).
When no expiration is set clients consider this a "non-persistent cookie" and delete it the current session is over.
The [cookie storage model specification](https://tools.ietf.org/html/rfc6265#section-5.3) states that if both `expires` and
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
so if both are set, they should point to the same date and time.
##### domain
Specifies the value for the [`Domain` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.3).
When no domain is set clients consider the cookie to apply to the current domain only.
##### path
Specifies the value for the [`Path` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.4).
When no path is set, the path is considered the ["default path"](https://tools.ietf.org/html/rfc6265#section-5.1.4).
##### httpOnly
Enables the [`HttpOnly` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.6).
When enabled, clients will not allow client-side JavaScript to see the cookie in `document.cookie`.
##### secure
Enables the [`Secure` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.5).
When enabled, clients will only send the cookie back if the browser has a HTTPS connection.
##### partitioned
Enables the [`Partitioned` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/).
When enabled, clients will only send the cookie back when the current domain _and_ top-level domain matches.
This is an attribute that has not yet been fully standardized, and may change in the future.
This also means clients may ignore this attribute until they understand it. More information
about can be found in [the proposal](https://github.com/privacycg/CHIPS).
##### priority
Specifies the value for the [`Priority` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
- `'low'` will set the `Priority` attribute to `Low`.
- `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
- `'high'` will set the `Priority` attribute to `High`.
More information about priority levels can be found in [the specification](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
##### sameSite
Specifies the value for the [`SameSite` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7).
- `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
- `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
- `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie.
- `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
More information about enforcement levels can be found in [the specification](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7).
## Example
The following example uses this module in conjunction with the Node.js core HTTP server
to prompt a user for their name and display it back on future visits.
```js
var cookie = require("cookie");
var escapeHtml = require("escape-html");
var http = require("http");
var url = require("url");
function onRequest(req, res) {
// Parse the query string
var query = url.parse(req.url, true, true).query;
if (query && query.name) {
// Set a new cookie with the name
res.setHeader(
"Set-Cookie",
cookie.serialize("name", String(query.name), {
httpOnly: true,
maxAge: 60 * 60 * 24 * 7, // 1 week
}),
);
// Redirect back after setting cookie
res.statusCode = 302;
res.setHeader("Location", req.headers.referer || "/");
res.end();
return;
}
// Parse the cookies on the request
var cookies = cookie.parse(req.headers.cookie || "");
// Get the visitor name set in the cookie
var name = cookies.name;
res.setHeader("Content-Type", "text/html; charset=UTF-8");
if (name) {
res.write("<p>Welcome back, <b>" + escapeHtml(name) + "</b>!</p>");
} else {
res.write("<p>Hello, new visitor!</p>");
}
res.write('<form method="GET">');
res.write(
'<input placeholder="enter your name" name="name"> <input type="submit" value="Set Name">',
);
res.end("</form>");
}
http.createServer(onRequest).listen(3000);
```
## Testing
```sh
npm test
```
## Benchmark
```sh
npm run bench
```
```
name hz min max mean p75 p99 p995 p999 rme samples
· simple 8,566,313.09 0.0000 0.3694 0.0001 0.0001 0.0002 0.0002 0.0003 ±0.64% 4283157 fastest
· decode 3,834,348.85 0.0001 0.2465 0.0003 0.0003 0.0003 0.0004 0.0006 ±0.38% 1917175
· unquote 8,315,355.96 0.0000 0.3824 0.0001 0.0001 0.0002 0.0002 0.0003 ±0.72% 4157880
· duplicates 1,944,765.97 0.0004 0.2959 0.0005 0.0005 0.0006 0.0006 0.0008 ±0.24% 972384
· 10 cookies 675,345.67 0.0012 0.4328 0.0015 0.0015 0.0019 0.0020 0.0058 ±0.75% 337673
· 100 cookies 61,040.71 0.0152 0.4092 0.0164 0.0160 0.0196 0.0228 0.2260 ±0.71% 30521 slowest
✓ parse top-sites (15) 22945ms
name hz min max mean p75 p99 p995 p999 rme samples
· parse accounts.google.com 7,164,349.17 0.0000 0.0929 0.0001 0.0002 0.0002 0.0002 0.0003 ±0.09% 3582184
· parse apple.com 7,817,686.84 0.0000 0.6048 0.0001 0.0001 0.0002 0.0002 0.0003 ±1.05% 3908844
· parse cloudflare.com 7,189,841.70 0.0000 0.0390 0.0001 0.0002 0.0002 0.0002 0.0003 ±0.06% 3594921
· parse docs.google.com 7,051,765.61 0.0000 0.0296 0.0001 0.0002 0.0002 0.0002 0.0003 ±0.06% 3525883
· parse drive.google.com 7,349,104.77 0.0000 0.0368 0.0001 0.0001 0.0002 0.0002 0.0003 ±0.05% 3674553
· parse en.wikipedia.org 1,929,909.49 0.0004 0.3598 0.0005 0.0005 0.0007 0.0007 0.0012 ±0.16% 964955
· parse linkedin.com 2,225,658.01 0.0003 0.0595 0.0004 0.0005 0.0005 0.0005 0.0006 ±0.06% 1112830
· parse maps.google.com 4,423,511.68 0.0001 0.0942 0.0002 0.0003 0.0003 0.0003 0.0005 ±0.08% 2211756
· parse microsoft.com 3,387,601.88 0.0002 0.0725 0.0003 0.0003 0.0004 0.0004 0.0005 ±0.09% 1693801
· parse play.google.com 7,375,980.86 0.0000 0.1994 0.0001 0.0001 0.0002 0.0002 0.0003 ±0.12% 3687991
· parse support.google.com 4,912,267.94 0.0001 2.8958 0.0002 0.0002 0.0003 0.0003 0.0005 ±1.28% 2456134
· parse www.google.com 3,443,035.87 0.0002 0.2783 0.0003 0.0003 0.0004 0.0004 0.0007 ±0.51% 1721518
· parse youtu.be 1,910,492.87 0.0004 0.3490 0.0005 0.0005 0.0007 0.0007 0.0011 ±0.46% 955247
· parse youtube.com 1,895,082.62 0.0004 0.7454 0.0005 0.0005 0.0006 0.0007 0.0013 ±0.64% 947542 slowest
· parse example.com 21,582,835.27 0.0000 0.1095 0.0000 0.0000 0.0001 0.0001 0.0001 ±0.13% 10791418
```
## References
- [RFC 6265: HTTP State Management Mechanism](https://tools.ietf.org/html/rfc6265)
- [Same-site Cookies](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7)
## License
[MIT](LICENSE)
[ci-image]: https://img.shields.io/github/actions/workflow/status/jshttp/cookie/ci.yml
[ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml?query=branch%3Amaster
[coverage-image]: https://img.shields.io/codecov/c/github/jshttp/cookie/master
[coverage-url]: https://app.codecov.io/gh/jshttp/cookie
[npm-downloads-image]: https://img.shields.io/npm/dm/cookie
[npm-url]: https://npmjs.org/package/cookie
[npm-version-image]: https://img.shields.io/npm/v/cookie

View File

@@ -0,0 +1,114 @@
/**
* Parse options.
*/
export interface ParseOptions {
/**
* Specifies a function that will be used to decode a [cookie-value](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1).
* Since the value of a cookie has a limited character set (and must be a simple string), this function can be used to decode
* a previously-encoded cookie value into a JavaScript string.
*
* The default function is the global `decodeURIComponent`, wrapped in a `try..catch`. If an error
* is thrown it will return the cookie's original value. If you provide your own encode/decode
* scheme you must ensure errors are appropriately handled.
*
* @default decode
*/
decode?: (str: string) => string | undefined;
}
/**
* Parse a cookie header.
*
* Parse the given cookie header string into an object
* The object has the various cookies as keys(names) => values
*/
export declare function parse(str: string, options?: ParseOptions): Record<string, string | undefined>;
/**
* Serialize options.
*/
export interface SerializeOptions {
/**
* Specifies a function that will be used to encode a [cookie-value](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1).
* Since value of a cookie has a limited character set (and must be a simple string), this function can be used to encode
* a value into a string suited for a cookie's value, and should mirror `decode` when parsing.
*
* @default encodeURIComponent
*/
encode?: (str: string) => string;
/**
* Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.2).
*
* The [cookie storage model specification](https://tools.ietf.org/html/rfc6265#section-5.3) states that if both `expires` and
* `maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
* so if both are set, they should point to the same date and time.
*/
maxAge?: number;
/**
* Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.1).
* When no expiration is set clients consider this a "non-persistent cookie" and delete it the current session is over.
*
* The [cookie storage model specification](https://tools.ietf.org/html/rfc6265#section-5.3) states that if both `expires` and
* `maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
* so if both are set, they should point to the same date and time.
*/
expires?: Date;
/**
* Specifies the value for the [`Domain` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.3).
* When no domain is set clients consider the cookie to apply to the current domain only.
*/
domain?: string;
/**
* Specifies the value for the [`Path` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.4).
* When no path is set, the path is considered the ["default path"](https://tools.ietf.org/html/rfc6265#section-5.1.4).
*/
path?: string;
/**
* Enables the [`HttpOnly` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.6).
* When enabled, clients will not allow client-side JavaScript to see the cookie in `document.cookie`.
*/
httpOnly?: boolean;
/**
* Enables the [`Secure` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.5).
* When enabled, clients will only send the cookie back if the browser has a HTTPS connection.
*/
secure?: boolean;
/**
* Enables the [`Partitioned` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/).
* When enabled, clients will only send the cookie back when the current domain _and_ top-level domain matches.
*
* This is an attribute that has not yet been fully standardized, and may change in the future.
* This also means clients may ignore this attribute until they understand it. More information
* about can be found in [the proposal](https://github.com/privacycg/CHIPS).
*/
partitioned?: boolean;
/**
* Specifies the value for the [`Priority` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
*
* - `'low'` will set the `Priority` attribute to `Low`.
* - `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
* - `'high'` will set the `Priority` attribute to `High`.
*
* More information about priority levels can be found in [the specification](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
*/
priority?: "low" | "medium" | "high";
/**
* Specifies the value for the [`SameSite` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7).
*
* - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
* - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
* - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie.
* - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
*
* More information about enforcement levels can be found in [the specification](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7).
*/
sameSite?: boolean | "lax" | "strict" | "none";
}
/**
* Serialize data into a cookie header.
*
* Serialize a name value pair into a cookie string suitable for
* http headers. An optional options object specifies cookie parameters.
*
* serialize('foo', 'bar', { httpOnly: true })
* => "foo=bar; httpOnly"
*/
export declare function serialize(name: string, val: string, options?: SerializeOptions): string;

View File

@@ -0,0 +1,239 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.serialize = serialize;
/**
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
* This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
* which has been replaced by the token definition in RFC 7230 appendix B.
*
* cookie-name = token
* token = 1*tchar
* tchar = "!" / "#" / "$" / "%" / "&" / "'" /
* "*" / "+" / "-" / "." / "^" / "_" /
* "`" / "|" / "~" / DIGIT / ALPHA
*
* Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191
* Allow same range as cookie value, except `=`, which delimits end of name.
*/
const cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
/**
* RegExp to match cookie-value in RFC 6265 sec 4.1.1
*
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
* ; US-ASCII characters excluding CTLs,
* ; whitespace DQUOTE, comma, semicolon,
* ; and backslash
*
* Allowing more characters: https://github.com/jshttp/cookie/issues/191
* Comma, backslash, and DQUOTE are not part of the parsing algorithm.
*/
const cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
/**
* RegExp to match domain-value in RFC 6265 sec 4.1.1
*
* domain-value = <subdomain>
* ; defined in [RFC1034], Section 3.5, as
* ; enhanced by [RFC1123], Section 2.1
* <subdomain> = <label> | <subdomain> "." <label>
* <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
* Labels must be 63 characters or less.
* 'let-dig' not 'letter' in the first char, per RFC1123
* <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
* <let-dig-hyp> = <let-dig> | "-"
* <let-dig> = <letter> | <digit>
* <letter> = any one of the 52 alphabetic characters A through Z in
* upper case and a through z in lower case
* <digit> = any one of the ten digits 0 through 9
*
* Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
*
* > (Note that a leading %x2E ("."), if present, is ignored even though that
* character is not permitted, but a trailing %x2E ("."), if present, will
* cause the user agent to ignore the attribute.)
*/
const domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
/**
* RegExp to match path-value in RFC 6265 sec 4.1.1
*
* path-value = <any CHAR except CTLs or ";">
* CHAR = %x01-7F
* ; defined in RFC 5234 appendix B.1
*/
const pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
const __toString = Object.prototype.toString;
const NullObject = /* @__PURE__ */ (() => {
const C = function () { };
C.prototype = Object.create(null);
return C;
})();
/**
* Parse a cookie header.
*
* Parse the given cookie header string into an object
* The object has the various cookies as keys(names) => values
*/
function parse(str, options) {
const obj = new NullObject();
const len = str.length;
// RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
if (len < 2)
return obj;
const dec = options?.decode || decode;
let index = 0;
do {
const eqIdx = str.indexOf("=", index);
if (eqIdx === -1)
break; // No more cookie pairs.
const colonIdx = str.indexOf(";", index);
const endIdx = colonIdx === -1 ? len : colonIdx;
if (eqIdx > endIdx) {
// backtrack on prior semicolon
index = str.lastIndexOf(";", eqIdx - 1) + 1;
continue;
}
const keyStartIdx = startIndex(str, index, eqIdx);
const keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
const key = str.slice(keyStartIdx, keyEndIdx);
// only assign once
if (obj[key] === undefined) {
let valStartIdx = startIndex(str, eqIdx + 1, endIdx);
let valEndIdx = endIndex(str, endIdx, valStartIdx);
const value = dec(str.slice(valStartIdx, valEndIdx));
obj[key] = value;
}
index = endIdx + 1;
} while (index < len);
return obj;
}
function startIndex(str, index, max) {
do {
const code = str.charCodeAt(index);
if (code !== 0x20 /* */ && code !== 0x09 /* \t */)
return index;
} while (++index < max);
return max;
}
function endIndex(str, index, min) {
while (index > min) {
const code = str.charCodeAt(--index);
if (code !== 0x20 /* */ && code !== 0x09 /* \t */)
return index + 1;
}
return min;
}
/**
* Serialize data into a cookie header.
*
* Serialize a name value pair into a cookie string suitable for
* http headers. An optional options object specifies cookie parameters.
*
* serialize('foo', 'bar', { httpOnly: true })
* => "foo=bar; httpOnly"
*/
function serialize(name, val, options) {
const enc = options?.encode || encodeURIComponent;
if (!cookieNameRegExp.test(name)) {
throw new TypeError(`argument name is invalid: ${name}`);
}
const value = enc(val);
if (!cookieValueRegExp.test(value)) {
throw new TypeError(`argument val is invalid: ${val}`);
}
let str = name + "=" + value;
if (!options)
return str;
if (options.maxAge !== undefined) {
if (!Number.isInteger(options.maxAge)) {
throw new TypeError(`option maxAge is invalid: ${options.maxAge}`);
}
str += "; Max-Age=" + options.maxAge;
}
if (options.domain) {
if (!domainValueRegExp.test(options.domain)) {
throw new TypeError(`option domain is invalid: ${options.domain}`);
}
str += "; Domain=" + options.domain;
}
if (options.path) {
if (!pathValueRegExp.test(options.path)) {
throw new TypeError(`option path is invalid: ${options.path}`);
}
str += "; Path=" + options.path;
}
if (options.expires) {
if (!isDate(options.expires) ||
!Number.isFinite(options.expires.valueOf())) {
throw new TypeError(`option expires is invalid: ${options.expires}`);
}
str += "; Expires=" + options.expires.toUTCString();
}
if (options.httpOnly) {
str += "; HttpOnly";
}
if (options.secure) {
str += "; Secure";
}
if (options.partitioned) {
str += "; Partitioned";
}
if (options.priority) {
const priority = typeof options.priority === "string"
? options.priority.toLowerCase()
: undefined;
switch (priority) {
case "low":
str += "; Priority=Low";
break;
case "medium":
str += "; Priority=Medium";
break;
case "high":
str += "; Priority=High";
break;
default:
throw new TypeError(`option priority is invalid: ${options.priority}`);
}
}
if (options.sameSite) {
const sameSite = typeof options.sameSite === "string"
? options.sameSite.toLowerCase()
: options.sameSite;
switch (sameSite) {
case true:
case "strict":
str += "; SameSite=Strict";
break;
case "lax":
str += "; SameSite=Lax";
break;
case "none":
str += "; SameSite=None";
break;
default:
throw new TypeError(`option sameSite is invalid: ${options.sameSite}`);
}
}
return str;
}
/**
* URL-decode string value. Optimized to skip native call when no %.
*/
function decode(str) {
if (str.indexOf("%") === -1)
return str;
try {
return decodeURIComponent(str);
}
catch (e) {
return str;
}
}
/**
* Determine if value is a Date.
*/
function isDate(val) {
return __toString.call(val) === "[object Date]";
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,42 @@
{
"name": "cookie",
"version": "1.0.2",
"description": "HTTP server cookie parsing and serialization",
"keywords": [
"cookie",
"cookies"
],
"repository": "jshttp/cookie",
"license": "MIT",
"author": "Roman Shtylman <shtylman@gmail.com>",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/"
],
"scripts": {
"bench": "vitest bench",
"build": "ts-scripts build",
"format": "ts-scripts format",
"prepare": "ts-scripts install",
"prepublishOnly": "npm run build",
"specs": "ts-scripts specs",
"test": "ts-scripts test"
},
"devDependencies": {
"@borderless/ts-scripts": "^0.15.0",
"@vitest/coverage-v8": "^2.1.2",
"top-sites": "1.1.194",
"typescript": "^5.6.2",
"vitest": "^2.1.2"
},
"engines": {
"node": ">=18"
},
"ts-scripts": {
"project": "tsconfig.build.json"
}
}

View File

@@ -0,0 +1,23 @@
MIT License
Copyright (c) React Training LLC 2015-2019
Copyright (c) Remix Software Inc. 2020-2021
Copyright (c) Shopify Inc. 2022-2023
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.

View File

@@ -0,0 +1,6 @@
This package simply re-exports everything from `react-router` to smooth the upgrade path for v6 applications. Once upgraded you can change all of your imports and remove it from your dependencies:
```diff
-import { Routes } from "react-router-dom"
+import { Routes } from "react-router"
```

View File

@@ -0,0 +1,2 @@
export { HydratedRouter, RouterProvider, RouterProviderProps } from 'react-router/dom';
export * from 'react-router';

View File

@@ -0,0 +1,2 @@
export { HydratedRouter, RouterProvider, RouterProviderProps } from 'react-router/dom';
export * from 'react-router';

View File

@@ -0,0 +1,45 @@
/**
* react-router-dom v7.8.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// index.ts
var index_exports = {};
__export(index_exports, {
HydratedRouter: () => import_dom.HydratedRouter,
RouterProvider: () => import_dom.RouterProvider
});
module.exports = __toCommonJS(index_exports);
var import_dom = require("react-router/dom");
__reExport(index_exports, require("react-router"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
HydratedRouter,
RouterProvider,
...require("react-router")
});

View File

@@ -0,0 +1,18 @@
/**
* react-router-dom v7.8.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
// index.ts
import { HydratedRouter, RouterProvider } from "react-router/dom";
export * from "react-router";
export {
HydratedRouter,
RouterProvider
};

View File

@@ -0,0 +1,82 @@
{
"name": "react-router-dom",
"version": "7.8.2",
"description": "Declarative routing for React web applications",
"keywords": [
"react",
"router",
"route",
"routing",
"history",
"link"
],
"repository": {
"type": "git",
"url": "https://github.com/remix-run/react-router",
"directory": "packages/react-router-dom"
},
"license": "MIT",
"author": "Remix Software <hello@remix.run>",
"sideEffects": false,
"main": "./dist/main.js",
"unpkg": "./dist/umd/react-router-dom.production.min.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"node": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./package.json": "./package.json"
},
"wireit": {
"build": {
"command": "tsup",
"files": [
"*.ts",
"tsconfig.json",
"package.json"
],
"output": [
"dist/**"
]
}
},
"dependencies": {
"react-router": "7.8.2"
},
"devDependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tsup": "^8.3.0",
"typescript": "^5.1.6",
"wireit": "0.14.9"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
},
"files": [
"dist/",
"LICENSE.md",
"README.md"
],
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"build": "wireit",
"typecheck": "tsc"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
MIT License
Copyright (c) React Training LLC 2015-2019
Copyright (c) Remix Software Inc. 2020-2021
Copyright (c) Shopify Inc. 2022-2023
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.

View File

@@ -0,0 +1,7 @@
`react-router` is the primary package in the React Router project.
## Installation
```sh
npm i react-router
```

View File

@@ -0,0 +1,46 @@
declare global {
interface Window {
__FLIGHT_DATA: any[];
}
}
/**
* Get the prerendered [RSC](https://react.dev/reference/rsc/server-components)
* stream for hydration. Usually passed directly to your
* `react-server-dom-xyz/client`'s `createFromReadableStream`.
*
* @example
* import { startTransition, StrictMode } from "react";
* import { hydrateRoot } from "react-dom/client";
* import {
* unstable_getRSCStream as getRSCStream,
* unstable_RSCHydratedRouter as RSCHydratedRouter,
* } from "react-router";
* import type { unstable_RSCPayload as RSCPayload } from "react-router";
*
* createFromReadableStream(getRSCStream()).then(
* (payload: RSCServerPayload) => {
* startTransition(async () => {
* hydrateRoot(
* document,
* <StrictMode>
* <RSCHydratedRouter {...props} />
* </StrictMode>,
* {
* // Options
* }
* );
* });
* }
* );
*
* @name unstable_getRSCStream
* @public
* @category RSC
* @mode data
* @returns A [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
* that contains the [RSC](https://react.dev/reference/rsc/server-components)
* data for hydration.
*/
declare function getRSCStream(): ReadableStream;
export { getRSCStream as g };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
import * as React from 'react';
import { R as RouterProviderProps$1, a as RouterInit, u as unstable_ClientOnErrorFunction } from './context-jKip1TFB.mjs';
import './browser-z32v5KVN.mjs';
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
/**
* Props for the {@link dom.HydratedRouter} component.
*
* @category Types
*/
interface HydratedRouterProps {
/**
* Context object to be passed through to {@link createBrowserRouter} and made
* available to
* [`clientAction`](../../start/framework/route-module#clientAction)/[`clientLoader`](../../start/framework/route-module#clientLoader)
* functions
*/
unstable_getContext?: RouterInit["unstable_getContext"];
/**
* An error handler function that will be called for any loader/action/render
* errors that are encountered in your application. This is useful for
* logging or reporting errors instead of the `ErrorBoundary` because it's not
* subject to re-rendering and will only run one time per error.
*
* The `errorInfo` parameter is passed along from
* [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
* and is only present for render errors.
*
* ```tsx
* <HydratedRouter unstable_onError={(error, errorInfo) => {
* console.error(error, errorInfo);
* reportToErrorService(error, errorInfo);
* }} />
* ```
*/
unstable_onError?: unstable_ClientOnErrorFunction;
}
/**
* Framework-mode router component to be used to hydrate a router from a
* {@link ServerRouter}. See [`entry.client.tsx`](../framework-conventions/entry.client.tsx).
*
* @public
* @category Framework Routers
* @mode framework
* @param props Props
* @param {dom.HydratedRouterProps.unstable_getContext} props.unstable_getContext n/a
* @param {dom.HydratedRouterProps.unstable_onError} props.unstable_onError n/a
* @returns A React element that represents the hydrated application.
*/
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
export { HydratedRouter, type HydratedRouterProps, RouterProvider, type RouterProviderProps };

View File

@@ -0,0 +1,53 @@
import * as React from 'react';
import { RouterProviderProps as RouterProviderProps$1, RouterInit, unstable_ClientOnErrorFunction } from 'react-router';
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
/**
* Props for the {@link dom.HydratedRouter} component.
*
* @category Types
*/
interface HydratedRouterProps {
/**
* Context object to be passed through to {@link createBrowserRouter} and made
* available to
* [`clientAction`](../../start/framework/route-module#clientAction)/[`clientLoader`](../../start/framework/route-module#clientLoader)
* functions
*/
unstable_getContext?: RouterInit["unstable_getContext"];
/**
* An error handler function that will be called for any loader/action/render
* errors that are encountered in your application. This is useful for
* logging or reporting errors instead of the `ErrorBoundary` because it's not
* subject to re-rendering and will only run one time per error.
*
* The `errorInfo` parameter is passed along from
* [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
* and is only present for render errors.
*
* ```tsx
* <HydratedRouter unstable_onError={(error, errorInfo) => {
* console.error(error, errorInfo);
* reportToErrorService(error, errorInfo);
* }} />
* ```
*/
unstable_onError?: unstable_ClientOnErrorFunction;
}
/**
* Framework-mode router component to be used to hydrate a router from a
* {@link ServerRouter}. See [`entry.client.tsx`](../framework-conventions/entry.client.tsx).
*
* @public
* @category Framework Routers
* @mode framework
* @param props Props
* @param {dom.HydratedRouterProps.unstable_getContext} props.unstable_getContext n/a
* @param {dom.HydratedRouterProps.unstable_onError} props.unstable_onError n/a
* @returns A React element that represents the hydrated application.
*/
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
export { HydratedRouter, type HydratedRouterProps, RouterProvider, type RouterProviderProps };

View File

@@ -0,0 +1,240 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
* react-router v7.8.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
"use client";
var _chunkZO66TDGBjs = require('./chunk-ZO66TDGB.js');
// lib/dom-export/dom-router-provider.tsx
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
var _reactdom = require('react-dom'); var ReactDOM = _interopRequireWildcard(_reactdom);
var _reactrouter = require('react-router');
function RouterProvider(props) {
return /* @__PURE__ */ React.createElement(_reactrouter.RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
}
// lib/dom-export/hydrated-router.tsx
var ssrInfo = null;
var router = null;
function initSsrInfo() {
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
if (window.__reactRouterManifest.sri === true) {
const importMap = document.querySelector("script[rr-importmap]");
if (_optionalChain([importMap, 'optionalAccess', _ => _.textContent])) {
try {
window.__reactRouterManifest.sri = JSON.parse(
importMap.textContent
).integrity;
} catch (err) {
console.error("Failed to parse import map", err);
}
}
}
ssrInfo = {
context: window.__reactRouterContext,
manifest: window.__reactRouterManifest,
routeModules: window.__reactRouterRouteModules,
stateDecodingPromise: void 0,
router: void 0,
routerInitialized: false
};
}
}
function createHydratedRouter({
unstable_getContext
}) {
initSsrInfo();
if (!ssrInfo) {
throw new Error(
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
);
}
let localSsrInfo = ssrInfo;
if (!ssrInfo.stateDecodingPromise) {
let stream = ssrInfo.context.stream;
_reactrouter.UNSAFE_invariant.call(void 0, stream, "No stream found for single fetch decoding");
ssrInfo.context.stream = void 0;
ssrInfo.stateDecodingPromise = _reactrouter.UNSAFE_decodeViaTurboStream.call(void 0, stream, window).then((value) => {
ssrInfo.context.state = value.value;
localSsrInfo.stateDecodingPromise.value = true;
}).catch((e) => {
localSsrInfo.stateDecodingPromise.error = e;
});
}
if (ssrInfo.stateDecodingPromise.error) {
throw ssrInfo.stateDecodingPromise.error;
}
if (!ssrInfo.stateDecodingPromise.value) {
throw ssrInfo.stateDecodingPromise;
}
let routes = _reactrouter.UNSAFE_createClientRoutes.call(void 0,
ssrInfo.manifest.routes,
ssrInfo.routeModules,
ssrInfo.context.state,
ssrInfo.context.ssr,
ssrInfo.context.isSpaMode
);
let hydrationData = void 0;
if (ssrInfo.context.isSpaMode) {
let { loaderData } = ssrInfo.context.state;
if (_optionalChain([ssrInfo, 'access', _2 => _2.manifest, 'access', _3 => _3.routes, 'access', _4 => _4.root, 'optionalAccess', _5 => _5.hasLoader]) && loaderData && "root" in loaderData) {
hydrationData = {
loaderData: {
root: loaderData.root
}
};
}
} else {
hydrationData = _reactrouter.UNSAFE_getHydrationData.call(void 0,
ssrInfo.context.state,
routes,
(routeId) => ({
clientLoader: _optionalChain([ssrInfo, 'access', _6 => _6.routeModules, 'access', _7 => _7[routeId], 'optionalAccess', _8 => _8.clientLoader]),
hasLoader: _optionalChain([ssrInfo, 'access', _9 => _9.manifest, 'access', _10 => _10.routes, 'access', _11 => _11[routeId], 'optionalAccess', _12 => _12.hasLoader]) === true,
hasHydrateFallback: _optionalChain([ssrInfo, 'access', _13 => _13.routeModules, 'access', _14 => _14[routeId], 'optionalAccess', _15 => _15.HydrateFallback]) != null
}),
window.location,
_optionalChain([window, 'access', _16 => _16.__reactRouterContext, 'optionalAccess', _17 => _17.basename]),
ssrInfo.context.isSpaMode
);
if (hydrationData && hydrationData.errors) {
hydrationData.errors = _reactrouter.UNSAFE_deserializeErrors.call(void 0, hydrationData.errors);
}
}
let router2 = _reactrouter.UNSAFE_createRouter.call(void 0, {
routes,
history: _reactrouter.UNSAFE_createBrowserHistory.call(void 0, ),
basename: ssrInfo.context.basename,
unstable_getContext,
hydrationData,
hydrationRouteProperties: _reactrouter.UNSAFE_hydrationRouteProperties,
mapRouteProperties: _reactrouter.UNSAFE_mapRouteProperties,
future: {
unstable_middleware: ssrInfo.context.future.unstable_middleware
},
dataStrategy: _reactrouter.UNSAFE_getTurboStreamSingleFetchDataStrategy.call(void 0,
() => router2,
ssrInfo.manifest,
ssrInfo.routeModules,
ssrInfo.context.ssr,
ssrInfo.context.basename
),
patchRoutesOnNavigation: _reactrouter.UNSAFE_getPatchRoutesOnNavigationFunction.call(void 0,
ssrInfo.manifest,
ssrInfo.routeModules,
ssrInfo.context.ssr,
ssrInfo.context.routeDiscovery,
ssrInfo.context.isSpaMode,
ssrInfo.context.basename
)
});
ssrInfo.router = router2;
if (router2.state.initialized) {
ssrInfo.routerInitialized = true;
router2.initialize();
}
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
_reactrouter.UNSAFE_createClientRoutesWithHMRRevalidationOptOut;
window.__reactRouterDataRouter = router2;
return router2;
}
function HydratedRouter(props) {
if (!router) {
router = createHydratedRouter({
unstable_getContext: props.unstable_getContext
});
}
let [criticalCss, setCriticalCss] = React2.useState(
process.env.NODE_ENV === "development" ? _optionalChain([ssrInfo, 'optionalAccess', _18 => _18.context, 'access', _19 => _19.criticalCss]) : void 0
);
React2.useEffect(() => {
if (process.env.NODE_ENV === "development") {
setCriticalCss(void 0);
}
}, []);
React2.useEffect(() => {
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
document.querySelectorAll(`[${_chunkZO66TDGBjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
}
}, [criticalCss]);
let [location, setLocation] = React2.useState(router.state.location);
React2.useLayoutEffect(() => {
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
ssrInfo.routerInitialized = true;
ssrInfo.router.initialize();
}
}, []);
React2.useLayoutEffect(() => {
if (ssrInfo && ssrInfo.router) {
return ssrInfo.router.subscribe((newState) => {
if (newState.location !== location) {
setLocation(newState.location);
}
});
}
}, [location]);
_reactrouter.UNSAFE_invariant.call(void 0, ssrInfo, "ssrInfo unavailable for HydratedRouter");
_reactrouter.UNSAFE_useFogOFWarDiscovery.call(void 0,
router,
ssrInfo.manifest,
ssrInfo.routeModules,
ssrInfo.context.ssr,
ssrInfo.context.routeDiscovery,
ssrInfo.context.isSpaMode
);
return (
// This fragment is important to ensure we match the <ServerRouter> JSX
// structure so that useId values hydrate correctly
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
_reactrouter.UNSAFE_FrameworkContext.Provider,
{
value: {
manifest: ssrInfo.manifest,
routeModules: ssrInfo.routeModules,
future: ssrInfo.context.future,
criticalCss,
ssr: ssrInfo.context.ssr,
isSpaMode: ssrInfo.context.isSpaMode,
routeDiscovery: ssrInfo.context.routeDiscovery
}
},
/* @__PURE__ */ React2.createElement(_reactrouter.UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
RouterProvider,
{
router,
unstable_onError: props.unstable_onError
}
))
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
);
}
exports.HydratedRouter = HydratedRouter; exports.RouterProvider = RouterProvider;

View File

@@ -0,0 +1,240 @@
/**
* react-router v7.8.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
"use client";
import {
deserializeErrors,
getHydrationData
} from "./chunk-5UALIXAM.mjs";
import {
CRITICAL_CSS_DATA_ATTRIBUTE,
FrameworkContext,
RemixErrorBoundary,
RouterProvider,
createBrowserHistory,
createClientRoutes,
createClientRoutesWithHMRRevalidationOptOut,
createRouter,
decodeViaTurboStream,
getPatchRoutesOnNavigationFunction,
getTurboStreamSingleFetchDataStrategy,
hydrationRouteProperties,
invariant,
mapRouteProperties,
useFogOFWarDiscovery
} from "./chunk-PVWAREVJ.mjs";
// lib/dom-export/dom-router-provider.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
function RouterProvider2(props) {
return /* @__PURE__ */ React.createElement(RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
}
// lib/dom-export/hydrated-router.tsx
import * as React2 from "react";
var ssrInfo = null;
var router = null;
function initSsrInfo() {
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
if (window.__reactRouterManifest.sri === true) {
const importMap = document.querySelector("script[rr-importmap]");
if (importMap?.textContent) {
try {
window.__reactRouterManifest.sri = JSON.parse(
importMap.textContent
).integrity;
} catch (err) {
console.error("Failed to parse import map", err);
}
}
}
ssrInfo = {
context: window.__reactRouterContext,
manifest: window.__reactRouterManifest,
routeModules: window.__reactRouterRouteModules,
stateDecodingPromise: void 0,
router: void 0,
routerInitialized: false
};
}
}
function createHydratedRouter({
unstable_getContext
}) {
initSsrInfo();
if (!ssrInfo) {
throw new Error(
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
);
}
let localSsrInfo = ssrInfo;
if (!ssrInfo.stateDecodingPromise) {
let stream = ssrInfo.context.stream;
invariant(stream, "No stream found for single fetch decoding");
ssrInfo.context.stream = void 0;
ssrInfo.stateDecodingPromise = decodeViaTurboStream(stream, window).then((value) => {
ssrInfo.context.state = value.value;
localSsrInfo.stateDecodingPromise.value = true;
}).catch((e) => {
localSsrInfo.stateDecodingPromise.error = e;
});
}
if (ssrInfo.stateDecodingPromise.error) {
throw ssrInfo.stateDecodingPromise.error;
}
if (!ssrInfo.stateDecodingPromise.value) {
throw ssrInfo.stateDecodingPromise;
}
let routes = createClientRoutes(
ssrInfo.manifest.routes,
ssrInfo.routeModules,
ssrInfo.context.state,
ssrInfo.context.ssr,
ssrInfo.context.isSpaMode
);
let hydrationData = void 0;
if (ssrInfo.context.isSpaMode) {
let { loaderData } = ssrInfo.context.state;
if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && "root" in loaderData) {
hydrationData = {
loaderData: {
root: loaderData.root
}
};
}
} else {
hydrationData = getHydrationData(
ssrInfo.context.state,
routes,
(routeId) => ({
clientLoader: ssrInfo.routeModules[routeId]?.clientLoader,
hasLoader: ssrInfo.manifest.routes[routeId]?.hasLoader === true,
hasHydrateFallback: ssrInfo.routeModules[routeId]?.HydrateFallback != null
}),
window.location,
window.__reactRouterContext?.basename,
ssrInfo.context.isSpaMode
);
if (hydrationData && hydrationData.errors) {
hydrationData.errors = deserializeErrors(hydrationData.errors);
}
}
let router2 = createRouter({
routes,
history: createBrowserHistory(),
basename: ssrInfo.context.basename,
unstable_getContext,
hydrationData,
hydrationRouteProperties,
mapRouteProperties,
future: {
unstable_middleware: ssrInfo.context.future.unstable_middleware
},
dataStrategy: getTurboStreamSingleFetchDataStrategy(
() => router2,
ssrInfo.manifest,
ssrInfo.routeModules,
ssrInfo.context.ssr,
ssrInfo.context.basename
),
patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
ssrInfo.manifest,
ssrInfo.routeModules,
ssrInfo.context.ssr,
ssrInfo.context.routeDiscovery,
ssrInfo.context.isSpaMode,
ssrInfo.context.basename
)
});
ssrInfo.router = router2;
if (router2.state.initialized) {
ssrInfo.routerInitialized = true;
router2.initialize();
}
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
createClientRoutesWithHMRRevalidationOptOut;
window.__reactRouterDataRouter = router2;
return router2;
}
function HydratedRouter(props) {
if (!router) {
router = createHydratedRouter({
unstable_getContext: props.unstable_getContext
});
}
let [criticalCss, setCriticalCss] = React2.useState(
process.env.NODE_ENV === "development" ? ssrInfo?.context.criticalCss : void 0
);
React2.useEffect(() => {
if (process.env.NODE_ENV === "development") {
setCriticalCss(void 0);
}
}, []);
React2.useEffect(() => {
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
document.querySelectorAll(`[${CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
}
}, [criticalCss]);
let [location, setLocation] = React2.useState(router.state.location);
React2.useLayoutEffect(() => {
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
ssrInfo.routerInitialized = true;
ssrInfo.router.initialize();
}
}, []);
React2.useLayoutEffect(() => {
if (ssrInfo && ssrInfo.router) {
return ssrInfo.router.subscribe((newState) => {
if (newState.location !== location) {
setLocation(newState.location);
}
});
}
}, [location]);
invariant(ssrInfo, "ssrInfo unavailable for HydratedRouter");
useFogOFWarDiscovery(
router,
ssrInfo.manifest,
ssrInfo.routeModules,
ssrInfo.context.ssr,
ssrInfo.context.routeDiscovery,
ssrInfo.context.isSpaMode
);
return (
// This fragment is important to ensure we match the <ServerRouter> JSX
// structure so that useId values hydrate correctly
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
FrameworkContext.Provider,
{
value: {
manifest: ssrInfo.manifest,
routeModules: ssrInfo.routeModules,
future: ssrInfo.context.future,
criticalCss,
ssr: ssrInfo.context.ssr,
isSpaMode: ssrInfo.context.isSpaMode,
routeDiscovery: ssrInfo.context.routeDiscovery
}
},
/* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
RouterProvider2,
{
router,
unstable_onError: props.unstable_onError
}
))
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
);
}
export {
HydratedRouter,
RouterProvider2 as RouterProvider
};

View File

@@ -0,0 +1,4 @@
export { aC as Await, aD as MemoryRouter, aE as Navigate, aF as Outlet, aG as Route, aH as Router, aI as RouterProvider, aJ as Routes, b0 as UNSAFE_WithComponentProps, b4 as UNSAFE_WithErrorBoundaryProps, b2 as UNSAFE_WithHydrateFallbackProps } from './context-jKip1TFB.mjs';
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-DRhjXpk2.mjs';
import 'react';
import './route-data-DAVP2QQ0.mjs';

View File

@@ -0,0 +1,3 @@
export { aW as Await, aX as MemoryRouter, aY as Navigate, aZ as Outlet, a_ as Route, a$ as Router, b0 as RouterProvider, b1 as Routes, br as UNSAFE_WithComponentProps, bv as UNSAFE_WithErrorBoundaryProps, bt as UNSAFE_WithHydrateFallbackProps } from './routeModules-rOzWJJ9x.js';
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-BKpa2trA.js';
import 'react';

View File

@@ -0,0 +1,61 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
* react-router v7.8.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
"use client";
var _chunkCSDGKXLRjs = require('./chunk-CSDGKXLR.js');
var _chunkZO66TDGBjs = require('./chunk-ZO66TDGB.js');
exports.Await = _chunkCSDGKXLRjs.Await; exports.BrowserRouter = _chunkCSDGKXLRjs.BrowserRouter; exports.Form = _chunkCSDGKXLRjs.Form; exports.HashRouter = _chunkCSDGKXLRjs.HashRouter; exports.Link = _chunkCSDGKXLRjs.Link; exports.Links = _chunkZO66TDGBjs.Links; exports.MemoryRouter = _chunkCSDGKXLRjs.MemoryRouter; exports.Meta = _chunkZO66TDGBjs.Meta; exports.NavLink = _chunkCSDGKXLRjs.NavLink; exports.Navigate = _chunkCSDGKXLRjs.Navigate; exports.Outlet = _chunkCSDGKXLRjs.Outlet; exports.Route = _chunkCSDGKXLRjs.Route; exports.Router = _chunkCSDGKXLRjs.Router; exports.RouterProvider = _chunkCSDGKXLRjs.RouterProvider; exports.Routes = _chunkCSDGKXLRjs.Routes; exports.ScrollRestoration = _chunkCSDGKXLRjs.ScrollRestoration; exports.StaticRouter = _chunkCSDGKXLRjs.StaticRouter; exports.StaticRouterProvider = _chunkCSDGKXLRjs.StaticRouterProvider; exports.UNSAFE_WithComponentProps = _chunkCSDGKXLRjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkCSDGKXLRjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkCSDGKXLRjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkCSDGKXLRjs.HistoryRouter;

View File

@@ -0,0 +1,59 @@
/**
* react-router v7.8.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
"use client";
import {
Await,
BrowserRouter,
Form,
HashRouter,
HistoryRouter,
Link,
Links,
MemoryRouter,
Meta,
NavLink,
Navigate,
Outlet,
Route,
Router,
RouterProvider,
Routes,
ScrollRestoration,
StaticRouter,
StaticRouterProvider,
WithComponentProps,
WithErrorBoundaryProps,
WithHydrateFallbackProps
} from "./chunk-PVWAREVJ.mjs";
export {
Await,
BrowserRouter,
Form,
HashRouter,
Link,
Links,
MemoryRouter,
Meta,
NavLink,
Navigate,
Outlet,
Route,
Router,
RouterProvider,
Routes,
ScrollRestoration,
StaticRouter,
StaticRouterProvider,
WithComponentProps as UNSAFE_WithComponentProps,
WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
HistoryRouter as unstable_HistoryRouter
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,273 @@
/**
* react-router v7.8.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
"use client";
import {
RSCDefaultRootErrorBoundary,
RSCHydratedRouter,
RSCStaticRouter,
ServerMode,
ServerRouter,
createCallServer,
createCookie,
createCookieSessionStorage,
createMemorySessionStorage,
createRequestHandler,
createRoutesStub,
createSession,
createSessionStorage,
deserializeErrors,
getHydrationData,
getRSCStream,
href,
isCookie,
isSession,
routeRSCServerRequest,
setDevServerHooks
} from "./chunk-5UALIXAM.mjs";
import {
Action,
Await,
BrowserRouter,
DataRouterContext,
DataRouterStateContext,
ErrorResponseImpl,
FetchersContext,
Form,
FrameworkContext,
HashRouter,
HistoryRouter,
IDLE_BLOCKER,
IDLE_FETCHER,
IDLE_NAVIGATION,
Link,
Links,
LocationContext,
MemoryRouter,
Meta,
NavLink,
Navigate,
NavigationContext,
Outlet,
PrefetchPageLinks,
RemixErrorBoundary,
Route,
RouteContext,
Router,
RouterProvider,
Routes,
Scripts,
ScrollRestoration,
SingleFetchRedirectSymbol,
StaticRouter,
StaticRouterProvider,
ViewTransitionContext,
WithComponentProps,
WithErrorBoundaryProps,
WithHydrateFallbackProps,
createBrowserHistory,
createBrowserRouter,
createClientRoutes,
createClientRoutesWithHMRRevalidationOptOut,
createHashRouter,
createMemoryRouter,
createPath,
createRouter,
createRoutesFromChildren,
createRoutesFromElements,
createSearchParams,
createStaticHandler2 as createStaticHandler,
createStaticRouter,
data,
decodeViaTurboStream,
generatePath,
getPatchRoutesOnNavigationFunction,
getTurboStreamSingleFetchDataStrategy,
hydrationRouteProperties,
invariant,
isRouteErrorResponse,
mapRouteProperties,
matchPath,
matchRoutes,
parsePath,
redirect,
redirectDocument,
renderMatches,
replace,
resolvePath,
shouldHydrateRouteLoader,
unstable_RouterContextProvider,
unstable_createContext,
useActionData,
useAsyncError,
useAsyncValue,
useBeforeUnload,
useBlocker,
useFetcher,
useFetchers,
useFogOFWarDiscovery,
useFormAction,
useHref,
useInRouterContext,
useLinkClickHandler,
useLoaderData,
useLocation,
useMatch,
useMatches,
useNavigate,
useNavigation,
useNavigationType,
useOutlet,
useOutletContext,
useParams,
usePrompt,
useResolvedPath,
useRevalidator,
useRouteError,
useRouteLoaderData,
useRoutes,
useScrollRestoration,
useSearchParams,
useSubmit,
useViewTransitionState,
withComponentProps,
withErrorBoundaryProps,
withHydrateFallbackProps
} from "./chunk-PVWAREVJ.mjs";
export {
Await,
BrowserRouter,
Form,
HashRouter,
IDLE_BLOCKER,
IDLE_FETCHER,
IDLE_NAVIGATION,
Link,
Links,
MemoryRouter,
Meta,
NavLink,
Navigate,
Action as NavigationType,
Outlet,
PrefetchPageLinks,
Route,
Router,
RouterProvider,
Routes,
Scripts,
ScrollRestoration,
ServerRouter,
StaticRouter,
StaticRouterProvider,
DataRouterContext as UNSAFE_DataRouterContext,
DataRouterStateContext as UNSAFE_DataRouterStateContext,
ErrorResponseImpl as UNSAFE_ErrorResponseImpl,
FetchersContext as UNSAFE_FetchersContext,
FrameworkContext as UNSAFE_FrameworkContext,
LocationContext as UNSAFE_LocationContext,
NavigationContext as UNSAFE_NavigationContext,
RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary,
RemixErrorBoundary as UNSAFE_RemixErrorBoundary,
RouteContext as UNSAFE_RouteContext,
ServerMode as UNSAFE_ServerMode,
SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol,
ViewTransitionContext as UNSAFE_ViewTransitionContext,
WithComponentProps as UNSAFE_WithComponentProps,
WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
createBrowserHistory as UNSAFE_createBrowserHistory,
createClientRoutes as UNSAFE_createClientRoutes,
createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
createRouter as UNSAFE_createRouter,
decodeViaTurboStream as UNSAFE_decodeViaTurboStream,
deserializeErrors as UNSAFE_deserializeErrors,
getHydrationData as UNSAFE_getHydrationData,
getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction,
getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy,
hydrationRouteProperties as UNSAFE_hydrationRouteProperties,
invariant as UNSAFE_invariant,
mapRouteProperties as UNSAFE_mapRouteProperties,
shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader,
useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery,
useScrollRestoration as UNSAFE_useScrollRestoration,
withComponentProps as UNSAFE_withComponentProps,
withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps,
withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps,
createBrowserRouter,
createCookie,
createCookieSessionStorage,
createHashRouter,
createMemoryRouter,
createMemorySessionStorage,
createPath,
createRequestHandler,
createRoutesFromChildren,
createRoutesFromElements,
createRoutesStub,
createSearchParams,
createSession,
createSessionStorage,
createStaticHandler,
createStaticRouter,
data,
generatePath,
href,
isCookie,
isRouteErrorResponse,
isSession,
matchPath,
matchRoutes,
parsePath,
redirect,
redirectDocument,
renderMatches,
replace,
resolvePath,
HistoryRouter as unstable_HistoryRouter,
RSCHydratedRouter as unstable_RSCHydratedRouter,
RSCStaticRouter as unstable_RSCStaticRouter,
unstable_RouterContextProvider,
createCallServer as unstable_createCallServer,
unstable_createContext,
getRSCStream as unstable_getRSCStream,
routeRSCServerRequest as unstable_routeRSCServerRequest,
setDevServerHooks as unstable_setDevServerHooks,
usePrompt as unstable_usePrompt,
useActionData,
useAsyncError,
useAsyncValue,
useBeforeUnload,
useBlocker,
useFetcher,
useFetchers,
useFormAction,
useHref,
useInRouterContext,
useLinkClickHandler,
useLoaderData,
useLocation,
useMatch,
useMatches,
useNavigate,
useNavigation,
useNavigationType,
useOutlet,
useOutletContext,
useParams,
useResolvedPath,
useRevalidator,
useRouteError,
useRouteLoaderData,
useRoutes,
useSearchParams,
useSubmit,
useViewTransitionState
};

View File

@@ -0,0 +1,160 @@
import { R as RouteModule, L as LinkDescriptor, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-DAVP2QQ0.mjs';
import { L as Location, b as unstable_MiddlewareNextFunction, D as DataStrategyResult } from '../../context-jKip1TFB.mjs';
import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.mjs';
import 'react';
type MaybePromise<T> = T | Promise<T>;
type Props = {
params: unknown;
loaderData: unknown;
actionData: unknown;
};
type RouteInfo = Props & {
module: RouteModule;
matches: Array<MatchInfo>;
};
type MatchInfo = {
id: string;
module: RouteModule;
};
type MetaMatch<T extends MatchInfo> = Pretty<{
id: T["id"];
params: Record<string, string | undefined>;
pathname: string;
meta: MetaDescriptor[];
/** @deprecated Use `MetaMatch.loaderData` instead */
data: GetLoaderData<T["module"]>;
loaderData: GetLoaderData<T["module"]>;
handle?: unknown;
error?: unknown;
}>;
type MetaMatches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<MatchInfo> | undefined>;
type HasErrorBoundary<T extends RouteInfo> = T["module"] extends {
ErrorBoundary: Func;
} ? true : false;
type CreateMetaArgs<T extends RouteInfo> = {
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
location: Location;
/** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
params: T["params"];
/**
* The return value for this route's server loader function
*
* @deprecated Use `Route.MetaArgs.loaderData` instead
*/
data: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
/** The return value for this route's server loader function */
loaderData: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
/** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
error?: unknown;
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
matches: MetaMatches<T["matches"]>;
};
type MetaDescriptors = MetaDescriptor[];
type HeadersArgs = {
loaderHeaders: Headers;
parentHeaders: Headers;
actionHeaders: Headers;
errorHeaders: Headers | undefined;
};
type CreateServerMiddlewareFunction<T extends RouteInfo> = (args: ServerDataFunctionArgs<T["params"]>, next: unstable_MiddlewareNextFunction<Response>) => MaybePromise<Response | void>;
type CreateClientMiddlewareFunction<T extends RouteInfo> = (args: ClientDataFunctionArgs<T["params"]>, next: unstable_MiddlewareNextFunction<Record<string, DataStrategyResult>>) => MaybePromise<Record<string, DataStrategyResult> | void>;
type CreateServerLoaderArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
type CreateClientLoaderArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
/** This is an asynchronous function to get the data from the server loader for this route. On client-side navigations, this will make a {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server loader. If you opt-into running your clientLoader on hydration, then this function will return the data that was already loaded on the server (via Promise.resolve). */
serverLoader: () => Promise<ServerDataFrom<T["module"]["loader"]>>;
};
type CreateServerActionArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
};
type CreateHydrateFallbackProps<T extends RouteInfo> = {
params: T["params"];
loaderData?: T["loaderData"];
actionData?: T["actionData"];
};
type Match<T extends MatchInfo> = Pretty<{
id: T["id"];
params: Record<string, string | undefined>;
pathname: string;
/** @deprecated Use `Match.loaderData` instead */
data: GetLoaderData<T["module"]>;
loaderData: GetLoaderData<T["module"]>;
handle: unknown;
}>;
type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
type CreateComponentProps<T extends RouteInfo> = {
/**
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
* @example
* // app/routes.ts
* route("teams/:teamId", "./team.tsx"),
*
* // app/team.tsx
* export default function Component({
* params,
* }: Route.ComponentProps) {
* params.teamId;
* // ^ string
* }
**/
params: T["params"];
/** The data returned from the `loader` or `clientLoader` */
loaderData: T["loaderData"];
/** The data returned from the `action` or `clientAction` following an action submission. */
actionData?: T["actionData"];
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
matches: Matches<T["matches"]>;
};
type CreateErrorBoundaryProps<T extends RouteInfo> = {
/**
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
* @example
* // app/routes.ts
* route("teams/:teamId", "./team.tsx"),
*
* // app/team.tsx
* export function ErrorBoundary({
* params,
* }: Route.ErrorBoundaryProps) {
* params.teamId;
* // ^ string
* }
**/
params: T["params"];
error: unknown;
loaderData?: T["loaderData"];
actionData?: T["actionData"];
};
type GetAnnotations<Info extends RouteInfo> = {
LinkDescriptors: LinkDescriptor[];
LinksFunction: () => LinkDescriptor[];
MetaArgs: CreateMetaArgs<Info>;
MetaDescriptors: MetaDescriptors;
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
HeadersArgs: HeadersArgs;
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
unstable_MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
unstable_ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
LoaderArgs: CreateServerLoaderArgs<Info>;
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
ActionArgs: CreateServerActionArgs<Info>;
ClientActionArgs: CreateClientActionArgs<Info>;
HydrateFallbackProps: CreateHydrateFallbackProps<Info>;
ComponentProps: CreateComponentProps<Info>;
ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
};
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
type GetInfo<T extends {
file: keyof RouteFiles;
module: RouteModule;
}> = {
params: Params<T["file"]>;
loaderData: GetLoaderData<T["module"]>;
actionData: GetActionData<T["module"]>;
};
export type { GetAnnotations, GetInfo };

Some files were not shown because too many files have changed in this diff Show More