Rename to hkt.sh
1
projects/cf-dns-bot
Submodule
141
projects/dstatus/dstatus-mac-agent.js
Normal file
@@ -0,0 +1,141 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* DStatus macOS Agent - Mac mini M2
|
||||
* 模拟 Go agent 上报格式: POST /stats/update, Header Key, Body {sid, data}
|
||||
*/
|
||||
const os = require('os');
|
||||
const https = require('https');
|
||||
const http = require('http');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const CONFIG = {
|
||||
server: 'http://51.81.222.43:5555',
|
||||
apiKey: 'macmini_report_key_2026',
|
||||
sid: '3b24c3cb-d06b-4747-83a8-a4c1ca11d4df',
|
||||
interval: 2,
|
||||
device: 'en0'
|
||||
};
|
||||
|
||||
let prevRx = 0, prevTx = 0, prevTime = 0, firstRx = 0, firstTx = 0;
|
||||
|
||||
function getCpu() {
|
||||
try {
|
||||
const out = execSync("ps -A -o %cpu | awk '{s+=$1} END {print s/100}'", { encoding: 'utf8', timeout: 3000 });
|
||||
const v = parseFloat(out.trim()) || 0;
|
||||
return { multi: Math.min(v, 1), single: os.cpus().map(() => Math.min(v, 1)) };
|
||||
} catch { return { multi: 0, single: [0] }; }
|
||||
}
|
||||
|
||||
function getDisk() {
|
||||
try {
|
||||
const out = execSync("df -k / | tail -1", { encoding: 'utf8', timeout: 3000 });
|
||||
const p = out.trim().split(/\s+/);
|
||||
const total = parseInt(p[1]) * 1024;
|
||||
const used = parseInt(p[2]) * 1024;
|
||||
const free = parseInt(p[3]) * 1024;
|
||||
const pct = parseFloat(p[4]) || 0;
|
||||
return {
|
||||
free, total, used,
|
||||
disks: [{ device: p[0], free, total, used, fstype: 'apfs', mount: '/', percent: pct }]
|
||||
};
|
||||
} catch { return { free: 0, total: 0, used: 0, disks: [] }; }
|
||||
}
|
||||
|
||||
function getMem() {
|
||||
const total = os.totalmem();
|
||||
const free = os.freemem();
|
||||
const used = total - free;
|
||||
return {
|
||||
virtual: {
|
||||
total, available: free, used, usedPercent: (used / total) * 100,
|
||||
free, active: 0, inactive: 0, wired: 0, laundry: 0,
|
||||
buffers: 0, cached: 0, writeBack: 0, dirty: 0,
|
||||
writeBackTmp: 0, shared: 0, slab: 0, sreclaimable: 0,
|
||||
sunreclaim: 0, pageTables: 0, swapCached: 0,
|
||||
commitLimit: 0, committedAS: 0, highTotal: 0, highFree: 0,
|
||||
lowTotal: 0, lowFree: 0, swapTotal: 0, swapFree: 0,
|
||||
mapped: 0, vmallocTotal: 0, vmallocUsed: 0, vmallocChunk: 0,
|
||||
hugePagesTotal: 0, hugePagesFree: 0, hugePagesRsvd: 0,
|
||||
hugePagesSurp: 0, hugePageSize: 0, anonHugePages: 0
|
||||
},
|
||||
swap: { total: 0, used: 0, free: 0, usedPercent: 0, sin: 0, sout: 0, pgIn: 0, pgOut: 0, pgFault: 0, pgMajFault: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
function getNet() {
|
||||
try {
|
||||
const out = execSync(`netstat -ibI ${CONFIG.device} | awk 'NR==2{print $7,$10}'`, { encoding: 'utf8', timeout: 3000 });
|
||||
const [rx, tx] = out.trim().split(/\s+/).map(Number);
|
||||
const now = Date.now();
|
||||
if (!firstRx) { firstRx = rx; firstTx = tx; }
|
||||
const deltaIn = prevRx ? Math.max(0, (rx || 0) - prevRx) : 0;
|
||||
const deltaOut = prevTx ? Math.max(0, (tx || 0) - prevTx) : 0;
|
||||
prevRx = rx || 0; prevTx = tx || 0; prevTime = now;
|
||||
return {
|
||||
delta: { in: deltaIn, out: deltaOut },
|
||||
total: { in: (rx || 0) - firstRx, out: (tx || 0) - firstTx }
|
||||
};
|
||||
} catch { return { delta: { in: 0, out: 0 }, total: { in: 0, out: 0 } }; }
|
||||
}
|
||||
|
||||
function getHost() {
|
||||
return {
|
||||
hostname: os.hostname(),
|
||||
uptime: Math.floor(os.uptime()),
|
||||
bootTime: Math.floor(Date.now() / 1000 - os.uptime()),
|
||||
procs: 0,
|
||||
os: 'darwin',
|
||||
platform: 'macOS',
|
||||
platformFamily: 'darwin',
|
||||
platformVersion: os.release(),
|
||||
kernelVersion: os.release(),
|
||||
kernelArch: os.arch() === 'arm64' ? 'aarch64' : os.arch(),
|
||||
virtualizationSystem: '',
|
||||
virtualizationRole: '',
|
||||
hostId: CONFIG.sid
|
||||
};
|
||||
}
|
||||
|
||||
function collectData() {
|
||||
const cpu = getCpu();
|
||||
const disk = getDisk();
|
||||
const mem = getMem();
|
||||
const net = getNet();
|
||||
const host = getHost();
|
||||
return {
|
||||
cpu, disk: { free: disk.free, total: disk.total, used: disk.used },
|
||||
disks: disk.disks, host, hostname: os.hostname(),
|
||||
mem, net, timestamp: Date.now()
|
||||
};
|
||||
}
|
||||
|
||||
function report() {
|
||||
const data = collectData();
|
||||
const body = JSON.stringify({ sid: CONFIG.sid, data });
|
||||
const mod = CONFIG.server.startsWith('https') ? https : http;
|
||||
const req = mod.request(`${CONFIG.server}/stats/update`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': Buffer.byteLength(body),
|
||||
'Key': CONFIG.apiKey
|
||||
}
|
||||
}, res => {
|
||||
let d = '';
|
||||
res.on('data', c => d += c);
|
||||
res.on('end', () => {
|
||||
try {
|
||||
const r = JSON.parse(d);
|
||||
if (r.success || r.status === 1) console.log(`[${new Date().toLocaleTimeString()}] ✅ 上报成功`);
|
||||
else console.log(`[${new Date().toLocaleTimeString()}] ❌`, d.substring(0, 100));
|
||||
} catch { console.log(`[${new Date().toLocaleTimeString()}] ❌ 解析失败:`, d.substring(0, 100)); }
|
||||
});
|
||||
});
|
||||
req.on('error', e => console.error('上报错误:', e.message));
|
||||
req.write(body);
|
||||
req.end();
|
||||
}
|
||||
|
||||
console.log('DStatus macOS Agent | SID:', CONFIG.sid);
|
||||
report();
|
||||
setInterval(report, CONFIG.interval * 1000);
|
||||
3
projects/dstatus/tcp_backup_20260131.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
net.inet.tcp.mssdflt: 512
|
||||
net.inet.tcp.ecn: 0
|
||||
net.inet.tcp.delayed_ack: 3
|
||||
148
projects/emby/tmdb_update.sh
Normal file
@@ -0,0 +1,148 @@
|
||||
#!/bin/bash
|
||||
# TMDB to Emby metadata updater
|
||||
# Fetches Chinese episode names/overviews from TMDB API and updates Emby SQLite DB
|
||||
|
||||
TMDB_API="https://api.themoviedb.org/3"
|
||||
# TMDB API key (free, read-only)
|
||||
TMDB_KEY="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI3MmJiNzMwMTRmMWQ1MTBjOGE4NjA3ZDViOGQ1MzA4YSIsIm5iZiI6MTczOTcwMjE0NC4wNTksInN1YiI6IjY3YjI2NjAwNjRkODEzMjI3NjA5NjI3NyIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.placeholder"
|
||||
|
||||
SSH_CMD="ssh -i /tmp/koipy_key -o StrictHostKeyChecking=no root@155.103.67.95"
|
||||
DB="/data/emby/config/data/library.db"
|
||||
|
||||
TOTAL_UPDATED=0
|
||||
|
||||
update_season() {
|
||||
local series_id=$1
|
||||
local tmdb_id=$2
|
||||
local season=$3
|
||||
local show_name=$4
|
||||
|
||||
echo " Fetching S$(printf '%02d' $season) from TMDB..."
|
||||
|
||||
# Fetch from TMDB API
|
||||
local url="https://api.themoviedb.org/3/tv/${tmdb_id}/season/${season}?language=zh-CN"
|
||||
local json=$(curl -s "$url" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI3MmJiNzMwMTRmMWQ1MTBjOGE4NjA3ZDViOGQ1MzA4YSIsIm5iZiI6MTczOTcwMjE0NC4wNTksInN1YiI6IjY3YjI2NjAwNjRkODEzMjI3NjA5NjI3NyIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.placeholder" -H "accept: application/json" 2>/dev/null)
|
||||
|
||||
# Check if valid response
|
||||
if echo "$json" | grep -q '"status_code"'; then
|
||||
echo " ⚠️ Season $season not found on TMDB, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
local count=$(echo "$json" | python3 -c "import sys,json; d=json.load(sys.stdin); print(len(d.get('episodes',[])))" 2>/dev/null)
|
||||
if [ -z "$count" ] || [ "$count" = "0" ]; then
|
||||
echo " ⚠️ No episodes found, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
echo " Found $count episodes"
|
||||
|
||||
# Generate SQL updates
|
||||
local sql=$(echo "$json" | python3 -c "
|
||||
import sys, json
|
||||
|
||||
data = json.load(sys.stdin)
|
||||
episodes = data.get('episodes', [])
|
||||
series_id = $series_id
|
||||
season = $season
|
||||
|
||||
sqls = []
|
||||
for ep in episodes:
|
||||
num = ep.get('episode_number', 0)
|
||||
name = ep.get('name', '').replace(\"'\", \"''\")
|
||||
overview = (ep.get('overview', '') or '').replace(\"'\", \"''\")[:500]
|
||||
|
||||
if name:
|
||||
if overview:
|
||||
sqls.append(f\"UPDATE MediaItems SET Name='{name}', Overview='{overview}' WHERE SeriesId={series_id} AND type=8 AND ParentIndexNumber={season} AND IndexNumber={num};\")
|
||||
else:
|
||||
sqls.append(f\"UPDATE MediaItems SET Name='{name}' WHERE SeriesId={series_id} AND type=8 AND ParentIndexNumber={season} AND IndexNumber={num};\")
|
||||
|
||||
print('\n'.join(sqls))
|
||||
" 2>/dev/null)
|
||||
|
||||
if [ -z "$sql" ]; then
|
||||
echo " ⚠️ No valid data to update"
|
||||
return
|
||||
fi
|
||||
|
||||
local update_count=$(echo "$sql" | wc -l | tr -d ' ')
|
||||
|
||||
# Execute SQL via SSH
|
||||
echo "$sql" | $SSH_CMD "sqlite3 '$DB'" 2>/dev/null
|
||||
|
||||
echo " ✅ Updated $update_count episodes"
|
||||
TOTAL_UPDATED=$((TOTAL_UPDATED + update_count))
|
||||
}
|
||||
|
||||
echo "========================================="
|
||||
echo "TMDB → Emby Metadata Updater"
|
||||
echo "========================================="
|
||||
|
||||
# 1. 汪汪队立大功
|
||||
echo ""
|
||||
echo "📺 [1/8] 汪汪队立大功 (SeriesId=229, TMDB=57532)"
|
||||
for s in 1 3 4 5 11; do
|
||||
update_season 229 57532 $s "汪汪队立大功"
|
||||
done
|
||||
|
||||
# 2. 小猪佩奇
|
||||
echo ""
|
||||
echo "📺 [2/8] 小猪佩奇 (SeriesId=228, TMDB=12225)"
|
||||
for s in 1 2 3 4 5; do
|
||||
update_season 228 12225 $s "小猪佩奇"
|
||||
done
|
||||
|
||||
# 3. 海底小纵队
|
||||
echo ""
|
||||
echo "📺 [3/8] 海底小纵队 (SeriesId=869, TMDB=44204)"
|
||||
for s in 1 2 3 4; do
|
||||
update_season 869 44204 $s "海底小纵队"
|
||||
done
|
||||
|
||||
# 4. 小恐龙大冒险
|
||||
echo ""
|
||||
echo "📺 [4/8] 小恐龙大冒险 (SeriesId=871, TMDB=82700)"
|
||||
for s in 1 2 3; do
|
||||
update_season 871 82700 $s "小恐龙大冒险"
|
||||
done
|
||||
|
||||
# 5. 小马宝莉
|
||||
echo ""
|
||||
echo "📺 [5/8] 小马宝莉 (SeriesId=1375, TMDB=21159)"
|
||||
for s in 1 2 3 4 7 9; do
|
||||
update_season 1375 21159 $s "小马宝莉"
|
||||
done
|
||||
|
||||
# 6. 动物神探队
|
||||
echo ""
|
||||
echo "📺 [6/8] 动物神探队 (SeriesId=146, TMDB=195407)"
|
||||
for s in 1 2 3 4 5 6 7; do
|
||||
update_season 146 195407 $s "动物神探队"
|
||||
done
|
||||
|
||||
# 7. 安全警长啦咘啦哆
|
||||
echo ""
|
||||
echo "📺 [7/8] 安全警长啦咘啦哆 (SeriesId=230, TMDB=219799)"
|
||||
for s in 1 2 3; do
|
||||
update_season 230 219799 $s "安全警长啦咘啦哆"
|
||||
done
|
||||
|
||||
# 8. 啦咘啦哆大战羚羚羊
|
||||
echo ""
|
||||
echo "📺 [8/8] 啦咘啦哆大战羚羚羊 (SeriesId=231, TMDB=253041)"
|
||||
for s in 1 2; do
|
||||
update_season 231 253041 $s "啦咘啦哆大战羚羚羊"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "========================================="
|
||||
echo "✅ Total episodes updated: $TOTAL_UPDATED"
|
||||
echo "========================================="
|
||||
|
||||
# Trigger Emby library refresh
|
||||
echo ""
|
||||
echo "🔄 Triggering Emby library refresh..."
|
||||
$SSH_CMD "curl -s -X POST 'http://127.0.0.1:8096/emby/Library/Refresh?api_key=e3e52b1dcb8b47c39d46b5256bf87081'" 2>/dev/null
|
||||
echo ""
|
||||
echo "✅ Done!"
|
||||
1
projects/gitea/gitea-backup/dd-reinstall
Submodule
1
projects/gitea/gitea-backup/oc-monitor
Submodule
1
projects/gitea/gitea-backup/ss-rust
Submodule
1
projects/gitea/gitea-backup/sub-bot
Submodule
1
projects/gitea/gitea-backup/tcp-bbr
Submodule
1
projects/gitea/gitea-backup/tg-user-monitor
Submodule
339
projects/gitea/gitea-backup/vps-reminder/bot.py
Normal file
@@ -0,0 +1,339 @@
|
||||
#!/usr/bin/env python3
|
||||
"""VPS 到期提醒 Telegram Bot"""
|
||||
|
||||
import os, json, subprocess
|
||||
from datetime import datetime
|
||||
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from telegram.ext import Application, CommandHandler, CallbackQueryHandler, MessageHandler, ConversationHandler, filters, ContextTypes
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
TOKEN = os.getenv("BOT_TOKEN")
|
||||
ADMIN = int(os.getenv("ADMIN_ID", "0"))
|
||||
DATA_FILE = os.path.join(os.path.dirname(__file__), "data.json")
|
||||
|
||||
def load_data():
|
||||
try:
|
||||
with open(DATA_FILE) as f: return json.load(f)
|
||||
except: return {"vps": [], "remind_days": [1, 3, 7]}
|
||||
|
||||
def save_data(data):
|
||||
with open(DATA_FILE, "w") as f: json.dump(data, f, ensure_ascii=False, indent=2)
|
||||
|
||||
def parse_date(text):
|
||||
"""解析日期简写: 0315 -> 2026-03-15, 3-15 -> 2026-03-15"""
|
||||
text = text.strip().replace("/", "-").replace(".", "-")
|
||||
year = datetime.now().year
|
||||
if len(text) == 4 and text.isdigit():
|
||||
return f"{year}-{text[:2]}-{text[2:]}"
|
||||
if len(text) in [3,4] and "-" in text:
|
||||
parts = text.split("-")
|
||||
return f"{year}-{parts[0].zfill(2)}-{parts[1].zfill(2)}"
|
||||
if len(text) == 10:
|
||||
return text
|
||||
return text
|
||||
|
||||
def days_left(d):
|
||||
return (datetime.strptime(d, "%Y-%m-%d") - datetime.now()).days
|
||||
|
||||
def ping_host(ip):
|
||||
try:
|
||||
r = subprocess.run(["ping", "-c", "1", "-W", "2", ip], capture_output=True, timeout=5)
|
||||
return r.returncode == 0
|
||||
except: return False
|
||||
|
||||
def calc_next_date(date_str, cycle):
|
||||
"""根据周期计算下一个到期日"""
|
||||
from dateutil.relativedelta import relativedelta
|
||||
dt = datetime.strptime(date_str, "%Y-%m-%d")
|
||||
c = cycle.lower().strip()
|
||||
if c in ("月", "monthly", "month", "1m"):
|
||||
return (dt + relativedelta(months=1)).strftime("%Y-%m-%d")
|
||||
elif c in ("季", "quarterly", "quarter", "3m"):
|
||||
return (dt + relativedelta(months=3)).strftime("%Y-%m-%d")
|
||||
elif c in ("半年", "semi", "6m"):
|
||||
return (dt + relativedelta(months=6)).strftime("%Y-%m-%d")
|
||||
elif c in ("年", "yearly", "annual", "12m"):
|
||||
return (dt + relativedelta(years=1)).strftime("%Y-%m-%d")
|
||||
return None
|
||||
|
||||
def main_kb():
|
||||
return InlineKeyboardMarkup([
|
||||
[InlineKeyboardButton("📋 VPS列表", callback_data="list")],
|
||||
[InlineKeyboardButton("➕ 添加", callback_data="add"), InlineKeyboardButton("✏️ 编辑", callback_data="edit"), InlineKeyboardButton("🗑 删除", callback_data="del")],
|
||||
[InlineKeyboardButton("📡 Ping全部", callback_data="ping"), InlineKeyboardButton("🔔 测试", callback_data="test"), InlineKeyboardButton("⚙️ 设置", callback_data="settings")]
|
||||
])
|
||||
|
||||
def back_kb():
|
||||
return InlineKeyboardMarkup([[InlineKeyboardButton("🔙 返回", callback_data="back")]])
|
||||
|
||||
async def start(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
|
||||
await update.message.reply_text("🖥 *VPS 到期提醒*", parse_mode="Markdown", reply_markup=main_kb())
|
||||
|
||||
async def button(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
|
||||
q = update.callback_query
|
||||
await q.answer()
|
||||
data = q.data
|
||||
|
||||
if data == "back":
|
||||
await q.edit_message_text("🖥 *VPS 到期提醒*", parse_mode="Markdown", reply_markup=main_kb())
|
||||
|
||||
elif data == "list":
|
||||
d = load_data()
|
||||
vps = d.get("vps", [])
|
||||
if not vps:
|
||||
await q.edit_message_text("📭 暂无VPS", reply_markup=back_kb())
|
||||
return
|
||||
groups = {}
|
||||
for i, v in enumerate(vps):
|
||||
p = v.get("provider", "未知")
|
||||
if p not in groups: groups[p] = []
|
||||
groups[p].append((i, v))
|
||||
msg = "📋 *VPS 列表*\n"
|
||||
renew_btns = []
|
||||
for provider, items in groups.items():
|
||||
msg += f"\n🏢 *{provider}*\n"
|
||||
for i, v in sorted(items, key=lambda x: days_left(x[1]["date"])):
|
||||
dl = days_left(v["date"])
|
||||
if dl < 0:
|
||||
icon, dl_text = "⚫", f"已过期{-dl}天"
|
||||
renew_btns.append(InlineKeyboardButton(f"✅ 续费 {v['name']}", callback_data=f"renew_{i}"))
|
||||
elif dl <= 3:
|
||||
icon, dl_text = "🔴", f"{dl}天"
|
||||
renew_btns.append(InlineKeyboardButton(f"✅ 续费 {v['name']}", callback_data=f"renew_{i}"))
|
||||
elif dl <= 7:
|
||||
icon, dl_text = "🟡", f"{dl}天"
|
||||
else:
|
||||
icon, dl_text = "🟢", f"{dl}天"
|
||||
msg += f"{icon} {v['name']} - {v['date']} ({dl_text})\n"
|
||||
kb = [[b] for b in renew_btns]
|
||||
kb.append([InlineKeyboardButton("🔙 返回", callback_data="back")])
|
||||
await q.edit_message_text(msg, parse_mode="Markdown", reply_markup=InlineKeyboardMarkup(kb))
|
||||
|
||||
elif data.startswith("renew_"):
|
||||
idx = int(data.split("_")[1])
|
||||
d = load_data()
|
||||
v = d["vps"][idx]
|
||||
cycle = v.get("cycle", "")
|
||||
next_date = calc_next_date(v["date"], cycle)
|
||||
kb = []
|
||||
if next_date:
|
||||
kb.append([InlineKeyboardButton(f"🔄 自动续期 → {next_date}", callback_data=f"renewauto_{idx}")])
|
||||
kb.append([InlineKeyboardButton("📝 手动输入日期", callback_data=f"renewmanual_{idx}")])
|
||||
kb.append([InlineKeyboardButton("🔙 返回", callback_data="list")])
|
||||
msg = f"✅ 续费 *{v['name']}*\n\n当前到期: {v['date']}\n周期: {cycle}"
|
||||
if next_date:
|
||||
msg += f"\n自动续期: {next_date}"
|
||||
await q.edit_message_text(msg, parse_mode="Markdown", reply_markup=InlineKeyboardMarkup(kb))
|
||||
|
||||
elif data.startswith("renewauto_"):
|
||||
idx = int(data.split("_")[1])
|
||||
d = load_data()
|
||||
v = d["vps"][idx]
|
||||
old_date = v["date"]
|
||||
new_date = calc_next_date(v["date"], v.get("cycle", ""))
|
||||
if new_date:
|
||||
v["date"] = new_date
|
||||
save_data(d)
|
||||
await q.edit_message_text(f"✅ *{v['name']}* 已续费\n\n旧日期: {old_date}\n新日期: {new_date}", parse_mode="Markdown", reply_markup=back_kb())
|
||||
else:
|
||||
await q.edit_message_text("❌ 无法计算,请手动输入", reply_markup=back_kb())
|
||||
|
||||
elif data.startswith("renewmanual_"):
|
||||
idx = int(data.split("_")[1])
|
||||
ctx.user_data["renew_idx"] = idx
|
||||
ctx.user_data["step"] = "renew_date"
|
||||
d = load_data()
|
||||
v = d["vps"][idx]
|
||||
await q.edit_message_text(f"📝 续费 *{v['name']}*\n\n请输入新的到期日期 (如 0401 或 2026-04-01):", parse_mode="Markdown")
|
||||
|
||||
elif data == "settings":
|
||||
d = load_data()
|
||||
days = d.get("remind_days", [1, 3, 7])
|
||||
kb = [[InlineKeyboardButton(f"{'✅' if i in days else '⬜'} {i}天", callback_data=f"toggle_{i}") for i in [1, 3, 7]],
|
||||
[InlineKeyboardButton(f"{'✅' if i in days else '⬜'} {i}天", callback_data=f"toggle_{i}") for i in [14, 30]],
|
||||
[InlineKeyboardButton("🔙 返回", callback_data="back")]]
|
||||
await q.edit_message_text(f"⚙️ 提醒天数设置\n当前: {days}", reply_markup=InlineKeyboardMarkup(kb))
|
||||
|
||||
elif data.startswith("toggle_"):
|
||||
day = int(data.split("_")[1])
|
||||
d = load_data()
|
||||
days = d.get("remind_days", [1, 3, 7])
|
||||
if day in days: days.remove(day)
|
||||
else: days.append(day)
|
||||
days.sort()
|
||||
d["remind_days"] = days
|
||||
save_data(d)
|
||||
kb = [[InlineKeyboardButton(f"{'✅' if i in days else '⬜'} {i}天", callback_data=f"toggle_{i}") for i in [1, 3, 7]],
|
||||
[InlineKeyboardButton(f"{'✅' if i in days else '⬜'} {i}天", callback_data=f"toggle_{i}") for i in [14, 30]],
|
||||
[InlineKeyboardButton("🔙 返回", callback_data="back")]]
|
||||
await q.edit_message_text(f"⚙️ 提醒天数设置\n当前: {days}", reply_markup=InlineKeyboardMarkup(kb))
|
||||
|
||||
elif data == "edit":
|
||||
d = load_data()
|
||||
vps = d.get("vps", [])
|
||||
if not vps:
|
||||
await q.edit_message_text("📭 暂无VPS", reply_markup=back_kb())
|
||||
return
|
||||
kb = [[InlineKeyboardButton(f"✏️ {v['name']}", callback_data=f"editvps_{i}")] for i, v in enumerate(vps)]
|
||||
kb.append([InlineKeyboardButton("🔙 返回", callback_data="back")])
|
||||
await q.edit_message_text("选择要编辑的VPS:", reply_markup=InlineKeyboardMarkup(kb))
|
||||
|
||||
elif data.startswith("editvps_"):
|
||||
idx = int(data.split("_")[1])
|
||||
ctx.user_data["edit_idx"] = idx
|
||||
d = load_data()
|
||||
v = d["vps"][idx]
|
||||
kb = [
|
||||
[InlineKeyboardButton("📝 名称", callback_data="ed_name"), InlineKeyboardButton("🏢 商家", callback_data="ed_provider")],
|
||||
[InlineKeyboardButton("🌐 IP", callback_data="ed_ip"), InlineKeyboardButton("📅 日期", callback_data="ed_date")],
|
||||
[InlineKeyboardButton("💰 价格", callback_data="ed_price"), InlineKeyboardButton("🔄 周期", callback_data="ed_cycle")],
|
||||
[InlineKeyboardButton("🔙 返回", callback_data="edit")]
|
||||
]
|
||||
msg = f"✏️ 编辑 *{v['name']}*\n\n"
|
||||
msg += f"🏢 商家: {v.get('provider','')}\n"
|
||||
msg += f"🌐 IP: {v.get('ip','无')}\n"
|
||||
msg += f"📅 日期: {v.get('date','')}\n"
|
||||
msg += f"💰 价格: {v.get('price','无')}\n"
|
||||
msg += f"🔄 周期: {v.get('cycle','')}"
|
||||
await q.edit_message_text(msg, parse_mode="Markdown", reply_markup=InlineKeyboardMarkup(kb))
|
||||
|
||||
elif data.startswith("ed_"):
|
||||
field = data.split("_")[1]
|
||||
ctx.user_data["edit_field"] = field
|
||||
names = {"name":"名称","provider":"商家","ip":"IP","date":"日期","price":"价格","cycle":"周期"}
|
||||
await q.edit_message_text(f"请输入新的{names.get(field,field)}:")
|
||||
|
||||
elif data == "del":
|
||||
d = load_data()
|
||||
vps = d.get("vps", [])
|
||||
if not vps:
|
||||
await q.edit_message_text("📭 暂无VPS", reply_markup=back_kb())
|
||||
return
|
||||
kb = [[InlineKeyboardButton(f"🗑 {v['name']}", callback_data=f"delvps_{i}")] for i, v in enumerate(vps)]
|
||||
kb.append([InlineKeyboardButton("🔙 返回", callback_data="back")])
|
||||
await q.edit_message_text("选择要删除的VPS:", reply_markup=InlineKeyboardMarkup(kb))
|
||||
|
||||
elif data.startswith("delvps_"):
|
||||
idx = int(data.split("_")[1])
|
||||
d = load_data()
|
||||
if 0 <= idx < len(d["vps"]):
|
||||
removed = d["vps"].pop(idx)
|
||||
save_data(d)
|
||||
await q.edit_message_text(f"✅ 已删除: {removed['name']}", reply_markup=back_kb())
|
||||
|
||||
elif data == "test":
|
||||
d = load_data()
|
||||
vps = d.get("vps", [])
|
||||
if not vps:
|
||||
await q.edit_message_text("📭 暂无VPS可测试", reply_markup=back_kb())
|
||||
return
|
||||
v = min(vps, key=lambda x: days_left(x["date"]))
|
||||
dl = days_left(v["date"])
|
||||
msg = f"🔔 *测试提醒*\n\n{v['name']} ({v['provider']})\n📅 {v['date']} (还剩 {dl} 天)"
|
||||
await q.message.reply_text(msg, parse_mode="Markdown")
|
||||
await q.edit_message_text("✅ 测试提醒已发送", reply_markup=back_kb())
|
||||
|
||||
elif data == "ping":
|
||||
d = load_data()
|
||||
vps = [v for v in d.get("vps", []) if v.get("ip")]
|
||||
if not vps:
|
||||
await q.edit_message_text("📭 没有可ping的VPS", reply_markup=back_kb())
|
||||
return
|
||||
await q.edit_message_text("📡 正在检测...")
|
||||
msg = "📡 *Ping 结果*\n\n"
|
||||
for v in vps:
|
||||
ok = ping_host(v["ip"])
|
||||
msg += f"{'🟢' if ok else '🔴'} {v['name']} - `{v['ip']}`\n"
|
||||
await q.edit_message_text(msg, parse_mode="Markdown", reply_markup=back_kb())
|
||||
|
||||
elif data == "add":
|
||||
ctx.user_data["step"] = "name"
|
||||
await q.edit_message_text("📝 请输入 VPS 名称:")
|
||||
|
||||
async def handle_msg(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
|
||||
step = ctx.user_data.get("step")
|
||||
text = update.message.text.strip()
|
||||
|
||||
# 编辑模式
|
||||
if ctx.user_data.get("edit_field"):
|
||||
idx = ctx.user_data.get("edit_idx", 0)
|
||||
field = ctx.user_data["edit_field"]
|
||||
d = load_data()
|
||||
if field == "date":
|
||||
text = parse_date(text)
|
||||
d["vps"][idx][field] = text
|
||||
save_data(d)
|
||||
ctx.user_data.clear()
|
||||
await update.message.reply_text("✅ 已更新", reply_markup=main_kb())
|
||||
return
|
||||
|
||||
# 续费模式
|
||||
if step == "renew_date":
|
||||
idx = ctx.user_data.get("renew_idx", 0)
|
||||
d = load_data()
|
||||
v = d["vps"][idx]
|
||||
old_date = v["date"]
|
||||
v["date"] = parse_date(text)
|
||||
save_data(d)
|
||||
ctx.user_data.clear()
|
||||
await update.message.reply_text(f"✅ *{v['name']}* 已续费\n旧日期: {old_date}\n新日期: {v['date']}", parse_mode="Markdown", reply_markup=main_kb())
|
||||
return
|
||||
return
|
||||
|
||||
if step == "name":
|
||||
ctx.user_data["name"] = text
|
||||
ctx.user_data["step"] = "provider"
|
||||
await update.message.reply_text("🏢 请输入商家名称:")
|
||||
elif step == "provider":
|
||||
ctx.user_data["provider"] = text
|
||||
ctx.user_data["step"] = "ip"
|
||||
await update.message.reply_text("🌐 请输入 IP (没有输入 0):")
|
||||
elif step == "ip":
|
||||
ctx.user_data["ip"] = None if text == "0" else text
|
||||
ctx.user_data["step"] = "cycle"
|
||||
await update.message.reply_text("🔄 付款周期 (月/季/年):")
|
||||
elif step == "cycle":
|
||||
ctx.user_data["cycle"] = text
|
||||
ctx.user_data["step"] = "date"
|
||||
await update.message.reply_text("📅 到期日期 (YYYY-MM-DD):")
|
||||
elif step == "date":
|
||||
ctx.user_data["date"] = text
|
||||
ctx.user_data["step"] = "price"
|
||||
await update.message.reply_text("💰 价格 (如 /月,没有输入 0):")
|
||||
elif step == "price":
|
||||
ctx.user_data["price"] = None if text == "0" else text
|
||||
d = load_data()
|
||||
d["vps"].append({
|
||||
"name": ctx.user_data["name"],
|
||||
"provider": ctx.user_data["provider"],
|
||||
"ip": ctx.user_data["ip"],
|
||||
"cycle": ctx.user_data["cycle"],
|
||||
"date": ctx.user_data["date"],
|
||||
"price": ctx.user_data["price"]
|
||||
})
|
||||
save_data(d)
|
||||
ctx.user_data.clear()
|
||||
await update.message.reply_text(f"✅ 已添加: {ctx.user_data.get('name', 'VPS')}", reply_markup=main_kb())
|
||||
|
||||
async def check_expire(ctx: ContextTypes.DEFAULT_TYPE):
|
||||
d = load_data()
|
||||
remind_days = d.get("remind_days", [1, 3, 7])
|
||||
for v in d.get("vps", []):
|
||||
dl = days_left(v["date"])
|
||||
if dl in remind_days:
|
||||
msg = f"⏰ *到期提醒*\n\n{v['name']} ({v['provider']})\n📅 {v['date']} (还剩 {dl} 天)"
|
||||
await ctx.bot.send_message(ADMIN, msg, parse_mode="Markdown")
|
||||
|
||||
def main():
|
||||
app = Application.builder().token(TOKEN).build()
|
||||
app.add_handler(CommandHandler("start", start))
|
||||
app.add_handler(CommandHandler("help", start))
|
||||
app.add_handler(CallbackQueryHandler(button))
|
||||
app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_msg))
|
||||
app.job_queue.run_daily(check_expire, time=datetime.strptime("09:00", "%H:%M").time())
|
||||
print("Bot 启动")
|
||||
app.run_polling(drop_pending_updates=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
90
projects/gitea/gitea-backup/vps-reminder/data.json
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"vps": [
|
||||
{
|
||||
"name": "US灵车",
|
||||
"provider": "灵车",
|
||||
"ip": "155.103.67.87",
|
||||
"cycle": "monthly",
|
||||
"date": "2026-03-01",
|
||||
"price": "20cny"
|
||||
},
|
||||
{
|
||||
"name": "HKCO",
|
||||
"provider": "RFC",
|
||||
"ip": "199.15.77.51",
|
||||
"cycle": "月",
|
||||
"date": "2026-03-18",
|
||||
"price": "11"
|
||||
},
|
||||
{
|
||||
"name": "JPSTD",
|
||||
"provider": "Sharon",
|
||||
"ip": "157.254.198.103",
|
||||
"cycle": "monthly",
|
||||
"date": "2026-03-03",
|
||||
"price": "5U"
|
||||
},
|
||||
{
|
||||
"name": "HKG-STD-1120",
|
||||
"provider": "Sharon",
|
||||
"ip": "157.254.32.201",
|
||||
"cycle": "monthly",
|
||||
"date": "2026-03-18",
|
||||
"price": "10U"
|
||||
},
|
||||
{
|
||||
"name": "TW-STD-1120",
|
||||
"provider": "Sharon",
|
||||
"ip": "188.64.110.21",
|
||||
"cycle": "monthly",
|
||||
"date": "2026-03-01",
|
||||
"price": "10U"
|
||||
},
|
||||
{
|
||||
"name": "HKG-PRE-2230",
|
||||
"provider": "Sharon",
|
||||
"ip": "157.254.53.55",
|
||||
"cycle": "monthly",
|
||||
"date": "2026-03-09",
|
||||
"price": "10U"
|
||||
},
|
||||
{
|
||||
"name": "HKG.Turin",
|
||||
"provider": "GoMaMi",
|
||||
"ip": "103.73.220.84",
|
||||
"cycle": "月",
|
||||
"date": "2026-03-11",
|
||||
"price": "50.15U"
|
||||
},
|
||||
{
|
||||
"name": "JP",
|
||||
"provider": "Halo",
|
||||
"ip": "178.253.245.179",
|
||||
"cycle": "月",
|
||||
"date": "2026-03-11",
|
||||
"price": "5Cny"
|
||||
},
|
||||
{
|
||||
"name": "OVH-KS2",
|
||||
"provider": "OVH",
|
||||
"ip": "145.239.143.92",
|
||||
"cycle": "2026-03-01",
|
||||
"date": "2026-03-01",
|
||||
"price": "18o"
|
||||
},
|
||||
{
|
||||
"name": "CTC",
|
||||
"provider": "RFC",
|
||||
"ip": "104.251.236.249",
|
||||
"cycle": "月",
|
||||
"date": "2026-03-18",
|
||||
"price": "3U"
|
||||
}
|
||||
],
|
||||
"remind_days": [
|
||||
7,
|
||||
3,
|
||||
1
|
||||
],
|
||||
"monitors": []
|
||||
}
|
||||
1
projects/gitea/gitea-backup/vps-snapshot
Submodule
146
projects/news-bot/README.md
Normal file
@@ -0,0 +1,146 @@
|
||||
# 📰 财经快讯 Telegram 机器人
|
||||
|
||||
自动抓取金十、华尔街见闻、36氪、新浪财经快讯,AI 评分过滤,推送到 Telegram。
|
||||
|
||||
---
|
||||
|
||||
## 功能特性
|
||||
|
||||
- 🔴 **重磅即时推送** — 评分 ≥8 立即发送
|
||||
- 🟡 **普通汇总推送** — 评分 6-7,每 N 分钟汇总一条
|
||||
- 📊 **定时总结** — 08:00 / 11:30 / 20:00 三次 AI 总结
|
||||
- 🔑 **关键词过滤** — 自定义关注词,精准推送
|
||||
- 📡 **多源管理** — 一键开关各信息源
|
||||
- ⚙️ **灵活设置** — 推送阈值、汇总频率均可调节
|
||||
- 🔄 **去重** — 标题相似度 >70% 自动合并
|
||||
|
||||
---
|
||||
|
||||
## 环境变量
|
||||
|
||||
| 变量 | 说明 | 必填 |
|
||||
|------|------|------|
|
||||
| `BOT_TOKEN` | Telegram Bot Token(从 @BotFather 获取) | ✅ |
|
||||
| `ADMIN_ID` | 管理员 Telegram 用户 ID | ❌(默认 165067365) |
|
||||
| `DATA_DIR` | 数据目录 | ❌(默认 `/opt/news-bot/data`) |
|
||||
|
||||
---
|
||||
|
||||
## 快速部署
|
||||
|
||||
### 方法一:直接运行
|
||||
|
||||
```bash
|
||||
# 1. 进入项目目录
|
||||
cd /path/to/news-bot
|
||||
|
||||
# 2. 安装依赖
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
# 3. 创建数据目录
|
||||
mkdir -p /opt/news-bot/data
|
||||
|
||||
# 4. 启动
|
||||
export BOT_TOKEN="your_bot_token_here"
|
||||
export ADMIN_ID="165067365"
|
||||
python3 bot.py
|
||||
```
|
||||
|
||||
### 方法二:systemd 服务(Linux)
|
||||
|
||||
```ini
|
||||
# /etc/systemd/system/news-bot.service
|
||||
[Unit]
|
||||
Description=Telegram 财经快讯机器人
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/news-bot
|
||||
ExecStart=/usr/bin/python3 /opt/news-bot/bot.py
|
||||
Environment=BOT_TOKEN=your_bot_token_here
|
||||
Environment=ADMIN_ID=165067365
|
||||
Environment=DATA_DIR=/opt/news-bot/data
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable news-bot
|
||||
sudo systemctl start news-bot
|
||||
sudo systemctl status news-bot
|
||||
```
|
||||
|
||||
### 方法三:部署到服务器(38.76.204.161)
|
||||
|
||||
```bash
|
||||
# 上传文件
|
||||
scp -r news-bot/ root@38.76.204.161:/opt/news-bot/
|
||||
|
||||
# SSH 登录
|
||||
ssh root@38.76.204.161
|
||||
|
||||
# 安装依赖
|
||||
pip3 install -r /opt/news-bot/requirements.txt
|
||||
|
||||
# 创建数据目录
|
||||
mkdir -p /opt/news-bot/data
|
||||
|
||||
# 配置 systemd(见上方),然后启动
|
||||
systemctl start news-bot
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 文件结构
|
||||
|
||||
```
|
||||
news-bot/
|
||||
├── bot.py # 主入口:Telegram bot + 调度器
|
||||
├── sources.py # 信息源抓取(金十/华尔街/36氪/新浪)
|
||||
├── scorer.py # 评分引擎 + 去重
|
||||
├── storage.py # JSON 数据持久化
|
||||
├── summarizer.py # 新闻总结生成
|
||||
├── requirements.txt
|
||||
├── README.md
|
||||
└── data/ # 运行时数据(settings.json / news.json / pushed.json)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 命令菜单
|
||||
|
||||
| 命令 | 功能 |
|
||||
|------|------|
|
||||
| `/start` | 欢迎页 + 主菜单按钮 |
|
||||
| `/news` | 最新快讯(分页浏览) |
|
||||
| `/summary` | 手动触发总结 |
|
||||
| `/sources` | 订阅源开关管理 |
|
||||
| `/keywords` | 关键词添加/删除 |
|
||||
| `/settings` | 推送阈值/频率设置 |
|
||||
|
||||
---
|
||||
|
||||
## 评分规则
|
||||
|
||||
| 分数 | 含义 | 处理 |
|
||||
|------|------|------|
|
||||
| ≥ 8 | 重磅/突发 | 🔥 即时推送 |
|
||||
| 6–7 | 值得关注 | 🟡 汇总推送 |
|
||||
| < 6 | 普通资讯 | ❌ 不推送 |
|
||||
|
||||
评分依据:关键词权重 + 来源重要性标记 + 规则引擎(无需外部 AI API)。
|
||||
|
||||
---
|
||||
|
||||
## 数据文件说明
|
||||
|
||||
- `data/settings.json` — 用户配置(关键词、源开关、阈值)
|
||||
- `data/news.json` — 新闻历史(最近 2000 条)
|
||||
- `data/pushed.json` — 已推送 ID 集合(防重复,最近 5000 条)
|
||||
776
projects/news-bot/bot.py
Normal file
@@ -0,0 +1,776 @@
|
||||
"""
|
||||
Telegram 财经快讯机器人 - 主入口
|
||||
功能:自动抓取财经/科技快讯,AI 评分过滤,推送到 Telegram
|
||||
"""
|
||||
import os
|
||||
import time
|
||||
import logging
|
||||
import asyncio
|
||||
from datetime import datetime
|
||||
|
||||
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from telegram.ext import (
|
||||
Application, CommandHandler, CallbackQueryHandler,
|
||||
ContextTypes, MessageHandler, filters,
|
||||
)
|
||||
from telegram.constants import ParseMode
|
||||
|
||||
import sources
|
||||
import scorer
|
||||
import storage
|
||||
import summarizer
|
||||
|
||||
# 日志配置
|
||||
logging.basicConfig(
|
||||
format="%(asctime)s [%(name)s] %(levelname)s: %(message)s",
|
||||
level=logging.INFO,
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 配置
|
||||
BOT_TOKEN = os.environ.get("BOT_TOKEN", "")
|
||||
ADMIN_ID = int(os.environ.get("ADMIN_ID", "165067365"))
|
||||
|
||||
# 分页状态缓存
|
||||
_page_cache = {}
|
||||
|
||||
|
||||
# ========== 工具函数 ==========
|
||||
|
||||
def _check_admin(user_id: int) -> bool:
|
||||
"""检查是否为管理员"""
|
||||
return user_id == ADMIN_ID
|
||||
|
||||
|
||||
def _format_news_item(item: dict) -> str:
|
||||
"""格式化单条新闻(支持 HTML 链接)"""
|
||||
score = item.get("score", 0)
|
||||
if score >= 9:
|
||||
emoji = "🔥"
|
||||
elif score >= 8:
|
||||
emoji = "⚡"
|
||||
elif score >= 7:
|
||||
emoji = "📌"
|
||||
elif score >= 6:
|
||||
emoji = "🔹"
|
||||
else:
|
||||
emoji = "•"
|
||||
src = item.get("source_name", "")
|
||||
ts = item.get("time_str", "")
|
||||
title = item.get("title", "")
|
||||
url = item.get("url", "")
|
||||
# 转义 HTML 特殊字符
|
||||
import html as html_mod
|
||||
title_safe = html_mod.escape(title)
|
||||
if url:
|
||||
title_display = f'<a href="{url}">{title_safe}</a>'
|
||||
else:
|
||||
title_display = title_safe
|
||||
return f"{emoji} {title_display}\n 📡 {src} 🕐 {ts} 评分:{score}"
|
||||
|
||||
|
||||
# ========== /start 命令 ==========
|
||||
|
||||
async def cmd_start(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""欢迎消息 + 主菜单"""
|
||||
if not _check_admin(update.effective_user.id):
|
||||
await update.message.reply_text("⛔ 仅限管理员使用")
|
||||
return
|
||||
|
||||
keyboard = [
|
||||
[InlineKeyboardButton("📰 最新快讯", callback_data="news_0"),
|
||||
InlineKeyboardButton("📊 新闻总结", callback_data="summary_menu")],
|
||||
[InlineKeyboardButton("📡 订阅源管理", callback_data="sources_menu"),
|
||||
InlineKeyboardButton("🔑 关键词管理", callback_data="keywords_menu")],
|
||||
[InlineKeyboardButton("⚙️ 设置", callback_data="settings_menu")],
|
||||
]
|
||||
text = (
|
||||
"👋 <b>欢迎使用财经快讯机器人</b>\n\n"
|
||||
"🤖 自动抓取金十、华尔街见闻、36氪、新浪财经快讯\n"
|
||||
"📊 AI 评分过滤,只推送相关内容\n"
|
||||
"⏰ 定时总结,不错过重要新闻\n\n"
|
||||
"请选择功能:"
|
||||
)
|
||||
await update.message.reply_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
|
||||
|
||||
# ========== /news 命令 ==========
|
||||
|
||||
async def cmd_news(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""查看最新快讯"""
|
||||
if not _check_admin(update.effective_user.id):
|
||||
return
|
||||
await _show_news_page(update.message, 0)
|
||||
|
||||
|
||||
async def _show_news_page(message_or_query, page: int):
|
||||
"""显示新闻分页"""
|
||||
settings = storage.get_settings()
|
||||
news_list = storage.get_news(limit=100)
|
||||
|
||||
# 评分
|
||||
scorer.score_and_filter(news_list, settings.get("keywords", []))
|
||||
# 只显示评分 >= 4 的
|
||||
news_list = [n for n in news_list if n.get("score", 0) >= 4]
|
||||
news_list.sort(key=lambda x: x.get("timestamp", 0), reverse=True)
|
||||
|
||||
page_size = 10
|
||||
total_pages = max(1, (len(news_list) + page_size - 1) // page_size)
|
||||
page = max(0, min(page, total_pages - 1))
|
||||
start = page * page_size
|
||||
page_items = news_list[start:start + page_size]
|
||||
|
||||
if not page_items:
|
||||
text = "📭 暂无快讯,等待抓取中..."
|
||||
else:
|
||||
lines = [f"📰 <b>最新快讯</b> (第{page+1}/{total_pages}页)\n"]
|
||||
for item in page_items:
|
||||
lines.append(_format_news_item(item))
|
||||
text = "\n".join(lines)
|
||||
|
||||
# 分页按钮
|
||||
buttons = []
|
||||
if page > 0:
|
||||
buttons.append(InlineKeyboardButton("⬅️ 上一页", callback_data=f"news_{page-1}"))
|
||||
buttons.append(InlineKeyboardButton("🔄 刷新", callback_data=f"news_{page}"))
|
||||
if page < total_pages - 1:
|
||||
buttons.append(InlineKeyboardButton("➡️ 下一页", callback_data=f"news_{page+1}"))
|
||||
keyboard = [buttons, [InlineKeyboardButton("🏠 主菜单", callback_data="main_menu")]]
|
||||
|
||||
if hasattr(message_or_query, "edit_message_text"):
|
||||
try:
|
||||
await message_or_query.edit_message_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
except Exception:
|
||||
await message_or_query.edit_message_text(
|
||||
text, reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
else:
|
||||
await message_or_query.reply_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
|
||||
|
||||
# ========== /summary 命令 ==========
|
||||
|
||||
async def cmd_summary(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""手动触发新闻总结"""
|
||||
if not _check_admin(update.effective_user.id):
|
||||
return
|
||||
await _show_summary_menu(update.message)
|
||||
|
||||
|
||||
async def _show_summary_menu(message_or_query):
|
||||
"""显示总结时间范围选择"""
|
||||
keyboard = [
|
||||
[InlineKeyboardButton("⏱ 最近1小时", callback_data="summary_最近1小时")],
|
||||
[InlineKeyboardButton("🌅 上午", callback_data="summary_上午")],
|
||||
[InlineKeyboardButton("📅 全天", callback_data="summary_全天")],
|
||||
[InlineKeyboardButton("🏠 主菜单", callback_data="main_menu")],
|
||||
]
|
||||
text = "📊 <b>新闻总结</b>\n\n请选择时间范围:"
|
||||
if hasattr(message_or_query, "edit_message_text"):
|
||||
await message_or_query.edit_message_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
else:
|
||||
await message_or_query.reply_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
|
||||
|
||||
# ========== /sources 命令 ==========
|
||||
|
||||
async def cmd_sources(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""查看/管理订阅源"""
|
||||
if not _check_admin(update.effective_user.id):
|
||||
return
|
||||
await _show_sources_menu(update.message)
|
||||
|
||||
|
||||
async def _show_sources_menu(message_or_query):
|
||||
"""显示订阅源管理菜单"""
|
||||
settings = storage.get_settings()
|
||||
srcs = settings.get("sources", {})
|
||||
source_info = {
|
||||
"jin10": "金十数据",
|
||||
"wallstreet": "华尔街见闻",
|
||||
"kr36": "36氪",
|
||||
"sina": "新浪财经",
|
||||
}
|
||||
keyboard = []
|
||||
for key, name in source_info.items():
|
||||
enabled = srcs.get(key, True)
|
||||
status = "✅" if enabled else "❌"
|
||||
keyboard.append([InlineKeyboardButton(
|
||||
f"{status} {name}", callback_data=f"toggle_src_{key}"
|
||||
)])
|
||||
keyboard.append([InlineKeyboardButton("🏠 主菜单", callback_data="main_menu")])
|
||||
text = "📡 <b>订阅源管理</b>\n\n点击切换开/关:"
|
||||
if hasattr(message_or_query, "edit_message_text"):
|
||||
await message_or_query.edit_message_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
else:
|
||||
await message_or_query.reply_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
|
||||
|
||||
# ========== /keywords 命令 ==========
|
||||
|
||||
async def cmd_keywords(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""管理关注关键词"""
|
||||
if not _check_admin(update.effective_user.id):
|
||||
return
|
||||
await _show_keywords_menu(update.message)
|
||||
|
||||
|
||||
async def _show_keywords_menu(message_or_query):
|
||||
"""显示关键词管理菜单"""
|
||||
settings = storage.get_settings()
|
||||
kw_list = settings.get("keywords", [])
|
||||
# 每行显示3个关键词删除按钮
|
||||
keyboard = []
|
||||
row = []
|
||||
for kw in kw_list[:30]:
|
||||
row.append(InlineKeyboardButton(f"❌ {kw}", callback_data=f"del_kw_{kw}"))
|
||||
if len(row) == 3:
|
||||
keyboard.append(row)
|
||||
row = []
|
||||
if row:
|
||||
keyboard.append(row)
|
||||
keyboard.append([InlineKeyboardButton("➕ 添加关键词", callback_data="add_kw_prompt")])
|
||||
keyboard.append([InlineKeyboardButton("🏠 主菜单", callback_data="main_menu")])
|
||||
text = f"🔑 <b>关键词管理</b>\n\n当前 {len(kw_list)} 个关键词\n(点击关键词可删除)"
|
||||
if hasattr(message_or_query, "edit_message_text"):
|
||||
await message_or_query.edit_message_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
else:
|
||||
await message_or_query.reply_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
|
||||
|
||||
# ========== /settings 命令 ==========
|
||||
|
||||
async def cmd_settings(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""设置菜单"""
|
||||
if not _check_admin(update.effective_user.id):
|
||||
return
|
||||
await _show_settings_menu(update.message)
|
||||
|
||||
|
||||
async def _show_settings_menu(message_or_query):
|
||||
"""显示设置菜单"""
|
||||
settings = storage.get_settings()
|
||||
push_on = settings.get("push_enabled", True)
|
||||
min_score = settings.get("min_score", 6)
|
||||
instant_score = settings.get("instant_score", 8)
|
||||
interval = settings.get("batch_interval", 30)
|
||||
|
||||
push_txt = "✅ 推送已开" if push_on else "❌ 推送已关"
|
||||
keyboard = [
|
||||
[InlineKeyboardButton(push_txt, callback_data="toggle_push")],
|
||||
[
|
||||
InlineKeyboardButton(f"最低评分: {min_score} ➖", callback_data="score_min_down"),
|
||||
InlineKeyboardButton(f"最低评分: {min_score} ➕", callback_data="score_min_up"),
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(f"即时阈值: {instant_score} ➖", callback_data="score_instant_down"),
|
||||
InlineKeyboardButton(f"即时阈值: {instant_score} ➕", callback_data="score_instant_up"),
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(f"汇总间隔: {interval}min ➖", callback_data="interval_down"),
|
||||
InlineKeyboardButton(f"汇总间隔: {interval}min ➕", callback_data="interval_up"),
|
||||
],
|
||||
[InlineKeyboardButton("🏠 主菜单", callback_data="main_menu")],
|
||||
]
|
||||
text = (
|
||||
f"⚙️ <b>设置</b>\n\n"
|
||||
f"推送状态: {'开启' if push_on else '关闭'}\n"
|
||||
f"最低推送评分: {min_score}\n"
|
||||
f"即时推送阈值: {instant_score}\n"
|
||||
f"汇总推送间隔: {interval} 分钟"
|
||||
)
|
||||
if hasattr(message_or_query, "edit_message_text"):
|
||||
await message_or_query.edit_message_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
else:
|
||||
await message_or_query.reply_text(
|
||||
text, parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
|
||||
|
||||
# ========== CallbackQuery 处理器 ==========
|
||||
|
||||
# 等待用户输入关键词的状态
|
||||
_waiting_kw_add = set()
|
||||
|
||||
|
||||
async def handle_callback(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""统一处理所有按钮回调"""
|
||||
query = update.callback_query
|
||||
await query.answer()
|
||||
data = query.data
|
||||
user_id = query.from_user.id
|
||||
|
||||
if not _check_admin(user_id):
|
||||
return
|
||||
|
||||
# ---------- 主菜单 ----------
|
||||
if data == "main_menu":
|
||||
keyboard = [
|
||||
[InlineKeyboardButton("📰 最新快讯", callback_data="news_0"),
|
||||
InlineKeyboardButton("📊 新闻总结", callback_data="summary_menu")],
|
||||
[InlineKeyboardButton("📡 订阅源管理", callback_data="sources_menu"),
|
||||
InlineKeyboardButton("🔑 关键词管理", callback_data="keywords_menu")],
|
||||
[InlineKeyboardButton("⚙️ 设置", callback_data="settings_menu")],
|
||||
]
|
||||
await query.edit_message_text(
|
||||
"🏠 <b>主菜单</b>\n\n请选择功能:",
|
||||
parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup(keyboard),
|
||||
)
|
||||
|
||||
# ---------- 新闻分页 ----------
|
||||
elif data.startswith("news_"):
|
||||
page = int(data.split("_", 1)[1])
|
||||
await _show_news_page(query, page)
|
||||
|
||||
# ---------- 总结菜单 ----------
|
||||
elif data == "summary_menu":
|
||||
await _show_summary_menu(query)
|
||||
|
||||
elif data.startswith("summary_"):
|
||||
period = data[len("summary_"):]
|
||||
start_ts, end_ts = summarizer.get_period_range(period)
|
||||
settings = storage.get_settings()
|
||||
news_list = storage.get_news(limit=500, since_ts=start_ts)
|
||||
news_list = [n for n in news_list if n.get("timestamp", 0) <= end_ts]
|
||||
scorer.score_and_filter(news_list, settings.get("keywords", []))
|
||||
news_list = [n for n in news_list if n.get("score", 0) >= settings.get("min_score", 6)]
|
||||
text = summarizer.generate_summary(news_list, period)
|
||||
back_btn = InlineKeyboardMarkup([[
|
||||
InlineKeyboardButton("🔙 返回", callback_data="summary_menu"),
|
||||
InlineKeyboardButton("🏠 主菜单", callback_data="main_menu"),
|
||||
]])
|
||||
try:
|
||||
await query.edit_message_text(text, parse_mode=ParseMode.HTML, reply_markup=back_btn)
|
||||
except Exception:
|
||||
await query.edit_message_text(text, reply_markup=back_btn)
|
||||
|
||||
# ---------- 订阅源 ----------
|
||||
elif data == "sources_menu":
|
||||
await _show_sources_menu(query)
|
||||
|
||||
elif data.startswith("toggle_src_"):
|
||||
src = data[len("toggle_src_"):]
|
||||
new_state = storage.toggle_source(src)
|
||||
state_txt = "开启" if new_state else "关闭"
|
||||
await query.answer(f"已{state_txt} {sources.SOURCE_NAMES.get(src, src)}", show_alert=False)
|
||||
await _show_sources_menu(query)
|
||||
|
||||
# ---------- 关键词 ----------
|
||||
elif data == "keywords_menu":
|
||||
await _show_keywords_menu(query)
|
||||
|
||||
elif data.startswith("del_kw_"):
|
||||
kw = data[len("del_kw_"):]
|
||||
storage.remove_keyword(kw)
|
||||
await query.answer(f"已删除关键词: {kw}", show_alert=False)
|
||||
await _show_keywords_menu(query)
|
||||
|
||||
elif data == "add_kw_prompt":
|
||||
_waiting_kw_add.add(user_id)
|
||||
await query.edit_message_text(
|
||||
"🔑 <b>添加关键词</b>\n\n请直接发送关键词文字(可空格分隔多个):",
|
||||
parse_mode=ParseMode.HTML,
|
||||
reply_markup=InlineKeyboardMarkup([[
|
||||
InlineKeyboardButton("取消", callback_data="keywords_menu")
|
||||
]]),
|
||||
)
|
||||
|
||||
# ---------- 设置 ----------
|
||||
elif data == "settings_menu":
|
||||
await _show_settings_menu(query)
|
||||
|
||||
elif data == "toggle_push":
|
||||
settings = storage.get_settings()
|
||||
storage.update_settings({"push_enabled": not settings.get("push_enabled", True)})
|
||||
await _show_settings_menu(query)
|
||||
|
||||
elif data == "score_min_up":
|
||||
s = storage.get_settings()
|
||||
storage.update_settings({"min_score": min(10, s.get("min_score", 6) + 1)})
|
||||
await _show_settings_menu(query)
|
||||
|
||||
elif data == "score_min_down":
|
||||
s = storage.get_settings()
|
||||
storage.update_settings({"min_score": max(1, s.get("min_score", 6) - 1)})
|
||||
await _show_settings_menu(query)
|
||||
|
||||
elif data == "score_instant_up":
|
||||
s = storage.get_settings()
|
||||
storage.update_settings({"instant_score": min(10, s.get("instant_score", 8) + 1)})
|
||||
await _show_settings_menu(query)
|
||||
|
||||
elif data == "score_instant_down":
|
||||
s = storage.get_settings()
|
||||
storage.update_settings({"instant_score": max(1, s.get("instant_score", 8) - 1)})
|
||||
await _show_settings_menu(query)
|
||||
|
||||
elif data == "interval_up":
|
||||
s = storage.get_settings()
|
||||
storage.update_settings({"batch_interval": min(120, s.get("batch_interval", 30) + 5)})
|
||||
await _show_settings_menu(query)
|
||||
|
||||
elif data == "interval_down":
|
||||
s = storage.get_settings()
|
||||
storage.update_settings({"batch_interval": max(5, s.get("batch_interval", 30) - 5)})
|
||||
await _show_settings_menu(query)
|
||||
|
||||
|
||||
async def handle_text(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""处理普通文本消息(用于添加关键词)"""
|
||||
user_id = update.effective_user.id
|
||||
if not _check_admin(user_id):
|
||||
return
|
||||
if user_id not in _waiting_kw_add:
|
||||
return
|
||||
_waiting_kw_add.discard(user_id)
|
||||
text = update.message.text.strip()
|
||||
added = []
|
||||
for kw in text.split():
|
||||
if storage.add_keyword(kw):
|
||||
added.append(kw)
|
||||
if added:
|
||||
await update.message.reply_text(
|
||||
f"✅ 已添加关键词: {', '.join(added)}",
|
||||
reply_markup=InlineKeyboardMarkup([[
|
||||
InlineKeyboardButton("🔑 关键词管理", callback_data="keywords_menu")
|
||||
]]),
|
||||
)
|
||||
else:
|
||||
await update.message.reply_text("⚠️ 关键词已存在或无效")
|
||||
|
||||
|
||||
# ========== 后台抓取任务 ==========
|
||||
|
||||
# 汇总队列(评分6-7的新闻暂存)
|
||||
_batch_queue: list = []
|
||||
_last_batch_push: float = 0.0
|
||||
_pushed_in_memory: set = set() # 内存去重,防止并发重复推送
|
||||
|
||||
|
||||
async def _fetch_and_process(app: Application):
|
||||
"""核心抓取+处理循环"""
|
||||
settings = storage.get_settings()
|
||||
enabled = settings.get("sources", {})
|
||||
push_on = settings.get("push_enabled", True)
|
||||
min_score = settings.get("min_score", 6)
|
||||
instant_score = settings.get("instant_score", 8)
|
||||
|
||||
logger.info("开始抓取新闻...")
|
||||
try:
|
||||
all_news = await sources.fetch_all(enabled)
|
||||
except Exception as e:
|
||||
logger.error(f"fetch_all 异常: {e}")
|
||||
return
|
||||
|
||||
if not all_news:
|
||||
return
|
||||
|
||||
# 评分
|
||||
scorer.score_and_filter(all_news, settings.get("keywords", []))
|
||||
|
||||
# 去重(全局标题去重)
|
||||
all_news = scorer.dedup_news(all_news)
|
||||
|
||||
# 过滤已推送(内存+文件双重去重)
|
||||
pushed_ids = storage.get_pushed_ids() | _pushed_in_memory
|
||||
new_items = [n for n in all_news if n["id"] not in pushed_ids and n.get("score", 0) >= min_score]
|
||||
|
||||
if not new_items:
|
||||
return
|
||||
|
||||
# 保存到存储
|
||||
storage.save_news(new_items)
|
||||
|
||||
if not push_on:
|
||||
return
|
||||
|
||||
instant_items = [n for n in new_items if n.get("score", 0) >= instant_score]
|
||||
batch_items = [n for n in new_items if min_score <= n.get("score", 0) < instant_score]
|
||||
|
||||
# 即时推送
|
||||
for item in instant_items:
|
||||
await _push_instant(app, item)
|
||||
|
||||
# 加入汇总队列(去重)
|
||||
existing_ids = {n["id"] for n in _batch_queue}
|
||||
for item in batch_items:
|
||||
if item["id"] not in existing_ids:
|
||||
_batch_queue.append(item)
|
||||
existing_ids.add(item["id"])
|
||||
|
||||
# 标记已推送(即时+批量都标记,防止重复)
|
||||
pushed = [n["id"] for n in instant_items + batch_items]
|
||||
_pushed_in_memory.update(pushed)
|
||||
storage.mark_pushed(pushed)
|
||||
|
||||
|
||||
async def _push_instant(app: Application, item: dict):
|
||||
"""立即推送单条重磅新闻"""
|
||||
score = item.get("score", 0)
|
||||
if score >= 9:
|
||||
emoji = "🔥🔥🔥"
|
||||
elif score >= 8:
|
||||
emoji = "⚡ 重磅"
|
||||
else:
|
||||
emoji = "📌"
|
||||
src = item.get("source_name", "")
|
||||
title = item.get("title", "")
|
||||
ts = item.get("time_str", "")
|
||||
url = item.get("url", "")
|
||||
import html as html_mod
|
||||
title_safe = html_mod.escape(title)
|
||||
if url:
|
||||
title_display = f'<a href="{url}">{title_safe}</a>'
|
||||
else:
|
||||
title_display = f"<b>{title_safe}</b>"
|
||||
text = f"{emoji}\n\n{title_display}\n\n📡 {src} 🕐 {ts} 评分:{score}"
|
||||
try:
|
||||
await app.bot.send_message(
|
||||
chat_id=ADMIN_ID, text=text, parse_mode=ParseMode.HTML,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"即时推送失败: {e}")
|
||||
try:
|
||||
await app.bot.send_message(chat_id=ADMIN_ID, text=f"{emoji}\n\n{title}\n\n{src} {ts}")
|
||||
except Exception as e2:
|
||||
logger.error(f"即时推送备用失败: {e2}")
|
||||
|
||||
|
||||
async def _push_batch(app: Application):
|
||||
"""汇总推送(每N分钟一次)"""
|
||||
global _batch_queue, _last_batch_push
|
||||
if not _batch_queue:
|
||||
return
|
||||
|
||||
settings = storage.get_settings()
|
||||
interval = settings.get("batch_interval", 30) * 60
|
||||
now = time.time()
|
||||
if now - _last_batch_push < interval:
|
||||
return
|
||||
|
||||
items = _batch_queue[:]
|
||||
_batch_queue.clear()
|
||||
_last_batch_push = now
|
||||
|
||||
# 标记已推送
|
||||
storage.mark_pushed([n["id"] for n in items])
|
||||
|
||||
if not items:
|
||||
return
|
||||
|
||||
import html as html_mod
|
||||
from collections import defaultdict
|
||||
|
||||
# 按来源分组
|
||||
source_map = defaultdict(list)
|
||||
for item in sorted(items, key=lambda x: x.get("score", 0), reverse=True):
|
||||
src = item.get("source_name", "未知")
|
||||
source_map[src].append(item)
|
||||
|
||||
source_emoji = {
|
||||
"金十数据": "💰", "华尔街见闻": "📈", "36氪": "🚀",
|
||||
"新浪财经": "📊", "Google News": "🌐",
|
||||
"Finviz": "📉", "TechCrunch": "💻",
|
||||
}
|
||||
|
||||
lines = [f"🟡 <b>快讯汇总</b>({len(items)}条)"]
|
||||
lines.append("")
|
||||
for src, src_items in source_map.items():
|
||||
emoji = source_emoji.get(src, "📰")
|
||||
lines.append(f"{emoji} <b>{src}</b>({len(src_items)})")
|
||||
for item in src_items[:10]:
|
||||
title = item.get("title", "")
|
||||
url = item.get("url", "")
|
||||
title_safe = html_mod.escape(title)
|
||||
if url:
|
||||
lines.append(f" • <a href=\"{url}\">{title_safe}</a>")
|
||||
else:
|
||||
lines.append(f" • {title_safe}")
|
||||
if len(src_items) > 10:
|
||||
lines.append(f" ... 还有{len(src_items) - 10}条")
|
||||
lines.append("")
|
||||
|
||||
lines.append(f"⏰ {datetime.now().strftime('%H:%M')}")
|
||||
|
||||
text = "\n".join(lines)
|
||||
try:
|
||||
await app.bot.send_message(
|
||||
chat_id=ADMIN_ID, text=text, parse_mode=ParseMode.HTML,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"汇总推送失败: {e}")
|
||||
try:
|
||||
await app.bot.send_message(chat_id=ADMIN_ID, text="\n".join(lines[:15]))
|
||||
except Exception as e2:
|
||||
logger.error(f"汇总推送备用失败: {e2}")
|
||||
|
||||
|
||||
async def _send_scheduled_summary(app: Application, period: str):
|
||||
"""发送定时总结"""
|
||||
settings = storage.get_settings()
|
||||
start_ts, end_ts = summarizer.get_period_range(period)
|
||||
news_list = storage.get_news(limit=500, since_ts=start_ts)
|
||||
news_list = [n for n in news_list if n.get("timestamp", 0) <= end_ts]
|
||||
scorer.score_and_filter(news_list, settings.get("keywords", []))
|
||||
news_list = [n for n in news_list if n.get("score", 0) >= settings.get("min_score", 6)]
|
||||
text = summarizer.generate_summary(news_list, period)
|
||||
try:
|
||||
await app.bot.send_message(
|
||||
chat_id=ADMIN_ID, text=text, parse_mode=ParseMode.HTML,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"定时总结推送失败: {e}")
|
||||
try:
|
||||
await app.bot.send_message(chat_id=ADMIN_ID, text=text)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
# ========== 调度器 ==========
|
||||
|
||||
class Scheduler:
|
||||
"""轻量调度器,基于 asyncio"""
|
||||
|
||||
def __init__(self, app: Application):
|
||||
self.app = app
|
||||
self._tasks: list[asyncio.Task] = []
|
||||
|
||||
def start(self):
|
||||
self._tasks.append(asyncio.create_task(self._fast_loop()))
|
||||
self._tasks.append(asyncio.create_task(self._slow_loop()))
|
||||
self._tasks.append(asyncio.create_task(self._batch_loop()))
|
||||
self._tasks.append(asyncio.create_task(self._summary_loop()))
|
||||
logger.info("调度器已启动")
|
||||
|
||||
async def _fast_loop(self):
|
||||
"""金十/华尔街见闻 每2分钟抓取"""
|
||||
while True:
|
||||
try:
|
||||
await _fetch_and_process(self.app)
|
||||
except Exception as e:
|
||||
logger.error(f"fast_loop 异常: {e}")
|
||||
await asyncio.sleep(120)
|
||||
|
||||
async def _slow_loop(self):
|
||||
"""36氪/新浪 每5分钟额外触发(fast_loop已包含全部,这里可扩展)"""
|
||||
await asyncio.sleep(60) # 错开启动时间
|
||||
while True:
|
||||
try:
|
||||
await _fetch_and_process(self.app)
|
||||
except Exception as e:
|
||||
logger.error(f"slow_loop 异常: {e}")
|
||||
await asyncio.sleep(300)
|
||||
|
||||
async def _batch_loop(self):
|
||||
"""每分钟检查是否需要汇总推送"""
|
||||
await asyncio.sleep(30)
|
||||
while True:
|
||||
try:
|
||||
await _push_batch(self.app)
|
||||
except Exception as e:
|
||||
logger.error(f"batch_loop 异常: {e}")
|
||||
await asyncio.sleep(60)
|
||||
|
||||
async def _summary_loop(self):
|
||||
"""定时总结 08:00 / 11:30 / 20:00"""
|
||||
schedule = [
|
||||
(8, 0, "昨晚到今早"),
|
||||
(11, 30, "上午"),
|
||||
(20, 0, "全天"),
|
||||
]
|
||||
triggered = set()
|
||||
while True:
|
||||
now = datetime.now()
|
||||
key = f"{now.date()}"
|
||||
for hour, minute, period in schedule:
|
||||
tid = f"{key}_{hour}_{minute}"
|
||||
if tid not in triggered:
|
||||
# 在目标时间 ±2 分钟内触发
|
||||
target = now.replace(hour=hour, minute=minute, second=0)
|
||||
diff = abs((now - target).total_seconds())
|
||||
if diff <= 120:
|
||||
triggered.add(tid)
|
||||
try:
|
||||
await _send_scheduled_summary(self.app, period)
|
||||
except Exception as e:
|
||||
logger.error(f"定时总结异常: {e}")
|
||||
# 每分钟检查一次
|
||||
await asyncio.sleep(60)
|
||||
|
||||
def stop(self):
|
||||
for t in self._tasks:
|
||||
t.cancel()
|
||||
|
||||
|
||||
# ========== 主函数 ==========
|
||||
|
||||
def main():
|
||||
if not BOT_TOKEN:
|
||||
logger.error("请设置 BOT_TOKEN 环境变量")
|
||||
return
|
||||
|
||||
logger.info(f"机器人启动,ADMIN_ID={ADMIN_ID}")
|
||||
|
||||
app = Application.builder().token(BOT_TOKEN).build()
|
||||
|
||||
# 注册命令
|
||||
app.add_handler(CommandHandler("start", cmd_start))
|
||||
app.add_handler(CommandHandler("news", cmd_news))
|
||||
app.add_handler(CommandHandler("summary", cmd_summary))
|
||||
app.add_handler(CommandHandler("sources", cmd_sources))
|
||||
app.add_handler(CommandHandler("keywords", cmd_keywords))
|
||||
app.add_handler(CommandHandler("settings", cmd_settings))
|
||||
|
||||
# 注册回调
|
||||
app.add_handler(CallbackQueryHandler(handle_callback))
|
||||
|
||||
# 注册文本消息(用于添加关键词)
|
||||
app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_text))
|
||||
|
||||
# 启动调度器(在 post_init 中启动,确保 event loop 已就绪)
|
||||
scheduler = Scheduler(app)
|
||||
|
||||
async def post_init(application: Application):
|
||||
scheduler.start()
|
||||
logger.info("调度器已在 post_init 中启动")
|
||||
|
||||
app.post_init = post_init
|
||||
|
||||
logger.info("开始 polling...")
|
||||
app.run_polling(drop_pending_updates=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
3
projects/news-bot/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
python-telegram-bot==21.3
|
||||
httpx==0.27.0
|
||||
apscheduler==3.10.4
|
||||
122
projects/news-bot/scorer.py
Normal file
@@ -0,0 +1,122 @@
|
||||
"""
|
||||
评分和过滤模块 - 基于关键词权重 + 规则引擎
|
||||
不调用外部 AI API,纯本地规则评分
|
||||
"""
|
||||
import re
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 高权重关键词(出现即加分)
|
||||
HIGH_WEIGHT_KEYWORDS = {
|
||||
# AI / 算力相关
|
||||
"英伟达": 3, "NVIDIA": 3, "AMD": 2, "算力": 2, "AI": 2,
|
||||
"光模块": 2, "存储": 1, "芯片": 2, "GPU": 2, "大模型": 2,
|
||||
"ChatGPT": 2, "OpenAI": 2, "Anthropic": 2, "DeepSeek": 2,
|
||||
# 中国科技公司
|
||||
"华为": 2, "腾讯": 2, "阿里": 2, "字节": 2, "小米": 2,
|
||||
"百度": 1, "京东": 1, "美团": 1, "拼多多": 1, "比亚迪": 2,
|
||||
# 重磅事件
|
||||
"收购": 2, "突破": 2, "泄露": 3, "内幕": 3, "传闻": 2,
|
||||
"重磅": 3, "突发": 3, "暴涨": 2, "暴跌": 2, "崩盘": 3,
|
||||
"熔断": 3, "制裁": 2, "禁令": 2, "封锁": 2,
|
||||
# 股市相关
|
||||
"A股": 1, "港股": 1, "美股": 1, "涨停": 2, "跌停": 2,
|
||||
"IPO": 2, "上市": 1, "退市": 2, "回购": 1,
|
||||
# 宏观
|
||||
"降息": 2, "加息": 2, "美联储": 2, "央行": 1, "GDP": 1,
|
||||
"CPI": 1, "非农": 2, "失业率": 1,
|
||||
}
|
||||
|
||||
# 低价值关键词(出现则减分)
|
||||
LOW_VALUE_PATTERNS = [
|
||||
r"广告", r"推广", r"优惠券", r"免费领",
|
||||
r"点击.*查看", r"扫码", r"关注.*公众号",
|
||||
]
|
||||
|
||||
|
||||
def score_news(news_item: dict, user_keywords: list = None) -> int:
|
||||
"""
|
||||
对单条新闻评分,返回 0-10 分
|
||||
评分规则:
|
||||
- 基础分 3 分
|
||||
- 匹配高权重关键词加分
|
||||
- 匹配用户自定义关键词加分
|
||||
- 信息源标记为重要加分
|
||||
- 匹配低价值模式减分
|
||||
- 最终分数限制在 0-10
|
||||
"""
|
||||
title = news_item.get("title", "")
|
||||
if not title:
|
||||
return 0
|
||||
|
||||
score = 3 # 基础分
|
||||
|
||||
# 1. 高权重关键词匹配
|
||||
for keyword, weight in HIGH_WEIGHT_KEYWORDS.items():
|
||||
if keyword.lower() in title.lower():
|
||||
score += weight
|
||||
|
||||
# 2. 用户自定义关键词匹配
|
||||
if user_keywords:
|
||||
for kw in user_keywords:
|
||||
if kw.lower() in title.lower():
|
||||
score += 1
|
||||
|
||||
# 3. 信息源标记为重要
|
||||
if news_item.get("important"):
|
||||
score += 2
|
||||
|
||||
# 4. 低价值内容减分
|
||||
for pattern in LOW_VALUE_PATTERNS:
|
||||
if re.search(pattern, title):
|
||||
score -= 3
|
||||
|
||||
# 5. 标题太短可能是无效内容
|
||||
if len(title) < 10:
|
||||
score -= 2
|
||||
|
||||
return max(0, min(10, score))
|
||||
|
||||
|
||||
def is_similar(title1: str, title2: str, threshold: float = 0.7) -> bool:
|
||||
"""
|
||||
简单的标题相似度判断
|
||||
使用字符级别的 Jaccard 相似度
|
||||
"""
|
||||
if not title1 or not title2:
|
||||
return False
|
||||
# 去除标点和空格
|
||||
clean1 = re.sub(r"[^\w]", "", title1)
|
||||
clean2 = re.sub(r"[^\w]", "", title2)
|
||||
if not clean1 or not clean2:
|
||||
return False
|
||||
# 2-gram 集合
|
||||
set1 = set(clean1[i:i+2] for i in range(len(clean1)-1))
|
||||
set2 = set(clean2[i:i+2] for i in range(len(clean2)-1))
|
||||
if not set1 or not set2:
|
||||
return clean1 == clean2
|
||||
intersection = set1 & set2
|
||||
union = set1 | set2
|
||||
return len(intersection) / len(union) >= threshold
|
||||
|
||||
|
||||
def dedup_news(news_list: list) -> list:
|
||||
"""去重:基于标题相似度,保留最早的一条"""
|
||||
result = []
|
||||
for item in news_list:
|
||||
is_dup = False
|
||||
for existing in result:
|
||||
if is_similar(item.get("title", ""), existing.get("title", "")):
|
||||
is_dup = True
|
||||
break
|
||||
if not is_dup:
|
||||
result.append(item)
|
||||
return result
|
||||
|
||||
|
||||
def score_and_filter(news_list: list, user_keywords: list = None) -> list:
|
||||
"""批量评分并过滤,返回带评分的新闻列表"""
|
||||
for item in news_list:
|
||||
item["score"] = score_news(item, user_keywords)
|
||||
return news_list
|
||||
374
projects/news-bot/sources.py
Normal file
@@ -0,0 +1,374 @@
|
||||
"""
|
||||
信息源抓取模块 - 支持金十、华尔街见闻、36氪、新浪财经、Google News、Finviz、TechCrunch
|
||||
"""
|
||||
import re
|
||||
import time
|
||||
import hashlib
|
||||
import logging
|
||||
import httpx
|
||||
import xml.etree.ElementTree as ET
|
||||
from datetime import datetime
|
||||
from email.utils import parsedate_to_datetime
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 请求超时设置
|
||||
TIMEOUT = 10
|
||||
|
||||
# 翻译缓存,避免重复翻译
|
||||
_translate_cache = {}
|
||||
|
||||
|
||||
async def translate_to_zh(text: str) -> str:
|
||||
"""用 Google Translate 免费接口将英文翻译为中文"""
|
||||
if not text:
|
||||
return text
|
||||
# 检测是否主要是中文,是则跳过
|
||||
zh_count = sum(1 for c in text if '\u4e00' <= c <= '\u9fff')
|
||||
if zh_count > len(text) * 0.3:
|
||||
return text
|
||||
# 查缓存
|
||||
cache_key = text[:100]
|
||||
if cache_key in _translate_cache:
|
||||
return _translate_cache[cache_key]
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=8) as client:
|
||||
resp = await client.get(
|
||||
"https://translate.googleapis.com/translate_a/single",
|
||||
params={"client": "gtx", "sl": "en", "tl": "zh-CN", "dt": "t", "q": text[:500]},
|
||||
)
|
||||
result = resp.json()
|
||||
translated = "".join(seg[0] for seg in result[0] if seg[0])
|
||||
_translate_cache[cache_key] = translated
|
||||
# 限制缓存大小
|
||||
if len(_translate_cache) > 500:
|
||||
keys = list(_translate_cache.keys())[:200]
|
||||
for k in keys:
|
||||
del _translate_cache[k]
|
||||
return translated
|
||||
except Exception as e:
|
||||
logger.error(f"翻译失败: {e}")
|
||||
return text
|
||||
|
||||
|
||||
def _make_id(source: str, title: str) -> str:
|
||||
"""生成新闻唯一 ID"""
|
||||
raw = f"{source}:{title}"
|
||||
return hashlib.md5(raw.encode()).hexdigest()[:16]
|
||||
|
||||
|
||||
def _safe_ts(val, default=0) -> int:
|
||||
"""安全转换时间戳"""
|
||||
try:
|
||||
if isinstance(val, (int, float)):
|
||||
# 如果是毫秒级时间戳,转为秒
|
||||
return int(val) if val < 2000000000 else int(val / 1000)
|
||||
if isinstance(val, str):
|
||||
# 尝试解析常见格式
|
||||
for fmt in ["%Y-%m-%d %H:%M:%S", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%dT%H:%M:%S.%f"]:
|
||||
try:
|
||||
return int(datetime.strptime(val[:19], fmt[:len(val)+2]).timestamp())
|
||||
except ValueError:
|
||||
continue
|
||||
except Exception:
|
||||
pass
|
||||
return default or int(time.time())
|
||||
|
||||
|
||||
async def fetch_jin10() -> list:
|
||||
"""抓取金十数据快讯"""
|
||||
url = "https://flash-api.jin10.com/get_flash_list"
|
||||
params = {"channel": "-8200", "vip": "1", "max_time": "", "t": "1"}
|
||||
headers = {"x-app-id": "bVBF4FyRTn5NJF5n", "x-version": "1.0.0"}
|
||||
results = []
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
|
||||
resp = await client.get(url, params=params, headers=headers)
|
||||
data = resp.json().get("data", [])
|
||||
for item in data:
|
||||
# 金十的 data 字段可能是 dict 或直接文本
|
||||
content = ""
|
||||
if isinstance(item.get("data"), dict):
|
||||
content = item["data"].get("content", "") or item["data"].get("title", "")
|
||||
elif isinstance(item.get("data"), str):
|
||||
content = item["data"]
|
||||
# 备用:用 content 字段
|
||||
if not content:
|
||||
content = item.get("content", "")
|
||||
if not content:
|
||||
continue
|
||||
# 清理 HTML 标签
|
||||
import re
|
||||
content = re.sub(r"<[^>]+>", "", content).strip()
|
||||
if not content:
|
||||
continue
|
||||
ts = _safe_ts(item.get("time", ""))
|
||||
news_id = item.get("id", "")
|
||||
news_url = f"https://www.jin10.com/flash_detail/{news_id}.html" if news_id else ""
|
||||
results.append({
|
||||
"id": _make_id("jin10", content[:80]),
|
||||
"source": "jin10",
|
||||
"source_name": "金十数据",
|
||||
"title": content[:200],
|
||||
"url": news_url,
|
||||
"timestamp": ts,
|
||||
"time_str": item.get("time", ""),
|
||||
"important": item.get("important", 0) == 1,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"金十数据抓取失败: {e}")
|
||||
return results
|
||||
|
||||
|
||||
async def fetch_wallstreet() -> list:
|
||||
"""抓取华尔街见闻快讯"""
|
||||
url = "https://api-one.wallstcn.com/apiv1/content/lives"
|
||||
params = {"channel": "global-channel", "limit": "20"}
|
||||
results = []
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
|
||||
resp = await client.get(url, params=params)
|
||||
items = resp.json().get("data", {}).get("items", [])
|
||||
for item in items:
|
||||
title = item.get("content_text", "") or item.get("title", "")
|
||||
if not title:
|
||||
continue
|
||||
import re
|
||||
title = re.sub(r"<[^>]+>", "", title).strip()
|
||||
if not title:
|
||||
continue
|
||||
ts = _safe_ts(item.get("display_time", 0))
|
||||
news_url = item.get("uri", "") or ""
|
||||
results.append({
|
||||
"id": _make_id("wallstreet", title[:80]),
|
||||
"source": "wallstreet",
|
||||
"source_name": "华尔街见闻",
|
||||
"title": title[:200],
|
||||
"url": news_url,
|
||||
"timestamp": ts,
|
||||
"time_str": datetime.fromtimestamp(ts).strftime("%H:%M:%S") if ts else "",
|
||||
"important": item.get("is_important", False),
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"华尔街见闻抓取失败: {e}")
|
||||
return results
|
||||
|
||||
|
||||
async def fetch_kr36() -> list:
|
||||
"""抓取36氪快讯"""
|
||||
url = "https://36kr.com/api/newsflash"
|
||||
params = {"per_page": "20"}
|
||||
results = []
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
|
||||
resp = await client.get(url, params=params)
|
||||
items = resp.json().get("data", {}).get("items", [])
|
||||
for item in items:
|
||||
title = item.get("title", "") or item.get("entity_name", "")
|
||||
if not title:
|
||||
continue
|
||||
ts = _safe_ts(item.get("published_at", ""))
|
||||
news_id = item.get("id", "")
|
||||
news_url = f"https://36kr.com/newsflashes/{news_id}" if news_id else ""
|
||||
results.append({
|
||||
"id": _make_id("kr36", title[:80]),
|
||||
"source": "kr36",
|
||||
"source_name": "36氪",
|
||||
"title": title[:200],
|
||||
"url": news_url,
|
||||
"timestamp": ts,
|
||||
"time_str": datetime.fromtimestamp(ts).strftime("%H:%M:%S") if ts else "",
|
||||
"important": False,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"36氪抓取失败: {e}")
|
||||
return results
|
||||
|
||||
|
||||
async def fetch_sina() -> list:
|
||||
"""抓取新浪财经快讯"""
|
||||
url = "https://feed.mix.sina.com.cn/api/roll/get"
|
||||
params = {"pageid": "153", "lid": "2516", "k": "", "num": "20", "page": "1"}
|
||||
results = []
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
|
||||
resp = await client.get(url, params=params)
|
||||
data = resp.json().get("result", {}).get("data", [])
|
||||
for item in data:
|
||||
title = item.get("title", "")
|
||||
if not title:
|
||||
continue
|
||||
import re
|
||||
title = re.sub(r"<[^>]+>", "", title).strip()
|
||||
if not title:
|
||||
continue
|
||||
ts = _safe_ts(item.get("ctime", item.get("createtime", 0)))
|
||||
news_url = item.get("url", "") or item.get("link", "") or ""
|
||||
results.append({
|
||||
"id": _make_id("sina", title[:80]),
|
||||
"source": "sina",
|
||||
"source_name": "新浪财经",
|
||||
"title": title[:200],
|
||||
"url": news_url,
|
||||
"timestamp": ts,
|
||||
"time_str": datetime.fromtimestamp(ts).strftime("%H:%M:%S") if ts else "",
|
||||
"important": False,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"新浪财经抓取失败: {e}")
|
||||
return results
|
||||
|
||||
|
||||
async def fetch_google_news() -> list:
|
||||
"""抓取 Google News 科技频道 RSS(聚合路透社/彭博社等)"""
|
||||
url = "https://news.google.com/rss/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB"
|
||||
params = {"hl": "en-US", "gl": "US", "ceid": "US:en"}
|
||||
results = []
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
|
||||
resp = await client.get(url, params=params, headers={"User-Agent": "Mozilla/5.0"})
|
||||
root = ET.fromstring(resp.text)
|
||||
for item in root.findall(".//item")[:20]:
|
||||
title = item.findtext("title", "").strip()
|
||||
if not title:
|
||||
continue
|
||||
# 去掉来源后缀 " - Bloomberg.com" 等
|
||||
source_tag = title.rsplit(" - ", 1)[-1] if " - " in title else ""
|
||||
news_url = item.findtext("link", "").strip()
|
||||
ts = 0
|
||||
pub = item.findtext("pubDate", "")
|
||||
if pub:
|
||||
try:
|
||||
ts = int(parsedate_to_datetime(pub).timestamp())
|
||||
except Exception:
|
||||
ts = int(time.time())
|
||||
title_zh = await translate_to_zh(title)
|
||||
results.append({
|
||||
"id": _make_id("google", title[:80]),
|
||||
"source": "google",
|
||||
"source_name": f"Google News ({source_tag})" if source_tag else "Google News",
|
||||
"title": title_zh[:200],
|
||||
"url": news_url,
|
||||
"timestamp": ts,
|
||||
"time_str": datetime.fromtimestamp(ts).strftime("%H:%M:%S") if ts else "",
|
||||
"important": False,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"Google News 抓取失败: {e}")
|
||||
return results
|
||||
|
||||
|
||||
async def fetch_finviz() -> list:
|
||||
"""抓取 Finviz 美股财经新闻"""
|
||||
url = "https://finviz.com/news.ashx"
|
||||
results = []
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
|
||||
resp = await client.get(url, headers={"User-Agent": "Mozilla/5.0"})
|
||||
# 解析 HTML 中的新闻标题和链接
|
||||
matches = re.findall(r'class="nn-tab-link"[^>]*href="([^"]*)"[^>]*>([^<]+)', resp.text)
|
||||
if not matches:
|
||||
# 备用:只提取标题
|
||||
titles = re.findall(r'class="nn-tab-link"[^>]*>([^<]+)', resp.text)
|
||||
matches = [("", t) for t in titles]
|
||||
for link, title in matches[:20]:
|
||||
title = title.strip()
|
||||
if not title:
|
||||
continue
|
||||
title_zh = await translate_to_zh(title)
|
||||
results.append({
|
||||
"id": _make_id("finviz", title[:80]),
|
||||
"source": "finviz",
|
||||
"source_name": "Finviz",
|
||||
"title": title_zh[:200],
|
||||
"url": link or "",
|
||||
"timestamp": int(time.time()),
|
||||
"time_str": datetime.now().strftime("%H:%M:%S"),
|
||||
"important": False,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"Finviz 抓取失败: {e}")
|
||||
return results
|
||||
|
||||
|
||||
async def fetch_techcrunch() -> list:
|
||||
"""抓取 TechCrunch RSS 科技新闻"""
|
||||
url = "https://techcrunch.com/feed/"
|
||||
results = []
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
|
||||
resp = await client.get(url, headers={"User-Agent": "Mozilla/5.0"})
|
||||
root = ET.fromstring(resp.text)
|
||||
for item in root.findall(".//item")[:20]:
|
||||
title = item.findtext("title", "").strip()
|
||||
if not title:
|
||||
continue
|
||||
news_url = item.findtext("link", "").strip()
|
||||
ts = 0
|
||||
pub = item.findtext("pubDate", "")
|
||||
if pub:
|
||||
try:
|
||||
ts = int(parsedate_to_datetime(pub).timestamp())
|
||||
except Exception:
|
||||
ts = int(time.time())
|
||||
title_zh = await translate_to_zh(title)
|
||||
results.append({
|
||||
"id": _make_id("techcrunch", title[:80]),
|
||||
"source": "techcrunch",
|
||||
"source_name": "TechCrunch",
|
||||
"title": title_zh[:200],
|
||||
"url": news_url,
|
||||
"timestamp": ts,
|
||||
"time_str": datetime.fromtimestamp(ts).strftime("%H:%M:%S") if ts else "",
|
||||
"important": False,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"TechCrunch 抓取失败: {e}")
|
||||
return results
|
||||
|
||||
|
||||
# 源名称 → 抓取函数映射
|
||||
SOURCE_FETCHERS = {
|
||||
"jin10": fetch_jin10,
|
||||
"wallstreet": fetch_wallstreet,
|
||||
"kr36": fetch_kr36,
|
||||
"sina": fetch_sina,
|
||||
"google": fetch_google_news,
|
||||
"finviz": fetch_finviz,
|
||||
"techcrunch": fetch_techcrunch,
|
||||
}
|
||||
|
||||
SOURCE_NAMES = {
|
||||
"jin10": "金十数据",
|
||||
"wallstreet": "华尔街见闻",
|
||||
"kr36": "36氪",
|
||||
"sina": "新浪财经",
|
||||
"google": "Google News",
|
||||
"finviz": "Finviz",
|
||||
"techcrunch": "TechCrunch",
|
||||
}
|
||||
|
||||
|
||||
async def fetch_all(enabled_sources: dict = None) -> list:
|
||||
"""抓取所有启用的信息源,返回合并后的新闻列表"""
|
||||
import asyncio
|
||||
if enabled_sources is None:
|
||||
enabled_sources = {k: True for k in SOURCE_FETCHERS}
|
||||
|
||||
tasks = []
|
||||
for name, fetcher in SOURCE_FETCHERS.items():
|
||||
if enabled_sources.get(name, True):
|
||||
tasks.append(fetcher())
|
||||
|
||||
all_news = []
|
||||
results = await asyncio.gather(*tasks, return_exceptions=True)
|
||||
for result in results:
|
||||
if isinstance(result, Exception):
|
||||
logger.error(f"抓取异常: {result}")
|
||||
continue
|
||||
if isinstance(result, list):
|
||||
all_news.extend(result)
|
||||
|
||||
# 按时间排序,最新的在前
|
||||
all_news.sort(key=lambda x: x.get("timestamp", 0), reverse=True)
|
||||
return all_news
|
||||
187
projects/news-bot/storage.py
Normal file
@@ -0,0 +1,187 @@
|
||||
"""
|
||||
数据存储模块 - 使用 JSON 文件持久化
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from threading import Lock
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
DATA_DIR = os.environ.get("DATA_DIR", "/opt/news-bot/data")
|
||||
|
||||
# 文件锁,防止并发写入
|
||||
_locks = {}
|
||||
|
||||
|
||||
def _get_lock(name: str) -> Lock:
|
||||
if name not in _locks:
|
||||
_locks[name] = Lock()
|
||||
return _locks[name]
|
||||
|
||||
|
||||
def _ensure_dir():
|
||||
"""确保数据目录存在"""
|
||||
Path(DATA_DIR).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def _read_json(filename: str, default=None):
|
||||
"""读取 JSON 文件"""
|
||||
filepath = os.path.join(DATA_DIR, filename)
|
||||
try:
|
||||
if os.path.exists(filepath):
|
||||
with open(filepath, "r", encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
except Exception as e:
|
||||
logger.error(f"读取 {filename} 失败: {e}")
|
||||
return default if default is not None else {}
|
||||
|
||||
|
||||
def _write_json(filename: str, data):
|
||||
"""写入 JSON 文件"""
|
||||
_ensure_dir()
|
||||
filepath = os.path.join(DATA_DIR, filename)
|
||||
try:
|
||||
with open(filepath, "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=2)
|
||||
except Exception as e:
|
||||
logger.error(f"写入 {filename} 失败: {e}")
|
||||
|
||||
|
||||
# ========== 新闻存储 ==========
|
||||
|
||||
def save_news(news_list: list):
|
||||
"""保存新闻列表(追加,自动去重)"""
|
||||
with _get_lock("news"):
|
||||
existing = _read_json("news.json", [])
|
||||
existing_ids = {n.get("id") for n in existing}
|
||||
added = 0
|
||||
for item in news_list:
|
||||
if item.get("id") not in existing_ids:
|
||||
existing.append(item)
|
||||
existing_ids.add(item["id"])
|
||||
added += 1
|
||||
# 只保留最近 2000 条
|
||||
if len(existing) > 2000:
|
||||
existing = existing[-2000:]
|
||||
_write_json("news.json", existing)
|
||||
return added
|
||||
|
||||
|
||||
def get_news(limit=50, since_ts=0) -> list:
|
||||
"""获取新闻,可按时间过滤"""
|
||||
news = _read_json("news.json", [])
|
||||
if since_ts:
|
||||
news = [n for n in news if n.get("timestamp", 0) >= since_ts]
|
||||
return news[-limit:]
|
||||
|
||||
|
||||
def get_news_by_score(min_score=6, since_ts=0) -> list:
|
||||
"""按评分获取新闻"""
|
||||
news = get_news(limit=500, since_ts=since_ts)
|
||||
return [n for n in news if n.get("score", 0) >= min_score]
|
||||
|
||||
|
||||
# ========== 已推送记录 ==========
|
||||
|
||||
def mark_pushed(news_ids: list):
|
||||
"""标记新闻为已推送"""
|
||||
with _get_lock("pushed"):
|
||||
pushed = set(_read_json("pushed.json", []))
|
||||
pushed.update(news_ids)
|
||||
# 只保留最近 5000 条
|
||||
pushed_list = list(pushed)[-5000:]
|
||||
_write_json("pushed.json", pushed_list)
|
||||
|
||||
|
||||
def is_pushed(news_id: str) -> bool:
|
||||
"""检查新闻是否已推送"""
|
||||
pushed = set(_read_json("pushed.json", []))
|
||||
return news_id in pushed
|
||||
|
||||
|
||||
def get_pushed_ids() -> set:
|
||||
"""获取所有已推送 ID"""
|
||||
return set(_read_json("pushed.json", []))
|
||||
|
||||
|
||||
# ========== 用户设置 ==========
|
||||
|
||||
DEFAULT_SETTINGS = {
|
||||
"push_enabled": True,
|
||||
"batch_interval": 30, # 汇总推送间隔(分钟)
|
||||
"min_score": 6, # 最低推送评分
|
||||
"instant_score": 8, # 即时推送评分阈值
|
||||
"sources": {
|
||||
"jin10": True,
|
||||
"wallstreet": True,
|
||||
"kr36": True,
|
||||
"sina": True,
|
||||
},
|
||||
"keywords": [
|
||||
"AI", "英伟达", "NVIDIA", "AMD", "存储", "光模块", "算力",
|
||||
"华为", "腾讯", "阿里", "字节", "小米",
|
||||
"收购", "突破", "泄露", "内幕", "传闻", "重磅",
|
||||
"A股", "港股", "美股",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def get_settings() -> dict:
|
||||
"""获取用户设置"""
|
||||
settings = _read_json("settings.json", None)
|
||||
if settings is None:
|
||||
settings = DEFAULT_SETTINGS.copy()
|
||||
_write_json("settings.json", settings)
|
||||
# 补全缺失字段
|
||||
for k, v in DEFAULT_SETTINGS.items():
|
||||
if k not in settings:
|
||||
settings[k] = v
|
||||
return settings
|
||||
|
||||
|
||||
def update_settings(updates: dict):
|
||||
"""更新用户设置"""
|
||||
with _get_lock("settings"):
|
||||
settings = get_settings()
|
||||
settings.update(updates)
|
||||
_write_json("settings.json", settings)
|
||||
return settings
|
||||
|
||||
|
||||
def toggle_source(source_name: str) -> bool:
|
||||
"""切换信息源开关,返回新状态"""
|
||||
with _get_lock("settings"):
|
||||
settings = get_settings()
|
||||
current = settings.get("sources", {}).get(source_name, True)
|
||||
settings.setdefault("sources", {})[source_name] = not current
|
||||
_write_json("settings.json", settings)
|
||||
return not current
|
||||
|
||||
|
||||
def add_keyword(keyword: str) -> bool:
|
||||
"""添加关键词,返回是否成功"""
|
||||
with _get_lock("settings"):
|
||||
settings = get_settings()
|
||||
kw_list = settings.get("keywords", [])
|
||||
if keyword in kw_list:
|
||||
return False
|
||||
kw_list.append(keyword)
|
||||
settings["keywords"] = kw_list
|
||||
_write_json("settings.json", settings)
|
||||
return True
|
||||
|
||||
|
||||
def remove_keyword(keyword: str) -> bool:
|
||||
"""删除关键词,返回是否成功"""
|
||||
with _get_lock("settings"):
|
||||
settings = get_settings()
|
||||
kw_list = settings.get("keywords", [])
|
||||
if keyword not in kw_list:
|
||||
return False
|
||||
kw_list.remove(keyword)
|
||||
settings["keywords"] = kw_list
|
||||
_write_json("settings.json", settings)
|
||||
return True
|
||||
97
projects/news-bot/summarizer.py
Normal file
@@ -0,0 +1,97 @@
|
||||
"""
|
||||
新闻总结生成模块
|
||||
使用规则引擎生成中文总结(不调用外部 AI API)
|
||||
"""
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from collections import defaultdict
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def generate_summary(news_list: list, period: str = "全天") -> str:
|
||||
"""
|
||||
生成新闻总结
|
||||
period: "最近1小时" / "上午" / "全天" / "昨晚到今早"
|
||||
"""
|
||||
if not news_list:
|
||||
return f"📭 {period}暂无重要新闻"
|
||||
|
||||
# 按评分排序,高分在前
|
||||
sorted_news = sorted(news_list, key=lambda x: x.get("score", 0), reverse=True)
|
||||
|
||||
# 按来源分组统计
|
||||
source_count = defaultdict(int)
|
||||
for n in sorted_news:
|
||||
source_count[n.get("source_name", "未知")] += 1
|
||||
|
||||
# 构建总结
|
||||
lines = []
|
||||
lines.append(f"📊 *{period}新闻总结*")
|
||||
lines.append(f"━━━━━━━━━━━━━━━")
|
||||
lines.append(f"📰 共 {len(sorted_news)} 条快讯")
|
||||
lines.append("")
|
||||
|
||||
# 🔴 重磅新闻(评分 >= 8)
|
||||
hot_news = [n for n in sorted_news if n.get("score", 0) >= 8]
|
||||
if hot_news:
|
||||
lines.append("🔴 *重磅快讯*")
|
||||
for n in hot_news[:5]:
|
||||
emoji = _score_emoji(n.get("score", 0))
|
||||
lines.append(f" {emoji} {n['title']}")
|
||||
lines.append("")
|
||||
|
||||
# 🟡 值得关注(评分 6-7)
|
||||
mid_news = [n for n in sorted_news if 6 <= n.get("score", 0) <= 7]
|
||||
if mid_news:
|
||||
lines.append("🟡 *值得关注*")
|
||||
for n in mid_news[:8]:
|
||||
lines.append(f" • {n['title']}")
|
||||
lines.append("")
|
||||
|
||||
# 来源统计
|
||||
lines.append("📡 *来源分布*")
|
||||
for src, cnt in sorted(source_count.items(), key=lambda x: x[1], reverse=True):
|
||||
lines.append(f" {src}: {cnt}条")
|
||||
|
||||
lines.append("")
|
||||
lines.append(f"⏰ 生成时间: {datetime.now().strftime('%H:%M')}")
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def _score_emoji(score: int) -> str:
|
||||
"""根据评分返回 emoji"""
|
||||
if score >= 9:
|
||||
return "🔥"
|
||||
elif score >= 8:
|
||||
return "⚡"
|
||||
elif score >= 7:
|
||||
return "📌"
|
||||
elif score >= 6:
|
||||
return "📎"
|
||||
else:
|
||||
return "•"
|
||||
|
||||
|
||||
def get_period_range(period: str) -> tuple:
|
||||
"""
|
||||
根据时间段名称返回 (start_ts, end_ts)
|
||||
"""
|
||||
now = datetime.now()
|
||||
today_start = now.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
||||
if period == "最近1小时":
|
||||
start = now - timedelta(hours=1)
|
||||
elif period == "上午":
|
||||
start = today_start.replace(hour=6)
|
||||
now = min(now, today_start.replace(hour=12))
|
||||
elif period == "全天":
|
||||
start = today_start
|
||||
elif period == "昨晚到今早":
|
||||
start = (today_start - timedelta(days=1)).replace(hour=20)
|
||||
now = today_start.replace(hour=8)
|
||||
else:
|
||||
start = now - timedelta(hours=3)
|
||||
|
||||
return int(start.timestamp()), int(now.timestamp())
|
||||
BIN
projects/nodeseek/nodeseek-board.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
projects/nodeseek/nodeseek-loggedin.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
projects/nodeseek/nodeseek-login.png
Normal file
|
After Width: | Height: | Size: 191 KiB |
1
projects/nodeseek/nodeseek-new-cookie.txt
Normal file
@@ -0,0 +1 @@
|
||||
smac=1771310865-GN-oHyD9nywyHscApHZMrA0HAKa6qnI1FD7YJtwSQCM; session=25d30e55edcd0b9e5261302a6f559bb6; colorscheme=light
|
||||
1
projects/nodeseek/nodeseek-rss-monitor
Submodule
BIN
projects/nodeseek/nodeseek_login.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
projects/nodeseek/ns4.png
Normal file
|
After Width: | Height: | Size: 195 KiB |
BIN
projects/nodeseek/ns_login2.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
projects/nodeseek/ns_login3.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
200
projects/oc-monitor/oc-monitor-design.html
Normal file
@@ -0,0 +1,200 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>OpenClaw Mission Control — 顶尖</title>
|
||||
<style>
|
||||
*{margin:0;padding:0;box-sizing:border-box}
|
||||
:root{--bg:#060a10;--card:#0d1520;--card2:#111c2e;--border:#1a2740;--txt:#c8d6e5;--dim:#5a6f88;--neon:#00e5ff;--green:#00ff88;--warn:#ffb020;--err:#ff4466;--purple:#b8a9ff;--peach:#ffb088}
|
||||
body{font-family:'SF Mono',Menlo,'Courier New',monospace;background:var(--bg);color:var(--txt);padding:16px}
|
||||
.wrap{max-width:1200px;margin:0 auto}
|
||||
h1{font-size:1.3em;color:var(--neon);margin-bottom:4px}
|
||||
.sub{color:var(--dim);font-size:.75em;margin-bottom:20px}
|
||||
.stats{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:20px}
|
||||
.st{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:14px;text-align:center}
|
||||
.st .n{font-size:1.5em;font-weight:700}.st .l{font-size:.7em;color:var(--dim);margin-top:2px}
|
||||
.s1 .n{color:var(--neon)}.s2 .n{color:var(--purple)}.s3 .n{color:var(--peach)}.s4 .n{color:var(--green)}.s5 .n{color:var(--warn)}.s6 .n{color:var(--err)}
|
||||
.tabs{display:flex;gap:0;margin-bottom:20px;border-bottom:1px solid var(--border)}
|
||||
.tab{padding:8px 20px;cursor:pointer;color:var(--dim);font-size:.85em;border-bottom:2px solid transparent}
|
||||
.tab.on{color:var(--neon);border-bottom-color:var(--neon)}
|
||||
.tp{display:none}.tp.on{display:block}
|
||||
.nodes{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:14px;margin-bottom:20px}
|
||||
.nd{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:16px}
|
||||
.nd-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
|
||||
.nd-nm{font-size:1.05em;font-weight:600}
|
||||
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:5px}
|
||||
.dot.on{background:var(--green);box-shadow:0 0 6px var(--green)}.dot.off{background:var(--err)}
|
||||
.tg{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:8px}
|
||||
.tg span{font-size:.63em;padding:2px 7px;border-radius:10px;background:var(--card2);color:var(--dim);border:1px solid var(--border)}
|
||||
.tg .ms{color:var(--neon);border-color:rgba(0,229,255,.3)}.tg .wk{color:var(--purple);border-color:rgba(184,169,255,.3)}
|
||||
.hb{height:28px;display:flex;align-items:end;gap:1px;margin-bottom:8px;overflow:hidden}
|
||||
.hb i{width:3px;border-radius:1px;background:var(--neon);opacity:.6}
|
||||
.sec{font-size:.72em;color:var(--dim);margin-bottom:4px}
|
||||
.pv{display:flex;justify-content:space-between;padding:3px 0;font-size:.78em}
|
||||
.pv-l{display:flex;gap:5px;align-items:center}
|
||||
.star{color:var(--warn);font-size:.7em}
|
||||
.pm{color:var(--dim);font-size:.85em}
|
||||
.ok{color:var(--green)}.er{color:var(--err)}.ms{color:var(--dim);font-size:.85em}
|
||||
.gs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:8px 0}
|
||||
.g{font-size:.7em}.g-l{color:var(--dim)}.g-t{height:4px;background:var(--card2);border-radius:2px;margin:2px 0}
|
||||
.g-f{height:100%;border-radius:2px}.fg{background:var(--green)}.fb{background:var(--neon)}.fw{background:var(--warn)}.fr{background:var(--err)}
|
||||
.g-n{font-weight:600}
|
||||
.tks{display:flex;gap:10px;margin:8px 0}
|
||||
.tk{flex:1;text-align:center;background:var(--card2);border-radius:6px;padding:5px}
|
||||
.tk-l{font-size:.63em;color:var(--dim)}.tk-v{font-size:.85em;font-weight:600;color:var(--neon)}
|
||||
.nd-f{display:flex;gap:8px;font-size:.68em;color:var(--dim);flex-wrap:wrap}
|
||||
.mx{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:16px;margin-bottom:20px}
|
||||
.mx-h{font-size:.9em;font-weight:600;margin-bottom:10px;color:var(--neon)}
|
||||
table{width:100%;border-collapse:collapse;font-size:.78em}
|
||||
th{text-align:left;padding:6px 10px;color:var(--dim);border-bottom:1px solid var(--border);font-weight:500}
|
||||
td{padding:6px 10px;border-bottom:1px solid rgba(26,39,64,.5)}
|
||||
.lt{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:16px}
|
||||
.lt-h{font-size:.9em;font-weight:600;margin-bottom:10px;color:var(--purple)}
|
||||
.lf{display:flex;gap:10px;margin-bottom:12px;flex-wrap:wrap}
|
||||
.lf select,.lf input{background:var(--card2);border:1px solid var(--border);color:var(--txt);padding:4px 10px;border-radius:6px;font-size:.78em;font-family:inherit}
|
||||
.lt td{font-size:.73em}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<h1>🐾 OpenClaw Mission Control</h1>
|
||||
<div class="sub">顶尖的 AI 基础设施 · 4 nodes · 6 providers · Updated 2026-02-22 17:30</div>
|
||||
|
||||
<div class="stats">
|
||||
<div class="st s1"><div class="n">4</div><div class="l">NODES ONLINE</div></div>
|
||||
<div class="st s2"><div class="n">1,247</div><div class="l">TODAY REQUESTS</div></div>
|
||||
<div class="st s3"><div class="n">2.8M</div><div class="l">INPUT TOKENS</div></div>
|
||||
<div class="st s4"><div class="n">99.2%</div><div class="l">SUCCESS RATE</div></div>
|
||||
<div class="st s5"><div class="n">6.8s</div><div class="l">AVG TTFT</div></div>
|
||||
<div class="st s6"><div class="n">8.5s</div><div class="l">AVG LATENCY</div></div>
|
||||
</div>
|
||||
|
||||
<div class="tabs">
|
||||
<div class="tab on" onclick="sw('nodes')">🖥 Nodes</div>
|
||||
<div class="tab" onclick="sw('matrix')">📊 Provider Matrix</div>
|
||||
<div class="tab" onclick="sw('logs')">📋 Request Logs</div>
|
||||
</div>
|
||||
|
||||
<div class="tp on" id="t-nodes">
|
||||
<div class="nodes">
|
||||
|
||||
<div class="nd">
|
||||
<div class="nd-h"><div><span class="dot on"></span><span class="nd-nm">Mac mini</span></div><span style="font-size:.7em;color:var(--dim)">192.168.1.5</span></div>
|
||||
<div class="tg"><span class="ms">Master</span><span>OC 2026.2.21</span><span>macOS 26.1 arm64</span></div>
|
||||
<div class="hb" id="h1"></div>
|
||||
<div class="sec">Providers</div>
|
||||
<div class="pv"><div class="pv-l"><span class="star">★</span>newcli <span class="pm">opus-4-6</span></div><div><span class="ok">✓</span> <span class="ms">2.1s</span></div></div>
|
||||
<div class="pv"><div class="pv-l">bookapi <span class="pm">opus-4-6</span></div><div><span class="ok">✓</span> <span class="ms">1.8s</span></div></div>
|
||||
<div class="pv"><div class="pv-l">terminalpub <span class="pm">opus-4-6</span></div><div><span class="ok">✓</span> <span class="ms">3.2s</span></div></div>
|
||||
<div class="pv"><div class="pv-l">volcengine <span class="pm">doubao-1.8</span></div><div><span class="ok">✓</span> <span class="ms">0.9s</span></div></div>
|
||||
<div class="pv"><div class="pv-l">xstx <span class="pm">opus-4.5</span></div><div><span class="er">✗</span> <span class="ms">timeout</span></div></div>
|
||||
<div class="gs">
|
||||
<div class="g"><span class="g-l">cpu</span><div class="g-t"><div class="g-f fg" style="width:23%"></div></div><span class="g-n">23%</span></div>
|
||||
<div class="g"><span class="g-l">mem</span><div class="g-t"><div class="g-f fb" style="width:72%"></div></div><span class="g-n">72%</span></div>
|
||||
<div class="g"><span class="g-l">disk</span><div class="g-t"><div class="g-f fg" style="width:45%"></div></div><span class="g-n">45%</span></div>
|
||||
<div class="g"><span class="g-l">swap</span><div class="g-t"><div class="g-f fg" style="width:12%"></div></div><span class="g-n">12%</span></div>
|
||||
</div>
|
||||
<div class="tks"><div class="tk"><div class="tk-l">Today</div><div class="tk-v">180K</div></div><div class="tk"><div class="tk-l">Week</div><div class="tk-v">1.2M</div></div><div class="tk"><div class="tk-l">Month</div><div class="tk-v">4.8M</div></div></div>
|
||||
<div class="nd-f"><span>⏱ 5d 12h</span><span>📡 8 sessions</span><span>⚡ gw ✓</span><span>🐾 daemon ✓</span></div>
|
||||
</div>
|
||||
|
||||
<div class="nd">
|
||||
<div class="nd-h"><div><span class="dot on"></span><span class="nd-nm">HDY</span></div><span style="font-size:.7em;color:var(--dim)">38.76.204.161</span></div>
|
||||
<div class="tg"><span class="wk">Worker</span><span>OC 2026.2.17</span><span>Debian 13 x64</span></div>
|
||||
<div class="hb" id="h2"></div>
|
||||
<div class="sec">Providers</div>
|
||||
<div class="pv"><div class="pv-l"><span class="star">★</span>newcli <span class="pm">opus-4-6</span></div><div><span class="ok">✓</span> <span class="ms">1.9s</span></div></div>
|
||||
<div class="pv"><div class="pv-l">volcengine <span class="pm">doubao-1.8</span></div><div><span class="ok">✓</span> <span class="ms">1.1s</span></div></div>
|
||||
<div class="gs">
|
||||
<div class="g"><span class="g-l">cpu</span><div class="g-t"><div class="g-f fg" style="width:8%"></div></div><span class="g-n">8%</span></div>
|
||||
<div class="g"><span class="g-l">mem</span><div class="g-t"><div class="g-f fg" style="width:35%"></div></div><span class="g-n">35%</span></div>
|
||||
<div class="g"><span class="g-l">disk</span><div class="g-t"><div class="g-f fg" style="width:28%"></div></div><span class="g-n">28%</span></div>
|
||||
<div class="g"><span class="g-l">swap</span><div class="g-t"><div class="g-f fg" style="width:0%"></div></div><span class="g-n">0%</span></div>
|
||||
</div>
|
||||
<div class="tks"><div class="tk"><div class="tk-l">Today</div><div class="tk-v">45K</div></div><div class="tk"><div class="tk-l">Week</div><div class="tk-v">320K</div></div><div class="tk"><div class="tk-l">Month</div><div class="tk-v">1.1M</div></div></div>
|
||||
<div class="nd-f"><span>⏱ 12d 3h</span><span>📡 3 sessions</span><span>⚡ gw ✓</span><span>🐾 daemon ✓</span></div>
|
||||
</div>
|
||||
|
||||
<div class="nd">
|
||||
<div class="nd-h"><div><span class="dot on"></span><span class="nd-nm">OC2</span></div><span style="font-size:.7em;color:var(--dim)">155.103.66.237</span></div>
|
||||
<div class="tg"><span class="wk">Worker</span><span>OC 2026.2.19</span><span>Debian 13 x64</span></div>
|
||||
<div class="hb" id="h3"></div>
|
||||
<div class="sec">Providers</div>
|
||||
<div class="pv"><div class="pv-l"><span class="star">★</span>newcli <span class="pm">opus-4-6</span></div><div><span class="ok">✓</span> <span class="ms">2.4s</span></div></div>
|
||||
<div class="pv"><div class="pv-l">terminalpub <span class="pm">opus-4-6</span></div><div><span class="ok">✓</span> <span class="ms">2.8s</span></div></div>
|
||||
<div class="gs">
|
||||
<div class="g"><span class="g-l">cpu</span><div class="g-t"><div class="g-f fg" style="width:5%"></div></div><span class="g-n">5%</span></div>
|
||||
<div class="g"><span class="g-l">mem</span><div class="g-t"><div class="g-f fg" style="width:42%"></div></div><span class="g-n">42%</span></div>
|
||||
<div class="g"><span class="g-l">disk</span><div class="g-t"><div class="g-f fg" style="width:15%"></div></div><span class="g-n">15%</span></div>
|
||||
<div class="g"><span class="g-l">swap</span><div class="g-t"><div class="g-f fg" style="width:0%"></div></div><span class="g-n">0%</span></div>
|
||||
</div>
|
||||
<div class="tks"><div class="tk"><div class="tk-l">Today</div><div class="tk-v">62K</div></div><div class="tk"><div class="tk-l">Week</div><div class="tk-v">410K</div></div><div class="tk"><div class="tk-l">Month</div><div class="tk-v">1.5M</div></div></div>
|
||||
<div class="nd-f"><span>⏱ 8d 7h</span><span>📡 4 sessions</span><span>⚡ gw ✓</span><span>🐾 daemon ✓</span></div>
|
||||
</div>
|
||||
|
||||
<div class="nd" style="border-color:rgba(255,68,102,.3)">
|
||||
<div class="nd-h"><div><span class="dot off"></span><span class="nd-nm">OC3</span></div><span style="font-size:.7em;color:var(--err)">173.249.215.67</span></div>
|
||||
<div class="tg"><span class="wk">Worker</span><span>OC 2026.2.15</span><span>Debian 12 x64</span></div>
|
||||
<div class="hb" id="h4"></div>
|
||||
<div class="sec">Providers</div>
|
||||
<div class="pv"><div class="pv-l">newcli <span class="pm">opus-4-6</span></div><div><span class="er">✗</span> <span class="ms">timeout</span></div></div>
|
||||
<div class="gs">
|
||||
<div class="g"><span class="g-l">cpu</span><div class="g-t"><div class="g-f fg" style="width:0%"></div></div><span class="g-n">—</span></div>
|
||||
<div class="g"><span class="g-l">mem</span><div class="g-t"><div class="g-f fg" style="width:0%"></div></div><span class="g-n">—</span></div>
|
||||
<div class="g"><span class="g-l">disk</span><div class="g-t"><div class="g-f fg" style="width:0%"></div></div><span class="g-n">—</span></div>
|
||||
<div class="g"><span class="g-l">swap</span><div class="g-t"><div class="g-f fg" style="width:0%"></div></div><span class="g-n">—</span></div>
|
||||
</div>
|
||||
<div class="tks"><div class="tk"><div class="tk-l">Today</div><div class="tk-v" style="color:var(--dim)">0</div></div><div class="tk"><div class="tk-l">Week</div><div class="tk-v">85K</div></div><div class="tk"><div class="tk-l">Month</div><div class="tk-v">340K</div></div></div>
|
||||
<div class="nd-f" style="color:var(--err)"><span>⚠ offline 2h ago</span><span>📡 0 sessions</span><span>⚡ gw ✗</span></div>
|
||||
</div>
|
||||
|
||||
</div></div>
|
||||
|
||||
<div class="tp" id="t-matrix">
|
||||
<div class="mx">
|
||||
<div class="mx-h">Provider × Node Matrix</div>
|
||||
<table>
|
||||
<thead><tr><th>Provider</th><th>Mac mini</th><th>HDY</th><th>OC2</th><th>OC3</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>newcli (opus-4-6)</td><td class="ok">✓ 2.1s</td><td class="ok">✓ 1.9s</td><td class="ok">✓ 2.4s</td><td class="er">✗ timeout</td></tr>
|
||||
<tr><td>bookapi (opus-4-6)</td><td class="ok">✓ 1.8s</td><td style="color:var(--dim)">—</td><td style="color:var(--dim)">—</td><td style="color:var(--dim)">—</td></tr>
|
||||
<tr><td>terminalpub (opus-4-6)</td><td class="ok">✓ 3.2s</td><td style="color:var(--dim)">—</td><td class="ok">✓ 2.8s</td><td style="color:var(--dim)">—</td></tr>
|
||||
<tr><td>volcengine (doubao-1.8)</td><td class="ok">✓ 0.9s</td><td class="ok">✓ 1.1s</td><td style="color:var(--dim)">—</td><td style="color:var(--dim)">—</td></tr>
|
||||
<tr><td>xstx (opus-4.5)</td><td class="er">✗ timeout</td><td style="color:var(--dim)">—</td><td style="color:var(--dim)">—</td><td style="color:var(--dim)">—</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
|
||||
<div class="tp" id="t-logs">
|
||||
<div class="lt">
|
||||
<div class="lt-h">Request Logs</div>
|
||||
<div class="lf">
|
||||
<input type="date" value="2026-02-22">
|
||||
<select><option>All Nodes</option><option>Mac mini</option><option>HDY</option><option>OC2</option><option>OC3</option></select>
|
||||
<select><option>All Upstream</option><option>newcli</option><option>bookapi</option><option>terminalpub</option><option>volcengine</option></select>
|
||||
<select><option>All Results</option><option>✓ Success</option><option>✗ Failed</option></select>
|
||||
</div>
|
||||
<table>
|
||||
<thead><tr><th>时间</th><th>Node</th><th>Upstream</th><th>Model</th><th>Result</th><th>Status</th><th>输入</th><th>输出</th><th>TTFT</th><th>总耗时</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>17:30:48</td><td>Mac mini</td><td>newcli</td><td>opus-4-6</td><td class="ok">✓</td><td>200</td><td>179.6K</td><td>29</td><td style="color:var(--warn)">10191ms</td><td>10.3s</td></tr>
|
||||
<tr><td>17:30:38</td><td>Mac mini</td><td>newcli</td><td>opus-4-6</td><td class="ok">✓</td><td>200</td><td>176.9K</td><td>41</td><td style="color:var(--warn)">8819ms</td><td>9.6s</td></tr>
|
||||
<tr><td>17:30:28</td><td>HDY</td><td>newcli</td><td>opus-4-6</td><td class="ok">✓</td><td>200</td><td>52.3K</td><td>156</td><td style="color:var(--warn)">4210ms</td><td>6.1s</td></tr>
|
||||
<tr><td>17:30:20</td><td>OC2</td><td>terminalpub</td><td>opus-4-6</td><td class="ok">✓</td><td>200</td><td>88.1K</td><td>43</td><td style="color:var(--warn)">7346ms</td><td>7.6s</td></tr>
|
||||
<tr><td>17:30:13</td><td>Mac mini</td><td>bookapi</td><td>opus-4-6</td><td class="ok">✓</td><td>200</td><td>167.8K</td><td>41</td><td style="color:var(--warn)">8602ms</td><td>8.9s</td></tr>
|
||||
<tr><td>17:30:04</td><td>Mac mini</td><td>volcengine</td><td>doubao-1.8</td><td class="ok">✓</td><td>200</td><td>12.5K</td><td>320</td><td style="color:var(--green)">890ms</td><td>2.1s</td></tr>
|
||||
<tr><td>17:29:56</td><td>HDY</td><td>volcengine</td><td>doubao-1.8</td><td class="ok">✓</td><td>200</td><td>8.2K</td><td>215</td><td style="color:var(--green)">1100ms</td><td>2.8s</td></tr>
|
||||
<tr><td>17:29:48</td><td>OC3</td><td>newcli</td><td>opus-4-6</td><td class="er">✗</td><td>504</td><td>45.0K</td><td>0</td><td style="color:var(--err)">30000ms</td><td>30.0s</td></tr>
|
||||
<tr><td>17:29:39</td><td>Mac mini</td><td>newcli</td><td>opus-4-6</td><td class="ok">✓</td><td>200</td><td>155.4K</td><td>44</td><td style="color:var(--warn)">6904ms</td><td>7.1s</td></tr>
|
||||
<tr><td>17:29:32</td><td>OC2</td><td>newcli</td><td>opus-4-6</td><td class="ok">✓</td><td>200</td><td>91.2K</td><td>89</td><td style="color:var(--warn)">5530ms</td><td>6.8s</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
function sw(t){document.querySelectorAll('.tab').forEach(e=>e.classList.remove('on'));document.querySelectorAll('.tp').forEach(e=>e.classList.remove('on'));document.querySelector('.tab[onclick*="'+t+'"]').classList.add('on');document.getElementById('t-'+t).classList.add('on')}
|
||||
['h1','h2','h3','h4'].forEach(id=>{const el=document.getElementById(id);if(!el)return;const off=id==='h4';for(let i=0;i<60;i++){const b=document.createElement('i');b.style.height=(off?0:Math.random()*20+4)+'px';b.style.background=off?'var(--err)':'var(--neon)';b.style.opacity=off?'.2':(.3+Math.random()*.5);el.appendChild(b)}});
|
||||
</script>
|
||||
</body></html>
|
||||
BIN
projects/oc-monitor/oc-monitor-post/1-nodes-dark.png
Normal file
|
After Width: | Height: | Size: 167 KiB |
BIN
projects/oc-monitor/oc-monitor-post/2-providers.png
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
projects/oc-monitor/oc-monitor-post/3-logs.jpg
Normal file
|
After Width: | Height: | Size: 209 KiB |
BIN
projects/oc-monitor/oc-monitor-post/4-nodes-light.png
Normal file
|
After Width: | Height: | Size: 171 KiB |
32
projects/oc-monitor/oc-monitor-post/copy.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<html><body><pre style="font-size:14px;white-space:pre-wrap;font-family:monospace;padding:20px">手上有几台 VPS 都跑着 OpenClaw,想搞个统一的面板看看各节点状态。跟 OpenClaw 描述了一下需求,它直接帮我从零撸了一套出来,前后端+Agent 全包了。
|
||||
|
||||
## 效果
|
||||
|
||||
- 节点总览:CPU/内存/磁盘/Swap 实时仪表盘
|
||||
- 供应商矩阵:各节点 API 供应商健康状态、响应延迟
|
||||
- 请求日志:完整 API 调用记录,输入/输出/缓存读写 Token 统计,分页+筛选
|
||||
- WebSocket 实时推送,10秒心跳
|
||||
- 未登录可看脱敏面板(IP隐藏),Token 解锁完整视图
|
||||
- 暗色/亮色主题切换
|
||||
- 手机/桌面自适应
|
||||
|
||||
## 架构
|
||||
|
||||
Server(Node.js + SQLite + WebSocket)Docker 一键部署
|
||||
Agent(Bash + Python3)每个节点装一个,自动检测 OpenClaw 配置,macOS/Linux 通吃
|
||||
|
||||
## 安装
|
||||
|
||||
Server:
|
||||
|
||||
```bash
|
||||
curl -sL https://git.088520.xyz/admin/oc-monitor/raw/branch/main/install.sh | bash
|
||||
```
|
||||
|
||||
Agent:
|
||||
|
||||
```bash
|
||||
curl -sL https://git.088520.xyz/admin/oc-monitor/raw/branch/main/install-agent.sh | bash -s -- -s http://服务器IP:3800 -t TOKEN -n "节点名"
|
||||
```
|
||||
|
||||
前端纯原生 HTML/CSS/JS,零依赖,单文件 ~300 行。Agent 也是零依赖,Bash+Python3 搞定。</pre></body></html>
|
||||
32
projects/oc-monitor/oc-monitor-post/post.md
Normal file
@@ -0,0 +1,32 @@
|
||||
手上有几台 VPS 都跑着 OpenClaw,想搞个统一的面板看看各节点状态。跟 OpenClaw 描述了一下需求,它直接帮我从零撸了一套出来,前后端+Agent 全包了。
|
||||
|
||||
## 效果
|
||||
|
||||
- 节点总览:CPU/内存/磁盘/Swap 实时仪表盘
|
||||
- 供应商矩阵:各节点 API 供应商健康状态、响应延迟
|
||||
- 请求日志:完整 API 调用记录,输入/输出/缓存读写 Token 统计,分页+筛选
|
||||
- WebSocket 实时推送,10秒心跳
|
||||
- 未登录可看脱敏面板(IP隐藏),Token 解锁完整视图
|
||||
- 暗色/亮色主题切换
|
||||
- 手机/桌面自适应
|
||||
|
||||
## 架构
|
||||
|
||||
Server(Node.js + SQLite + WebSocket)Docker 一键部署
|
||||
Agent(Bash + Python3)每个节点装一个,自动检测 OpenClaw 配置,macOS/Linux 通吃
|
||||
|
||||
## 安装
|
||||
|
||||
Server:
|
||||
|
||||
```bash
|
||||
curl -sL https://git.088520.xyz/admin/oc-monitor/raw/branch/main/install.sh | bash
|
||||
```
|
||||
|
||||
Agent:
|
||||
|
||||
```bash
|
||||
curl -sL https://git.088520.xyz/admin/oc-monitor/raw/branch/main/install-agent.sh | bash -s -- -s http://服务器IP:3800 -t TOKEN -n "节点名"
|
||||
```
|
||||
|
||||
前端纯原生 HTML/CSS/JS,零依赖,单文件 ~300 行。Agent 也是零依赖,Bash+Python3 搞定。
|
||||
44
projects/oc-monitor/oc-status.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh"><head><meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>OpenClaw Monitor</title>
|
||||
<style>
|
||||
*{margin:0;padding:0;box-sizing:border-box}
|
||||
body{font-family:-apple-system,system-ui,sans-serif;background:#0d1117;color:#c9d1d9;padding:20px}
|
||||
.container{max-width:1000px;margin:0 auto}
|
||||
h1{font-size:1.5em;margin-bottom:20px;color:#58a6ff}
|
||||
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-bottom:24px}
|
||||
.card{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:16px}
|
||||
.card .label{font-size:.8em;color:#8b949e;margin-bottom:4px}
|
||||
.card .value{font-size:1.4em;font-weight:600}
|
||||
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;background:#3fb950}
|
||||
table{width:100%;border-collapse:collapse;background:#161b22;border:1px solid #30363d;border-radius:8px;overflow:hidden}
|
||||
th{background:#21262d;text-align:left;padding:10px 12px;font-size:.85em;color:#8b949e}
|
||||
td{padding:8px 12px;border-top:1px solid #30363d;font-size:.85em}
|
||||
code{background:#30363d;padding:2px 6px;border-radius:4px;font-size:.85em}
|
||||
.badge{padding:2px 8px;border-radius:10px;font-size:.75em;font-weight:600}
|
||||
.badge.primary{background:#1f6feb;color:#fff}
|
||||
.badge.secondary{background:#30363d;color:#8b949e}
|
||||
.url{color:#8b949e;font-size:.75em;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.footer{margin-top:16px;font-size:.75em;color:#484f58;text-align:center}
|
||||
</style></head><body>
|
||||
<div class="container">
|
||||
<h1>🐾 OpenClaw Monitor</h1>
|
||||
<div class="cards">
|
||||
<div class="card"><div class="label">Gateway</div><div class="value"><span class="dot"></span>online</div></div>
|
||||
<div class="card"><div class="label">Sessions</div><div class="value">8</div></div>
|
||||
<div class="card"><div class="label">Default Model</div><div class="value" style="font-size:1em">newcli/claude-opus-4-6</div></div>
|
||||
<div class="card"><div class="label">Providers</div><div class="value">6</div></div>
|
||||
</div>
|
||||
<table>
|
||||
<thead><tr><th>Provider</th><th>Model ID</th><th>Name</th><th>API</th><th>Context</th><th>Max Out</th><th>Endpoint</th></tr></thead>
|
||||
<tbody><tr><td><span class="badge secondary">volcengine</span></td><td><code>doubao-seed-1-8-251228</code></td><td>豆包 Seed 1.8 (火山引擎)</td><td>openai-completions</td><td>128k</td><td>8k</td><td class="url">https://ark.cn-beijing.volces.com/api/v3</td></tr>
|
||||
<tr><td><span class="badge primary">newcli</span></td><td><code>claude-opus-4-6</code></td><td>Claude Opus 4.6 (NewCli)</td><td>anthropic-messages</td><td>200k</td><td>16k</td><td class="url">https://code.newcli.com/claude/aws</td></tr>
|
||||
<tr><td><span class="badge primary">bookapi</span></td><td><code>claude-opus-4-6</code></td><td>Claude Opus 4.6 (BookAPI)</td><td>anthropic-messages</td><td>200k</td><td>16k</td><td class="url">http://127.0.0.1:18801</td></tr>
|
||||
<tr><td><span class="badge secondary">xstx</span></td><td><code>claude-opus-4-5-20251101</code></td><td>Claude Opus 4.5 (XSTX)</td><td>openai-completions</td><td>200k</td><td>16k</td><td class="url">https://api.xstx.info/v1</td></tr>
|
||||
<tr><td><span class="badge primary">terminalpub</span></td><td><code>claude-opus-4-6</code></td><td>Claude Opus 4.6 (Terminal)</td><td>anthropic-messages</td><td>200k</td><td>16k</td><td class="url">https://terminal.pub</td></tr>
|
||||
<tr><td><span class="badge secondary">terminal</span></td><td><code>claude-opus-4-6</code></td><td>Claude Opus 4.6 (Terminal)</td><td>anthropic-messages</td><td>200k</td><td>16k</td><td class="url">https://terminal.pub</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="footer">Updated: 2026-02-22 17:08:26 · OpenClaw Status Monitor</div>
|
||||
</div></body></html>
|
||||
71
projects/status-panel/agent.sh
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
# Status Panel Agent
|
||||
# 用法: ./agent.sh <服务器地址> <密钥>
|
||||
|
||||
SERVER="${1:-http://your-server:3800}"
|
||||
SECRET="$2"
|
||||
|
||||
[ -z "$SECRET" ] && echo "Usage: $0 <server> <secret>" && exit 1
|
||||
|
||||
# 获取CPU使用率
|
||||
get_cpu() {
|
||||
local idle=$(top -bn1 | grep "Cpu(s)" | awk '{print $8}' | cut -d'%' -f1)
|
||||
[ -z "$idle" ] && idle=$(top -bn1 | grep "%id" | awk '{print $8}')
|
||||
echo "scale=1; 100 - $idle" | bc 2>/dev/null || echo "0"
|
||||
}
|
||||
|
||||
# 获取内存
|
||||
get_mem() {
|
||||
local mem=$(free -b | grep Mem)
|
||||
echo "$(echo $mem | awk '{print $3}'),$(echo $mem | awk '{print $2}')"
|
||||
}
|
||||
|
||||
# 获取磁盘
|
||||
get_disk() {
|
||||
local disk=$(df -B1 / | tail -1)
|
||||
echo "$(echo $disk | awk '{print $3}'),$(echo $disk | awk '{print $2}')"
|
||||
}
|
||||
|
||||
# 获取网络流量
|
||||
get_net() {
|
||||
local net=$(cat /proc/net/dev | grep -E 'eth0|ens|enp' | head -1)
|
||||
echo "$(echo $net | awk '{print $2}'),$(echo $net | awk '{print $10}')"
|
||||
}
|
||||
|
||||
# 获取负载
|
||||
get_load() {
|
||||
cat /proc/loadavg | awk '{print $1","$2","$3}'
|
||||
}
|
||||
|
||||
# 获取运行时间
|
||||
get_uptime() {
|
||||
cat /proc/uptime | awk '{print int($1)}"
|
||||
}
|
||||
|
||||
while true; do
|
||||
cpu=$(get_cpu)
|
||||
mem=(${(get_mem)//,/ })
|
||||
disk=(${(get_disk)//,/ })
|
||||
net=(${(get_net)//,/ })
|
||||
load=(${(get_load)//,/ })
|
||||
uptime=$(get_uptime)
|
||||
|
||||
curl -s -X POST "$SERVER/report" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"secret\": \"$SECRET\",
|
||||
\"cpu\": $cpu,
|
||||
\"mem_used\": ${mem[0]},
|
||||
\"mem_total\": ${mem[1]},
|
||||
\"disk_used\": ${disk[0]},
|
||||
\"disk_total\": ${disk[1]},
|
||||
\"net_in\": ${net[0]},
|
||||
\"net_out\": ${net[1]},
|
||||
\"uptime\": $uptime,
|
||||
\"load1\": ${load[0]},
|
||||
\"load5\": ${load[1]},
|
||||
\"load15\": ${load[2]}
|
||||
}" > /dev/null 2>&1
|
||||
|
||||
sleep 30
|
||||
done
|
||||
1
projects/status-panel/node_modules/.bin/mime
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../mime/cli.js
|
||||
1
projects/status-panel/node_modules/.bin/prebuild-install
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../prebuild-install/bin.js
|
||||
1
projects/status-panel/node_modules/.bin/rc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../rc/cli.js
|
||||
1
projects/status-panel/node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver.js
|
||||
1264
projects/status-panel/node_modules/.package-lock.json
generated
vendored
Normal file
243
projects/status-panel/node_modules/accepts/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
1.3.8 / 2022-02-02
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.34
|
||||
- deps: mime-db@~1.51.0
|
||||
* deps: negotiator@0.6.3
|
||||
|
||||
1.3.7 / 2019-04-29
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.6.2
|
||||
- Fix sorting charset, encoding, and language with extra parameters
|
||||
|
||||
1.3.6 / 2019-04-28
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.24
|
||||
- deps: mime-db@~1.40.0
|
||||
|
||||
1.3.5 / 2018-02-28
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.18
|
||||
- deps: mime-db@~1.33.0
|
||||
|
||||
1.3.4 / 2017-08-22
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.16
|
||||
- deps: mime-db@~1.29.0
|
||||
|
||||
1.3.3 / 2016-05-02
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.11
|
||||
- deps: mime-db@~1.23.0
|
||||
* deps: negotiator@0.6.1
|
||||
- perf: improve `Accept` parsing speed
|
||||
- perf: improve `Accept-Charset` parsing speed
|
||||
- perf: improve `Accept-Encoding` parsing speed
|
||||
- perf: improve `Accept-Language` parsing speed
|
||||
|
||||
1.3.2 / 2016-03-08
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.10
|
||||
- Fix extension of `application/dash+xml`
|
||||
- Update primary extension for `audio/mp4`
|
||||
- deps: mime-db@~1.22.0
|
||||
|
||||
1.3.1 / 2016-01-19
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.9
|
||||
- deps: mime-db@~1.21.0
|
||||
|
||||
1.3.0 / 2015-09-29
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.7
|
||||
- deps: mime-db@~1.19.0
|
||||
* deps: negotiator@0.6.0
|
||||
- Fix including type extensions in parameters in `Accept` parsing
|
||||
- Fix parsing `Accept` parameters with quoted equals
|
||||
- Fix parsing `Accept` parameters with quoted semicolons
|
||||
- Lazy-load modules from main entry point
|
||||
- perf: delay type concatenation until needed
|
||||
- perf: enable strict mode
|
||||
- perf: hoist regular expressions
|
||||
- perf: remove closures getting spec properties
|
||||
- perf: remove a closure from media type parsing
|
||||
- perf: remove property delete from media type parsing
|
||||
|
||||
1.2.13 / 2015-09-06
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.6
|
||||
- deps: mime-db@~1.18.0
|
||||
|
||||
1.2.12 / 2015-07-30
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.4
|
||||
- deps: mime-db@~1.16.0
|
||||
|
||||
1.2.11 / 2015-07-16
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.3
|
||||
- deps: mime-db@~1.15.0
|
||||
|
||||
1.2.10 / 2015-07-01
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.2
|
||||
- deps: mime-db@~1.14.0
|
||||
|
||||
1.2.9 / 2015-06-08
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.1
|
||||
- perf: fix deopt during mapping
|
||||
|
||||
1.2.8 / 2015-06-07
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.0
|
||||
- deps: mime-db@~1.13.0
|
||||
* perf: avoid argument reassignment & argument slice
|
||||
* perf: avoid negotiator recursive construction
|
||||
* perf: enable strict mode
|
||||
* perf: remove unnecessary bitwise operator
|
||||
|
||||
1.2.7 / 2015-05-10
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.5.3
|
||||
- Fix media type parameter matching to be case-insensitive
|
||||
|
||||
1.2.6 / 2015-05-07
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.11
|
||||
- deps: mime-db@~1.9.1
|
||||
* deps: negotiator@0.5.2
|
||||
- Fix comparing media types with quoted values
|
||||
- Fix splitting media types with quoted commas
|
||||
|
||||
1.2.5 / 2015-03-13
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.10
|
||||
- deps: mime-db@~1.8.0
|
||||
|
||||
1.2.4 / 2015-02-14
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
* deps: mime-types@~2.0.9
|
||||
- deps: mime-db@~1.7.0
|
||||
* deps: negotiator@0.5.1
|
||||
- Fix preference sorting to be stable for long acceptable lists
|
||||
|
||||
1.2.3 / 2015-01-31
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.8
|
||||
- deps: mime-db@~1.6.0
|
||||
|
||||
1.2.2 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.7
|
||||
- deps: mime-db@~1.5.0
|
||||
|
||||
1.2.1 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.5
|
||||
- deps: mime-db@~1.3.1
|
||||
|
||||
1.2.0 / 2014-12-19
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.5.0
|
||||
- Fix list return order when large accepted list
|
||||
- Fix missing identity encoding when q=0 exists
|
||||
- Remove dynamic building of Negotiator class
|
||||
|
||||
1.1.4 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.4
|
||||
- deps: mime-db@~1.3.0
|
||||
|
||||
1.1.3 / 2014-11-09
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.3
|
||||
- deps: mime-db@~1.2.0
|
||||
|
||||
1.1.2 / 2014-10-14
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.9
|
||||
- Fix error when media type has invalid parameter
|
||||
|
||||
1.1.1 / 2014-09-28
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.2
|
||||
- deps: mime-db@~1.1.0
|
||||
* deps: negotiator@0.4.8
|
||||
- Fix all negotiations to be case-insensitive
|
||||
- Stable sort preferences of same quality according to client order
|
||||
|
||||
1.1.0 / 2014-09-02
|
||||
==================
|
||||
|
||||
* update `mime-types`
|
||||
|
||||
1.0.7 / 2014-07-04
|
||||
==================
|
||||
|
||||
* Fix wrong type returned from `type` when match after unknown extension
|
||||
|
||||
1.0.6 / 2014-06-24
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.7
|
||||
|
||||
1.0.5 / 2014-06-20
|
||||
==================
|
||||
|
||||
* fix crash when unknown extension given
|
||||
|
||||
1.0.4 / 2014-06-19
|
||||
==================
|
||||
|
||||
* use `mime-types`
|
||||
|
||||
1.0.3 / 2014-06-11
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.6
|
||||
- Order by specificity when quality is the same
|
||||
|
||||
1.0.2 / 2014-05-29
|
||||
==================
|
||||
|
||||
* Fix interpretation when header not in request
|
||||
* deps: pin negotiator@0.4.5
|
||||
|
||||
1.0.1 / 2014-01-18
|
||||
==================
|
||||
|
||||
* Identity encoding isn't always acceptable
|
||||
* deps: negotiator@~0.4.0
|
||||
|
||||
1.0.0 / 2013-12-27
|
||||
==================
|
||||
|
||||
* Genesis
|
||||
23
projects/status-panel/node_modules/accepts/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
140
projects/status-panel/node_modules/accepts/README.md
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
# accepts
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
|
||||
Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
|
||||
|
||||
In addition to negotiator, it allows:
|
||||
|
||||
- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])`
|
||||
as well as `('text/html', 'application/json')`.
|
||||
- Allows type shorthands such as `json`.
|
||||
- Returns `false` when no types match
|
||||
- Treats non-existent headers as `*`
|
||||
|
||||
## Installation
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install accepts
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var accepts = require('accepts')
|
||||
```
|
||||
|
||||
### accepts(req)
|
||||
|
||||
Create a new `Accepts` object for the given `req`.
|
||||
|
||||
#### .charset(charsets)
|
||||
|
||||
Return the first accepted charset. If nothing in `charsets` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .charsets()
|
||||
|
||||
Return the charsets that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .encoding(encodings)
|
||||
|
||||
Return the first accepted encoding. If nothing in `encodings` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .encodings()
|
||||
|
||||
Return the encodings that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .language(languages)
|
||||
|
||||
Return the first accepted language. If nothing in `languages` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .languages()
|
||||
|
||||
Return the languages that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .type(types)
|
||||
|
||||
Return the first accepted type (and it is returned as the same text as what
|
||||
appears in the `types` array). If nothing in `types` is accepted, then `false`
|
||||
is returned.
|
||||
|
||||
The `types` array can contain full MIME types or file extensions. Any value
|
||||
that is not a full MIME types is passed to `require('mime-types').lookup`.
|
||||
|
||||
#### .types()
|
||||
|
||||
Return the types that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
## Examples
|
||||
|
||||
### Simple type negotiation
|
||||
|
||||
This simple example shows how to use `accepts` to return a different typed
|
||||
respond body based on what the client wants to accept. The server lists it's
|
||||
preferences in order and will get back the best match between the client and
|
||||
server.
|
||||
|
||||
```js
|
||||
var accepts = require('accepts')
|
||||
var http = require('http')
|
||||
|
||||
function app (req, res) {
|
||||
var accept = accepts(req)
|
||||
|
||||
// the order of this list is significant; should be server preferred order
|
||||
switch (accept.type(['json', 'html'])) {
|
||||
case 'json':
|
||||
res.setHeader('Content-Type', 'application/json')
|
||||
res.write('{"hello":"world!"}')
|
||||
break
|
||||
case 'html':
|
||||
res.setHeader('Content-Type', 'text/html')
|
||||
res.write('<b>hello, world!</b>')
|
||||
break
|
||||
default:
|
||||
// the fallback is text/plain, so no need to specify it above
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
res.write('hello, world!')
|
||||
break
|
||||
}
|
||||
|
||||
res.end()
|
||||
}
|
||||
|
||||
http.createServer(app).listen(3000)
|
||||
```
|
||||
|
||||
You can test this out with the cURL program:
|
||||
```sh
|
||||
curl -I -H'Accept: text/html' http://localhost:3000/
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master
|
||||
[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci
|
||||
[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml
|
||||
[node-version-image]: https://badgen.net/npm/node/accepts
|
||||
[node-version-url]: https://nodejs.org/en/download
|
||||
[npm-downloads-image]: https://badgen.net/npm/dm/accepts
|
||||
[npm-url]: https://npmjs.org/package/accepts
|
||||
[npm-version-image]: https://badgen.net/npm/v/accepts
|
||||
238
projects/status-panel/node_modules/accepts/index.js
generated
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
/*!
|
||||
* accepts
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var Negotiator = require('negotiator')
|
||||
var mime = require('mime-types')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = Accepts
|
||||
|
||||
/**
|
||||
* Create a new Accepts object for the given req.
|
||||
*
|
||||
* @param {object} req
|
||||
* @public
|
||||
*/
|
||||
|
||||
function Accepts (req) {
|
||||
if (!(this instanceof Accepts)) {
|
||||
return new Accepts(req)
|
||||
}
|
||||
|
||||
this.headers = req.headers
|
||||
this.negotiator = new Negotiator(req)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given `type(s)` is acceptable, returning
|
||||
* the best match when true, otherwise `undefined`, in which
|
||||
* case you should respond with 406 "Not Acceptable".
|
||||
*
|
||||
* The `type` value may be a single mime type string
|
||||
* such as "application/json", the extension name
|
||||
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
|
||||
* or array is given the _best_ match, if any is returned.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // Accept: text/html
|
||||
* this.types('html');
|
||||
* // => "html"
|
||||
*
|
||||
* // Accept: text/*, application/json
|
||||
* this.types('html');
|
||||
* // => "html"
|
||||
* this.types('text/html');
|
||||
* // => "text/html"
|
||||
* this.types('json', 'text');
|
||||
* // => "json"
|
||||
* this.types('application/json');
|
||||
* // => "application/json"
|
||||
*
|
||||
* // Accept: text/*, application/json
|
||||
* this.types('image/png');
|
||||
* this.types('png');
|
||||
* // => undefined
|
||||
*
|
||||
* // Accept: text/*;q=.5, application/json
|
||||
* this.types(['html', 'json']);
|
||||
* this.types('html', 'json');
|
||||
* // => "json"
|
||||
*
|
||||
* @param {String|Array} types...
|
||||
* @return {String|Array|Boolean}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.type =
|
||||
Accepts.prototype.types = function (types_) {
|
||||
var types = types_
|
||||
|
||||
// support flattened arguments
|
||||
if (types && !Array.isArray(types)) {
|
||||
types = new Array(arguments.length)
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
types[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no types, return all requested types
|
||||
if (!types || types.length === 0) {
|
||||
return this.negotiator.mediaTypes()
|
||||
}
|
||||
|
||||
// no accept header, return first given type
|
||||
if (!this.headers.accept) {
|
||||
return types[0]
|
||||
}
|
||||
|
||||
var mimes = types.map(extToMime)
|
||||
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
|
||||
var first = accepts[0]
|
||||
|
||||
return first
|
||||
? types[mimes.indexOf(first)]
|
||||
: false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted encodings or best fit based on `encodings`.
|
||||
*
|
||||
* Given `Accept-Encoding: gzip, deflate`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['gzip', 'deflate']
|
||||
*
|
||||
* @param {String|Array} encodings...
|
||||
* @return {String|Array}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.encoding =
|
||||
Accepts.prototype.encodings = function (encodings_) {
|
||||
var encodings = encodings_
|
||||
|
||||
// support flattened arguments
|
||||
if (encodings && !Array.isArray(encodings)) {
|
||||
encodings = new Array(arguments.length)
|
||||
for (var i = 0; i < encodings.length; i++) {
|
||||
encodings[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no encodings, return all requested encodings
|
||||
if (!encodings || encodings.length === 0) {
|
||||
return this.negotiator.encodings()
|
||||
}
|
||||
|
||||
return this.negotiator.encodings(encodings)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted charsets or best fit based on `charsets`.
|
||||
*
|
||||
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['utf-8', 'utf-7', 'iso-8859-1']
|
||||
*
|
||||
* @param {String|Array} charsets...
|
||||
* @return {String|Array}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.charset =
|
||||
Accepts.prototype.charsets = function (charsets_) {
|
||||
var charsets = charsets_
|
||||
|
||||
// support flattened arguments
|
||||
if (charsets && !Array.isArray(charsets)) {
|
||||
charsets = new Array(arguments.length)
|
||||
for (var i = 0; i < charsets.length; i++) {
|
||||
charsets[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no charsets, return all requested charsets
|
||||
if (!charsets || charsets.length === 0) {
|
||||
return this.negotiator.charsets()
|
||||
}
|
||||
|
||||
return this.negotiator.charsets(charsets)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted languages or best fit based on `langs`.
|
||||
*
|
||||
* Given `Accept-Language: en;q=0.8, es, pt`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['es', 'pt', 'en']
|
||||
*
|
||||
* @param {String|Array} langs...
|
||||
* @return {Array|String}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.lang =
|
||||
Accepts.prototype.langs =
|
||||
Accepts.prototype.language =
|
||||
Accepts.prototype.languages = function (languages_) {
|
||||
var languages = languages_
|
||||
|
||||
// support flattened arguments
|
||||
if (languages && !Array.isArray(languages)) {
|
||||
languages = new Array(arguments.length)
|
||||
for (var i = 0; i < languages.length; i++) {
|
||||
languages[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no languages, return all requested languages
|
||||
if (!languages || languages.length === 0) {
|
||||
return this.negotiator.languages()
|
||||
}
|
||||
|
||||
return this.negotiator.languages(languages)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert extnames to mime.
|
||||
*
|
||||
* @param {String} type
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function extToMime (type) {
|
||||
return type.indexOf('/') === -1
|
||||
? mime.lookup(type)
|
||||
: type
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if mime is valid.
|
||||
*
|
||||
* @param {String} type
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function validMime (type) {
|
||||
return typeof type === 'string'
|
||||
}
|
||||
47
projects/status-panel/node_modules/accepts/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "accepts",
|
||||
"description": "Higher-level content negotiation",
|
||||
"version": "1.3.8",
|
||||
"contributors": [
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": "jshttp/accepts",
|
||||
"dependencies": {
|
||||
"mime-types": "~2.1.34",
|
||||
"negotiator": "0.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"deep-equal": "1.0.1",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-standard": "14.1.1",
|
||||
"eslint-plugin-import": "2.25.4",
|
||||
"eslint-plugin-markdown": "2.2.1",
|
||||
"eslint-plugin-node": "11.1.0",
|
||||
"eslint-plugin-promise": "4.3.1",
|
||||
"eslint-plugin-standard": "4.1.0",
|
||||
"mocha": "9.2.0",
|
||||
"nyc": "15.1.0"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
||||
},
|
||||
"keywords": [
|
||||
"content",
|
||||
"negotiation",
|
||||
"accept",
|
||||
"accepts"
|
||||
]
|
||||
}
|
||||
21
projects/status-panel/node_modules/array-flatten/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
43
projects/status-panel/node_modules/array-flatten/README.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# Array Flatten
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![NPM downloads][downloads-image]][downloads-url]
|
||||
[![Build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
> Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install array-flatten --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var flatten = require('array-flatten')
|
||||
|
||||
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
|
||||
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
|
||||
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
|
||||
//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
|
||||
|
||||
(function () {
|
||||
flatten(arguments) //=> [1, 2, 3]
|
||||
})(1, [2, 3])
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
|
||||
[npm-url]: https://npmjs.org/package/array-flatten
|
||||
[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/array-flatten
|
||||
[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
|
||||
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
|
||||
64
projects/status-panel/node_modules/array-flatten/array-flatten.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Expose `arrayFlatten`.
|
||||
*/
|
||||
module.exports = arrayFlatten
|
||||
|
||||
/**
|
||||
* Recursive flatten function with depth.
|
||||
*
|
||||
* @param {Array} array
|
||||
* @param {Array} result
|
||||
* @param {Number} depth
|
||||
* @return {Array}
|
||||
*/
|
||||
function flattenWithDepth (array, result, depth) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var value = array[i]
|
||||
|
||||
if (depth > 0 && Array.isArray(value)) {
|
||||
flattenWithDepth(value, result, depth - 1)
|
||||
} else {
|
||||
result.push(value)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive flatten function. Omitting depth is slightly faster.
|
||||
*
|
||||
* @param {Array} array
|
||||
* @param {Array} result
|
||||
* @return {Array}
|
||||
*/
|
||||
function flattenForever (array, result) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var value = array[i]
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
flattenForever(value, result)
|
||||
} else {
|
||||
result.push(value)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Flatten an array, with the ability to define a depth.
|
||||
*
|
||||
* @param {Array} array
|
||||
* @param {Number} depth
|
||||
* @return {Array}
|
||||
*/
|
||||
function arrayFlatten (array, depth) {
|
||||
if (depth == null) {
|
||||
return flattenForever(array, [])
|
||||
}
|
||||
|
||||
return flattenWithDepth(array, [], depth)
|
||||
}
|
||||
39
projects/status-panel/node_modules/array-flatten/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "array-flatten",
|
||||
"version": "1.1.1",
|
||||
"description": "Flatten an array of nested arrays into a single flat array",
|
||||
"main": "array-flatten.js",
|
||||
"files": [
|
||||
"array-flatten.js",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "istanbul cover _mocha -- -R spec"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/blakeembrey/array-flatten.git"
|
||||
},
|
||||
"keywords": [
|
||||
"array",
|
||||
"flatten",
|
||||
"arguments",
|
||||
"depth"
|
||||
],
|
||||
"author": {
|
||||
"name": "Blake Embrey",
|
||||
"email": "hello@blakeembrey.com",
|
||||
"url": "http://blakeembrey.me"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/blakeembrey/array-flatten/issues"
|
||||
},
|
||||
"homepage": "https://github.com/blakeembrey/array-flatten",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.3.13",
|
||||
"mocha": "^2.2.4",
|
||||
"pre-commit": "^1.0.7",
|
||||
"standard": "^3.7.3"
|
||||
}
|
||||
}
|
||||
21
projects/status-panel/node_modules/base64-js/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jameson Little
|
||||
|
||||
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.
|
||||
34
projects/status-panel/node_modules/base64-js/README.md
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
base64-js
|
||||
=========
|
||||
|
||||
`base64-js` does basic base64 encoding/decoding in pure JS.
|
||||
|
||||
[](http://travis-ci.org/beatgammit/base64-js)
|
||||
|
||||
Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.
|
||||
|
||||
Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
|
||||
|
||||
## install
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
`npm install base64-js` and `var base64js = require('base64-js')`
|
||||
|
||||
For use in web browsers do:
|
||||
|
||||
`<script src="base64js.min.js"></script>`
|
||||
|
||||
[Get supported base64-js with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-base64-js?utm_source=npm-base64-js&utm_medium=referral&utm_campaign=readme)
|
||||
|
||||
## methods
|
||||
|
||||
`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
|
||||
|
||||
* `byteLength` - Takes a base64 string and returns length of byte array
|
||||
* `toByteArray` - Takes a base64 string and returns a byte array
|
||||
* `fromByteArray` - Takes a byte array and returns a base64 string
|
||||
|
||||
## license
|
||||
|
||||
MIT
|
||||
1
projects/status-panel/node_modules/base64-js/base64js.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({"/":[function(a,b,c){'use strict';function d(a){var b=a.length;if(0<b%4)throw new Error("Invalid string. Length must be a multiple of 4");var c=a.indexOf("=");-1===c&&(c=b);var d=c===b?0:4-c%4;return[c,d]}function e(a,b,c){return 3*(b+c)/4-c}function f(a){var b,c,f=d(a),g=f[0],h=f[1],j=new m(e(a,g,h)),k=0,n=0<h?g-4:g;for(c=0;c<n;c+=4)b=l[a.charCodeAt(c)]<<18|l[a.charCodeAt(c+1)]<<12|l[a.charCodeAt(c+2)]<<6|l[a.charCodeAt(c+3)],j[k++]=255&b>>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;f<c;f+=3)d=(16711680&a[f]<<16)+(65280&a[f+1]<<8)+(255&a[f+2]),e.push(g(d));return e.join("")}function j(a){for(var b,c=a.length,d=c%3,e=[],f=16383,g=0,j=c-d;g<j;g+=f)e.push(h(a,g,g+f>j?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o<p;++o)k[o]=n[o],l[n.charCodeAt(o)]=o;l[45]=62,l[95]=63},{}]},{},[])("/")});
|
||||
3
projects/status-panel/node_modules/base64-js/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export function byteLength(b64: string): number;
|
||||
export function toByteArray(b64: string): Uint8Array;
|
||||
export function fromByteArray(uint8: Uint8Array): string;
|
||||
150
projects/status-panel/node_modules/base64-js/index.js
generated
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
'use strict'
|
||||
|
||||
exports.byteLength = byteLength
|
||||
exports.toByteArray = toByteArray
|
||||
exports.fromByteArray = fromByteArray
|
||||
|
||||
var lookup = []
|
||||
var revLookup = []
|
||||
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
|
||||
|
||||
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
||||
for (var i = 0, len = code.length; i < len; ++i) {
|
||||
lookup[i] = code[i]
|
||||
revLookup[code.charCodeAt(i)] = i
|
||||
}
|
||||
|
||||
// Support decoding URL-safe base64 strings, as Node.js does.
|
||||
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
||||
revLookup['-'.charCodeAt(0)] = 62
|
||||
revLookup['_'.charCodeAt(0)] = 63
|
||||
|
||||
function getLens (b64) {
|
||||
var len = b64.length
|
||||
|
||||
if (len % 4 > 0) {
|
||||
throw new Error('Invalid string. Length must be a multiple of 4')
|
||||
}
|
||||
|
||||
// Trim off extra bytes after placeholder bytes are found
|
||||
// See: https://github.com/beatgammit/base64-js/issues/42
|
||||
var validLen = b64.indexOf('=')
|
||||
if (validLen === -1) validLen = len
|
||||
|
||||
var placeHoldersLen = validLen === len
|
||||
? 0
|
||||
: 4 - (validLen % 4)
|
||||
|
||||
return [validLen, placeHoldersLen]
|
||||
}
|
||||
|
||||
// base64 is 4/3 + up to two characters of the original data
|
||||
function byteLength (b64) {
|
||||
var lens = getLens(b64)
|
||||
var validLen = lens[0]
|
||||
var placeHoldersLen = lens[1]
|
||||
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
||||
}
|
||||
|
||||
function _byteLength (b64, validLen, placeHoldersLen) {
|
||||
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
||||
}
|
||||
|
||||
function toByteArray (b64) {
|
||||
var tmp
|
||||
var lens = getLens(b64)
|
||||
var validLen = lens[0]
|
||||
var placeHoldersLen = lens[1]
|
||||
|
||||
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
|
||||
|
||||
var curByte = 0
|
||||
|
||||
// if there are placeholders, only get up to the last complete 4 chars
|
||||
var len = placeHoldersLen > 0
|
||||
? validLen - 4
|
||||
: validLen
|
||||
|
||||
var i
|
||||
for (i = 0; i < len; i += 4) {
|
||||
tmp =
|
||||
(revLookup[b64.charCodeAt(i)] << 18) |
|
||||
(revLookup[b64.charCodeAt(i + 1)] << 12) |
|
||||
(revLookup[b64.charCodeAt(i + 2)] << 6) |
|
||||
revLookup[b64.charCodeAt(i + 3)]
|
||||
arr[curByte++] = (tmp >> 16) & 0xFF
|
||||
arr[curByte++] = (tmp >> 8) & 0xFF
|
||||
arr[curByte++] = tmp & 0xFF
|
||||
}
|
||||
|
||||
if (placeHoldersLen === 2) {
|
||||
tmp =
|
||||
(revLookup[b64.charCodeAt(i)] << 2) |
|
||||
(revLookup[b64.charCodeAt(i + 1)] >> 4)
|
||||
arr[curByte++] = tmp & 0xFF
|
||||
}
|
||||
|
||||
if (placeHoldersLen === 1) {
|
||||
tmp =
|
||||
(revLookup[b64.charCodeAt(i)] << 10) |
|
||||
(revLookup[b64.charCodeAt(i + 1)] << 4) |
|
||||
(revLookup[b64.charCodeAt(i + 2)] >> 2)
|
||||
arr[curByte++] = (tmp >> 8) & 0xFF
|
||||
arr[curByte++] = tmp & 0xFF
|
||||
}
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
function tripletToBase64 (num) {
|
||||
return lookup[num >> 18 & 0x3F] +
|
||||
lookup[num >> 12 & 0x3F] +
|
||||
lookup[num >> 6 & 0x3F] +
|
||||
lookup[num & 0x3F]
|
||||
}
|
||||
|
||||
function encodeChunk (uint8, start, end) {
|
||||
var tmp
|
||||
var output = []
|
||||
for (var i = start; i < end; i += 3) {
|
||||
tmp =
|
||||
((uint8[i] << 16) & 0xFF0000) +
|
||||
((uint8[i + 1] << 8) & 0xFF00) +
|
||||
(uint8[i + 2] & 0xFF)
|
||||
output.push(tripletToBase64(tmp))
|
||||
}
|
||||
return output.join('')
|
||||
}
|
||||
|
||||
function fromByteArray (uint8) {
|
||||
var tmp
|
||||
var len = uint8.length
|
||||
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
|
||||
var parts = []
|
||||
var maxChunkLength = 16383 // must be multiple of 3
|
||||
|
||||
// go through the array every three bytes, we'll deal with trailing stuff later
|
||||
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
||||
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
|
||||
}
|
||||
|
||||
// pad the end with zeros, but make sure to not forget the extra bytes
|
||||
if (extraBytes === 1) {
|
||||
tmp = uint8[len - 1]
|
||||
parts.push(
|
||||
lookup[tmp >> 2] +
|
||||
lookup[(tmp << 4) & 0x3F] +
|
||||
'=='
|
||||
)
|
||||
} else if (extraBytes === 2) {
|
||||
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
|
||||
parts.push(
|
||||
lookup[tmp >> 10] +
|
||||
lookup[(tmp >> 4) & 0x3F] +
|
||||
lookup[(tmp << 2) & 0x3F] +
|
||||
'='
|
||||
)
|
||||
}
|
||||
|
||||
return parts.join('')
|
||||
}
|
||||
47
projects/status-panel/node_modules/base64-js/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "base64-js",
|
||||
"description": "Base64 encoding/decoding in pure JS",
|
||||
"version": "1.5.1",
|
||||
"author": "T. Jameson Little <t.jameson.little@gmail.com>",
|
||||
"typings": "index.d.ts",
|
||||
"bugs": {
|
||||
"url": "https://github.com/beatgammit/base64-js/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-minify": "^0.5.1",
|
||||
"benchmark": "^2.1.4",
|
||||
"browserify": "^16.3.0",
|
||||
"standard": "*",
|
||||
"tape": "4.x"
|
||||
},
|
||||
"homepage": "https://github.com/beatgammit/base64-js",
|
||||
"keywords": [
|
||||
"base64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/beatgammit/base64-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "browserify -s base64js -r ./ | minify > base64js.min.js",
|
||||
"lint": "standard",
|
||||
"test": "npm run lint && npm run unit",
|
||||
"unit": "tape test/*.js"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
}
|
||||
21
projects/status-panel/node_modules/better-sqlite3/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Joshua Wise
|
||||
|
||||
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.
|
||||
92
projects/status-panel/node_modules/better-sqlite3/README.md
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
# better-sqlite3 [](https://github.com/JoshuaWise/better-sqlite3/actions/workflows/build.yml?query=branch%3Amaster)
|
||||
|
||||
The fastest and simplest library for SQLite3 in Node.js.
|
||||
|
||||
- Full transaction support
|
||||
- High performance, efficiency, and safety
|
||||
- Easy-to-use synchronous API *(better concurrency than an asynchronous API... yes, you read that correctly)*
|
||||
- Support for user-defined functions, aggregates, virtual tables, and extensions
|
||||
- 64-bit integers *(invisible until you need them)*
|
||||
- Worker thread support *(for large/slow queries)*
|
||||
|
||||
## Help this project stay strong! 💪
|
||||
|
||||
`better-sqlite3` is used by thousands of developers and engineers on a daily basis. Long nights and weekends were spent keeping this project strong and dependable, with no ask for compensation or funding, until now. If your company uses `better-sqlite3`, ask your manager to consider supporting the project:
|
||||
|
||||
- [Become a GitHub sponsor](https://github.com/sponsors/JoshuaWise)
|
||||
- [Become a backer on Patreon](https://www.patreon.com/joshuawise)
|
||||
- [Make a one-time donation on PayPal](https://www.paypal.me/joshuathomaswise)
|
||||
|
||||
## How other libraries compare
|
||||
|
||||
| |select 1 row `get()` |select 100 rows `all()` |select 100 rows `iterate()` 1-by-1|insert 1 row `run()`|insert 100 rows in a transaction|
|
||||
|---|---|---|---|---|---|
|
||||
|better-sqlite3|1x|1x|1x|1x|1x|
|
||||
|[sqlite](https://www.npmjs.com/package/sqlite) and [sqlite3](https://www.npmjs.com/package/sqlite3)|11.7x slower|2.9x slower|24.4x slower|2.8x slower|15.6x slower|
|
||||
|
||||
> You can verify these results by [running the benchmark yourself](./docs/benchmark.md).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install better-sqlite3
|
||||
```
|
||||
|
||||
> You must be using Node.js v14.21.1 or above. Prebuilt binaries are available for [LTS versions](https://nodejs.org/en/about/releases/). If you have trouble installing, check the [troubleshooting guide](./docs/troubleshooting.md).
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const db = require('better-sqlite3')('foobar.db', options);
|
||||
|
||||
const row = db.prepare('SELECT * FROM users WHERE id = ?').get(userId);
|
||||
console.log(row.firstName, row.lastName, row.email);
|
||||
```
|
||||
|
||||
Though not required, [it is generally important to set the WAL pragma for performance reasons](https://github.com/WiseLibs/better-sqlite3/blob/master/docs/performance.md).
|
||||
|
||||
```js
|
||||
db.pragma('journal_mode = WAL');
|
||||
```
|
||||
|
||||
##### In ES6 module notation:
|
||||
|
||||
```js
|
||||
import Database from 'better-sqlite3';
|
||||
const db = new Database('foobar.db', options);
|
||||
db.pragma('journal_mode = WAL');
|
||||
```
|
||||
|
||||
## Why should I use this instead of [node-sqlite3](https://github.com/mapbox/node-sqlite3)?
|
||||
|
||||
- `node-sqlite3` uses asynchronous APIs for tasks that are either CPU-bound or serialized. That's not only bad design, but it wastes tons of resources. It also causes [mutex thrashing](https://en.wikipedia.org/wiki/Resource_contention) which has devastating effects on performance.
|
||||
- `node-sqlite3` exposes low-level (C language) memory management functions. `better-sqlite3` does it the JavaScript way, allowing the garbage collector to worry about memory management.
|
||||
- `better-sqlite3` is simpler to use, and it provides nice utilities for some operations that are very difficult or impossible in `node-sqlite3`.
|
||||
- `better-sqlite3` is much faster than `node-sqlite3` in most cases, and just as fast in all other cases.
|
||||
|
||||
#### When is this library not appropriate?
|
||||
|
||||
In most cases, if you're attempting something that cannot be reasonably accomplished with `better-sqlite3`, it probably cannot be reasonably accomplished with SQLite3 in general. For example, if you're executing queries that take one second to complete, and you expect to have many concurrent users executing those queries, no amount of asynchronicity will save you from SQLite3's serialized nature. Fortunately, SQLite3 is very *very* fast. With proper indexing, we've been able to achieve upward of 2000 queries per second with 5-way-joins in a 60 GB database, where each query was handling 5–50 kilobytes of real data.
|
||||
|
||||
If you have a performance problem, the most likely causes are inefficient queries, improper indexing, or a lack of [WAL mode](./docs/performance.md)—not `better-sqlite3` itself. However, there are some cases where `better-sqlite3` could be inappropriate:
|
||||
|
||||
- If you expect a high volume of concurrent reads each returning many megabytes of data (i.e., videos)
|
||||
- If you expect a high volume of concurrent writes (i.e., a social media site)
|
||||
- If your database's size is near the terabyte range
|
||||
|
||||
For these situations, you should probably use a full-fledged RDBMS such as [PostgreSQL](https://www.postgresql.org/).
|
||||
|
||||
# Documentation
|
||||
|
||||
- [API documentation](./docs/api.md)
|
||||
- [Performance](./docs/performance.md) (also see [benchmark results](./docs/benchmark.md))
|
||||
- [64-bit integer support](./docs/integer.md)
|
||||
- [Worker thread support](./docs/threads.md)
|
||||
- [Unsafe mode (advanced)](./docs/unsafe.md)
|
||||
- [SQLite3 compilation (advanced)](./docs/compilation.md)
|
||||
- [Contribution rules](./docs/contribution.md)
|
||||
- [Code of conduct](./docs/conduct.md)
|
||||
|
||||
# License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
38
projects/status-panel/node_modules/better-sqlite3/binding.gyp
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# ===
|
||||
# This is the main GYP file, which builds better-sqlite3 with SQLite3 itself.
|
||||
# ===
|
||||
|
||||
{
|
||||
'includes': ['deps/common.gypi'],
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'better_sqlite3',
|
||||
'dependencies': ['deps/sqlite3.gyp:sqlite3'],
|
||||
'sources': ['src/better_sqlite3.cpp'],
|
||||
'cflags_cc': ['-std=c++17'],
|
||||
'xcode_settings': {
|
||||
'OTHER_CPLUSPLUSFLAGS': ['-std=c++17', '-stdlib=libc++'],
|
||||
},
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'AdditionalOptions': [
|
||||
'/std:c++17',
|
||||
],
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['OS=="linux"', {
|
||||
'ldflags': [
|
||||
'-Wl,-Bsymbolic',
|
||||
'-Wl,--exclude-libs,ALL',
|
||||
],
|
||||
}],
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'test_extension',
|
||||
'dependencies': ['deps/sqlite3.gyp:sqlite3'],
|
||||
'conditions': [['sqlite3 == ""', { 'sources': ['deps/test_extension.c'] }]],
|
||||
},
|
||||
],
|
||||
}
|
||||
362
projects/status-panel/node_modules/better-sqlite3/build/Makefile
generated
vendored
Normal file
@@ -0,0 +1,362 @@
|
||||
# We borrow heavily from the kernel build setup, though we are simpler since
|
||||
# we don't have Kconfig tweaking settings on us.
|
||||
|
||||
# The implicit make rules have it looking for RCS files, among other things.
|
||||
# We instead explicitly write all the rules we care about.
|
||||
# It's even quicker (saves ~200ms) to pass -r on the command line.
|
||||
MAKEFLAGS=-r
|
||||
|
||||
# The source directory tree.
|
||||
srcdir := ..
|
||||
abs_srcdir := $(abspath $(srcdir))
|
||||
|
||||
# The name of the builddir.
|
||||
builddir_name ?= .
|
||||
|
||||
# The V=1 flag on command line makes us verbosely print command lines.
|
||||
ifdef V
|
||||
quiet=
|
||||
else
|
||||
quiet=quiet_
|
||||
endif
|
||||
|
||||
# Specify BUILDTYPE=Release on the command line for a release build.
|
||||
BUILDTYPE ?= Release
|
||||
|
||||
# Directory all our build output goes into.
|
||||
# Note that this must be two directories beneath src/ for unit tests to pass,
|
||||
# as they reach into the src/ directory for data with relative paths.
|
||||
builddir ?= $(builddir_name)/$(BUILDTYPE)
|
||||
abs_builddir := $(abspath $(builddir))
|
||||
depsdir := $(builddir)/.deps
|
||||
|
||||
# Object output directory.
|
||||
obj := $(builddir)/obj
|
||||
abs_obj := $(abspath $(obj))
|
||||
|
||||
# We build up a list of every single one of the targets so we can slurp in the
|
||||
# generated dependency rule Makefiles in one pass.
|
||||
all_deps :=
|
||||
|
||||
|
||||
|
||||
CC.target ?= $(CC)
|
||||
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
|
||||
CXX.target ?= $(CXX)
|
||||
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
|
||||
LINK.target ?= $(LINK)
|
||||
LDFLAGS.target ?= $(LDFLAGS)
|
||||
AR.target ?= $(AR)
|
||||
PLI.target ?= pli
|
||||
|
||||
# C++ apps need to be linked with g++.
|
||||
LINK ?= $(CXX.target)
|
||||
|
||||
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
|
||||
# to replicate this environment fallback in make as well.
|
||||
CC.host ?= gcc
|
||||
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
|
||||
CXX.host ?= g++
|
||||
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
|
||||
LINK.host ?= $(CXX.host)
|
||||
LDFLAGS.host ?= $(LDFLAGS_host)
|
||||
AR.host ?= ar
|
||||
PLI.host ?= pli
|
||||
|
||||
# Define a dir function that can handle spaces.
|
||||
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
|
||||
# "leading spaces cannot appear in the text of the first argument as written.
|
||||
# These characters can be put into the argument value by variable substitution."
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
|
||||
# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
|
||||
replace_spaces = $(subst $(space),?,$1)
|
||||
unreplace_spaces = $(subst ?,$(space),$1)
|
||||
dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
|
||||
|
||||
# Flags to make gcc output dependency info. Note that you need to be
|
||||
# careful here to use the flags that ccache and distcc can understand.
|
||||
# We write to a dep file on the side first and then rename at the end
|
||||
# so we can't end up with a broken dep file.
|
||||
depfile = $(depsdir)/$(call replace_spaces,$@).d
|
||||
DEPFLAGS = -MMD -MF $(depfile).raw
|
||||
|
||||
# We have to fixup the deps output in a few ways.
|
||||
# (1) the file output should mention the proper .o file.
|
||||
# ccache or distcc lose the path to the target, so we convert a rule of
|
||||
# the form:
|
||||
# foobar.o: DEP1 DEP2
|
||||
# into
|
||||
# path/to/foobar.o: DEP1 DEP2
|
||||
# (2) we want missing files not to cause us to fail to build.
|
||||
# We want to rewrite
|
||||
# foobar.o: DEP1 DEP2 \
|
||||
# DEP3
|
||||
# to
|
||||
# DEP1:
|
||||
# DEP2:
|
||||
# DEP3:
|
||||
# so if the files are missing, they're just considered phony rules.
|
||||
# We have to do some pretty insane escaping to get those backslashes
|
||||
# and dollar signs past make, the shell, and sed at the same time.
|
||||
# Doesn't work with spaces, but that's fine: .d files have spaces in
|
||||
# their names replaced with other characters.
|
||||
define fixup_dep
|
||||
# The depfile may not exist if the input file didn't have any #includes.
|
||||
touch $(depfile).raw
|
||||
# Fixup path as in (1).
|
||||
sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
|
||||
# Add extra rules as in (2).
|
||||
# We remove slashes and replace spaces with new lines;
|
||||
# remove blank lines;
|
||||
# delete the first line and append a colon to the remaining lines.
|
||||
sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
|
||||
grep -v '^$$' |\
|
||||
sed -e 1d -e 's|$$|:|' \
|
||||
>> $(depfile)
|
||||
rm $(depfile).raw
|
||||
endef
|
||||
|
||||
# Command definitions:
|
||||
# - cmd_foo is the actual command to run;
|
||||
# - quiet_cmd_foo is the brief-output summary of the command.
|
||||
|
||||
quiet_cmd_cc = CC($(TOOLSET)) $@
|
||||
cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c
|
||||
|
||||
quiet_cmd_cxx = CXX($(TOOLSET)) $@
|
||||
cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c
|
||||
|
||||
quiet_cmd_objc = CXX($(TOOLSET)) $@
|
||||
cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
|
||||
|
||||
quiet_cmd_objcxx = CXX($(TOOLSET)) $@
|
||||
cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
|
||||
|
||||
# Commands for precompiled header files.
|
||||
quiet_cmd_pch_c = CXX($(TOOLSET)) $@
|
||||
cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
|
||||
quiet_cmd_pch_cc = CXX($(TOOLSET)) $@
|
||||
cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
|
||||
quiet_cmd_pch_m = CXX($(TOOLSET)) $@
|
||||
cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
|
||||
quiet_cmd_pch_mm = CXX($(TOOLSET)) $@
|
||||
cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
|
||||
|
||||
# gyp-mac-tool is written next to the root Makefile by gyp.
|
||||
# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd
|
||||
# already.
|
||||
quiet_cmd_mac_tool = MACTOOL $(4) $<
|
||||
cmd_mac_tool = /opt/homebrew/opt/python@3.14/bin/python3.14 gyp-mac-tool $(4) $< "$@"
|
||||
|
||||
quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@
|
||||
cmd_mac_package_framework = /opt/homebrew/opt/python@3.14/bin/python3.14 gyp-mac-tool package-framework "$@" $(4)
|
||||
|
||||
quiet_cmd_infoplist = INFOPLIST $@
|
||||
cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@"
|
||||
|
||||
quiet_cmd_touch = TOUCH $@
|
||||
cmd_touch = touch $@
|
||||
|
||||
quiet_cmd_copy = COPY $@
|
||||
# send stderr to /dev/null to ignore messages when linking directories.
|
||||
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
|
||||
|
||||
quiet_cmd_symlink = SYMLINK $@
|
||||
cmd_symlink = ln -sf "$<" "$@"
|
||||
|
||||
quiet_cmd_alink = LIBTOOL-STATIC $@
|
||||
cmd_alink = rm -f $@ && /opt/homebrew/opt/python@3.14/bin/python3.14 gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
|
||||
|
||||
quiet_cmd_link = LINK($(TOOLSET)) $@
|
||||
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
|
||||
|
||||
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
|
||||
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
|
||||
|
||||
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
|
||||
cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
|
||||
|
||||
|
||||
# Define an escape_quotes function to escape single quotes.
|
||||
# This allows us to handle quotes properly as long as we always use
|
||||
# use single quotes and escape_quotes.
|
||||
escape_quotes = $(subst ','\'',$(1))
|
||||
# This comment is here just to include a ' to unconfuse syntax highlighting.
|
||||
# Define an escape_vars function to escape '$' variable syntax.
|
||||
# This allows us to read/write command lines with shell variables (e.g.
|
||||
# $LD_LIBRARY_PATH), without triggering make substitution.
|
||||
escape_vars = $(subst $$,$$$$,$(1))
|
||||
# Helper that expands to a shell command to echo a string exactly as it is in
|
||||
# make. This uses printf instead of echo because printf's behaviour with respect
|
||||
# to escape sequences is more portable than echo's across different shells
|
||||
# (e.g., dash, bash).
|
||||
exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
|
||||
|
||||
# Helper to compare the command we're about to run against the command
|
||||
# we logged the last time we ran the command. Produces an empty
|
||||
# string (false) when the commands match.
|
||||
# Tricky point: Make has no string-equality test function.
|
||||
# The kernel uses the following, but it seems like it would have false
|
||||
# positives, where one string reordered its arguments.
|
||||
# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
|
||||
# $(filter-out $(cmd_$@), $(cmd_$(1))))
|
||||
# We instead substitute each for the empty string into the other, and
|
||||
# say they're equal if both substitutions produce the empty string.
|
||||
# .d files contain ? instead of spaces, take that into account.
|
||||
command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
|
||||
$(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
|
||||
|
||||
# Helper that is non-empty when a prerequisite changes.
|
||||
# Normally make does this implicitly, but we force rules to always run
|
||||
# so we can check their command lines.
|
||||
# $? -- new prerequisites
|
||||
# $| -- order-only dependencies
|
||||
prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
|
||||
|
||||
# Helper that executes all postbuilds until one fails.
|
||||
define do_postbuilds
|
||||
@E=0;\
|
||||
for p in $(POSTBUILDS); do\
|
||||
eval $$p;\
|
||||
E=$$?;\
|
||||
if [ $$E -ne 0 ]; then\
|
||||
break;\
|
||||
fi;\
|
||||
done;\
|
||||
if [ $$E -ne 0 ]; then\
|
||||
rm -rf "$@";\
|
||||
exit $$E;\
|
||||
fi
|
||||
endef
|
||||
|
||||
# do_cmd: run a command via the above cmd_foo names, if necessary.
|
||||
# Should always run for a given target to handle command-line changes.
|
||||
# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
|
||||
# Third argument, if non-zero, makes it do POSTBUILDS processing.
|
||||
# Note: We intentionally do NOT call dirx for depfile, since it contains ? for
|
||||
# spaces already and dirx strips the ? characters.
|
||||
define do_cmd
|
||||
$(if $(or $(command_changed),$(prereq_changed)),
|
||||
@$(call exact_echo, $($(quiet)cmd_$(1)))
|
||||
@mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
|
||||
$(if $(findstring flock,$(word 2,$(cmd_$1))),
|
||||
@$(cmd_$(1))
|
||||
@echo " $(quiet_cmd_$(1)): Finished",
|
||||
@$(cmd_$(1))
|
||||
)
|
||||
@$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
|
||||
@$(if $(2),$(fixup_dep))
|
||||
$(if $(and $(3), $(POSTBUILDS)),
|
||||
$(call do_postbuilds)
|
||||
)
|
||||
)
|
||||
endef
|
||||
|
||||
# Declare the "all" target first so it is the default,
|
||||
# even though we don't have the deps yet.
|
||||
.PHONY: all
|
||||
all:
|
||||
|
||||
# make looks for ways to re-generate included makefiles, but in our case, we
|
||||
# don't have a direct way. Explicitly telling make that it has nothing to do
|
||||
# for them makes it go faster.
|
||||
%.d: ;
|
||||
|
||||
# Use FORCE_DO_CMD to force a target to run. Should be coupled with
|
||||
# do_cmd.
|
||||
.PHONY: FORCE_DO_CMD
|
||||
FORCE_DO_CMD:
|
||||
|
||||
TOOLSET := target
|
||||
# Suffix rules, putting all outputs into $(obj).
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD
|
||||
@$(call do_cmd,objc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD
|
||||
@$(call do_cmd,objcxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
# Try building from generated source, too.
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD
|
||||
@$(call do_cmd,objc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD
|
||||
@$(call do_cmd,objcxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD
|
||||
@$(call do_cmd,objc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD
|
||||
@$(call do_cmd,objcxx,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
|
||||
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
|
||||
$(findstring $(join ^,$(prefix)),\
|
||||
$(join ^,better_sqlite3.target.mk)))),)
|
||||
include better_sqlite3.target.mk
|
||||
endif
|
||||
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
|
||||
$(findstring $(join ^,$(prefix)),\
|
||||
$(join ^,deps/locate_sqlite3.target.mk)))),)
|
||||
include deps/locate_sqlite3.target.mk
|
||||
endif
|
||||
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
|
||||
$(findstring $(join ^,$(prefix)),\
|
||||
$(join ^,deps/sqlite3.target.mk)))),)
|
||||
include deps/sqlite3.target.mk
|
||||
endif
|
||||
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
|
||||
$(findstring $(join ^,$(prefix)),\
|
||||
$(join ^,test_extension.target.mk)))),)
|
||||
include test_extension.target.mk
|
||||
endif
|
||||
|
||||
quiet_cmd_regen_makefile = ACTION Regenerating $@
|
||||
cmd_regen_makefile = cd $(srcdir); /opt/homebrew/Cellar/node@22/22.22.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/jianzhang/Library/Caches/node-gyp/22.22.0" "-Dnode_gyp_dir=/opt/homebrew/Cellar/node@22/22.22.0/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/jianzhang/Library/Caches/node-gyp/22.22.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/jianzhang/.openclaw/workspace/projects/status-panel/node_modules/better-sqlite3" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/jianzhang/.openclaw/workspace/projects/status-panel/node_modules/better-sqlite3/build/config.gypi -I/opt/homebrew/Cellar/node@22/22.22.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
|
||||
Makefile: $(srcdir)/../../../../../../Library/Caches/node-gyp/22.22.0/include/node/common.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../../opt/homebrew/Cellar/node@22/22.22.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/deps/defines.gypi $(srcdir)/build/config.gypi $(srcdir)/deps/sqlite3.gyp $(srcdir)/deps/common.gypi
|
||||
$(call do_cmd,regen_makefile)
|
||||
|
||||
# "all" is a concatenation of the "all" targets from all the included
|
||||
# sub-makefiles. This is just here to clarify.
|
||||
all:
|
||||
|
||||
# Add in dependency-tracking rules. $(all_deps) is the list of every single
|
||||
# target in our tree. Only consider the ones with .d (dependency) info:
|
||||
d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
|
||||
ifneq ($(d_files),)
|
||||
include $(d_files)
|
||||
endif
|
||||
1
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/Release/better_sqlite3.node.d
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
cmd_Release/better_sqlite3.node := c++ -bundle -undefined dynamic_lookup -Wl,-search_paths_first -Wl,-dead_strip -mmacosx-version-min=10.7 -arch arm64 -L./Release -stdlib=libc++ -o Release/better_sqlite3.node Release/obj.target/better_sqlite3/src/better_sqlite3.o Release/sqlite3.a
|
||||
123
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/Release/obj.target/better_sqlite3/src/better_sqlite3.o.d
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
cmd_Release/obj.target/better_sqlite3/src/better_sqlite3.o := c++ -o Release/obj.target/better_sqlite3/src/better_sqlite3.o ../src/better_sqlite3.cpp '-DNODE_GYP_MODULE_NAME=better_sqlite3' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_FILE_OFFSET_BITS=64' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-DBUILDING_NODE_EXTENSION' '-DNDEBUG' -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include -I./Release/obj/gen/sqlite3 -O3 -fno-strict-aliasing -flto -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -std=c++17 -stdlib=libc++ -MMD -MF ./Release/.deps/Release/obj.target/better_sqlite3/src/better_sqlite3.o.d.raw -c
|
||||
Release/obj.target/better_sqlite3/src/better_sqlite3.o: \
|
||||
../src/better_sqlite3.cpp ../src/better_sqlite3.hpp \
|
||||
Release/obj/gen/sqlite3/sqlite3.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/cppgc/common.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8config.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-array-buffer.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-local-handle.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-handle-base.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-internal.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-object.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-maybe.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-persistent-handle.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-weak-callback-info.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-primitive.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-data.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-value.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-traced-handle.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-container.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-context.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-snapshot.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-isolate.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-callbacks.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-promise.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-debug.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-script.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-memory-span.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-message.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-embedder-heap.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-function-callback.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-microtask.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-statistics.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-unwinder.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-embedder-state-scope.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-date.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-exception.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-extension.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-external.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-function.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-template.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-initialization.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-platform.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-source-location.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-json.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-locker.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-microtask-queue.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-primitive-object.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-proxy.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-regexp.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-typed-array.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-value-serializer.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-version.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-wasm.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_version.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_api.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/js_native_api.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/js_native_api_types.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_api_types.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_object_wrap.h \
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_buffer.h
|
||||
../src/better_sqlite3.cpp:
|
||||
../src/better_sqlite3.hpp:
|
||||
Release/obj/gen/sqlite3/sqlite3.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/cppgc/common.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8config.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-array-buffer.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-local-handle.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-handle-base.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-internal.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-object.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-maybe.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-persistent-handle.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-weak-callback-info.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-primitive.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-data.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-value.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-traced-handle.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-container.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-context.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-snapshot.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-isolate.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-callbacks.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-promise.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-debug.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-script.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-memory-span.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-message.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-embedder-heap.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-function-callback.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-microtask.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-statistics.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-unwinder.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-embedder-state-scope.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-date.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-exception.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-extension.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-external.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-function.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-template.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-initialization.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-platform.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-source-location.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-json.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-locker.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-microtask-queue.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-primitive-object.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-proxy.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-regexp.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-typed-array.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-value-serializer.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-version.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/v8-wasm.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_version.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_api.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/js_native_api.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/js_native_api_types.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_api_types.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_object_wrap.h:
|
||||
/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node/node_buffer.h:
|
||||
1
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/Release/obj.target/deps/locate_sqlite3.stamp.d
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
cmd_Release/obj.target/deps/locate_sqlite3.stamp := touch Release/obj.target/deps/locate_sqlite3.stamp
|
||||
4
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o.d
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
cmd_Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o := cc -o Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o Release/obj/gen/sqlite3/sqlite3.c '-DNODE_GYP_MODULE_NAME=sqlite3' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_FILE_OFFSET_BITS=64' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-DHAVE_INT16_T=1' '-DHAVE_INT32_T=1' '-DHAVE_INT8_T=1' '-DHAVE_STDINT_H=1' '-DHAVE_UINT16_T=1' '-DHAVE_UINT32_T=1' '-DHAVE_UINT8_T=1' '-DHAVE_USLEEP=1' '-DSQLITE_DEFAULT_CACHE_SIZE=-16000' '-DSQLITE_DEFAULT_FOREIGN_KEYS=1' '-DSQLITE_DEFAULT_MEMSTATUS=0' '-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1' '-DSQLITE_DQS=0' '-DSQLITE_ENABLE_COLUMN_METADATA' '-DSQLITE_ENABLE_DESERIALIZE' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_FTS3_PARENTHESIS' '-DSQLITE_ENABLE_FTS4' '-DSQLITE_ENABLE_FTS5' '-DSQLITE_ENABLE_GEOPOLY' '-DSQLITE_ENABLE_JSON1' '-DSQLITE_ENABLE_MATH_FUNCTIONS' '-DSQLITE_ENABLE_RTREE' '-DSQLITE_ENABLE_STAT4' '-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT' '-DSQLITE_LIKE_DOESNT_MATCH_BLOBS' '-DSQLITE_OMIT_DEPRECATED' '-DSQLITE_OMIT_PROGRESS_CALLBACK' '-DSQLITE_OMIT_SHARED_CACHE' '-DSQLITE_OMIT_TCL_VARIABLE' '-DSQLITE_SOUNDEX' '-DSQLITE_THREADSAFE=2' '-DSQLITE_TRACE_SIZE_LIMIT=32' '-DSQLITE_USE_URI=0' '-DNDEBUG' -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include -I./Release/obj/gen/sqlite3 -O3 -fno-strict-aliasing -flto -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -w -std=c99 -MMD -MF ./Release/.deps/Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o.d.raw -c
|
||||
Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o: \
|
||||
Release/obj/gen/sqlite3/sqlite3.c
|
||||
Release/obj/gen/sqlite3/sqlite3.c:
|
||||
7
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/Release/obj.target/test_extension/deps/test_extension.o.d
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
cmd_Release/obj.target/test_extension/deps/test_extension.o := cc -o Release/obj.target/test_extension/deps/test_extension.o ../deps/test_extension.c '-DNODE_GYP_MODULE_NAME=test_extension' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_FILE_OFFSET_BITS=64' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-DBUILDING_NODE_EXTENSION' '-DNDEBUG' -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib -I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include -I./Release/obj/gen/sqlite3 -O3 -fno-strict-aliasing -flto -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -MMD -MF ./Release/.deps/Release/obj.target/test_extension/deps/test_extension.o.d.raw -c
|
||||
Release/obj.target/test_extension/deps/test_extension.o: \
|
||||
../deps/test_extension.c Release/obj/gen/sqlite3/sqlite3ext.h \
|
||||
Release/obj/gen/sqlite3/sqlite3.h
|
||||
../deps/test_extension.c:
|
||||
Release/obj/gen/sqlite3/sqlite3ext.h:
|
||||
Release/obj/gen/sqlite3/sqlite3.h:
|
||||
1
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/Release/sqlite3.a.d
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
cmd_Release/sqlite3.a := rm -f Release/sqlite3.a && /opt/homebrew/opt/python@3.14/bin/python3.14 gyp-mac-tool filter-libtool libtool -static -o Release/sqlite3.a Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
|
||||
1
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/Release/test_extension.node.d
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
cmd_Release/test_extension.node := c++ -bundle -undefined dynamic_lookup -Wl,-search_paths_first -Wl,-dead_strip -mmacosx-version-min=10.7 -arch arm64 -L./Release -stdlib=libc++ -o Release/test_extension.node Release/obj.target/test_extension/deps/test_extension.o Release/sqlite3.a
|
||||
1
projects/status-panel/node_modules/better-sqlite3/build/Release/.deps/ba23eeee118cd63e16015df367567cb043fed872.intermediate.d
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
cmd_ba23eeee118cd63e16015df367567cb043fed872.intermediate := LD_LIBRARY_PATH=/Users/jianzhang/.openclaw/workspace/projects/status-panel/node_modules/better-sqlite3/build/Release/lib.host:/Users/jianzhang/.openclaw/workspace/projects/status-panel/node_modules/better-sqlite3/build/Release/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps; mkdir -p /Users/jianzhang/.openclaw/workspace/projects/status-panel/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3; node copy.js "/Users/jianzhang/.openclaw/workspace/projects/status-panel/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3" ""
|
||||
BIN
projects/status-panel/node_modules/better-sqlite3/build/Release/better_sqlite3.node
generated
vendored
Executable file
BIN
projects/status-panel/node_modules/better-sqlite3/build/Release/obj.target/better_sqlite3/src/better_sqlite3.o
generated
vendored
Normal file
0
projects/status-panel/node_modules/better-sqlite3/build/Release/obj.target/deps/locate_sqlite3.stamp
generated
vendored
Normal file
BIN
projects/status-panel/node_modules/better-sqlite3/build/Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
generated
vendored
Normal file
BIN
projects/status-panel/node_modules/better-sqlite3/build/Release/obj.target/test_extension/deps/test_extension.o
generated
vendored
Normal file
255954
projects/status-panel/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3/sqlite3.c
generated
vendored
Normal file
13374
projects/status-panel/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3/sqlite3.h
generated
vendored
Normal file
719
projects/status-panel/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3/sqlite3ext.h
generated
vendored
Normal file
@@ -0,0 +1,719 @@
|
||||
/*
|
||||
** 2006 June 7
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** This header file defines the SQLite interface for use by
|
||||
** shared libraries that want to be imported as extensions into
|
||||
** an SQLite instance. Shared libraries that intend to be loaded
|
||||
** as extensions by SQLite should #include this file instead of
|
||||
** sqlite3.h.
|
||||
*/
|
||||
#ifndef SQLITE3EXT_H
|
||||
#define SQLITE3EXT_H
|
||||
#include "sqlite3.h"
|
||||
|
||||
/*
|
||||
** The following structure holds pointers to all of the SQLite API
|
||||
** routines.
|
||||
**
|
||||
** WARNING: In order to maintain backwards compatibility, add new
|
||||
** interfaces to the end of this structure only. If you insert new
|
||||
** interfaces in the middle of this structure, then older different
|
||||
** versions of SQLite will not be able to load each other's shared
|
||||
** libraries!
|
||||
*/
|
||||
struct sqlite3_api_routines {
|
||||
void * (*aggregate_context)(sqlite3_context*,int nBytes);
|
||||
int (*aggregate_count)(sqlite3_context*);
|
||||
int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
|
||||
int (*bind_double)(sqlite3_stmt*,int,double);
|
||||
int (*bind_int)(sqlite3_stmt*,int,int);
|
||||
int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
|
||||
int (*bind_null)(sqlite3_stmt*,int);
|
||||
int (*bind_parameter_count)(sqlite3_stmt*);
|
||||
int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
|
||||
const char * (*bind_parameter_name)(sqlite3_stmt*,int);
|
||||
int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
|
||||
int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
|
||||
int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
|
||||
int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
|
||||
int (*busy_timeout)(sqlite3*,int ms);
|
||||
int (*changes)(sqlite3*);
|
||||
int (*close)(sqlite3*);
|
||||
int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,
|
||||
int eTextRep,const char*));
|
||||
int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,
|
||||
int eTextRep,const void*));
|
||||
const void * (*column_blob)(sqlite3_stmt*,int iCol);
|
||||
int (*column_bytes)(sqlite3_stmt*,int iCol);
|
||||
int (*column_bytes16)(sqlite3_stmt*,int iCol);
|
||||
int (*column_count)(sqlite3_stmt*pStmt);
|
||||
const char * (*column_database_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_database_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_decltype)(sqlite3_stmt*,int i);
|
||||
const void * (*column_decltype16)(sqlite3_stmt*,int);
|
||||
double (*column_double)(sqlite3_stmt*,int iCol);
|
||||
int (*column_int)(sqlite3_stmt*,int iCol);
|
||||
sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
|
||||
const char * (*column_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_origin_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_origin_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_table_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_table_name16)(sqlite3_stmt*,int);
|
||||
const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
|
||||
const void * (*column_text16)(sqlite3_stmt*,int iCol);
|
||||
int (*column_type)(sqlite3_stmt*,int iCol);
|
||||
sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
|
||||
void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
|
||||
int (*complete)(const char*sql);
|
||||
int (*complete16)(const void*sql);
|
||||
int (*create_collation)(sqlite3*,const char*,int,void*,
|
||||
int(*)(void*,int,const void*,int,const void*));
|
||||
int (*create_collation16)(sqlite3*,const void*,int,void*,
|
||||
int(*)(void*,int,const void*,int,const void*));
|
||||
int (*create_function)(sqlite3*,const char*,int,int,void*,
|
||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*));
|
||||
int (*create_function16)(sqlite3*,const void*,int,int,void*,
|
||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*));
|
||||
int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
|
||||
int (*data_count)(sqlite3_stmt*pStmt);
|
||||
sqlite3 * (*db_handle)(sqlite3_stmt*);
|
||||
int (*declare_vtab)(sqlite3*,const char*);
|
||||
int (*enable_shared_cache)(int);
|
||||
int (*errcode)(sqlite3*db);
|
||||
const char * (*errmsg)(sqlite3*);
|
||||
const void * (*errmsg16)(sqlite3*);
|
||||
int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
|
||||
int (*expired)(sqlite3_stmt*);
|
||||
int (*finalize)(sqlite3_stmt*pStmt);
|
||||
void (*free)(void*);
|
||||
void (*free_table)(char**result);
|
||||
int (*get_autocommit)(sqlite3*);
|
||||
void * (*get_auxdata)(sqlite3_context*,int);
|
||||
int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
|
||||
int (*global_recover)(void);
|
||||
void (*interruptx)(sqlite3*);
|
||||
sqlite_int64 (*last_insert_rowid)(sqlite3*);
|
||||
const char * (*libversion)(void);
|
||||
int (*libversion_number)(void);
|
||||
void *(*malloc)(int);
|
||||
char * (*mprintf)(const char*,...);
|
||||
int (*open)(const char*,sqlite3**);
|
||||
int (*open16)(const void*,sqlite3**);
|
||||
int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
|
||||
int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
|
||||
void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
|
||||
void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
|
||||
void *(*realloc)(void*,int);
|
||||
int (*reset)(sqlite3_stmt*pStmt);
|
||||
void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_double)(sqlite3_context*,double);
|
||||
void (*result_error)(sqlite3_context*,const char*,int);
|
||||
void (*result_error16)(sqlite3_context*,const void*,int);
|
||||
void (*result_int)(sqlite3_context*,int);
|
||||
void (*result_int64)(sqlite3_context*,sqlite_int64);
|
||||
void (*result_null)(sqlite3_context*);
|
||||
void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
|
||||
void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_value)(sqlite3_context*,sqlite3_value*);
|
||||
void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
|
||||
int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,
|
||||
const char*,const char*),void*);
|
||||
void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
|
||||
char * (*xsnprintf)(int,char*,const char*,...);
|
||||
int (*step)(sqlite3_stmt*);
|
||||
int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,
|
||||
char const**,char const**,int*,int*,int*);
|
||||
void (*thread_cleanup)(void);
|
||||
int (*total_changes)(sqlite3*);
|
||||
void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
|
||||
int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
|
||||
void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,
|
||||
sqlite_int64),void*);
|
||||
void * (*user_data)(sqlite3_context*);
|
||||
const void * (*value_blob)(sqlite3_value*);
|
||||
int (*value_bytes)(sqlite3_value*);
|
||||
int (*value_bytes16)(sqlite3_value*);
|
||||
double (*value_double)(sqlite3_value*);
|
||||
int (*value_int)(sqlite3_value*);
|
||||
sqlite_int64 (*value_int64)(sqlite3_value*);
|
||||
int (*value_numeric_type)(sqlite3_value*);
|
||||
const unsigned char * (*value_text)(sqlite3_value*);
|
||||
const void * (*value_text16)(sqlite3_value*);
|
||||
const void * (*value_text16be)(sqlite3_value*);
|
||||
const void * (*value_text16le)(sqlite3_value*);
|
||||
int (*value_type)(sqlite3_value*);
|
||||
char *(*vmprintf)(const char*,va_list);
|
||||
/* Added ??? */
|
||||
int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
|
||||
/* Added by 3.3.13 */
|
||||
int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
|
||||
int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
|
||||
int (*clear_bindings)(sqlite3_stmt*);
|
||||
/* Added by 3.4.1 */
|
||||
int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,
|
||||
void (*xDestroy)(void *));
|
||||
/* Added by 3.5.0 */
|
||||
int (*bind_zeroblob)(sqlite3_stmt*,int,int);
|
||||
int (*blob_bytes)(sqlite3_blob*);
|
||||
int (*blob_close)(sqlite3_blob*);
|
||||
int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,
|
||||
int,sqlite3_blob**);
|
||||
int (*blob_read)(sqlite3_blob*,void*,int,int);
|
||||
int (*blob_write)(sqlite3_blob*,const void*,int,int);
|
||||
int (*create_collation_v2)(sqlite3*,const char*,int,void*,
|
||||
int(*)(void*,int,const void*,int,const void*),
|
||||
void(*)(void*));
|
||||
int (*file_control)(sqlite3*,const char*,int,void*);
|
||||
sqlite3_int64 (*memory_highwater)(int);
|
||||
sqlite3_int64 (*memory_used)(void);
|
||||
sqlite3_mutex *(*mutex_alloc)(int);
|
||||
void (*mutex_enter)(sqlite3_mutex*);
|
||||
void (*mutex_free)(sqlite3_mutex*);
|
||||
void (*mutex_leave)(sqlite3_mutex*);
|
||||
int (*mutex_try)(sqlite3_mutex*);
|
||||
int (*open_v2)(const char*,sqlite3**,int,const char*);
|
||||
int (*release_memory)(int);
|
||||
void (*result_error_nomem)(sqlite3_context*);
|
||||
void (*result_error_toobig)(sqlite3_context*);
|
||||
int (*sleep)(int);
|
||||
void (*soft_heap_limit)(int);
|
||||
sqlite3_vfs *(*vfs_find)(const char*);
|
||||
int (*vfs_register)(sqlite3_vfs*,int);
|
||||
int (*vfs_unregister)(sqlite3_vfs*);
|
||||
int (*xthreadsafe)(void);
|
||||
void (*result_zeroblob)(sqlite3_context*,int);
|
||||
void (*result_error_code)(sqlite3_context*,int);
|
||||
int (*test_control)(int, ...);
|
||||
void (*randomness)(int,void*);
|
||||
sqlite3 *(*context_db_handle)(sqlite3_context*);
|
||||
int (*extended_result_codes)(sqlite3*,int);
|
||||
int (*limit)(sqlite3*,int,int);
|
||||
sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
|
||||
const char *(*sql)(sqlite3_stmt*);
|
||||
int (*status)(int,int*,int*,int);
|
||||
int (*backup_finish)(sqlite3_backup*);
|
||||
sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
|
||||
int (*backup_pagecount)(sqlite3_backup*);
|
||||
int (*backup_remaining)(sqlite3_backup*);
|
||||
int (*backup_step)(sqlite3_backup*,int);
|
||||
const char *(*compileoption_get)(int);
|
||||
int (*compileoption_used)(const char*);
|
||||
int (*create_function_v2)(sqlite3*,const char*,int,int,void*,
|
||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*),
|
||||
void(*xDestroy)(void*));
|
||||
int (*db_config)(sqlite3*,int,...);
|
||||
sqlite3_mutex *(*db_mutex)(sqlite3*);
|
||||
int (*db_status)(sqlite3*,int,int*,int*,int);
|
||||
int (*extended_errcode)(sqlite3*);
|
||||
void (*log)(int,const char*,...);
|
||||
sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
|
||||
const char *(*sourceid)(void);
|
||||
int (*stmt_status)(sqlite3_stmt*,int,int);
|
||||
int (*strnicmp)(const char*,const char*,int);
|
||||
int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
|
||||
int (*wal_autocheckpoint)(sqlite3*,int);
|
||||
int (*wal_checkpoint)(sqlite3*,const char*);
|
||||
void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
|
||||
int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
|
||||
int (*vtab_config)(sqlite3*,int op,...);
|
||||
int (*vtab_on_conflict)(sqlite3*);
|
||||
/* Version 3.7.16 and later */
|
||||
int (*close_v2)(sqlite3*);
|
||||
const char *(*db_filename)(sqlite3*,const char*);
|
||||
int (*db_readonly)(sqlite3*,const char*);
|
||||
int (*db_release_memory)(sqlite3*);
|
||||
const char *(*errstr)(int);
|
||||
int (*stmt_busy)(sqlite3_stmt*);
|
||||
int (*stmt_readonly)(sqlite3_stmt*);
|
||||
int (*stricmp)(const char*,const char*);
|
||||
int (*uri_boolean)(const char*,const char*,int);
|
||||
sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
|
||||
const char *(*uri_parameter)(const char*,const char*);
|
||||
char *(*xvsnprintf)(int,char*,const char*,va_list);
|
||||
int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
|
||||
/* Version 3.8.7 and later */
|
||||
int (*auto_extension)(void(*)(void));
|
||||
int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
|
||||
void(*)(void*));
|
||||
int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
|
||||
void(*)(void*),unsigned char);
|
||||
int (*cancel_auto_extension)(void(*)(void));
|
||||
int (*load_extension)(sqlite3*,const char*,const char*,char**);
|
||||
void *(*malloc64)(sqlite3_uint64);
|
||||
sqlite3_uint64 (*msize)(void*);
|
||||
void *(*realloc64)(void*,sqlite3_uint64);
|
||||
void (*reset_auto_extension)(void);
|
||||
void (*result_blob64)(sqlite3_context*,const void*,sqlite3_uint64,
|
||||
void(*)(void*));
|
||||
void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
|
||||
void(*)(void*), unsigned char);
|
||||
int (*strglob)(const char*,const char*);
|
||||
/* Version 3.8.11 and later */
|
||||
sqlite3_value *(*value_dup)(const sqlite3_value*);
|
||||
void (*value_free)(sqlite3_value*);
|
||||
int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
|
||||
int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
|
||||
/* Version 3.9.0 and later */
|
||||
unsigned int (*value_subtype)(sqlite3_value*);
|
||||
void (*result_subtype)(sqlite3_context*,unsigned int);
|
||||
/* Version 3.10.0 and later */
|
||||
int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int);
|
||||
int (*strlike)(const char*,const char*,unsigned int);
|
||||
int (*db_cacheflush)(sqlite3*);
|
||||
/* Version 3.12.0 and later */
|
||||
int (*system_errno)(sqlite3*);
|
||||
/* Version 3.14.0 and later */
|
||||
int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
|
||||
char *(*expanded_sql)(sqlite3_stmt*);
|
||||
/* Version 3.18.0 and later */
|
||||
void (*set_last_insert_rowid)(sqlite3*,sqlite3_int64);
|
||||
/* Version 3.20.0 and later */
|
||||
int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
|
||||
sqlite3_stmt**,const char**);
|
||||
int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
|
||||
sqlite3_stmt**,const void**);
|
||||
int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
|
||||
void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
|
||||
void *(*value_pointer)(sqlite3_value*,const char*);
|
||||
int (*vtab_nochange)(sqlite3_context*);
|
||||
int (*value_nochange)(sqlite3_value*);
|
||||
const char *(*vtab_collation)(sqlite3_index_info*,int);
|
||||
/* Version 3.24.0 and later */
|
||||
int (*keyword_count)(void);
|
||||
int (*keyword_name)(int,const char**,int*);
|
||||
int (*keyword_check)(const char*,int);
|
||||
sqlite3_str *(*str_new)(sqlite3*);
|
||||
char *(*str_finish)(sqlite3_str*);
|
||||
void (*str_appendf)(sqlite3_str*, const char *zFormat, ...);
|
||||
void (*str_vappendf)(sqlite3_str*, const char *zFormat, va_list);
|
||||
void (*str_append)(sqlite3_str*, const char *zIn, int N);
|
||||
void (*str_appendall)(sqlite3_str*, const char *zIn);
|
||||
void (*str_appendchar)(sqlite3_str*, int N, char C);
|
||||
void (*str_reset)(sqlite3_str*);
|
||||
int (*str_errcode)(sqlite3_str*);
|
||||
int (*str_length)(sqlite3_str*);
|
||||
char *(*str_value)(sqlite3_str*);
|
||||
/* Version 3.25.0 and later */
|
||||
int (*create_window_function)(sqlite3*,const char*,int,int,void*,
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*),
|
||||
void (*xValue)(sqlite3_context*),
|
||||
void (*xInv)(sqlite3_context*,int,sqlite3_value**),
|
||||
void(*xDestroy)(void*));
|
||||
/* Version 3.26.0 and later */
|
||||
const char *(*normalized_sql)(sqlite3_stmt*);
|
||||
/* Version 3.28.0 and later */
|
||||
int (*stmt_isexplain)(sqlite3_stmt*);
|
||||
int (*value_frombind)(sqlite3_value*);
|
||||
/* Version 3.30.0 and later */
|
||||
int (*drop_modules)(sqlite3*,const char**);
|
||||
/* Version 3.31.0 and later */
|
||||
sqlite3_int64 (*hard_heap_limit64)(sqlite3_int64);
|
||||
const char *(*uri_key)(const char*,int);
|
||||
const char *(*filename_database)(const char*);
|
||||
const char *(*filename_journal)(const char*);
|
||||
const char *(*filename_wal)(const char*);
|
||||
/* Version 3.32.0 and later */
|
||||
const char *(*create_filename)(const char*,const char*,const char*,
|
||||
int,const char**);
|
||||
void (*free_filename)(const char*);
|
||||
sqlite3_file *(*database_file_object)(const char*);
|
||||
/* Version 3.34.0 and later */
|
||||
int (*txn_state)(sqlite3*,const char*);
|
||||
/* Version 3.36.1 and later */
|
||||
sqlite3_int64 (*changes64)(sqlite3*);
|
||||
sqlite3_int64 (*total_changes64)(sqlite3*);
|
||||
/* Version 3.37.0 and later */
|
||||
int (*autovacuum_pages)(sqlite3*,
|
||||
unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
|
||||
void*, void(*)(void*));
|
||||
/* Version 3.38.0 and later */
|
||||
int (*error_offset)(sqlite3*);
|
||||
int (*vtab_rhs_value)(sqlite3_index_info*,int,sqlite3_value**);
|
||||
int (*vtab_distinct)(sqlite3_index_info*);
|
||||
int (*vtab_in)(sqlite3_index_info*,int,int);
|
||||
int (*vtab_in_first)(sqlite3_value*,sqlite3_value**);
|
||||
int (*vtab_in_next)(sqlite3_value*,sqlite3_value**);
|
||||
/* Version 3.39.0 and later */
|
||||
int (*deserialize)(sqlite3*,const char*,unsigned char*,
|
||||
sqlite3_int64,sqlite3_int64,unsigned);
|
||||
unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*,
|
||||
unsigned int);
|
||||
const char *(*db_name)(sqlite3*,int);
|
||||
/* Version 3.40.0 and later */
|
||||
int (*value_encoding)(sqlite3_value*);
|
||||
/* Version 3.41.0 and later */
|
||||
int (*is_interrupted)(sqlite3*);
|
||||
/* Version 3.43.0 and later */
|
||||
int (*stmt_explain)(sqlite3_stmt*,int);
|
||||
/* Version 3.44.0 and later */
|
||||
void *(*get_clientdata)(sqlite3*,const char*);
|
||||
int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*));
|
||||
};
|
||||
|
||||
/*
|
||||
** This is the function signature used for all extension entry points. It
|
||||
** is also defined in the file "loadext.c".
|
||||
*/
|
||||
typedef int (*sqlite3_loadext_entry)(
|
||||
sqlite3 *db, /* Handle to the database. */
|
||||
char **pzErrMsg, /* Used to set error string on failure. */
|
||||
const sqlite3_api_routines *pThunk /* Extension API function pointers. */
|
||||
);
|
||||
|
||||
/*
|
||||
** The following macros redefine the API routines so that they are
|
||||
** redirected through the global sqlite3_api structure.
|
||||
**
|
||||
** This header file is also used by the loadext.c source file
|
||||
** (part of the main SQLite library - not an extension) so that
|
||||
** it can get access to the sqlite3_api_routines structure
|
||||
** definition. But the main library does not want to redefine
|
||||
** the API. So the redefinition macros are only valid if the
|
||||
** SQLITE_CORE macros is undefined.
|
||||
*/
|
||||
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
||||
#define sqlite3_aggregate_context sqlite3_api->aggregate_context
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_aggregate_count sqlite3_api->aggregate_count
|
||||
#endif
|
||||
#define sqlite3_bind_blob sqlite3_api->bind_blob
|
||||
#define sqlite3_bind_double sqlite3_api->bind_double
|
||||
#define sqlite3_bind_int sqlite3_api->bind_int
|
||||
#define sqlite3_bind_int64 sqlite3_api->bind_int64
|
||||
#define sqlite3_bind_null sqlite3_api->bind_null
|
||||
#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
|
||||
#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
|
||||
#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
|
||||
#define sqlite3_bind_text sqlite3_api->bind_text
|
||||
#define sqlite3_bind_text16 sqlite3_api->bind_text16
|
||||
#define sqlite3_bind_value sqlite3_api->bind_value
|
||||
#define sqlite3_busy_handler sqlite3_api->busy_handler
|
||||
#define sqlite3_busy_timeout sqlite3_api->busy_timeout
|
||||
#define sqlite3_changes sqlite3_api->changes
|
||||
#define sqlite3_close sqlite3_api->close
|
||||
#define sqlite3_collation_needed sqlite3_api->collation_needed
|
||||
#define sqlite3_collation_needed16 sqlite3_api->collation_needed16
|
||||
#define sqlite3_column_blob sqlite3_api->column_blob
|
||||
#define sqlite3_column_bytes sqlite3_api->column_bytes
|
||||
#define sqlite3_column_bytes16 sqlite3_api->column_bytes16
|
||||
#define sqlite3_column_count sqlite3_api->column_count
|
||||
#define sqlite3_column_database_name sqlite3_api->column_database_name
|
||||
#define sqlite3_column_database_name16 sqlite3_api->column_database_name16
|
||||
#define sqlite3_column_decltype sqlite3_api->column_decltype
|
||||
#define sqlite3_column_decltype16 sqlite3_api->column_decltype16
|
||||
#define sqlite3_column_double sqlite3_api->column_double
|
||||
#define sqlite3_column_int sqlite3_api->column_int
|
||||
#define sqlite3_column_int64 sqlite3_api->column_int64
|
||||
#define sqlite3_column_name sqlite3_api->column_name
|
||||
#define sqlite3_column_name16 sqlite3_api->column_name16
|
||||
#define sqlite3_column_origin_name sqlite3_api->column_origin_name
|
||||
#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
|
||||
#define sqlite3_column_table_name sqlite3_api->column_table_name
|
||||
#define sqlite3_column_table_name16 sqlite3_api->column_table_name16
|
||||
#define sqlite3_column_text sqlite3_api->column_text
|
||||
#define sqlite3_column_text16 sqlite3_api->column_text16
|
||||
#define sqlite3_column_type sqlite3_api->column_type
|
||||
#define sqlite3_column_value sqlite3_api->column_value
|
||||
#define sqlite3_commit_hook sqlite3_api->commit_hook
|
||||
#define sqlite3_complete sqlite3_api->complete
|
||||
#define sqlite3_complete16 sqlite3_api->complete16
|
||||
#define sqlite3_create_collation sqlite3_api->create_collation
|
||||
#define sqlite3_create_collation16 sqlite3_api->create_collation16
|
||||
#define sqlite3_create_function sqlite3_api->create_function
|
||||
#define sqlite3_create_function16 sqlite3_api->create_function16
|
||||
#define sqlite3_create_module sqlite3_api->create_module
|
||||
#define sqlite3_create_module_v2 sqlite3_api->create_module_v2
|
||||
#define sqlite3_data_count sqlite3_api->data_count
|
||||
#define sqlite3_db_handle sqlite3_api->db_handle
|
||||
#define sqlite3_declare_vtab sqlite3_api->declare_vtab
|
||||
#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
|
||||
#define sqlite3_errcode sqlite3_api->errcode
|
||||
#define sqlite3_errmsg sqlite3_api->errmsg
|
||||
#define sqlite3_errmsg16 sqlite3_api->errmsg16
|
||||
#define sqlite3_exec sqlite3_api->exec
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_expired sqlite3_api->expired
|
||||
#endif
|
||||
#define sqlite3_finalize sqlite3_api->finalize
|
||||
#define sqlite3_free sqlite3_api->free
|
||||
#define sqlite3_free_table sqlite3_api->free_table
|
||||
#define sqlite3_get_autocommit sqlite3_api->get_autocommit
|
||||
#define sqlite3_get_auxdata sqlite3_api->get_auxdata
|
||||
#define sqlite3_get_table sqlite3_api->get_table
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_global_recover sqlite3_api->global_recover
|
||||
#endif
|
||||
#define sqlite3_interrupt sqlite3_api->interruptx
|
||||
#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
|
||||
#define sqlite3_libversion sqlite3_api->libversion
|
||||
#define sqlite3_libversion_number sqlite3_api->libversion_number
|
||||
#define sqlite3_malloc sqlite3_api->malloc
|
||||
#define sqlite3_mprintf sqlite3_api->mprintf
|
||||
#define sqlite3_open sqlite3_api->open
|
||||
#define sqlite3_open16 sqlite3_api->open16
|
||||
#define sqlite3_prepare sqlite3_api->prepare
|
||||
#define sqlite3_prepare16 sqlite3_api->prepare16
|
||||
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
|
||||
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
|
||||
#define sqlite3_profile sqlite3_api->profile
|
||||
#define sqlite3_progress_handler sqlite3_api->progress_handler
|
||||
#define sqlite3_realloc sqlite3_api->realloc
|
||||
#define sqlite3_reset sqlite3_api->reset
|
||||
#define sqlite3_result_blob sqlite3_api->result_blob
|
||||
#define sqlite3_result_double sqlite3_api->result_double
|
||||
#define sqlite3_result_error sqlite3_api->result_error
|
||||
#define sqlite3_result_error16 sqlite3_api->result_error16
|
||||
#define sqlite3_result_int sqlite3_api->result_int
|
||||
#define sqlite3_result_int64 sqlite3_api->result_int64
|
||||
#define sqlite3_result_null sqlite3_api->result_null
|
||||
#define sqlite3_result_text sqlite3_api->result_text
|
||||
#define sqlite3_result_text16 sqlite3_api->result_text16
|
||||
#define sqlite3_result_text16be sqlite3_api->result_text16be
|
||||
#define sqlite3_result_text16le sqlite3_api->result_text16le
|
||||
#define sqlite3_result_value sqlite3_api->result_value
|
||||
#define sqlite3_rollback_hook sqlite3_api->rollback_hook
|
||||
#define sqlite3_set_authorizer sqlite3_api->set_authorizer
|
||||
#define sqlite3_set_auxdata sqlite3_api->set_auxdata
|
||||
#define sqlite3_snprintf sqlite3_api->xsnprintf
|
||||
#define sqlite3_step sqlite3_api->step
|
||||
#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
|
||||
#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
|
||||
#define sqlite3_total_changes sqlite3_api->total_changes
|
||||
#define sqlite3_trace sqlite3_api->trace
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
|
||||
#endif
|
||||
#define sqlite3_update_hook sqlite3_api->update_hook
|
||||
#define sqlite3_user_data sqlite3_api->user_data
|
||||
#define sqlite3_value_blob sqlite3_api->value_blob
|
||||
#define sqlite3_value_bytes sqlite3_api->value_bytes
|
||||
#define sqlite3_value_bytes16 sqlite3_api->value_bytes16
|
||||
#define sqlite3_value_double sqlite3_api->value_double
|
||||
#define sqlite3_value_int sqlite3_api->value_int
|
||||
#define sqlite3_value_int64 sqlite3_api->value_int64
|
||||
#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
|
||||
#define sqlite3_value_text sqlite3_api->value_text
|
||||
#define sqlite3_value_text16 sqlite3_api->value_text16
|
||||
#define sqlite3_value_text16be sqlite3_api->value_text16be
|
||||
#define sqlite3_value_text16le sqlite3_api->value_text16le
|
||||
#define sqlite3_value_type sqlite3_api->value_type
|
||||
#define sqlite3_vmprintf sqlite3_api->vmprintf
|
||||
#define sqlite3_vsnprintf sqlite3_api->xvsnprintf
|
||||
#define sqlite3_overload_function sqlite3_api->overload_function
|
||||
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
|
||||
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
|
||||
#define sqlite3_clear_bindings sqlite3_api->clear_bindings
|
||||
#define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob
|
||||
#define sqlite3_blob_bytes sqlite3_api->blob_bytes
|
||||
#define sqlite3_blob_close sqlite3_api->blob_close
|
||||
#define sqlite3_blob_open sqlite3_api->blob_open
|
||||
#define sqlite3_blob_read sqlite3_api->blob_read
|
||||
#define sqlite3_blob_write sqlite3_api->blob_write
|
||||
#define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2
|
||||
#define sqlite3_file_control sqlite3_api->file_control
|
||||
#define sqlite3_memory_highwater sqlite3_api->memory_highwater
|
||||
#define sqlite3_memory_used sqlite3_api->memory_used
|
||||
#define sqlite3_mutex_alloc sqlite3_api->mutex_alloc
|
||||
#define sqlite3_mutex_enter sqlite3_api->mutex_enter
|
||||
#define sqlite3_mutex_free sqlite3_api->mutex_free
|
||||
#define sqlite3_mutex_leave sqlite3_api->mutex_leave
|
||||
#define sqlite3_mutex_try sqlite3_api->mutex_try
|
||||
#define sqlite3_open_v2 sqlite3_api->open_v2
|
||||
#define sqlite3_release_memory sqlite3_api->release_memory
|
||||
#define sqlite3_result_error_nomem sqlite3_api->result_error_nomem
|
||||
#define sqlite3_result_error_toobig sqlite3_api->result_error_toobig
|
||||
#define sqlite3_sleep sqlite3_api->sleep
|
||||
#define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit
|
||||
#define sqlite3_vfs_find sqlite3_api->vfs_find
|
||||
#define sqlite3_vfs_register sqlite3_api->vfs_register
|
||||
#define sqlite3_vfs_unregister sqlite3_api->vfs_unregister
|
||||
#define sqlite3_threadsafe sqlite3_api->xthreadsafe
|
||||
#define sqlite3_result_zeroblob sqlite3_api->result_zeroblob
|
||||
#define sqlite3_result_error_code sqlite3_api->result_error_code
|
||||
#define sqlite3_test_control sqlite3_api->test_control
|
||||
#define sqlite3_randomness sqlite3_api->randomness
|
||||
#define sqlite3_context_db_handle sqlite3_api->context_db_handle
|
||||
#define sqlite3_extended_result_codes sqlite3_api->extended_result_codes
|
||||
#define sqlite3_limit sqlite3_api->limit
|
||||
#define sqlite3_next_stmt sqlite3_api->next_stmt
|
||||
#define sqlite3_sql sqlite3_api->sql
|
||||
#define sqlite3_status sqlite3_api->status
|
||||
#define sqlite3_backup_finish sqlite3_api->backup_finish
|
||||
#define sqlite3_backup_init sqlite3_api->backup_init
|
||||
#define sqlite3_backup_pagecount sqlite3_api->backup_pagecount
|
||||
#define sqlite3_backup_remaining sqlite3_api->backup_remaining
|
||||
#define sqlite3_backup_step sqlite3_api->backup_step
|
||||
#define sqlite3_compileoption_get sqlite3_api->compileoption_get
|
||||
#define sqlite3_compileoption_used sqlite3_api->compileoption_used
|
||||
#define sqlite3_create_function_v2 sqlite3_api->create_function_v2
|
||||
#define sqlite3_db_config sqlite3_api->db_config
|
||||
#define sqlite3_db_mutex sqlite3_api->db_mutex
|
||||
#define sqlite3_db_status sqlite3_api->db_status
|
||||
#define sqlite3_extended_errcode sqlite3_api->extended_errcode
|
||||
#define sqlite3_log sqlite3_api->log
|
||||
#define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64
|
||||
#define sqlite3_sourceid sqlite3_api->sourceid
|
||||
#define sqlite3_stmt_status sqlite3_api->stmt_status
|
||||
#define sqlite3_strnicmp sqlite3_api->strnicmp
|
||||
#define sqlite3_unlock_notify sqlite3_api->unlock_notify
|
||||
#define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint
|
||||
#define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint
|
||||
#define sqlite3_wal_hook sqlite3_api->wal_hook
|
||||
#define sqlite3_blob_reopen sqlite3_api->blob_reopen
|
||||
#define sqlite3_vtab_config sqlite3_api->vtab_config
|
||||
#define sqlite3_vtab_on_conflict sqlite3_api->vtab_on_conflict
|
||||
/* Version 3.7.16 and later */
|
||||
#define sqlite3_close_v2 sqlite3_api->close_v2
|
||||
#define sqlite3_db_filename sqlite3_api->db_filename
|
||||
#define sqlite3_db_readonly sqlite3_api->db_readonly
|
||||
#define sqlite3_db_release_memory sqlite3_api->db_release_memory
|
||||
#define sqlite3_errstr sqlite3_api->errstr
|
||||
#define sqlite3_stmt_busy sqlite3_api->stmt_busy
|
||||
#define sqlite3_stmt_readonly sqlite3_api->stmt_readonly
|
||||
#define sqlite3_stricmp sqlite3_api->stricmp
|
||||
#define sqlite3_uri_boolean sqlite3_api->uri_boolean
|
||||
#define sqlite3_uri_int64 sqlite3_api->uri_int64
|
||||
#define sqlite3_uri_parameter sqlite3_api->uri_parameter
|
||||
#define sqlite3_uri_vsnprintf sqlite3_api->xvsnprintf
|
||||
#define sqlite3_wal_checkpoint_v2 sqlite3_api->wal_checkpoint_v2
|
||||
/* Version 3.8.7 and later */
|
||||
#define sqlite3_auto_extension sqlite3_api->auto_extension
|
||||
#define sqlite3_bind_blob64 sqlite3_api->bind_blob64
|
||||
#define sqlite3_bind_text64 sqlite3_api->bind_text64
|
||||
#define sqlite3_cancel_auto_extension sqlite3_api->cancel_auto_extension
|
||||
#define sqlite3_load_extension sqlite3_api->load_extension
|
||||
#define sqlite3_malloc64 sqlite3_api->malloc64
|
||||
#define sqlite3_msize sqlite3_api->msize
|
||||
#define sqlite3_realloc64 sqlite3_api->realloc64
|
||||
#define sqlite3_reset_auto_extension sqlite3_api->reset_auto_extension
|
||||
#define sqlite3_result_blob64 sqlite3_api->result_blob64
|
||||
#define sqlite3_result_text64 sqlite3_api->result_text64
|
||||
#define sqlite3_strglob sqlite3_api->strglob
|
||||
/* Version 3.8.11 and later */
|
||||
#define sqlite3_value_dup sqlite3_api->value_dup
|
||||
#define sqlite3_value_free sqlite3_api->value_free
|
||||
#define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64
|
||||
#define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64
|
||||
/* Version 3.9.0 and later */
|
||||
#define sqlite3_value_subtype sqlite3_api->value_subtype
|
||||
#define sqlite3_result_subtype sqlite3_api->result_subtype
|
||||
/* Version 3.10.0 and later */
|
||||
#define sqlite3_status64 sqlite3_api->status64
|
||||
#define sqlite3_strlike sqlite3_api->strlike
|
||||
#define sqlite3_db_cacheflush sqlite3_api->db_cacheflush
|
||||
/* Version 3.12.0 and later */
|
||||
#define sqlite3_system_errno sqlite3_api->system_errno
|
||||
/* Version 3.14.0 and later */
|
||||
#define sqlite3_trace_v2 sqlite3_api->trace_v2
|
||||
#define sqlite3_expanded_sql sqlite3_api->expanded_sql
|
||||
/* Version 3.18.0 and later */
|
||||
#define sqlite3_set_last_insert_rowid sqlite3_api->set_last_insert_rowid
|
||||
/* Version 3.20.0 and later */
|
||||
#define sqlite3_prepare_v3 sqlite3_api->prepare_v3
|
||||
#define sqlite3_prepare16_v3 sqlite3_api->prepare16_v3
|
||||
#define sqlite3_bind_pointer sqlite3_api->bind_pointer
|
||||
#define sqlite3_result_pointer sqlite3_api->result_pointer
|
||||
#define sqlite3_value_pointer sqlite3_api->value_pointer
|
||||
/* Version 3.22.0 and later */
|
||||
#define sqlite3_vtab_nochange sqlite3_api->vtab_nochange
|
||||
#define sqlite3_value_nochange sqlite3_api->value_nochange
|
||||
#define sqlite3_vtab_collation sqlite3_api->vtab_collation
|
||||
/* Version 3.24.0 and later */
|
||||
#define sqlite3_keyword_count sqlite3_api->keyword_count
|
||||
#define sqlite3_keyword_name sqlite3_api->keyword_name
|
||||
#define sqlite3_keyword_check sqlite3_api->keyword_check
|
||||
#define sqlite3_str_new sqlite3_api->str_new
|
||||
#define sqlite3_str_finish sqlite3_api->str_finish
|
||||
#define sqlite3_str_appendf sqlite3_api->str_appendf
|
||||
#define sqlite3_str_vappendf sqlite3_api->str_vappendf
|
||||
#define sqlite3_str_append sqlite3_api->str_append
|
||||
#define sqlite3_str_appendall sqlite3_api->str_appendall
|
||||
#define sqlite3_str_appendchar sqlite3_api->str_appendchar
|
||||
#define sqlite3_str_reset sqlite3_api->str_reset
|
||||
#define sqlite3_str_errcode sqlite3_api->str_errcode
|
||||
#define sqlite3_str_length sqlite3_api->str_length
|
||||
#define sqlite3_str_value sqlite3_api->str_value
|
||||
/* Version 3.25.0 and later */
|
||||
#define sqlite3_create_window_function sqlite3_api->create_window_function
|
||||
/* Version 3.26.0 and later */
|
||||
#define sqlite3_normalized_sql sqlite3_api->normalized_sql
|
||||
/* Version 3.28.0 and later */
|
||||
#define sqlite3_stmt_isexplain sqlite3_api->stmt_isexplain
|
||||
#define sqlite3_value_frombind sqlite3_api->value_frombind
|
||||
/* Version 3.30.0 and later */
|
||||
#define sqlite3_drop_modules sqlite3_api->drop_modules
|
||||
/* Version 3.31.0 and later */
|
||||
#define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64
|
||||
#define sqlite3_uri_key sqlite3_api->uri_key
|
||||
#define sqlite3_filename_database sqlite3_api->filename_database
|
||||
#define sqlite3_filename_journal sqlite3_api->filename_journal
|
||||
#define sqlite3_filename_wal sqlite3_api->filename_wal
|
||||
/* Version 3.32.0 and later */
|
||||
#define sqlite3_create_filename sqlite3_api->create_filename
|
||||
#define sqlite3_free_filename sqlite3_api->free_filename
|
||||
#define sqlite3_database_file_object sqlite3_api->database_file_object
|
||||
/* Version 3.34.0 and later */
|
||||
#define sqlite3_txn_state sqlite3_api->txn_state
|
||||
/* Version 3.36.1 and later */
|
||||
#define sqlite3_changes64 sqlite3_api->changes64
|
||||
#define sqlite3_total_changes64 sqlite3_api->total_changes64
|
||||
/* Version 3.37.0 and later */
|
||||
#define sqlite3_autovacuum_pages sqlite3_api->autovacuum_pages
|
||||
/* Version 3.38.0 and later */
|
||||
#define sqlite3_error_offset sqlite3_api->error_offset
|
||||
#define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value
|
||||
#define sqlite3_vtab_distinct sqlite3_api->vtab_distinct
|
||||
#define sqlite3_vtab_in sqlite3_api->vtab_in
|
||||
#define sqlite3_vtab_in_first sqlite3_api->vtab_in_first
|
||||
#define sqlite3_vtab_in_next sqlite3_api->vtab_in_next
|
||||
/* Version 3.39.0 and later */
|
||||
#ifndef SQLITE_OMIT_DESERIALIZE
|
||||
#define sqlite3_deserialize sqlite3_api->deserialize
|
||||
#define sqlite3_serialize sqlite3_api->serialize
|
||||
#endif
|
||||
#define sqlite3_db_name sqlite3_api->db_name
|
||||
/* Version 3.40.0 and later */
|
||||
#define sqlite3_value_encoding sqlite3_api->value_encoding
|
||||
/* Version 3.41.0 and later */
|
||||
#define sqlite3_is_interrupted sqlite3_api->is_interrupted
|
||||
/* Version 3.43.0 and later */
|
||||
#define sqlite3_stmt_explain sqlite3_api->stmt_explain
|
||||
/* Version 3.44.0 and later */
|
||||
#define sqlite3_get_clientdata sqlite3_api->get_clientdata
|
||||
#define sqlite3_set_clientdata sqlite3_api->set_clientdata
|
||||
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
|
||||
|
||||
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
||||
/* This case when the file really is being compiled as a loadable
|
||||
** extension */
|
||||
# define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
|
||||
# define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
|
||||
# define SQLITE_EXTENSION_INIT3 \
|
||||
extern const sqlite3_api_routines *sqlite3_api;
|
||||
#else
|
||||
/* This case when the file is being statically linked into the
|
||||
** application */
|
||||
# define SQLITE_EXTENSION_INIT1 /*no-op*/
|
||||
# define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
|
||||
# define SQLITE_EXTENSION_INIT3 /*no-op*/
|
||||
#endif
|
||||
|
||||
#endif /* SQLITE3EXT_H */
|
||||
BIN
projects/status-panel/node_modules/better-sqlite3/build/Release/sqlite3.a
generated
vendored
Normal file
BIN
projects/status-panel/node_modules/better-sqlite3/build/Release/test_extension.node
generated
vendored
Executable file
197
projects/status-panel/node_modules/better-sqlite3/build/better_sqlite3.target.mk
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
# This file is generated by gyp; do not edit.
|
||||
|
||||
TOOLSET := target
|
||||
TARGET := better_sqlite3
|
||||
DEFS_Debug := \
|
||||
'-DNODE_GYP_MODULE_NAME=better_sqlite3' \
|
||||
'-DUSING_UV_SHARED=1' \
|
||||
'-DUSING_V8_SHARED=1' \
|
||||
'-DV8_DEPRECATION_WARNINGS=1' \
|
||||
'-D_GLIBCXX_USE_CXX11_ABI=1' \
|
||||
'-D_FILE_OFFSET_BITS=64' \
|
||||
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
||||
'-D_LARGEFILE_SOURCE' \
|
||||
'-DBUILDING_NODE_EXTENSION' \
|
||||
'-DDEBUG' \
|
||||
'-D_DEBUG' \
|
||||
'-DSQLITE_DEBUG' \
|
||||
'-DSQLITE_MEMDEBUG' \
|
||||
'-DSQLITE_ENABLE_API_ARMOR' \
|
||||
'-DSQLITE_WIN32_MALLOC_VALIDATE'
|
||||
|
||||
# Flags passed to all source files.
|
||||
CFLAGS_Debug := \
|
||||
-O0 \
|
||||
-gdwarf-2 \
|
||||
-fno-strict-aliasing \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-Wall \
|
||||
-Wendif-labels \
|
||||
-W \
|
||||
-Wno-unused-parameter
|
||||
|
||||
# Flags passed to only C files.
|
||||
CFLAGS_C_Debug :=
|
||||
|
||||
# Flags passed to only C++ files.
|
||||
CFLAGS_CC_Debug := \
|
||||
-std=gnu++17 \
|
||||
-stdlib=libc++ \
|
||||
-fno-rtti \
|
||||
-fno-exceptions \
|
||||
-std=c++17 \
|
||||
-stdlib=libc++
|
||||
|
||||
# Flags passed to only ObjC files.
|
||||
CFLAGS_OBJC_Debug :=
|
||||
|
||||
# Flags passed to only ObjC++ files.
|
||||
CFLAGS_OBJCC_Debug :=
|
||||
|
||||
INCS_Debug := \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include \
|
||||
-I$(obj)/gen/sqlite3
|
||||
|
||||
DEFS_Release := \
|
||||
'-DNODE_GYP_MODULE_NAME=better_sqlite3' \
|
||||
'-DUSING_UV_SHARED=1' \
|
||||
'-DUSING_V8_SHARED=1' \
|
||||
'-DV8_DEPRECATION_WARNINGS=1' \
|
||||
'-D_GLIBCXX_USE_CXX11_ABI=1' \
|
||||
'-D_FILE_OFFSET_BITS=64' \
|
||||
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
||||
'-D_LARGEFILE_SOURCE' \
|
||||
'-DBUILDING_NODE_EXTENSION' \
|
||||
'-DNDEBUG'
|
||||
|
||||
# Flags passed to all source files.
|
||||
CFLAGS_Release := \
|
||||
-O3 \
|
||||
-fno-strict-aliasing \
|
||||
-flto \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-Wall \
|
||||
-Wendif-labels \
|
||||
-W \
|
||||
-Wno-unused-parameter
|
||||
|
||||
# Flags passed to only C files.
|
||||
CFLAGS_C_Release :=
|
||||
|
||||
# Flags passed to only C++ files.
|
||||
CFLAGS_CC_Release := \
|
||||
-std=gnu++17 \
|
||||
-stdlib=libc++ \
|
||||
-fno-rtti \
|
||||
-fno-exceptions \
|
||||
-fvisibility-inlines-hidden \
|
||||
-std=c++17 \
|
||||
-stdlib=libc++
|
||||
|
||||
# Flags passed to only ObjC files.
|
||||
CFLAGS_OBJC_Release :=
|
||||
|
||||
# Flags passed to only ObjC++ files.
|
||||
CFLAGS_OBJCC_Release :=
|
||||
|
||||
INCS_Release := \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include \
|
||||
-I$(obj)/gen/sqlite3
|
||||
|
||||
OBJS := \
|
||||
$(obj).target/$(TARGET)/src/better_sqlite3.o
|
||||
|
||||
# Add to the list of files we specially track dependencies for.
|
||||
all_deps += $(OBJS)
|
||||
|
||||
# Make sure our dependencies are built before any of us.
|
||||
$(OBJS): | $(builddir)/sqlite3.a $(obj).target/deps/locate_sqlite3.stamp
|
||||
|
||||
# CFLAGS et al overrides must be target-local.
|
||||
# See "Target-specific Variable Values" in the GNU Make manual.
|
||||
$(OBJS): TOOLSET := $(TOOLSET)
|
||||
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
|
||||
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
|
||||
$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
|
||||
$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
|
||||
|
||||
# Suffix rules, putting all outputs into $(obj).
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
|
||||
# Try building from generated source, too.
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
|
||||
@$(call do_cmd,cxx,1)
|
||||
|
||||
# End of this set of suffix rules
|
||||
### Rules for final target.
|
||||
LDFLAGS_Debug := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-L$(builddir) \
|
||||
-stdlib=libc++
|
||||
|
||||
LIBTOOLFLAGS_Debug := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first
|
||||
|
||||
LDFLAGS_Release := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first \
|
||||
-Wl,-dead_strip \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-L$(builddir) \
|
||||
-stdlib=libc++
|
||||
|
||||
LIBTOOLFLAGS_Release := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first
|
||||
|
||||
LIBS :=
|
||||
|
||||
$(builddir)/better_sqlite3.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
|
||||
$(builddir)/better_sqlite3.node: LIBS := $(LIBS)
|
||||
$(builddir)/better_sqlite3.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
|
||||
$(builddir)/better_sqlite3.node: TOOLSET := $(TOOLSET)
|
||||
$(builddir)/better_sqlite3.node: $(OBJS) $(builddir)/sqlite3.a FORCE_DO_CMD
|
||||
$(call do_cmd,solink_module)
|
||||
|
||||
all_deps += $(builddir)/better_sqlite3.node
|
||||
# Add target alias
|
||||
.PHONY: better_sqlite3
|
||||
better_sqlite3: $(builddir)/better_sqlite3.node
|
||||
|
||||
# Short alias for building this executable.
|
||||
.PHONY: better_sqlite3.node
|
||||
better_sqlite3.node: $(builddir)/better_sqlite3.node
|
||||
|
||||
# Add executable to "all" target.
|
||||
.PHONY: all
|
||||
all: $(builddir)/better_sqlite3.node
|
||||
|
||||
6
projects/status-panel/node_modules/better-sqlite3/build/binding.Makefile
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# This file is generated by gyp; do not edit.
|
||||
|
||||
export builddir_name ?= ./build/.
|
||||
.PHONY: all
|
||||
all:
|
||||
$(MAKE) test_extension better_sqlite3
|
||||
508
projects/status-panel/node_modules/better-sqlite3/build/config.gypi
generated
vendored
Normal file
@@ -0,0 +1,508 @@
|
||||
# Do not edit. File was generated by node-gyp's "configure" step
|
||||
{
|
||||
"target_defaults": {
|
||||
"cflags": [],
|
||||
"configurations": {
|
||||
"Debug": {
|
||||
"v8_enable_v8_checks": 0,
|
||||
"variables": {}
|
||||
},
|
||||
"Release": {
|
||||
"v8_enable_v8_checks": 1,
|
||||
"variables": {}
|
||||
}
|
||||
},
|
||||
"default_configuration": "Release",
|
||||
"defines": [],
|
||||
"include_dirs": [],
|
||||
"libraries": [],
|
||||
"msvs_configuration_platform": "ARM64",
|
||||
"xcode_configuration_platform": "arm64"
|
||||
},
|
||||
"variables": {
|
||||
"arm_fpu": "neon",
|
||||
"asan": 0,
|
||||
"clang": 1,
|
||||
"control_flow_guard": "false",
|
||||
"coverage": "false",
|
||||
"dcheck_always_on": 0,
|
||||
"debug_nghttp2": "false",
|
||||
"debug_node": "false",
|
||||
"enable_lto": "true",
|
||||
"enable_pgo_generate": "false",
|
||||
"enable_pgo_use": "false",
|
||||
"error_on_warn": "false",
|
||||
"force_dynamic_crt": 1,
|
||||
"host_arch": "arm64",
|
||||
"icu_gyp_path": "tools/icu/icu-system.gyp",
|
||||
"icu_small": "false",
|
||||
"icu_ver_major": "78",
|
||||
"libdir": "lib",
|
||||
"llvm_version": "17.0",
|
||||
"napi_build_version": "10",
|
||||
"node_builtin_shareable_builtins": [
|
||||
"deps/cjs-module-lexer/lexer.js",
|
||||
"deps/cjs-module-lexer/dist/lexer.js",
|
||||
"deps/undici/undici.js",
|
||||
"deps/amaro/dist/index.js"
|
||||
],
|
||||
"node_byteorder": "little",
|
||||
"node_cctest_sources": [
|
||||
"src/node_snapshot_stub.cc",
|
||||
"test/cctest/inspector/test_node_protocol.cc",
|
||||
"test/cctest/node_test_fixture.cc",
|
||||
"test/cctest/test_aliased_buffer.cc",
|
||||
"test/cctest/test_base64.cc",
|
||||
"test/cctest/test_base_object_ptr.cc",
|
||||
"test/cctest/test_cppgc.cc",
|
||||
"test/cctest/test_crypto_clienthello.cc",
|
||||
"test/cctest/test_dataqueue.cc",
|
||||
"test/cctest/test_environment.cc",
|
||||
"test/cctest/test_inspector_socket.cc",
|
||||
"test/cctest/test_inspector_socket_server.cc",
|
||||
"test/cctest/test_json_utils.cc",
|
||||
"test/cctest/test_linked_binding.cc",
|
||||
"test/cctest/test_node_api.cc",
|
||||
"test/cctest/test_node_crypto.cc",
|
||||
"test/cctest/test_node_crypto_env.cc",
|
||||
"test/cctest/test_node_postmortem_metadata.cc",
|
||||
"test/cctest/test_node_task_runner.cc",
|
||||
"test/cctest/test_path.cc",
|
||||
"test/cctest/test_per_process.cc",
|
||||
"test/cctest/test_platform.cc",
|
||||
"test/cctest/test_quic_cid.cc",
|
||||
"test/cctest/test_quic_error.cc",
|
||||
"test/cctest/test_quic_tokens.cc",
|
||||
"test/cctest/test_report.cc",
|
||||
"test/cctest/test_sockaddr.cc",
|
||||
"test/cctest/test_traced_value.cc",
|
||||
"test/cctest/test_util.cc",
|
||||
"test/cctest/node_test_fixture.h"
|
||||
],
|
||||
"node_debug_lib": "false",
|
||||
"node_enable_d8": "false",
|
||||
"node_enable_v8_vtunejit": "false",
|
||||
"node_enable_v8windbg": "false",
|
||||
"node_fipsinstall": "false",
|
||||
"node_install_corepack": "true",
|
||||
"node_install_npm": "true",
|
||||
"node_library_files": [
|
||||
"lib/_http_agent.js",
|
||||
"lib/_http_client.js",
|
||||
"lib/_http_common.js",
|
||||
"lib/_http_incoming.js",
|
||||
"lib/_http_outgoing.js",
|
||||
"lib/_http_server.js",
|
||||
"lib/_stream_duplex.js",
|
||||
"lib/_stream_passthrough.js",
|
||||
"lib/_stream_readable.js",
|
||||
"lib/_stream_transform.js",
|
||||
"lib/_stream_wrap.js",
|
||||
"lib/_stream_writable.js",
|
||||
"lib/_tls_common.js",
|
||||
"lib/_tls_wrap.js",
|
||||
"lib/assert.js",
|
||||
"lib/assert/strict.js",
|
||||
"lib/async_hooks.js",
|
||||
"lib/buffer.js",
|
||||
"lib/child_process.js",
|
||||
"lib/cluster.js",
|
||||
"lib/console.js",
|
||||
"lib/constants.js",
|
||||
"lib/crypto.js",
|
||||
"lib/dgram.js",
|
||||
"lib/diagnostics_channel.js",
|
||||
"lib/dns.js",
|
||||
"lib/dns/promises.js",
|
||||
"lib/domain.js",
|
||||
"lib/events.js",
|
||||
"lib/fs.js",
|
||||
"lib/fs/promises.js",
|
||||
"lib/http.js",
|
||||
"lib/http2.js",
|
||||
"lib/https.js",
|
||||
"lib/inspector.js",
|
||||
"lib/inspector/promises.js",
|
||||
"lib/internal/abort_controller.js",
|
||||
"lib/internal/assert.js",
|
||||
"lib/internal/assert/assertion_error.js",
|
||||
"lib/internal/assert/calltracker.js",
|
||||
"lib/internal/assert/myers_diff.js",
|
||||
"lib/internal/assert/utils.js",
|
||||
"lib/internal/async_context_frame.js",
|
||||
"lib/internal/async_hooks.js",
|
||||
"lib/internal/async_local_storage/async_context_frame.js",
|
||||
"lib/internal/async_local_storage/async_hooks.js",
|
||||
"lib/internal/blob.js",
|
||||
"lib/internal/blocklist.js",
|
||||
"lib/internal/bootstrap/node.js",
|
||||
"lib/internal/bootstrap/realm.js",
|
||||
"lib/internal/bootstrap/shadow_realm.js",
|
||||
"lib/internal/bootstrap/switches/does_not_own_process_state.js",
|
||||
"lib/internal/bootstrap/switches/does_own_process_state.js",
|
||||
"lib/internal/bootstrap/switches/is_main_thread.js",
|
||||
"lib/internal/bootstrap/switches/is_not_main_thread.js",
|
||||
"lib/internal/bootstrap/web/exposed-wildcard.js",
|
||||
"lib/internal/bootstrap/web/exposed-window-or-worker.js",
|
||||
"lib/internal/buffer.js",
|
||||
"lib/internal/child_process.js",
|
||||
"lib/internal/child_process/serialization.js",
|
||||
"lib/internal/cli_table.js",
|
||||
"lib/internal/cluster/child.js",
|
||||
"lib/internal/cluster/primary.js",
|
||||
"lib/internal/cluster/round_robin_handle.js",
|
||||
"lib/internal/cluster/shared_handle.js",
|
||||
"lib/internal/cluster/utils.js",
|
||||
"lib/internal/cluster/worker.js",
|
||||
"lib/internal/console/constructor.js",
|
||||
"lib/internal/console/global.js",
|
||||
"lib/internal/constants.js",
|
||||
"lib/internal/crypto/aes.js",
|
||||
"lib/internal/crypto/certificate.js",
|
||||
"lib/internal/crypto/cfrg.js",
|
||||
"lib/internal/crypto/cipher.js",
|
||||
"lib/internal/crypto/diffiehellman.js",
|
||||
"lib/internal/crypto/ec.js",
|
||||
"lib/internal/crypto/hash.js",
|
||||
"lib/internal/crypto/hashnames.js",
|
||||
"lib/internal/crypto/hkdf.js",
|
||||
"lib/internal/crypto/keygen.js",
|
||||
"lib/internal/crypto/keys.js",
|
||||
"lib/internal/crypto/mac.js",
|
||||
"lib/internal/crypto/pbkdf2.js",
|
||||
"lib/internal/crypto/random.js",
|
||||
"lib/internal/crypto/rsa.js",
|
||||
"lib/internal/crypto/scrypt.js",
|
||||
"lib/internal/crypto/sig.js",
|
||||
"lib/internal/crypto/util.js",
|
||||
"lib/internal/crypto/webcrypto.js",
|
||||
"lib/internal/crypto/webidl.js",
|
||||
"lib/internal/crypto/x509.js",
|
||||
"lib/internal/data_url.js",
|
||||
"lib/internal/debugger/inspect.js",
|
||||
"lib/internal/debugger/inspect_client.js",
|
||||
"lib/internal/debugger/inspect_repl.js",
|
||||
"lib/internal/dgram.js",
|
||||
"lib/internal/dns/callback_resolver.js",
|
||||
"lib/internal/dns/promises.js",
|
||||
"lib/internal/dns/utils.js",
|
||||
"lib/internal/encoding.js",
|
||||
"lib/internal/error_serdes.js",
|
||||
"lib/internal/errors.js",
|
||||
"lib/internal/errors/error_source.js",
|
||||
"lib/internal/event_target.js",
|
||||
"lib/internal/events/abort_listener.js",
|
||||
"lib/internal/events/symbols.js",
|
||||
"lib/internal/file.js",
|
||||
"lib/internal/fixed_queue.js",
|
||||
"lib/internal/freelist.js",
|
||||
"lib/internal/freeze_intrinsics.js",
|
||||
"lib/internal/fs/cp/cp-sync.js",
|
||||
"lib/internal/fs/cp/cp.js",
|
||||
"lib/internal/fs/dir.js",
|
||||
"lib/internal/fs/glob.js",
|
||||
"lib/internal/fs/promises.js",
|
||||
"lib/internal/fs/read/context.js",
|
||||
"lib/internal/fs/recursive_watch.js",
|
||||
"lib/internal/fs/rimraf.js",
|
||||
"lib/internal/fs/streams.js",
|
||||
"lib/internal/fs/sync_write_stream.js",
|
||||
"lib/internal/fs/utils.js",
|
||||
"lib/internal/fs/watchers.js",
|
||||
"lib/internal/heap_utils.js",
|
||||
"lib/internal/histogram.js",
|
||||
"lib/internal/http.js",
|
||||
"lib/internal/http2/compat.js",
|
||||
"lib/internal/http2/core.js",
|
||||
"lib/internal/http2/util.js",
|
||||
"lib/internal/inspector/network.js",
|
||||
"lib/internal/inspector/network_http.js",
|
||||
"lib/internal/inspector/network_http2.js",
|
||||
"lib/internal/inspector/network_resources.js",
|
||||
"lib/internal/inspector/network_undici.js",
|
||||
"lib/internal/inspector_async_hook.js",
|
||||
"lib/internal/inspector_network_tracking.js",
|
||||
"lib/internal/js_stream_socket.js",
|
||||
"lib/internal/legacy/processbinding.js",
|
||||
"lib/internal/linkedlist.js",
|
||||
"lib/internal/main/check_syntax.js",
|
||||
"lib/internal/main/embedding.js",
|
||||
"lib/internal/main/eval_stdin.js",
|
||||
"lib/internal/main/eval_string.js",
|
||||
"lib/internal/main/inspect.js",
|
||||
"lib/internal/main/mksnapshot.js",
|
||||
"lib/internal/main/print_help.js",
|
||||
"lib/internal/main/prof_process.js",
|
||||
"lib/internal/main/repl.js",
|
||||
"lib/internal/main/run_main_module.js",
|
||||
"lib/internal/main/test_runner.js",
|
||||
"lib/internal/main/watch_mode.js",
|
||||
"lib/internal/main/worker_thread.js",
|
||||
"lib/internal/mime.js",
|
||||
"lib/internal/modules/cjs/loader.js",
|
||||
"lib/internal/modules/customization_hooks.js",
|
||||
"lib/internal/modules/esm/assert.js",
|
||||
"lib/internal/modules/esm/create_dynamic_module.js",
|
||||
"lib/internal/modules/esm/formats.js",
|
||||
"lib/internal/modules/esm/get_format.js",
|
||||
"lib/internal/modules/esm/hooks.js",
|
||||
"lib/internal/modules/esm/initialize_import_meta.js",
|
||||
"lib/internal/modules/esm/load.js",
|
||||
"lib/internal/modules/esm/loader.js",
|
||||
"lib/internal/modules/esm/module_job.js",
|
||||
"lib/internal/modules/esm/module_map.js",
|
||||
"lib/internal/modules/esm/resolve.js",
|
||||
"lib/internal/modules/esm/shared_constants.js",
|
||||
"lib/internal/modules/esm/translators.js",
|
||||
"lib/internal/modules/esm/utils.js",
|
||||
"lib/internal/modules/esm/worker.js",
|
||||
"lib/internal/modules/helpers.js",
|
||||
"lib/internal/modules/package_json_reader.js",
|
||||
"lib/internal/modules/run_main.js",
|
||||
"lib/internal/modules/typescript.js",
|
||||
"lib/internal/navigator.js",
|
||||
"lib/internal/net.js",
|
||||
"lib/internal/options.js",
|
||||
"lib/internal/per_context/domexception.js",
|
||||
"lib/internal/per_context/messageport.js",
|
||||
"lib/internal/per_context/primordials.js",
|
||||
"lib/internal/perf/event_loop_delay.js",
|
||||
"lib/internal/perf/event_loop_utilization.js",
|
||||
"lib/internal/perf/nodetiming.js",
|
||||
"lib/internal/perf/observe.js",
|
||||
"lib/internal/perf/performance.js",
|
||||
"lib/internal/perf/performance_entry.js",
|
||||
"lib/internal/perf/resource_timing.js",
|
||||
"lib/internal/perf/timerify.js",
|
||||
"lib/internal/perf/usertiming.js",
|
||||
"lib/internal/perf/utils.js",
|
||||
"lib/internal/priority_queue.js",
|
||||
"lib/internal/process/execution.js",
|
||||
"lib/internal/process/finalization.js",
|
||||
"lib/internal/process/per_thread.js",
|
||||
"lib/internal/process/permission.js",
|
||||
"lib/internal/process/pre_execution.js",
|
||||
"lib/internal/process/promises.js",
|
||||
"lib/internal/process/report.js",
|
||||
"lib/internal/process/signal.js",
|
||||
"lib/internal/process/task_queues.js",
|
||||
"lib/internal/process/warning.js",
|
||||
"lib/internal/process/worker_thread_only.js",
|
||||
"lib/internal/promise_hooks.js",
|
||||
"lib/internal/querystring.js",
|
||||
"lib/internal/quic/quic.js",
|
||||
"lib/internal/quic/state.js",
|
||||
"lib/internal/quic/stats.js",
|
||||
"lib/internal/quic/symbols.js",
|
||||
"lib/internal/readline/callbacks.js",
|
||||
"lib/internal/readline/emitKeypressEvents.js",
|
||||
"lib/internal/readline/interface.js",
|
||||
"lib/internal/readline/promises.js",
|
||||
"lib/internal/readline/utils.js",
|
||||
"lib/internal/repl.js",
|
||||
"lib/internal/repl/await.js",
|
||||
"lib/internal/repl/history.js",
|
||||
"lib/internal/repl/utils.js",
|
||||
"lib/internal/socket_list.js",
|
||||
"lib/internal/socketaddress.js",
|
||||
"lib/internal/source_map/prepare_stack_trace.js",
|
||||
"lib/internal/source_map/source_map.js",
|
||||
"lib/internal/source_map/source_map_cache.js",
|
||||
"lib/internal/source_map/source_map_cache_map.js",
|
||||
"lib/internal/stream_base_commons.js",
|
||||
"lib/internal/streams/add-abort-signal.js",
|
||||
"lib/internal/streams/compose.js",
|
||||
"lib/internal/streams/destroy.js",
|
||||
"lib/internal/streams/duplex.js",
|
||||
"lib/internal/streams/duplexify.js",
|
||||
"lib/internal/streams/duplexpair.js",
|
||||
"lib/internal/streams/end-of-stream.js",
|
||||
"lib/internal/streams/from.js",
|
||||
"lib/internal/streams/lazy_transform.js",
|
||||
"lib/internal/streams/legacy.js",
|
||||
"lib/internal/streams/operators.js",
|
||||
"lib/internal/streams/passthrough.js",
|
||||
"lib/internal/streams/pipeline.js",
|
||||
"lib/internal/streams/readable.js",
|
||||
"lib/internal/streams/state.js",
|
||||
"lib/internal/streams/transform.js",
|
||||
"lib/internal/streams/utils.js",
|
||||
"lib/internal/streams/writable.js",
|
||||
"lib/internal/test/binding.js",
|
||||
"lib/internal/test/transfer.js",
|
||||
"lib/internal/test_runner/assert.js",
|
||||
"lib/internal/test_runner/coverage.js",
|
||||
"lib/internal/test_runner/harness.js",
|
||||
"lib/internal/test_runner/mock/loader.js",
|
||||
"lib/internal/test_runner/mock/mock.js",
|
||||
"lib/internal/test_runner/mock/mock_timers.js",
|
||||
"lib/internal/test_runner/reporter/dot.js",
|
||||
"lib/internal/test_runner/reporter/junit.js",
|
||||
"lib/internal/test_runner/reporter/lcov.js",
|
||||
"lib/internal/test_runner/reporter/spec.js",
|
||||
"lib/internal/test_runner/reporter/tap.js",
|
||||
"lib/internal/test_runner/reporter/utils.js",
|
||||
"lib/internal/test_runner/reporter/v8-serializer.js",
|
||||
"lib/internal/test_runner/runner.js",
|
||||
"lib/internal/test_runner/snapshot.js",
|
||||
"lib/internal/test_runner/test.js",
|
||||
"lib/internal/test_runner/tests_stream.js",
|
||||
"lib/internal/test_runner/utils.js",
|
||||
"lib/internal/timers.js",
|
||||
"lib/internal/tls/secure-context.js",
|
||||
"lib/internal/tls/secure-pair.js",
|
||||
"lib/internal/trace_events_async_hooks.js",
|
||||
"lib/internal/tty.js",
|
||||
"lib/internal/url.js",
|
||||
"lib/internal/util.js",
|
||||
"lib/internal/util/colors.js",
|
||||
"lib/internal/util/comparisons.js",
|
||||
"lib/internal/util/debuglog.js",
|
||||
"lib/internal/util/diff.js",
|
||||
"lib/internal/util/inspect.js",
|
||||
"lib/internal/util/inspector.js",
|
||||
"lib/internal/util/parse_args/parse_args.js",
|
||||
"lib/internal/util/parse_args/utils.js",
|
||||
"lib/internal/util/trace_sigint.js",
|
||||
"lib/internal/util/types.js",
|
||||
"lib/internal/v8/startup_snapshot.js",
|
||||
"lib/internal/v8_prof_polyfill.js",
|
||||
"lib/internal/v8_prof_processor.js",
|
||||
"lib/internal/validators.js",
|
||||
"lib/internal/vm.js",
|
||||
"lib/internal/vm/module.js",
|
||||
"lib/internal/wasm_web_api.js",
|
||||
"lib/internal/watch_mode/files_watcher.js",
|
||||
"lib/internal/watchdog.js",
|
||||
"lib/internal/webidl.js",
|
||||
"lib/internal/webstorage.js",
|
||||
"lib/internal/webstreams/adapters.js",
|
||||
"lib/internal/webstreams/compression.js",
|
||||
"lib/internal/webstreams/encoding.js",
|
||||
"lib/internal/webstreams/queuingstrategies.js",
|
||||
"lib/internal/webstreams/readablestream.js",
|
||||
"lib/internal/webstreams/transfer.js",
|
||||
"lib/internal/webstreams/transformstream.js",
|
||||
"lib/internal/webstreams/util.js",
|
||||
"lib/internal/webstreams/writablestream.js",
|
||||
"lib/internal/worker.js",
|
||||
"lib/internal/worker/clone_dom_exception.js",
|
||||
"lib/internal/worker/io.js",
|
||||
"lib/internal/worker/js_transferable.js",
|
||||
"lib/internal/worker/messaging.js",
|
||||
"lib/module.js",
|
||||
"lib/net.js",
|
||||
"lib/os.js",
|
||||
"lib/path.js",
|
||||
"lib/path/posix.js",
|
||||
"lib/path/win32.js",
|
||||
"lib/perf_hooks.js",
|
||||
"lib/process.js",
|
||||
"lib/punycode.js",
|
||||
"lib/querystring.js",
|
||||
"lib/readline.js",
|
||||
"lib/readline/promises.js",
|
||||
"lib/repl.js",
|
||||
"lib/sea.js",
|
||||
"lib/sqlite.js",
|
||||
"lib/stream.js",
|
||||
"lib/stream/consumers.js",
|
||||
"lib/stream/promises.js",
|
||||
"lib/stream/web.js",
|
||||
"lib/string_decoder.js",
|
||||
"lib/sys.js",
|
||||
"lib/test.js",
|
||||
"lib/test/reporters.js",
|
||||
"lib/timers.js",
|
||||
"lib/timers/promises.js",
|
||||
"lib/tls.js",
|
||||
"lib/trace_events.js",
|
||||
"lib/tty.js",
|
||||
"lib/url.js",
|
||||
"lib/util.js",
|
||||
"lib/util/types.js",
|
||||
"lib/v8.js",
|
||||
"lib/vm.js",
|
||||
"lib/wasi.js",
|
||||
"lib/worker_threads.js",
|
||||
"lib/zlib.js"
|
||||
],
|
||||
"node_module_version": 127,
|
||||
"node_no_browser_globals": "false",
|
||||
"node_prefix": "/opt/homebrew/Cellar/node@22/22.22.0",
|
||||
"node_release_urlbase": "",
|
||||
"node_shared": "true",
|
||||
"node_shared_ada": "false",
|
||||
"node_shared_brotli": "true",
|
||||
"node_shared_cares": "true",
|
||||
"node_shared_http_parser": "false",
|
||||
"node_shared_libuv": "true",
|
||||
"node_shared_nghttp2": "true",
|
||||
"node_shared_nghttp3": "true",
|
||||
"node_shared_ngtcp2": "true",
|
||||
"node_shared_openssl": "true",
|
||||
"node_shared_simdjson": "true",
|
||||
"node_shared_simdutf": "true",
|
||||
"node_shared_sqlite": "true",
|
||||
"node_shared_uvwasi": "true",
|
||||
"node_shared_zlib": "true",
|
||||
"node_shared_zstd": "true",
|
||||
"node_tag": "",
|
||||
"node_target_type": "shared_library",
|
||||
"node_use_amaro": "true",
|
||||
"node_use_bundled_v8": "true",
|
||||
"node_use_node_code_cache": "false",
|
||||
"node_use_node_snapshot": "false",
|
||||
"node_use_openssl": "true",
|
||||
"node_use_sqlite": "true",
|
||||
"node_use_v8_platform": "true",
|
||||
"node_with_ltcg": "false",
|
||||
"node_without_node_options": "false",
|
||||
"node_write_snapshot_as_array_literals": "false",
|
||||
"openssl_is_fips": "false",
|
||||
"openssl_quic": "false",
|
||||
"ossfuzz": "false",
|
||||
"shlib_suffix": "127.dylib",
|
||||
"single_executable_application": "true",
|
||||
"suppress_all_error_on_warn": "false",
|
||||
"target_arch": "arm64",
|
||||
"ubsan": 0,
|
||||
"use_ccache_win": 0,
|
||||
"use_prefix_to_find_headers": "false",
|
||||
"v8_enable_31bit_smis_on_64bit_arch": 0,
|
||||
"v8_enable_extensible_ro_snapshot": 0,
|
||||
"v8_enable_external_code_space": 0,
|
||||
"v8_enable_gdbjit": 0,
|
||||
"v8_enable_hugepage": 0,
|
||||
"v8_enable_i18n_support": 1,
|
||||
"v8_enable_inspector": 1,
|
||||
"v8_enable_javascript_promise_hooks": 1,
|
||||
"v8_enable_lite_mode": 0,
|
||||
"v8_enable_maglev": 0,
|
||||
"v8_enable_object_print": 1,
|
||||
"v8_enable_pointer_compression": 0,
|
||||
"v8_enable_pointer_compression_shared_cage": 0,
|
||||
"v8_enable_sandbox": 0,
|
||||
"v8_enable_shared_ro_heap": 1,
|
||||
"v8_enable_webassembly": 1,
|
||||
"v8_optimized_debug": 1,
|
||||
"v8_promise_internal_field_count": 1,
|
||||
"v8_random_seed": 0,
|
||||
"v8_trace_maps": 0,
|
||||
"v8_use_siphash": 1,
|
||||
"want_separate_host_toolset": 0,
|
||||
"nodedir": "/Users/jianzhang/Library/Caches/node-gyp/22.22.0",
|
||||
"python": "/opt/homebrew/opt/python@3.14/bin/python3.14",
|
||||
"standalone_static_library": 1,
|
||||
"global_prefix": "/opt/homebrew",
|
||||
"local_prefix": "/Users/jianzhang/.openclaw/workspace/projects/status-panel",
|
||||
"globalconfig": "/opt/homebrew/etc/npmrc",
|
||||
"init_module": "/Users/jianzhang/.npm-init.js",
|
||||
"userconfig": "/Users/jianzhang/.npmrc",
|
||||
"npm_version": "10.9.4",
|
||||
"node_gyp": "/opt/homebrew/Cellar/node@22/22.22.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",
|
||||
"cache": "/Users/jianzhang/.npm",
|
||||
"user_agent": "npm/10.9.4 node/v22.22.0 darwin arm64 workspaces/false",
|
||||
"prefix": "/opt/homebrew"
|
||||
}
|
||||
}
|
||||
52
projects/status-panel/node_modules/better-sqlite3/build/deps/locate_sqlite3.target.mk
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
# This file is generated by gyp; do not edit.
|
||||
|
||||
TOOLSET := target
|
||||
TARGET := locate_sqlite3
|
||||
### Rules for action "copy_builtin_sqlite3":
|
||||
quiet_cmd_deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 = ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 $@
|
||||
cmd_deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd $(srcdir)/deps; mkdir -p $(obj)/gen/sqlite3; node copy.js "$(obj)/gen/sqlite3" ""
|
||||
|
||||
$(obj)/gen/sqlite3/sqlite3.c: obj := $(abs_obj)
|
||||
$(obj)/gen/sqlite3/sqlite3.c: builddir := $(abs_builddir)
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export BUILT_FRAMEWORKS_DIR := ${abs_builddir}
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export BUILT_PRODUCTS_DIR := ${abs_builddir}
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export CONFIGURATION := ${BUILDTYPE}
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export PRODUCT_NAME := locate_sqlite3
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export SDKROOT := /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export SRCROOT := ${abs_srcdir}/deps
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export SOURCE_ROOT := ${SRCROOT}
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export TARGET_BUILD_DIR := ${abs_builddir}
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export TEMP_DIR := ${TMPDIR}
|
||||
$(obj)/gen/sqlite3/sqlite3.c: export XCODE_VERSION_ACTUAL := 2620
|
||||
$(obj)/gen/sqlite3/sqlite3.c: TOOLSET := $(TOOLSET)
|
||||
$(obj)/gen/sqlite3/sqlite3.c $(obj)/gen/sqlite3/sqlite3.h $(obj)/gen/sqlite3/sqlite3ext.h: ba23eeee118cd63e16015df367567cb043fed872.intermediate
|
||||
@:
|
||||
.INTERMEDIATE: ba23eeee118cd63e16015df367567cb043fed872.intermediate
|
||||
ba23eeee118cd63e16015df367567cb043fed872.intermediate: $(srcdir)/deps/sqlite3/sqlite3.c $(srcdir)/deps/sqlite3/sqlite3.h $(srcdir)/deps/sqlite3/sqlite3ext.h FORCE_DO_CMD
|
||||
$(call do_cmd,touch)
|
||||
$(call do_cmd,deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3)
|
||||
|
||||
all_deps += $(obj)/gen/sqlite3/sqlite3.c $(obj)/gen/sqlite3/sqlite3.h $(obj)/gen/sqlite3/sqlite3ext.h
|
||||
action_deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3_outputs := $(obj)/gen/sqlite3/sqlite3.c $(obj)/gen/sqlite3/sqlite3.h $(obj)/gen/sqlite3/sqlite3ext.h
|
||||
|
||||
|
||||
### Rules for final target.
|
||||
# Build our special outputs first.
|
||||
$(obj).target/deps/locate_sqlite3.stamp: | $(action_deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3_outputs)
|
||||
|
||||
# Preserve order dependency of special output on deps.
|
||||
$(action_deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3_outputs): |
|
||||
|
||||
$(obj).target/deps/locate_sqlite3.stamp: TOOLSET := $(TOOLSET)
|
||||
$(obj).target/deps/locate_sqlite3.stamp: FORCE_DO_CMD
|
||||
$(call do_cmd,touch)
|
||||
|
||||
all_deps += $(obj).target/deps/locate_sqlite3.stamp
|
||||
# Add target alias
|
||||
.PHONY: locate_sqlite3
|
||||
locate_sqlite3: $(obj).target/deps/locate_sqlite3.stamp
|
||||
|
||||
# Add target alias to "all" target.
|
||||
.PHONY: all
|
||||
all: locate_sqlite3
|
||||
|
||||
6
projects/status-panel/node_modules/better-sqlite3/build/deps/sqlite3.Makefile
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# This file is generated by gyp; do not edit.
|
||||
|
||||
export builddir_name ?= ./build/deps/.
|
||||
.PHONY: all
|
||||
all:
|
||||
$(MAKE) -C .. locate_sqlite3 sqlite3
|
||||
265
projects/status-panel/node_modules/better-sqlite3/build/deps/sqlite3.target.mk
generated
vendored
Normal file
@@ -0,0 +1,265 @@
|
||||
# This file is generated by gyp; do not edit.
|
||||
|
||||
TOOLSET := target
|
||||
TARGET := sqlite3
|
||||
DEFS_Debug := \
|
||||
'-DNODE_GYP_MODULE_NAME=sqlite3' \
|
||||
'-DUSING_UV_SHARED=1' \
|
||||
'-DUSING_V8_SHARED=1' \
|
||||
'-DV8_DEPRECATION_WARNINGS=1' \
|
||||
'-D_GLIBCXX_USE_CXX11_ABI=1' \
|
||||
'-D_FILE_OFFSET_BITS=64' \
|
||||
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
||||
'-D_LARGEFILE_SOURCE' \
|
||||
'-DHAVE_INT16_T=1' \
|
||||
'-DHAVE_INT32_T=1' \
|
||||
'-DHAVE_INT8_T=1' \
|
||||
'-DHAVE_STDINT_H=1' \
|
||||
'-DHAVE_UINT16_T=1' \
|
||||
'-DHAVE_UINT32_T=1' \
|
||||
'-DHAVE_UINT8_T=1' \
|
||||
'-DHAVE_USLEEP=1' \
|
||||
'-DSQLITE_DEFAULT_CACHE_SIZE=-16000' \
|
||||
'-DSQLITE_DEFAULT_FOREIGN_KEYS=1' \
|
||||
'-DSQLITE_DEFAULT_MEMSTATUS=0' \
|
||||
'-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1' \
|
||||
'-DSQLITE_DQS=0' \
|
||||
'-DSQLITE_ENABLE_COLUMN_METADATA' \
|
||||
'-DSQLITE_ENABLE_DESERIALIZE' \
|
||||
'-DSQLITE_ENABLE_FTS3' \
|
||||
'-DSQLITE_ENABLE_FTS3_PARENTHESIS' \
|
||||
'-DSQLITE_ENABLE_FTS4' \
|
||||
'-DSQLITE_ENABLE_FTS5' \
|
||||
'-DSQLITE_ENABLE_GEOPOLY' \
|
||||
'-DSQLITE_ENABLE_JSON1' \
|
||||
'-DSQLITE_ENABLE_MATH_FUNCTIONS' \
|
||||
'-DSQLITE_ENABLE_RTREE' \
|
||||
'-DSQLITE_ENABLE_STAT4' \
|
||||
'-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT' \
|
||||
'-DSQLITE_LIKE_DOESNT_MATCH_BLOBS' \
|
||||
'-DSQLITE_OMIT_DEPRECATED' \
|
||||
'-DSQLITE_OMIT_PROGRESS_CALLBACK' \
|
||||
'-DSQLITE_OMIT_SHARED_CACHE' \
|
||||
'-DSQLITE_OMIT_TCL_VARIABLE' \
|
||||
'-DSQLITE_SOUNDEX' \
|
||||
'-DSQLITE_THREADSAFE=2' \
|
||||
'-DSQLITE_TRACE_SIZE_LIMIT=32' \
|
||||
'-DSQLITE_USE_URI=0' \
|
||||
'-DDEBUG' \
|
||||
'-D_DEBUG' \
|
||||
'-DSQLITE_DEBUG' \
|
||||
'-DSQLITE_MEMDEBUG' \
|
||||
'-DSQLITE_ENABLE_API_ARMOR' \
|
||||
'-DSQLITE_WIN32_MALLOC_VALIDATE'
|
||||
|
||||
# Flags passed to all source files.
|
||||
CFLAGS_Debug := \
|
||||
-O0 \
|
||||
-gdwarf-2 \
|
||||
-fno-strict-aliasing \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-Wall \
|
||||
-Wendif-labels \
|
||||
-W \
|
||||
-Wno-unused-parameter \
|
||||
-w
|
||||
|
||||
# Flags passed to only C files.
|
||||
CFLAGS_C_Debug := \
|
||||
-std=c99
|
||||
|
||||
# Flags passed to only C++ files.
|
||||
CFLAGS_CC_Debug := \
|
||||
-std=gnu++17 \
|
||||
-stdlib=libc++ \
|
||||
-fno-rtti \
|
||||
-fno-exceptions \
|
||||
-std=c99
|
||||
|
||||
# Flags passed to only ObjC files.
|
||||
CFLAGS_OBJC_Debug :=
|
||||
|
||||
# Flags passed to only ObjC++ files.
|
||||
CFLAGS_OBJCC_Debug :=
|
||||
|
||||
INCS_Debug := \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include \
|
||||
-I$(obj)/gen/sqlite3
|
||||
|
||||
DEFS_Release := \
|
||||
'-DNODE_GYP_MODULE_NAME=sqlite3' \
|
||||
'-DUSING_UV_SHARED=1' \
|
||||
'-DUSING_V8_SHARED=1' \
|
||||
'-DV8_DEPRECATION_WARNINGS=1' \
|
||||
'-D_GLIBCXX_USE_CXX11_ABI=1' \
|
||||
'-D_FILE_OFFSET_BITS=64' \
|
||||
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
||||
'-D_LARGEFILE_SOURCE' \
|
||||
'-DHAVE_INT16_T=1' \
|
||||
'-DHAVE_INT32_T=1' \
|
||||
'-DHAVE_INT8_T=1' \
|
||||
'-DHAVE_STDINT_H=1' \
|
||||
'-DHAVE_UINT16_T=1' \
|
||||
'-DHAVE_UINT32_T=1' \
|
||||
'-DHAVE_UINT8_T=1' \
|
||||
'-DHAVE_USLEEP=1' \
|
||||
'-DSQLITE_DEFAULT_CACHE_SIZE=-16000' \
|
||||
'-DSQLITE_DEFAULT_FOREIGN_KEYS=1' \
|
||||
'-DSQLITE_DEFAULT_MEMSTATUS=0' \
|
||||
'-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1' \
|
||||
'-DSQLITE_DQS=0' \
|
||||
'-DSQLITE_ENABLE_COLUMN_METADATA' \
|
||||
'-DSQLITE_ENABLE_DESERIALIZE' \
|
||||
'-DSQLITE_ENABLE_FTS3' \
|
||||
'-DSQLITE_ENABLE_FTS3_PARENTHESIS' \
|
||||
'-DSQLITE_ENABLE_FTS4' \
|
||||
'-DSQLITE_ENABLE_FTS5' \
|
||||
'-DSQLITE_ENABLE_GEOPOLY' \
|
||||
'-DSQLITE_ENABLE_JSON1' \
|
||||
'-DSQLITE_ENABLE_MATH_FUNCTIONS' \
|
||||
'-DSQLITE_ENABLE_RTREE' \
|
||||
'-DSQLITE_ENABLE_STAT4' \
|
||||
'-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT' \
|
||||
'-DSQLITE_LIKE_DOESNT_MATCH_BLOBS' \
|
||||
'-DSQLITE_OMIT_DEPRECATED' \
|
||||
'-DSQLITE_OMIT_PROGRESS_CALLBACK' \
|
||||
'-DSQLITE_OMIT_SHARED_CACHE' \
|
||||
'-DSQLITE_OMIT_TCL_VARIABLE' \
|
||||
'-DSQLITE_SOUNDEX' \
|
||||
'-DSQLITE_THREADSAFE=2' \
|
||||
'-DSQLITE_TRACE_SIZE_LIMIT=32' \
|
||||
'-DSQLITE_USE_URI=0' \
|
||||
'-DNDEBUG'
|
||||
|
||||
# Flags passed to all source files.
|
||||
CFLAGS_Release := \
|
||||
-O3 \
|
||||
-fno-strict-aliasing \
|
||||
-flto \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-Wall \
|
||||
-Wendif-labels \
|
||||
-W \
|
||||
-Wno-unused-parameter \
|
||||
-w
|
||||
|
||||
# Flags passed to only C files.
|
||||
CFLAGS_C_Release := \
|
||||
-std=c99
|
||||
|
||||
# Flags passed to only C++ files.
|
||||
CFLAGS_CC_Release := \
|
||||
-std=gnu++17 \
|
||||
-stdlib=libc++ \
|
||||
-fno-rtti \
|
||||
-fno-exceptions \
|
||||
-fvisibility-inlines-hidden \
|
||||
-std=c99
|
||||
|
||||
# Flags passed to only ObjC files.
|
||||
CFLAGS_OBJC_Release :=
|
||||
|
||||
# Flags passed to only ObjC++ files.
|
||||
CFLAGS_OBJCC_Release :=
|
||||
|
||||
INCS_Release := \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include \
|
||||
-I$(obj)/gen/sqlite3
|
||||
|
||||
OBJS := \
|
||||
$(obj).target/$(TARGET)/gen/sqlite3/sqlite3.o
|
||||
|
||||
# Add to the list of files we specially track dependencies for.
|
||||
all_deps += $(OBJS)
|
||||
|
||||
# Make sure our dependencies are built before any of us.
|
||||
$(OBJS): | $(obj).target/deps/locate_sqlite3.stamp
|
||||
|
||||
# CFLAGS et al overrides must be target-local.
|
||||
# See "Target-specific Variable Values" in the GNU Make manual.
|
||||
$(OBJS): TOOLSET := $(TOOLSET)
|
||||
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
|
||||
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
|
||||
$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
|
||||
$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
|
||||
|
||||
# Suffix rules, putting all outputs into $(obj).
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
# Try building from generated source, too.
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
# End of this set of suffix rules
|
||||
### Rules for final target.
|
||||
LDFLAGS_Debug := \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-L$(builddir) \
|
||||
-stdlib=libc++
|
||||
|
||||
LIBTOOLFLAGS_Debug :=
|
||||
|
||||
LDFLAGS_Release := \
|
||||
-Wl,-dead_strip \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-L$(builddir) \
|
||||
-stdlib=libc++
|
||||
|
||||
LIBTOOLFLAGS_Release :=
|
||||
|
||||
LIBS :=
|
||||
|
||||
$(builddir)/sqlite3.a: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
|
||||
$(builddir)/sqlite3.a: LIBS := $(LIBS)
|
||||
$(builddir)/sqlite3.a: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
|
||||
$(builddir)/sqlite3.a: TOOLSET := $(TOOLSET)
|
||||
$(builddir)/sqlite3.a: $(OBJS) FORCE_DO_CMD
|
||||
$(call do_cmd,alink)
|
||||
|
||||
all_deps += $(builddir)/sqlite3.a
|
||||
# Add target alias
|
||||
.PHONY: sqlite3
|
||||
sqlite3: $(builddir)/sqlite3.a
|
||||
|
||||
# Add target alias to "all" target.
|
||||
.PHONY: all
|
||||
all: sqlite3
|
||||
|
||||
# Add target alias
|
||||
.PHONY: sqlite3
|
||||
sqlite3: $(builddir)/sqlite3.a
|
||||
|
||||
# Short alias for building this static library.
|
||||
.PHONY: sqlite3.a
|
||||
sqlite3.a: $(builddir)/sqlite3.a
|
||||
|
||||
# Add static library to "all" target.
|
||||
.PHONY: all
|
||||
all: $(builddir)/sqlite3.a
|
||||
|
||||
768
projects/status-panel/node_modules/better-sqlite3/build/gyp-mac-tool
generated
vendored
Executable file
@@ -0,0 +1,768 @@
|
||||
#!/usr/bin/env python3
|
||||
# Generated by gyp. Do not edit.
|
||||
# Copyright (c) 2012 Google Inc. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""Utility functions to perform Xcode-style build steps.
|
||||
|
||||
These functions are executed via gyp-mac-tool when using the Makefile generator.
|
||||
"""
|
||||
|
||||
|
||||
import fcntl
|
||||
import fnmatch
|
||||
import glob
|
||||
import json
|
||||
import os
|
||||
import plistlib
|
||||
import re
|
||||
import shutil
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
|
||||
def main(args):
|
||||
executor = MacTool()
|
||||
exit_code = executor.Dispatch(args)
|
||||
if exit_code is not None:
|
||||
sys.exit(exit_code)
|
||||
|
||||
|
||||
class MacTool:
|
||||
"""This class performs all the Mac tooling steps. The methods can either be
|
||||
executed directly, or dispatched from an argument list."""
|
||||
|
||||
def Dispatch(self, args):
|
||||
"""Dispatches a string command to a method."""
|
||||
if len(args) < 1:
|
||||
raise Exception("Not enough arguments")
|
||||
|
||||
method = "Exec%s" % self._CommandifyName(args[0])
|
||||
return getattr(self, method)(*args[1:])
|
||||
|
||||
def _CommandifyName(self, name_string):
|
||||
"""Transforms a tool name like copy-info-plist to CopyInfoPlist"""
|
||||
return name_string.title().replace("-", "")
|
||||
|
||||
def ExecCopyBundleResource(self, source, dest, convert_to_binary):
|
||||
"""Copies a resource file to the bundle/Resources directory, performing any
|
||||
necessary compilation on each resource."""
|
||||
convert_to_binary = convert_to_binary == "True"
|
||||
extension = os.path.splitext(source)[1].lower()
|
||||
if os.path.isdir(source):
|
||||
# Copy tree.
|
||||
# TODO(thakis): This copies file attributes like mtime, while the
|
||||
# single-file branch below doesn't. This should probably be changed to
|
||||
# be consistent with the single-file branch.
|
||||
if os.path.exists(dest):
|
||||
shutil.rmtree(dest)
|
||||
shutil.copytree(source, dest)
|
||||
elif extension in {".xib", ".storyboard"}:
|
||||
return self._CopyXIBFile(source, dest)
|
||||
elif extension == ".strings" and not convert_to_binary:
|
||||
self._CopyStringsFile(source, dest)
|
||||
else:
|
||||
if os.path.exists(dest):
|
||||
os.unlink(dest)
|
||||
shutil.copy(source, dest)
|
||||
|
||||
if convert_to_binary and extension in {".plist", ".strings"}:
|
||||
self._ConvertToBinary(dest)
|
||||
|
||||
def _CopyXIBFile(self, source, dest):
|
||||
"""Compiles a XIB file with ibtool into a binary plist in the bundle."""
|
||||
|
||||
# ibtool sometimes crashes with relative paths. See crbug.com/314728.
|
||||
base = os.path.dirname(os.path.realpath(__file__))
|
||||
if os.path.relpath(source):
|
||||
source = os.path.join(base, source)
|
||||
if os.path.relpath(dest):
|
||||
dest = os.path.join(base, dest)
|
||||
|
||||
args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"]
|
||||
|
||||
if os.environ["XCODE_VERSION_ACTUAL"] > "0700":
|
||||
args.extend(["--auto-activate-custom-fonts"])
|
||||
if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ:
|
||||
args.extend(
|
||||
[
|
||||
"--target-device",
|
||||
"iphone",
|
||||
"--target-device",
|
||||
"ipad",
|
||||
"--minimum-deployment-target",
|
||||
os.environ["IPHONEOS_DEPLOYMENT_TARGET"],
|
||||
]
|
||||
)
|
||||
else:
|
||||
args.extend(
|
||||
[
|
||||
"--target-device",
|
||||
"mac",
|
||||
"--minimum-deployment-target",
|
||||
os.environ["MACOSX_DEPLOYMENT_TARGET"],
|
||||
]
|
||||
)
|
||||
|
||||
args.extend(
|
||||
["--output-format", "human-readable-text", "--compile", dest, source]
|
||||
)
|
||||
|
||||
ibtool_section_re = re.compile(r"/\*.*\*/")
|
||||
ibtool_re = re.compile(r".*note:.*is clipping its content")
|
||||
try:
|
||||
stdout = subprocess.check_output(args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.output)
|
||||
raise
|
||||
current_section_header = None
|
||||
for line in stdout.splitlines():
|
||||
if ibtool_section_re.match(line):
|
||||
current_section_header = line
|
||||
elif not ibtool_re.match(line):
|
||||
if current_section_header:
|
||||
print(current_section_header)
|
||||
current_section_header = None
|
||||
print(line)
|
||||
return 0
|
||||
|
||||
def _ConvertToBinary(self, dest):
|
||||
subprocess.check_call(
|
||||
["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest]
|
||||
)
|
||||
|
||||
def _CopyStringsFile(self, source, dest):
|
||||
"""Copies a .strings file using iconv to reconvert the input into UTF-16."""
|
||||
input_code = self._DetectInputEncoding(source) or "UTF-8"
|
||||
|
||||
# Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call
|
||||
# CFPropertyListCreateFromXMLData() behind the scenes; at least it prints
|
||||
# CFPropertyListCreateFromXMLData(): Old-style plist parser: missing
|
||||
# semicolon in dictionary.
|
||||
# on invalid files. Do the same kind of validation.
|
||||
import CoreFoundation
|
||||
|
||||
with open(source, "rb") as in_file:
|
||||
s = in_file.read()
|
||||
d = CoreFoundation.CFDataCreate(None, s, len(s))
|
||||
_, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None)
|
||||
if error:
|
||||
return
|
||||
|
||||
with open(dest, "wb") as fp:
|
||||
fp.write(s.decode(input_code).encode("UTF-16"))
|
||||
|
||||
def _DetectInputEncoding(self, file_name):
|
||||
"""Reads the first few bytes from file_name and tries to guess the text
|
||||
encoding. Returns None as a guess if it can't detect it."""
|
||||
with open(file_name, "rb") as fp:
|
||||
try:
|
||||
header = fp.read(3)
|
||||
except Exception:
|
||||
return None
|
||||
if header.startswith((b"\xFE\xFF", b"\xFF\xFE")):
|
||||
return "UTF-16"
|
||||
elif header.startswith(b"\xEF\xBB\xBF"):
|
||||
return "UTF-8"
|
||||
else:
|
||||
return None
|
||||
|
||||
def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys):
|
||||
"""Copies the |source| Info.plist to the destination directory |dest|."""
|
||||
# Read the source Info.plist into memory.
|
||||
with open(source) as fd:
|
||||
lines = fd.read()
|
||||
|
||||
# Insert synthesized key/value pairs (e.g. BuildMachineOSBuild).
|
||||
plist = plistlib.readPlistFromString(lines)
|
||||
if keys:
|
||||
plist.update(json.loads(keys[0]))
|
||||
lines = plistlib.writePlistToString(plist)
|
||||
|
||||
# Go through all the environment variables and replace them as variables in
|
||||
# the file.
|
||||
IDENT_RE = re.compile(r"[_/\s]")
|
||||
for key in os.environ:
|
||||
if key.startswith("_"):
|
||||
continue
|
||||
evar = "${%s}" % key
|
||||
evalue = os.environ[key]
|
||||
lines = lines.replace(lines, evar, evalue)
|
||||
|
||||
# Xcode supports various suffices on environment variables, which are
|
||||
# all undocumented. :rfc1034identifier is used in the standard project
|
||||
# template these days, and :identifier was used earlier. They are used to
|
||||
# convert non-url characters into things that look like valid urls --
|
||||
# except that the replacement character for :identifier, '_' isn't valid
|
||||
# in a URL either -- oops, hence :rfc1034identifier was born.
|
||||
evar = "${%s:identifier}" % key
|
||||
evalue = IDENT_RE.sub("_", os.environ[key])
|
||||
lines = lines.replace(lines, evar, evalue)
|
||||
|
||||
evar = "${%s:rfc1034identifier}" % key
|
||||
evalue = IDENT_RE.sub("-", os.environ[key])
|
||||
lines = lines.replace(lines, evar, evalue)
|
||||
|
||||
# Remove any keys with values that haven't been replaced.
|
||||
lines = lines.splitlines()
|
||||
for i in range(len(lines)):
|
||||
if lines[i].strip().startswith("<string>${"):
|
||||
lines[i] = None
|
||||
lines[i - 1] = None
|
||||
lines = "\n".join(line for line in lines if line is not None)
|
||||
|
||||
# Write out the file with variables replaced.
|
||||
with open(dest, "w") as fd:
|
||||
fd.write(lines)
|
||||
|
||||
# Now write out PkgInfo file now that the Info.plist file has been
|
||||
# "compiled".
|
||||
self._WritePkgInfo(dest)
|
||||
|
||||
if convert_to_binary == "True":
|
||||
self._ConvertToBinary(dest)
|
||||
|
||||
def _WritePkgInfo(self, info_plist):
|
||||
"""This writes the PkgInfo file from the data stored in Info.plist."""
|
||||
plist = plistlib.readPlist(info_plist)
|
||||
if not plist:
|
||||
return
|
||||
|
||||
# Only create PkgInfo for executable types.
|
||||
package_type = plist["CFBundlePackageType"]
|
||||
if package_type != "APPL":
|
||||
return
|
||||
|
||||
# The format of PkgInfo is eight characters, representing the bundle type
|
||||
# and bundle signature, each four characters. If that is missing, four
|
||||
# '?' characters are used instead.
|
||||
signature_code = plist.get("CFBundleSignature", "????")
|
||||
if len(signature_code) != 4: # Wrong length resets everything, too.
|
||||
signature_code = "?" * 4
|
||||
|
||||
dest = os.path.join(os.path.dirname(info_plist), "PkgInfo")
|
||||
with open(dest, "w") as fp:
|
||||
fp.write(f"{package_type}{signature_code}")
|
||||
|
||||
def ExecFlock(self, lockfile, *cmd_list):
|
||||
"""Emulates the most basic behavior of Linux's flock(1)."""
|
||||
# Rely on exception handling to report errors.
|
||||
fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666)
|
||||
fcntl.flock(fd, fcntl.LOCK_EX)
|
||||
return subprocess.call(cmd_list)
|
||||
|
||||
def ExecFilterLibtool(self, *cmd_list):
|
||||
"""Calls libtool and filters out '/path/to/libtool: file: foo.o has no
|
||||
symbols'."""
|
||||
libtool_re = re.compile(
|
||||
r"^.*libtool: (?:for architecture: \S* )?file: .* has no symbols$"
|
||||
)
|
||||
libtool_re5 = re.compile(
|
||||
r"^.*libtool: warning for library: "
|
||||
+ r".* the table of contents is empty "
|
||||
+ r"\(no object file members in the library define global symbols\)$"
|
||||
)
|
||||
env = os.environ.copy()
|
||||
# Ref:
|
||||
# http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c
|
||||
# The problem with this flag is that it resets the file mtime on the file to
|
||||
# epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone.
|
||||
env["ZERO_AR_DATE"] = "1"
|
||||
libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env)
|
||||
err = libtoolout.communicate()[1].decode("utf-8")
|
||||
for line in err.splitlines():
|
||||
if not libtool_re.match(line) and not libtool_re5.match(line):
|
||||
print(line, file=sys.stderr)
|
||||
# Unconditionally touch the output .a file on the command line if present
|
||||
# and the command succeeded. A bit hacky.
|
||||
if not libtoolout.returncode:
|
||||
for i in range(len(cmd_list) - 1):
|
||||
if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"):
|
||||
os.utime(cmd_list[i + 1], None)
|
||||
break
|
||||
return libtoolout.returncode
|
||||
|
||||
def ExecPackageIosFramework(self, framework):
|
||||
# Find the name of the binary based on the part before the ".framework".
|
||||
binary = os.path.basename(framework).split(".")[0]
|
||||
module_path = os.path.join(framework, "Modules")
|
||||
if not os.path.exists(module_path):
|
||||
os.mkdir(module_path)
|
||||
module_template = (
|
||||
"framework module %s {\n"
|
||||
' umbrella header "%s.h"\n'
|
||||
"\n"
|
||||
" export *\n"
|
||||
" module * { export * }\n"
|
||||
"}\n" % (binary, binary)
|
||||
)
|
||||
|
||||
with open(os.path.join(module_path, "module.modulemap"), "w") as module_file:
|
||||
module_file.write(module_template)
|
||||
|
||||
def ExecPackageFramework(self, framework, version):
|
||||
"""Takes a path to Something.framework and the Current version of that and
|
||||
sets up all the symlinks."""
|
||||
# Find the name of the binary based on the part before the ".framework".
|
||||
binary = os.path.basename(framework).split(".")[0]
|
||||
|
||||
CURRENT = "Current"
|
||||
RESOURCES = "Resources"
|
||||
VERSIONS = "Versions"
|
||||
|
||||
if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)):
|
||||
# Binary-less frameworks don't seem to contain symlinks (see e.g.
|
||||
# chromium's out/Debug/org.chromium.Chromium.manifest/ bundle).
|
||||
return
|
||||
|
||||
# Move into the framework directory to set the symlinks correctly.
|
||||
pwd = os.getcwd()
|
||||
os.chdir(framework)
|
||||
|
||||
# Set up the Current version.
|
||||
self._Relink(version, os.path.join(VERSIONS, CURRENT))
|
||||
|
||||
# Set up the root symlinks.
|
||||
self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary)
|
||||
self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES)
|
||||
|
||||
# Back to where we were before!
|
||||
os.chdir(pwd)
|
||||
|
||||
def _Relink(self, dest, link):
|
||||
"""Creates a symlink to |dest| named |link|. If |link| already exists,
|
||||
it is overwritten."""
|
||||
if os.path.lexists(link):
|
||||
os.remove(link)
|
||||
os.symlink(dest, link)
|
||||
|
||||
def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers):
|
||||
framework_name = os.path.basename(framework).split(".")[0]
|
||||
all_headers = [os.path.abspath(header) for header in all_headers]
|
||||
filelist = {}
|
||||
for header in all_headers:
|
||||
filename = os.path.basename(header)
|
||||
filelist[filename] = header
|
||||
filelist[os.path.join(framework_name, filename)] = header
|
||||
WriteHmap(out, filelist)
|
||||
|
||||
def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers):
|
||||
header_path = os.path.join(framework, "Headers")
|
||||
if not os.path.exists(header_path):
|
||||
os.makedirs(header_path)
|
||||
for header in copy_headers:
|
||||
shutil.copy(header, os.path.join(header_path, os.path.basename(header)))
|
||||
|
||||
def ExecCompileXcassets(self, keys, *inputs):
|
||||
"""Compiles multiple .xcassets files into a single .car file.
|
||||
|
||||
This invokes 'actool' to compile all the inputs .xcassets files. The
|
||||
|keys| arguments is a json-encoded dictionary of extra arguments to
|
||||
pass to 'actool' when the asset catalogs contains an application icon
|
||||
or a launch image.
|
||||
|
||||
Note that 'actool' does not create the Assets.car file if the asset
|
||||
catalogs does not contains imageset.
|
||||
"""
|
||||
command_line = [
|
||||
"xcrun",
|
||||
"actool",
|
||||
"--output-format",
|
||||
"human-readable-text",
|
||||
"--compress-pngs",
|
||||
"--notices",
|
||||
"--warnings",
|
||||
"--errors",
|
||||
]
|
||||
is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ
|
||||
if is_iphone_target:
|
||||
platform = os.environ["CONFIGURATION"].split("-")[-1]
|
||||
if platform not in ("iphoneos", "iphonesimulator"):
|
||||
platform = "iphonesimulator"
|
||||
command_line.extend(
|
||||
[
|
||||
"--platform",
|
||||
platform,
|
||||
"--target-device",
|
||||
"iphone",
|
||||
"--target-device",
|
||||
"ipad",
|
||||
"--minimum-deployment-target",
|
||||
os.environ["IPHONEOS_DEPLOYMENT_TARGET"],
|
||||
"--compile",
|
||||
os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]),
|
||||
]
|
||||
)
|
||||
else:
|
||||
command_line.extend(
|
||||
[
|
||||
"--platform",
|
||||
"macosx",
|
||||
"--target-device",
|
||||
"mac",
|
||||
"--minimum-deployment-target",
|
||||
os.environ["MACOSX_DEPLOYMENT_TARGET"],
|
||||
"--compile",
|
||||
os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]),
|
||||
]
|
||||
)
|
||||
if keys:
|
||||
keys = json.loads(keys)
|
||||
for key, value in keys.items():
|
||||
arg_name = "--" + key
|
||||
if isinstance(value, bool):
|
||||
if value:
|
||||
command_line.append(arg_name)
|
||||
elif isinstance(value, list):
|
||||
for v in value:
|
||||
command_line.append(arg_name)
|
||||
command_line.append(str(v))
|
||||
else:
|
||||
command_line.append(arg_name)
|
||||
command_line.append(str(value))
|
||||
# Note: actool crashes if inputs path are relative, so use os.path.abspath
|
||||
# to get absolute path name for inputs.
|
||||
command_line.extend(map(os.path.abspath, inputs))
|
||||
subprocess.check_call(command_line)
|
||||
|
||||
def ExecMergeInfoPlist(self, output, *inputs):
|
||||
"""Merge multiple .plist files into a single .plist file."""
|
||||
merged_plist = {}
|
||||
for path in inputs:
|
||||
plist = self._LoadPlistMaybeBinary(path)
|
||||
self._MergePlist(merged_plist, plist)
|
||||
plistlib.writePlist(merged_plist, output)
|
||||
|
||||
def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve):
|
||||
"""Code sign a bundle.
|
||||
|
||||
This function tries to code sign an iOS bundle, following the same
|
||||
algorithm as Xcode:
|
||||
1. pick the provisioning profile that best match the bundle identifier,
|
||||
and copy it into the bundle as embedded.mobileprovision,
|
||||
2. copy Entitlements.plist from user or SDK next to the bundle,
|
||||
3. code sign the bundle.
|
||||
"""
|
||||
substitutions, overrides = self._InstallProvisioningProfile(
|
||||
provisioning, self._GetCFBundleIdentifier()
|
||||
)
|
||||
entitlements_path = self._InstallEntitlements(
|
||||
entitlements, substitutions, overrides
|
||||
)
|
||||
|
||||
args = ["codesign", "--force", "--sign", key]
|
||||
if preserve == "True":
|
||||
args.extend(["--deep", "--preserve-metadata=identifier,entitlements"])
|
||||
else:
|
||||
args.extend(["--entitlements", entitlements_path])
|
||||
args.extend(["--timestamp=none", path])
|
||||
subprocess.check_call(args)
|
||||
|
||||
def _InstallProvisioningProfile(self, profile, bundle_identifier):
|
||||
"""Installs embedded.mobileprovision into the bundle.
|
||||
|
||||
Args:
|
||||
profile: string, optional, short name of the .mobileprovision file
|
||||
to use, if empty or the file is missing, the best file installed
|
||||
will be used
|
||||
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
|
||||
|
||||
Returns:
|
||||
A tuple containing two dictionary: variables substitutions and values
|
||||
to overrides when generating the entitlements file.
|
||||
"""
|
||||
source_path, provisioning_data, team_id = self._FindProvisioningProfile(
|
||||
profile, bundle_identifier
|
||||
)
|
||||
target_path = os.path.join(
|
||||
os.environ["BUILT_PRODUCTS_DIR"],
|
||||
os.environ["CONTENTS_FOLDER_PATH"],
|
||||
"embedded.mobileprovision",
|
||||
)
|
||||
shutil.copy2(source_path, target_path)
|
||||
substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".")
|
||||
return substitutions, provisioning_data["Entitlements"]
|
||||
|
||||
def _FindProvisioningProfile(self, profile, bundle_identifier):
|
||||
"""Finds the .mobileprovision file to use for signing the bundle.
|
||||
|
||||
Checks all the installed provisioning profiles (or if the user specified
|
||||
the PROVISIONING_PROFILE variable, only consult it) and select the most
|
||||
specific that correspond to the bundle identifier.
|
||||
|
||||
Args:
|
||||
profile: string, optional, short name of the .mobileprovision file
|
||||
to use, if empty or the file is missing, the best file installed
|
||||
will be used
|
||||
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
|
||||
|
||||
Returns:
|
||||
A tuple of the path to the selected provisioning profile, the data of
|
||||
the embedded plist in the provisioning profile and the team identifier
|
||||
to use for code signing.
|
||||
|
||||
Raises:
|
||||
SystemExit: if no .mobileprovision can be used to sign the bundle.
|
||||
"""
|
||||
profiles_dir = os.path.join(
|
||||
os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles"
|
||||
)
|
||||
if not os.path.isdir(profiles_dir):
|
||||
print(
|
||||
"cannot find mobile provisioning for %s" % (bundle_identifier),
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
provisioning_profiles = None
|
||||
if profile:
|
||||
profile_path = os.path.join(profiles_dir, profile + ".mobileprovision")
|
||||
if os.path.exists(profile_path):
|
||||
provisioning_profiles = [profile_path]
|
||||
if not provisioning_profiles:
|
||||
provisioning_profiles = glob.glob(
|
||||
os.path.join(profiles_dir, "*.mobileprovision")
|
||||
)
|
||||
valid_provisioning_profiles = {}
|
||||
for profile_path in provisioning_profiles:
|
||||
profile_data = self._LoadProvisioningProfile(profile_path)
|
||||
app_id_pattern = profile_data.get("Entitlements", {}).get(
|
||||
"application-identifier", ""
|
||||
)
|
||||
for team_identifier in profile_data.get("TeamIdentifier", []):
|
||||
app_id = f"{team_identifier}.{bundle_identifier}"
|
||||
if fnmatch.fnmatch(app_id, app_id_pattern):
|
||||
valid_provisioning_profiles[app_id_pattern] = (
|
||||
profile_path,
|
||||
profile_data,
|
||||
team_identifier,
|
||||
)
|
||||
if not valid_provisioning_profiles:
|
||||
print(
|
||||
"cannot find mobile provisioning for %s" % (bundle_identifier),
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
# If the user has multiple provisioning profiles installed that can be
|
||||
# used for ${bundle_identifier}, pick the most specific one (ie. the
|
||||
# provisioning profile whose pattern is the longest).
|
||||
selected_key = max(valid_provisioning_profiles, key=lambda v: len(v))
|
||||
return valid_provisioning_profiles[selected_key]
|
||||
|
||||
def _LoadProvisioningProfile(self, profile_path):
|
||||
"""Extracts the plist embedded in a provisioning profile.
|
||||
|
||||
Args:
|
||||
profile_path: string, path to the .mobileprovision file
|
||||
|
||||
Returns:
|
||||
Content of the plist embedded in the provisioning profile as a dictionary.
|
||||
"""
|
||||
with tempfile.NamedTemporaryFile() as temp:
|
||||
subprocess.check_call(
|
||||
["security", "cms", "-D", "-i", profile_path, "-o", temp.name]
|
||||
)
|
||||
return self._LoadPlistMaybeBinary(temp.name)
|
||||
|
||||
def _MergePlist(self, merged_plist, plist):
|
||||
"""Merge |plist| into |merged_plist|."""
|
||||
for key, value in plist.items():
|
||||
if isinstance(value, dict):
|
||||
merged_value = merged_plist.get(key, {})
|
||||
if isinstance(merged_value, dict):
|
||||
self._MergePlist(merged_value, value)
|
||||
merged_plist[key] = merged_value
|
||||
else:
|
||||
merged_plist[key] = value
|
||||
else:
|
||||
merged_plist[key] = value
|
||||
|
||||
def _LoadPlistMaybeBinary(self, plist_path):
|
||||
"""Loads into a memory a plist possibly encoded in binary format.
|
||||
|
||||
This is a wrapper around plistlib.readPlist that tries to convert the
|
||||
plist to the XML format if it can't be parsed (assuming that it is in
|
||||
the binary format).
|
||||
|
||||
Args:
|
||||
plist_path: string, path to a plist file, in XML or binary format
|
||||
|
||||
Returns:
|
||||
Content of the plist as a dictionary.
|
||||
"""
|
||||
try:
|
||||
# First, try to read the file using plistlib that only supports XML,
|
||||
# and if an exception is raised, convert a temporary copy to XML and
|
||||
# load that copy.
|
||||
return plistlib.readPlist(plist_path)
|
||||
except Exception:
|
||||
pass
|
||||
with tempfile.NamedTemporaryFile() as temp:
|
||||
shutil.copy2(plist_path, temp.name)
|
||||
subprocess.check_call(["plutil", "-convert", "xml1", temp.name])
|
||||
return plistlib.readPlist(temp.name)
|
||||
|
||||
def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix):
|
||||
"""Constructs a dictionary of variable substitutions for Entitlements.plist.
|
||||
|
||||
Args:
|
||||
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
|
||||
app_identifier_prefix: string, value for AppIdentifierPrefix
|
||||
|
||||
Returns:
|
||||
Dictionary of substitutions to apply when generating Entitlements.plist.
|
||||
"""
|
||||
return {
|
||||
"CFBundleIdentifier": bundle_identifier,
|
||||
"AppIdentifierPrefix": app_identifier_prefix,
|
||||
}
|
||||
|
||||
def _GetCFBundleIdentifier(self):
|
||||
"""Extracts CFBundleIdentifier value from Info.plist in the bundle.
|
||||
|
||||
Returns:
|
||||
Value of CFBundleIdentifier in the Info.plist located in the bundle.
|
||||
"""
|
||||
info_plist_path = os.path.join(
|
||||
os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"]
|
||||
)
|
||||
info_plist_data = self._LoadPlistMaybeBinary(info_plist_path)
|
||||
return info_plist_data["CFBundleIdentifier"]
|
||||
|
||||
def _InstallEntitlements(self, entitlements, substitutions, overrides):
|
||||
"""Generates and install the ${BundleName}.xcent entitlements file.
|
||||
|
||||
Expands variables "$(variable)" pattern in the source entitlements file,
|
||||
add extra entitlements defined in the .mobileprovision file and the copy
|
||||
the generated plist to "${BundlePath}.xcent".
|
||||
|
||||
Args:
|
||||
entitlements: string, optional, path to the Entitlements.plist template
|
||||
to use, defaults to "${SDKROOT}/Entitlements.plist"
|
||||
substitutions: dictionary, variable substitutions
|
||||
overrides: dictionary, values to add to the entitlements
|
||||
|
||||
Returns:
|
||||
Path to the generated entitlements file.
|
||||
"""
|
||||
source_path = entitlements
|
||||
target_path = os.path.join(
|
||||
os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent"
|
||||
)
|
||||
if not source_path:
|
||||
source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist")
|
||||
shutil.copy2(source_path, target_path)
|
||||
data = self._LoadPlistMaybeBinary(target_path)
|
||||
data = self._ExpandVariables(data, substitutions)
|
||||
if overrides:
|
||||
for key in overrides:
|
||||
if key not in data:
|
||||
data[key] = overrides[key]
|
||||
plistlib.writePlist(data, target_path)
|
||||
return target_path
|
||||
|
||||
def _ExpandVariables(self, data, substitutions):
|
||||
"""Expands variables "$(variable)" in data.
|
||||
|
||||
Args:
|
||||
data: object, can be either string, list or dictionary
|
||||
substitutions: dictionary, variable substitutions to perform
|
||||
|
||||
Returns:
|
||||
Copy of data where each references to "$(variable)" has been replaced
|
||||
by the corresponding value found in substitutions, or left intact if
|
||||
the key was not found.
|
||||
"""
|
||||
if isinstance(data, str):
|
||||
for key, value in substitutions.items():
|
||||
data = data.replace("$(%s)" % key, value)
|
||||
return data
|
||||
if isinstance(data, list):
|
||||
return [self._ExpandVariables(v, substitutions) for v in data]
|
||||
if isinstance(data, dict):
|
||||
return {k: self._ExpandVariables(data[k], substitutions) for k in data}
|
||||
return data
|
||||
|
||||
|
||||
def NextGreaterPowerOf2(x):
|
||||
return 2 ** (x).bit_length()
|
||||
|
||||
|
||||
def WriteHmap(output_name, filelist):
|
||||
"""Generates a header map based on |filelist|.
|
||||
|
||||
Per Mark Mentovai:
|
||||
A header map is structured essentially as a hash table, keyed by names used
|
||||
in #includes, and providing pathnames to the actual files.
|
||||
|
||||
The implementation below and the comment above comes from inspecting:
|
||||
http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt
|
||||
while also looking at the implementation in clang in:
|
||||
https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp
|
||||
"""
|
||||
magic = 1751998832
|
||||
version = 1
|
||||
_reserved = 0
|
||||
count = len(filelist)
|
||||
capacity = NextGreaterPowerOf2(count)
|
||||
strings_offset = 24 + (12 * capacity)
|
||||
max_value_length = max(len(value) for value in filelist.values())
|
||||
|
||||
out = open(output_name, "wb")
|
||||
out.write(
|
||||
struct.pack(
|
||||
"<LHHLLLL",
|
||||
magic,
|
||||
version,
|
||||
_reserved,
|
||||
strings_offset,
|
||||
count,
|
||||
capacity,
|
||||
max_value_length,
|
||||
)
|
||||
)
|
||||
|
||||
# Create empty hashmap buckets.
|
||||
buckets = [None] * capacity
|
||||
for file, path in filelist.items():
|
||||
key = 0
|
||||
for c in file:
|
||||
key += ord(c.lower()) * 13
|
||||
|
||||
# Fill next empty bucket.
|
||||
while buckets[key & capacity - 1] is not None:
|
||||
key = key + 1
|
||||
buckets[key & capacity - 1] = (file, path)
|
||||
|
||||
next_offset = 1
|
||||
for bucket in buckets:
|
||||
if bucket is None:
|
||||
out.write(struct.pack("<LLL", 0, 0, 0))
|
||||
else:
|
||||
(file, path) = bucket
|
||||
key_offset = next_offset
|
||||
prefix_offset = key_offset + len(file) + 1
|
||||
suffix_offset = prefix_offset + len(os.path.dirname(path) + os.sep) + 1
|
||||
next_offset = suffix_offset + len(os.path.basename(path)) + 1
|
||||
out.write(struct.pack("<LLL", key_offset, prefix_offset, suffix_offset))
|
||||
|
||||
# Pad byte since next offset starts at 1.
|
||||
out.write(struct.pack("<x"))
|
||||
|
||||
for bucket in buckets:
|
||||
if bucket is not None:
|
||||
(file, path) = bucket
|
||||
out.write(struct.pack("<%ds" % len(file), file))
|
||||
out.write(struct.pack("<s", "\0"))
|
||||
base = os.path.dirname(path) + os.sep
|
||||
out.write(struct.pack("<%ds" % len(base), base))
|
||||
out.write(struct.pack("<s", "\0"))
|
||||
path = os.path.basename(path)
|
||||
out.write(struct.pack("<%ds" % len(path), path))
|
||||
out.write(struct.pack("<s", "\0"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
193
projects/status-panel/node_modules/better-sqlite3/build/test_extension.target.mk
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
# This file is generated by gyp; do not edit.
|
||||
|
||||
TOOLSET := target
|
||||
TARGET := test_extension
|
||||
DEFS_Debug := \
|
||||
'-DNODE_GYP_MODULE_NAME=test_extension' \
|
||||
'-DUSING_UV_SHARED=1' \
|
||||
'-DUSING_V8_SHARED=1' \
|
||||
'-DV8_DEPRECATION_WARNINGS=1' \
|
||||
'-D_GLIBCXX_USE_CXX11_ABI=1' \
|
||||
'-D_FILE_OFFSET_BITS=64' \
|
||||
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
||||
'-D_LARGEFILE_SOURCE' \
|
||||
'-DBUILDING_NODE_EXTENSION' \
|
||||
'-DDEBUG' \
|
||||
'-D_DEBUG' \
|
||||
'-DSQLITE_DEBUG' \
|
||||
'-DSQLITE_MEMDEBUG' \
|
||||
'-DSQLITE_ENABLE_API_ARMOR' \
|
||||
'-DSQLITE_WIN32_MALLOC_VALIDATE'
|
||||
|
||||
# Flags passed to all source files.
|
||||
CFLAGS_Debug := \
|
||||
-O0 \
|
||||
-gdwarf-2 \
|
||||
-fno-strict-aliasing \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-Wall \
|
||||
-Wendif-labels \
|
||||
-W \
|
||||
-Wno-unused-parameter
|
||||
|
||||
# Flags passed to only C files.
|
||||
CFLAGS_C_Debug :=
|
||||
|
||||
# Flags passed to only C++ files.
|
||||
CFLAGS_CC_Debug := \
|
||||
-std=gnu++17 \
|
||||
-stdlib=libc++ \
|
||||
-fno-rtti \
|
||||
-fno-exceptions
|
||||
|
||||
# Flags passed to only ObjC files.
|
||||
CFLAGS_OBJC_Debug :=
|
||||
|
||||
# Flags passed to only ObjC++ files.
|
||||
CFLAGS_OBJCC_Debug :=
|
||||
|
||||
INCS_Debug := \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include \
|
||||
-I$(obj)/gen/sqlite3
|
||||
|
||||
DEFS_Release := \
|
||||
'-DNODE_GYP_MODULE_NAME=test_extension' \
|
||||
'-DUSING_UV_SHARED=1' \
|
||||
'-DUSING_V8_SHARED=1' \
|
||||
'-DV8_DEPRECATION_WARNINGS=1' \
|
||||
'-D_GLIBCXX_USE_CXX11_ABI=1' \
|
||||
'-D_FILE_OFFSET_BITS=64' \
|
||||
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
||||
'-D_LARGEFILE_SOURCE' \
|
||||
'-DBUILDING_NODE_EXTENSION' \
|
||||
'-DNDEBUG'
|
||||
|
||||
# Flags passed to all source files.
|
||||
CFLAGS_Release := \
|
||||
-O3 \
|
||||
-fno-strict-aliasing \
|
||||
-flto \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-Wall \
|
||||
-Wendif-labels \
|
||||
-W \
|
||||
-Wno-unused-parameter
|
||||
|
||||
# Flags passed to only C files.
|
||||
CFLAGS_C_Release :=
|
||||
|
||||
# Flags passed to only C++ files.
|
||||
CFLAGS_CC_Release := \
|
||||
-std=gnu++17 \
|
||||
-stdlib=libc++ \
|
||||
-fno-rtti \
|
||||
-fno-exceptions \
|
||||
-fvisibility-inlines-hidden
|
||||
|
||||
# Flags passed to only ObjC files.
|
||||
CFLAGS_OBJC_Release :=
|
||||
|
||||
# Flags passed to only ObjC++ files.
|
||||
CFLAGS_OBJCC_Release :=
|
||||
|
||||
INCS_Release := \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/include/node \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/src \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/config \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/openssl/openssl/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/uv/include \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/zlib \
|
||||
-I/Users/jianzhang/Library/Caches/node-gyp/22.22.0/deps/v8/include \
|
||||
-I$(obj)/gen/sqlite3
|
||||
|
||||
OBJS := \
|
||||
$(obj).target/$(TARGET)/deps/test_extension.o
|
||||
|
||||
# Add to the list of files we specially track dependencies for.
|
||||
all_deps += $(OBJS)
|
||||
|
||||
# Make sure our dependencies are built before any of us.
|
||||
$(OBJS): | $(builddir)/sqlite3.a $(obj).target/deps/locate_sqlite3.stamp
|
||||
|
||||
# CFLAGS et al overrides must be target-local.
|
||||
# See "Target-specific Variable Values" in the GNU Make manual.
|
||||
$(OBJS): TOOLSET := $(TOOLSET)
|
||||
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
|
||||
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
|
||||
$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
|
||||
$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
|
||||
|
||||
# Suffix rules, putting all outputs into $(obj).
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
# Try building from generated source, too.
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.c FORCE_DO_CMD
|
||||
@$(call do_cmd,cc,1)
|
||||
|
||||
# End of this set of suffix rules
|
||||
### Rules for final target.
|
||||
LDFLAGS_Debug := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-L$(builddir) \
|
||||
-stdlib=libc++
|
||||
|
||||
LIBTOOLFLAGS_Debug := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first
|
||||
|
||||
LDFLAGS_Release := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first \
|
||||
-Wl,-dead_strip \
|
||||
-mmacosx-version-min=10.7 \
|
||||
-arch \
|
||||
arm64 \
|
||||
-L$(builddir) \
|
||||
-stdlib=libc++
|
||||
|
||||
LIBTOOLFLAGS_Release := \
|
||||
-undefined dynamic_lookup \
|
||||
-Wl,-search_paths_first
|
||||
|
||||
LIBS :=
|
||||
|
||||
$(builddir)/test_extension.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
|
||||
$(builddir)/test_extension.node: LIBS := $(LIBS)
|
||||
$(builddir)/test_extension.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
|
||||
$(builddir)/test_extension.node: TOOLSET := $(TOOLSET)
|
||||
$(builddir)/test_extension.node: $(OBJS) $(builddir)/sqlite3.a FORCE_DO_CMD
|
||||
$(call do_cmd,solink_module)
|
||||
|
||||
all_deps += $(builddir)/test_extension.node
|
||||
# Add target alias
|
||||
.PHONY: test_extension
|
||||
test_extension: $(builddir)/test_extension.node
|
||||
|
||||
# Short alias for building this executable.
|
||||
.PHONY: test_extension.node
|
||||
test_extension.node: $(builddir)/test_extension.node
|
||||
|
||||
# Add executable to "all" target.
|
||||
.PHONY: all
|
||||
all: $(builddir)/test_extension.node
|
||||
|
||||
68
projects/status-panel/node_modules/better-sqlite3/deps/common.gypi
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# ===
|
||||
# This configuration defines the differences between Release and Debug builds.
|
||||
# Some miscellaneous Windows settings are also defined here.
|
||||
# ===
|
||||
|
||||
{
|
||||
'variables': { 'sqlite3%': '' },
|
||||
'target_defaults': {
|
||||
'default_configuration': 'Release',
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'ExceptionHandling': 1,
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
'defines': ['WIN32'],
|
||||
}],
|
||||
],
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
'defines!': [
|
||||
'NDEBUG',
|
||||
],
|
||||
'defines': [
|
||||
'DEBUG',
|
||||
'_DEBUG',
|
||||
'SQLITE_DEBUG',
|
||||
'SQLITE_MEMDEBUG',
|
||||
'SQLITE_ENABLE_API_ARMOR',
|
||||
'SQLITE_WIN32_MALLOC_VALIDATE',
|
||||
],
|
||||
'cflags': [
|
||||
'-O0',
|
||||
],
|
||||
'xcode_settings': {
|
||||
'MACOSX_DEPLOYMENT_TARGET': '10.7',
|
||||
'GCC_OPTIMIZATION_LEVEL': '0',
|
||||
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
|
||||
},
|
||||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
'GenerateDebugInformation': 'true',
|
||||
},
|
||||
},
|
||||
},
|
||||
'Release': {
|
||||
'defines!': [
|
||||
'DEBUG',
|
||||
'_DEBUG',
|
||||
],
|
||||
'defines': [
|
||||
'NDEBUG',
|
||||
],
|
||||
'cflags': [
|
||||
'-O3',
|
||||
],
|
||||
'xcode_settings': {
|
||||
'MACOSX_DEPLOYMENT_TARGET': '10.7',
|
||||
'GCC_OPTIMIZATION_LEVEL': '3',
|
||||
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
|
||||
'DEAD_CODE_STRIPPING': 'YES',
|
||||
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
31
projects/status-panel/node_modules/better-sqlite3/deps/copy.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const dest = process.argv[2];
|
||||
const source = path.resolve(path.sep, process.argv[3] || path.join(__dirname, 'sqlite3'));
|
||||
const files = [
|
||||
{ filename: 'sqlite3.c', optional: false },
|
||||
{ filename: 'sqlite3.h', optional: false },
|
||||
];
|
||||
|
||||
if (process.argv[3]) {
|
||||
// Support "_HAVE_SQLITE_CONFIG_H" in custom builds.
|
||||
files.push({ filename: 'config.h', optional: true });
|
||||
} else {
|
||||
// Required for some tests.
|
||||
files.push({ filename: 'sqlite3ext.h', optional: false });
|
||||
}
|
||||
|
||||
for (const { filename, optional } of files) {
|
||||
const sourceFilepath = path.join(source, filename);
|
||||
const destFilepath = path.join(dest, filename);
|
||||
|
||||
if (optional && !fs.existsSync(sourceFilepath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
fs.accessSync(sourceFilepath);
|
||||
fs.mkdirSync(path.dirname(destFilepath), { recursive: true });
|
||||
fs.copyFileSync(sourceFilepath, destFilepath);
|
||||
}
|
||||
40
projects/status-panel/node_modules/better-sqlite3/deps/defines.gypi
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# THIS FILE IS AUTOMATICALLY GENERATED BY deps/download.sh (DO NOT EDIT)
|
||||
|
||||
{
|
||||
'defines': [
|
||||
'HAVE_INT16_T=1',
|
||||
'HAVE_INT32_T=1',
|
||||
'HAVE_INT8_T=1',
|
||||
'HAVE_STDINT_H=1',
|
||||
'HAVE_UINT16_T=1',
|
||||
'HAVE_UINT32_T=1',
|
||||
'HAVE_UINT8_T=1',
|
||||
'HAVE_USLEEP=1',
|
||||
'SQLITE_DEFAULT_CACHE_SIZE=-16000',
|
||||
'SQLITE_DEFAULT_FOREIGN_KEYS=1',
|
||||
'SQLITE_DEFAULT_MEMSTATUS=0',
|
||||
'SQLITE_DEFAULT_WAL_SYNCHRONOUS=1',
|
||||
'SQLITE_DQS=0',
|
||||
'SQLITE_ENABLE_COLUMN_METADATA',
|
||||
'SQLITE_ENABLE_DESERIALIZE',
|
||||
'SQLITE_ENABLE_FTS3',
|
||||
'SQLITE_ENABLE_FTS3_PARENTHESIS',
|
||||
'SQLITE_ENABLE_FTS4',
|
||||
'SQLITE_ENABLE_FTS5',
|
||||
'SQLITE_ENABLE_GEOPOLY',
|
||||
'SQLITE_ENABLE_JSON1',
|
||||
'SQLITE_ENABLE_MATH_FUNCTIONS',
|
||||
'SQLITE_ENABLE_RTREE',
|
||||
'SQLITE_ENABLE_STAT4',
|
||||
'SQLITE_ENABLE_UPDATE_DELETE_LIMIT',
|
||||
'SQLITE_LIKE_DOESNT_MATCH_BLOBS',
|
||||
'SQLITE_OMIT_DEPRECATED',
|
||||
'SQLITE_OMIT_PROGRESS_CALLBACK',
|
||||
'SQLITE_OMIT_SHARED_CACHE',
|
||||
'SQLITE_OMIT_TCL_VARIABLE',
|
||||
'SQLITE_SOUNDEX',
|
||||
'SQLITE_THREADSAFE=2',
|
||||
'SQLITE_TRACE_SIZE_LIMIT=32',
|
||||
'SQLITE_USE_URI=0',
|
||||
],
|
||||
}
|
||||
112
projects/status-panel/node_modules/better-sqlite3/deps/download.sh
generated
vendored
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# ===
|
||||
# This script defines and generates the bundled SQLite3 unit (sqlite3.c).
|
||||
#
|
||||
# The following steps are taken:
|
||||
# 1. populate the shell environment with the defined compile-time options.
|
||||
# 2. download and extract the SQLite3 source code into a temporary directory.
|
||||
# 3. run "sh configure" and "make sqlite3.c" within the source directory.
|
||||
# 4. copy the generated amalgamation into the output directory (./sqlite3).
|
||||
# 5. export the defined compile-time options to a gyp file (./defines.gypi).
|
||||
# 6. update the docs (../docs/compilation.md) with details of this distribution.
|
||||
#
|
||||
# When a user builds better-sqlite3, the following steps are taken:
|
||||
# 1. node-gyp loads the previously exported compile-time options (defines.gypi).
|
||||
# 2. the copy.js script copies the bundled amalgamation into the build folder.
|
||||
# 3. node-gyp compiles the copied sqlite3.c along with better_sqlite3.cpp.
|
||||
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
|
||||
# ===
|
||||
|
||||
YEAR="2024"
|
||||
VERSION="3450300"
|
||||
|
||||
# Defines below are sorted alphabetically
|
||||
DEFINES="
|
||||
HAVE_INT16_T=1
|
||||
HAVE_INT32_T=1
|
||||
HAVE_INT8_T=1
|
||||
HAVE_STDINT_H=1
|
||||
HAVE_UINT16_T=1
|
||||
HAVE_UINT32_T=1
|
||||
HAVE_UINT8_T=1
|
||||
HAVE_USLEEP=1
|
||||
SQLITE_DEFAULT_CACHE_SIZE=-16000
|
||||
SQLITE_DEFAULT_FOREIGN_KEYS=1
|
||||
SQLITE_DEFAULT_MEMSTATUS=0
|
||||
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1
|
||||
SQLITE_DQS=0
|
||||
SQLITE_ENABLE_COLUMN_METADATA
|
||||
SQLITE_ENABLE_DESERIALIZE
|
||||
SQLITE_ENABLE_FTS3
|
||||
SQLITE_ENABLE_FTS3_PARENTHESIS
|
||||
SQLITE_ENABLE_FTS4
|
||||
SQLITE_ENABLE_FTS5
|
||||
SQLITE_ENABLE_GEOPOLY
|
||||
SQLITE_ENABLE_JSON1
|
||||
SQLITE_ENABLE_MATH_FUNCTIONS
|
||||
SQLITE_ENABLE_RTREE
|
||||
SQLITE_ENABLE_STAT4
|
||||
SQLITE_ENABLE_UPDATE_DELETE_LIMIT
|
||||
SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
SQLITE_OMIT_DEPRECATED
|
||||
SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
SQLITE_OMIT_SHARED_CACHE
|
||||
SQLITE_OMIT_TCL_VARIABLE
|
||||
SQLITE_SOUNDEX
|
||||
SQLITE_THREADSAFE=2
|
||||
SQLITE_TRACE_SIZE_LIMIT=32
|
||||
SQLITE_USE_URI=0
|
||||
"
|
||||
|
||||
# ========== START SCRIPT ========== #
|
||||
|
||||
echo "setting up environment..."
|
||||
DEPS="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
||||
TEMP="$DEPS/temp"
|
||||
OUTPUT="$DEPS/sqlite3"
|
||||
rm -rf "$TEMP"
|
||||
rm -rf "$OUTPUT"
|
||||
mkdir -p "$TEMP"
|
||||
mkdir -p "$OUTPUT"
|
||||
export CFLAGS=`echo $(echo "$DEFINES" | sed -e "/^\s*$/d" -e "s/^/-D/")`
|
||||
|
||||
echo "downloading source..."
|
||||
curl -#f "https://www.sqlite.org/$YEAR/sqlite-src-$VERSION.zip" > "$TEMP/source.zip" || exit 1
|
||||
|
||||
echo "extracting source..."
|
||||
unzip "$TEMP/source.zip" -d "$TEMP" > /dev/null || exit 1
|
||||
cd "$TEMP/sqlite-src-$VERSION" || exit 1
|
||||
|
||||
echo "configuring amalgamation..."
|
||||
sh configure > /dev/null || exit 1
|
||||
|
||||
echo "building amalgamation..."
|
||||
make sqlite3.c > /dev/null || exit 1
|
||||
|
||||
echo "copying amalgamation..."
|
||||
cp sqlite3.c sqlite3.h sqlite3ext.h "$OUTPUT/" || exit 1
|
||||
|
||||
echo "updating gyp configs..."
|
||||
GYP="$DEPS/defines.gypi"
|
||||
printf "# THIS FILE IS AUTOMATICALLY GENERATED BY deps/download.sh (DO NOT EDIT)\n\n{\n 'defines': [\n" > "$GYP"
|
||||
printf "$DEFINES" | sed -e "/^\s*$/d" -e "s/\(.*\)/ '\1',/" >> "$GYP"
|
||||
printf " ],\n}\n" >> "$GYP"
|
||||
|
||||
echo "updating docs..."
|
||||
DOCS="$DEPS/../docs/compilation.md"
|
||||
MAJOR=`expr "${VERSION:0:1}" + 0`
|
||||
MINOR=`expr "${VERSION:1:2}" + 0`
|
||||
PATCH=`expr "${VERSION:3:2}" + 0`
|
||||
sed -Ei.bak -e "s/version [0-9]+\.[0-9]+\.[0-9]+/version $MAJOR.$MINOR.$PATCH/g" "$DOCS"
|
||||
sed -i.bak -e "/^SQLITE_/,\$d" "$DOCS"
|
||||
sed -i.bak -e "/^HAVE_/,\$d" "$DOCS"
|
||||
rm "$DOCS".bak
|
||||
printf "$DEFINES" | sed -e "/^\s*$/d" >> "$DOCS"
|
||||
printf "\`\`\`\n" >> "$DOCS"
|
||||
|
||||
echo "cleaning up..."
|
||||
cd - > /dev/null || exit 1
|
||||
rm -rf "$TEMP"
|
||||
|
||||
echo "done!"
|
||||
80
projects/status-panel/node_modules/better-sqlite3/deps/sqlite3.gyp
generated
vendored
Executable file
@@ -0,0 +1,80 @@
|
||||
# ===
|
||||
# This configuration defines options specific to compiling SQLite3 itself.
|
||||
# Compile-time options are loaded by the auto-generated file "defines.gypi".
|
||||
# The --sqlite3 option can be provided to use a custom amalgamation instead.
|
||||
# ===
|
||||
|
||||
{
|
||||
'includes': ['common.gypi'],
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'locate_sqlite3',
|
||||
'type': 'none',
|
||||
'hard_dependency': 1,
|
||||
'conditions': [
|
||||
['sqlite3 == ""', {
|
||||
'actions': [{
|
||||
'action_name': 'copy_builtin_sqlite3',
|
||||
'inputs': [
|
||||
'sqlite3/sqlite3.c',
|
||||
'sqlite3/sqlite3.h',
|
||||
'sqlite3/sqlite3ext.h',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.c',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.h',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3ext.h',
|
||||
],
|
||||
'action': ['node', 'copy.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', ''],
|
||||
}],
|
||||
}, {
|
||||
'actions': [{
|
||||
'action_name': 'copy_custom_sqlite3',
|
||||
'inputs': [
|
||||
'<(sqlite3)/sqlite3.c',
|
||||
'<(sqlite3)/sqlite3.h',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.c',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.h',
|
||||
],
|
||||
'action': ['node', 'copy.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', '<(sqlite3)'],
|
||||
}],
|
||||
}],
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'sqlite3',
|
||||
'type': 'static_library',
|
||||
'dependencies': ['locate_sqlite3'],
|
||||
'sources': ['<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.c'],
|
||||
'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/sqlite3/'],
|
||||
'direct_dependent_settings': {
|
||||
'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/sqlite3/'],
|
||||
},
|
||||
'cflags': ['-std=c99', '-w'],
|
||||
'xcode_settings': {
|
||||
'OTHER_CFLAGS': ['-std=c99'],
|
||||
'WARNING_CFLAGS': ['-w'],
|
||||
},
|
||||
'conditions': [
|
||||
['sqlite3 == ""', {
|
||||
'includes': ['defines.gypi'],
|
||||
}, {
|
||||
'defines': [
|
||||
# This is currently required by better-sqlite3.
|
||||
'SQLITE_ENABLE_COLUMN_METADATA',
|
||||
],
|
||||
}]
|
||||
],
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
'msvs_settings': { 'VCCLCompilerTool': { 'RuntimeLibrary': 1 } }, # static debug
|
||||
},
|
||||
'Release': {
|
||||
'msvs_settings': { 'VCCLCompilerTool': { 'RuntimeLibrary': 0 } }, # static release
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
255954
projects/status-panel/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c
generated
vendored
Normal file
13374
projects/status-panel/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h
generated
vendored
Normal file
719
projects/status-panel/node_modules/better-sqlite3/deps/sqlite3/sqlite3ext.h
generated
vendored
Normal file
@@ -0,0 +1,719 @@
|
||||
/*
|
||||
** 2006 June 7
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** This header file defines the SQLite interface for use by
|
||||
** shared libraries that want to be imported as extensions into
|
||||
** an SQLite instance. Shared libraries that intend to be loaded
|
||||
** as extensions by SQLite should #include this file instead of
|
||||
** sqlite3.h.
|
||||
*/
|
||||
#ifndef SQLITE3EXT_H
|
||||
#define SQLITE3EXT_H
|
||||
#include "sqlite3.h"
|
||||
|
||||
/*
|
||||
** The following structure holds pointers to all of the SQLite API
|
||||
** routines.
|
||||
**
|
||||
** WARNING: In order to maintain backwards compatibility, add new
|
||||
** interfaces to the end of this structure only. If you insert new
|
||||
** interfaces in the middle of this structure, then older different
|
||||
** versions of SQLite will not be able to load each other's shared
|
||||
** libraries!
|
||||
*/
|
||||
struct sqlite3_api_routines {
|
||||
void * (*aggregate_context)(sqlite3_context*,int nBytes);
|
||||
int (*aggregate_count)(sqlite3_context*);
|
||||
int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
|
||||
int (*bind_double)(sqlite3_stmt*,int,double);
|
||||
int (*bind_int)(sqlite3_stmt*,int,int);
|
||||
int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
|
||||
int (*bind_null)(sqlite3_stmt*,int);
|
||||
int (*bind_parameter_count)(sqlite3_stmt*);
|
||||
int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
|
||||
const char * (*bind_parameter_name)(sqlite3_stmt*,int);
|
||||
int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
|
||||
int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
|
||||
int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
|
||||
int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
|
||||
int (*busy_timeout)(sqlite3*,int ms);
|
||||
int (*changes)(sqlite3*);
|
||||
int (*close)(sqlite3*);
|
||||
int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,
|
||||
int eTextRep,const char*));
|
||||
int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,
|
||||
int eTextRep,const void*));
|
||||
const void * (*column_blob)(sqlite3_stmt*,int iCol);
|
||||
int (*column_bytes)(sqlite3_stmt*,int iCol);
|
||||
int (*column_bytes16)(sqlite3_stmt*,int iCol);
|
||||
int (*column_count)(sqlite3_stmt*pStmt);
|
||||
const char * (*column_database_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_database_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_decltype)(sqlite3_stmt*,int i);
|
||||
const void * (*column_decltype16)(sqlite3_stmt*,int);
|
||||
double (*column_double)(sqlite3_stmt*,int iCol);
|
||||
int (*column_int)(sqlite3_stmt*,int iCol);
|
||||
sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
|
||||
const char * (*column_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_origin_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_origin_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_table_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_table_name16)(sqlite3_stmt*,int);
|
||||
const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
|
||||
const void * (*column_text16)(sqlite3_stmt*,int iCol);
|
||||
int (*column_type)(sqlite3_stmt*,int iCol);
|
||||
sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
|
||||
void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
|
||||
int (*complete)(const char*sql);
|
||||
int (*complete16)(const void*sql);
|
||||
int (*create_collation)(sqlite3*,const char*,int,void*,
|
||||
int(*)(void*,int,const void*,int,const void*));
|
||||
int (*create_collation16)(sqlite3*,const void*,int,void*,
|
||||
int(*)(void*,int,const void*,int,const void*));
|
||||
int (*create_function)(sqlite3*,const char*,int,int,void*,
|
||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*));
|
||||
int (*create_function16)(sqlite3*,const void*,int,int,void*,
|
||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*));
|
||||
int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
|
||||
int (*data_count)(sqlite3_stmt*pStmt);
|
||||
sqlite3 * (*db_handle)(sqlite3_stmt*);
|
||||
int (*declare_vtab)(sqlite3*,const char*);
|
||||
int (*enable_shared_cache)(int);
|
||||
int (*errcode)(sqlite3*db);
|
||||
const char * (*errmsg)(sqlite3*);
|
||||
const void * (*errmsg16)(sqlite3*);
|
||||
int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
|
||||
int (*expired)(sqlite3_stmt*);
|
||||
int (*finalize)(sqlite3_stmt*pStmt);
|
||||
void (*free)(void*);
|
||||
void (*free_table)(char**result);
|
||||
int (*get_autocommit)(sqlite3*);
|
||||
void * (*get_auxdata)(sqlite3_context*,int);
|
||||
int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
|
||||
int (*global_recover)(void);
|
||||
void (*interruptx)(sqlite3*);
|
||||
sqlite_int64 (*last_insert_rowid)(sqlite3*);
|
||||
const char * (*libversion)(void);
|
||||
int (*libversion_number)(void);
|
||||
void *(*malloc)(int);
|
||||
char * (*mprintf)(const char*,...);
|
||||
int (*open)(const char*,sqlite3**);
|
||||
int (*open16)(const void*,sqlite3**);
|
||||
int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
|
||||
int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
|
||||
void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
|
||||
void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
|
||||
void *(*realloc)(void*,int);
|
||||
int (*reset)(sqlite3_stmt*pStmt);
|
||||
void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_double)(sqlite3_context*,double);
|
||||
void (*result_error)(sqlite3_context*,const char*,int);
|
||||
void (*result_error16)(sqlite3_context*,const void*,int);
|
||||
void (*result_int)(sqlite3_context*,int);
|
||||
void (*result_int64)(sqlite3_context*,sqlite_int64);
|
||||
void (*result_null)(sqlite3_context*);
|
||||
void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
|
||||
void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_value)(sqlite3_context*,sqlite3_value*);
|
||||
void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
|
||||
int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,
|
||||
const char*,const char*),void*);
|
||||
void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
|
||||
char * (*xsnprintf)(int,char*,const char*,...);
|
||||
int (*step)(sqlite3_stmt*);
|
||||
int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,
|
||||
char const**,char const**,int*,int*,int*);
|
||||
void (*thread_cleanup)(void);
|
||||
int (*total_changes)(sqlite3*);
|
||||
void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
|
||||
int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
|
||||
void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,
|
||||
sqlite_int64),void*);
|
||||
void * (*user_data)(sqlite3_context*);
|
||||
const void * (*value_blob)(sqlite3_value*);
|
||||
int (*value_bytes)(sqlite3_value*);
|
||||
int (*value_bytes16)(sqlite3_value*);
|
||||
double (*value_double)(sqlite3_value*);
|
||||
int (*value_int)(sqlite3_value*);
|
||||
sqlite_int64 (*value_int64)(sqlite3_value*);
|
||||
int (*value_numeric_type)(sqlite3_value*);
|
||||
const unsigned char * (*value_text)(sqlite3_value*);
|
||||
const void * (*value_text16)(sqlite3_value*);
|
||||
const void * (*value_text16be)(sqlite3_value*);
|
||||
const void * (*value_text16le)(sqlite3_value*);
|
||||
int (*value_type)(sqlite3_value*);
|
||||
char *(*vmprintf)(const char*,va_list);
|
||||
/* Added ??? */
|
||||
int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
|
||||
/* Added by 3.3.13 */
|
||||
int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
|
||||
int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
|
||||
int (*clear_bindings)(sqlite3_stmt*);
|
||||
/* Added by 3.4.1 */
|
||||
int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,
|
||||
void (*xDestroy)(void *));
|
||||
/* Added by 3.5.0 */
|
||||
int (*bind_zeroblob)(sqlite3_stmt*,int,int);
|
||||
int (*blob_bytes)(sqlite3_blob*);
|
||||
int (*blob_close)(sqlite3_blob*);
|
||||
int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,
|
||||
int,sqlite3_blob**);
|
||||
int (*blob_read)(sqlite3_blob*,void*,int,int);
|
||||
int (*blob_write)(sqlite3_blob*,const void*,int,int);
|
||||
int (*create_collation_v2)(sqlite3*,const char*,int,void*,
|
||||
int(*)(void*,int,const void*,int,const void*),
|
||||
void(*)(void*));
|
||||
int (*file_control)(sqlite3*,const char*,int,void*);
|
||||
sqlite3_int64 (*memory_highwater)(int);
|
||||
sqlite3_int64 (*memory_used)(void);
|
||||
sqlite3_mutex *(*mutex_alloc)(int);
|
||||
void (*mutex_enter)(sqlite3_mutex*);
|
||||
void (*mutex_free)(sqlite3_mutex*);
|
||||
void (*mutex_leave)(sqlite3_mutex*);
|
||||
int (*mutex_try)(sqlite3_mutex*);
|
||||
int (*open_v2)(const char*,sqlite3**,int,const char*);
|
||||
int (*release_memory)(int);
|
||||
void (*result_error_nomem)(sqlite3_context*);
|
||||
void (*result_error_toobig)(sqlite3_context*);
|
||||
int (*sleep)(int);
|
||||
void (*soft_heap_limit)(int);
|
||||
sqlite3_vfs *(*vfs_find)(const char*);
|
||||
int (*vfs_register)(sqlite3_vfs*,int);
|
||||
int (*vfs_unregister)(sqlite3_vfs*);
|
||||
int (*xthreadsafe)(void);
|
||||
void (*result_zeroblob)(sqlite3_context*,int);
|
||||
void (*result_error_code)(sqlite3_context*,int);
|
||||
int (*test_control)(int, ...);
|
||||
void (*randomness)(int,void*);
|
||||
sqlite3 *(*context_db_handle)(sqlite3_context*);
|
||||
int (*extended_result_codes)(sqlite3*,int);
|
||||
int (*limit)(sqlite3*,int,int);
|
||||
sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
|
||||
const char *(*sql)(sqlite3_stmt*);
|
||||
int (*status)(int,int*,int*,int);
|
||||
int (*backup_finish)(sqlite3_backup*);
|
||||
sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
|
||||
int (*backup_pagecount)(sqlite3_backup*);
|
||||
int (*backup_remaining)(sqlite3_backup*);
|
||||
int (*backup_step)(sqlite3_backup*,int);
|
||||
const char *(*compileoption_get)(int);
|
||||
int (*compileoption_used)(const char*);
|
||||
int (*create_function_v2)(sqlite3*,const char*,int,int,void*,
|
||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*),
|
||||
void(*xDestroy)(void*));
|
||||
int (*db_config)(sqlite3*,int,...);
|
||||
sqlite3_mutex *(*db_mutex)(sqlite3*);
|
||||
int (*db_status)(sqlite3*,int,int*,int*,int);
|
||||
int (*extended_errcode)(sqlite3*);
|
||||
void (*log)(int,const char*,...);
|
||||
sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
|
||||
const char *(*sourceid)(void);
|
||||
int (*stmt_status)(sqlite3_stmt*,int,int);
|
||||
int (*strnicmp)(const char*,const char*,int);
|
||||
int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
|
||||
int (*wal_autocheckpoint)(sqlite3*,int);
|
||||
int (*wal_checkpoint)(sqlite3*,const char*);
|
||||
void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
|
||||
int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
|
||||
int (*vtab_config)(sqlite3*,int op,...);
|
||||
int (*vtab_on_conflict)(sqlite3*);
|
||||
/* Version 3.7.16 and later */
|
||||
int (*close_v2)(sqlite3*);
|
||||
const char *(*db_filename)(sqlite3*,const char*);
|
||||
int (*db_readonly)(sqlite3*,const char*);
|
||||
int (*db_release_memory)(sqlite3*);
|
||||
const char *(*errstr)(int);
|
||||
int (*stmt_busy)(sqlite3_stmt*);
|
||||
int (*stmt_readonly)(sqlite3_stmt*);
|
||||
int (*stricmp)(const char*,const char*);
|
||||
int (*uri_boolean)(const char*,const char*,int);
|
||||
sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
|
||||
const char *(*uri_parameter)(const char*,const char*);
|
||||
char *(*xvsnprintf)(int,char*,const char*,va_list);
|
||||
int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
|
||||
/* Version 3.8.7 and later */
|
||||
int (*auto_extension)(void(*)(void));
|
||||
int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
|
||||
void(*)(void*));
|
||||
int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
|
||||
void(*)(void*),unsigned char);
|
||||
int (*cancel_auto_extension)(void(*)(void));
|
||||
int (*load_extension)(sqlite3*,const char*,const char*,char**);
|
||||
void *(*malloc64)(sqlite3_uint64);
|
||||
sqlite3_uint64 (*msize)(void*);
|
||||
void *(*realloc64)(void*,sqlite3_uint64);
|
||||
void (*reset_auto_extension)(void);
|
||||
void (*result_blob64)(sqlite3_context*,const void*,sqlite3_uint64,
|
||||
void(*)(void*));
|
||||
void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
|
||||
void(*)(void*), unsigned char);
|
||||
int (*strglob)(const char*,const char*);
|
||||
/* Version 3.8.11 and later */
|
||||
sqlite3_value *(*value_dup)(const sqlite3_value*);
|
||||
void (*value_free)(sqlite3_value*);
|
||||
int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
|
||||
int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
|
||||
/* Version 3.9.0 and later */
|
||||
unsigned int (*value_subtype)(sqlite3_value*);
|
||||
void (*result_subtype)(sqlite3_context*,unsigned int);
|
||||
/* Version 3.10.0 and later */
|
||||
int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int);
|
||||
int (*strlike)(const char*,const char*,unsigned int);
|
||||
int (*db_cacheflush)(sqlite3*);
|
||||
/* Version 3.12.0 and later */
|
||||
int (*system_errno)(sqlite3*);
|
||||
/* Version 3.14.0 and later */
|
||||
int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
|
||||
char *(*expanded_sql)(sqlite3_stmt*);
|
||||
/* Version 3.18.0 and later */
|
||||
void (*set_last_insert_rowid)(sqlite3*,sqlite3_int64);
|
||||
/* Version 3.20.0 and later */
|
||||
int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
|
||||
sqlite3_stmt**,const char**);
|
||||
int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
|
||||
sqlite3_stmt**,const void**);
|
||||
int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
|
||||
void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
|
||||
void *(*value_pointer)(sqlite3_value*,const char*);
|
||||
int (*vtab_nochange)(sqlite3_context*);
|
||||
int (*value_nochange)(sqlite3_value*);
|
||||
const char *(*vtab_collation)(sqlite3_index_info*,int);
|
||||
/* Version 3.24.0 and later */
|
||||
int (*keyword_count)(void);
|
||||
int (*keyword_name)(int,const char**,int*);
|
||||
int (*keyword_check)(const char*,int);
|
||||
sqlite3_str *(*str_new)(sqlite3*);
|
||||
char *(*str_finish)(sqlite3_str*);
|
||||
void (*str_appendf)(sqlite3_str*, const char *zFormat, ...);
|
||||
void (*str_vappendf)(sqlite3_str*, const char *zFormat, va_list);
|
||||
void (*str_append)(sqlite3_str*, const char *zIn, int N);
|
||||
void (*str_appendall)(sqlite3_str*, const char *zIn);
|
||||
void (*str_appendchar)(sqlite3_str*, int N, char C);
|
||||
void (*str_reset)(sqlite3_str*);
|
||||
int (*str_errcode)(sqlite3_str*);
|
||||
int (*str_length)(sqlite3_str*);
|
||||
char *(*str_value)(sqlite3_str*);
|
||||
/* Version 3.25.0 and later */
|
||||
int (*create_window_function)(sqlite3*,const char*,int,int,void*,
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*),
|
||||
void (*xValue)(sqlite3_context*),
|
||||
void (*xInv)(sqlite3_context*,int,sqlite3_value**),
|
||||
void(*xDestroy)(void*));
|
||||
/* Version 3.26.0 and later */
|
||||
const char *(*normalized_sql)(sqlite3_stmt*);
|
||||
/* Version 3.28.0 and later */
|
||||
int (*stmt_isexplain)(sqlite3_stmt*);
|
||||
int (*value_frombind)(sqlite3_value*);
|
||||
/* Version 3.30.0 and later */
|
||||
int (*drop_modules)(sqlite3*,const char**);
|
||||
/* Version 3.31.0 and later */
|
||||
sqlite3_int64 (*hard_heap_limit64)(sqlite3_int64);
|
||||
const char *(*uri_key)(const char*,int);
|
||||
const char *(*filename_database)(const char*);
|
||||
const char *(*filename_journal)(const char*);
|
||||
const char *(*filename_wal)(const char*);
|
||||
/* Version 3.32.0 and later */
|
||||
const char *(*create_filename)(const char*,const char*,const char*,
|
||||
int,const char**);
|
||||
void (*free_filename)(const char*);
|
||||
sqlite3_file *(*database_file_object)(const char*);
|
||||
/* Version 3.34.0 and later */
|
||||
int (*txn_state)(sqlite3*,const char*);
|
||||
/* Version 3.36.1 and later */
|
||||
sqlite3_int64 (*changes64)(sqlite3*);
|
||||
sqlite3_int64 (*total_changes64)(sqlite3*);
|
||||
/* Version 3.37.0 and later */
|
||||
int (*autovacuum_pages)(sqlite3*,
|
||||
unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
|
||||
void*, void(*)(void*));
|
||||
/* Version 3.38.0 and later */
|
||||
int (*error_offset)(sqlite3*);
|
||||
int (*vtab_rhs_value)(sqlite3_index_info*,int,sqlite3_value**);
|
||||
int (*vtab_distinct)(sqlite3_index_info*);
|
||||
int (*vtab_in)(sqlite3_index_info*,int,int);
|
||||
int (*vtab_in_first)(sqlite3_value*,sqlite3_value**);
|
||||
int (*vtab_in_next)(sqlite3_value*,sqlite3_value**);
|
||||
/* Version 3.39.0 and later */
|
||||
int (*deserialize)(sqlite3*,const char*,unsigned char*,
|
||||
sqlite3_int64,sqlite3_int64,unsigned);
|
||||
unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*,
|
||||
unsigned int);
|
||||
const char *(*db_name)(sqlite3*,int);
|
||||
/* Version 3.40.0 and later */
|
||||
int (*value_encoding)(sqlite3_value*);
|
||||
/* Version 3.41.0 and later */
|
||||
int (*is_interrupted)(sqlite3*);
|
||||
/* Version 3.43.0 and later */
|
||||
int (*stmt_explain)(sqlite3_stmt*,int);
|
||||
/* Version 3.44.0 and later */
|
||||
void *(*get_clientdata)(sqlite3*,const char*);
|
||||
int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*));
|
||||
};
|
||||
|
||||
/*
|
||||
** This is the function signature used for all extension entry points. It
|
||||
** is also defined in the file "loadext.c".
|
||||
*/
|
||||
typedef int (*sqlite3_loadext_entry)(
|
||||
sqlite3 *db, /* Handle to the database. */
|
||||
char **pzErrMsg, /* Used to set error string on failure. */
|
||||
const sqlite3_api_routines *pThunk /* Extension API function pointers. */
|
||||
);
|
||||
|
||||
/*
|
||||
** The following macros redefine the API routines so that they are
|
||||
** redirected through the global sqlite3_api structure.
|
||||
**
|
||||
** This header file is also used by the loadext.c source file
|
||||
** (part of the main SQLite library - not an extension) so that
|
||||
** it can get access to the sqlite3_api_routines structure
|
||||
** definition. But the main library does not want to redefine
|
||||
** the API. So the redefinition macros are only valid if the
|
||||
** SQLITE_CORE macros is undefined.
|
||||
*/
|
||||
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
||||
#define sqlite3_aggregate_context sqlite3_api->aggregate_context
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_aggregate_count sqlite3_api->aggregate_count
|
||||
#endif
|
||||
#define sqlite3_bind_blob sqlite3_api->bind_blob
|
||||
#define sqlite3_bind_double sqlite3_api->bind_double
|
||||
#define sqlite3_bind_int sqlite3_api->bind_int
|
||||
#define sqlite3_bind_int64 sqlite3_api->bind_int64
|
||||
#define sqlite3_bind_null sqlite3_api->bind_null
|
||||
#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
|
||||
#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
|
||||
#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
|
||||
#define sqlite3_bind_text sqlite3_api->bind_text
|
||||
#define sqlite3_bind_text16 sqlite3_api->bind_text16
|
||||
#define sqlite3_bind_value sqlite3_api->bind_value
|
||||
#define sqlite3_busy_handler sqlite3_api->busy_handler
|
||||
#define sqlite3_busy_timeout sqlite3_api->busy_timeout
|
||||
#define sqlite3_changes sqlite3_api->changes
|
||||
#define sqlite3_close sqlite3_api->close
|
||||
#define sqlite3_collation_needed sqlite3_api->collation_needed
|
||||
#define sqlite3_collation_needed16 sqlite3_api->collation_needed16
|
||||
#define sqlite3_column_blob sqlite3_api->column_blob
|
||||
#define sqlite3_column_bytes sqlite3_api->column_bytes
|
||||
#define sqlite3_column_bytes16 sqlite3_api->column_bytes16
|
||||
#define sqlite3_column_count sqlite3_api->column_count
|
||||
#define sqlite3_column_database_name sqlite3_api->column_database_name
|
||||
#define sqlite3_column_database_name16 sqlite3_api->column_database_name16
|
||||
#define sqlite3_column_decltype sqlite3_api->column_decltype
|
||||
#define sqlite3_column_decltype16 sqlite3_api->column_decltype16
|
||||
#define sqlite3_column_double sqlite3_api->column_double
|
||||
#define sqlite3_column_int sqlite3_api->column_int
|
||||
#define sqlite3_column_int64 sqlite3_api->column_int64
|
||||
#define sqlite3_column_name sqlite3_api->column_name
|
||||
#define sqlite3_column_name16 sqlite3_api->column_name16
|
||||
#define sqlite3_column_origin_name sqlite3_api->column_origin_name
|
||||
#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
|
||||
#define sqlite3_column_table_name sqlite3_api->column_table_name
|
||||
#define sqlite3_column_table_name16 sqlite3_api->column_table_name16
|
||||
#define sqlite3_column_text sqlite3_api->column_text
|
||||
#define sqlite3_column_text16 sqlite3_api->column_text16
|
||||
#define sqlite3_column_type sqlite3_api->column_type
|
||||
#define sqlite3_column_value sqlite3_api->column_value
|
||||
#define sqlite3_commit_hook sqlite3_api->commit_hook
|
||||
#define sqlite3_complete sqlite3_api->complete
|
||||
#define sqlite3_complete16 sqlite3_api->complete16
|
||||
#define sqlite3_create_collation sqlite3_api->create_collation
|
||||
#define sqlite3_create_collation16 sqlite3_api->create_collation16
|
||||
#define sqlite3_create_function sqlite3_api->create_function
|
||||
#define sqlite3_create_function16 sqlite3_api->create_function16
|
||||
#define sqlite3_create_module sqlite3_api->create_module
|
||||
#define sqlite3_create_module_v2 sqlite3_api->create_module_v2
|
||||
#define sqlite3_data_count sqlite3_api->data_count
|
||||
#define sqlite3_db_handle sqlite3_api->db_handle
|
||||
#define sqlite3_declare_vtab sqlite3_api->declare_vtab
|
||||
#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
|
||||
#define sqlite3_errcode sqlite3_api->errcode
|
||||
#define sqlite3_errmsg sqlite3_api->errmsg
|
||||
#define sqlite3_errmsg16 sqlite3_api->errmsg16
|
||||
#define sqlite3_exec sqlite3_api->exec
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_expired sqlite3_api->expired
|
||||
#endif
|
||||
#define sqlite3_finalize sqlite3_api->finalize
|
||||
#define sqlite3_free sqlite3_api->free
|
||||
#define sqlite3_free_table sqlite3_api->free_table
|
||||
#define sqlite3_get_autocommit sqlite3_api->get_autocommit
|
||||
#define sqlite3_get_auxdata sqlite3_api->get_auxdata
|
||||
#define sqlite3_get_table sqlite3_api->get_table
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_global_recover sqlite3_api->global_recover
|
||||
#endif
|
||||
#define sqlite3_interrupt sqlite3_api->interruptx
|
||||
#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
|
||||
#define sqlite3_libversion sqlite3_api->libversion
|
||||
#define sqlite3_libversion_number sqlite3_api->libversion_number
|
||||
#define sqlite3_malloc sqlite3_api->malloc
|
||||
#define sqlite3_mprintf sqlite3_api->mprintf
|
||||
#define sqlite3_open sqlite3_api->open
|
||||
#define sqlite3_open16 sqlite3_api->open16
|
||||
#define sqlite3_prepare sqlite3_api->prepare
|
||||
#define sqlite3_prepare16 sqlite3_api->prepare16
|
||||
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
|
||||
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
|
||||
#define sqlite3_profile sqlite3_api->profile
|
||||
#define sqlite3_progress_handler sqlite3_api->progress_handler
|
||||
#define sqlite3_realloc sqlite3_api->realloc
|
||||
#define sqlite3_reset sqlite3_api->reset
|
||||
#define sqlite3_result_blob sqlite3_api->result_blob
|
||||
#define sqlite3_result_double sqlite3_api->result_double
|
||||
#define sqlite3_result_error sqlite3_api->result_error
|
||||
#define sqlite3_result_error16 sqlite3_api->result_error16
|
||||
#define sqlite3_result_int sqlite3_api->result_int
|
||||
#define sqlite3_result_int64 sqlite3_api->result_int64
|
||||
#define sqlite3_result_null sqlite3_api->result_null
|
||||
#define sqlite3_result_text sqlite3_api->result_text
|
||||
#define sqlite3_result_text16 sqlite3_api->result_text16
|
||||
#define sqlite3_result_text16be sqlite3_api->result_text16be
|
||||
#define sqlite3_result_text16le sqlite3_api->result_text16le
|
||||
#define sqlite3_result_value sqlite3_api->result_value
|
||||
#define sqlite3_rollback_hook sqlite3_api->rollback_hook
|
||||
#define sqlite3_set_authorizer sqlite3_api->set_authorizer
|
||||
#define sqlite3_set_auxdata sqlite3_api->set_auxdata
|
||||
#define sqlite3_snprintf sqlite3_api->xsnprintf
|
||||
#define sqlite3_step sqlite3_api->step
|
||||
#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
|
||||
#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
|
||||
#define sqlite3_total_changes sqlite3_api->total_changes
|
||||
#define sqlite3_trace sqlite3_api->trace
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
|
||||
#endif
|
||||
#define sqlite3_update_hook sqlite3_api->update_hook
|
||||
#define sqlite3_user_data sqlite3_api->user_data
|
||||
#define sqlite3_value_blob sqlite3_api->value_blob
|
||||
#define sqlite3_value_bytes sqlite3_api->value_bytes
|
||||
#define sqlite3_value_bytes16 sqlite3_api->value_bytes16
|
||||
#define sqlite3_value_double sqlite3_api->value_double
|
||||
#define sqlite3_value_int sqlite3_api->value_int
|
||||
#define sqlite3_value_int64 sqlite3_api->value_int64
|
||||
#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
|
||||
#define sqlite3_value_text sqlite3_api->value_text
|
||||
#define sqlite3_value_text16 sqlite3_api->value_text16
|
||||
#define sqlite3_value_text16be sqlite3_api->value_text16be
|
||||
#define sqlite3_value_text16le sqlite3_api->value_text16le
|
||||
#define sqlite3_value_type sqlite3_api->value_type
|
||||
#define sqlite3_vmprintf sqlite3_api->vmprintf
|
||||
#define sqlite3_vsnprintf sqlite3_api->xvsnprintf
|
||||
#define sqlite3_overload_function sqlite3_api->overload_function
|
||||
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
|
||||
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
|
||||
#define sqlite3_clear_bindings sqlite3_api->clear_bindings
|
||||
#define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob
|
||||
#define sqlite3_blob_bytes sqlite3_api->blob_bytes
|
||||
#define sqlite3_blob_close sqlite3_api->blob_close
|
||||
#define sqlite3_blob_open sqlite3_api->blob_open
|
||||
#define sqlite3_blob_read sqlite3_api->blob_read
|
||||
#define sqlite3_blob_write sqlite3_api->blob_write
|
||||
#define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2
|
||||
#define sqlite3_file_control sqlite3_api->file_control
|
||||
#define sqlite3_memory_highwater sqlite3_api->memory_highwater
|
||||
#define sqlite3_memory_used sqlite3_api->memory_used
|
||||
#define sqlite3_mutex_alloc sqlite3_api->mutex_alloc
|
||||
#define sqlite3_mutex_enter sqlite3_api->mutex_enter
|
||||
#define sqlite3_mutex_free sqlite3_api->mutex_free
|
||||
#define sqlite3_mutex_leave sqlite3_api->mutex_leave
|
||||
#define sqlite3_mutex_try sqlite3_api->mutex_try
|
||||
#define sqlite3_open_v2 sqlite3_api->open_v2
|
||||
#define sqlite3_release_memory sqlite3_api->release_memory
|
||||
#define sqlite3_result_error_nomem sqlite3_api->result_error_nomem
|
||||
#define sqlite3_result_error_toobig sqlite3_api->result_error_toobig
|
||||
#define sqlite3_sleep sqlite3_api->sleep
|
||||
#define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit
|
||||
#define sqlite3_vfs_find sqlite3_api->vfs_find
|
||||
#define sqlite3_vfs_register sqlite3_api->vfs_register
|
||||
#define sqlite3_vfs_unregister sqlite3_api->vfs_unregister
|
||||
#define sqlite3_threadsafe sqlite3_api->xthreadsafe
|
||||
#define sqlite3_result_zeroblob sqlite3_api->result_zeroblob
|
||||
#define sqlite3_result_error_code sqlite3_api->result_error_code
|
||||
#define sqlite3_test_control sqlite3_api->test_control
|
||||
#define sqlite3_randomness sqlite3_api->randomness
|
||||
#define sqlite3_context_db_handle sqlite3_api->context_db_handle
|
||||
#define sqlite3_extended_result_codes sqlite3_api->extended_result_codes
|
||||
#define sqlite3_limit sqlite3_api->limit
|
||||
#define sqlite3_next_stmt sqlite3_api->next_stmt
|
||||
#define sqlite3_sql sqlite3_api->sql
|
||||
#define sqlite3_status sqlite3_api->status
|
||||
#define sqlite3_backup_finish sqlite3_api->backup_finish
|
||||
#define sqlite3_backup_init sqlite3_api->backup_init
|
||||
#define sqlite3_backup_pagecount sqlite3_api->backup_pagecount
|
||||
#define sqlite3_backup_remaining sqlite3_api->backup_remaining
|
||||
#define sqlite3_backup_step sqlite3_api->backup_step
|
||||
#define sqlite3_compileoption_get sqlite3_api->compileoption_get
|
||||
#define sqlite3_compileoption_used sqlite3_api->compileoption_used
|
||||
#define sqlite3_create_function_v2 sqlite3_api->create_function_v2
|
||||
#define sqlite3_db_config sqlite3_api->db_config
|
||||
#define sqlite3_db_mutex sqlite3_api->db_mutex
|
||||
#define sqlite3_db_status sqlite3_api->db_status
|
||||
#define sqlite3_extended_errcode sqlite3_api->extended_errcode
|
||||
#define sqlite3_log sqlite3_api->log
|
||||
#define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64
|
||||
#define sqlite3_sourceid sqlite3_api->sourceid
|
||||
#define sqlite3_stmt_status sqlite3_api->stmt_status
|
||||
#define sqlite3_strnicmp sqlite3_api->strnicmp
|
||||
#define sqlite3_unlock_notify sqlite3_api->unlock_notify
|
||||
#define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint
|
||||
#define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint
|
||||
#define sqlite3_wal_hook sqlite3_api->wal_hook
|
||||
#define sqlite3_blob_reopen sqlite3_api->blob_reopen
|
||||
#define sqlite3_vtab_config sqlite3_api->vtab_config
|
||||
#define sqlite3_vtab_on_conflict sqlite3_api->vtab_on_conflict
|
||||
/* Version 3.7.16 and later */
|
||||
#define sqlite3_close_v2 sqlite3_api->close_v2
|
||||
#define sqlite3_db_filename sqlite3_api->db_filename
|
||||
#define sqlite3_db_readonly sqlite3_api->db_readonly
|
||||
#define sqlite3_db_release_memory sqlite3_api->db_release_memory
|
||||
#define sqlite3_errstr sqlite3_api->errstr
|
||||
#define sqlite3_stmt_busy sqlite3_api->stmt_busy
|
||||
#define sqlite3_stmt_readonly sqlite3_api->stmt_readonly
|
||||
#define sqlite3_stricmp sqlite3_api->stricmp
|
||||
#define sqlite3_uri_boolean sqlite3_api->uri_boolean
|
||||
#define sqlite3_uri_int64 sqlite3_api->uri_int64
|
||||
#define sqlite3_uri_parameter sqlite3_api->uri_parameter
|
||||
#define sqlite3_uri_vsnprintf sqlite3_api->xvsnprintf
|
||||
#define sqlite3_wal_checkpoint_v2 sqlite3_api->wal_checkpoint_v2
|
||||
/* Version 3.8.7 and later */
|
||||
#define sqlite3_auto_extension sqlite3_api->auto_extension
|
||||
#define sqlite3_bind_blob64 sqlite3_api->bind_blob64
|
||||
#define sqlite3_bind_text64 sqlite3_api->bind_text64
|
||||
#define sqlite3_cancel_auto_extension sqlite3_api->cancel_auto_extension
|
||||
#define sqlite3_load_extension sqlite3_api->load_extension
|
||||
#define sqlite3_malloc64 sqlite3_api->malloc64
|
||||
#define sqlite3_msize sqlite3_api->msize
|
||||
#define sqlite3_realloc64 sqlite3_api->realloc64
|
||||
#define sqlite3_reset_auto_extension sqlite3_api->reset_auto_extension
|
||||
#define sqlite3_result_blob64 sqlite3_api->result_blob64
|
||||
#define sqlite3_result_text64 sqlite3_api->result_text64
|
||||
#define sqlite3_strglob sqlite3_api->strglob
|
||||
/* Version 3.8.11 and later */
|
||||
#define sqlite3_value_dup sqlite3_api->value_dup
|
||||
#define sqlite3_value_free sqlite3_api->value_free
|
||||
#define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64
|
||||
#define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64
|
||||
/* Version 3.9.0 and later */
|
||||
#define sqlite3_value_subtype sqlite3_api->value_subtype
|
||||
#define sqlite3_result_subtype sqlite3_api->result_subtype
|
||||
/* Version 3.10.0 and later */
|
||||
#define sqlite3_status64 sqlite3_api->status64
|
||||
#define sqlite3_strlike sqlite3_api->strlike
|
||||
#define sqlite3_db_cacheflush sqlite3_api->db_cacheflush
|
||||
/* Version 3.12.0 and later */
|
||||
#define sqlite3_system_errno sqlite3_api->system_errno
|
||||
/* Version 3.14.0 and later */
|
||||
#define sqlite3_trace_v2 sqlite3_api->trace_v2
|
||||
#define sqlite3_expanded_sql sqlite3_api->expanded_sql
|
||||
/* Version 3.18.0 and later */
|
||||
#define sqlite3_set_last_insert_rowid sqlite3_api->set_last_insert_rowid
|
||||
/* Version 3.20.0 and later */
|
||||
#define sqlite3_prepare_v3 sqlite3_api->prepare_v3
|
||||
#define sqlite3_prepare16_v3 sqlite3_api->prepare16_v3
|
||||
#define sqlite3_bind_pointer sqlite3_api->bind_pointer
|
||||
#define sqlite3_result_pointer sqlite3_api->result_pointer
|
||||
#define sqlite3_value_pointer sqlite3_api->value_pointer
|
||||
/* Version 3.22.0 and later */
|
||||
#define sqlite3_vtab_nochange sqlite3_api->vtab_nochange
|
||||
#define sqlite3_value_nochange sqlite3_api->value_nochange
|
||||
#define sqlite3_vtab_collation sqlite3_api->vtab_collation
|
||||
/* Version 3.24.0 and later */
|
||||
#define sqlite3_keyword_count sqlite3_api->keyword_count
|
||||
#define sqlite3_keyword_name sqlite3_api->keyword_name
|
||||
#define sqlite3_keyword_check sqlite3_api->keyword_check
|
||||
#define sqlite3_str_new sqlite3_api->str_new
|
||||
#define sqlite3_str_finish sqlite3_api->str_finish
|
||||
#define sqlite3_str_appendf sqlite3_api->str_appendf
|
||||
#define sqlite3_str_vappendf sqlite3_api->str_vappendf
|
||||
#define sqlite3_str_append sqlite3_api->str_append
|
||||
#define sqlite3_str_appendall sqlite3_api->str_appendall
|
||||
#define sqlite3_str_appendchar sqlite3_api->str_appendchar
|
||||
#define sqlite3_str_reset sqlite3_api->str_reset
|
||||
#define sqlite3_str_errcode sqlite3_api->str_errcode
|
||||
#define sqlite3_str_length sqlite3_api->str_length
|
||||
#define sqlite3_str_value sqlite3_api->str_value
|
||||
/* Version 3.25.0 and later */
|
||||
#define sqlite3_create_window_function sqlite3_api->create_window_function
|
||||
/* Version 3.26.0 and later */
|
||||
#define sqlite3_normalized_sql sqlite3_api->normalized_sql
|
||||
/* Version 3.28.0 and later */
|
||||
#define sqlite3_stmt_isexplain sqlite3_api->stmt_isexplain
|
||||
#define sqlite3_value_frombind sqlite3_api->value_frombind
|
||||
/* Version 3.30.0 and later */
|
||||
#define sqlite3_drop_modules sqlite3_api->drop_modules
|
||||
/* Version 3.31.0 and later */
|
||||
#define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64
|
||||
#define sqlite3_uri_key sqlite3_api->uri_key
|
||||
#define sqlite3_filename_database sqlite3_api->filename_database
|
||||
#define sqlite3_filename_journal sqlite3_api->filename_journal
|
||||
#define sqlite3_filename_wal sqlite3_api->filename_wal
|
||||
/* Version 3.32.0 and later */
|
||||
#define sqlite3_create_filename sqlite3_api->create_filename
|
||||
#define sqlite3_free_filename sqlite3_api->free_filename
|
||||
#define sqlite3_database_file_object sqlite3_api->database_file_object
|
||||
/* Version 3.34.0 and later */
|
||||
#define sqlite3_txn_state sqlite3_api->txn_state
|
||||
/* Version 3.36.1 and later */
|
||||
#define sqlite3_changes64 sqlite3_api->changes64
|
||||
#define sqlite3_total_changes64 sqlite3_api->total_changes64
|
||||
/* Version 3.37.0 and later */
|
||||
#define sqlite3_autovacuum_pages sqlite3_api->autovacuum_pages
|
||||
/* Version 3.38.0 and later */
|
||||
#define sqlite3_error_offset sqlite3_api->error_offset
|
||||
#define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value
|
||||
#define sqlite3_vtab_distinct sqlite3_api->vtab_distinct
|
||||
#define sqlite3_vtab_in sqlite3_api->vtab_in
|
||||
#define sqlite3_vtab_in_first sqlite3_api->vtab_in_first
|
||||
#define sqlite3_vtab_in_next sqlite3_api->vtab_in_next
|
||||
/* Version 3.39.0 and later */
|
||||
#ifndef SQLITE_OMIT_DESERIALIZE
|
||||
#define sqlite3_deserialize sqlite3_api->deserialize
|
||||
#define sqlite3_serialize sqlite3_api->serialize
|
||||
#endif
|
||||
#define sqlite3_db_name sqlite3_api->db_name
|
||||
/* Version 3.40.0 and later */
|
||||
#define sqlite3_value_encoding sqlite3_api->value_encoding
|
||||
/* Version 3.41.0 and later */
|
||||
#define sqlite3_is_interrupted sqlite3_api->is_interrupted
|
||||
/* Version 3.43.0 and later */
|
||||
#define sqlite3_stmt_explain sqlite3_api->stmt_explain
|
||||
/* Version 3.44.0 and later */
|
||||
#define sqlite3_get_clientdata sqlite3_api->get_clientdata
|
||||
#define sqlite3_set_clientdata sqlite3_api->set_clientdata
|
||||
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
|
||||
|
||||
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
||||
/* This case when the file really is being compiled as a loadable
|
||||
** extension */
|
||||
# define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
|
||||
# define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
|
||||
# define SQLITE_EXTENSION_INIT3 \
|
||||
extern const sqlite3_api_routines *sqlite3_api;
|
||||
#else
|
||||
/* This case when the file is being statically linked into the
|
||||
** application */
|
||||
# define SQLITE_EXTENSION_INIT1 /*no-op*/
|
||||
# define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
|
||||
# define SQLITE_EXTENSION_INIT3 /*no-op*/
|
||||
#endif
|
||||
|
||||
#endif /* SQLITE3EXT_H */
|
||||
21
projects/status-panel/node_modules/better-sqlite3/deps/test_extension.c
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <sqlite3ext.h>
|
||||
SQLITE_EXTENSION_INIT1
|
||||
|
||||
/*
|
||||
This SQLite3 extension is used only for testing purposes (npm test).
|
||||
*/
|
||||
|
||||
static void TestExtensionFunction(sqlite3_context* pCtx, int nVal, sqlite3_value** _) {
|
||||
sqlite3_result_double(pCtx, (double)nVal);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
|
||||
int sqlite3_extension_init(sqlite3* db, char** pzErrMsg, const sqlite3_api_routines* pApi) {
|
||||
SQLITE_EXTENSION_INIT2(pApi)
|
||||
if (pzErrMsg != 0) *pzErrMsg = 0;
|
||||
sqlite3_create_function(db, "testExtensionFunction", -1, SQLITE_UTF8, 0, TestExtensionFunction, 0, 0);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
90
projects/status-panel/node_modules/better-sqlite3/lib/database.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const util = require('./util');
|
||||
const SqliteError = require('./sqlite-error');
|
||||
|
||||
let DEFAULT_ADDON;
|
||||
|
||||
function Database(filenameGiven, options) {
|
||||
if (new.target == null) {
|
||||
return new Database(filenameGiven, options);
|
||||
}
|
||||
|
||||
// Apply defaults
|
||||
let buffer;
|
||||
if (Buffer.isBuffer(filenameGiven)) {
|
||||
buffer = filenameGiven;
|
||||
filenameGiven = ':memory:';
|
||||
}
|
||||
if (filenameGiven == null) filenameGiven = '';
|
||||
if (options == null) options = {};
|
||||
|
||||
// Validate arguments
|
||||
if (typeof filenameGiven !== 'string') throw new TypeError('Expected first argument to be a string');
|
||||
if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
|
||||
if ('readOnly' in options) throw new TypeError('Misspelled option "readOnly" should be "readonly"');
|
||||
if ('memory' in options) throw new TypeError('Option "memory" was removed in v7.0.0 (use ":memory:" filename instead)');
|
||||
|
||||
// Interpret options
|
||||
const filename = filenameGiven.trim();
|
||||
const anonymous = filename === '' || filename === ':memory:';
|
||||
const readonly = util.getBooleanOption(options, 'readonly');
|
||||
const fileMustExist = util.getBooleanOption(options, 'fileMustExist');
|
||||
const timeout = 'timeout' in options ? options.timeout : 5000;
|
||||
const verbose = 'verbose' in options ? options.verbose : null;
|
||||
const nativeBinding = 'nativeBinding' in options ? options.nativeBinding : null;
|
||||
|
||||
// Validate interpreted options
|
||||
if (readonly && anonymous && !buffer) throw new TypeError('In-memory/temporary databases cannot be readonly');
|
||||
if (!Number.isInteger(timeout) || timeout < 0) throw new TypeError('Expected the "timeout" option to be a positive integer');
|
||||
if (timeout > 0x7fffffff) throw new RangeError('Option "timeout" cannot be greater than 2147483647');
|
||||
if (verbose != null && typeof verbose !== 'function') throw new TypeError('Expected the "verbose" option to be a function');
|
||||
if (nativeBinding != null && typeof nativeBinding !== 'string' && typeof nativeBinding !== 'object') throw new TypeError('Expected the "nativeBinding" option to be a string or addon object');
|
||||
|
||||
// Load the native addon
|
||||
let addon;
|
||||
if (nativeBinding == null) {
|
||||
addon = DEFAULT_ADDON || (DEFAULT_ADDON = require('bindings')('better_sqlite3.node'));
|
||||
} else if (typeof nativeBinding === 'string') {
|
||||
// See <https://webpack.js.org/api/module-variables/#__non_webpack_require__-webpack-specific>
|
||||
const requireFunc = typeof __non_webpack_require__ === 'function' ? __non_webpack_require__ : require;
|
||||
addon = requireFunc(path.resolve(nativeBinding).replace(/(\.node)?$/, '.node'));
|
||||
} else {
|
||||
// See <https://github.com/WiseLibs/better-sqlite3/issues/972>
|
||||
addon = nativeBinding;
|
||||
}
|
||||
|
||||
if (!addon.isInitialized) {
|
||||
addon.setErrorConstructor(SqliteError);
|
||||
addon.isInitialized = true;
|
||||
}
|
||||
|
||||
// Make sure the specified directory exists
|
||||
if (!anonymous && !fs.existsSync(path.dirname(filename))) {
|
||||
throw new TypeError('Cannot open database because the directory does not exist');
|
||||
}
|
||||
|
||||
Object.defineProperties(this, {
|
||||
[util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
|
||||
...wrappers.getters,
|
||||
});
|
||||
}
|
||||
|
||||
const wrappers = require('./methods/wrappers');
|
||||
Database.prototype.prepare = wrappers.prepare;
|
||||
Database.prototype.transaction = require('./methods/transaction');
|
||||
Database.prototype.pragma = require('./methods/pragma');
|
||||
Database.prototype.backup = require('./methods/backup');
|
||||
Database.prototype.serialize = require('./methods/serialize');
|
||||
Database.prototype.function = require('./methods/function');
|
||||
Database.prototype.aggregate = require('./methods/aggregate');
|
||||
Database.prototype.table = require('./methods/table');
|
||||
Database.prototype.loadExtension = wrappers.loadExtension;
|
||||
Database.prototype.exec = wrappers.exec;
|
||||
Database.prototype.close = wrappers.close;
|
||||
Database.prototype.defaultSafeIntegers = wrappers.defaultSafeIntegers;
|
||||
Database.prototype.unsafeMode = wrappers.unsafeMode;
|
||||
Database.prototype[util.inspect] = require('./methods/inspect');
|
||||
|
||||
module.exports = Database;
|
||||
3
projects/status-panel/node_modules/better-sqlite3/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
module.exports = require('./database');
|
||||
module.exports.SqliteError = require('./sqlite-error');
|
||||
43
projects/status-panel/node_modules/better-sqlite3/lib/methods/aggregate.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
const { getBooleanOption, cppdb } = require('../util');
|
||||
|
||||
module.exports = function defineAggregate(name, options) {
|
||||
// Validate arguments
|
||||
if (typeof name !== 'string') throw new TypeError('Expected first argument to be a string');
|
||||
if (typeof options !== 'object' || options === null) throw new TypeError('Expected second argument to be an options object');
|
||||
if (!name) throw new TypeError('User-defined function name cannot be an empty string');
|
||||
|
||||
// Interpret options
|
||||
const start = 'start' in options ? options.start : null;
|
||||
const step = getFunctionOption(options, 'step', true);
|
||||
const inverse = getFunctionOption(options, 'inverse', false);
|
||||
const result = getFunctionOption(options, 'result', false);
|
||||
const safeIntegers = 'safeIntegers' in options ? +getBooleanOption(options, 'safeIntegers') : 2;
|
||||
const deterministic = getBooleanOption(options, 'deterministic');
|
||||
const directOnly = getBooleanOption(options, 'directOnly');
|
||||
const varargs = getBooleanOption(options, 'varargs');
|
||||
let argCount = -1;
|
||||
|
||||
// Determine argument count
|
||||
if (!varargs) {
|
||||
argCount = Math.max(getLength(step), inverse ? getLength(inverse) : 0);
|
||||
if (argCount > 0) argCount -= 1;
|
||||
if (argCount > 100) throw new RangeError('User-defined functions cannot have more than 100 arguments');
|
||||
}
|
||||
|
||||
this[cppdb].aggregate(start, step, inverse, result, name, argCount, safeIntegers, deterministic, directOnly);
|
||||
return this;
|
||||
};
|
||||
|
||||
const getFunctionOption = (options, key, required) => {
|
||||
const value = key in options ? options[key] : null;
|
||||
if (typeof value === 'function') return value;
|
||||
if (value != null) throw new TypeError(`Expected the "${key}" option to be a function`);
|
||||
if (required) throw new TypeError(`Missing required option "${key}"`);
|
||||
return null;
|
||||
};
|
||||
|
||||
const getLength = ({ length }) => {
|
||||
if (Number.isInteger(length) && length >= 0) return length;
|
||||
throw new TypeError('Expected function.length to be a positive integer');
|
||||
};
|
||||