fix(src): 从版本库移除 node_modules_old 依赖缓存污染
此前提交误将 src/frontend-h5/node_modules_old(11071 个依赖缓存文件)纳入版本控制。 本次基于已净化的索引生成新树, 彻底剔除该污染: - .gitignore 新增 **/node_modules_*/ 排除规则, 防止再次误入 - .gitignore 根 data/ 锚定为 /data/, 避免误伤 src/.../data/ 真实源码 - 补入被误伤源码: seed_quiz.py / seed_rbac.py / qrData.ts
This commit is contained in:
+2
-1
@@ -246,9 +246,10 @@ tools/
|
||||
chat_export/
|
||||
deliverables/
|
||||
02meiti/
|
||||
data/
|
||||
/data/
|
||||
|
||||
# === src/ 专用: 构建产物与运行期上传 (2026-08-08 将 src/ 纳入版本控制时补充) ===
|
||||
# 活跃前端/后端源码需入仓; 以下生成物与运行数据排除
|
||||
src/backend/uploads/
|
||||
src/frontend-*/dist*/
|
||||
**/node_modules_*/
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
# =============================================================================
|
||||
# 企微IT智能服务台 — 测验题目种子数据
|
||||
# =============================================================================
|
||||
# 说明:启动时调用,如果 quiz_questions 表为空:
|
||||
# 1. 调用 Dify API 生成 70 道知识题(7 类 × 10 题),is_active=True
|
||||
# 2. 插入手写诊断模板(7 个,每类 1 个),is_active=True
|
||||
#
|
||||
# 降级策略:Dify 不可用时记录错误,不阻塞启动
|
||||
# 管理员后续可通过 POST /api/admin/quiz/generate 手动触发生成
|
||||
#
|
||||
# 幂等性:已有数据时跳过(不重复插入)
|
||||
# =============================================================================
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from sqlalchemy import select, func
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.models.quiz import QuizQuestion
|
||||
from app.models.diagnostic import DiagnosticTemplate
|
||||
from app.services.quiz_generation_service import get_quiz_generation_service
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 7 个类别,每个类别生成 10 道知识题
|
||||
SEED_CATEGORIES = ["network", "vpn", "email", "system", "printer", "security", "office"]
|
||||
SEED_QUESTIONS_PER_CATEGORY = 10
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# 手写诊断模板种子数据(7 个,每类 1 个)
|
||||
# 这些模板包含 PowerShell 脚本,需精确控制,不由 AI 生成
|
||||
# =============================================================================
|
||||
|
||||
SEED_DIAGNOSTIC_TEMPLATES: List[Dict[str, Any]] = [
|
||||
{
|
||||
"category": "network",
|
||||
"name": "网关连通性检测",
|
||||
"check_type": "script",
|
||||
"script_template": (
|
||||
"# 检测默认网关是否可达\n"
|
||||
"$gateway = (Get-NetRoute -DestinationPrefix '0.0.0.0/0' | "
|
||||
"Select-Object -First 1).NextHop\n"
|
||||
"if ($gateway) {\n"
|
||||
" $result = Test-Connection -ComputerName $gateway -Count 4 -Quiet\n"
|
||||
" Write-Output \"gateway=$gateway;reachable=$result\"\n"
|
||||
"} else {\n"
|
||||
" Write-Output \"gateway=none;reachable=false\"\n"
|
||||
"}"
|
||||
),
|
||||
"fix_template": (
|
||||
"# 释放并重新获取IP地址\n"
|
||||
"ipconfig /release\n"
|
||||
"Start-Sleep -Seconds 2\n"
|
||||
"ipconfig /renew\n"
|
||||
"ipconfig /flushdns"
|
||||
),
|
||||
"fix_risk_level": "low",
|
||||
"target_condition": "network_connectivity=fail",
|
||||
"description": "检测本地网关是否可达,不通时尝试重新获取IP",
|
||||
},
|
||||
{
|
||||
"category": "vpn",
|
||||
"name": "VPN进程状态检测",
|
||||
"check_type": "script",
|
||||
"script_template": (
|
||||
"# 检测VPN客户端进程是否运行\n"
|
||||
"$vpnProcesses = Get-Process | "
|
||||
"Where-Object {$_.Name -match 'vpn|aTrust|SangforConnect'}\n"
|
||||
"if ($vpnProcesses) {\n"
|
||||
" Write-Output \"vpn_process=running;name=$($vpnProcesses.Name -join ',')\"\n"
|
||||
"} else {\n"
|
||||
" Write-Output \"vpn_process=not_found\"\n"
|
||||
"}"
|
||||
),
|
||||
"fix_template": (
|
||||
"# 重启VPN客户端\n"
|
||||
"Stop-Process -Name 'aTrust*' -Force -ErrorAction SilentlyContinue\n"
|
||||
"Start-Sleep -Seconds 3\n"
|
||||
"Start-Process 'C:\\Program Files\\aTrust\\aTrust.exe' "
|
||||
"-ErrorAction SilentlyContinue"
|
||||
),
|
||||
"fix_risk_level": "medium",
|
||||
"target_condition": "vpn_process=not_found",
|
||||
"description": "检测VPN/aTrust客户端进程是否运行",
|
||||
},
|
||||
{
|
||||
"category": "system",
|
||||
"name": "磁盘空间检测",
|
||||
"check_type": "script",
|
||||
"script_template": (
|
||||
"# 检测各磁盘分区可用空间\n"
|
||||
"Get-WmiObject Win32_LogicalDisk | "
|
||||
"ForEach-Object {\n"
|
||||
" $freeGB = [math]::Round($_.FreeSpace / 1GB, 1)\n"
|
||||
" Write-Output \"disk=$($_.DeviceID);free_gb=$freeGB\"\n"
|
||||
"}"
|
||||
),
|
||||
"fix_template": (
|
||||
"# 清理临时文件\n"
|
||||
"Remove-Item -Path \"$env:TEMP\\*\" -Recurse -Force "
|
||||
"-ErrorAction SilentlyContinue\n"
|
||||
"Cleanmgr /autoclean"
|
||||
),
|
||||
"fix_risk_level": "low",
|
||||
"target_condition": "disk_free<5GB",
|
||||
"description": "检测各磁盘分区可用空间,低于5GB时清理临时文件",
|
||||
},
|
||||
{
|
||||
"category": "printer",
|
||||
"name": "打印后台服务检测",
|
||||
"check_type": "script",
|
||||
"script_template": (
|
||||
"# 检测Windows打印后台服务状态\n"
|
||||
"$spooler = Get-Service -Name Spooler -ErrorAction SilentlyContinue\n"
|
||||
"if ($spooler) {\n"
|
||||
" Write-Output \"print_spooler=$($spooler.Status)\"\n"
|
||||
"} else {\n"
|
||||
" Write-Output \"print_spooler=not_found\"\n"
|
||||
"}"
|
||||
),
|
||||
"fix_template": (
|
||||
"# 重启打印后台服务\n"
|
||||
"Stop-Service -Name Spooler -Force\n"
|
||||
"Start-Sleep -Seconds 2\n"
|
||||
"Start-Service -Name Spooler"
|
||||
),
|
||||
"fix_risk_level": "medium",
|
||||
"target_condition": "print_spooler=stopped",
|
||||
"description": "检测Windows打印后台服务状态,停止时自动重启",
|
||||
},
|
||||
{
|
||||
"category": "email",
|
||||
"name": "Outlook进程检测",
|
||||
"check_type": "script",
|
||||
"script_template": (
|
||||
"# 检测Outlook是否运行\n"
|
||||
"$outlook = Get-Process -Name OUTLOOK -ErrorAction SilentlyContinue\n"
|
||||
"if ($outlook) {\n"
|
||||
" Write-Output \"outlook_process=running;pid=$($outlook.Id)\"\n"
|
||||
"} else {\n"
|
||||
" Write-Output \"outlook_process=not_found\"\n"
|
||||
"}"
|
||||
),
|
||||
"fix_template": (
|
||||
"# 重启Outlook\n"
|
||||
"Stop-Process -Name OUTLOOK -Force -ErrorAction SilentlyContinue\n"
|
||||
"Start-Sleep -Seconds 3\n"
|
||||
"Start-Process 'C:\\Program Files\\Microsoft Office\\root\\Office16\\OUTLOOK.EXE' "
|
||||
"-ErrorAction SilentlyContinue"
|
||||
),
|
||||
"fix_risk_level": "medium",
|
||||
"target_condition": "outlook_process=not_found",
|
||||
"description": "检测Outlook是否运行,未运行时尝试启动",
|
||||
},
|
||||
{
|
||||
"category": "security",
|
||||
"name": "火绒防护状态检测",
|
||||
"check_type": "api",
|
||||
"api_source": "huorong",
|
||||
"api_method": "get_protection_status",
|
||||
"fix_template": None,
|
||||
"fix_risk_level": "high",
|
||||
"target_condition": "huorong_protection=disabled",
|
||||
"description": "通过火绒API检测终端防护是否开启(需火绒企业版在线)",
|
||||
},
|
||||
{
|
||||
"category": "office",
|
||||
"name": "企微进程检测",
|
||||
"check_type": "script",
|
||||
"script_template": (
|
||||
"# 检测企微客户端是否运行\n"
|
||||
"$wxwork = Get-Process -Name WXWork -ErrorAction SilentlyContinue\n"
|
||||
"if ($wxwork) {\n"
|
||||
" Write-Output \"wxwork_process=running;pid=$($wxwork.Id)\"\n"
|
||||
"} else {\n"
|
||||
" Write-Output \"wxwork_process=not_found\"\n"
|
||||
"}"
|
||||
),
|
||||
"fix_template": (
|
||||
"# 重启企微客户端\n"
|
||||
"Stop-Process -Name WXWork -Force -ErrorAction SilentlyContinue\n"
|
||||
"Start-Sleep -Seconds 3\n"
|
||||
"Start-Process 'C:\\Program Files\\WXWork\\WXWork.exe' "
|
||||
"-ErrorAction SilentlyContinue"
|
||||
),
|
||||
"fix_risk_level": "low",
|
||||
"target_condition": "wxwork_process=not_found",
|
||||
"description": "检测企微客户端是否运行,未运行时尝试启动",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# 种子函数
|
||||
# =============================================================================
|
||||
|
||||
async def seed_quiz_data(db: AsyncSession) -> Dict[str, int]:
|
||||
"""种子测验题目和诊断模板数据。
|
||||
|
||||
行为:
|
||||
- diagnostic_templates 表为空 → 插入手写诊断模板(快速,本地操作)
|
||||
- quiz_questions 表为空且未设置 SKIP_SEED_QUIZ → 调用 Dify 生成 70 道知识题
|
||||
- 已有数据 → 跳过(幂等)
|
||||
- SKIP_SEED_QUIZ=true → 跳过 Dify 生成(仅插入模板),管理员后续可手动触发
|
||||
|
||||
降级:Dify 不可用时记录错误,不阻塞启动
|
||||
|
||||
Args:
|
||||
db: 数据库会话
|
||||
|
||||
Returns:
|
||||
Dict[str, int]: {"questions_created": N, "templates_created": N}
|
||||
"""
|
||||
created_questions = 0
|
||||
created_templates = 0
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 1. 种子诊断模板(手写,不依赖 Dify,快速插入)
|
||||
# ----------------------------------------------------------------
|
||||
existing_templates = await db.scalar(
|
||||
select(func.count(DiagnosticTemplate.id))
|
||||
)
|
||||
existing_templates = existing_templates or 0
|
||||
|
||||
if existing_templates == 0:
|
||||
for template_data in SEED_DIAGNOSTIC_TEMPLATES:
|
||||
template = DiagnosticTemplate(
|
||||
category=template_data["category"],
|
||||
name=template_data["name"],
|
||||
check_type=template_data.get("check_type", "script"),
|
||||
api_source=template_data.get("api_source"),
|
||||
api_method=template_data.get("api_method"),
|
||||
script_template=template_data.get("script_template"),
|
||||
fix_template=template_data.get("fix_template"),
|
||||
fix_risk_level=template_data.get("fix_risk_level", "medium"),
|
||||
target_condition=template_data.get("target_condition"),
|
||||
description=template_data.get("description"),
|
||||
is_active=True,
|
||||
created_at=datetime.now(),
|
||||
updated_at=datetime.now(),
|
||||
)
|
||||
db.add(template)
|
||||
created_templates += 1
|
||||
|
||||
logger.info(f"种子诊断模板插入完成: {created_templates} 个")
|
||||
else:
|
||||
logger.debug(f"diagnostic_templates 已有 {existing_templates} 条数据,跳过种子")
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 2. 种子知识题(Dify 生成,慢操作)
|
||||
# ----------------------------------------------------------------
|
||||
skip_seed_quiz = os.getenv("SKIP_SEED_QUIZ", "").lower() == "true"
|
||||
|
||||
if skip_seed_quiz:
|
||||
logger.info("SKIP_SEED_QUIZ=true,跳过 Dify 知识题生成。管理员可通过 POST /api/admin/quiz/generate 手动触发")
|
||||
else:
|
||||
existing_questions = await db.scalar(
|
||||
select(func.count(QuizQuestion.id))
|
||||
)
|
||||
existing_questions = existing_questions or 0
|
||||
|
||||
if existing_questions == 0:
|
||||
logger.info("===== 开始 Dify 生成种子知识题(70题)=====")
|
||||
service = get_quiz_generation_service()
|
||||
|
||||
for category in SEED_CATEGORIES:
|
||||
try:
|
||||
result = await service.generate_knowledge_questions_batch(
|
||||
db=db,
|
||||
category=category,
|
||||
count=SEED_QUESTIONS_PER_CATEGORY,
|
||||
is_active=True, # 种子数据直接激活
|
||||
)
|
||||
created_questions += result["success_count"]
|
||||
|
||||
if result["errors"]:
|
||||
logger.warning(
|
||||
f"种子知识题 [{category}] 有错误: {result['errors'][:3]}"
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
# Dify 不可用时跳过该类别,不阻塞启动
|
||||
logger.error(f"种子知识题 [{category}] 生成失败: {e}")
|
||||
continue
|
||||
|
||||
logger.info(f"===== 种子知识题生成完成: {created_questions} 道 =====")
|
||||
|
||||
if created_questions == 0:
|
||||
logger.warning(
|
||||
"Dify 种子知识题生成全部失败!"
|
||||
"管理员可通过 POST /api/admin/quiz/generate 手动触发生成"
|
||||
)
|
||||
else:
|
||||
logger.debug(f"quiz_questions 已有 {existing_questions} 条数据,跳过种子")
|
||||
|
||||
# 注意:不在此处 commit,由调用方 _init_default_data 统一 commit
|
||||
await db.flush()
|
||||
return {
|
||||
"questions_created": created_questions,
|
||||
"templates_created": created_templates,
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
# =============================================================================
|
||||
# 企微IT智能服务台 — RBAC 角色种子数据 (v0.7.1 task #86)
|
||||
# =============================================================================
|
||||
# 启动时调用,把 5 角色 + 权限矩阵写入 roles 表
|
||||
# 兼容"角色已存在"的场景: 不重复插入,但更新 permissions
|
||||
# =============================================================================
|
||||
|
||||
import logging
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.models.role import Role
|
||||
from app.services.rbac_service import (
|
||||
ROLE_METADATA,
|
||||
get_role_default_permissions,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def seed_rbac_roles(db: AsyncSession) -> int:
|
||||
"""种子 RBAC 5 角色。
|
||||
|
||||
行为:
|
||||
1. 遍历 ROLE_METADATA
|
||||
2. 角色不存在 → 创建(UUID + 默认 permissions)
|
||||
3. 角色存在 → 更新 display_name / description / permissions
|
||||
(不动 is_default,避免影响手动设置)
|
||||
|
||||
Returns:
|
||||
int: 新建角色数
|
||||
"""
|
||||
created_count = 0
|
||||
|
||||
for role_name, meta in ROLE_METADATA.items():
|
||||
# 查询是否已存在
|
||||
stmt = select(Role).where(Role.name == role_name)
|
||||
result = await db.execute(stmt)
|
||||
role = result.scalars().first()
|
||||
|
||||
permissions = get_role_default_permissions(role_name)
|
||||
|
||||
if role:
|
||||
# 更新现有角色(不动 is_default,防止覆盖手动设置)
|
||||
role.display_name = meta["display_name"]
|
||||
role.description = meta["description"]
|
||||
role.permissions = permissions
|
||||
role.updated_at = datetime.now()
|
||||
logger.debug(f"更新角色: {role_name} ({len(permissions)} 项权限)")
|
||||
else:
|
||||
# 创建新角色
|
||||
role = Role(
|
||||
id=str(uuid.uuid4()),
|
||||
name=role_name,
|
||||
display_name=meta["display_name"],
|
||||
description=meta["description"],
|
||||
permissions=permissions,
|
||||
is_default=(meta["is_default"] == "true"),
|
||||
created_at=datetime.now(),
|
||||
updated_at=datetime.now(),
|
||||
)
|
||||
db.add(role)
|
||||
created_count += 1
|
||||
logger.info(f"创建角色: {role_name} ({len(permissions)} 项权限)")
|
||||
|
||||
await db.commit()
|
||||
logger.info(f"RBAC 角色种子完成: 新建 {created_count} 个")
|
||||
return created_count
|
||||
@@ -0,0 +1,941 @@
|
||||
// 快速回复层级数据 — 从 IT支持知识库2026-4-24.docx 自动提取
|
||||
// 7大类 / 子类 / 回复模板
|
||||
|
||||
export interface QrItem {
|
||||
title: string
|
||||
content: string
|
||||
}
|
||||
|
||||
export interface QrSubCategory {
|
||||
name: string
|
||||
items: QrItem[]
|
||||
}
|
||||
|
||||
export interface QrCategory {
|
||||
name: string
|
||||
subs: QrSubCategory[]
|
||||
}
|
||||
|
||||
export const qrData: QrCategory[] =
|
||||
[
|
||||
{
|
||||
"name": "电脑",
|
||||
"subs": [
|
||||
{
|
||||
"name": "硬件设备",
|
||||
"items": [
|
||||
{
|
||||
"title": "笔记本电脑电池续航异常",
|
||||
"content": "健康评估标准:剩余容量<70%或循环次数>500次。\n获取报告步骤::\nWindows:cmd中输入 powercfg /batteryreport,查看报告中的“CYCLE COUNT”。\nMac:按住Option键点击苹果菜单→系统信息→电源→查看“循环计数”。\n将报告留言分享,等待人工坐席进一步评估。"
|
||||
},
|
||||
{
|
||||
"title": "办公电脑常见问题处理(黑屏、警报)",
|
||||
"content": "排查步骤\n1. 观察电源指示灯:确认电脑的电源指示灯是否亮起或闪烁。\n2. 强制关机重启:长按电源键约15-20秒,直到电源指示灯完全熄灭,等待几秒钟后,再次按下电源键尝试开机。"
|
||||
},
|
||||
{
|
||||
"title": "办公电脑常见问题处理(死机、卡顿)",
|
||||
"content": "排查步骤:\n1. 检查系统资源:按Ctrl+Shift+Esc打开任务管理器,结束占用高的非必要进程。\n2. 强制重启:长按电源键15-20秒至指示灯熄灭,等待后重新开机。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Windows系统",
|
||||
"items": [
|
||||
{
|
||||
"title": "Windows本地账户密码修改",
|
||||
"content": "路径:设置→帐户→登录选项→密码→更改,按提示完成。"
|
||||
},
|
||||
{
|
||||
"title": "办公电脑功能异常(无声音、屏幕显示、键盘热键)",
|
||||
"content": "排查步骤:\n1. 检查驱动:设备管理器查看是否有异常设备(黄色/红色标志)。\n2. 重装驱动:联想电脑使用官方工具;其他品牌从官网下载最新驱动。"
|
||||
},
|
||||
{
|
||||
"title": "办公电脑麦克风无声音",
|
||||
"content": "排查步骤:\n1. 设置默认设备:右键任务栏扬声器图标→声音设置,确保麦克风设为默认输入设备。\n2. 授予权限:在Windows搜索“麦克风隐私设置”,开启麦克风访问权限及对应应用(如企业微信、小鱼)的权限。\n3. 调整属性:在设备属性中调整音量和麦克风增强,禁用独占模式。"
|
||||
},
|
||||
{
|
||||
"title": "Windows电脑和Office许可证过期|激活|即将到期",
|
||||
"content": "适用场景:激活过期/失败/即将到期。\n操作步骤:\n1. 下载工具:https://drive.weixin.qq.com/s?k=AAoA1wcYAAcmKeQnWG\n2. 运行工具,按需取消选项(如不需激活Office)。\n3. 点击“开始”处理。"
|
||||
},
|
||||
{
|
||||
"title": "电脑C盘空间不足",
|
||||
"content": "操作步骤:\n1. 打开企业微信,进入【设置】→【文档/文件管理】→【文件储存位置】。\n2. 点击【更改】,选择其他盘符的目录作为新存储路径。"
|
||||
},
|
||||
{
|
||||
"title": "U盘、移动硬盘无法弹出报错“弹出USB大容量存储设备时出问题”",
|
||||
"content": "故障现象:\n弹出U盘提示“该设备正在使用中、请关闭可能使用该设备的所有程序或窗口,然后重试”\n解决方法:\n将电脑关机后再拔出硬盘"
|
||||
},
|
||||
{
|
||||
"title": "办公电脑系统初始密码",
|
||||
"content": "总部新电脑:Windows系统无密码(直接回车)\n电脑开机密码是独立的,不与内部统一员工账密一致。"
|
||||
},
|
||||
{
|
||||
"title": "电脑开机密码重置",
|
||||
"content": "重置电脑开机需使用专用工具由IT支持人员进行现场处理,总部员工请携带设备前往121室,区域同事请联系本地兼职网络协助处理"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "鸿蒙系统",
|
||||
"items": [
|
||||
{
|
||||
"title": "公司办公IT环境不支持鸿蒙系统的软硬件清单",
|
||||
"content": "软件功能类:\n火绒安全、税友安全助手、企业微信-同事吧(发帖、回复)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "软件",
|
||||
"subs": [
|
||||
{
|
||||
"name": "常用工具",
|
||||
"items": [
|
||||
{
|
||||
"title": "常用办公软件下载地址",
|
||||
"content": "常用办公软件下载地址:https://drive.weixin.qq.com/s?k=AAoA1wcYAAcVScZYR4"
|
||||
},
|
||||
{
|
||||
"title": "压缩工具",
|
||||
"content": "7-Zip是一款免费开源高压缩比的压缩软件,支持7z、ZIP、RAR、CAB、GZIP、BZIP2和TAR等格式。此软件压缩的压缩比要比普通ZIP文件高30-50%。\n7-Zip 客户端下载地址:https://sparanoid.com/lab/7z/download.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "企业微信",
|
||||
"items": [
|
||||
{
|
||||
"title": "企业微信综合信息",
|
||||
"content": "企业微信账号同时与个人微信、手机同步绑定"
|
||||
},
|
||||
{
|
||||
"title": "企微手机聊天记录迁移到电脑",
|
||||
"content": "企业微信:打开企业微信---我---设置---通用---聊天记录迁移(手机和电脑连接同一网络热点)"
|
||||
},
|
||||
{
|
||||
"title": "企业微信显示手机号码修改",
|
||||
"content": "操作路径:企业微信手机端→设置→账号与安全→手机号→更换手机号,按提示完成。"
|
||||
},
|
||||
{
|
||||
"title": "企业微信账号登录异常",
|
||||
"content": "处理方案:\n1. 账号限制/封禁:通过官方申诉链接处理:https://work.weixin.qq.com/webapp/kefuSelfService/page 。\n2. 设备超限:卸载当前版本,重启后下载最新版安装:https://work.weixin.qq.com/#indexDownload"
|
||||
},
|
||||
{
|
||||
"title": "企业微信消息接收延迟",
|
||||
"content": "排查步骤:\n1. 确认文件存储路径:企业微信→设置→存储管理。\n2. 退出企业微信,删除WXWork存储路径下的Global文件夹。"
|
||||
},
|
||||
{
|
||||
"title": "企业微信客户相关功能限制(客户群/朋友圈/外部联系人",
|
||||
"content": "“亿企赢总部“企微主要作为内部沟通渠道,限制添加外部联系人、客户、客户群等客户营销、服务支持功能。\n“亿企赢”主体:用于客户联系。\n“亿企赢总部”主体:仅限内部沟通。\n如有上述需求请切换至“亿企赢”企微主体进行操作,或由“亿企赢”企微主体账号客户&项目经理账号建立客户群,再添加“亿企赢总部”相关人员入群。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "企业邮箱",
|
||||
"items": [
|
||||
{
|
||||
"title": "税友企业邮箱访问方式与账号密码认证方式",
|
||||
"content": "通过第三方邮件客户端配置POP、SMTP、IMAP协议访问,需使用邮箱专用安全密码\n通过Coremail客户端配置POP、SMTP、IMAP协议访问,需使用邮箱专用安全密码\n通过Coremail客户端配置Coremail协议访问,需使用统一员工账号密码\n通过税友企业邮箱网页登录使用统一员工账号密码+短信认证"
|
||||
},
|
||||
{
|
||||
"title": "税友企业邮箱密码修改或重置",
|
||||
"content": "注意:通过WEB网页登录企业邮箱与邮件客户端收发邮件所配置密码并不相同,访问WEB地址和使用Coremail客户端采用的是员工统一账号密码(与eHR、税友家园登录密码相同),其他第三方邮件客户端配置的是邮件客户端安全专用密码,请根据实际情况选择不同密码修改重置方式。\n员工统一账号密码重置入口:\nhttp://192.168.9.87:8080/employee-center/resetPwd.jsp\n第三方邮件客户端邮件客户端专用密码生成和重置入口:\n使用员工统一账号密码+短信验证码登录WEB邮箱https://mail.servyou.com.cn/\n设置(齿轮图标)-安全设置-客户端安全登录-“生成专用密码”\n设置密码名称(便于区分使用软件或对象)\n获取(复制)16位密码和邮件客户端配置(按需)"
|
||||
},
|
||||
{
|
||||
"title": "邮箱客户端安全登录专用密码介绍",
|
||||
"content": "客户端专用密码是用于登录第三方邮件客户端(例如Outlook、Foxmail、邮件App等)时使用的专属密码\n适合客户端通过以下协议使用:POP、IMAP、SMTP、Pushmail、CalDAV、CardDAV\n“客户端专用密码”仅在生成时可见,支持设置多个,切勿使用其它方式保存,以防泄露\n邮件客户端专用密码需通过登录邮件服务器网站进行申请和获取"
|
||||
},
|
||||
{
|
||||
"title": "税友企业邮件地址",
|
||||
"content": "税友企业邮件网址: https://mail.servyou.com.cn"
|
||||
},
|
||||
{
|
||||
"title": "税友邮箱网站无法登入",
|
||||
"content": "步骤:\n1. 先登录税友家园( https://oa.servyou-it.com/)验证账号。\n2. 若密码错误,通过http://192.168.9.87:8080/employee-center/resetPwd.jsp重置。\n3. 重置后等待10分钟重试邮箱登录。"
|
||||
},
|
||||
{
|
||||
"title": "税友邮箱已发送邮件召回",
|
||||
"content": "条件:仅限发送给公司内部员工且对方未读的邮件。\n操作:登录网页版邮箱(https://mail.servyou.com.cn)→自助查询→发信查询→点击“召回邮件”。"
|
||||
},
|
||||
{
|
||||
"title": "邮箱客户端配置",
|
||||
"content": "邮件客户端选择和下载\nCoremail邮件客户端 https://www.coremail.cn/download.html\nFoxmail邮件客户端 https://www.foxmail.com/win/\n企业微信邮件应用 路径:企业微信客户端-邮件\n生成邮件客户端专用密码:登录网页版邮箱( https://mail.servyou.com.cn/ )→个人设置→安全设置→客户端安全登录→生成16位专用密码。\n配置客户端:\n收发服务器地址:mail.servyou.com.cn\n协议和端口:POP收件协议 995(SSL)、SMTP发件协议465(SSL)\n密码使用生成的专用密码。\n详细指南参考:https://doc.weixin.qq.com/doc/w3_AU8AjwZhAIgBx1RxfT7SRqnW0yN7i"
|
||||
},
|
||||
{
|
||||
"title": "使用邮件客户端本地保留历史收发邮件",
|
||||
"content": "说明:根据公司信息安全管理要求,企业邮箱服务器邮件仅保留14天,14天到期邮件将被清除且无法恢复。如有经常随时查阅历史邮件和有邮件存档需求,应避免只使用WEB方式访问邮件网站收发邮件,同时避免使用配置imap、Coremail协议的邮件客户端如:企业微信邮件、Coremail邮件客户端),而应选择配置POP收件协议 的邮件客户端管理邮件。\n解决方案:\n根据需要选择下载安装 Foxmail、Coremail、网易邮箱大师等邮件客户端,Coremail邮件客户端配置过程邮件协议不要默认选择Coremail。\n2.登录企业邮件网址https://mail.servyou.com.cn. 通过路径”设置(齿轮图标)-安全设置-客户端安全登录“,申请邮件客户端专用密码\n3.正确邮件客户端邮件服务器地址、收发邮件服务器地址和端口、邮件账号和邮件客户端专用密码"
|
||||
},
|
||||
{
|
||||
"title": "Foxmail邮箱收发异常“不知道这样的主机”",
|
||||
"content": "处理步骤:\n1. 打开Foxmail,右键邮箱名→设置→账号→服务器。\n2. 修改服务器地址为mail.servyou.com.cn,端口收件995(SSL)、发件465(SSL)。"
|
||||
},
|
||||
{
|
||||
"title": "税友邮箱WEB登录异常“用户名或密码错误,或登录受到限制”",
|
||||
"content": "解决步骤:\n1. 重置密码:http://192.168.9.87:8080/employee-center/resetPwd.jsp\n2. 尝试登录税友家园( https://oa.servyou-it.com/ )验证账号正常后,重试邮箱登录。"
|
||||
},
|
||||
{
|
||||
"title": "外部邮件漏收&被拦截",
|
||||
"content": "排查步骤:\n1.使用私人邮箱或请同事给自己发送一封邮件,确认有些客户端设置是否正确。\n2.检查邮件客户端垃圾邮件(箱),确定是否被邮件客户端拦截\n3使用员工账户中心密码+短信信验证码,登录企业邮箱WEB页面 https://mail.servyou.com.cn ,检查“其他文件-垃圾邮件下是否有所需邮件\n如以上检查确认无法收到,请IT支持人工坐席联系邮件运维,启动“邮件防火墙筛查”"
|
||||
},
|
||||
{
|
||||
"title": "公共邮箱申请流程(新建|回收|停用)",
|
||||
"content": "申请链接:https://devops.dc.servyou-it.com/ITSM/workflow/service/createTicket?name=公共邮箱账号申请\n具体审批执行情况请联系工单处理人。"
|
||||
},
|
||||
{
|
||||
"title": "Coremail邮箱显示脱机",
|
||||
"content": "请右键点击账号信息,选择“设为联机模式”。如果操作后仍未恢复,请确认账号和密码输入是否正确。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "税友云盘",
|
||||
"items": [
|
||||
{
|
||||
"title": "税友云盘网址和客户端下载",
|
||||
"content": "税友云盘网址: https://ypan.dc.servyou-it.com\n登录窗口左下角点击“下载客户端”\n注:税友云盘暂不支持手机移动端"
|
||||
},
|
||||
{
|
||||
"title": "税友企业云盘账号解冻",
|
||||
"content": "税友云盘(企业云盘)\n云盘账号解冻联系谢聪利申请解冻。"
|
||||
},
|
||||
{
|
||||
"title": "税友云盘更新失败",
|
||||
"content": "访问https://ypan.dc.servyou-it.com/user/login ,在登录页面左下角下载最新版安装。"
|
||||
},
|
||||
{
|
||||
"title": "税友云盘密码错误",
|
||||
"content": "使用员工统一认证账号密码+短信二次认证,用户名与税友家园、EHR系统一致,忘记密码可使用员工统一认证账号密码重置方式进行重置"
|
||||
},
|
||||
{
|
||||
"title": "税友云盘文件夹访问权限申请",
|
||||
"content": "税友云盘文件夹权限管理由各部门及项目指定空间管理员分管,云盘文件夹目录创建与权限调整需联系所属的管理员。\n税友云盘部门和项目管理员名单:https://doc.weixin.qq.com/sheet/e3_m_aOPqWFhxgwDR?scode=AAoA1wcYAAcVgz1ud7AQgAuAYMANY&tab=BB08J2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "企微微盘",
|
||||
"items": [
|
||||
{
|
||||
"title": "企微微盘上传本地文件提示“微盘容量已满,无法上传文件,开通微盘高级功能,可提升容量。”应该如何处理?",
|
||||
"content": "因企业微信-微盘收费政策发生重大调整,费用较之前上涨6倍。前期经过与各客群沟通,当前“文档”功能在绝大多数工作场景中已能够替代“微盘”,因此先暂停微盘的续费工作。已安排各客群调研实际需求,后续将根据调研的结果评估续费方案。现阶段的影响以及安排如下:\n一、到期影响(2026年3月14日起)\n1.微盘:到期后将无法上传新本地文件,空间已有文件可正常访问、下载,短时间不被删除。\n2.文档:“文档”的在线编辑、上传及共享等功能 不受此次调整影响。在线文档大小不占用微盘容量。\n二、 后续使用指引\n1.主要替代方案:请各部门及员工将后续新增的文档存储、分享需求,通过企业微信“文档”功能中实现。\n2.特殊需求处理:如确有特殊业务必须使用微盘,请由部门接口人汇总评估需求必要性。\n3.文档高级会员:部分原微盘需求将转移至“文档”后新增高级会员,公司将按必要性进行引导与管理,具体采购流程和管理方案另行通知。\n三、 咨询与支持\n请各位同事知悉并提前做好工作安排,如有疑问可统一咨询: 企微“智能IT助手”,各中心接口人将负责本部门内的宣导与部门内个性化实施。\n微盘&文档常见问题答疑文档链接:https://doc.weixin.qq.com/doc/w3_AJAAAQaUAI4CN6WEkNQg7RZWP4F2Z?scode=AAoA1wcYAAcO7CE2NAAJAAAQaUAI4\n微盘管理部门接口人:"
|
||||
},
|
||||
{
|
||||
"title": "为什么企微微盘容量到期后,公司不再统一续费?",
|
||||
"content": ""
|
||||
},
|
||||
{
|
||||
"title": "因企业微信-微盘收费政策发生重大调整,费用较之前上涨6倍。前期经过与各客群沟通,当前“文档”功能在绝大多数工作场景中已能够替代“微盘”,因此先暂停微盘的续费工作。",
|
||||
"content": ""
|
||||
},
|
||||
{
|
||||
"title": "企微微盘容量到期后,原有空间内的文件有什么影响?",
|
||||
"content": "到期后企微空间将无法上传新本地文件,空间已有文件可正常访问、下载,短时间不被删除。"
|
||||
},
|
||||
{
|
||||
"title": "企微微盘空间内的文件能够保留多久?",
|
||||
"content": "企微空间内的文件暂时不会删除,如果企微官方调整文件保存策略,会提前通知"
|
||||
},
|
||||
{
|
||||
"title": "企微微盘没有扩容的情况下,每个人平均有的是多少?",
|
||||
"content": "按照集团企微账号共享容量100GB,集团现有约7000人均分,大概14MB/ 人"
|
||||
},
|
||||
{
|
||||
"title": "如何查看企微微盘已用容量",
|
||||
"content": "路径:【电脑端->微盘->左下角->个人容量】\n将鼠标悬停在已用容量位置,可查看:微盘版本(企业)、账号类型(个人)、已用容量(个人)、剩余容量(企业)。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "企微文档",
|
||||
"items": [
|
||||
{
|
||||
"title": "在线文档里插入本地图片和其他文件,所占用的是什么应用的容量?",
|
||||
"content": "在线文档上传的本地文件只会占用“文档”容量,"
|
||||
},
|
||||
{
|
||||
"title": "视频/音频可以转成企微微盘在线文档吗?",
|
||||
"content": "只有word、Excel、演示、PPT不可以转为在线文档,其他格式无法转为在线文档"
|
||||
},
|
||||
{
|
||||
"title": "企微文档容量如何计算?",
|
||||
"content": "文档仅占用创建者的容量,文档容量根据文档正文、文档中插入的文件、图片以及版本历史记录综合计算,具体类型包括:\n文档、表格、幻灯片、智能表格、思维导图、流程图:文档正文、文档中插入的本地文件、图片、表格函数、图表等\n收集表、汇报:填写者提交的内容,包含正文、文件、图片、签名等\n版本历史记录计入文档容量:在线文档会自动保留历史版本,方便查看编辑记录,可以随时找回历史内容,避免数据丢失。文档容量将根据版本历史的大小综合计算。"
|
||||
},
|
||||
{
|
||||
"title": "企微文档中插入的文件是否占用企微微盘容量?",
|
||||
"content": "文档中插入的文件仅占用文档容量,不会占用微盘容量。"
|
||||
},
|
||||
{
|
||||
"title": "企微文档容量如何提升?",
|
||||
"content": "基础版个人总容量上限为 1G,开通文档高级功能后,文档容量提升至无限。"
|
||||
},
|
||||
{
|
||||
"title": "如何查看已用企微文档容量情况?",
|
||||
"content": "成员可在【手机端->文档->右上角的“+”->更多->关于文档】中查看文档已用容量。"
|
||||
},
|
||||
{
|
||||
"title": "如何释放已经占用的企微「文档」容量",
|
||||
"content": "方法一:删除过期文档,进入「文档 > 全部 > 我的文档」,这里将展示占用本人容量的所有文档,可以按大小排序,可自行操作删除。\n方法二:删除文档中的图片和文件,打开本人创建的文档,删除文档中已插入的图片、文件。\n方法三:删除通过汇报上传的文件,在「微盘 ->我的空间->选择对应的汇报」操作删除汇报中的文件、图片。删除后,一般10分钟左右就能释放对应的容量。注:需汇报创建者操作。\n方法四:文档版本历史记录文档瘦身,进入进入「文档 > 设置> 生成副本」,删除原文档保留副本文档\n方法五:移交文档、文件(夹)所有权给文档高级会员,将文档(文件夹)移动至个人空间,选中文件(夹)右键>转接所有权(所转交文件占用的空间会移交给接收人)\n温馨提示:\n(1)文档容量非实时更新,会在第二天更新。\n(2)文档删除后,可以在【文档->全部->回收站】中恢复对应的文档,非高级账号的文档在回收站会保留7天,高级账号的文档在回收站会保留180天。"
|
||||
},
|
||||
{
|
||||
"title": "企微文档提示:“文档容量已满,因此你无法在该文档中插入图片”",
|
||||
"content": "异常原因:插入图片所在文档所有者,企微文档免费额度已满,需由当前文档创建者购买收费高级功能\n出于数据安全和成本考虑,公司不提倡大范围使用企微在线文档,部门或个人如坚持使用,需自行购买。"
|
||||
},
|
||||
{
|
||||
"title": "企微文档所有者查看方式",
|
||||
"content": "文档窗口右上角“三杠”图标"
|
||||
},
|
||||
{
|
||||
"title": "企微文档高级功能购买链接",
|
||||
"content": "https://work.weixin.qq.com/mall/wedoc?wws=19"
|
||||
},
|
||||
{
|
||||
"title": "企业微信共享文件删除恢复",
|
||||
"content": "路径:微盘→我的文件→左下角三点菜单→回收站→选择文件→还原。"
|
||||
},
|
||||
{
|
||||
"title": "企业微信文档报错“未知错误”",
|
||||
"content": "解决方式:\n1. 关闭网络代理:Internet选项→连接→局域网设置→取消代理服务器勾选。\n2. 更新企业微信版本:左下角“关于”中检查更新。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "文档中心",
|
||||
"items": [
|
||||
{
|
||||
"title": "Confluence文档中心网址",
|
||||
"content": "文档中心 https://docs.dc.servyou-it.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "网页浏览",
|
||||
"items": [
|
||||
{
|
||||
"title": "Edge&谷歌浏览器无法打开网页,错误代码: STATUS_STACK_BUFFER_OVERRUN”",
|
||||
"content": "【问题原因】\n浏览器更新后与税友安全助手组件冲突\n【影响范围】\nMicrosoft Edge 、谷歌浏览器\n【处理办法】\n下载并安装“浏览器修复补丁”,重启浏览器后即可恢复。\n下载地址:浏览器修复补丁"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "外设",
|
||||
"subs": [
|
||||
{
|
||||
"name": "打印复印",
|
||||
"items": [
|
||||
{
|
||||
"title": "杭州总部刷卡打印机安装",
|
||||
"content": "1.登录页面右下角“客户端下载”下载驱动,http://printer.oa.servyou-it.com/printhub/ui/sign/login.htm\nWindows:选择“柯美原厂驱动”\nMac:选择“PrintDriver”,\n打印时,Windows用户选择打印机名称 KM_Printer,MAC用户选择打印机名称 FollowMe-Black\n输入服务器地址:printer.oa.servyou-it.com:80, 绑定“统一员工账号密码”,填写完成后点击“校验”并确定\n3.首次使用刷卡取件,可前往任意楼层刷卡打印机,在提示位置刷卡后,输入员工账号和密码进行认证绑定。\n详细操作请参考文档《统一刷卡打印机安装使用说明》统一刷卡打印机安装使用说明\nhttps://doc.weixin.qq.com/doc/w3_APQA0gb5AAgUUYPrXy8QAGRQfMDgx?scode=AAoA1wcYAAcuo1wd2hAPQA0gb5AAg&qt_source=Search&qt_report_identifier=1763972439462&version=5.0.2.6008&platform=win"
|
||||
},
|
||||
{
|
||||
"title": "杭州总部刷卡打印机复印操作",
|
||||
"content": "步骤:\n1. 刷卡后点击“复印”功能。\n2. 按提示操作,完成后取件口取件。\n身份证复印支持双面模式。\n详细操作请参考文档《统一刷卡打印机安装使用说明》https://doc.weixin.qq.com/doc/w3_APQA0gb5AAgUUYPrXy8QAGRQfMDgx?scode=AAoA1wcYAAcuo1wd2hAPQA0gb5AAg&qt_source=Search&qt_report_identifier=1763972439462&version=5.0.2.6008&platform=win"
|
||||
},
|
||||
{
|
||||
"title": "杭州总部刷卡打印机扫描操作",
|
||||
"content": "步骤:\n1. 刷卡后点击屏幕“扫描”功能。\n2. 选择扫描方式:多页用“进纸器”,单页/厚重文件用“平板”。\n3. 扫描文件发送至个人邮箱。详情操作参考https://doc.weixin.qq.com/doc/w3_APQA0gb5AAgUUYPrXy8QAGRQfMDgx 。"
|
||||
},
|
||||
{
|
||||
"title": "总部刷卡打印驱动下载",
|
||||
"content": "总部刷卡打印中心网址 http://printer.oa.servyou-it.com/printhub/ui/sign/login.htm"
|
||||
},
|
||||
{
|
||||
"title": "杭州总部打印彩色稿件",
|
||||
"content": "Windows操作系统直接打印,Mac OS系统选择名称“”ColourPrine”打印机,\n打印任务完成后至杭州总部亿企赢大厦彩色打印机放置楼层为5、10、15、20层刷卡取件即可"
|
||||
},
|
||||
{
|
||||
"title": "杭州总部刷卡打印机卡纸、缺墨",
|
||||
"content": "总部员工改用其他楼层打印设备,并留言告知异常设备位置,安排处理。"
|
||||
},
|
||||
{
|
||||
"title": "杭州总部刷卡打印机显示未连接",
|
||||
"content": "尝试重启电脑后重试打印。"
|
||||
},
|
||||
{
|
||||
"title": "杭州总部刷卡打印机缺纸处理",
|
||||
"content": "总部员工可改用其他楼层打印设备,或自行补充备用纸(设备下方防潮柜柜内可取)。部门批量打印需至资产办公室领用。"
|
||||
},
|
||||
{
|
||||
"title": "杭州总部刷卡打印机取件异常",
|
||||
"content": "原因一:员工账号密码更新后,客户端密码未同步修改更新。\n检测步骤:\nWindows:任务栏打印机图标(蓝色大拇指)→配置→校验密码。\nMac:应用程序→PrinterLogin→校验账号密码。\n原因二:30分钟内未及时取件,打印任务超30分钟未取件自动取消\n操作步骤:重新打印,30分钟内取件"
|
||||
},
|
||||
{
|
||||
"title": "总部刷卡打印客户端,配置页面提示“验证失败!用户名或密码错误”",
|
||||
"content": "原因:员工账户中心员工密码到期或更新后,刷卡打印客户端未同步更新\n处理步骤:更新密码后,点击校验,提示“校验成功!”后,点击确认"
|
||||
},
|
||||
{
|
||||
"title": "总部刷卡打印客户端,配置页面提示“验证失败!用户名或密码错误次数达到系统上限,现已被锁定...\"",
|
||||
"content": "原因:密码错误输入超过3次\n处理步骤:确认员工账号密码正确(可在税友家园、eHR尝试登录),在5分钟后使用正确密码进行校验"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "网络会议",
|
||||
"items": [
|
||||
{
|
||||
"title": "小鱼易连客户端下载",
|
||||
"content": "小鱼易连客户端支持Windows、MAC、Linux(统信、麒麟),请根据所运行操作系统选择下载不同客户端。 小鱼易连下载中心:https://www.xylink.com/download"
|
||||
},
|
||||
{
|
||||
"title": "小鱼固定方云会议室预约",
|
||||
"content": "操作路径:运行小鱼易连软件→会议→我的会议→新建→预约会议。详情参考《小鱼云会议用户使用指南》。\nhttps://doc.weixin.qq.com/doc/w3_AJAAAQaUAI429WiTgHnRU0I0O5ItO?scode=AAoA1wcYAAcNyzXMF6AJAAAQaUAI4&qt_source=Search&qt_report_identifier=1764120639847&version=5.0.2.6008&platform=win"
|
||||
},
|
||||
{
|
||||
"title": "小鱼固定方云会议预约信息查询",
|
||||
"content": "小鱼固定方云会议预约信息查询需桌面IT支持人工坐席处理,请按一下步骤进行操作。\n回复“IT”获取桌面IT支持人工支持链接\n点击IT支持人工支持链接进入人工坐席咨询窗口\n输入需要查询的小鱼固定方会议室号,会议时间区间\n耐心等待人工支持坐席回复"
|
||||
},
|
||||
{
|
||||
"title": "小鱼云会议使用方法",
|
||||
"content": "详情参考《小鱼云会议用户使用指南》。\nhttps://doc.weixin.qq.com/doc/w3_AJAAAQaUAI429WiTgHnRU0I0O5ItO?scode=AAoA1wcYAAcNyzXMF6AJAAAQaUAI4&qt_source=Search&qt_report_identifier=1764120639847&version=5.0.2.6008&platform=win"
|
||||
},
|
||||
{
|
||||
"title": "小鱼固定方云会议室号及主持人密码",
|
||||
"content": "25方:会议号9083894961,密码348124,主持密码569149\n50方:会议号9083284868,密码502892,主持密码625067\n100方:会议号9083261987,密码359615,主持密码374852"
|
||||
},
|
||||
{
|
||||
"title": "小鱼直播权限申请",
|
||||
"content": "无需申请,新建直播即可,无人数限制。"
|
||||
},
|
||||
{
|
||||
"title": "小鱼云会议室录像和会议统计提取",
|
||||
"content": "企业云会议室:登录一站式运维平台-服务目录-IT支持服务-活动与会议支持,支持级别\"资料下载“,服务内容“录像下载”或“活动统计”补充信息会议号,以及会议直至时间。\n个人云会议室:客户端→文件夹→我的文件夹查看历史录制。正常情况支持人员会在1小时内处理完成,请关注“一站式运维平台”工单完工消息提醒,通过我的工单-我的创建-查看并获取下载链接"
|
||||
},
|
||||
{
|
||||
"title": "企业微信会议(腾讯会议)不可用",
|
||||
"content": "受企业微信商业政策调整影响,公司决定2023-8-1停止企业微信会议功能,企微会议功能关闭后,企微音频/视频通话+屏幕分享(企业内限16人,企业外1对1),集团全体员工可使用手机号+短信方式登录使用小鱼易连会议,30方及以下会议可使用小鱼终端号、个人云会议号,>30~100方会议需预约小鱼企业云会议号"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "会议电视",
|
||||
"items": [
|
||||
{
|
||||
"title": "会议室屏幕投屏操作步骤",
|
||||
"content": "标准会议室(如:总部办公楼层5~21楼)\n使用电视遥控器打开电视\n将投屏线(转接头)连接至电脑HDMI|Type-C接口\n大型视频会议室(总部409、410)\n黑色遥控器打开电视\n银色遥控器打开小鱼终端\n将投屏器连接至电脑\n点击弹出投屏程序,或者运行投屏器存储盘符下的投屏程序\n根据提示操作一键投屏\n超大型会议室(总部124、126、401、404、405、409)\n超大会议室设备使用,请通过“一站式运维平台-IT支持服务-员工服务入口-活动与会议技术支持”提前一天预约现场技术支持"
|
||||
},
|
||||
{
|
||||
"title": "会议室电视机无法开启",
|
||||
"content": "1. 近距离使用遥控器重试。\n2. 检查电视机背面或侧面电源键。\n确认电源连接正常。"
|
||||
},
|
||||
{
|
||||
"title": "会议室HDMI连接线或转接头缺失",
|
||||
"content": "请转人工联系“IT”服务号"
|
||||
},
|
||||
{
|
||||
"title": "会议室电视机无法投屏",
|
||||
"content": "1. 重新插拔投屏线。\n用遥控器切换电视信号源。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "网络电话",
|
||||
"items": [
|
||||
{
|
||||
"title": "网络电话机故障",
|
||||
"content": "拔插电源线,等待3分钟后重插,启动后重试(重启约需1分钟)。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "碎纸机",
|
||||
"items": [
|
||||
{
|
||||
"title": "碎纸机使用方法",
|
||||
"content": "确认碎纸机已通电并处于待机状态,电源指示灯正常亮起。\n将待销毁的纸质文件整齐放入进纸口,避免折叠或过厚。\n按下“运行”按钮,碎纸机将自动开始工作,直至完成处理。\n文件粉碎完成后,机器会自动停止。"
|
||||
},
|
||||
{
|
||||
"title": "碎纸机异常无反应",
|
||||
"content": "依次检查电源插头、碎纸箱是否扣紧"
|
||||
},
|
||||
{
|
||||
"title": "碎纸机卡纸处理",
|
||||
"content": "单次碎纸上限一般8张普通复印纸,取出卡纸后,插拔电源重新启动"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "网络",
|
||||
"subs": [
|
||||
{
|
||||
"name": "有线无线",
|
||||
"items": [
|
||||
{
|
||||
"title": "iPad如何连接总部办公WiFi网络",
|
||||
"content": "不支持员工认证方式。短期用访客码申请;长期需提交工单“终端设备网络准入申请”加白处理。\nhttp://devops.dc.servyou-it.com/dashboard,服务台-服务目录-IT支持服务-员工服务入口-终端设备网络准入申请"
|
||||
},
|
||||
{
|
||||
"title": "员工手机怎么连接公司内网?",
|
||||
"content": "打开手机搜索无线网络\n发现并连接servyou网络后,浏览器输入http://www.baidu.com等网址\n耐心等待30秒左右,触发弹出账号密码认证界面,依次输入员工账号密码和动态短信验证码登录,确保认证页面自动弹出,不要手动输入网址。\n注:\n新入职员工,请确认账号信息是否已同步,建议入职次日再尝试连接。\n苹果手机请使用QQ浏览器打开认证页面,避免使用Safari。如使用Safari,可尝试点击“显示详细信息”后访问。"
|
||||
},
|
||||
{
|
||||
"title": "手机连接公司网络提示“未获取到手机号,请与管理员联系”",
|
||||
"content": "新员工入职当天账号信息未完全同步,需第二天才可正常使用"
|
||||
},
|
||||
{
|
||||
"title": "访客在公司总部如何联网",
|
||||
"content": "申请访客码:\n1. 临时访客设备连接servyou网络,浏览器弹出认证界面后点击“申请访客码”(有效期24小时)。\n2. 拜访对象邮箱收到邮件,点击允许接入。\n3. 手机接收访客码并登录。"
|
||||
},
|
||||
{
|
||||
"title": "电脑端税友安全助手登录异常“**认证失败,网络已断开”",
|
||||
"content": "原因:账号密码输入错误、密码过期或税友安全助手安装后未重启电脑。\n解决:\n1. 重置密码: http://192.168.9.87:8080/employee-center/resetPwd.jsp\n2. 助手界面点击“注销”,手动重输密码。若无效则需重启电脑。"
|
||||
},
|
||||
{
|
||||
"title": "手机连公司内网异常“账号/密码情误或认证被拒绝!请再次确认验证码,或者重置密码”",
|
||||
"content": "确保认证界面自动弹出,勿手动输入网址。建议使用QQ浏览器,Safari可尝试“显示详细信息”后访问。"
|
||||
},
|
||||
{
|
||||
"title": "员工办公电脑总部连接办公网络",
|
||||
"content": "步骤:\n1. 连接SERVYOU无线或有线网络。\n2. 访问192.168.1.53下载安装税友安全助手。\n3. 重启电脑后登录助手(账号为邮箱前缀,密码同邮箱)。"
|
||||
},
|
||||
{
|
||||
"title": "互联网部分网页无法访问【Windows】",
|
||||
"content": "使用办公网络时,部分网页无法访问,可能因代理服务器设置异常导致。\n解决办法:\n1.检查DNS设置\n右键点击Windows 图标--“网络连接”-打开“更改适配器选项”--选择“以太网”或者“WLAN”-右键“属性”--选择“Internet协议版本 4(TCP/IP4)”-点击“属性”-选择“使用下面的DNS服务器地址”-首选DNS服务器和备用DNS服务器---输入“10.253.0.55”(公司内网专用的 DNS)和“223.5.5.5”(阿里云公共 DNS)—单击“确定”。\n2.检查代理设置\n以 Edge浏览器为例“菜单>设置>显示高级设置>更改代理设置> LAN 设置 并取消选中”为 LAN 使用代理服务器“复选框。\n办公网络异常修复"
|
||||
},
|
||||
{
|
||||
"title": "互联网部分网页无法访问【Mac】",
|
||||
"content": "使用办公网络时,部分网页无法访问,可能因代理服务器设置异常导致。\n报错信息:\n代理服务器出现问题,或者地址有误。\n解决办法:\n1.检查DNS设置\n单击菜单栏右上角的“ Apple”图标,-选择“系统偏好设置”-选择“网络”,点击连接的网络(比如Wi-Fi)--------选择“高级”,在弹出的选框中点击“DNS”选项卡,然后点击左下角【+】图标,手动添加DNS地址。如:10.253.0.55(公司内网专用的 DNS)和223.5.5.5(阿里云公共 DNS)。\n2.取消所有代理协议勾选\n单击菜单栏右上角的“ Apple”图标,-------选择“系统偏好设置”----------选择“网络”,点击连接的网络,比如是Wi-Fi--------选择“高级”,在弹出的选框中点击“DNS”选项卡,取消所有协议前的勾选项”总部办公互联网出口IP地址\n电信:115.227.36.10;联通:180.178.252.186。更新信息见税友家园公告。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "零信任",
|
||||
"items": [
|
||||
{
|
||||
"title": "SSL VPN升级零信任 aTrust通知",
|
||||
"content": "自2026年3月19日起,因SSL VPN设备架构调整,为保障协议兼容性、性能与稳定性,SSL VPN更新升级为零信任 aTrust,请各位同事在更新升级后使用。"
|
||||
},
|
||||
{
|
||||
"title": "SSLVPN与零信任区别",
|
||||
"content": "SSL VPN是深信服传统的远程访问解决方案,EasyConnect是其客户端名称;而零信任是一种更先进的安全理念,aTrust则是深信服基于此理念推出的、用于替代和升级SSL VPN的具体产品。"
|
||||
},
|
||||
{
|
||||
"title": "Windows操作系统SSLVPN客户端EasyConnect自动升级零信任aTrust指引",
|
||||
"content": "步骤1:打开原 SSLVPN客户端easeconnect,并输入https://vpn.servyou.com.cn,点击“连接”\n步骤2:客户端登录,提示版本更新,点击“立即更新”\n步骤3:等待客户端自动完成更新和安装,完成客户端自动打开新的客户端\n步骤4:通过新的客户端sTrust,接入设置输入:https://vpn.servyou.com.cn,点击“确定接入”,然后输入账号密码登录"
|
||||
},
|
||||
{
|
||||
"title": "Mac os操作系统SSLVPN客户端自动升级零信任aTrust指引",
|
||||
"content": "Macy原客户端easeconnect首次登录后,会提示版本不匹配,需要下载新版本,下载后双击客户端安装文件完成安装即可。\n步骤1:客户端输入https://vpn.servyou.com.cn,会提示版本不匹配,点击“下载更新”\n步骤2:跳转的页面点击“立即下载”\n步骤3:双击已下载的客户端安装文件,根据提示完成安装\n步骤4:客户端安装完成后,新老客户端会同时存在,打开“atrust”客户端,并输入https://vpn.servyou.com.cn登录"
|
||||
},
|
||||
{
|
||||
"title": "atrust客户端无法建立连接?",
|
||||
"content": "请按以下步骤排查:\n退出客户端重新登录\n重启电脑后再次尝试\n检查本地网络是否正常\n确认未连接其他VPN软件"
|
||||
},
|
||||
{
|
||||
"title": "atrust客户端登录成功后但无法访问内部系统怎么办?",
|
||||
"content": "可能原因包括:\n本地缓存未刷新\nDNS缓存未更新\n权限问题\n建议:\n断开连接后重新登录\n执行DNS刷新(Windows:ipconfig /flushdns)"
|
||||
},
|
||||
{
|
||||
"title": "零信任aTrust客户端下载地址",
|
||||
"content": "Windows客户端下载:\nhttps://atrustcdn.sangfor.com/standard/windows/2.5.16.20/aTrustInstaller.exe\nMac客户端下载:\nhttps://atrustcdn.sangfor.com/standard/mac/2.5.16.20/aTrustInstaller.pkg\n安卓、苹果手机移动客户端下载:\n应用商店搜索“aTrust”app"
|
||||
},
|
||||
{
|
||||
"title": "零信任访问非公共资源权限申请",
|
||||
"content": "申请路径:打开一张式运维平台-服务目录-IT支持服务-员工零信任账号申请,类型选“权限申请”,根据资源类型选择测试资源或其他资源,其他咨询填写网址/IP/端口。\n申请地址:http://devops.dc.servyou-it.com/ITSM/workflow/service/createTicket?name=%E5%91%98%E5%B7%A5%E9%9B%B6%E4%BF%A1%E4%BB%BB%EF%BC%88%E5%8E%9FVPN%EF%BC%89%E8%B4%A6%E5%8F%B7%E7%94%B3%E8%AF%B7"
|
||||
},
|
||||
{
|
||||
"title": "零信任aTrust客户端登录提示“用户名或密码错误,您还有 次尝试的机会”",
|
||||
"content": "原因一:没有申请过零信任账户,账户不存在\n申请方式:登录移动端企业微信,企业微信→工作台→一站式运维平台→服务目录→IT支持服务→员工零信任账号申请。\n原因二:密码输入错误、忘记密码或者申请账号后首次登录\n解决办法:需登录页https://vpn.servyou.com.cn点击“忘记密码”,用户名使用邮箱前缀,根据提示重置密码\n原因三:用户名输入错误或填写了员工账户中心密码\n解决办法:零信任账号与员工账户中心账号使用不同身份认证体系,如:aTrust用户名与虽然税友家园、邮箱前缀相同,但深信服aTrust采用独立密码管理规则,重置过程也与统一员工账号密码不同步"
|
||||
},
|
||||
{
|
||||
"title": "零信任(原VPN)登录异常“账号禁用”",
|
||||
"content": "360天未登录使用aTrust会导致账号被禁用,登录运维平台-员工零信任账号申请-申请类型“账号解禁\"\nhttp://devops.dc.servyou-it.com/ITSM/workflow/service/createTicket?name=%E5%91%98%E5%B7%A5%E9%9B%B6%E4%BF%A1%E4%BB%BB%EF%BC%88%E5%8E%9FVPN%EF%BC%89%E8%B4%A6%E5%8F%B7%E7%94%B3%E8%AF%B7"
|
||||
},
|
||||
{
|
||||
"title": "零信任密码重置“用户信息匹配失败,请联系管理员,...”",
|
||||
"content": "申请开通账号(零信任账号并非入职默认开通,如有办公需求,需登录移动端企业微信,企业微信→工作台→一站式运维平台→服务目录→IT支持服务→员工零信任账号申请。)\n检查手机号码填写正确,已更换手机号,请提交员工零信任账号申请,备注填写更换的新手机号)\n检查用户名是否正确,用户名为邮箱前缀,且字母均为小写"
|
||||
},
|
||||
{
|
||||
"title": "零信任登录异常”账号锁定“",
|
||||
"content": "密码输入错误3次后系统锁定账户,不进行任何操作10分钟自动解锁。等待期间勿操作以免重置锁定计时。"
|
||||
},
|
||||
{
|
||||
"title": "零信任员工账号申请",
|
||||
"content": "员工可以因出差、居家办公等情况单独申请零信任员工账号。\n办公内网申请方式: 一站式运维平台→服务目录→IT支持服务→员工零信任账号申请(http://devops.dc.servyou-it.com)\n公司外部申请方式:登录移动端企业微信,企业微信→工作台→一站式运维平台→服务目录→IT支持服务→员工零信任账号申请。\n处理同事将会在工作时间1小时内接单,并在当天下班前处理完成,请耐心等待,处理进度请关注“一站式运维平台”企微应用消息提醒。"
|
||||
},
|
||||
{
|
||||
"title": "零信任无法收到验证短信",
|
||||
"content": "检查短信应用下所有信息目录,查看是否被垃圾信息、推广信息过滤\n重启手机。\n3. 机主发送短信“11111”至10690999申请解除黑名单。"
|
||||
},
|
||||
{
|
||||
"title": "零信任验证手机号码更改",
|
||||
"content": "通过一站式运维平台提交“员工零信任账号申请”工单,备注新旧手机号。手机端路径:企业微信→工作台→一站式运维平台。"
|
||||
},
|
||||
{
|
||||
"title": "零信任登录提示异常“网络请求异常,请稍后重试”",
|
||||
"content": "原因和解决办法:\n一般是网络波动导致,切换自己手机热点测试使用。"
|
||||
},
|
||||
{
|
||||
"title": "零信任登录提示异常“路由连接失败”",
|
||||
"content": "原因:网络冲突或DNS缓存。\n解决:\n使用外部网络(如手机热点)测试。\nMac:网络设置中添加DNS 10.253.0.55和223.5.5.5。"
|
||||
},
|
||||
{
|
||||
"title": "零信任登录提示异常“选路连接失败,可能当前连接网络异常,请稍后重试”",
|
||||
"content": "服务器地址栏需要完整输入 https://vpn.servyou.com.cn,不能省略https://,也不能填写为http://vpn.servyou.com.cn\n因安全和网络原因限制,集团总部(杭州)办公网络禁止连接零信任\n部分税局、酒店或其他无线网络波动或限制,\n解决方法:可尝试重启电脑后,使用手机热点连接网络,重新登录零信任"
|
||||
},
|
||||
{
|
||||
"title": "零信任aTrust客户端支持桌面操作系统清单",
|
||||
"content": "【Windows系统】\nWindows 7~11\n【Mac os】\nMacOS10.13~10.15,Mac11.x~Mac OS 14.x\n【Linux/国产系统】\nUOS(V20) For X86、ARM、MIPS、Loongarch\n麒麟(V10/V10 SP1)For X86、ARM、MIPS\n麒麟(V10 SP1)For Loongarch\nUbuntu 16、18、20、22、24 For X86\n中科方德(5.0-G220/5.0-G220H) For X86、ARM、Loongarch\n注意:\n已发布版本中,windows11 arm架构的电脑不支持使用工作空间,同时不支持麒麟server系统、中标麒麟系统、deepin系统、centos系统接入。"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "安全",
|
||||
"subs": [
|
||||
{
|
||||
"name": "税友安全助手",
|
||||
"items": [
|
||||
{
|
||||
"title": "税友安全助手卸载操作",
|
||||
"content": "卸载税友安全助手后将无法正常在杭州总部进行网络访问,请确认税友安全助手卸载原因,如:电脑更换、离职、离开杭州总部工作\n2.通过以下方式获取卸载动态码\nwindows系统:下载IT提供卸载助手脚本 https://drive.weixin.qq.com/s?k=AAoA1wcYAAch0J2Cxe,直接双击运行后生成动态码,回复生成的动态码,填入桌面IT支持回复的卸载码进行卸载\nmac os系统:右键右上角的安全助手图标,点击卸载,随后提供动态码,\n3.将生成的动态码,通过智能IT助手 人工服务,提供生成的动态码,获取回复的卸载码进行卸载"
|
||||
},
|
||||
{
|
||||
"title": "Window系统下载安装“税友安全助手”",
|
||||
"content": "步骤:\n连接servyou网络,访问http://192.168.1.53 ,员工电脑通道-点击提示链接,下载安装“税友安装助手”。\n2. 安装后重启电脑,在任务栏右下角打开助手登录。\n税友安全助手下载链接 http://192.168.1.53:8099/portal/redirect/nacc/"
|
||||
},
|
||||
{
|
||||
"title": "MAC OS系统下载安装“税友安全助手",
|
||||
"content": "步骤:\n1. 连接servyou网络,访问http://192.168.1.53/portal/redirect/nacc/下载。\n2. 根据系统版本选择安装项(如MAC OS 14以上选70133)。\n3. 运行安装程序,按系统提示授权(点击“是”/“仍要打开”)。\n4. 输入开机密码(盲输),完成安装后重启电脑。"
|
||||
},
|
||||
{
|
||||
"title": "税友安全助手打开方式和查看运行状态图标",
|
||||
"content": "Windows系统:右下角任务栏图标;Mac:右上角菜单栏图标。"
|
||||
},
|
||||
{
|
||||
"title": "Mac OS系统安装税友助手报错“身份不明的开发者”",
|
||||
"content": "解决:\n1. 系统偏好设置→安全性与隐私→允许安装。\n2. 输入开机密码(盲输),完成安装后重启。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "火绒安全",
|
||||
"items": [
|
||||
{
|
||||
"title": "火绒安全终端下载安装",
|
||||
"content": "火绒安全是公司指定使用的杀毒软件,请根据情况选择安装版本:\n总部员工:请选择火绒终端安全企业版,下载地址:\nWindows系统: http://huorong.oa.servyou-it.com/deploy/installer.exe\nMacOS系统: http://huorong.oa.servyou-it.com/deploy/mac-inst.dmg\n安装过程中控制中心地址设置: http://huorong.oa.servyou-it.com:80\n区域员工:请选择火绒安全软件个人版\nWindows系统 https://www.huorong.cn/person5.html"
|
||||
},
|
||||
{
|
||||
"title": "火绒安全如何卸载",
|
||||
"content": "火绒安全卸载:向IT支持人工说明卸载原因获取输入卸载码,打开Windows系统控制面板-程序和功能,选择火绒终端安全管理系统安全终端-右键卸载,输入获取的卸载码"
|
||||
},
|
||||
{
|
||||
"title": "火绒安全如何退出",
|
||||
"content": "向IT支持人工说明退出原因获取卸载密码(火绒安全管理员密码),屏幕右下角火绒图标,点击“退出火绒”"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "员工账户中心",
|
||||
"items": [
|
||||
{
|
||||
"title": "员工账户密码重置和修改",
|
||||
"content": "步骤:\n1. 访问http://192.168.9.87:8080/employee-center/resetPwd.jsp重置,密码需10位以上含大小写字母、数字、符号中的三种。\n2. 同步修改本地客户端(如总部刷卡打印机客户端、税友安全助手)密码。\n3.如不确认原密码或者原密码忘记,重置方式请选择“短信验证码重置”\n注意事项\n-员工账户密码有效期为90天,密码到期前3天会通过消息进行提醒,到期后未更新将重置为随机密码,需通过短信验证码重置方式找回\n-已经无法联网情况,可以借用同事电脑或者通过手机热点连接零信任后执行密码修改操作\n-使用独立密码的零信任和邮件客户端,无需修改重置"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "风险应对",
|
||||
"items": [
|
||||
{
|
||||
"title": "终端安全风险预警",
|
||||
"content": "如果您遇到网络诈骗、网络攻击、恶意病毒、钓鱼邮件、账号被盗、信息泄露等安全问题,或已点击链接,请立即点击链接向“信息安全支持”进行反馈.https://work.weixin.qq.com/nl/innerkfid/ikfCtcYBwAAtkP_ODMcv53bGE5x5M9YYw"
|
||||
},
|
||||
{
|
||||
"title": "重大安全活动相关信息和管理要求",
|
||||
"content": "活动期间禁用社交软件,公共服务策略调整详见公告链接。\n活动时间以税友家园通知为准,或咨询“信息安全支持”服务号"
|
||||
},
|
||||
{
|
||||
"title": "重大安全活动期间软件限制“微信无法登录“",
|
||||
"content": "本答案适用于重大安全活动期间,当前时期可能不适用,活动期间范围请关注税友家园公告\n活动期间禁止使用微信/QQ/脉脉等,需通过工单申请特殊权限。\n申请路径:一站式运维平台→集团内部服务→其他服务→办公及远程接入网络安全策略申请。https://devops.dc.servyou-it.com/itsm/service/workbench\n=gf4ljb\n如有疑问请联系企业微信“员工服务-信息安全支持”"
|
||||
},
|
||||
{
|
||||
"title": "远程控制软件使用限制与特殊申请(向日葵、Todesk、Teamivew、Teamview)",
|
||||
"content": "根据 2023年第【13】号《税友集团信息安全管理制度》第二十二条,2.2.7. 远程办公中规定,禁用使用远程工具(包括不限于向日葵)访问个人办公电脑。即不得使用远程工具用于员工远程办公用途。特殊情况需通过工单申请:申请路径:一站式运维平台→集团内部服务→其他服务→办公及远程接入网络安全策略申请,如有疑问请企业微信联系“员工服务-信息安全支持”。https://devops.dc.servyou-it.com/ITSM/workflow/service/createTicket?name=%E5%8A%9E%E5%85%AC%E5%8F%8A%E8%BF%9C%E7%A8%8B%E6%8E%A5%E5%85%A5%E7%BD%91%E7%BB%9C%E5%AE%89%E5%85%A8%E7%AD%96%E7%95%A5%E7%94%B3%E8%AF%B7\n向日葵软件下载地址:https://sunlogin.oray.com/download"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "资产",
|
||||
"subs": [
|
||||
{
|
||||
"name": "硬件资产",
|
||||
"items": [
|
||||
{
|
||||
"title": "个人名下公司资产及资产详细信息查询",
|
||||
"content": "方式一:登录eHR系统,进入“个人信息-个人固定资产”页面,可查询领用设备清单、资产名称、资产编号、规格\n方式二:查看设备固定资产标签,一般在设备底部或侧边,包含资产名称、启用时间、资产编号、型号"
|
||||
},
|
||||
{
|
||||
"title": "办公电脑升级和汰换流程",
|
||||
"content": "操作步骤:\n1.自行提交“IT资产升级申请”,申请流程路径:企业微信-工作台-审批-IT资产升级申请\n2.审批通过后,总部同事至122室办理;区域同事联系当地资产管理员。\n注意事项:\n升级申请内存、硬盘、显示器,其容量、尺寸和型号需符合《IT资产配置标准》中的岗位要求,特殊超标申请需部门领导审批。\n办公电脑启用时间达到五年,可以申请整机汰换(Mac电脑汰换周期暂定未8年)\n《IT资产配置标准》文档链接:https://oa.servyou-it.com/spa/document/index.jsp?id=3471&router=1#/main/document/detail"
|
||||
},
|
||||
{
|
||||
"title": "公司领用办公电脑使用或启用年限已满5年,可以申请延期使用吗?",
|
||||
"content": "公司电脑启用年限满5年不是强制汰换要求,可以继续使用,无需办理延期申请."
|
||||
},
|
||||
{
|
||||
"title": "办公IT资产借用/退还",
|
||||
"content": "可借用设备类型:办公电脑、显示器、小鱼会议终端、会议音箱\n申请审批流程入口:企业微信-审批-资产借用申请\n领取/退还地点:\n总部同事至税友亿企赢大厦122室办理;\n区域同事联系当地资产管理员。"
|
||||
},
|
||||
{
|
||||
"title": "办公IT资产领用/退还",
|
||||
"content": "可领用设备类型:办公电脑、显示器、键盘、鼠标、网线、话机\n申请审批流程入口:企业微信-审批-资产领用申请\n注:键盘、鼠标、网线、话机等低值易耗品无需提交申请流程\n领取/退还地点:\n总部同事至税友亿企赢大厦122室办理;\n区域同事联系当地资产管理员。"
|
||||
},
|
||||
{
|
||||
"title": "系统维修工具借用",
|
||||
"content": "借用工具类型:系统安装U盘、螺丝刀、移动硬盘(盒)\n借用流程:\n1.回复“IT”获取桌面IT支持人工支持链接\n2.点击IT支持人工支持链接进入人工坐席咨询窗口\n3.说明需要借用的工具类型、使用地点、使用时间\n4.耐心等待人工支持坐席回复,确认设备库存。\n5.总部员工前往121室进行借用登记,区域同事联系资产管理员"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "软件资产",
|
||||
"items": [
|
||||
{
|
||||
"title": "公司限制使用的商业软件清单",
|
||||
"content": "正版化严控清单(包括但不限于):\nXshell/Xftp/Xmanager、InterBase、Delphi、MyEclipse、CINEMA4D、Anaconda、Fiddler、Navicat、VMware全系列、UltraEdit、HP Loadrunner、Adobe全系列(如Acrobat、Acrobat Reader、Photoshop、lllustrator、After Effects、Premiere、Lightroom、Audition、InDesign、Adobe XD等)。"
|
||||
},
|
||||
{
|
||||
"title": "parallelsDesktop软件使用限制与替代方案",
|
||||
"content": "公司实行软件正版化管理,收费软件需经需求评估后安装。\n替代方案:建议使用VirtualBox。\n资源包下载(含Win7/Win10纯净版及VB安装包):\n链接:https://pan.baidu.com/s/1ly-3vDMOh48yRXRo-b-hBg 提取码:serv\n安装指南:在VirtualBox中通过“管理→导入虚拟电脑”直接导入系统。"
|
||||
},
|
||||
{
|
||||
"title": "visio软件使用限制与替代方案",
|
||||
"content": "公司实行软件正版化管理,收费软件需经需求评估后安装。\n替代方案:\n1. 仅需读取Visio文档:使用Microsoft Visio查看器(https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=51188 )。\n2. 需编辑文档且可接受非vsdx格式:使用ProcessOn在线工具(https://www.processon.com/i/5c99dd75e4b0180f6ee6c615 )。注:敏感信息勿用。\n3. 必须输出vsdx格式(如外部分享):走正式审批流程,路径:企业微信→工作台→审批→商业软件服务申请,费用2040元由部门分摊,需事业部总经理审批。"
|
||||
},
|
||||
{
|
||||
"title": "微软office软件使用限制与替代方案",
|
||||
"content": "公司推行软件正版化政策,禁止安装盗版软件。安装Microsoft Office需部门分摊费用3070元,申请流程:\n路径:企业微信→工作台→审批→商业软件服务申请。\n审批要求:需事业部总经理批准。\n建议:若无特殊需求,优先安装WPS作为替代方案。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "自备电脑",
|
||||
"items": [
|
||||
{
|
||||
"title": "自备电脑申请及审核",
|
||||
"content": "步骤:\n1. 确认岗位在《自备电脑补贴岗位清单》内。\n2. 电脑配置需高于公司标准。\n3. eHR系统→流程申请→自备电脑使用申请/变更,提交购买凭证。\n4. 半工作日内完成配置审核。详情见《自备电脑使用及补贴管理办法》。\n详情请查看《自备电脑使用及补贴管理办法》\nhttps://oa.servyou-it.com/spa/document/index2file.jsp?id=75578&versionId=78041&imagefileId=96908&router=1#/main/document/fileView"
|
||||
},
|
||||
{
|
||||
"title": "所有在公司使用的自备电脑的都需要登记?不领取补贴但使用自备电脑的员工是否需要登记?",
|
||||
"content": "根据公司管理要求,所有在公司使用的自备电脑的员工,都需要进行自备电脑信息登记"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑购买二手电脑如何计算购买时间?",
|
||||
"content": "二手按电脑电脑首次销售发票开具时间开始计算,如果无法提供购买发票,则按设备出厂时间计算,也可按官网查询的首次购买,以及设备激活、保修开始时间计算"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑无法提供销售发票或者发票遗失如何计算购买时间?",
|
||||
"content": "可以使用平台订单、收据、转账记录作为购买凭证时间参考依据(不包含二手电脑二次销售凭证),如果没有购买凭证参考依据,则使用设备出产时间"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑发票时间、出厂时间、购买记录不一致如何计算?",
|
||||
"content": "补贴发放截止时间采纳的优先次序为 , 发票时间>购买记录>出厂日期"
|
||||
},
|
||||
{
|
||||
"title": "使用配件自行组装自备电脑如何计算出厂时间",
|
||||
"content": "按整机或主要配件(CPU、主板)任一主要配件购买凭证或出厂日期计算"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑如何查看通过电脑序列号查询生产日期",
|
||||
"content": "联想 https://pre.wx.lenovo.com.cn/wordpress/?p=1456 https://newsupport.lenovo.com.cn/guardeploySearch.html?fromsource=guanwang&_ga=2.67510865.1168833807.1598233691-1876919846.1595491060\nhttps://newthink.lenovo.com.cn/guarantee.html?v=329b114e91fec9e2336126dfd1b6ff42\nDell https://www.dell.com/support/contents/zh-cn/article/product-support/self-support-knowledgebase/locate-service-tag/notebook https://www.dell.com/support/contractservices/zh-cn/\nHP https://support.hp.com/cn-zh/document/ish_2898769-2609229-16 https://support.hp.com/cn-zh/check-warranty\n微软 https://support.microsoft.com/zh-cn/surface/%E6%9F%A5%E6%89%BE-surface-%E8%AE%BE%E5%A4%87%E5%92%8C%E9%85%8D%E4%BB%B6%E6%88%96microsoft%E9%85%8D%E4%BB%B6%E7%9A%84%E5%BA%8F%E5%88%97%E5%8F%B7-6c0abc0c-2b45-247d-f959-70e504e55fa5 https://mybusinessservice.surface.com/en-US/CheckWarranty/CheckWarrantyhttps://support.microsoft.com/zh-cn/surface/surface-%E4%BF%9D%E4%BF%AE-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E7%AD%94-1217913a-2692-424e-a5c4-0eb0de84f05a\n小米 https://www.mi.com/service/notebook/drivers https://47wke3.smartapps.baidu.com/?_chatQuery=%E5%B0%8F%E7%B1%B3%E6%80%8E%E4%B9%88%E6%9F%A5%E5%87%BA%E5%8E%82%E6%97%A5%E6%9C%9F&searchid=14302220643046412854&_chatParams=%7B%22agent_id%22%3A%22592d7%22%2C%22content_build_id%22%3A%2218852dd5%22%2C%22from%22%3A%22q2c%22%2C%22token%22%3A%22alVvR3EyL3lWVnpwRk02ZFVSUG9GUzhkMkNZTDFwa0IySVJBUS9ORUxob2cyb0pObjdmVDhXQVJteEpqWjVMY2VMVzRoVmtBejBjRWdnNEdTNG5MclVQUGRIc3ZLa1QvMFhSQUdLMmhPRVVveHRQT3AvQUhTSldHTEdqU2NPa0NkUDJVNEU1MEVxK0o2UGg5czJjQ09CWUQzcVh6elRFVGJiNitpNmFvakxzPQ%3D%3D%22%2C%22chat_no_login%22%3Atrue%7D&_swebScene=3711000610001000\n宏基 https://community.acer.com/cn/kb/articles/863-%E5%BA%8F%E5%88%97%E5%8F%B7%E6%88%96snid%E5%8F%B7 https://www.acer.com.cn/myhelp.html?type=3&serverid=143\n华为 https://consumer.huawei.com/cn/support/content/zh-cn00688529/ https://consumer.huawei.com/cn/support/warranty-query/\n华硕 https://www.asus.com.cn/support/article/566/ https://www.asus.com.cn/support/warranty-status-inquiry/\n神州 机器底部有一个lOT http://www.hasee.com/after/index\n苹果\nhttps://support.apple.com/zh-cn/102767 https://checkcoverage.apple.com/user-consent"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑补贴岗位是如何设定的?",
|
||||
"content": "自备电脑补贴岗位范围,是针对对电脑性能有较高性能需求技术岗位,以及部分特殊需求岗位;对于这部分性能要求较高的开发和测试岗位,一方面我们提高了这些岗位公司配发电脑标准,同时保留了自备电脑补充策略供员工自由选择"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑管理办法提到较高性能的技术岗位是如何确定的?",
|
||||
"content": "根据总部历年员工满意度调查中员工反馈,以及IT资产配置标准评估过程中电脑内存CPU报警统计信息,开发和测试岗位所使用电脑的CPU和内存报警次数和时长远高于其他岗位(80%内存CPU报警阈值),开发和测试类岗位与其他岗位相比,对电脑性能有明显较高要求。"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑补贴岗位以后还会有新增或变更吗?",
|
||||
"content": "参考《IT资产配置标准》中岗位与设备变更和执行反馈意见,由管理部门共同商议修订,并在EHR系统同步更新。"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑配置是否符合IT资产配置标准如何判断?",
|
||||
"content": "自备电脑配置审核标准要求,主要看配置是否达到购买日期或补贴发放历史年度IT资产配置标准\n●当前自备电脑配置需满足任职岗位的当前公司配发电脑配置最低标准\n●CPU主要看是否同级&同代(i3\\i5\\i7\\i9)同代(八代、十代、11代、12代...),跨级跨带可酌情增加和降低审核标准(每相差1年一代按1年累积计算)。\n●内存和硬盘不符情况下,可提供升级后的配置信息截图或升级配件购买记录"
|
||||
},
|
||||
{
|
||||
"title": "\"自备电脑补贴到期截止时间是怎么计算的?",
|
||||
"content": "●6/10前所有现有领取补贴员工需进行登记,不登记电脑信息,不发放补贴\n●当前使用自备电脑购买日期<5年,补贴领取截止时间为当前使用电脑从购买之日起5年\n●当前使用自备电脑购买日期>5年,停止补贴发放\n●非补贴岗位6/3日期后购买的电脑不享受存量自备电脑补贴政策"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑补贴年限规定?",
|
||||
"content": "单台自备电脑电脑补贴有效期为由购买日期计算至5年截止。"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑补贴岗位内的人员,后续电脑更换了需要怎么操作",
|
||||
"content": "单台自备电脑补贴期限最多为5年,到期后自动停发补贴。若要继续申请补贴,新购或更换设备后,须在5个工作日内在EHR系统重新提交“自备电脑使用申请”,并提供购买凭证(发票、收据)或出厂日期证明。"
|
||||
},
|
||||
{
|
||||
"title": "\"自备电脑电脑补贴岗位外的补贴时间是到什么时候结束?",
|
||||
"content": "自备电脑补贴岗位外正在享受补贴的员工,继续享受补贴至当前使用自备电脑补贴有效期截止;"
|
||||
},
|
||||
{
|
||||
"title": "自备补贴到期了,不想用公司配发电脑,可以继续使用自备电脑吗?",
|
||||
"content": "可以继续使用自备电脑,但无法领取补贴,需遵守自备电脑管理要求,进行自备电脑登记,纳入自备电脑台账管理。登录eHR系统- 流程申请-自备电脑使用申请进行登记。"
|
||||
},
|
||||
{
|
||||
"title": "\"入职、离职、调岗,自备电脑与公司电脑直接切换当月,自备电脑使用不足1月,补贴金额怎么计算",
|
||||
"content": "自然月内累计使用自备电脑办公≥15天,按100元/月标准随工资发放补贴。"
|
||||
},
|
||||
{
|
||||
"title": "自备电脑补贴到期后,如何申请公司电脑?",
|
||||
"content": "自备电脑申请路径:EHR系统个人信息-个人固定资产查看中-进行报备。"
|
||||
},
|
||||
{
|
||||
"title": "实习生可以申请自备电脑补贴吗?",
|
||||
"content": "实习生不在自备电脑补贴范围内"
|
||||
},
|
||||
{
|
||||
"title": "\"自备电脑如果使用的MAC电脑或者AMD 或非intel CPU应该如何评估?",
|
||||
"content": "与同类intel芯片做比较,在20%性能差异范围内,可使用通用查询工具AI或CPU天梯图查询相关性能对比信息,酌情综合评估是否满足岗位工作需要。"
|
||||
},
|
||||
{
|
||||
"title": "\"购买的自备电脑原始配置没有达到岗位要求,后续通过升级后达到配置要求,可以获得补贴吗?",
|
||||
"content": "通过后续升级后达到岗位IT资产配置标准符合补贴资格条件,硬盘容量可以通过外置连接方式升级,但内置硬盘应为固态硬盘,且固态硬盘容量不低于256GB。"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "其他",
|
||||
"subs": [
|
||||
{
|
||||
"name": "活动支持",
|
||||
"items": [
|
||||
{
|
||||
"title": "会议室预定",
|
||||
"content": "总部会议室:企业微信→工作台→“会议室预定”应用。\n区域会议室(北京/石家庄等):企业微信→工作台→“会议室”应用。"
|
||||
},
|
||||
{
|
||||
"title": "活动与会议技术支持预约",
|
||||
"content": "提交预约工单(需至少提前1天):https://oa.servyou-it.com/spa/portal/static/index.html#/main/portal/portal-8-34 ,选择“重要活动支持预约”。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "党工",
|
||||
"items": [
|
||||
{
|
||||
"title": "税友家园",
|
||||
"content": "税友家园网址: https://oa.servyou-it.com\n账号密码认证方式:统一员工账号密码\n税友家园登录异常\n情况一:新员工入职次日方可登录,请耐心等待。\n情况二:账号密码错误,通过重置密码解决(http://192.168.9.87:8080/employee-center/resetPwd.jsp)。"
|
||||
},
|
||||
{
|
||||
"title": "官网地址",
|
||||
"content": "税友集团官网地址:https://www.servyou.com.cn\n亿企赢官网地址:https://www.17win.com\n亿企鑫福官网地址:https://17xinfu.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "人力资源",
|
||||
"items": [
|
||||
{
|
||||
"title": "人力相关问题咨询(考勤、薪资、保险等)",
|
||||
"content": "通过企业微信→员工服务→“人力资源共享服务咨询”联系人力资源部门。https://work.weixin.qq.com/nl/innerkfid/ikfCtcYBwAAvSRL5i5b_Xia8vCmFc2gRw"
|
||||
},
|
||||
{
|
||||
"title": "人力资源管理平台",
|
||||
"content": "人力资源管理平台别名:税友eHR、EHR\n网站地址: https://ehr.dc.servyou-it.com\n应用路径:企业微信-工作台-税友eHR\n账号密码认证方式:统一员工账号密码,账号同企业邮箱的前缀"
|
||||
},
|
||||
{
|
||||
"title": "员工个人手机号更改",
|
||||
"content": "联系HR在EHR系统中修改。通过企业微信→员工服务→“人力资源共享服务咨询”联系人力资源部门。https://work.weixin.qq.com/nl/innerkfid/ikfCtcYBwAAvSRL5i5b_Xia8vCmFc2gRw"
|
||||
},
|
||||
{
|
||||
"title": "网络学院相关信息",
|
||||
"content": "企业微信入口(推荐方式): 企业微信-工作台-网络学院\n电脑端访问:https://servyoulearning.yunxuetang.cn\n手机端链接:https://servyoulearning.yunxuetang.cn/m\n新入职当日13:00后生成账号,若无法登录请次日重试。\n实习生无网络学院账号,会定期禁用,转正后可以进入学习。 如有网络学院相关疑问可咨询刘馨月。"
|
||||
},
|
||||
{
|
||||
"title": "新员工入职IT指引手册获取",
|
||||
"content": "新员工入职IT指引手册/指南地址:https://doc.weixin.qq.com/doc/w3_AU8AjwZhAIgyNSkHK3OTjWueJe1oa?scode=AAoA1wcYAAcD09JltaAQgAuAYMANY"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "财务",
|
||||
"items": [
|
||||
{
|
||||
"title": "财务工作相关问题",
|
||||
"content": "请联系财务中心或企业微信→员工服务→“总部报销服务台”。\n常见问题参考:\n财务软件安装:参考《财务人员工作环境安装指南》。\n差旅报销:通过企业微信→通讯录→员工服务→“总部报销服务台”咨询。\n金蝶EAS打印中断:重启软件或电脑后重试。\n金蝶安装:方式一:访问 http://10.90.5.92/down/kingdee.exe或http://192.168.2.67:6888/eassso/login ,点击帮助按钮获取安装包。使用问题咨询宋会讲。"
|
||||
},
|
||||
{
|
||||
"title": "财务共享平台地址",
|
||||
"content": "财务共享平台,旧地址192.168.9.215已下线,可以访问新域名:http://cwgx.oa.servyou-it.com/"
|
||||
},
|
||||
{
|
||||
"title": "手机企微无法访问“总部差旅报销”",
|
||||
"content": "问题现象:打开后报错“Whitelabel Error Page...Status=403”。\n解决步骤:\n1. 清理缓存:企业微信APP→头像→设置→通用→存储空间→清理缓存。\n退出并重新登录企业微信。"
|
||||
},
|
||||
{
|
||||
"title": "手机企微滴滴打车权限开通/管理",
|
||||
"content": "企微联系应用管理员:刘红霞"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "物业",
|
||||
"items": [
|
||||
{
|
||||
"title": "物业服务相关问题(工牌、门禁、停车等)",
|
||||
"content": "联系人指引:\n咖啡馆/食堂超市:于闻婧\n停车/保洁:谭欣\n补卡/餐卡:陈乐\n三楼食堂包厢:王蕊\n会议接待:袁丽丽\n其他问题:咨询物业服务号。https://work.weixin.qq.com/nl/innerkfid/ikfCtcYBwAAUtkMyOToCZqe42ZBDupVEQ"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "运维",
|
||||
"items": [
|
||||
{
|
||||
"title": "一站式运维平台综合信息",
|
||||
"content": "登录地址: http://devops.dc.servyou-it.com\n一站式运维平台使用统一员工账号密码+短信认证\n运维平台相关问题请咨询企业微信联系【员工服务号:工单系统技术支持】如:运维平台无法登录\n运维平台账号密码登录二次认证密码获取方法详见:运维平台登录说明https://doc.weixin.qq.com/doc/w3_AM4AvwYHAKkhd6GOfh1SAe8ID9Kbv?scode=AAoA1wcYAAcl8IQiqyAM4AvwYHAKk&qt_source=Search&qt_report_identifier=1764050011765&version=5.0.2.6008&platform=win\n维平台企微认证免扫描失效处理:\nchrome浏览器输入网址chrome://flags/#block-insecure-private-network-requests,搜索 Local Network Access Checks,改成Disabled\nedge浏览器输入网址edge://flags/#block-insecure-private-network-requests"
|
||||
},
|
||||
{
|
||||
"title": "JumpServer堡垒机综合信息",
|
||||
"content": "堡垒机访问权限申请:通过一站式运维系统提交申请,紧急情况联系工单处理人。\nhttp://devops.dc.servyou-it.com/itsm/service/workbench"
|
||||
},
|
||||
{
|
||||
"title": "GitLab相关问题",
|
||||
"content": "1. 账号锁定:5分钟后自动解锁;若忘记密码,请通过“员工账号密码重置”功能操作。\n2. 二次验证码手机更换:联系吴云鹏修改。\n3. 系统后台问题:联系吴云鹏处理。"
|
||||
},
|
||||
{
|
||||
"title": "阿里云综合信息",
|
||||
"content": "1.阿里云账号问题咨询:方笑\n2.阿里云账号验证mfa:陈伟章"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "产研",
|
||||
"items": [
|
||||
{
|
||||
"title": "Walle瓦力平台综合信息",
|
||||
"content": "平台介绍:\nwalle 是提供集 接口文档自动生成、接口文档查看、接口调试、接口Mock、接口测试用例、接口调用代码生成、对外提供在线/离线文档 等功能的 自动化、智能化的综合性接口管理平台。可以提升研发接口开发中各阶段的效率与减少协作时的沟通成本,并助力团队制定符合团队的研发流程与规范。适合公司 GB 端及各分公司研发同学使用。\n功能介绍:\n接口生成与使用流程图\n平台账号密码:\n访问 walle 平台, 使用线上的 员工邮箱前缀 、 邮箱密码 登录 (eg: 账号 liaobl, 密码:xxxxxx), 可以在 全部项目 页面 查看所有项目, 可以随意查看项目的接口文档,如果需要创建项目或对接口进行调试、Mock、修改等操作,需要找【于程程】或项目负责人 添加权限\n联系支持:\n使用过程有任何问题或者需求的可以直接联系[于程程],如:更换手机、需要获取新的二次认证二维码等\n如需及时了解 walle 平台的更新状态,可加入 【Walle 金牌服务群】,入群请联系[于程程]发送入群邀请"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "运营",
|
||||
"items": [
|
||||
{
|
||||
"title": "税友内管系统综合信息",
|
||||
"content": "别名:小蚂蚁、小蜜蜂\n客户端不支持苹果操作系统安装运行\n税友内管系统客户端下载地址:https://drive.weixin.qq.com/s?k=AAoA1wcYAAcLEI7DnM\n内管系统咨询支持:倪银飞。"
|
||||
},
|
||||
{
|
||||
"title": "基础运营平台综合信息",
|
||||
"content": "基础运营平台别名BOSS\n基础运营平台地址:https://boss.dc.servyou-it.com/#/\n账号密码认证方式:统一员工账号密码\n登录提示账号密码错误:\n优先检查账号密码是否过期\n检查电脑右下角系统时间是否准确,若时间存在偏差,请手动同步时间"
|
||||
},
|
||||
{
|
||||
"title": "快速查数工具综合信息",
|
||||
"content": "快速查数工具别名QQT\n账号密码登录:账号密码与内部统一员工账密一致。\n使用问题咨询:联系公共数据团队:李晓刚(17682348007)、朱文赵(15088664612)。如:若二次认证失败\n报表权限开通:查询广场-选择对应报表操作列“申请”按钮,报表管理员会进行审批。"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@"
|
||||
else
|
||||
exec node "$basedir/../acorn/bin/acorn" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../acorn/bin/acorn" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../acorn/bin/acorn" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../esbuild/bin/esbuild" "$@"
|
||||
else
|
||||
exec node "$basedir/../esbuild/bin/esbuild" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esbuild\bin\esbuild" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../esbuild/bin/esbuild" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../esbuild/bin/esbuild" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../he/bin/he" "$@"
|
||||
else
|
||||
exec node "$basedir/../he/bin/he" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\he\bin\he" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../he/bin/he" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../he/bin/he" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../he/bin/he" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../he/bin/he" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
||||
else
|
||||
exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../prebuild-install/bin.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../prebuild-install/bin.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\prebuild-install\bin.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../prebuild-install/bin.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../prebuild-install/bin.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../prebuild-install/bin.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../prebuild-install/bin.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../rc/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../rc/cli.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rc\cli.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../rc/cli.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../rc/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../rc/cli.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../rc/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../rolldown/bin/cli.mjs" "$@"
|
||||
else
|
||||
exec node "$basedir/../rolldown/bin/cli.mjs" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rolldown\bin\cli.mjs" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../rollup/dist/bin/rollup" "$@"
|
||||
else
|
||||
exec node "$basedir/../rollup/dist/bin/rollup" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rollup\dist\bin\rollup" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../rollup/dist/bin/rollup" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../rollup/dist/bin/rollup" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../rollup/dist/bin/rollup" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../rollup/dist/bin/rollup" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../sass/sass.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../sass/sass.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sass\sass.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../sass/sass.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../sass/sass.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../semver/bin/semver.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../tldts/bin/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../tldts/bin/cli.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\tldts\bin\cli.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../tldts/bin/cli.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../tldts/bin/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../tldts/bin/cli.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../tldts/bin/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
||||
else
|
||||
exec node "$basedir/../typescript/bin/tsc" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsc" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../typescript/bin/tsc" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../typescript/bin/tsc" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
||||
else
|
||||
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsserver" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../typescript/bin/tsserver" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../typescript/bin/tsserver" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../vite/bin/vite.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vite\bin\vite.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
||||
else
|
||||
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vitest\vitest.mjs" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../vitest/vitest.mjs" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../vitest/vitest.mjs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../vitest/vitest.mjs" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../vitest/vitest.mjs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-fix.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-switch.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../vue-tsc/bin/vue-tsc.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../vue-tsc/bin/vue-tsc.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-tsc\bin\vue-tsc.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../vue-tsc/bin/vue-tsc.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../vue-tsc/bin/vue-tsc.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../vue-tsc/bin/vue-tsc.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../vue-tsc/bin/vue-tsc.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../why-is-node-running/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../why-is-node-running/cli.js" "$@"
|
||||
fi
|
||||
@@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\why-is-node-running\cli.js" %*
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../why-is-node-running/cli.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../why-is-node-running/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../why-is-node-running/cli.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../why-is-node-running/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
@@ -1,10 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Youzan
|
||||
Copyright (c) Chen Jiahan and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,226 +0,0 @@
|
||||
# Vant Auto Import Resolver
|
||||
|
||||
English | [简体中文](./README.zh-CN.md)
|
||||
|
||||
`@vant/auto-import-resolver` is a resolver for [unplugin-vue-components](https://github.com/unplugin/unplugin-vue-components) that enables on-demand importing of Vant components.
|
||||
|
||||
### Features
|
||||
|
||||
- Supports `Vite`, `Webpack`, `Rspack`, `Vue CLI`, `Rollup`, `esbuild`, and more.
|
||||
- Automatically imports the corresponding CSS styles for the components.
|
||||
- Supports SSR (Server-Side Rendering).
|
||||
|
||||
### Installation
|
||||
|
||||
```shell
|
||||
# via npm
|
||||
npm i @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
|
||||
# via yarn
|
||||
yarn add @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
|
||||
# via pnpm
|
||||
pnpm add @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
|
||||
# via Bun
|
||||
bun add @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Vite
|
||||
|
||||
```ts
|
||||
// vite.config.ts
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
### Rollup
|
||||
|
||||
```ts
|
||||
// rollup.config.js
|
||||
import AutoImport from 'unplugin-auto-import/rollup';
|
||||
import Components from 'unplugin-vue-components/rollup';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
export default {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Webpack
|
||||
|
||||
```ts
|
||||
// webpack.config.js
|
||||
import AutoImport from 'unplugin-auto-import/webpack';
|
||||
import Components from 'unplugin-vue-components/webpack';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Rspack
|
||||
|
||||
```ts
|
||||
// rspack.config.js
|
||||
import AutoImport from 'unplugin-auto-import/rspack';
|
||||
import Components from 'unplugin-vue-components/rspack';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Vue CLI
|
||||
|
||||
```ts
|
||||
// vue.config.js
|
||||
import AutoImport from 'unplugin-auto-import/webpack';
|
||||
import Components from 'unplugin-vue-components/webpack';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
module.exports = {
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### esbuild
|
||||
|
||||
```ts
|
||||
// esbuild.config.js
|
||||
import { build } from 'esbuild';
|
||||
import AutoImport from 'unplugin-auto-import/esbuild';
|
||||
import Components from 'unplugin-vue-components/esbuild';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
build({
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### importStyle
|
||||
|
||||
Whether to automatically import the corresponding styles of the components.
|
||||
|
||||
- **Type:** `boolean`
|
||||
- **Default:** `true`
|
||||
- **Example:**
|
||||
|
||||
```ts
|
||||
Components({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
// Disable style import
|
||||
importStyle: false,
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
### module
|
||||
|
||||
Specifies the type of module to be imported.
|
||||
|
||||
- **Type:** `'esm' | 'cjs'`
|
||||
- **Default:** `'esm'`
|
||||
- **Example:**
|
||||
|
||||
```ts
|
||||
Components({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
module: 'cjs',
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
### ssr
|
||||
|
||||
- **Type:** `boolean`
|
||||
- **Default:** `undefined`
|
||||
|
||||
This option is deprecated. Please use the `module` option to set the module type.
|
||||
|
||||
### exclude
|
||||
|
||||
Set the components or APIs that do not require automatic import.
|
||||
|
||||
- **Type:** `string[]`
|
||||
- **Default:** `[]`
|
||||
- **Example:**
|
||||
|
||||
```ts
|
||||
Components({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
exclude: ['Button'],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
```ts
|
||||
AutoImport({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
exclude: ['showToast'],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
@@ -1,226 +0,0 @@
|
||||
# Vant Auto Import Resolver
|
||||
|
||||
[English](./README.md) | 简体中文
|
||||
|
||||
`@vant/auto-import-resolver` 是 [unplugin-vue-components](https://github.com/unplugin/unplugin-vue-components) 的一个解析器,用于实现 Vant 按需引入。
|
||||
|
||||
### 特性
|
||||
|
||||
- 支持 `Vite`, `Webpack`, `Rspack`, `Vue CLI`, `Rollup`, `esbuild` 等
|
||||
- 支持自动引入组件对应的 CSS 样式
|
||||
- 支持 SSR(服务端渲染)
|
||||
|
||||
### 安装
|
||||
|
||||
```shell
|
||||
# via npm
|
||||
npm i @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
|
||||
# via yarn
|
||||
yarn add @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
|
||||
# via pnpm
|
||||
pnpm add @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
|
||||
# via Bun
|
||||
bun add @vant/auto-import-resolver unplugin-vue-components unplugin-auto-import -D
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
### Vite
|
||||
|
||||
```ts
|
||||
// vite.config.ts
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
### Rollup
|
||||
|
||||
```ts
|
||||
// rollup.config.js
|
||||
import AutoImport from 'unplugin-auto-import/rollup';
|
||||
import Components from 'unplugin-vue-components/rollup';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
export default {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Webpack
|
||||
|
||||
```ts
|
||||
// webpack.config.js
|
||||
import AutoImport from 'unplugin-auto-import/webpack';
|
||||
import Components from 'unplugin-vue-components/webpack';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Rspack
|
||||
|
||||
```ts
|
||||
// rspack.config.js
|
||||
import AutoImport from 'unplugin-auto-import/rspack';
|
||||
import Components from 'unplugin-vue-components/rspack';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Vue CLI
|
||||
|
||||
```ts
|
||||
// vue.config.js
|
||||
import AutoImport from 'unplugin-auto-import/webpack';
|
||||
import Components from 'unplugin-vue-components/webpack';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
module.exports = {
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### esbuild
|
||||
|
||||
```ts
|
||||
// esbuild.config.js
|
||||
import { build } from 'esbuild';
|
||||
import AutoImport from 'unplugin-auto-import/esbuild';
|
||||
import Components from 'unplugin-vue-components/esbuild';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
build({
|
||||
plugins: [
|
||||
AutoImport({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## 选项
|
||||
|
||||
### importStyle
|
||||
|
||||
是否自动引用组件对应的样式。
|
||||
|
||||
- **Type:** `boolean`
|
||||
- **Default:** `true`
|
||||
- **Example:**
|
||||
|
||||
```ts
|
||||
Components({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
// 禁用样式引用
|
||||
importStyle: false,
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
### module
|
||||
|
||||
设置引用的模块类型。
|
||||
|
||||
- **Type:** `'esm' | 'cjs'`
|
||||
- **Default:** `'esm'`
|
||||
- **Example:**
|
||||
|
||||
```ts
|
||||
Components({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
module: 'cjs',
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
### ssr
|
||||
|
||||
- **Type:** `boolean`
|
||||
- **Default:** `undefined`
|
||||
|
||||
此选项已废弃,请使用 `module` 选项来设置模块类型。
|
||||
|
||||
### exclude
|
||||
|
||||
设置不自动引入的组件或 API。
|
||||
|
||||
- **Type:** `string[]`
|
||||
- **Default:** `[]`
|
||||
- **Example:**
|
||||
|
||||
```ts
|
||||
Components({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
exclude: ['Button'],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
```ts
|
||||
AutoImport({
|
||||
resolvers: [
|
||||
VantResolver({
|
||||
exclude: ['showToast'],
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"name": "@vant/auto-import-resolver",
|
||||
"version": "1.3.0",
|
||||
"type": "module",
|
||||
"description": "Vant auto import resolver based on unplugin-vue-components",
|
||||
"main": "dist/index.cjs",
|
||||
"module": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vant-ui/vant.git",
|
||||
"directory": "packages/vant-auto-import-resolver"
|
||||
},
|
||||
"homepage": "https://github.com/youzan/vant/blob/main/packages/vant-auto-import-resolver/README.md",
|
||||
"bugs": "https://github.com/vant-ui/vant/issues",
|
||||
"author": "chenjiahan",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@rslib/core": "^0.4.1",
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "rslib dev",
|
||||
"build": "rslib build",
|
||||
"release": "vant-cli release"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,278 +0,0 @@
|
||||
# @vitejs/plugin-vue [](https://npmjs.com/package/@vitejs/plugin-vue)
|
||||
|
||||
> Note: as of `vue` 3.2.13+ and `@vitejs/plugin-vue` 1.9.0+, `@vue/compiler-sfc` is no longer required as a peer dependency.
|
||||
|
||||
```js
|
||||
// vite.config.js
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default {
|
||||
plugins: [vue()],
|
||||
}
|
||||
```
|
||||
|
||||
For JSX / TSX support, [`@vitejs/plugin-vue-jsx`](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx) is also needed.
|
||||
|
||||
## Options
|
||||
|
||||
```ts
|
||||
export interface Options {
|
||||
include?: string | RegExp | (string | RegExp)[]
|
||||
exclude?: string | RegExp | (string | RegExp)[]
|
||||
|
||||
isProduction?: boolean
|
||||
|
||||
/**
|
||||
* Requires @vitejs/plugin-vue@^5.1.0
|
||||
*/
|
||||
features?: {
|
||||
/**
|
||||
* Enable reactive destructure for `defineProps`.
|
||||
* - Available in Vue 3.4 and later.
|
||||
* - **default:** `false` in Vue 3.4 (**experimental**), `true` in Vue 3.5+
|
||||
*/
|
||||
propsDestructure?: boolean
|
||||
/**
|
||||
* Transform Vue SFCs into custom elements.
|
||||
* - `true`: all `*.vue` imports are converted into custom elements
|
||||
* - `string | RegExp`: matched files are converted into custom elements
|
||||
* - **default:** /\.ce\.vue$/
|
||||
*/
|
||||
customElement?: boolean | string | RegExp | (string | RegExp)[]
|
||||
/**
|
||||
* Set to `false` to disable Options API support and allow related code in
|
||||
* Vue core to be dropped via dead-code elimination in production builds,
|
||||
* resulting in smaller bundles.
|
||||
* - **default:** `true`
|
||||
*/
|
||||
optionsAPI?: boolean
|
||||
/**
|
||||
* Set to `true` to enable devtools support in production builds.
|
||||
* Results in slightly larger bundles.
|
||||
* - **default:** `false`
|
||||
*/
|
||||
prodDevtools?: boolean
|
||||
/**
|
||||
* Set to `true` to enable detailed information for hydration mismatch
|
||||
* errors in production builds. Results in slightly larger bundles.
|
||||
* - **default:** `false`
|
||||
*/
|
||||
prodHydrationMismatchDetails?: boolean
|
||||
/**
|
||||
* Customize the component ID generation strategy.
|
||||
* - `'filepath'`: hash the file path (relative to the project root)
|
||||
* - `'filepath-source'`: hash the file path and the source code
|
||||
* - `function`: custom function that takes the file path, source code,
|
||||
* whether in production mode, and the default hash function as arguments
|
||||
* - **default:** `'filepath'` in development, `'filepath-source'` in production
|
||||
*/
|
||||
componentIdGenerator?:
|
||||
| 'filepath'
|
||||
| 'filepath-source'
|
||||
| ((
|
||||
filepath: string,
|
||||
source: string,
|
||||
isProduction: boolean | undefined,
|
||||
getHash: (text: string) => string,
|
||||
) => string)
|
||||
}
|
||||
|
||||
// `script`, `template` and `style` are lower-level compiler options
|
||||
// to pass on to respective APIs of `vue/compiler-sfc`
|
||||
|
||||
script?: Partial<
|
||||
Omit<
|
||||
SFCScriptCompileOptions,
|
||||
| 'id'
|
||||
| 'isProd'
|
||||
| 'inlineTemplate'
|
||||
| 'templateOptions'
|
||||
| 'sourceMap'
|
||||
| 'genDefaultAs'
|
||||
| 'customElement'
|
||||
>
|
||||
>
|
||||
|
||||
template?: Partial<
|
||||
Omit<
|
||||
SFCTemplateCompileOptions,
|
||||
| 'id'
|
||||
| 'source'
|
||||
| 'ast'
|
||||
| 'filename'
|
||||
| 'scoped'
|
||||
| 'slotted'
|
||||
| 'isProd'
|
||||
| 'inMap'
|
||||
| 'ssr'
|
||||
| 'ssrCssVars'
|
||||
| 'preprocessLang'
|
||||
>
|
||||
>
|
||||
|
||||
style?: Partial<
|
||||
Omit<
|
||||
SFCStyleCompileOptions,
|
||||
| 'filename'
|
||||
| 'id'
|
||||
| 'isProd'
|
||||
| 'source'
|
||||
| 'scoped'
|
||||
| 'cssDevSourcemap'
|
||||
| 'postcssOptions'
|
||||
| 'map'
|
||||
| 'postcssPlugins'
|
||||
| 'preprocessCustomRequire'
|
||||
| 'preprocessLang'
|
||||
| 'preprocessOptions'
|
||||
>
|
||||
>
|
||||
|
||||
/**
|
||||
* Use custom compiler-sfc instance. Can be used to force a specific version.
|
||||
*/
|
||||
compiler?: typeof _compiler
|
||||
|
||||
/**
|
||||
* @deprecated moved to `features.customElement`.
|
||||
*/
|
||||
customElements?: boolean | string | RegExp | (string | RegExp)[]
|
||||
}
|
||||
```
|
||||
|
||||
## Asset URL handling
|
||||
|
||||
When `@vitejs/plugin-vue` compiles the `<template>` blocks in SFCs, it also converts any encountered asset URLs into ESM imports.
|
||||
|
||||
For example, the following template snippet:
|
||||
|
||||
```vue
|
||||
<img src="../image.png" />
|
||||
```
|
||||
|
||||
Is the same as:
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
import _imports_0 from '../image.png'
|
||||
</script>
|
||||
|
||||
<img :src="_imports_0" />
|
||||
```
|
||||
|
||||
By default the following tag/attribute combinations are transformed, and can be configured using the `template.transformAssetUrls` option.
|
||||
|
||||
```js
|
||||
{
|
||||
video: ['src', 'poster'],
|
||||
source: ['src'],
|
||||
img: ['src'],
|
||||
image: ['xlink:href', 'href'],
|
||||
use: ['xlink:href', 'href']
|
||||
}
|
||||
```
|
||||
|
||||
Note that only attribute values that are static strings are transformed. Otherwise, you'd need to import the asset manually, e.g. `import imgUrl from '../image.png'`.
|
||||
|
||||
## Example for passing options to `vue/compiler-sfc`:
|
||||
|
||||
```ts
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default {
|
||||
plugins: [
|
||||
vue({
|
||||
template: {
|
||||
compilerOptions: {
|
||||
// ...
|
||||
},
|
||||
transformAssetUrls: {
|
||||
// ...
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
## Example for transforming custom blocks
|
||||
|
||||
```ts
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import yaml from 'js-yaml'
|
||||
|
||||
const vueI18nPlugin = {
|
||||
name: 'vue-i18n',
|
||||
transform(code, id) {
|
||||
// if .vue file don't have <i18n> block, just return
|
||||
if (!/vue&type=i18n/.test(id)) {
|
||||
return
|
||||
}
|
||||
// parse yaml
|
||||
if (/\.ya?ml$/.test(id)) {
|
||||
code = JSON.stringify(yaml.load(code.trim()))
|
||||
}
|
||||
// mount the value on the i18n property of the component instance
|
||||
return `export default Comp => {
|
||||
Comp.i18n = ${code}
|
||||
}`
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
plugins: [vue(), vueI18nPlugin],
|
||||
}
|
||||
```
|
||||
|
||||
Create a file named `Demo.vue`, add `lang="yaml"` to the `<i18n>` blocks, then you can use the syntax of `YAML`:
|
||||
|
||||
```vue
|
||||
<template>Hello</template>
|
||||
|
||||
<i18n lang="yaml">
|
||||
message: 'world'
|
||||
fullWord: 'hello world'
|
||||
</i18n>
|
||||
```
|
||||
|
||||
`message` is mounted on the i18n property of the component instance, you can use like this:
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import Demo from 'components/Demo.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Demo /> {{ Demo.i18n.message }}
|
||||
<div>{{ Demo.i18n.fullWord }}</div>
|
||||
</template>
|
||||
```
|
||||
|
||||
## Using Vue SFCs as Custom Elements
|
||||
|
||||
> Requires `vue@^3.2.0` & `@vitejs/plugin-vue@^1.4.0`
|
||||
|
||||
Vue 3.2 introduces the `defineCustomElement` method, which works with SFCs. By default, `<style>` tags inside SFCs are extracted and merged into CSS files during build. However when shipping a library of custom elements, it may be desirable to inline the styles as JavaScript strings and inject them into the custom elements' shadow root instead.
|
||||
|
||||
Starting in 1.4.0, files ending with `*.ce.vue` will be compiled in "custom elements" mode: its `<style>` tags are compiled into inlined CSS strings and attached to the component as its `styles` property:
|
||||
|
||||
```js
|
||||
import { defineCustomElement } from 'vue'
|
||||
import Example from './Example.ce.vue'
|
||||
|
||||
console.log(Example.styles) // ['/* css content */']
|
||||
|
||||
// register
|
||||
customElements.define('my-example', defineCustomElement(Example))
|
||||
```
|
||||
|
||||
Note in custom elements mode there is no need to use `<style scoped>` since the CSS is already scoped inside the shadow DOM.
|
||||
|
||||
The `customElement` plugin option can be used to configure the behavior:
|
||||
|
||||
- `{ customElement: true }` will import all `*.vue` files in custom element mode.
|
||||
- Use a string or regex pattern to change how files should be loaded as Custom Elements (this check is applied after `include` and `exclude` matches).
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"name": "@vitejs/plugin-vue",
|
||||
"version": "5.2.4",
|
||||
"type": "commonjs",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.0.0 || >=20.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vitejs/vite-plugin-vue.git",
|
||||
"directory": "packages/plugin-vue"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vitejs/vite-plugin-vue/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#readme",
|
||||
"peerDependencies": {
|
||||
"vite": "^5.0.0 || ^6.0.0",
|
||||
"vue": "^3.2.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jridgewell/gen-mapping": "^0.3.8",
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"debug": "^4.4.0",
|
||||
"rollup": "^4.40.2",
|
||||
"slash": "^5.1.0",
|
||||
"source-map-js": "^1.2.1",
|
||||
"vite": "^6.3.5",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "unbuild --stub",
|
||||
"build": "unbuild && pnpm run patch-cjs",
|
||||
"patch-cjs": "tsx ../../scripts/patchCJS.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
|
||||
|
||||
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.
|
||||
@@ -1 +0,0 @@
|
||||
../../README.md
|
||||
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"name": "@vueuse/core",
|
||||
"type": "module",
|
||||
"version": "14.3.0",
|
||||
"description": "Collection of essential Vue Composition Utilities",
|
||||
"author": "Anthony Fu <https://github.com/antfu>",
|
||||
"license": "MIT",
|
||||
"funding": "https://github.com/sponsors/antfu",
|
||||
"homepage": "https://github.com/vueuse/vueuse#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vueuse/vueuse.git",
|
||||
"directory": "packages/core"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vueuse/vueuse/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"vue",
|
||||
"vue-use",
|
||||
"utils"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./*": "./dist/*",
|
||||
"./metadata": "./dist/metadata.mjs",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"unpkg": "./dist/index.iife.min.js",
|
||||
"jsdelivr": "./dist/index.iife.min.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"vue": "^3.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/web-bluetooth": "^0.0.21",
|
||||
"@vueuse/metadata": "14.3.0",
|
||||
"@vueuse/shared": "14.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsdown"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
# Copyright (c) 2014-present Matt Zabriskie & Collaborators
|
||||
|
||||
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.
|
||||
@@ -1,877 +0,0 @@
|
||||
# Axios Migration Guide
|
||||
|
||||
> **Migrating from Axios 0.x to 1.x**
|
||||
>
|
||||
> This guide helps developers upgrade from Axios 0.x to 1.x by documenting breaking changes, providing migration strategies, and offering solutions to common upgrade challenges.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Breaking Changes](#breaking-changes)
|
||||
- [Error Handling Migration](#error-handling-migration)
|
||||
- [API Changes](#api-changes)
|
||||
- [Configuration Changes](#configuration-changes)
|
||||
- [Migration Strategies](#migration-strategies)
|
||||
- [Common Patterns](#common-patterns)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Resources](#resources)
|
||||
|
||||
## Overview
|
||||
|
||||
Axios 1.x introduced several breaking changes to improve consistency, security, and developer experience. While these changes provide better error handling and more predictable behavior, they require code updates when migrating from 0.x versions.
|
||||
|
||||
### Key Changes Summary
|
||||
|
||||
| Area | 0.x Behavior | 1.x Behavior | Impact |
|
||||
|------|--------------|--------------|--------|
|
||||
| Error Handling | Selective throwing | Consistent throwing | High |
|
||||
| JSON Parsing | Lenient | Strict | Medium |
|
||||
| Browser Support | IE11+ | Modern browsers | Low-Medium |
|
||||
| TypeScript | Partial | Full support | Low |
|
||||
|
||||
### Migration Complexity
|
||||
|
||||
- **Simple applications**: 1-2 hours
|
||||
- **Medium applications**: 1-2 days
|
||||
- **Large applications with complex error handling**: 3-5 days
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
### 1. Error Handling Changes
|
||||
|
||||
**The most significant change in Axios 1.x is how errors are handled.**
|
||||
|
||||
#### 0.x Behavior
|
||||
```javascript
|
||||
// Axios 0.x - Some HTTP error codes didn't throw
|
||||
axios.get('/api/data')
|
||||
.then(response => {
|
||||
// Response interceptor could handle all errors
|
||||
console.log('Success:', response.data);
|
||||
});
|
||||
|
||||
// Response interceptor handled everything
|
||||
axios.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
handleError(error);
|
||||
// Error was "handled" and didn't propagate
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
#### 1.x Behavior
|
||||
```javascript
|
||||
// Axios 1.x - All HTTP errors throw consistently
|
||||
axios.get('/api/data')
|
||||
.then(response => {
|
||||
console.log('Success:', response.data);
|
||||
})
|
||||
.catch(error => {
|
||||
// Must handle errors at call site or they propagate
|
||||
console.error('Request failed:', error);
|
||||
});
|
||||
|
||||
// Response interceptor must re-throw or return rejected promise
|
||||
axios.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
handleError(error);
|
||||
// Must explicitly handle propagation
|
||||
return Promise.reject(error); // or throw error;
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
#### Impact
|
||||
- **Response interceptors** can no longer "swallow" errors silently
|
||||
- **Every API call** must handle errors explicitly or they become unhandled promise rejections
|
||||
- **Centralized error handling** requires new patterns
|
||||
|
||||
### 2. JSON Parsing Changes
|
||||
|
||||
#### 0.x Behavior
|
||||
```javascript
|
||||
// Axios 0.x - Lenient JSON parsing
|
||||
// Would attempt to parse even invalid JSON
|
||||
response.data; // Might contain partial data or fallbacks
|
||||
```
|
||||
|
||||
#### 1.x Behavior
|
||||
```javascript
|
||||
// Axios 1.x - Strict JSON parsing
|
||||
// Throws clear errors for invalid JSON
|
||||
try {
|
||||
const data = response.data;
|
||||
} catch (error) {
|
||||
// Handle JSON parsing errors explicitly
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Request/Response Transform Changes
|
||||
|
||||
#### 0.x Behavior
|
||||
```javascript
|
||||
// Implicit transformations with some edge cases
|
||||
transformRequest: [function (data) {
|
||||
// Less predictable behavior
|
||||
return data;
|
||||
}]
|
||||
```
|
||||
|
||||
#### 1.x Behavior
|
||||
```javascript
|
||||
// More consistent transformation pipeline
|
||||
transformRequest: [function (data, headers) {
|
||||
// Headers parameter always available
|
||||
// More predictable behavior
|
||||
return data;
|
||||
}]
|
||||
```
|
||||
|
||||
### 4. Browser Support Changes
|
||||
|
||||
- **0.x**: Supported IE11 and older browsers
|
||||
- **1.x**: Requires modern browsers with Promise support
|
||||
- **Polyfills**: May be needed for older browser support
|
||||
|
||||
## Error Handling Migration
|
||||
|
||||
The error handling changes are the most complex part of migrating to Axios 1.x. Here are proven strategies:
|
||||
|
||||
### Strategy 1: Centralized Error Handling with Error Boundary
|
||||
|
||||
```javascript
|
||||
// Create a centralized error handler
|
||||
class ApiErrorHandler {
|
||||
constructor() {
|
||||
this.setupInterceptors();
|
||||
}
|
||||
|
||||
setupInterceptors() {
|
||||
axios.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
// Centralized error processing
|
||||
this.processError(error);
|
||||
|
||||
// Return a resolved promise with error info for handled errors
|
||||
if (this.isHandledError(error)) {
|
||||
return Promise.resolve({
|
||||
data: null,
|
||||
error: this.normalizeError(error),
|
||||
handled: true
|
||||
});
|
||||
}
|
||||
|
||||
// Re-throw unhandled errors
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
processError(error) {
|
||||
// Log errors
|
||||
console.error('API Error:', error);
|
||||
|
||||
// Show user notifications
|
||||
if (error.response?.status === 401) {
|
||||
this.handleAuthError();
|
||||
} else if (error.response?.status >= 500) {
|
||||
this.showErrorNotification('Server error occurred');
|
||||
}
|
||||
}
|
||||
|
||||
isHandledError(error) {
|
||||
// Define which errors are "handled" centrally
|
||||
const handledStatuses = [401, 403, 404, 422, 500, 502, 503];
|
||||
return handledStatuses.includes(error.response?.status);
|
||||
}
|
||||
|
||||
normalizeError(error) {
|
||||
return {
|
||||
status: error.response?.status,
|
||||
message: error.response?.data?.message || error.message,
|
||||
code: error.response?.data?.code || error.code
|
||||
};
|
||||
}
|
||||
|
||||
handleAuthError() {
|
||||
// Redirect to login, clear tokens, etc.
|
||||
localStorage.removeItem('token');
|
||||
window.location.href = '/login';
|
||||
}
|
||||
|
||||
showErrorNotification(message) {
|
||||
// Show user-friendly error message
|
||||
console.error(message); // Replace with your notification system
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize globally
|
||||
const errorHandler = new ApiErrorHandler();
|
||||
|
||||
// Usage in components/services
|
||||
async function fetchUserData(userId) {
|
||||
try {
|
||||
const response = await axios.get(`/api/users/${userId}`);
|
||||
|
||||
// Check if error was handled centrally
|
||||
if (response.handled) {
|
||||
return { data: null, error: response.error };
|
||||
}
|
||||
|
||||
return { data: response.data, error: null };
|
||||
} catch (error) {
|
||||
// Unhandled errors still need local handling
|
||||
return { data: null, error: { message: 'Unexpected error occurred' } };
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Strategy 2: Wrapper Function Pattern
|
||||
|
||||
```javascript
|
||||
// Create a wrapper that provides 0.x-like behavior
|
||||
function createApiWrapper() {
|
||||
const api = axios.create();
|
||||
|
||||
// Add response interceptor for centralized handling
|
||||
api.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
// Handle common errors centrally
|
||||
if (error.response?.status === 401) {
|
||||
// Handle auth errors
|
||||
handleAuthError();
|
||||
}
|
||||
|
||||
if (error.response?.status >= 500) {
|
||||
// Handle server errors
|
||||
showServerErrorNotification();
|
||||
}
|
||||
|
||||
// Always reject to maintain error propagation
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
// Wrapper function that mimics 0.x behavior
|
||||
function safeRequest(requestConfig, options = {}) {
|
||||
return api(requestConfig)
|
||||
.then(response => response)
|
||||
.catch(error => {
|
||||
if (options.suppressErrors) {
|
||||
// Return error info instead of throwing
|
||||
return {
|
||||
data: null,
|
||||
error: {
|
||||
status: error.response?.status,
|
||||
message: error.response?.data?.message || error.message
|
||||
}
|
||||
};
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
return { safeRequest, axios: api };
|
||||
}
|
||||
|
||||
// Usage
|
||||
const { safeRequest } = createApiWrapper();
|
||||
|
||||
// For calls where you want centralized error handling
|
||||
const result = await safeRequest(
|
||||
{ method: 'get', url: '/api/data' },
|
||||
{ suppressErrors: true }
|
||||
);
|
||||
|
||||
if (result.error) {
|
||||
// Handle error case
|
||||
console.log('Request failed:', result.error.message);
|
||||
} else {
|
||||
// Handle success case
|
||||
console.log('Data:', result.data);
|
||||
}
|
||||
```
|
||||
|
||||
### Strategy 3: Global Error Handler with Custom Events
|
||||
|
||||
```javascript
|
||||
// Set up global error handling with events
|
||||
class GlobalErrorHandler extends EventTarget {
|
||||
constructor() {
|
||||
super();
|
||||
this.setupInterceptors();
|
||||
}
|
||||
|
||||
setupInterceptors() {
|
||||
axios.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
// Emit custom event for global handling
|
||||
this.dispatchEvent(new CustomEvent('apiError', {
|
||||
detail: { error, timestamp: new Date() }
|
||||
}));
|
||||
|
||||
// Always reject to maintain proper error flow
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const globalErrorHandler = new GlobalErrorHandler();
|
||||
|
||||
// Set up global listeners
|
||||
globalErrorHandler.addEventListener('apiError', (event) => {
|
||||
const { error } = event.detail;
|
||||
|
||||
// Centralized error logic
|
||||
if (error.response?.status === 401) {
|
||||
handleAuthError();
|
||||
}
|
||||
|
||||
if (error.response?.status >= 500) {
|
||||
showErrorNotification('Server error occurred');
|
||||
}
|
||||
});
|
||||
|
||||
// Usage remains clean
|
||||
async function apiCall() {
|
||||
try {
|
||||
const response = await axios.get('/api/data');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
// Error was already handled globally
|
||||
// Just handle component-specific logic
|
||||
return null;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## API Changes
|
||||
|
||||
### Request Configuration
|
||||
|
||||
#### 0.x to 1.x Changes
|
||||
```javascript
|
||||
// 0.x - Some properties had different defaults
|
||||
const config = {
|
||||
timeout: 0, // No timeout by default
|
||||
maxContentLength: -1, // No limit
|
||||
};
|
||||
|
||||
// 1.x - More secure defaults
|
||||
const config = {
|
||||
timeout: 0, // Still no timeout, but easier to configure
|
||||
maxContentLength: 2000, // Default limit for security
|
||||
maxBodyLength: 2000, // New property
|
||||
};
|
||||
```
|
||||
|
||||
### Response Object
|
||||
|
||||
The response object structure remains largely the same, but error responses are more consistent:
|
||||
|
||||
```javascript
|
||||
// Both 0.x and 1.x
|
||||
response = {
|
||||
data: {}, // Response body
|
||||
status: 200, // HTTP status
|
||||
statusText: 'OK', // HTTP status message
|
||||
headers: {}, // Response headers
|
||||
config: {}, // Request config
|
||||
request: {} // Request object
|
||||
};
|
||||
|
||||
// Error responses are more consistent in 1.x
|
||||
error.response = {
|
||||
data: {}, // Error response body
|
||||
status: 404, // HTTP error status
|
||||
statusText: 'Not Found',
|
||||
headers: {},
|
||||
config: {},
|
||||
request: {}
|
||||
};
|
||||
```
|
||||
|
||||
## Configuration Changes
|
||||
|
||||
### Default Configuration Updates
|
||||
|
||||
```javascript
|
||||
// 0.x defaults
|
||||
axios.defaults.timeout = 0; // No timeout
|
||||
axios.defaults.maxContentLength = -1; // No limit
|
||||
|
||||
// 1.x defaults (more secure)
|
||||
axios.defaults.timeout = 0; // Still no timeout
|
||||
axios.defaults.maxContentLength = 2000; // 2MB limit
|
||||
axios.defaults.maxBodyLength = 2000; // 2MB limit
|
||||
```
|
||||
|
||||
### Instance Configuration
|
||||
|
||||
```javascript
|
||||
// 0.x - Instance creation
|
||||
const api = axios.create({
|
||||
baseURL: 'https://api.example.com',
|
||||
timeout: 1000,
|
||||
});
|
||||
|
||||
// 1.x - Same API, but more options available
|
||||
const api = axios.create({
|
||||
baseURL: 'https://api.example.com',
|
||||
timeout: 1000,
|
||||
maxBodyLength: Infinity, // Override default if needed
|
||||
maxContentLength: Infinity,
|
||||
});
|
||||
```
|
||||
|
||||
## Migration Strategies
|
||||
|
||||
### Step-by-Step Migration Process
|
||||
|
||||
#### Phase 1: Preparation
|
||||
1. **Audit Current Error Handling**
|
||||
```bash
|
||||
# Find all axios usage
|
||||
grep -r "axios\." src/
|
||||
grep -r "\.catch" src/
|
||||
grep -r "interceptors" src/
|
||||
```
|
||||
|
||||
2. **Identify Patterns**
|
||||
- Response interceptors that handle errors
|
||||
- Components that rely on centralized error handling
|
||||
- Authentication and retry logic
|
||||
|
||||
3. **Create Test Cases**
|
||||
```javascript
|
||||
// Test current error handling behavior
|
||||
describe('Error Handling Migration', () => {
|
||||
it('should handle 401 errors consistently', async () => {
|
||||
// Test authentication error flows
|
||||
});
|
||||
|
||||
it('should handle 500 errors with user feedback', async () => {
|
||||
// Test server error handling
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
#### Phase 2: Implementation
|
||||
1. **Update Dependencies**
|
||||
```bash
|
||||
npm update axios
|
||||
```
|
||||
|
||||
2. **Implement New Error Handling**
|
||||
- Choose one of the strategies above
|
||||
- Update response interceptors
|
||||
- Add error handling to API calls
|
||||
|
||||
3. **Update Authentication Logic**
|
||||
```javascript
|
||||
// 0.x pattern
|
||||
axios.interceptors.response.use(null, error => {
|
||||
if (error.response?.status === 401) {
|
||||
logout();
|
||||
// Error was "handled"
|
||||
}
|
||||
});
|
||||
|
||||
// 1.x pattern
|
||||
axios.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
if (error.response?.status === 401) {
|
||||
logout();
|
||||
}
|
||||
return Promise.reject(error); // Always propagate
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
#### Phase 3: Testing and Validation
|
||||
1. **Test Error Scenarios**
|
||||
- Network failures
|
||||
- HTTP error codes (401, 403, 404, 500, etc.)
|
||||
- Timeout errors
|
||||
- JSON parsing errors
|
||||
|
||||
2. **Validate User Experience**
|
||||
- Error messages are shown appropriately
|
||||
- Authentication redirects work
|
||||
- Loading states are handled correctly
|
||||
|
||||
### Gradual Migration Approach
|
||||
|
||||
For large applications, consider gradual migration:
|
||||
|
||||
```javascript
|
||||
// Create a compatibility layer
|
||||
const axiosCompat = {
|
||||
// Use new axios instance for new code
|
||||
v1: axios.create({
|
||||
// 1.x configuration
|
||||
}),
|
||||
|
||||
// Wrapper for legacy code
|
||||
legacy: createLegacyWrapper(axios.create({
|
||||
// Configuration that mimics 0.x behavior
|
||||
}))
|
||||
};
|
||||
|
||||
function createLegacyWrapper(axiosInstance) {
|
||||
// Add interceptors that provide 0.x-like behavior
|
||||
axiosInstance.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
// Handle errors in 0.x style for legacy code
|
||||
handleLegacyError(error);
|
||||
// Don't propagate certain errors
|
||||
if (shouldSuppressError(error)) {
|
||||
return Promise.resolve({ data: null, error: true });
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
return axiosInstance;
|
||||
}
|
||||
```
|
||||
|
||||
## Common Patterns
|
||||
|
||||
### Authentication Interceptors
|
||||
|
||||
#### Updated Authentication Pattern
|
||||
```javascript
|
||||
// Token refresh interceptor for 1.x
|
||||
let isRefreshing = false;
|
||||
let refreshSubscribers = [];
|
||||
|
||||
function subscribeTokenRefresh(cb) {
|
||||
refreshSubscribers.push(cb);
|
||||
}
|
||||
|
||||
function onTokenRefreshed(token) {
|
||||
refreshSubscribers.forEach(cb => cb(token));
|
||||
refreshSubscribers = [];
|
||||
}
|
||||
|
||||
axios.interceptors.response.use(
|
||||
response => response,
|
||||
async error => {
|
||||
const originalRequest = error.config;
|
||||
|
||||
if (error.response?.status === 401 && !originalRequest._retry) {
|
||||
if (isRefreshing) {
|
||||
// Wait for token refresh
|
||||
return new Promise(resolve => {
|
||||
subscribeTokenRefresh(token => {
|
||||
originalRequest.headers.Authorization = `Bearer ${token}`;
|
||||
resolve(axios(originalRequest));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
originalRequest._retry = true;
|
||||
isRefreshing = true;
|
||||
|
||||
try {
|
||||
const newToken = await refreshToken();
|
||||
onTokenRefreshed(newToken);
|
||||
isRefreshing = false;
|
||||
|
||||
originalRequest.headers.Authorization = `Bearer ${newToken}`;
|
||||
return axios(originalRequest);
|
||||
} catch (refreshError) {
|
||||
isRefreshing = false;
|
||||
logout();
|
||||
return Promise.reject(refreshError);
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
### Retry Logic
|
||||
|
||||
```javascript
|
||||
// Retry interceptor for 1.x
|
||||
function createRetryInterceptor(maxRetries = 3, retryDelay = 1000) {
|
||||
return axios.interceptors.response.use(
|
||||
response => response,
|
||||
async error => {
|
||||
const config = error.config;
|
||||
|
||||
if (!config || !config.retry) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
config.__retryCount = config.__retryCount || 0;
|
||||
|
||||
if (config.__retryCount >= maxRetries) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
config.__retryCount += 1;
|
||||
|
||||
// Exponential backoff
|
||||
const delay = retryDelay * Math.pow(2, config.__retryCount - 1);
|
||||
await new Promise(resolve => setTimeout(resolve, delay));
|
||||
|
||||
return axios(config);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Usage
|
||||
const api = axios.create();
|
||||
createRetryInterceptor(3, 1000);
|
||||
|
||||
// Make request with retry
|
||||
api.get('/api/data', { retry: true });
|
||||
```
|
||||
|
||||
### Loading State Management
|
||||
|
||||
```javascript
|
||||
// Loading interceptor for 1.x
|
||||
class LoadingManager {
|
||||
constructor() {
|
||||
this.requests = new Set();
|
||||
this.setupInterceptors();
|
||||
}
|
||||
|
||||
setupInterceptors() {
|
||||
axios.interceptors.request.use(config => {
|
||||
this.requests.add(config);
|
||||
this.updateLoadingState();
|
||||
return config;
|
||||
});
|
||||
|
||||
axios.interceptors.response.use(
|
||||
response => {
|
||||
this.requests.delete(response.config);
|
||||
this.updateLoadingState();
|
||||
return response;
|
||||
},
|
||||
error => {
|
||||
this.requests.delete(error.config);
|
||||
this.updateLoadingState();
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
updateLoadingState() {
|
||||
const isLoading = this.requests.size > 0;
|
||||
// Update your loading UI
|
||||
document.body.classList.toggle('loading', isLoading);
|
||||
}
|
||||
}
|
||||
|
||||
const loadingManager = new LoadingManager();
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Migration Issues
|
||||
|
||||
#### Issue 1: Unhandled Promise Rejections
|
||||
|
||||
**Problem:**
|
||||
```javascript
|
||||
// This pattern worked in 0.x but causes unhandled rejections in 1.x
|
||||
axios.get('/api/data'); // No .catch() handler
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
```javascript
|
||||
// Always handle promises
|
||||
axios.get('/api/data')
|
||||
.catch(error => {
|
||||
// Handle error appropriately
|
||||
console.error('Request failed:', error.message);
|
||||
});
|
||||
|
||||
// Or use async/await with try/catch
|
||||
async function fetchData() {
|
||||
try {
|
||||
const response = await axios.get('/api/data');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Request failed:', error.message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Issue 2: Response Interceptors Not "Handling" Errors
|
||||
|
||||
**Problem:**
|
||||
```javascript
|
||||
// 0.x style - interceptor "handled" errors
|
||||
axios.interceptors.response.use(null, error => {
|
||||
showErrorMessage(error.message);
|
||||
// Error was considered "handled"
|
||||
});
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
```javascript
|
||||
// 1.x style - explicitly control error propagation
|
||||
axios.interceptors.response.use(
|
||||
response => response,
|
||||
error => {
|
||||
showErrorMessage(error.message);
|
||||
|
||||
// Choose whether to propagate the error
|
||||
if (shouldPropagateError(error)) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
// Return success-like response for "handled" errors
|
||||
return Promise.resolve({
|
||||
data: null,
|
||||
handled: true,
|
||||
error: normalizeError(error)
|
||||
});
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
#### Issue 3: JSON Parsing Errors
|
||||
|
||||
**Problem:**
|
||||
```javascript
|
||||
// 1.x is stricter about JSON parsing
|
||||
// This might throw where 0.x was lenient
|
||||
const data = response.data;
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
```javascript
|
||||
// Add response transformer for better error handling
|
||||
axios.defaults.transformResponse = [
|
||||
function (data) {
|
||||
if (typeof data === 'string') {
|
||||
try {
|
||||
return JSON.parse(data);
|
||||
} catch (e) {
|
||||
// Handle JSON parsing errors gracefully
|
||||
console.warn('Invalid JSON response:', data);
|
||||
return { error: 'Invalid JSON', rawData: data };
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
];
|
||||
```
|
||||
|
||||
#### Issue 4: TypeScript Errors After Upgrade
|
||||
|
||||
**Problem:**
|
||||
```typescript
|
||||
// TypeScript errors after upgrade
|
||||
const response = await axios.get('/api/data');
|
||||
// Property 'someProperty' does not exist on type 'any'
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
```typescript
|
||||
// Define proper interfaces
|
||||
interface ApiResponse {
|
||||
data: any;
|
||||
message: string;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
const response = await axios.get<ApiResponse>('/api/data');
|
||||
// Now properly typed
|
||||
console.log(response.data.data);
|
||||
```
|
||||
|
||||
### Debug Migration Issues
|
||||
|
||||
#### Enable Debug Logging
|
||||
```javascript
|
||||
// Add request/response logging
|
||||
axios.interceptors.request.use(config => {
|
||||
console.log('Request:', config);
|
||||
return config;
|
||||
});
|
||||
|
||||
axios.interceptors.response.use(
|
||||
response => {
|
||||
console.log('Response:', response);
|
||||
return response;
|
||||
},
|
||||
error => {
|
||||
console.log('Error:', error);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
#### Compare Behavior
|
||||
```javascript
|
||||
// Create side-by-side comparison during migration
|
||||
const axios0x = require('axios-0x'); // Keep old version for testing
|
||||
const axios1x = require('axios');
|
||||
|
||||
async function compareRequests(config) {
|
||||
try {
|
||||
const [result0x, result1x] = await Promise.allSettled([
|
||||
axios0x(config),
|
||||
axios1x(config)
|
||||
]);
|
||||
|
||||
console.log('0.x result:', result0x);
|
||||
console.log('1.x result:', result1x);
|
||||
} catch (error) {
|
||||
console.log('Comparison error:', error);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
### Official Documentation
|
||||
- [Axios 1.x Documentation](https://axios-http.com/)
|
||||
- [Axios GitHub Repository](https://github.com/axios/axios)
|
||||
- [Axios Changelog](https://github.com/axios/axios/blob/main/CHANGELOG.md)
|
||||
|
||||
### Migration Tools
|
||||
- [Axios Migration Codemod](https://github.com/axios/axios-migration-codemod) *(if available)*
|
||||
- [ESLint Rules for Axios 1.x](https://github.com/axios/eslint-plugin-axios) *(if available)*
|
||||
|
||||
### Community Resources
|
||||
- [Stack Overflow - Axios Migration Questions](https://stackoverflow.com/questions/tagged/axios+migration)
|
||||
- [GitHub Discussions](https://github.com/axios/axios/discussions)
|
||||
- [Axios Discord Community](https://discord.gg/axios) *(if available)*
|
||||
|
||||
### Related Issues
|
||||
- [Error Handling Changes Discussion](https://github.com/axios/axios/issues/7208)
|
||||
- [Migration Guide Request](https://github.com/axios/axios/issues/xxxx) *(link to related issues)*
|
||||
|
||||
---
|
||||
|
||||
## Need Help?
|
||||
|
||||
If you encounter issues during migration that aren't covered in this guide:
|
||||
|
||||
1. **Search existing issues** in the [Axios GitHub repository](https://github.com/axios/axios/issues)
|
||||
2. **Ask questions** in [GitHub Discussions](https://github.com/axios/axios/discussions)
|
||||
3. **Contribute improvements** to this migration guide
|
||||
|
||||
---
|
||||
|
||||
*This migration guide is maintained by the community. If you find errors or have suggestions, please [open an issue](https://github.com/axios/axios/issues) or submit a pull request.*
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,715 +0,0 @@
|
||||
type MethodsHeaders = Partial<
|
||||
{
|
||||
[Key in axios.Method as Lowercase<Key>]: AxiosHeaders;
|
||||
} & { common: AxiosHeaders }
|
||||
>;
|
||||
|
||||
type AxiosHeaderMatcher =
|
||||
| string
|
||||
| RegExp
|
||||
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
||||
|
||||
type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any;
|
||||
|
||||
type CommonRequestHeadersList =
|
||||
| 'Accept'
|
||||
| 'Content-Length'
|
||||
| 'User-Agent'
|
||||
| 'Content-Encoding'
|
||||
| 'Authorization'
|
||||
| 'Location';
|
||||
|
||||
type ContentType =
|
||||
| axios.AxiosHeaderValue
|
||||
| 'text/html'
|
||||
| 'text/plain'
|
||||
| 'multipart/form-data'
|
||||
| 'application/json'
|
||||
| 'application/x-www-form-urlencoded'
|
||||
| 'application/octet-stream';
|
||||
|
||||
type CommonResponseHeadersList =
|
||||
| 'Server'
|
||||
| 'Content-Type'
|
||||
| 'Content-Length'
|
||||
| 'Cache-Control'
|
||||
| 'Content-Encoding';
|
||||
|
||||
type CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase<CommonResponseHeadersList>;
|
||||
|
||||
type BrowserProgressEvent = any;
|
||||
|
||||
declare class AxiosHeaders {
|
||||
constructor(headers?: axios.RawAxiosHeaders | AxiosHeaders | string);
|
||||
|
||||
[key: string]: any;
|
||||
|
||||
set(
|
||||
headerName?: string,
|
||||
value?: axios.AxiosHeaderValue,
|
||||
rewrite?: boolean | AxiosHeaderMatcher
|
||||
): AxiosHeaders;
|
||||
set(headers?: axios.RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
||||
|
||||
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
||||
get(headerName: string, matcher?: true | AxiosHeaderParser): axios.AxiosHeaderValue;
|
||||
|
||||
has(header: string, matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
clear(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
normalize(format: boolean): AxiosHeaders;
|
||||
|
||||
concat(
|
||||
...targets: Array<AxiosHeaders | axios.RawAxiosHeaders | string | undefined | null>
|
||||
): AxiosHeaders;
|
||||
|
||||
toJSON(asStrings?: boolean): axios.RawAxiosHeaders;
|
||||
|
||||
static from(thing?: AxiosHeaders | axios.RawAxiosHeaders | string): AxiosHeaders;
|
||||
|
||||
static accessor(header: string | string[]): AxiosHeaders;
|
||||
|
||||
static concat(
|
||||
...targets: Array<AxiosHeaders | axios.RawAxiosHeaders | string | undefined | null>
|
||||
): AxiosHeaders;
|
||||
|
||||
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getContentType(parser?: RegExp): RegExpExecArray | null;
|
||||
getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setContentLength(
|
||||
value: axios.AxiosHeaderValue,
|
||||
rewrite?: boolean | AxiosHeaderMatcher
|
||||
): AxiosHeaders;
|
||||
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
||||
getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getAccept(parser?: RegExp): RegExpExecArray | null;
|
||||
getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
||||
getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setContentEncoding(
|
||||
value: axios.AxiosHeaderValue,
|
||||
rewrite?: boolean | AxiosHeaderMatcher
|
||||
): AxiosHeaders;
|
||||
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
||||
getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setAuthorization(
|
||||
value: axios.AxiosHeaderValue,
|
||||
rewrite?: boolean | AxiosHeaderMatcher
|
||||
): AxiosHeaders;
|
||||
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
||||
getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
getSetCookie(): string[];
|
||||
|
||||
[Symbol.iterator](): IterableIterator<[string, axios.AxiosHeaderValue]>;
|
||||
}
|
||||
|
||||
declare class AxiosError<T = unknown, D = any> extends Error {
|
||||
constructor(
|
||||
message?: string,
|
||||
code?: string,
|
||||
config?: axios.InternalAxiosRequestConfig<D>,
|
||||
request?: any,
|
||||
response?: axios.AxiosResponse<T, D>
|
||||
);
|
||||
|
||||
config?: axios.InternalAxiosRequestConfig<D>;
|
||||
code?: string;
|
||||
request?: any;
|
||||
response?: axios.AxiosResponse<T, D>;
|
||||
isAxiosError: boolean;
|
||||
status?: number;
|
||||
toJSON: () => object;
|
||||
cause?: Error;
|
||||
event?: BrowserProgressEvent;
|
||||
static from<T = unknown, D = any>(
|
||||
error: Error | unknown,
|
||||
code?: string,
|
||||
config?: axios.InternalAxiosRequestConfig<D>,
|
||||
request?: any,
|
||||
response?: axios.AxiosResponse<T, D>,
|
||||
customProps?: object
|
||||
): AxiosError<T, D>;
|
||||
static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
||||
static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
||||
static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
||||
static readonly ERR_NETWORK = 'ERR_NETWORK';
|
||||
static readonly ERR_DEPRECATED = 'ERR_DEPRECATED';
|
||||
static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
||||
static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
||||
static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
||||
static readonly ERR_INVALID_URL = 'ERR_INVALID_URL';
|
||||
static readonly ERR_CANCELED = 'ERR_CANCELED';
|
||||
static readonly ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
||||
static readonly ECONNABORTED = 'ECONNABORTED';
|
||||
static readonly ECONNREFUSED = 'ECONNREFUSED';
|
||||
static readonly ETIMEDOUT = 'ETIMEDOUT';
|
||||
}
|
||||
|
||||
declare class CanceledError<T> extends AxiosError<T> {}
|
||||
|
||||
declare class Axios {
|
||||
constructor(config?: axios.AxiosRequestConfig);
|
||||
defaults: axios.AxiosDefaults;
|
||||
interceptors: {
|
||||
request: axios.AxiosInterceptorManager<axios.InternalAxiosRequestConfig>;
|
||||
response: axios.AxiosInterceptorManager<axios.AxiosResponse>;
|
||||
};
|
||||
getUri(config?: axios.AxiosRequestConfig): string;
|
||||
request<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
config: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
get<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
delete<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
head<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
options<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
post<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
put<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
patch<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
postForm<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
putForm<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
patchForm<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
query<T = any, R = axios.AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: axios.AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
}
|
||||
|
||||
declare enum HttpStatusCode {
|
||||
Continue = 100,
|
||||
SwitchingProtocols = 101,
|
||||
Processing = 102,
|
||||
EarlyHints = 103,
|
||||
Ok = 200,
|
||||
Created = 201,
|
||||
Accepted = 202,
|
||||
NonAuthoritativeInformation = 203,
|
||||
NoContent = 204,
|
||||
ResetContent = 205,
|
||||
PartialContent = 206,
|
||||
MultiStatus = 207,
|
||||
AlreadyReported = 208,
|
||||
ImUsed = 226,
|
||||
MultipleChoices = 300,
|
||||
MovedPermanently = 301,
|
||||
Found = 302,
|
||||
SeeOther = 303,
|
||||
NotModified = 304,
|
||||
UseProxy = 305,
|
||||
Unused = 306,
|
||||
TemporaryRedirect = 307,
|
||||
PermanentRedirect = 308,
|
||||
BadRequest = 400,
|
||||
Unauthorized = 401,
|
||||
PaymentRequired = 402,
|
||||
Forbidden = 403,
|
||||
NotFound = 404,
|
||||
MethodNotAllowed = 405,
|
||||
NotAcceptable = 406,
|
||||
ProxyAuthenticationRequired = 407,
|
||||
RequestTimeout = 408,
|
||||
Conflict = 409,
|
||||
Gone = 410,
|
||||
LengthRequired = 411,
|
||||
PreconditionFailed = 412,
|
||||
PayloadTooLarge = 413,
|
||||
UriTooLong = 414,
|
||||
UnsupportedMediaType = 415,
|
||||
RangeNotSatisfiable = 416,
|
||||
ExpectationFailed = 417,
|
||||
ImATeapot = 418,
|
||||
MisdirectedRequest = 421,
|
||||
UnprocessableEntity = 422,
|
||||
Locked = 423,
|
||||
FailedDependency = 424,
|
||||
TooEarly = 425,
|
||||
UpgradeRequired = 426,
|
||||
PreconditionRequired = 428,
|
||||
TooManyRequests = 429,
|
||||
RequestHeaderFieldsTooLarge = 431,
|
||||
UnavailableForLegalReasons = 451,
|
||||
InternalServerError = 500,
|
||||
NotImplemented = 501,
|
||||
BadGateway = 502,
|
||||
ServiceUnavailable = 503,
|
||||
GatewayTimeout = 504,
|
||||
HttpVersionNotSupported = 505,
|
||||
VariantAlsoNegotiates = 506,
|
||||
InsufficientStorage = 507,
|
||||
LoopDetected = 508,
|
||||
NotExtended = 510,
|
||||
NetworkAuthenticationRequired = 511,
|
||||
}
|
||||
|
||||
type InternalAxiosError<T = unknown, D = any> = AxiosError<T, D>;
|
||||
|
||||
declare namespace axios {
|
||||
type AxiosError<T = unknown, D = any> = InternalAxiosError<T, D>;
|
||||
|
||||
interface RawAxiosHeaders {
|
||||
[key: string]: AxiosHeaderValue;
|
||||
}
|
||||
|
||||
type RawAxiosRequestHeaders = Partial<
|
||||
RawAxiosHeaders & {
|
||||
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
||||
} & {
|
||||
'Content-Type': ContentType;
|
||||
}
|
||||
>;
|
||||
|
||||
type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
||||
|
||||
type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
||||
|
||||
type RawCommonResponseHeaders = {
|
||||
[Key in CommonResponseHeaderKey]: AxiosHeaderValue;
|
||||
} & {
|
||||
'set-cookie': string[];
|
||||
};
|
||||
|
||||
type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
||||
|
||||
type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
||||
|
||||
interface AxiosRequestTransformer {
|
||||
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
||||
}
|
||||
|
||||
interface AxiosResponseTransformer {
|
||||
(
|
||||
this: InternalAxiosRequestConfig,
|
||||
data: any,
|
||||
headers: AxiosResponseHeaders,
|
||||
status?: number
|
||||
): any;
|
||||
}
|
||||
|
||||
interface AxiosAdapter {
|
||||
(config: InternalAxiosRequestConfig): AxiosPromise;
|
||||
}
|
||||
|
||||
interface AxiosBasicCredentials {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
interface AxiosProxyConfig {
|
||||
host: string;
|
||||
port: number;
|
||||
auth?: AxiosBasicCredentials;
|
||||
protocol?: string;
|
||||
}
|
||||
|
||||
type UppercaseMethod =
|
||||
| 'GET'
|
||||
| 'DELETE'
|
||||
| 'HEAD'
|
||||
| 'OPTIONS'
|
||||
| 'POST'
|
||||
| 'PUT'
|
||||
| 'PATCH'
|
||||
| 'PURGE'
|
||||
| 'LINK'
|
||||
| 'UNLINK'
|
||||
| 'QUERY';
|
||||
|
||||
type Method = (UppercaseMethod | Lowercase<UppercaseMethod>) & {};
|
||||
|
||||
type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' | 'formdata';
|
||||
|
||||
type UppercaseResponseEncoding =
|
||||
| 'ASCII'
|
||||
| 'ANSI'
|
||||
| 'BINARY'
|
||||
| 'BASE64'
|
||||
| 'BASE64URL'
|
||||
| 'HEX'
|
||||
| 'LATIN1'
|
||||
| 'UCS-2'
|
||||
| 'UCS2'
|
||||
| 'UTF-8'
|
||||
| 'UTF8'
|
||||
| 'UTF16LE';
|
||||
|
||||
type responseEncoding = (UppercaseResponseEncoding | Lowercase<UppercaseResponseEncoding>) & {};
|
||||
|
||||
interface TransitionalOptions {
|
||||
silentJSONParsing?: boolean;
|
||||
forcedJSONParsing?: boolean;
|
||||
clarifyTimeoutError?: boolean;
|
||||
legacyInterceptorReqResOrdering?: boolean;
|
||||
}
|
||||
|
||||
interface GenericAbortSignal {
|
||||
readonly aborted: boolean;
|
||||
onabort?: ((...args: any) => any) | null;
|
||||
addEventListener?: (...args: any) => any;
|
||||
removeEventListener?: (...args: any) => any;
|
||||
}
|
||||
|
||||
interface FormDataVisitorHelpers {
|
||||
defaultVisitor: SerializerVisitor;
|
||||
convertValue: (value: any) => any;
|
||||
isVisitable: (value: any) => boolean;
|
||||
}
|
||||
|
||||
interface SerializerVisitor {
|
||||
(
|
||||
this: GenericFormData,
|
||||
value: any,
|
||||
key: string | number,
|
||||
path: null | Array<string | number>,
|
||||
helpers: FormDataVisitorHelpers
|
||||
): boolean;
|
||||
}
|
||||
|
||||
interface SerializerOptions {
|
||||
visitor?: SerializerVisitor;
|
||||
dots?: boolean;
|
||||
metaTokens?: boolean;
|
||||
indexes?: boolean | null;
|
||||
}
|
||||
|
||||
// tslint:disable-next-line
|
||||
interface FormSerializerOptions extends SerializerOptions {}
|
||||
|
||||
interface ParamEncoder {
|
||||
(value: any, defaultEncoder: (value: any) => any): any;
|
||||
}
|
||||
|
||||
interface CustomParamsSerializer {
|
||||
(params: Record<string, any>, options?: ParamsSerializerOptions): string;
|
||||
}
|
||||
|
||||
interface ParamsSerializerOptions extends SerializerOptions {
|
||||
encode?: ParamEncoder;
|
||||
serialize?: CustomParamsSerializer;
|
||||
}
|
||||
|
||||
type MaxUploadRate = number;
|
||||
|
||||
type MaxDownloadRate = number;
|
||||
|
||||
interface AxiosProgressEvent {
|
||||
loaded: number;
|
||||
total?: number;
|
||||
progress?: number;
|
||||
bytes: number;
|
||||
rate?: number;
|
||||
estimated?: number;
|
||||
upload?: boolean;
|
||||
download?: boolean;
|
||||
event?: BrowserProgressEvent;
|
||||
lengthComputable: boolean;
|
||||
}
|
||||
|
||||
type Milliseconds = number;
|
||||
|
||||
type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {});
|
||||
|
||||
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
||||
|
||||
type AddressFamily = 4 | 6 | undefined;
|
||||
|
||||
interface LookupAddressEntry {
|
||||
address: string;
|
||||
family?: AddressFamily;
|
||||
}
|
||||
|
||||
type LookupAddress = string | LookupAddressEntry;
|
||||
|
||||
interface AxiosRequestConfig<D = any> {
|
||||
url?: string;
|
||||
method?: Method | string;
|
||||
baseURL?: string;
|
||||
allowAbsoluteUrls?: boolean;
|
||||
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
||||
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
|
||||
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
|
||||
params?: any;
|
||||
paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
|
||||
data?: D;
|
||||
timeout?: Milliseconds;
|
||||
timeoutErrorMessage?: string;
|
||||
withCredentials?: boolean;
|
||||
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
|
||||
auth?: AxiosBasicCredentials;
|
||||
responseType?: ResponseType;
|
||||
responseEncoding?: responseEncoding | string;
|
||||
xsrfCookieName?: string;
|
||||
xsrfHeaderName?: string;
|
||||
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||
maxContentLength?: number;
|
||||
validateStatus?: ((status: number) => boolean) | null;
|
||||
maxBodyLength?: number;
|
||||
maxRedirects?: number;
|
||||
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
||||
beforeRedirect?: (
|
||||
options: Record<string, any>,
|
||||
responseDetails: { headers: Record<string, string>; statusCode: HttpStatusCode },
|
||||
requestDetails: { headers: Record<string, string>; url: string; method: string },
|
||||
) => void;
|
||||
socketPath?: string | null;
|
||||
allowedSocketPaths?: string | string[] | null;
|
||||
transport?: any;
|
||||
httpAgent?: any;
|
||||
httpsAgent?: any;
|
||||
proxy?: AxiosProxyConfig | false;
|
||||
cancelToken?: CancelToken | undefined;
|
||||
decompress?: boolean;
|
||||
transitional?: TransitionalOptions;
|
||||
signal?: GenericAbortSignal;
|
||||
insecureHTTPParser?: boolean;
|
||||
env?: {
|
||||
FormData?: new (...args: any[]) => object;
|
||||
fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
|
||||
Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
|
||||
Response?: new (
|
||||
body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
|
||||
init?: ResponseInit
|
||||
) => Response;
|
||||
};
|
||||
formSerializer?: FormSerializerOptions;
|
||||
family?: AddressFamily;
|
||||
lookup?:
|
||||
| ((
|
||||
hostname: string,
|
||||
options: object,
|
||||
cb: (
|
||||
err: Error | null,
|
||||
address: LookupAddress | LookupAddress[],
|
||||
family?: AddressFamily
|
||||
) => void
|
||||
) => void)
|
||||
| ((
|
||||
hostname: string,
|
||||
options: object
|
||||
) => Promise<
|
||||
| [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]
|
||||
| LookupAddress
|
||||
>);
|
||||
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
||||
parseReviver?: (this: any, key: string, value: any, context?: { source?: string }) => any;
|
||||
fetchOptions?:
|
||||
| Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'>
|
||||
| Record<string, any>;
|
||||
httpVersion?: 1 | 2;
|
||||
http2Options?: Record<string, any> & {
|
||||
sessionTimeout?: number;
|
||||
};
|
||||
formDataHeaderPolicy?: 'legacy' | 'content-only';
|
||||
redact?: string[];
|
||||
}
|
||||
|
||||
// Alias
|
||||
type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
||||
|
||||
interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
||||
headers: AxiosRequestHeaders;
|
||||
}
|
||||
|
||||
interface HeadersDefaults {
|
||||
common: RawAxiosRequestHeaders;
|
||||
delete: RawAxiosRequestHeaders;
|
||||
get: RawAxiosRequestHeaders;
|
||||
head: RawAxiosRequestHeaders;
|
||||
post: RawAxiosRequestHeaders;
|
||||
put: RawAxiosRequestHeaders;
|
||||
patch: RawAxiosRequestHeaders;
|
||||
options?: RawAxiosRequestHeaders;
|
||||
purge?: RawAxiosRequestHeaders;
|
||||
link?: RawAxiosRequestHeaders;
|
||||
unlink?: RawAxiosRequestHeaders;
|
||||
query?: RawAxiosRequestHeaders;
|
||||
}
|
||||
|
||||
interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||
headers: HeadersDefaults;
|
||||
}
|
||||
|
||||
interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
||||
}
|
||||
|
||||
interface AxiosResponse<T = any, D = any, H = {}> {
|
||||
data: T;
|
||||
status: number;
|
||||
statusText: string;
|
||||
headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
|
||||
config: InternalAxiosRequestConfig<D>;
|
||||
request?: any;
|
||||
}
|
||||
|
||||
type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
|
||||
|
||||
interface CancelStatic {
|
||||
new (message?: string): Cancel;
|
||||
}
|
||||
|
||||
interface Cancel {
|
||||
message: string | undefined;
|
||||
}
|
||||
|
||||
interface Canceler {
|
||||
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
||||
}
|
||||
|
||||
interface CancelTokenStatic {
|
||||
new (executor: (cancel: Canceler) => void): CancelToken;
|
||||
source(): CancelTokenSource;
|
||||
}
|
||||
|
||||
interface CancelToken {
|
||||
promise: Promise<Cancel>;
|
||||
reason?: Cancel;
|
||||
throwIfRequested(): void;
|
||||
}
|
||||
|
||||
interface CancelTokenSource {
|
||||
token: CancelToken;
|
||||
cancel: Canceler;
|
||||
}
|
||||
|
||||
interface AxiosInterceptorOptions {
|
||||
synchronous?: boolean;
|
||||
runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null;
|
||||
}
|
||||
|
||||
type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>;
|
||||
type AxiosInterceptorRejected = (error: any) => any;
|
||||
|
||||
type AxiosRequestInterceptorUse<T> = (
|
||||
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
||||
onRejected?: AxiosInterceptorRejected | null,
|
||||
options?: AxiosInterceptorOptions
|
||||
) => number;
|
||||
|
||||
type AxiosResponseInterceptorUse<T> = (
|
||||
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
||||
onRejected?: AxiosInterceptorRejected | null
|
||||
) => number;
|
||||
|
||||
interface AxiosInterceptorHandler<T> {
|
||||
fulfilled: AxiosInterceptorFulfilled<T>;
|
||||
rejected?: AxiosInterceptorRejected;
|
||||
synchronous: boolean;
|
||||
runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null;
|
||||
}
|
||||
|
||||
interface AxiosInterceptorManager<V> {
|
||||
use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>;
|
||||
eject(id: number): void;
|
||||
clear(): void;
|
||||
handlers?: Array<AxiosInterceptorHandler<V>>;
|
||||
}
|
||||
|
||||
interface AxiosInstance extends Axios {
|
||||
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
||||
<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
|
||||
create(config?: CreateAxiosDefaults): AxiosInstance;
|
||||
defaults: Omit<AxiosDefaults, 'headers'> & {
|
||||
headers: HeadersDefaults & {
|
||||
[key: string]: AxiosHeaderValue;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
interface GenericFormData {
|
||||
append(name: string, value: any, options?: any): any;
|
||||
}
|
||||
|
||||
interface GenericHTMLFormElement {
|
||||
name: string;
|
||||
method: string;
|
||||
submit(): void;
|
||||
}
|
||||
|
||||
interface AxiosStatic extends AxiosInstance {
|
||||
Cancel: CancelStatic;
|
||||
CancelToken: CancelTokenStatic;
|
||||
Axios: typeof Axios;
|
||||
AxiosError: typeof AxiosError;
|
||||
CanceledError: typeof CanceledError;
|
||||
HttpStatusCode: typeof HttpStatusCode;
|
||||
readonly VERSION: string;
|
||||
isCancel(value: any): value is Cancel;
|
||||
all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
||||
spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
||||
isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
||||
toFormData(
|
||||
sourceObj: object,
|
||||
targetFormData?: GenericFormData,
|
||||
options?: FormSerializerOptions
|
||||
): GenericFormData;
|
||||
formToJSON(form: GenericFormData | GenericHTMLFormElement): object;
|
||||
getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
|
||||
AxiosHeaders: typeof AxiosHeaders;
|
||||
mergeConfig<D = any>(
|
||||
config1: AxiosRequestConfig<D>,
|
||||
config2: AxiosRequestConfig<D>
|
||||
): AxiosRequestConfig<D>;
|
||||
}
|
||||
}
|
||||
|
||||
declare const axios: axios.AxiosStatic;
|
||||
|
||||
export = axios;
|
||||
@@ -1,734 +0,0 @@
|
||||
// TypeScript Version: 4.7
|
||||
type StringLiteralsOrString<Literals extends string> = Literals | (string & {});
|
||||
|
||||
export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
||||
|
||||
export interface RawAxiosHeaders {
|
||||
[key: string]: AxiosHeaderValue;
|
||||
}
|
||||
|
||||
type MethodsHeaders = Partial<
|
||||
{
|
||||
[Key in Method as Lowercase<Key>]: AxiosHeaders;
|
||||
} & { common: AxiosHeaders }
|
||||
>;
|
||||
|
||||
type AxiosHeaderMatcher =
|
||||
| string
|
||||
| RegExp
|
||||
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
||||
|
||||
type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
|
||||
|
||||
export class AxiosHeaders {
|
||||
constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
|
||||
|
||||
[key: string]: any;
|
||||
|
||||
set(
|
||||
headerName?: string,
|
||||
value?: AxiosHeaderValue,
|
||||
rewrite?: boolean | AxiosHeaderMatcher
|
||||
): AxiosHeaders;
|
||||
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
||||
|
||||
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
||||
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
||||
|
||||
has(header: string, matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
clear(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
normalize(format: boolean): AxiosHeaders;
|
||||
|
||||
concat(
|
||||
...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
|
||||
): AxiosHeaders;
|
||||
|
||||
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
||||
|
||||
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
||||
|
||||
static accessor(header: string | string[]): AxiosHeaders;
|
||||
|
||||
static concat(
|
||||
...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
|
||||
): AxiosHeaders;
|
||||
|
||||
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getContentType(parser?: RegExp): RegExpExecArray | null;
|
||||
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
||||
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getAccept(parser?: RegExp): RegExpExecArray | null;
|
||||
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
||||
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
||||
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
||||
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
||||
|
||||
getSetCookie(): string[];
|
||||
|
||||
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
||||
}
|
||||
|
||||
type CommonRequestHeadersList =
|
||||
| 'Accept'
|
||||
| 'Content-Length'
|
||||
| 'User-Agent'
|
||||
| 'Content-Encoding'
|
||||
| 'Authorization'
|
||||
| 'Location';
|
||||
|
||||
type ContentType =
|
||||
| AxiosHeaderValue
|
||||
| 'text/html'
|
||||
| 'text/plain'
|
||||
| 'multipart/form-data'
|
||||
| 'application/json'
|
||||
| 'application/x-www-form-urlencoded'
|
||||
| 'application/octet-stream';
|
||||
|
||||
export type RawAxiosRequestHeaders = Partial<
|
||||
RawAxiosHeaders & {
|
||||
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
||||
} & {
|
||||
'Content-Type': ContentType;
|
||||
}
|
||||
>;
|
||||
|
||||
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
||||
|
||||
type CommonResponseHeadersList =
|
||||
| 'Server'
|
||||
| 'Content-Type'
|
||||
| 'Content-Length'
|
||||
| 'Cache-Control'
|
||||
| 'Content-Encoding';
|
||||
|
||||
type CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase<CommonResponseHeadersList>;
|
||||
|
||||
type RawCommonResponseHeaders = {
|
||||
[Key in CommonResponseHeaderKey]: AxiosHeaderValue;
|
||||
} & {
|
||||
'set-cookie': string[];
|
||||
};
|
||||
|
||||
export type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
||||
|
||||
export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
||||
|
||||
export interface AxiosRequestTransformer {
|
||||
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
||||
}
|
||||
|
||||
export interface AxiosResponseTransformer {
|
||||
(
|
||||
this: InternalAxiosRequestConfig,
|
||||
data: any,
|
||||
headers: AxiosResponseHeaders,
|
||||
status?: number
|
||||
): any;
|
||||
}
|
||||
|
||||
export interface AxiosAdapter {
|
||||
(config: InternalAxiosRequestConfig): AxiosPromise;
|
||||
}
|
||||
|
||||
export interface AxiosBasicCredentials {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface AxiosProxyConfig {
|
||||
host: string;
|
||||
port: number;
|
||||
auth?: AxiosBasicCredentials;
|
||||
protocol?: string;
|
||||
}
|
||||
|
||||
export enum HttpStatusCode {
|
||||
Continue = 100,
|
||||
SwitchingProtocols = 101,
|
||||
Processing = 102,
|
||||
EarlyHints = 103,
|
||||
Ok = 200,
|
||||
Created = 201,
|
||||
Accepted = 202,
|
||||
NonAuthoritativeInformation = 203,
|
||||
NoContent = 204,
|
||||
ResetContent = 205,
|
||||
PartialContent = 206,
|
||||
MultiStatus = 207,
|
||||
AlreadyReported = 208,
|
||||
ImUsed = 226,
|
||||
MultipleChoices = 300,
|
||||
MovedPermanently = 301,
|
||||
Found = 302,
|
||||
SeeOther = 303,
|
||||
NotModified = 304,
|
||||
UseProxy = 305,
|
||||
Unused = 306,
|
||||
TemporaryRedirect = 307,
|
||||
PermanentRedirect = 308,
|
||||
BadRequest = 400,
|
||||
Unauthorized = 401,
|
||||
PaymentRequired = 402,
|
||||
Forbidden = 403,
|
||||
NotFound = 404,
|
||||
MethodNotAllowed = 405,
|
||||
NotAcceptable = 406,
|
||||
ProxyAuthenticationRequired = 407,
|
||||
RequestTimeout = 408,
|
||||
Conflict = 409,
|
||||
Gone = 410,
|
||||
LengthRequired = 411,
|
||||
PreconditionFailed = 412,
|
||||
PayloadTooLarge = 413,
|
||||
UriTooLong = 414,
|
||||
UnsupportedMediaType = 415,
|
||||
RangeNotSatisfiable = 416,
|
||||
ExpectationFailed = 417,
|
||||
ImATeapot = 418,
|
||||
MisdirectedRequest = 421,
|
||||
UnprocessableEntity = 422,
|
||||
Locked = 423,
|
||||
FailedDependency = 424,
|
||||
TooEarly = 425,
|
||||
UpgradeRequired = 426,
|
||||
PreconditionRequired = 428,
|
||||
TooManyRequests = 429,
|
||||
RequestHeaderFieldsTooLarge = 431,
|
||||
UnavailableForLegalReasons = 451,
|
||||
InternalServerError = 500,
|
||||
NotImplemented = 501,
|
||||
BadGateway = 502,
|
||||
ServiceUnavailable = 503,
|
||||
GatewayTimeout = 504,
|
||||
HttpVersionNotSupported = 505,
|
||||
VariantAlsoNegotiates = 506,
|
||||
InsufficientStorage = 507,
|
||||
LoopDetected = 508,
|
||||
NotExtended = 510,
|
||||
NetworkAuthenticationRequired = 511,
|
||||
}
|
||||
|
||||
type UppercaseMethod =
|
||||
| 'GET'
|
||||
| 'DELETE'
|
||||
| 'HEAD'
|
||||
| 'OPTIONS'
|
||||
| 'POST'
|
||||
| 'PUT'
|
||||
| 'PATCH'
|
||||
| 'PURGE'
|
||||
| 'LINK'
|
||||
| 'UNLINK'
|
||||
| 'QUERY';
|
||||
|
||||
export type Method = (UppercaseMethod | Lowercase<UppercaseMethod>) & {};
|
||||
|
||||
export type ResponseType =
|
||||
| 'arraybuffer'
|
||||
| 'blob'
|
||||
| 'document'
|
||||
| 'json'
|
||||
| 'text'
|
||||
| 'stream'
|
||||
| 'formdata';
|
||||
|
||||
type UppercaseResponseEncoding =
|
||||
| 'ASCII'
|
||||
| 'ANSI'
|
||||
| 'BINARY'
|
||||
| 'BASE64'
|
||||
| 'BASE64URL'
|
||||
| 'HEX'
|
||||
| 'LATIN1'
|
||||
| 'UCS-2'
|
||||
| 'UCS2'
|
||||
| 'UTF-8'
|
||||
| 'UTF8'
|
||||
| 'UTF16LE';
|
||||
|
||||
export type responseEncoding = (
|
||||
| UppercaseResponseEncoding
|
||||
| Lowercase<UppercaseResponseEncoding>
|
||||
) & {};
|
||||
|
||||
export interface TransitionalOptions {
|
||||
silentJSONParsing?: boolean;
|
||||
forcedJSONParsing?: boolean;
|
||||
clarifyTimeoutError?: boolean;
|
||||
legacyInterceptorReqResOrdering?: boolean;
|
||||
}
|
||||
|
||||
export interface GenericAbortSignal {
|
||||
readonly aborted: boolean;
|
||||
onabort?: ((...args: any) => any) | null;
|
||||
addEventListener?: (...args: any) => any;
|
||||
removeEventListener?: (...args: any) => any;
|
||||
}
|
||||
|
||||
export interface FormDataVisitorHelpers {
|
||||
defaultVisitor: SerializerVisitor;
|
||||
convertValue: (value: any) => any;
|
||||
isVisitable: (value: any) => boolean;
|
||||
}
|
||||
|
||||
export interface SerializerVisitor {
|
||||
(
|
||||
this: GenericFormData,
|
||||
value: any,
|
||||
key: string | number,
|
||||
path: null | Array<string | number>,
|
||||
helpers: FormDataVisitorHelpers
|
||||
): boolean;
|
||||
}
|
||||
|
||||
export interface SerializerOptions {
|
||||
visitor?: SerializerVisitor;
|
||||
dots?: boolean;
|
||||
metaTokens?: boolean;
|
||||
indexes?: boolean | null;
|
||||
}
|
||||
|
||||
// tslint:disable-next-line
|
||||
export interface FormSerializerOptions extends SerializerOptions {}
|
||||
|
||||
export interface ParamEncoder {
|
||||
(value: any, defaultEncoder: (value: any) => any): any;
|
||||
}
|
||||
|
||||
export interface CustomParamsSerializer {
|
||||
(params: Record<string, any>, options?: ParamsSerializerOptions): string;
|
||||
}
|
||||
|
||||
export interface ParamsSerializerOptions extends SerializerOptions {
|
||||
encode?: ParamEncoder;
|
||||
serialize?: CustomParamsSerializer;
|
||||
}
|
||||
|
||||
type MaxUploadRate = number;
|
||||
|
||||
type MaxDownloadRate = number;
|
||||
|
||||
type BrowserProgressEvent = any;
|
||||
|
||||
export interface AxiosProgressEvent {
|
||||
loaded: number;
|
||||
total?: number;
|
||||
progress?: number;
|
||||
bytes: number;
|
||||
rate?: number;
|
||||
estimated?: number;
|
||||
upload?: boolean;
|
||||
download?: boolean;
|
||||
event?: BrowserProgressEvent;
|
||||
lengthComputable: boolean;
|
||||
}
|
||||
|
||||
type Milliseconds = number;
|
||||
|
||||
type AxiosAdapterName = StringLiteralsOrString<'xhr' | 'http' | 'fetch'>;
|
||||
|
||||
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
||||
|
||||
export type AddressFamily = 4 | 6 | undefined;
|
||||
|
||||
export interface LookupAddressEntry {
|
||||
address: string;
|
||||
family?: AddressFamily;
|
||||
}
|
||||
|
||||
export type LookupAddress = string | LookupAddressEntry;
|
||||
|
||||
export interface AxiosRequestConfig<D = any> {
|
||||
url?: string;
|
||||
method?: StringLiteralsOrString<Method>;
|
||||
baseURL?: string;
|
||||
allowAbsoluteUrls?: boolean;
|
||||
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
||||
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
|
||||
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
|
||||
params?: any;
|
||||
paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
|
||||
data?: D;
|
||||
timeout?: Milliseconds;
|
||||
timeoutErrorMessage?: string;
|
||||
withCredentials?: boolean;
|
||||
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
|
||||
auth?: AxiosBasicCredentials;
|
||||
responseType?: ResponseType;
|
||||
responseEncoding?: StringLiteralsOrString<responseEncoding>;
|
||||
xsrfCookieName?: string;
|
||||
xsrfHeaderName?: string;
|
||||
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||
maxContentLength?: number;
|
||||
validateStatus?: ((status: number) => boolean) | null;
|
||||
maxBodyLength?: number;
|
||||
maxRedirects?: number;
|
||||
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
||||
beforeRedirect?: (
|
||||
options: Record<string, any>,
|
||||
responseDetails: {
|
||||
headers: Record<string, string>;
|
||||
statusCode: HttpStatusCode;
|
||||
},
|
||||
requestDetails: {
|
||||
headers: Record<string, string>;
|
||||
url: string;
|
||||
method: string;
|
||||
},
|
||||
) => void;
|
||||
socketPath?: string | null;
|
||||
allowedSocketPaths?: string | string[] | null;
|
||||
transport?: any;
|
||||
httpAgent?: any;
|
||||
httpsAgent?: any;
|
||||
proxy?: AxiosProxyConfig | false;
|
||||
cancelToken?: CancelToken | undefined;
|
||||
decompress?: boolean;
|
||||
transitional?: TransitionalOptions;
|
||||
signal?: GenericAbortSignal;
|
||||
insecureHTTPParser?: boolean;
|
||||
env?: {
|
||||
FormData?: new (...args: any[]) => object;
|
||||
fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
|
||||
Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
|
||||
Response?: new (
|
||||
body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
|
||||
init?: ResponseInit
|
||||
) => Response;
|
||||
};
|
||||
formSerializer?: FormSerializerOptions;
|
||||
family?: AddressFamily;
|
||||
lookup?:
|
||||
| ((
|
||||
hostname: string,
|
||||
options: object,
|
||||
cb: (
|
||||
err: Error | null,
|
||||
address: LookupAddress | LookupAddress[],
|
||||
family?: AddressFamily
|
||||
) => void
|
||||
) => void)
|
||||
| ((
|
||||
hostname: string,
|
||||
options: object
|
||||
) => Promise<
|
||||
[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress
|
||||
>);
|
||||
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
||||
parseReviver?: (this: any, key: string, value: any, context?: { source?: string }) => any;
|
||||
fetchOptions?: Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'> | Record<string, any>;
|
||||
httpVersion?: 1 | 2;
|
||||
http2Options?: Record<string, any> & {
|
||||
sessionTimeout?: number;
|
||||
};
|
||||
formDataHeaderPolicy?: 'legacy' | 'content-only';
|
||||
redact?: string[];
|
||||
}
|
||||
|
||||
// Alias
|
||||
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
||||
|
||||
export interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
||||
headers: AxiosRequestHeaders;
|
||||
}
|
||||
|
||||
export interface HeadersDefaults {
|
||||
common: RawAxiosRequestHeaders;
|
||||
delete: RawAxiosRequestHeaders;
|
||||
get: RawAxiosRequestHeaders;
|
||||
head: RawAxiosRequestHeaders;
|
||||
post: RawAxiosRequestHeaders;
|
||||
put: RawAxiosRequestHeaders;
|
||||
patch: RawAxiosRequestHeaders;
|
||||
options?: RawAxiosRequestHeaders;
|
||||
purge?: RawAxiosRequestHeaders;
|
||||
link?: RawAxiosRequestHeaders;
|
||||
unlink?: RawAxiosRequestHeaders;
|
||||
query?: RawAxiosRequestHeaders;
|
||||
}
|
||||
|
||||
export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||
headers: HeadersDefaults;
|
||||
}
|
||||
|
||||
export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
||||
}
|
||||
|
||||
export interface AxiosResponse<T = any, D = any, H = {}> {
|
||||
data: T;
|
||||
status: number;
|
||||
statusText: string;
|
||||
headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
|
||||
config: InternalAxiosRequestConfig<D>;
|
||||
request?: any;
|
||||
}
|
||||
|
||||
export class AxiosError<T = unknown, D = any> extends Error {
|
||||
constructor(
|
||||
message?: string,
|
||||
code?: string,
|
||||
config?: InternalAxiosRequestConfig<D>,
|
||||
request?: any,
|
||||
response?: AxiosResponse<T, D>
|
||||
);
|
||||
|
||||
config?: InternalAxiosRequestConfig<D>;
|
||||
code?: string;
|
||||
request?: any;
|
||||
response?: AxiosResponse<T, D>;
|
||||
isAxiosError: boolean;
|
||||
status?: number;
|
||||
toJSON: () => object;
|
||||
cause?: Error;
|
||||
event?: BrowserProgressEvent;
|
||||
static from<T = unknown, D = any>(
|
||||
error: Error | unknown,
|
||||
code?: string,
|
||||
config?: InternalAxiosRequestConfig<D>,
|
||||
request?: any,
|
||||
response?: AxiosResponse<T, D>,
|
||||
customProps?: object
|
||||
): AxiosError<T, D>;
|
||||
static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
||||
static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
||||
static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
||||
static readonly ERR_NETWORK = 'ERR_NETWORK';
|
||||
static readonly ERR_DEPRECATED = 'ERR_DEPRECATED';
|
||||
static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
||||
static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
||||
static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
||||
static readonly ERR_INVALID_URL = 'ERR_INVALID_URL';
|
||||
static readonly ERR_CANCELED = 'ERR_CANCELED';
|
||||
static readonly ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
||||
static readonly ECONNABORTED = 'ECONNABORTED';
|
||||
static readonly ECONNREFUSED = 'ECONNREFUSED';
|
||||
static readonly ETIMEDOUT = 'ETIMEDOUT';
|
||||
}
|
||||
|
||||
export class CanceledError<T> extends AxiosError<T> {
|
||||
readonly name: 'CanceledError';
|
||||
}
|
||||
|
||||
export type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
|
||||
|
||||
export interface CancelStatic {
|
||||
new (message?: string): Cancel;
|
||||
}
|
||||
|
||||
export interface Cancel {
|
||||
message: string | undefined;
|
||||
}
|
||||
|
||||
export interface Canceler {
|
||||
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
||||
}
|
||||
|
||||
export interface CancelTokenStatic {
|
||||
new (executor: (cancel: Canceler) => void): CancelToken;
|
||||
source(): CancelTokenSource;
|
||||
}
|
||||
|
||||
export interface CancelToken {
|
||||
promise: Promise<Cancel>;
|
||||
reason?: Cancel;
|
||||
throwIfRequested(): void;
|
||||
}
|
||||
|
||||
export interface CancelTokenSource {
|
||||
token: CancelToken;
|
||||
cancel: Canceler;
|
||||
}
|
||||
|
||||
export interface AxiosInterceptorOptions {
|
||||
synchronous?: boolean;
|
||||
runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null;
|
||||
}
|
||||
|
||||
type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>;
|
||||
type AxiosInterceptorRejected = (error: any) => any;
|
||||
|
||||
type AxiosRequestInterceptorUse<T> = (
|
||||
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
||||
onRejected?: AxiosInterceptorRejected | null,
|
||||
options?: AxiosInterceptorOptions
|
||||
) => number;
|
||||
|
||||
type AxiosResponseInterceptorUse<T> = (
|
||||
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
||||
onRejected?: AxiosInterceptorRejected | null
|
||||
) => number;
|
||||
|
||||
interface AxiosInterceptorHandler<T> {
|
||||
fulfilled: AxiosInterceptorFulfilled<T>;
|
||||
rejected?: AxiosInterceptorRejected;
|
||||
synchronous: boolean;
|
||||
runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null;
|
||||
}
|
||||
|
||||
export interface AxiosInterceptorManager<V> {
|
||||
use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>;
|
||||
eject(id: number): void;
|
||||
clear(): void;
|
||||
handlers?: Array<AxiosInterceptorHandler<V>>;
|
||||
}
|
||||
|
||||
export class Axios {
|
||||
constructor(config?: AxiosRequestConfig);
|
||||
defaults: AxiosDefaults;
|
||||
interceptors: {
|
||||
request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
|
||||
response: AxiosInterceptorManager<AxiosResponse>;
|
||||
};
|
||||
getUri(config?: AxiosRequestConfig): string;
|
||||
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
||||
get<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
delete<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
head<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
options<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
post<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
put<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
patch<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
postForm<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
putForm<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
patchForm<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
query<T = any, R = AxiosResponse<T>, D = any>(
|
||||
url: string,
|
||||
data?: D,
|
||||
config?: AxiosRequestConfig<D>
|
||||
): Promise<R>;
|
||||
}
|
||||
|
||||
export interface AxiosInstance extends Axios {
|
||||
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
||||
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||
|
||||
create(config?: CreateAxiosDefaults): AxiosInstance;
|
||||
defaults: Omit<AxiosDefaults, 'headers'> & {
|
||||
headers: HeadersDefaults & {
|
||||
[key: string]: AxiosHeaderValue;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface GenericFormData {
|
||||
append(name: string, value: any, options?: any): any;
|
||||
}
|
||||
|
||||
export interface GenericHTMLFormElement {
|
||||
name: string;
|
||||
method: string;
|
||||
submit(): void;
|
||||
}
|
||||
|
||||
export function getAdapter(
|
||||
adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined
|
||||
): AxiosAdapter;
|
||||
|
||||
export function toFormData(
|
||||
sourceObj: object,
|
||||
targetFormData?: GenericFormData,
|
||||
options?: FormSerializerOptions
|
||||
): GenericFormData;
|
||||
|
||||
export function formToJSON(form: GenericFormData | GenericHTMLFormElement): object;
|
||||
|
||||
export function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
||||
|
||||
export function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
||||
|
||||
export function isCancel<T = any>(value: any): value is CanceledError<T>;
|
||||
|
||||
export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
||||
|
||||
export function mergeConfig<D = any>(
|
||||
config1: AxiosRequestConfig<D>,
|
||||
config2: AxiosRequestConfig<D>
|
||||
): AxiosRequestConfig<D>;
|
||||
|
||||
export function create(config?: CreateAxiosDefaults): AxiosInstance;
|
||||
|
||||
export interface AxiosStatic extends AxiosInstance {
|
||||
Cancel: CancelStatic;
|
||||
CancelToken: CancelTokenStatic;
|
||||
Axios: typeof Axios;
|
||||
AxiosError: typeof AxiosError;
|
||||
HttpStatusCode: typeof HttpStatusCode;
|
||||
readonly VERSION: string;
|
||||
isCancel: typeof isCancel;
|
||||
all: typeof all;
|
||||
spread: typeof spread;
|
||||
isAxiosError: typeof isAxiosError;
|
||||
toFormData: typeof toFormData;
|
||||
formToJSON: typeof formToJSON;
|
||||
getAdapter: typeof getAdapter;
|
||||
CanceledError: typeof CanceledError;
|
||||
AxiosHeaders: typeof AxiosHeaders;
|
||||
mergeConfig: typeof mergeConfig;
|
||||
}
|
||||
|
||||
declare const axios: AxiosStatic;
|
||||
|
||||
export default axios;
|
||||
@@ -1,45 +0,0 @@
|
||||
import axios from './lib/axios.js';
|
||||
|
||||
// This module is intended to unwrap Axios default export as named.
|
||||
// Keep top-level export same with static properties
|
||||
// so that it can keep same with es module or cjs
|
||||
const {
|
||||
Axios,
|
||||
AxiosError,
|
||||
CanceledError,
|
||||
isCancel,
|
||||
CancelToken,
|
||||
VERSION,
|
||||
all,
|
||||
Cancel,
|
||||
isAxiosError,
|
||||
spread,
|
||||
toFormData,
|
||||
AxiosHeaders,
|
||||
HttpStatusCode,
|
||||
formToJSON,
|
||||
getAdapter,
|
||||
mergeConfig,
|
||||
create,
|
||||
} = axios;
|
||||
|
||||
export {
|
||||
axios as default,
|
||||
create,
|
||||
Axios,
|
||||
AxiosError,
|
||||
CanceledError,
|
||||
isCancel,
|
||||
CancelToken,
|
||||
VERSION,
|
||||
all,
|
||||
Cancel,
|
||||
isAxiosError,
|
||||
spread,
|
||||
toFormData,
|
||||
AxiosHeaders,
|
||||
HttpStatusCode,
|
||||
formToJSON,
|
||||
getAdapter,
|
||||
mergeConfig,
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
# axios // adapters
|
||||
|
||||
The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var settle = require('../core/settle');
|
||||
|
||||
module.exports = function myAdapter(config) {
|
||||
// At this point:
|
||||
// - config has been merged with defaults
|
||||
// - request transformers have already run
|
||||
// - request interceptors have already run
|
||||
|
||||
// Make the request using config provided
|
||||
// Upon response settle the Promise
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var response = {
|
||||
data: responseData,
|
||||
status: request.status,
|
||||
statusText: request.statusText,
|
||||
headers: responseHeaders,
|
||||
config: config,
|
||||
request: request,
|
||||
};
|
||||
|
||||
settle(resolve, reject, response);
|
||||
|
||||
// From here:
|
||||
// - response transformers will run
|
||||
// - response interceptors will run
|
||||
});
|
||||
};
|
||||
```
|
||||
@@ -1,132 +0,0 @@
|
||||
import utils from '../utils.js';
|
||||
import httpAdapter from './http.js';
|
||||
import xhrAdapter from './xhr.js';
|
||||
import * as fetchAdapter from './fetch.js';
|
||||
import AxiosError from '../core/AxiosError.js';
|
||||
|
||||
/**
|
||||
* Known adapters mapping.
|
||||
* Provides environment-specific adapters for Axios:
|
||||
* - `http` for Node.js
|
||||
* - `xhr` for browsers
|
||||
* - `fetch` for fetch API-based requests
|
||||
*
|
||||
* @type {Object<string, Function|Object>}
|
||||
*/
|
||||
const knownAdapters = {
|
||||
http: httpAdapter,
|
||||
xhr: xhrAdapter,
|
||||
fetch: {
|
||||
get: fetchAdapter.getFetch,
|
||||
},
|
||||
};
|
||||
|
||||
// Assign adapter names for easier debugging and identification
|
||||
utils.forEach(knownAdapters, (fn, value) => {
|
||||
if (fn) {
|
||||
try {
|
||||
// Null-proto descriptors so a polluted Object.prototype.get cannot turn
|
||||
// these data descriptors into accessor descriptors on the way in.
|
||||
Object.defineProperty(fn, 'name', { __proto__: null, value });
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-empty
|
||||
}
|
||||
Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Render a rejection reason string for unknown or unsupported adapters
|
||||
*
|
||||
* @param {string} reason
|
||||
* @returns {string}
|
||||
*/
|
||||
const renderReason = (reason) => `- ${reason}`;
|
||||
|
||||
/**
|
||||
* Check if the adapter is resolved (function, null, or false)
|
||||
*
|
||||
* @param {Function|null|false} adapter
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const isResolvedHandle = (adapter) =>
|
||||
utils.isFunction(adapter) || adapter === null || adapter === false;
|
||||
|
||||
/**
|
||||
* Get the first suitable adapter from the provided list.
|
||||
* Tries each adapter in order until a supported one is found.
|
||||
* Throws an AxiosError if no adapter is suitable.
|
||||
*
|
||||
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
||||
* @param {Object} config - Axios request configuration
|
||||
* @throws {AxiosError} If no suitable adapter is available
|
||||
* @returns {Function} The resolved adapter function
|
||||
*/
|
||||
function getAdapter(adapters, config) {
|
||||
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
||||
|
||||
const { length } = adapters;
|
||||
let nameOrAdapter;
|
||||
let adapter;
|
||||
|
||||
const rejectedReasons = {};
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
nameOrAdapter = adapters[i];
|
||||
let id;
|
||||
|
||||
adapter = nameOrAdapter;
|
||||
|
||||
if (!isResolvedHandle(nameOrAdapter)) {
|
||||
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
||||
|
||||
if (adapter === undefined) {
|
||||
throw new AxiosError(`Unknown adapter '${id}'`);
|
||||
}
|
||||
}
|
||||
|
||||
if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
||||
break;
|
||||
}
|
||||
|
||||
rejectedReasons[id || '#' + i] = adapter;
|
||||
}
|
||||
|
||||
if (!adapter) {
|
||||
const reasons = Object.entries(rejectedReasons).map(
|
||||
([id, state]) =>
|
||||
`adapter ${id} ` +
|
||||
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
||||
);
|
||||
|
||||
let s = length
|
||||
? reasons.length > 1
|
||||
? 'since :\n' + reasons.map(renderReason).join('\n')
|
||||
: ' ' + renderReason(reasons[0])
|
||||
: 'as no adapter specified';
|
||||
|
||||
throw new AxiosError(
|
||||
`There is no suitable adapter to dispatch the request ` + s,
|
||||
'ERR_NOT_SUPPORT'
|
||||
);
|
||||
}
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports Axios adapters and utility to resolve an adapter
|
||||
*/
|
||||
export default {
|
||||
/**
|
||||
* Resolve an adapter from a list of adapter names or functions.
|
||||
* @type {Function}
|
||||
*/
|
||||
getAdapter,
|
||||
|
||||
/**
|
||||
* Exposes all known adapters
|
||||
* @type {Object<string, Function|Object>}
|
||||
*/
|
||||
adapters: knownAdapters,
|
||||
};
|
||||
@@ -1,473 +0,0 @@
|
||||
import platform from '../platform/index.js';
|
||||
import utils from '../utils.js';
|
||||
import AxiosError from '../core/AxiosError.js';
|
||||
import composeSignals from '../helpers/composeSignals.js';
|
||||
import { trackStream } from '../helpers/trackStream.js';
|
||||
import AxiosHeaders from '../core/AxiosHeaders.js';
|
||||
import {
|
||||
progressEventReducer,
|
||||
progressEventDecorator,
|
||||
asyncDecorator,
|
||||
} from '../helpers/progressEventReducer.js';
|
||||
import resolveConfig from '../helpers/resolveConfig.js';
|
||||
import settle from '../core/settle.js';
|
||||
import estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js';
|
||||
import { VERSION } from '../env/data.js';
|
||||
import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';
|
||||
|
||||
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
||||
|
||||
const { isFunction } = utils;
|
||||
|
||||
const test = (fn, ...args) => {
|
||||
try {
|
||||
return !!fn(...args);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const factory = (env) => {
|
||||
const globalObject =
|
||||
utils.global !== undefined && utils.global !== null
|
||||
? utils.global
|
||||
: globalThis;
|
||||
const { ReadableStream, TextEncoder } = globalObject;
|
||||
|
||||
env = utils.merge.call(
|
||||
{
|
||||
skipUndefined: true,
|
||||
},
|
||||
{
|
||||
Request: globalObject.Request,
|
||||
Response: globalObject.Response,
|
||||
},
|
||||
env
|
||||
);
|
||||
|
||||
const { fetch: envFetch, Request, Response } = env;
|
||||
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
||||
const isRequestSupported = isFunction(Request);
|
||||
const isResponseSupported = isFunction(Response);
|
||||
|
||||
if (!isFetchSupported) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
|
||||
|
||||
const encodeText =
|
||||
isFetchSupported &&
|
||||
(typeof TextEncoder === 'function'
|
||||
? (
|
||||
(encoder) => (str) =>
|
||||
encoder.encode(str)
|
||||
)(new TextEncoder())
|
||||
: async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
||||
|
||||
const supportsRequestStream =
|
||||
isRequestSupported &&
|
||||
isReadableStreamSupported &&
|
||||
test(() => {
|
||||
let duplexAccessed = false;
|
||||
|
||||
const request = new Request(platform.origin, {
|
||||
body: new ReadableStream(),
|
||||
method: 'POST',
|
||||
get duplex() {
|
||||
duplexAccessed = true;
|
||||
return 'half';
|
||||
},
|
||||
});
|
||||
|
||||
const hasContentType = request.headers.has('Content-Type');
|
||||
|
||||
if (request.body != null) {
|
||||
request.body.cancel();
|
||||
}
|
||||
|
||||
return duplexAccessed && !hasContentType;
|
||||
});
|
||||
|
||||
const supportsResponseStream =
|
||||
isResponseSupported &&
|
||||
isReadableStreamSupported &&
|
||||
test(() => utils.isReadableStream(new Response('').body));
|
||||
|
||||
const resolvers = {
|
||||
stream: supportsResponseStream && ((res) => res.body),
|
||||
};
|
||||
|
||||
isFetchSupported &&
|
||||
(() => {
|
||||
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
|
||||
!resolvers[type] &&
|
||||
(resolvers[type] = (res, config) => {
|
||||
let method = res && res[type];
|
||||
|
||||
if (method) {
|
||||
return method.call(res);
|
||||
}
|
||||
|
||||
throw new AxiosError(
|
||||
`Response type '${type}' is not supported`,
|
||||
AxiosError.ERR_NOT_SUPPORT,
|
||||
config
|
||||
);
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
const getBodyLength = async (body) => {
|
||||
if (body == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (utils.isBlob(body)) {
|
||||
return body.size;
|
||||
}
|
||||
|
||||
if (utils.isSpecCompliantForm(body)) {
|
||||
const _request = new Request(platform.origin, {
|
||||
method: 'POST',
|
||||
body,
|
||||
});
|
||||
return (await _request.arrayBuffer()).byteLength;
|
||||
}
|
||||
|
||||
if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
|
||||
return body.byteLength;
|
||||
}
|
||||
|
||||
if (utils.isURLSearchParams(body)) {
|
||||
body = body + '';
|
||||
}
|
||||
|
||||
if (utils.isString(body)) {
|
||||
return (await encodeText(body)).byteLength;
|
||||
}
|
||||
};
|
||||
|
||||
const resolveBodyLength = async (headers, body) => {
|
||||
const length = utils.toFiniteNumber(headers.getContentLength());
|
||||
|
||||
return length == null ? getBodyLength(body) : length;
|
||||
};
|
||||
|
||||
return async (config) => {
|
||||
let {
|
||||
url,
|
||||
method,
|
||||
data,
|
||||
signal,
|
||||
cancelToken,
|
||||
timeout,
|
||||
onDownloadProgress,
|
||||
onUploadProgress,
|
||||
responseType,
|
||||
headers,
|
||||
withCredentials = 'same-origin',
|
||||
fetchOptions,
|
||||
maxContentLength,
|
||||
maxBodyLength,
|
||||
} = resolveConfig(config);
|
||||
|
||||
const hasMaxContentLength = utils.isNumber(maxContentLength) && maxContentLength > -1;
|
||||
const hasMaxBodyLength = utils.isNumber(maxBodyLength) && maxBodyLength > -1;
|
||||
|
||||
let _fetch = envFetch || fetch;
|
||||
|
||||
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
||||
|
||||
let composedSignal = composeSignals(
|
||||
[signal, cancelToken && cancelToken.toAbortSignal()],
|
||||
timeout
|
||||
);
|
||||
|
||||
let request = null;
|
||||
|
||||
const unsubscribe =
|
||||
composedSignal &&
|
||||
composedSignal.unsubscribe &&
|
||||
(() => {
|
||||
composedSignal.unsubscribe();
|
||||
});
|
||||
|
||||
let requestContentLength;
|
||||
|
||||
try {
|
||||
// Enforce maxContentLength for data: URLs up-front so we never materialize
|
||||
// an oversized payload. The HTTP adapter applies the same check (see http.js
|
||||
// "if (protocol === 'data:')" branch).
|
||||
if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
|
||||
const estimated = estimateDataURLDecodedBytes(url);
|
||||
if (estimated > maxContentLength) {
|
||||
throw new AxiosError(
|
||||
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
||||
AxiosError.ERR_BAD_RESPONSE,
|
||||
config,
|
||||
request
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Enforce maxBodyLength against the outbound request body before dispatch.
|
||||
// Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
|
||||
// maxBodyLength limit'). Skip when the body length cannot be determined
|
||||
// (e.g. a live ReadableStream supplied by the caller).
|
||||
if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
|
||||
const outboundLength = await resolveBodyLength(headers, data);
|
||||
if (
|
||||
typeof outboundLength === 'number' &&
|
||||
isFinite(outboundLength) &&
|
||||
outboundLength > maxBodyLength
|
||||
) {
|
||||
throw new AxiosError(
|
||||
'Request body larger than maxBodyLength limit',
|
||||
AxiosError.ERR_BAD_REQUEST,
|
||||
config,
|
||||
request
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
onUploadProgress &&
|
||||
supportsRequestStream &&
|
||||
method !== 'get' &&
|
||||
method !== 'head' &&
|
||||
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
||||
) {
|
||||
let _request = new Request(url, {
|
||||
method: 'POST',
|
||||
body: data,
|
||||
duplex: 'half',
|
||||
});
|
||||
|
||||
let contentTypeHeader;
|
||||
|
||||
if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
||||
headers.setContentType(contentTypeHeader);
|
||||
}
|
||||
|
||||
if (_request.body) {
|
||||
const [onProgress, flush] = progressEventDecorator(
|
||||
requestContentLength,
|
||||
progressEventReducer(asyncDecorator(onUploadProgress))
|
||||
);
|
||||
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
||||
}
|
||||
}
|
||||
|
||||
if (!utils.isString(withCredentials)) {
|
||||
withCredentials = withCredentials ? 'include' : 'omit';
|
||||
}
|
||||
|
||||
// Cloudflare Workers throws when credentials are defined
|
||||
// see https://github.com/cloudflare/workerd/issues/902
|
||||
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
||||
|
||||
// If data is FormData and Content-Type is multipart/form-data without boundary,
|
||||
// delete it so fetch can set it correctly with the boundary
|
||||
if (utils.isFormData(data)) {
|
||||
const contentType = headers.getContentType();
|
||||
if (
|
||||
contentType &&
|
||||
/^multipart\/form-data/i.test(contentType) &&
|
||||
!/boundary=/i.test(contentType)
|
||||
) {
|
||||
headers.delete('content-type');
|
||||
}
|
||||
}
|
||||
|
||||
// Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
|
||||
headers.set('User-Agent', 'axios/' + VERSION, false);
|
||||
|
||||
const resolvedOptions = {
|
||||
...fetchOptions,
|
||||
signal: composedSignal,
|
||||
method: method.toUpperCase(),
|
||||
headers: toByteStringHeaderObject(headers.normalize()),
|
||||
body: data,
|
||||
duplex: 'half',
|
||||
credentials: isCredentialsSupported ? withCredentials : undefined,
|
||||
};
|
||||
|
||||
request = isRequestSupported && new Request(url, resolvedOptions);
|
||||
|
||||
let response = await (isRequestSupported
|
||||
? _fetch(request, fetchOptions)
|
||||
: _fetch(url, resolvedOptions));
|
||||
|
||||
// Cheap pre-check: if the server honestly declares a content-length that
|
||||
// already exceeds the cap, reject before we start streaming.
|
||||
if (hasMaxContentLength) {
|
||||
const declaredLength = utils.toFiniteNumber(response.headers.get('content-length'));
|
||||
if (declaredLength != null && declaredLength > maxContentLength) {
|
||||
throw new AxiosError(
|
||||
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
||||
AxiosError.ERR_BAD_RESPONSE,
|
||||
config,
|
||||
request
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const isStreamResponse =
|
||||
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
||||
|
||||
if (
|
||||
supportsResponseStream &&
|
||||
response.body &&
|
||||
(onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
|
||||
) {
|
||||
const options = {};
|
||||
|
||||
['status', 'statusText', 'headers'].forEach((prop) => {
|
||||
options[prop] = response[prop];
|
||||
});
|
||||
|
||||
const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));
|
||||
|
||||
const [onProgress, flush] =
|
||||
(onDownloadProgress &&
|
||||
progressEventDecorator(
|
||||
responseContentLength,
|
||||
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
||||
)) ||
|
||||
[];
|
||||
|
||||
let bytesRead = 0;
|
||||
const onChunkProgress = (loadedBytes) => {
|
||||
if (hasMaxContentLength) {
|
||||
bytesRead = loadedBytes;
|
||||
if (bytesRead > maxContentLength) {
|
||||
throw new AxiosError(
|
||||
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
||||
AxiosError.ERR_BAD_RESPONSE,
|
||||
config,
|
||||
request
|
||||
);
|
||||
}
|
||||
}
|
||||
onProgress && onProgress(loadedBytes);
|
||||
};
|
||||
|
||||
response = new Response(
|
||||
trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
|
||||
flush && flush();
|
||||
unsubscribe && unsubscribe();
|
||||
}),
|
||||
options
|
||||
);
|
||||
}
|
||||
|
||||
responseType = responseType || 'text';
|
||||
|
||||
let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](
|
||||
response,
|
||||
config
|
||||
);
|
||||
|
||||
// Fallback enforcement for environments without ReadableStream support
|
||||
// (legacy runtimes). Detect materialized size from typed output; skip
|
||||
// streams/Response passthrough since the user will read those themselves.
|
||||
if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
|
||||
let materializedSize;
|
||||
if (responseData != null) {
|
||||
if (typeof responseData.byteLength === 'number') {
|
||||
materializedSize = responseData.byteLength;
|
||||
} else if (typeof responseData.size === 'number') {
|
||||
materializedSize = responseData.size;
|
||||
} else if (typeof responseData === 'string') {
|
||||
materializedSize =
|
||||
typeof TextEncoder === 'function'
|
||||
? new TextEncoder().encode(responseData).byteLength
|
||||
: responseData.length;
|
||||
}
|
||||
}
|
||||
if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
|
||||
throw new AxiosError(
|
||||
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
||||
AxiosError.ERR_BAD_RESPONSE,
|
||||
config,
|
||||
request
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
!isStreamResponse && unsubscribe && unsubscribe();
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
settle(resolve, reject, {
|
||||
data: responseData,
|
||||
headers: AxiosHeaders.from(response.headers),
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
config,
|
||||
request,
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
unsubscribe && unsubscribe();
|
||||
|
||||
// Safari can surface fetch aborts as a DOMException-like object whose
|
||||
// branded getters throw. Prefer our composed signal reason before reading
|
||||
// the caught error, preserving timeout vs cancellation semantics.
|
||||
if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
|
||||
const canceledError = composedSignal.reason;
|
||||
canceledError.config = config;
|
||||
request && (canceledError.request = request);
|
||||
err !== canceledError && (canceledError.cause = err);
|
||||
throw canceledError;
|
||||
}
|
||||
|
||||
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
||||
throw Object.assign(
|
||||
new AxiosError(
|
||||
'Network Error',
|
||||
AxiosError.ERR_NETWORK,
|
||||
config,
|
||||
request,
|
||||
err && err.response
|
||||
),
|
||||
{
|
||||
cause: err.cause || err,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
throw AxiosError.from(err, err && err.code, config, request, err && err.response);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const seedCache = new Map();
|
||||
|
||||
export const getFetch = (config) => {
|
||||
let env = (config && config.env) || {};
|
||||
const { fetch, Request, Response } = env;
|
||||
const seeds = [Request, Response, fetch];
|
||||
|
||||
let len = seeds.length,
|
||||
i = len,
|
||||
seed,
|
||||
target,
|
||||
map = seedCache;
|
||||
|
||||
while (i--) {
|
||||
seed = seeds[i];
|
||||
target = map.get(seed);
|
||||
|
||||
target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
|
||||
|
||||
map = target;
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
const adapter = getFetch();
|
||||
|
||||
export default adapter;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,227 +0,0 @@
|
||||
import utils from '../utils.js';
|
||||
import settle from '../core/settle.js';
|
||||
import transitionalDefaults from '../defaults/transitional.js';
|
||||
import AxiosError from '../core/AxiosError.js';
|
||||
import CanceledError from '../cancel/CanceledError.js';
|
||||
import parseProtocol from '../helpers/parseProtocol.js';
|
||||
import platform from '../platform/index.js';
|
||||
import AxiosHeaders from '../core/AxiosHeaders.js';
|
||||
import { progressEventReducer } from '../helpers/progressEventReducer.js';
|
||||
import resolveConfig from '../helpers/resolveConfig.js';
|
||||
import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';
|
||||
|
||||
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
||||
|
||||
export default isXHRAdapterSupported &&
|
||||
function (config) {
|
||||
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
||||
const _config = resolveConfig(config);
|
||||
let requestData = _config.data;
|
||||
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
||||
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
||||
let onCanceled;
|
||||
let uploadThrottled, downloadThrottled;
|
||||
let flushUpload, flushDownload;
|
||||
|
||||
function done() {
|
||||
flushUpload && flushUpload(); // flush events
|
||||
flushDownload && flushDownload(); // flush events
|
||||
|
||||
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
||||
|
||||
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
||||
}
|
||||
|
||||
let request = new XMLHttpRequest();
|
||||
|
||||
request.open(_config.method.toUpperCase(), _config.url, true);
|
||||
|
||||
// Set the request timeout in MS
|
||||
request.timeout = _config.timeout;
|
||||
|
||||
function onloadend() {
|
||||
if (!request) {
|
||||
return;
|
||||
}
|
||||
// Prepare the response
|
||||
const responseHeaders = AxiosHeaders.from(
|
||||
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
||||
);
|
||||
const responseData =
|
||||
!responseType || responseType === 'text' || responseType === 'json'
|
||||
? request.responseText
|
||||
: request.response;
|
||||
const response = {
|
||||
data: responseData,
|
||||
status: request.status,
|
||||
statusText: request.statusText,
|
||||
headers: responseHeaders,
|
||||
config,
|
||||
request,
|
||||
};
|
||||
|
||||
settle(
|
||||
function _resolve(value) {
|
||||
resolve(value);
|
||||
done();
|
||||
},
|
||||
function _reject(err) {
|
||||
reject(err);
|
||||
done();
|
||||
},
|
||||
response
|
||||
);
|
||||
|
||||
// Clean up request
|
||||
request = null;
|
||||
}
|
||||
|
||||
if ('onloadend' in request) {
|
||||
// Use onloadend if available
|
||||
request.onloadend = onloadend;
|
||||
} else {
|
||||
// Listen for ready state to emulate onloadend
|
||||
request.onreadystatechange = function handleLoad() {
|
||||
if (!request || request.readyState !== 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The request errored out and we didn't get a response, this will be
|
||||
// handled by onerror instead
|
||||
// With one exception: request that using file: protocol, most browsers
|
||||
// will return status as 0 even though it's a successful request
|
||||
if (
|
||||
request.status === 0 &&
|
||||
!(request.responseURL && request.responseURL.startsWith('file:'))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
// readystate handler is calling before onerror or ontimeout handlers,
|
||||
// so we should call onloadend on the next 'tick'
|
||||
setTimeout(onloadend);
|
||||
};
|
||||
}
|
||||
|
||||
// Handle browser request cancellation (as opposed to a manual cancellation)
|
||||
request.onabort = function handleAbort() {
|
||||
if (!request) {
|
||||
return;
|
||||
}
|
||||
|
||||
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
||||
done();
|
||||
|
||||
// Clean up request
|
||||
request = null;
|
||||
};
|
||||
|
||||
// Handle low level network errors
|
||||
request.onerror = function handleError(event) {
|
||||
// Browsers deliver a ProgressEvent in XHR onerror
|
||||
// (message may be empty; when present, surface it)
|
||||
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
||||
const msg = event && event.message ? event.message : 'Network Error';
|
||||
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
||||
// attach the underlying event for consumers who want details
|
||||
err.event = event || null;
|
||||
reject(err);
|
||||
done();
|
||||
request = null;
|
||||
};
|
||||
|
||||
// Handle timeout
|
||||
request.ontimeout = function handleTimeout() {
|
||||
let timeoutErrorMessage = _config.timeout
|
||||
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
||||
: 'timeout exceeded';
|
||||
const transitional = _config.transitional || transitionalDefaults;
|
||||
if (_config.timeoutErrorMessage) {
|
||||
timeoutErrorMessage = _config.timeoutErrorMessage;
|
||||
}
|
||||
reject(
|
||||
new AxiosError(
|
||||
timeoutErrorMessage,
|
||||
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
||||
config,
|
||||
request
|
||||
)
|
||||
);
|
||||
done();
|
||||
|
||||
// Clean up request
|
||||
request = null;
|
||||
};
|
||||
|
||||
// Remove Content-Type if data is undefined
|
||||
requestData === undefined && requestHeaders.setContentType(null);
|
||||
|
||||
// Add headers to the request
|
||||
if ('setRequestHeader' in request) {
|
||||
utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
|
||||
request.setRequestHeader(key, val);
|
||||
});
|
||||
}
|
||||
|
||||
// Add withCredentials to request if needed
|
||||
if (!utils.isUndefined(_config.withCredentials)) {
|
||||
request.withCredentials = !!_config.withCredentials;
|
||||
}
|
||||
|
||||
// Add responseType to request if needed
|
||||
if (responseType && responseType !== 'json') {
|
||||
request.responseType = _config.responseType;
|
||||
}
|
||||
|
||||
// Handle progress if needed
|
||||
if (onDownloadProgress) {
|
||||
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
||||
request.addEventListener('progress', downloadThrottled);
|
||||
}
|
||||
|
||||
// Not all browsers support upload events
|
||||
if (onUploadProgress && request.upload) {
|
||||
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
||||
|
||||
request.upload.addEventListener('progress', uploadThrottled);
|
||||
|
||||
request.upload.addEventListener('loadend', flushUpload);
|
||||
}
|
||||
|
||||
if (_config.cancelToken || _config.signal) {
|
||||
// Handle cancellation
|
||||
// eslint-disable-next-line func-names
|
||||
onCanceled = (cancel) => {
|
||||
if (!request) {
|
||||
return;
|
||||
}
|
||||
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
||||
request.abort();
|
||||
done();
|
||||
request = null;
|
||||
};
|
||||
|
||||
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
||||
if (_config.signal) {
|
||||
_config.signal.aborted
|
||||
? onCanceled()
|
||||
: _config.signal.addEventListener('abort', onCanceled);
|
||||
}
|
||||
}
|
||||
|
||||
const protocol = parseProtocol(_config.url);
|
||||
|
||||
if (protocol && !platform.protocols.includes(protocol)) {
|
||||
reject(
|
||||
new AxiosError(
|
||||
'Unsupported protocol ' + protocol + ':',
|
||||
AxiosError.ERR_BAD_REQUEST,
|
||||
config
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Send the request
|
||||
request.send(requestData || null);
|
||||
});
|
||||
};
|
||||
@@ -1,89 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import utils from './utils.js';
|
||||
import bind from './helpers/bind.js';
|
||||
import Axios from './core/Axios.js';
|
||||
import mergeConfig from './core/mergeConfig.js';
|
||||
import defaults from './defaults/index.js';
|
||||
import formDataToJSON from './helpers/formDataToJSON.js';
|
||||
import CanceledError from './cancel/CanceledError.js';
|
||||
import CancelToken from './cancel/CancelToken.js';
|
||||
import isCancel from './cancel/isCancel.js';
|
||||
import { VERSION } from './env/data.js';
|
||||
import toFormData from './helpers/toFormData.js';
|
||||
import AxiosError from './core/AxiosError.js';
|
||||
import spread from './helpers/spread.js';
|
||||
import isAxiosError from './helpers/isAxiosError.js';
|
||||
import AxiosHeaders from './core/AxiosHeaders.js';
|
||||
import adapters from './adapters/adapters.js';
|
||||
import HttpStatusCode from './helpers/HttpStatusCode.js';
|
||||
|
||||
/**
|
||||
* Create an instance of Axios
|
||||
*
|
||||
* @param {Object} defaultConfig The default config for the instance
|
||||
*
|
||||
* @returns {Axios} A new instance of Axios
|
||||
*/
|
||||
function createInstance(defaultConfig) {
|
||||
const context = new Axios(defaultConfig);
|
||||
const instance = bind(Axios.prototype.request, context);
|
||||
|
||||
// Copy axios.prototype to instance
|
||||
utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });
|
||||
|
||||
// Copy context to instance
|
||||
utils.extend(instance, context, null, { allOwnKeys: true });
|
||||
|
||||
// Factory for creating new instances
|
||||
instance.create = function create(instanceConfig) {
|
||||
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
||||
};
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Create the default instance to be exported
|
||||
const axios = createInstance(defaults);
|
||||
|
||||
// Expose Axios class to allow class inheritance
|
||||
axios.Axios = Axios;
|
||||
|
||||
// Expose Cancel & CancelToken
|
||||
axios.CanceledError = CanceledError;
|
||||
axios.CancelToken = CancelToken;
|
||||
axios.isCancel = isCancel;
|
||||
axios.VERSION = VERSION;
|
||||
axios.toFormData = toFormData;
|
||||
|
||||
// Expose AxiosError class
|
||||
axios.AxiosError = AxiosError;
|
||||
|
||||
// alias for CanceledError for backward compatibility
|
||||
axios.Cancel = axios.CanceledError;
|
||||
|
||||
// Expose all/spread
|
||||
axios.all = function all(promises) {
|
||||
return Promise.all(promises);
|
||||
};
|
||||
|
||||
axios.spread = spread;
|
||||
|
||||
// Expose isAxiosError
|
||||
axios.isAxiosError = isAxiosError;
|
||||
|
||||
// Expose mergeConfig
|
||||
axios.mergeConfig = mergeConfig;
|
||||
|
||||
axios.AxiosHeaders = AxiosHeaders;
|
||||
|
||||
axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
||||
|
||||
axios.getAdapter = adapters.getAdapter;
|
||||
|
||||
axios.HttpStatusCode = HttpStatusCode;
|
||||
|
||||
axios.default = axios;
|
||||
|
||||
// this module should only have a default export
|
||||
export default axios;
|
||||
@@ -1,135 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import CanceledError from './CanceledError.js';
|
||||
|
||||
/**
|
||||
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
||||
*
|
||||
* @param {Function} executor The executor function.
|
||||
*
|
||||
* @returns {CancelToken}
|
||||
*/
|
||||
class CancelToken {
|
||||
constructor(executor) {
|
||||
if (typeof executor !== 'function') {
|
||||
throw new TypeError('executor must be a function.');
|
||||
}
|
||||
|
||||
let resolvePromise;
|
||||
|
||||
this.promise = new Promise(function promiseExecutor(resolve) {
|
||||
resolvePromise = resolve;
|
||||
});
|
||||
|
||||
const token = this;
|
||||
|
||||
// eslint-disable-next-line func-names
|
||||
this.promise.then((cancel) => {
|
||||
if (!token._listeners) return;
|
||||
|
||||
let i = token._listeners.length;
|
||||
|
||||
while (i-- > 0) {
|
||||
token._listeners[i](cancel);
|
||||
}
|
||||
token._listeners = null;
|
||||
});
|
||||
|
||||
// eslint-disable-next-line func-names
|
||||
this.promise.then = (onfulfilled) => {
|
||||
let _resolve;
|
||||
// eslint-disable-next-line func-names
|
||||
const promise = new Promise((resolve) => {
|
||||
token.subscribe(resolve);
|
||||
_resolve = resolve;
|
||||
}).then(onfulfilled);
|
||||
|
||||
promise.cancel = function reject() {
|
||||
token.unsubscribe(_resolve);
|
||||
};
|
||||
|
||||
return promise;
|
||||
};
|
||||
|
||||
executor(function cancel(message, config, request) {
|
||||
if (token.reason) {
|
||||
// Cancellation has already been requested
|
||||
return;
|
||||
}
|
||||
|
||||
token.reason = new CanceledError(message, config, request);
|
||||
resolvePromise(token.reason);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a `CanceledError` if cancellation has been requested.
|
||||
*/
|
||||
throwIfRequested() {
|
||||
if (this.reason) {
|
||||
throw this.reason;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to the cancel signal
|
||||
*/
|
||||
|
||||
subscribe(listener) {
|
||||
if (this.reason) {
|
||||
listener(this.reason);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._listeners) {
|
||||
this._listeners.push(listener);
|
||||
} else {
|
||||
this._listeners = [listener];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsubscribe from the cancel signal
|
||||
*/
|
||||
|
||||
unsubscribe(listener) {
|
||||
if (!this._listeners) {
|
||||
return;
|
||||
}
|
||||
const index = this._listeners.indexOf(listener);
|
||||
if (index !== -1) {
|
||||
this._listeners.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
toAbortSignal() {
|
||||
const controller = new AbortController();
|
||||
|
||||
const abort = (err) => {
|
||||
controller.abort(err);
|
||||
};
|
||||
|
||||
this.subscribe(abort);
|
||||
|
||||
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
||||
|
||||
return controller.signal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
||||
* cancels the `CancelToken`.
|
||||
*/
|
||||
static source() {
|
||||
let cancel;
|
||||
const token = new CancelToken(function executor(c) {
|
||||
cancel = c;
|
||||
});
|
||||
return {
|
||||
token,
|
||||
cancel,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default CancelToken;
|
||||
@@ -1,22 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import AxiosError from '../core/AxiosError.js';
|
||||
|
||||
class CanceledError extends AxiosError {
|
||||
/**
|
||||
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
||||
*
|
||||
* @param {string=} message The message.
|
||||
* @param {Object=} config The config.
|
||||
* @param {Object=} request The request.
|
||||
*
|
||||
* @returns {CanceledError} The created error.
|
||||
*/
|
||||
constructor(message, config, request) {
|
||||
super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
|
||||
this.name = 'CanceledError';
|
||||
this.__CANCEL__ = true;
|
||||
}
|
||||
}
|
||||
|
||||
export default CanceledError;
|
||||
@@ -1,5 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
export default function isCancel(value) {
|
||||
return !!(value && value.__CANCEL__);
|
||||
}
|
||||
@@ -1,281 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import utils from '../utils.js';
|
||||
import buildURL from '../helpers/buildURL.js';
|
||||
import InterceptorManager from './InterceptorManager.js';
|
||||
import dispatchRequest from './dispatchRequest.js';
|
||||
import mergeConfig from './mergeConfig.js';
|
||||
import buildFullPath from './buildFullPath.js';
|
||||
import validator from '../helpers/validator.js';
|
||||
import AxiosHeaders from './AxiosHeaders.js';
|
||||
import transitionalDefaults from '../defaults/transitional.js';
|
||||
|
||||
const validators = validator.validators;
|
||||
|
||||
/**
|
||||
* Create a new instance of Axios
|
||||
*
|
||||
* @param {Object} instanceConfig The default config for the instance
|
||||
*
|
||||
* @return {Axios} A new instance of Axios
|
||||
*/
|
||||
class Axios {
|
||||
constructor(instanceConfig) {
|
||||
this.defaults = instanceConfig || {};
|
||||
this.interceptors = {
|
||||
request: new InterceptorManager(),
|
||||
response: new InterceptorManager(),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch a request
|
||||
*
|
||||
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
||||
* @param {?Object} config
|
||||
*
|
||||
* @returns {Promise} The Promise to be fulfilled
|
||||
*/
|
||||
async request(configOrUrl, config) {
|
||||
try {
|
||||
return await this._request(configOrUrl, config);
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
let dummy = {};
|
||||
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
||||
|
||||
// slice off the Error: ... line
|
||||
const stack = (() => {
|
||||
if (!dummy.stack) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const firstNewlineIndex = dummy.stack.indexOf('\n');
|
||||
|
||||
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
||||
})();
|
||||
try {
|
||||
if (!err.stack) {
|
||||
err.stack = stack;
|
||||
// match without the 2 top stack lines
|
||||
} else if (stack) {
|
||||
const firstNewlineIndex = stack.indexOf('\n');
|
||||
const secondNewlineIndex =
|
||||
firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
|
||||
const stackWithoutTwoTopLines =
|
||||
secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
|
||||
|
||||
if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
|
||||
err.stack += '\n' + stack;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore the case where "stack" is an un-writable property
|
||||
}
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
_request(configOrUrl, config) {
|
||||
/*eslint no-param-reassign:0*/
|
||||
// Allow for axios('example/url'[, config]) a la fetch API
|
||||
if (typeof configOrUrl === 'string') {
|
||||
config = config || {};
|
||||
config.url = configOrUrl;
|
||||
} else {
|
||||
config = configOrUrl || {};
|
||||
}
|
||||
|
||||
config = mergeConfig(this.defaults, config);
|
||||
|
||||
const { transitional, paramsSerializer, headers } = config;
|
||||
|
||||
if (transitional !== undefined) {
|
||||
validator.assertOptions(
|
||||
transitional,
|
||||
{
|
||||
silentJSONParsing: validators.transitional(validators.boolean),
|
||||
forcedJSONParsing: validators.transitional(validators.boolean),
|
||||
clarifyTimeoutError: validators.transitional(validators.boolean),
|
||||
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
||||
},
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
if (paramsSerializer != null) {
|
||||
if (utils.isFunction(paramsSerializer)) {
|
||||
config.paramsSerializer = {
|
||||
serialize: paramsSerializer,
|
||||
};
|
||||
} else {
|
||||
validator.assertOptions(
|
||||
paramsSerializer,
|
||||
{
|
||||
encode: validators.function,
|
||||
serialize: validators.function,
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set config.allowAbsoluteUrls
|
||||
if (config.allowAbsoluteUrls !== undefined) {
|
||||
// do nothing
|
||||
} else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
||||
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
||||
} else {
|
||||
config.allowAbsoluteUrls = true;
|
||||
}
|
||||
|
||||
validator.assertOptions(
|
||||
config,
|
||||
{
|
||||
baseUrl: validators.spelling('baseURL'),
|
||||
withXsrfToken: validators.spelling('withXSRFToken'),
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
// Set config.method
|
||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||
|
||||
// Flatten headers
|
||||
let contextHeaders = headers && utils.merge(headers.common, headers[config.method]);
|
||||
|
||||
headers &&
|
||||
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
|
||||
delete headers[method];
|
||||
});
|
||||
|
||||
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
||||
|
||||
// filter out skipped interceptors
|
||||
const requestInterceptorChain = [];
|
||||
let synchronousRequestInterceptors = true;
|
||||
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
||||
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
||||
|
||||
const transitional = config.transitional || transitionalDefaults;
|
||||
const legacyInterceptorReqResOrdering =
|
||||
transitional && transitional.legacyInterceptorReqResOrdering;
|
||||
|
||||
if (legacyInterceptorReqResOrdering) {
|
||||
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
||||
} else {
|
||||
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
||||
}
|
||||
});
|
||||
|
||||
const responseInterceptorChain = [];
|
||||
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
||||
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
||||
});
|
||||
|
||||
let promise;
|
||||
let i = 0;
|
||||
let len;
|
||||
|
||||
if (!synchronousRequestInterceptors) {
|
||||
const chain = [dispatchRequest.bind(this), undefined];
|
||||
chain.unshift(...requestInterceptorChain);
|
||||
chain.push(...responseInterceptorChain);
|
||||
len = chain.length;
|
||||
|
||||
promise = Promise.resolve(config);
|
||||
|
||||
while (i < len) {
|
||||
promise = promise.then(chain[i++], chain[i++]);
|
||||
}
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
len = requestInterceptorChain.length;
|
||||
|
||||
let newConfig = config;
|
||||
|
||||
while (i < len) {
|
||||
const onFulfilled = requestInterceptorChain[i++];
|
||||
const onRejected = requestInterceptorChain[i++];
|
||||
try {
|
||||
newConfig = onFulfilled(newConfig);
|
||||
} catch (error) {
|
||||
onRejected.call(this, error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
promise = dispatchRequest.call(this, newConfig);
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
len = responseInterceptorChain.length;
|
||||
|
||||
while (i < len) {
|
||||
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
||||
}
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
getUri(config) {
|
||||
config = mergeConfig(this.defaults, config);
|
||||
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
||||
return buildURL(fullPath, config.params, config.paramsSerializer);
|
||||
}
|
||||
}
|
||||
|
||||
// Provide aliases for supported request methods
|
||||
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
||||
/*eslint func-names:0*/
|
||||
Axios.prototype[method] = function (url, config) {
|
||||
return this.request(
|
||||
mergeConfig(config || {}, {
|
||||
method,
|
||||
url,
|
||||
data: (config || {}).data,
|
||||
})
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
utils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
|
||||
function generateHTTPMethod(isForm) {
|
||||
return function httpMethod(url, data, config) {
|
||||
return this.request(
|
||||
mergeConfig(config || {}, {
|
||||
method,
|
||||
headers: isForm
|
||||
? {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
}
|
||||
: {},
|
||||
url,
|
||||
data,
|
||||
})
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Axios.prototype[method] = generateHTTPMethod();
|
||||
|
||||
// QUERY is a safe/idempotent read method; multipart form bodies don't fit
|
||||
// its semantics, so no queryForm shorthand is generated.
|
||||
if (method !== 'query') {
|
||||
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
|
||||
}
|
||||
});
|
||||
|
||||
export default Axios;
|
||||
@@ -1,176 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import utils from '../utils.js';
|
||||
import AxiosHeaders from './AxiosHeaders.js';
|
||||
|
||||
const REDACTED = '[REDACTED ****]';
|
||||
|
||||
function hasOwnOrPrototypeToJSON(source) {
|
||||
if (utils.hasOwnProp(source, 'toJSON')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
let prototype = Object.getPrototypeOf(source);
|
||||
|
||||
while (prototype && prototype !== Object.prototype) {
|
||||
if (utils.hasOwnProp(prototype, 'toJSON')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
prototype = Object.getPrototypeOf(prototype);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Build a plain-object snapshot of `config` and replace the value of any key
|
||||
// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
|
||||
// and AxiosHeaders, and short-circuits on circular references.
|
||||
function redactConfig(config, redactKeys) {
|
||||
const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
|
||||
const seen = [];
|
||||
|
||||
const visit = (source) => {
|
||||
if (source === null || typeof source !== 'object') return source;
|
||||
if (utils.isBuffer(source)) return source;
|
||||
if (seen.indexOf(source) !== -1) return undefined;
|
||||
|
||||
if (source instanceof AxiosHeaders) {
|
||||
source = source.toJSON();
|
||||
}
|
||||
|
||||
seen.push(source);
|
||||
|
||||
let result;
|
||||
if (utils.isArray(source)) {
|
||||
result = [];
|
||||
source.forEach((v, i) => {
|
||||
const reducedValue = visit(v);
|
||||
if (!utils.isUndefined(reducedValue)) {
|
||||
result[i] = reducedValue;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
|
||||
seen.pop();
|
||||
return source;
|
||||
}
|
||||
|
||||
result = Object.create(null);
|
||||
for (const [key, value] of Object.entries(source)) {
|
||||
const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
|
||||
if (!utils.isUndefined(reducedValue)) {
|
||||
result[key] = reducedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
seen.pop();
|
||||
return result;
|
||||
};
|
||||
|
||||
return visit(config);
|
||||
}
|
||||
|
||||
class AxiosError extends Error {
|
||||
static from(error, code, config, request, response, customProps) {
|
||||
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
||||
axiosError.cause = error;
|
||||
axiosError.name = error.name;
|
||||
|
||||
// Preserve status from the original error if not already set from response
|
||||
if (error.status != null && axiosError.status == null) {
|
||||
axiosError.status = error.status;
|
||||
}
|
||||
|
||||
customProps && Object.assign(axiosError, customProps);
|
||||
return axiosError;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an Error with the specified message, config, error code, request and response.
|
||||
*
|
||||
* @param {string} message The error message.
|
||||
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
||||
* @param {Object} [config] The config.
|
||||
* @param {Object} [request] The request.
|
||||
* @param {Object} [response] The response.
|
||||
*
|
||||
* @returns {Error} The created error.
|
||||
*/
|
||||
constructor(message, code, config, request, response) {
|
||||
super(message);
|
||||
|
||||
// Make message enumerable to maintain backward compatibility
|
||||
// The native Error constructor sets message as non-enumerable,
|
||||
// but axios < v1.13.3 had it as enumerable
|
||||
Object.defineProperty(this, 'message', {
|
||||
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
||||
// this data descriptor into an accessor descriptor on the way in.
|
||||
__proto__: null,
|
||||
value: message,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
this.name = 'AxiosError';
|
||||
this.isAxiosError = true;
|
||||
code && (this.code = code);
|
||||
config && (this.config = config);
|
||||
request && (this.request = request);
|
||||
if (response) {
|
||||
this.response = response;
|
||||
this.status = response.status;
|
||||
}
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
// Opt-in redaction: when the request config carries a `redact` array, the
|
||||
// value of any matching key (case-insensitive, at any depth) is replaced
|
||||
// with REDACTED in the serialized snapshot. Undefined or empty leaves the
|
||||
// existing serialization behavior unchanged.
|
||||
const config = this.config;
|
||||
const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined;
|
||||
const serializedConfig =
|
||||
utils.isArray(redactKeys) && redactKeys.length > 0
|
||||
? redactConfig(config, redactKeys)
|
||||
: utils.toJSONObject(config);
|
||||
|
||||
return {
|
||||
// Standard
|
||||
message: this.message,
|
||||
name: this.name,
|
||||
// Microsoft
|
||||
description: this.description,
|
||||
number: this.number,
|
||||
// Mozilla
|
||||
fileName: this.fileName,
|
||||
lineNumber: this.lineNumber,
|
||||
columnNumber: this.columnNumber,
|
||||
stack: this.stack,
|
||||
// Axios
|
||||
config: serializedConfig,
|
||||
code: this.code,
|
||||
status: this.status,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
||||
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
||||
AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
||||
AxiosError.ECONNABORTED = 'ECONNABORTED';
|
||||
AxiosError.ETIMEDOUT = 'ETIMEDOUT';
|
||||
AxiosError.ECONNREFUSED = 'ECONNREFUSED';
|
||||
AxiosError.ERR_NETWORK = 'ERR_NETWORK';
|
||||
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
||||
AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
||||
AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
||||
AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
||||
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
||||
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
||||
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
||||
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
||||
|
||||
export default AxiosError;
|
||||
@@ -1,348 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import utils from '../utils.js';
|
||||
import parseHeaders from '../helpers/parseHeaders.js';
|
||||
import { sanitizeHeaderValue } from '../helpers/sanitizeHeaderValue.js';
|
||||
|
||||
const $internals = Symbol('internals');
|
||||
|
||||
function normalizeHeader(header) {
|
||||
return header && String(header).trim().toLowerCase();
|
||||
}
|
||||
|
||||
function normalizeValue(value) {
|
||||
if (value === false || value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
||||
}
|
||||
|
||||
function parseTokens(str) {
|
||||
const tokens = Object.create(null);
|
||||
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
||||
let match;
|
||||
|
||||
while ((match = tokensRE.exec(str))) {
|
||||
tokens[match[1]] = match[2];
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
||||
|
||||
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
||||
if (utils.isFunction(filter)) {
|
||||
return filter.call(this, value, header);
|
||||
}
|
||||
|
||||
if (isHeaderNameFilter) {
|
||||
value = header;
|
||||
}
|
||||
|
||||
if (!utils.isString(value)) return;
|
||||
|
||||
if (utils.isString(filter)) {
|
||||
return value.indexOf(filter) !== -1;
|
||||
}
|
||||
|
||||
if (utils.isRegExp(filter)) {
|
||||
return filter.test(value);
|
||||
}
|
||||
}
|
||||
|
||||
function formatHeader(header) {
|
||||
return header
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
||||
return char.toUpperCase() + str;
|
||||
});
|
||||
}
|
||||
|
||||
function buildAccessors(obj, header) {
|
||||
const accessorName = utils.toCamelCase(' ' + header);
|
||||
|
||||
['get', 'set', 'has'].forEach((methodName) => {
|
||||
Object.defineProperty(obj, methodName + accessorName, {
|
||||
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
||||
// this data descriptor into an accessor descriptor on the way in.
|
||||
__proto__: null,
|
||||
value: function (arg1, arg2, arg3) {
|
||||
return this[methodName].call(this, header, arg1, arg2, arg3);
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
class AxiosHeaders {
|
||||
constructor(headers) {
|
||||
headers && this.set(headers);
|
||||
}
|
||||
|
||||
set(header, valueOrRewrite, rewrite) {
|
||||
const self = this;
|
||||
|
||||
function setHeader(_value, _header, _rewrite) {
|
||||
const lHeader = normalizeHeader(_header);
|
||||
|
||||
if (!lHeader) {
|
||||
throw new Error('header name must be a non-empty string');
|
||||
}
|
||||
|
||||
const key = utils.findKey(self, lHeader);
|
||||
|
||||
if (
|
||||
!key ||
|
||||
self[key] === undefined ||
|
||||
_rewrite === true ||
|
||||
(_rewrite === undefined && self[key] !== false)
|
||||
) {
|
||||
self[key || _header] = normalizeValue(_value);
|
||||
}
|
||||
}
|
||||
|
||||
const setHeaders = (headers, _rewrite) =>
|
||||
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
||||
|
||||
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
||||
setHeaders(header, valueOrRewrite);
|
||||
} else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
||||
setHeaders(parseHeaders(header), valueOrRewrite);
|
||||
} else if (utils.isObject(header) && utils.isIterable(header)) {
|
||||
let obj = {},
|
||||
dest,
|
||||
key;
|
||||
for (const entry of header) {
|
||||
if (!utils.isArray(entry)) {
|
||||
throw TypeError('Object iterator must return a key-value pair');
|
||||
}
|
||||
|
||||
obj[(key = entry[0])] = (dest = obj[key])
|
||||
? utils.isArray(dest)
|
||||
? [...dest, entry[1]]
|
||||
: [dest, entry[1]]
|
||||
: entry[1];
|
||||
}
|
||||
|
||||
setHeaders(obj, valueOrRewrite);
|
||||
} else {
|
||||
header != null && setHeader(valueOrRewrite, header, rewrite);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
get(header, parser) {
|
||||
header = normalizeHeader(header);
|
||||
|
||||
if (header) {
|
||||
const key = utils.findKey(this, header);
|
||||
|
||||
if (key) {
|
||||
const value = this[key];
|
||||
|
||||
if (!parser) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (parser === true) {
|
||||
return parseTokens(value);
|
||||
}
|
||||
|
||||
if (utils.isFunction(parser)) {
|
||||
return parser.call(this, value, key);
|
||||
}
|
||||
|
||||
if (utils.isRegExp(parser)) {
|
||||
return parser.exec(value);
|
||||
}
|
||||
|
||||
throw new TypeError('parser must be boolean|regexp|function');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
has(header, matcher) {
|
||||
header = normalizeHeader(header);
|
||||
|
||||
if (header) {
|
||||
const key = utils.findKey(this, header);
|
||||
|
||||
return !!(
|
||||
key &&
|
||||
this[key] !== undefined &&
|
||||
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
delete(header, matcher) {
|
||||
const self = this;
|
||||
let deleted = false;
|
||||
|
||||
function deleteHeader(_header) {
|
||||
_header = normalizeHeader(_header);
|
||||
|
||||
if (_header) {
|
||||
const key = utils.findKey(self, _header);
|
||||
|
||||
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
||||
delete self[key];
|
||||
|
||||
deleted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isArray(header)) {
|
||||
header.forEach(deleteHeader);
|
||||
} else {
|
||||
deleteHeader(header);
|
||||
}
|
||||
|
||||
return deleted;
|
||||
}
|
||||
|
||||
clear(matcher) {
|
||||
const keys = Object.keys(this);
|
||||
let i = keys.length;
|
||||
let deleted = false;
|
||||
|
||||
while (i--) {
|
||||
const key = keys[i];
|
||||
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
||||
delete this[key];
|
||||
deleted = true;
|
||||
}
|
||||
}
|
||||
|
||||
return deleted;
|
||||
}
|
||||
|
||||
normalize(format) {
|
||||
const self = this;
|
||||
const headers = {};
|
||||
|
||||
utils.forEach(this, (value, header) => {
|
||||
const key = utils.findKey(headers, header);
|
||||
|
||||
if (key) {
|
||||
self[key] = normalizeValue(value);
|
||||
delete self[header];
|
||||
return;
|
||||
}
|
||||
|
||||
const normalized = format ? formatHeader(header) : String(header).trim();
|
||||
|
||||
if (normalized !== header) {
|
||||
delete self[header];
|
||||
}
|
||||
|
||||
self[normalized] = normalizeValue(value);
|
||||
|
||||
headers[normalized] = true;
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
concat(...targets) {
|
||||
return this.constructor.concat(this, ...targets);
|
||||
}
|
||||
|
||||
toJSON(asStrings) {
|
||||
const obj = Object.create(null);
|
||||
|
||||
utils.forEach(this, (value, header) => {
|
||||
value != null &&
|
||||
value !== false &&
|
||||
(obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
||||
});
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
[Symbol.iterator]() {
|
||||
return Object.entries(this.toJSON())[Symbol.iterator]();
|
||||
}
|
||||
|
||||
toString() {
|
||||
return Object.entries(this.toJSON())
|
||||
.map(([header, value]) => header + ': ' + value)
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
getSetCookie() {
|
||||
return this.get('set-cookie') || [];
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return 'AxiosHeaders';
|
||||
}
|
||||
|
||||
static from(thing) {
|
||||
return thing instanceof this ? thing : new this(thing);
|
||||
}
|
||||
|
||||
static concat(first, ...targets) {
|
||||
const computed = new this(first);
|
||||
|
||||
targets.forEach((target) => computed.set(target));
|
||||
|
||||
return computed;
|
||||
}
|
||||
|
||||
static accessor(header) {
|
||||
const internals =
|
||||
(this[$internals] =
|
||||
this[$internals] =
|
||||
{
|
||||
accessors: {},
|
||||
});
|
||||
|
||||
const accessors = internals.accessors;
|
||||
const prototype = this.prototype;
|
||||
|
||||
function defineAccessor(_header) {
|
||||
const lHeader = normalizeHeader(_header);
|
||||
|
||||
if (!accessors[lHeader]) {
|
||||
buildAccessors(prototype, _header);
|
||||
accessors[lHeader] = true;
|
||||
}
|
||||
}
|
||||
|
||||
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
AxiosHeaders.accessor([
|
||||
'Content-Type',
|
||||
'Content-Length',
|
||||
'Accept',
|
||||
'Accept-Encoding',
|
||||
'User-Agent',
|
||||
'Authorization',
|
||||
]);
|
||||
|
||||
// reserved names hotfix
|
||||
utils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
||||
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
||||
return {
|
||||
get: () => value,
|
||||
set(headerValue) {
|
||||
this[mapped] = headerValue;
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
utils.freezeMethods(AxiosHeaders);
|
||||
|
||||
export default AxiosHeaders;
|
||||
@@ -1,72 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import utils from '../utils.js';
|
||||
|
||||
class InterceptorManager {
|
||||
constructor() {
|
||||
this.handlers = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new interceptor to the stack
|
||||
*
|
||||
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
||||
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
||||
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
||||
*
|
||||
* @return {Number} An ID used to remove interceptor later
|
||||
*/
|
||||
use(fulfilled, rejected, options) {
|
||||
this.handlers.push({
|
||||
fulfilled,
|
||||
rejected,
|
||||
synchronous: options ? options.synchronous : false,
|
||||
runWhen: options ? options.runWhen : null,
|
||||
});
|
||||
return this.handlers.length - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an interceptor from the stack
|
||||
*
|
||||
* @param {Number} id The ID that was returned by `use`
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
eject(id) {
|
||||
if (this.handlers[id]) {
|
||||
this.handlers[id] = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all interceptors from the stack
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
clear() {
|
||||
if (this.handlers) {
|
||||
this.handlers = [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate over all the registered interceptors
|
||||
*
|
||||
* This method is particularly useful for skipping over any
|
||||
* interceptors that may have become `null` calling `eject`.
|
||||
*
|
||||
* @param {Function} fn The function to call for each interceptor
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
forEach(fn) {
|
||||
utils.forEach(this.handlers, function forEachHandler(h) {
|
||||
if (h !== null) {
|
||||
fn(h);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default InterceptorManager;
|
||||
@@ -1,8 +0,0 @@
|
||||
# axios // core
|
||||
|
||||
The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are:
|
||||
|
||||
- Dispatching requests
|
||||
- Requests sent via `adapters/` (see lib/adapters/README.md)
|
||||
- Managing interceptors
|
||||
- Handling config
|
||||
@@ -1,22 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import isAbsoluteURL from '../helpers/isAbsoluteURL.js';
|
||||
import combineURLs from '../helpers/combineURLs.js';
|
||||
|
||||
/**
|
||||
* Creates a new URL by combining the baseURL with the requestedURL,
|
||||
* only when the requestedURL is not already an absolute URL.
|
||||
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
||||
*
|
||||
* @param {string} baseURL The base URL
|
||||
* @param {string} requestedURL Absolute or relative URL to combine
|
||||
*
|
||||
* @returns {string} The combined full path
|
||||
*/
|
||||
export default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
||||
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
||||
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
||||
return combineURLs(baseURL, requestedURL);
|
||||
}
|
||||
return requestedURL;
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import transformData from './transformData.js';
|
||||
import isCancel from '../cancel/isCancel.js';
|
||||
import defaults from '../defaults/index.js';
|
||||
import CanceledError from '../cancel/CanceledError.js';
|
||||
import AxiosHeaders from '../core/AxiosHeaders.js';
|
||||
import adapters from '../adapters/adapters.js';
|
||||
|
||||
/**
|
||||
* Throws a `CanceledError` if cancellation has been requested.
|
||||
*
|
||||
* @param {Object} config The config that is to be used for the request
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function throwIfCancellationRequested(config) {
|
||||
if (config.cancelToken) {
|
||||
config.cancelToken.throwIfRequested();
|
||||
}
|
||||
|
||||
if (config.signal && config.signal.aborted) {
|
||||
throw new CanceledError(null, config);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch a request to the server using the configured adapter.
|
||||
*
|
||||
* @param {object} config The config that is to be used for the request
|
||||
*
|
||||
* @returns {Promise} The Promise to be fulfilled
|
||||
*/
|
||||
export default function dispatchRequest(config) {
|
||||
throwIfCancellationRequested(config);
|
||||
|
||||
config.headers = AxiosHeaders.from(config.headers);
|
||||
|
||||
// Transform request data
|
||||
config.data = transformData.call(config, config.transformRequest);
|
||||
|
||||
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
||||
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
||||
}
|
||||
|
||||
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
||||
|
||||
return adapter(config).then(
|
||||
function onAdapterResolution(response) {
|
||||
throwIfCancellationRequested(config);
|
||||
|
||||
// Expose the current response on config so that transformResponse can
|
||||
// attach it to any AxiosError it throws (e.g. on JSON parse failure).
|
||||
// We clean it up afterwards to avoid polluting the config object.
|
||||
config.response = response;
|
||||
try {
|
||||
response.data = transformData.call(config, config.transformResponse, response);
|
||||
} finally {
|
||||
delete config.response;
|
||||
}
|
||||
|
||||
response.headers = AxiosHeaders.from(response.headers);
|
||||
|
||||
return response;
|
||||
},
|
||||
function onAdapterRejection(reason) {
|
||||
if (!isCancel(reason)) {
|
||||
throwIfCancellationRequested(config);
|
||||
|
||||
// Transform response data
|
||||
if (reason && reason.response) {
|
||||
config.response = reason.response;
|
||||
try {
|
||||
reason.response.data = transformData.call(
|
||||
config,
|
||||
config.transformResponse,
|
||||
reason.response
|
||||
);
|
||||
} finally {
|
||||
delete config.response;
|
||||
}
|
||||
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.reject(reason);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import utils from '../utils.js';
|
||||
import AxiosHeaders from './AxiosHeaders.js';
|
||||
|
||||
const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);
|
||||
|
||||
/**
|
||||
* Config-specific merge-function which creates a new config-object
|
||||
* by merging two configuration objects together.
|
||||
*
|
||||
* @param {Object} config1
|
||||
* @param {Object} config2
|
||||
*
|
||||
* @returns {Object} New object resulting from merging config2 to config1
|
||||
*/
|
||||
export default function mergeConfig(config1, config2) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
config2 = config2 || {};
|
||||
|
||||
// Use a null-prototype object so that downstream reads such as `config.auth`
|
||||
// or `config.baseURL` cannot inherit polluted values from Object.prototype.
|
||||
// `hasOwnProperty` is restored as a non-enumerable own slot to preserve
|
||||
// ergonomics for user code that relies on it.
|
||||
const config = Object.create(null);
|
||||
Object.defineProperty(config, 'hasOwnProperty', {
|
||||
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
||||
// this data descriptor into an accessor descriptor on the way in.
|
||||
__proto__: null,
|
||||
value: Object.prototype.hasOwnProperty,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
function getMergedValue(target, source, prop, caseless) {
|
||||
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
||||
return utils.merge.call({ caseless }, target, source);
|
||||
} else if (utils.isPlainObject(source)) {
|
||||
return utils.merge({}, source);
|
||||
} else if (utils.isArray(source)) {
|
||||
return source.slice();
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
function mergeDeepProperties(a, b, prop, caseless) {
|
||||
if (!utils.isUndefined(b)) {
|
||||
return getMergedValue(a, b, prop, caseless);
|
||||
} else if (!utils.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a, prop, caseless);
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function valueFromConfig2(a, b) {
|
||||
if (!utils.isUndefined(b)) {
|
||||
return getMergedValue(undefined, b);
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function defaultToConfig2(a, b) {
|
||||
if (!utils.isUndefined(b)) {
|
||||
return getMergedValue(undefined, b);
|
||||
} else if (!utils.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a);
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function mergeDirectKeys(a, b, prop) {
|
||||
if (utils.hasOwnProp(config2, prop)) {
|
||||
return getMergedValue(a, b);
|
||||
} else if (utils.hasOwnProp(config1, prop)) {
|
||||
return getMergedValue(undefined, a);
|
||||
}
|
||||
}
|
||||
|
||||
const mergeMap = {
|
||||
url: valueFromConfig2,
|
||||
method: valueFromConfig2,
|
||||
data: valueFromConfig2,
|
||||
baseURL: defaultToConfig2,
|
||||
transformRequest: defaultToConfig2,
|
||||
transformResponse: defaultToConfig2,
|
||||
paramsSerializer: defaultToConfig2,
|
||||
timeout: defaultToConfig2,
|
||||
timeoutMessage: defaultToConfig2,
|
||||
withCredentials: defaultToConfig2,
|
||||
withXSRFToken: defaultToConfig2,
|
||||
adapter: defaultToConfig2,
|
||||
responseType: defaultToConfig2,
|
||||
xsrfCookieName: defaultToConfig2,
|
||||
xsrfHeaderName: defaultToConfig2,
|
||||
onUploadProgress: defaultToConfig2,
|
||||
onDownloadProgress: defaultToConfig2,
|
||||
decompress: defaultToConfig2,
|
||||
maxContentLength: defaultToConfig2,
|
||||
maxBodyLength: defaultToConfig2,
|
||||
beforeRedirect: defaultToConfig2,
|
||||
transport: defaultToConfig2,
|
||||
httpAgent: defaultToConfig2,
|
||||
httpsAgent: defaultToConfig2,
|
||||
cancelToken: defaultToConfig2,
|
||||
socketPath: defaultToConfig2,
|
||||
allowedSocketPaths: defaultToConfig2,
|
||||
responseEncoding: defaultToConfig2,
|
||||
validateStatus: mergeDirectKeys,
|
||||
headers: (a, b, prop) =>
|
||||
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
||||
};
|
||||
|
||||
utils.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
||||
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
||||
const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
||||
const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
||||
const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
||||
const configValue = merge(a, b, prop);
|
||||
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
||||
});
|
||||
|
||||
return config;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import AxiosError from './AxiosError.js';
|
||||
|
||||
/**
|
||||
* Resolve or reject a Promise based on response status.
|
||||
*
|
||||
* @param {Function} resolve A function that resolves the promise.
|
||||
* @param {Function} reject A function that rejects the promise.
|
||||
* @param {object} response The response.
|
||||
*
|
||||
* @returns {object} The response.
|
||||
*/
|
||||
export default function settle(resolve, reject, response) {
|
||||
const validateStatus = response.config.validateStatus;
|
||||
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
||||
resolve(response);
|
||||
} else {
|
||||
reject(new AxiosError(
|
||||
'Request failed with status code ' + response.status,
|
||||
response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,
|
||||
response.config,
|
||||
response.request,
|
||||
response
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import utils from '../utils.js';
|
||||
import defaults from '../defaults/index.js';
|
||||
import AxiosHeaders from '../core/AxiosHeaders.js';
|
||||
|
||||
/**
|
||||
* Transform the data for a request or a response
|
||||
*
|
||||
* @param {Array|Function} fns A single function or Array of functions
|
||||
* @param {?Object} response The response object
|
||||
*
|
||||
* @returns {*} The resulting transformed data
|
||||
*/
|
||||
export default function transformData(fns, response) {
|
||||
const config = this || defaults;
|
||||
const context = response || config;
|
||||
const headers = AxiosHeaders.from(context.headers);
|
||||
let data = context.data;
|
||||
|
||||
utils.forEach(fns, function transform(fn) {
|
||||
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
||||
});
|
||||
|
||||
headers.normalize();
|
||||
|
||||
return data;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user