ai-yuca 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +67 -0
- package/dist/package.json +1 -1
- package/dist/src/cache.d.ts +1 -1
- package/dist/src/cache.js +5 -2
- package/dist/src/uploadWithConfig.js +1 -1
- package/package.json +1 -1
- package/.cdn.cache.json +0 -96
- package/bin/cli.js +0 -85
- package/bin/cli.ts +0 -417
- package/debug-upload.js +0 -206
- package/docs/deploy.md +0 -286
- package/docs/usage.md +0 -223
- package/examples/sample.txt +0 -7
- package/examples/upload-example.js +0 -53
- package/i18n/de-de.json +0 -1211
- package/i18n/en-us.json +0 -1211
- package/i18n/es-es.json +0 -1211
- package/i18n/fr-fr.json +0 -1211
- package/i18n/it-it.json +0 -1211
- package/i18n/keys/aiAgent.json +0 -259
- package/i18n/keys/dev_20250102.json +0 -14
- package/i18n/keys/h5.json +0 -37
- package/i18n/keys/main.json +0 -436
- package/i18n/keys/newsite.json +0 -473
- package/i18n/lang/de-de/aiAgent.json +0 -259
- package/i18n/lang/de-de/dev_20250102.json +0 -14
- package/i18n/lang/de-de/h5.json +0 -37
- package/i18n/lang/de-de/main.json +0 -436
- package/i18n/lang/de-de/newsite.json +0 -473
- package/i18n/lang/en-us/aiAgent.json +0 -259
- package/i18n/lang/en-us/dev_20250102.json +0 -14
- package/i18n/lang/en-us/dev_241116.json +0 -49
- package/i18n/lang/en-us/h5.json +0 -37
- package/i18n/lang/en-us/main.json +0 -436
- package/i18n/lang/en-us/newsite.json +0 -473
- package/i18n/lang/es-es/aiAgent.json +0 -259
- package/i18n/lang/es-es/dev_20250102.json +0 -14
- package/i18n/lang/es-es/h5.json +0 -37
- package/i18n/lang/es-es/main.json +0 -436
- package/i18n/lang/es-es/newsite.json +0 -473
- package/i18n/lang/fr-fr/aiAgent.json +0 -259
- package/i18n/lang/fr-fr/dev_20250102.json +0 -14
- package/i18n/lang/fr-fr/h5.json +0 -37
- package/i18n/lang/fr-fr/main.json +0 -436
- package/i18n/lang/fr-fr/newsite.json +0 -473
- package/i18n/lang/it-it/aiAgent.json +0 -259
- package/i18n/lang/it-it/dev_20250102.json +0 -14
- package/i18n/lang/it-it/h5.json +0 -37
- package/i18n/lang/it-it/main.json +0 -436
- package/i18n/lang/it-it/newsite.json +0 -473
- package/i18n/lang/pt-pt/aiAgent.json +0 -259
- package/i18n/lang/pt-pt/dev_20250102.json +0 -14
- package/i18n/lang/pt-pt/h5.json +0 -37
- package/i18n/lang/pt-pt/main.json +0 -436
- package/i18n/lang/pt-pt/newsite.json +0 -473
- package/i18n/lang/ru-ru/aiAgent.json +0 -259
- package/i18n/lang/ru-ru/dev_20250102.json +0 -14
- package/i18n/lang/ru-ru/h5.json +0 -37
- package/i18n/lang/ru-ru/main.json +0 -436
- package/i18n/lang/ru-ru/newsite.json +0 -473
- package/i18n/lang/zh-cn/aiAgent.json +0 -259
- package/i18n/lang/zh-cn/dev_20250102.json +0 -14
- package/i18n/lang/zh-cn/dev_241116.json +0 -49
- package/i18n/lang/zh-cn/h5.json +0 -37
- package/i18n/lang/zh-cn/main.json +0 -436
- package/i18n/lang/zh-cn/newsite.json +0 -473
- package/i18n/lang/zh-hk/dev_241116.json +0 -49
- package/i18n/lang/zh-hk/main.json +0 -128
- package/i18n/pt-pt.json +0 -1211
- package/i18n/ru-ru.json +0 -1211
- package/i18n/zh-cn.json +0 -1211
- package/i18n/zh-hk.json +0 -128
- package/out/404.html +0 -1
- package/out/_next/static/chunks/1328.dd74ae6e3b15ff04.js +0 -1
- package/out/_next/static/chunks/1386-ecc75214ecbee698.js +0 -1
- package/out/_next/static/chunks/2433-e7a7a662dbf652f6.js +0 -1
- package/out/_next/static/chunks/2690-0095f1624d934453.js +0 -1
- package/out/_next/static/chunks/275-72255fc3d50dc50c.js +0 -1
- package/out/_next/static/chunks/2959.ae3acbd23e5f6cda.js +0 -1
- package/out/_next/static/chunks/3225-d85abacd3899a814.js +0 -1
- package/out/_next/static/chunks/3675-28b72a3b32730d1c.js +0 -1
- package/out/_next/static/chunks/3748.264b42930465e3e2.js +0 -1
- package/out/_next/static/chunks/4037-2b7b438dbc62c0d7.js +0 -1
- package/out/_next/static/chunks/4398.5d9a05b91ef7245f.js +0 -1
- package/out/_next/static/chunks/4622-c0099488d417e118.js +0 -1
- package/out/_next/static/chunks/4959-ad724f5ec8938d01.js +0 -1
- package/out/_next/static/chunks/5074.36b4aee9d001a900.js +0 -1
- package/out/_next/static/chunks/508-ba5053bf494548a6.js +0 -1
- package/out/_next/static/chunks/527-e5943a23b7cb1339.js +0 -1
- package/out/_next/static/chunks/5364-c39e26834b019bf3.js +0 -1
- package/out/_next/static/chunks/5538-bbaa8d71d26838f4.js +0 -1
- package/out/_next/static/chunks/5546-9819a4f3addbda7d.js +0 -1
- package/out/_next/static/chunks/5646-deba957ab6368360.js +0 -1
- package/out/_next/static/chunks/6360-f8ffe176e0fb126a.js +0 -1
- package/out/_next/static/chunks/6377.2de8a90471ccb1f2.js +0 -1
- package/out/_next/static/chunks/6459-b13d29c55a4ccc17.js +0 -1
- package/out/_next/static/chunks/6499-73f4ba916cde84ec.js +0 -1
- package/out/_next/static/chunks/6703.87e72c53c45ac649.js +0 -1
- package/out/_next/static/chunks/6831-ddb4f2c5325ed9e1.js +0 -1
- package/out/_next/static/chunks/6878-413d4147840a9d3f.js +0 -1
- package/out/_next/static/chunks/7136-92e74a77d4fe1c09.js +0 -1
- package/out/_next/static/chunks/7300-60bd937826e2889a.js +0 -1
- package/out/_next/static/chunks/7640-25157b4bebca756f.js +0 -1
- package/out/_next/static/chunks/7660-71eef9eb7f0e25f4.js +0 -1
- package/out/_next/static/chunks/8141-fc059567bae11835.js +0 -1
- package/out/_next/static/chunks/8229-27cb99a1348167ef.js +0 -1
- package/out/_next/static/chunks/8482-12ab17377a4689a4.js +0 -1
- package/out/_next/static/chunks/8671-531e97f50b7ac7e2.js +0 -1
- package/out/_next/static/chunks/8976-517d30d3cb7d450b.js +0 -1
- package/out/_next/static/chunks/8990-7bfc97b8a13369db.js +0 -1
- package/out/_next/static/chunks/9774-0752c9ec02a672b1.js +0 -1
- package/out/_next/static/chunks/framework-4e48f2cc6a39465a.js +0 -1
- package/out/_next/static/chunks/main-691aa8a7a04c0676.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/help/[docs]-da22f062530993f0.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/addr-add-66110024b03a0619.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/address-756133e40329d810.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/cart-a108662aa517644d.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/coin-history-a3080e2211a22b4a.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/coupons-73b673123e7dc947.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/package-83495f0992231f5d.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/promotion-669a234cb0b244a3.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/top-up-54a68d160bc9712d.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user/user-trans-729e81ff7835ecd4.js +0 -1
- package/out/_next/static/chunks/pages/[lang]/user-fdd23283e1809971.js +0 -1
- package/out/_next/static/chunks/pages/[lang]-4c5942ab30d5820a.js +0 -1
- package/out/_next/static/chunks/pages/_app-9e17b6a9fc7f7fd6.js +0 -5
- package/out/_next/static/chunks/pages/_error-6df9c3943cfa136b.js +0 -1
- package/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/out/_next/static/chunks/webpack-02d8ee89c01f16cc.js +0 -1
- package/out/_next/static/css/0ea4ceb6ceb58b84.css +0 -3
- package/out/_next/static/css/5812f5a1673562f2.css +0 -1
- package/out/_next/static/css/ebee78a7b84ab4db.css +0 -1
- package/out/de-de.html +0 -1
- package/out/en-us.html +0 -1
- package/out/es-es.html +0 -1
- package/out/favicon.ico +0 -0
- package/out/file.svg +0 -1
- package/out/fr-fr.html +0 -1
- package/out/globe.svg +0 -1
- package/out/it-it.html +0 -1
- package/out/next.svg +0 -1
- package/out/pt-pt.html +0 -1
- package/out/zh-cn/help/about-us.html +0 -41
- package/out/zh-cn/help/beginner-guide.html +0 -123
- package/out/zh-cn/help/delivery-agreement.html +0 -153
- package/out/zh-cn/help/faq.html +0 -102
- package/out/zh-cn/help/incentive-system.html +0 -254
- package/out/zh-cn/help/privacy-statement.html +0 -61
- package/out/zh-cn/help/promotion.html +0 -132
- package/out/zh-cn/help/return-refunds.html +0 -206
- package/out/zh-cn/help/service-agreement.html +0 -89
- package/out/zh-cn/help/user-guide.html +0 -169
- package/out/zh-cn/help/why-us.html +0 -138
- package/out/zh-cn/user/addr-add.html +0 -1
- package/out/zh-cn/user/address.html +0 -1
- package/out/zh-cn/user/cart.html +0 -1
- package/out/zh-cn/user/coin-history.html +0 -1
- package/out/zh-cn/user/coupons.html +0 -1
- package/out/zh-cn/user/package.html +0 -1
- package/out/zh-cn/user/promotion.html +0 -1
- package/out/zh-cn/user/top-up.html +0 -1
- package/out/zh-cn/user/user-trans.html +0 -1
- package/out/zh-cn/user.html +0 -1
- package/out/zh-cn.html +0 -1
- package/src/cache.ts +0 -167
- package/src/config.ts +0 -105
- package/src/deploy.ts +0 -578
- package/src/download.ts +0 -232
- package/src/index.js +0 -88
- package/src/index.ts +0 -98
- package/src/pullCrowdin.ts +0 -482
- package/src/types/analyze.ts +0 -37
- package/src/types/deploy.ts +0 -77
- package/src/types/download.ts +0 -67
- package/src/types/index.ts +0 -22
- package/src/types/pullCrowdin.ts +0 -164
- package/src/types/upload.ts +0 -125
- package/src/upload.js +0 -197
- package/src/upload.ts +0 -466
- package/src/uploadWithConfig.ts +0 -277
- package/src/utils/compression.ts +0 -61
- package/test/cli-test/test-exclude.js +0 -43
- package/test/cli-test/test-queue-upload.js +0 -49
- package/test/cli-test/test-retry.js +0 -71
- package/test/cli-test/test-upload-queue.js +0 -80
- package/test/compression.test.ts +0 -88
- package/test/download.test.ts +0 -162
- package/test/index.test.js +0 -38
- package/test/index.test.ts +0 -39
- package/test/upload.test.ts +0 -131
package/dist/bin/cli.js
CHANGED
|
@@ -38,6 +38,7 @@ const commander_1 = require("commander");
|
|
|
38
38
|
const pkg = __importStar(require("../package.json"));
|
|
39
39
|
const fs = __importStar(require("fs"));
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
|
+
const child_process_1 = require("child_process");
|
|
41
42
|
const index_1 = require("../src/index");
|
|
42
43
|
const upload_1 = require("../src/upload");
|
|
43
44
|
const download_1 = require("../src/download");
|
|
@@ -388,6 +389,72 @@ program
|
|
|
388
389
|
process.exit(1);
|
|
389
390
|
}
|
|
390
391
|
});
|
|
392
|
+
// 添加crowdin-push命令
|
|
393
|
+
program
|
|
394
|
+
.command('crowdin-push')
|
|
395
|
+
.description('推送本地keys文件到Crowdin项目')
|
|
396
|
+
.option('-c, --config <path>', '指定配置文件路径(默认为项目根目录下的vs.config.json)')
|
|
397
|
+
.action(async (options) => {
|
|
398
|
+
try {
|
|
399
|
+
const { config: configPath } = options;
|
|
400
|
+
// 1. 读取vs.config.json文件
|
|
401
|
+
const configFile = configPath || path.join(process.cwd(), 'vs.config.json');
|
|
402
|
+
if (!fs.existsSync(configFile)) {
|
|
403
|
+
console.error(`❌ 配置文件不存在: ${configFile}`);
|
|
404
|
+
process.exit(1);
|
|
405
|
+
}
|
|
406
|
+
console.log(`📖 读取配置文件: ${configFile}`);
|
|
407
|
+
const configContent = fs.readFileSync(configFile, 'utf8');
|
|
408
|
+
const cg = JSON.parse(configContent);
|
|
409
|
+
// 检查crowdin配置是否存在
|
|
410
|
+
if (!cg.crowdin || !cg.crowdin.keysDir || !cg.crowdin.project) {
|
|
411
|
+
console.error('❌ 配置文件中缺少必要的crowdin配置项 (keysDir, project)');
|
|
412
|
+
process.exit(1);
|
|
413
|
+
}
|
|
414
|
+
// 检查必要的上传配置
|
|
415
|
+
if (!cg.crowdin.Bucket) {
|
|
416
|
+
console.error('❌ 配置文件中缺少必要的crowdin.Bucket配置项');
|
|
417
|
+
process.exit(1);
|
|
418
|
+
}
|
|
419
|
+
console.log(`📋 Crowdin项目: ${cg.crowdin.project}`);
|
|
420
|
+
console.log(`📁 Keys目录: ${cg.crowdin.keysDir}`);
|
|
421
|
+
console.log(`🪣 存储桶: ${cg.crowdin.Bucket}`);
|
|
422
|
+
// 2. 生成可执行命令
|
|
423
|
+
let command = `ai-yuca upload -s ${cg.crowdin.keysDir}/keys -d crowdin/keys/${cg.crowdin.project} -b ${cg.crowdin.Bucket} -r`;
|
|
424
|
+
// 如果有密钥文件配置,添加密钥文件参数
|
|
425
|
+
if (cg.aws && cg.aws.FileKey) {
|
|
426
|
+
command += ` -k ${cg.aws.FileKey}`;
|
|
427
|
+
console.log(`🔑 密钥文件: ${cg.aws.FileKey}`);
|
|
428
|
+
}
|
|
429
|
+
console.log(`🚀 执行命令: ${command}`);
|
|
430
|
+
// 3. 执行execSync并返回结果
|
|
431
|
+
try {
|
|
432
|
+
const result = (0, child_process_1.execSync)(command, {
|
|
433
|
+
encoding: 'utf8',
|
|
434
|
+
stdio: 'pipe',
|
|
435
|
+
cwd: process.cwd()
|
|
436
|
+
});
|
|
437
|
+
console.log('✅ 命令执行成功!');
|
|
438
|
+
console.log('📤 执行结果:');
|
|
439
|
+
console.log(result);
|
|
440
|
+
}
|
|
441
|
+
catch (execError) {
|
|
442
|
+
console.error('❌ 命令执行失败:');
|
|
443
|
+
console.error('错误信息:', execError.message);
|
|
444
|
+
if (execError.stdout) {
|
|
445
|
+
console.log('标准输出:', execError.stdout);
|
|
446
|
+
}
|
|
447
|
+
if (execError.stderr) {
|
|
448
|
+
console.error('错误输出:', execError.stderr);
|
|
449
|
+
}
|
|
450
|
+
process.exit(1);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
catch (err) {
|
|
454
|
+
console.error(`❌ Crowdin Push 操作失败: ${err instanceof Error ? err.message : String(err)}`);
|
|
455
|
+
process.exit(1);
|
|
456
|
+
}
|
|
457
|
+
});
|
|
391
458
|
program.parse(process.argv);
|
|
392
459
|
if (!process.argv.slice(2).length) {
|
|
393
460
|
program.outputHelp();
|
package/dist/package.json
CHANGED
package/dist/src/cache.d.ts
CHANGED
package/dist/src/cache.js
CHANGED
|
@@ -93,9 +93,12 @@ class CacheManager {
|
|
|
93
93
|
/**
|
|
94
94
|
* 检查文件是否已经上传过
|
|
95
95
|
*/
|
|
96
|
-
isFileUploaded(filePath) {
|
|
96
|
+
isFileUploaded(filePath, replacePath) {
|
|
97
97
|
const hash = this.getFileHash(filePath);
|
|
98
|
-
|
|
98
|
+
const fileLink = filePath.replace(replacePath || '', '');
|
|
99
|
+
const newReg = new RegExp(`${fileLink}$`);
|
|
100
|
+
// console.log(hash in this.cache, !newReg.test(this.cache[hash]), filePath, this.cache[hash])
|
|
101
|
+
return hash in this.cache && newReg.test(this.cache[hash] || '');
|
|
99
102
|
}
|
|
100
103
|
/**
|
|
101
104
|
* 获取已上传文件的URL
|
|
@@ -130,7 +130,7 @@ async function uploadFilesWithConfig(options = {}) {
|
|
|
130
130
|
// 获取所有需要处理的文件
|
|
131
131
|
const allFiles = await getFilesToProcess(sourcePath, recursive, exclude);
|
|
132
132
|
for (const filePath of allFiles) {
|
|
133
|
-
if (cacheManager.isFileUploaded(filePath)) {
|
|
133
|
+
if (cacheManager.isFileUploaded(filePath, path.join(process.cwd(), config.upload.uploadPath))) {
|
|
134
134
|
skippedFiles.push(filePath);
|
|
135
135
|
}
|
|
136
136
|
else {
|
package/package.json
CHANGED
package/.cdn.cache.json
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"1a99299c456ebc765167fd52e2001e74": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/404.html",
|
|
3
|
-
"lastDeployVersion": "mfp1f60j",
|
|
4
|
-
"lastDeployTime": "2025-09-18T06:36:46.855Z",
|
|
5
|
-
"9c131577ed5a3ac2c491333d8ef2a9f9": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/1328.dd74ae6e3b15ff04.js",
|
|
6
|
-
"cd7b2febfe85ef70a082e26acd4c2db2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/1386-ecc75214ecbee698.js",
|
|
7
|
-
"70a06778dece088aea2f8f4f930eae33": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/2433-e7a7a662dbf652f6.js",
|
|
8
|
-
"d7eca074918940b61b0908fc0be75521": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/2690-0095f1624d934453.js",
|
|
9
|
-
"ef4731128d2ff9f2e82be9bffca25383": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/275-72255fc3d50dc50c.js",
|
|
10
|
-
"661e8d3be44e3ed0eebd21743918f521": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/2959.ae3acbd23e5f6cda.js",
|
|
11
|
-
"97c4a3368fdde3e8829526144a022723": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/3225-d85abacd3899a814.js",
|
|
12
|
-
"cde63adea346d4c3a729e7a170dac70d": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/3675-28b72a3b32730d1c.js",
|
|
13
|
-
"598e1c13bff6c0453593c5267d906222": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/3748.264b42930465e3e2.js",
|
|
14
|
-
"2f3e3aa7b2ef4d0e6521bae10ca65795": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4037-2b7b438dbc62c0d7.js",
|
|
15
|
-
"5f1ce6f19ab0aab661153c67a2d25eb1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4398.5d9a05b91ef7245f.js",
|
|
16
|
-
"a14a0c897c5d6a36e57a7d1dcc846239": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4622-c0099488d417e118.js",
|
|
17
|
-
"339d445e0c8aa350e4a044c6ecafae59": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4959-ad724f5ec8938d01.js",
|
|
18
|
-
"96b9ff2023dd384cede1edb91499c6c7": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5074.36b4aee9d001a900.js",
|
|
19
|
-
"389cd6cd28ff553b246d2770635380c6": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/508-ba5053bf494548a6.js",
|
|
20
|
-
"9737af21dde5d88084771cf4f8371970": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/527-e5943a23b7cb1339.js",
|
|
21
|
-
"521d5320a5957d1f5ed6f3c8cdb6ffa5": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5364-c39e26834b019bf3.js",
|
|
22
|
-
"a8682c0aaac554adc346c85b75ab87e2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5538-bbaa8d71d26838f4.js",
|
|
23
|
-
"d2c8f93e74883004f7fa329aa7d3a0d1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5546-9819a4f3addbda7d.js",
|
|
24
|
-
"e3b206036ff2e9bea610850073a0cca1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5646-deba957ab6368360.js",
|
|
25
|
-
"b2572f55cc3b2f085fa2cb04e4228f87": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6360-f8ffe176e0fb126a.js",
|
|
26
|
-
"bca38d211fb9ce82fea310fec3c235aa": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6377.2de8a90471ccb1f2.js",
|
|
27
|
-
"f00a931b54c6999405b2c1b53728cfff": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6459-b13d29c55a4ccc17.js",
|
|
28
|
-
"419c2ace7bc6773427caf0efe4789088": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6499-73f4ba916cde84ec.js",
|
|
29
|
-
"dc788f0ea4dddee06ac1e16e789044ac": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6703.87e72c53c45ac649.js",
|
|
30
|
-
"4c47c356be3d591d8a884e4397c385e1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6831-ddb4f2c5325ed9e1.js",
|
|
31
|
-
"30aba2e3de94764ea8017cd9d67b4c8b": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6878-413d4147840a9d3f.js",
|
|
32
|
-
"e1c2d015d98f3e341f1f05eed4bd547b": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7136-92e74a77d4fe1c09.js",
|
|
33
|
-
"f99928a728c489b96aa29be6f258f523": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7300-60bd937826e2889a.js",
|
|
34
|
-
"fb5b372c29242f4f4a1c2acb4bf71ea8": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7640-25157b4bebca756f.js",
|
|
35
|
-
"c53f331dcba971007e2924dba10e7150": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7660-71eef9eb7f0e25f4.js",
|
|
36
|
-
"75745e551cecdcbeaf4db5a765e229a9": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8141-fc059567bae11835.js",
|
|
37
|
-
"e772116c9a6d2d4e4db0e1e807293c19": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8229-27cb99a1348167ef.js",
|
|
38
|
-
"92e448c243b7445f2a23374691811295": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8482-12ab17377a4689a4.js",
|
|
39
|
-
"76b16cc4e66062c4dfa1bfaa5eb38d63": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8671-531e97f50b7ac7e2.js",
|
|
40
|
-
"9646f36406c8e3ee0ba4f6af5762df91": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8976-517d30d3cb7d450b.js",
|
|
41
|
-
"ef866452f63e4dc6909f46d91c2eada5": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8990-7bfc97b8a13369db.js",
|
|
42
|
-
"069c6fa9a8cb487c5ae76e93e2ac851d": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/9774-0752c9ec02a672b1.js",
|
|
43
|
-
"e9b3c6dfd6248d2ed01d5ba82d95f06f": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/framework-4e48f2cc6a39465a.js",
|
|
44
|
-
"5d3c6f77ca889d5af44fac717da4b716": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/main-691aa8a7a04c0676.js",
|
|
45
|
-
"8af1a6001bc6354a642c926e6756c535": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/help/[docs]-da22f062530993f0.js",
|
|
46
|
-
"45c4450d7a5ffc3e5adc8d7e2e230e18": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/addr-add-66110024b03a0619.js",
|
|
47
|
-
"8c33fe1ba8f4276ab4c8bb9b7e5ef62a": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/address-756133e40329d810.js",
|
|
48
|
-
"a3775486d79c904c16cecf34646b9129": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/cart-a108662aa517644d.js",
|
|
49
|
-
"9bfff886052ec4ceca7c25a9025a917a": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/coin-history-a3080e2211a22b4a.js",
|
|
50
|
-
"1f722e0721e61b0a1c26b4298c85a9c2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/coupons-73b673123e7dc947.js",
|
|
51
|
-
"be15960af6a3985e89fca971120c9b3e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/package-83495f0992231f5d.js",
|
|
52
|
-
"0e39e5228d49265c53247bd87b35cf70": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/promotion-669a234cb0b244a3.js",
|
|
53
|
-
"b9930b02ef701f0dfea3da46a9140b0b": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/top-up-54a68d160bc9712d.js",
|
|
54
|
-
"ee5b83742e0de944fb578abaa8025eed": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/user-trans-729e81ff7835ecd4.js",
|
|
55
|
-
"22bc5226914d89cf4556eb04eb7bcae8": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user-fdd23283e1809971.js",
|
|
56
|
-
"543ead04ce64036b96a0fc9e60a55382": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]-4c5942ab30d5820a.js",
|
|
57
|
-
"143f0aa61af40b8174a22f83efde2a44": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/_app-9e17b6a9fc7f7fd6.js",
|
|
58
|
-
"54ac0c128b24bff18dbe7a104144b8ad": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/_error-6df9c3943cfa136b.js",
|
|
59
|
-
"846118c33b2c0e922d7b3a7676f81f6f": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/polyfills-42372ed130431b0a.js",
|
|
60
|
-
"305732b75ff2b910ffc7b179f78ec2fe": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/webpack-02d8ee89c01f16cc.js",
|
|
61
|
-
"c0d22fa05bb01a979aa16647502841ea": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/css/0ea4ceb6ceb58b84.css",
|
|
62
|
-
"50bfbd5d5399c220c9d75e830880ea95": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/css/5812f5a1673562f2.css",
|
|
63
|
-
"00cd4b7e37eebd50d7dfbba2ff9250d4": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/css/ebee78a7b84ab4db.css",
|
|
64
|
-
"ecad0ad0e58696fefbd077cf80ca4eae": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/de-de.html",
|
|
65
|
-
"26035c34c9604ef619aee0a0390ad5f2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/en-us.html",
|
|
66
|
-
"b2538becc3efe3c7f6e8baf8b08a8906": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/es-es.html",
|
|
67
|
-
"2d6b00c26278a7e0cc36f17ccfd43ae8": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/favicon.ico",
|
|
68
|
-
"d09f95206c3fa0bb9bd9fefabfd0ea71": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/file.svg",
|
|
69
|
-
"7d4ae5c9a42c8e51a188bffef56afe07": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/fr-fr.html",
|
|
70
|
-
"2aaafa6a49b6563925fe440891e32717": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/globe.svg",
|
|
71
|
-
"5cd3c04827bbded361356f32bb7200ec": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/it-it.html",
|
|
72
|
-
"8e061864f388b47f33a1c3780831193e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/next.svg",
|
|
73
|
-
"b4066bd38debe2fbb5175822ff56aee9": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/pt-pt.html",
|
|
74
|
-
"50020dc76264ce4aa9e0bd558dad5fea": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/about-us.html",
|
|
75
|
-
"6e502a5b60df5d59419fa299620dd89a": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/beginner-guide.html",
|
|
76
|
-
"5631943a8ea8777480c72d3487f957a6": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/delivery-agreement.html",
|
|
77
|
-
"75a6c9c5cd467e13d49694f8b4206842": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/faq.html",
|
|
78
|
-
"8d90eb64288f45a8731c07b022c9bd48": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/incentive-system.html",
|
|
79
|
-
"80eb11e81b584d7f4e7005d8eaeea412": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/privacy-statement.html",
|
|
80
|
-
"f2a319665ca938caf61838b5b8fa89d0": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/promotion.html",
|
|
81
|
-
"9b9f7877145a2c0294a1a4521c45ddb5": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/return-refunds.html",
|
|
82
|
-
"a818ca1181996274a2d74b036bc12d8e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/service-agreement.html",
|
|
83
|
-
"a45b13865e180ad3089654748581dd13": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/user-guide.html",
|
|
84
|
-
"dbbe926f7471e8a08b0a29a3ea1d9ddf": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/why-us.html",
|
|
85
|
-
"456d04b7debe707ee3c6ce48fc693d40": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/addr-add.html",
|
|
86
|
-
"6bdbce72ca0a8f4026dbbb07814acfff": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/address.html",
|
|
87
|
-
"37f61247fed758955511a5b2587de935": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/cart.html",
|
|
88
|
-
"fc445fc0cdd3973f4453feaee70ed6fa": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/coin-history.html",
|
|
89
|
-
"b1306845df0ab4a4f6735a92e91d3faa": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/coupons.html",
|
|
90
|
-
"b1009da3d328c61806dc469d7fdd5053": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/package.html",
|
|
91
|
-
"c9d0f57aa2d6b9b728d3f3169843729e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/promotion.html",
|
|
92
|
-
"89c3fba566fb51d6c8ecc6f5c84a3777": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/top-up.html",
|
|
93
|
-
"4a19a2cfea499099e40127cff9cb07e0": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/user-trans.html",
|
|
94
|
-
"6f7294a78724f57e19bf956e71fea29c": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user.html",
|
|
95
|
-
"12eaa1a82b34e0b7ad027b327f8c7bfc": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn.html"
|
|
96
|
-
}
|
package/bin/cli.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { program } = require('commander');
|
|
4
|
-
const pkg = require('../package.json');
|
|
5
|
-
const { analyze } = require('../src/index');
|
|
6
|
-
const { createStorageClient, uploadFiles } = require('../src/upload');
|
|
7
|
-
|
|
8
|
-
// 设置版本和描述
|
|
9
|
-
program
|
|
10
|
-
.version(pkg.version, '-v, --version')
|
|
11
|
-
.description(pkg.description);
|
|
12
|
-
|
|
13
|
-
// 添加analyze命令
|
|
14
|
-
program
|
|
15
|
-
.command('analyze')
|
|
16
|
-
.description('分析文本内容')
|
|
17
|
-
.option('-f, --file <path>', '指定要分析的文件路径')
|
|
18
|
-
.option('-t, --text <text>', '直接分析提供的文本')
|
|
19
|
-
.action((options) => {
|
|
20
|
-
analyze(options);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// 添加upload命令
|
|
24
|
-
program
|
|
25
|
-
.command('upload')
|
|
26
|
-
.description('上传文件到GCP存储桶')
|
|
27
|
-
.option('-s, --source <paths...>', '指定要上传的文件或目录路径(支持多个)')
|
|
28
|
-
.option('-b, --bucket <name>', 'GCP存储桶名称')
|
|
29
|
-
.option('-d, --destination <path>', '目标路径(存储桶中的路径)')
|
|
30
|
-
.option('-k, --key-file <path>', 'GCP服务账号密钥文件路径')
|
|
31
|
-
.option('-r, --recursive', '递归上传目录中的文件', false)
|
|
32
|
-
.action(async (options) => {
|
|
33
|
-
try {
|
|
34
|
-
const { source, bucket, destination, keyFile, recursive } = options;
|
|
35
|
-
|
|
36
|
-
if (!source || !bucket || !keyFile) {
|
|
37
|
-
console.error('错误: 必须提供源文件路径、存储桶名称和密钥文件路径');
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// 创建存储客户端
|
|
42
|
-
const storageClient = createStorageClient({ keyFilename: keyFile });
|
|
43
|
-
|
|
44
|
-
console.log('开始上传文件...');
|
|
45
|
-
|
|
46
|
-
// 执行上传
|
|
47
|
-
const results = await uploadFiles({
|
|
48
|
-
bucketName: bucket,
|
|
49
|
-
sourcePath: source,
|
|
50
|
-
destination,
|
|
51
|
-
storageClient,
|
|
52
|
-
recursive
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// 输出结果
|
|
56
|
-
console.log('\n上传完成!');
|
|
57
|
-
console.log(`成功: ${results.success.length} 个文件`);
|
|
58
|
-
console.log(`失败: ${results.failed.length} 个文件`);
|
|
59
|
-
|
|
60
|
-
if (results.success.length > 0) {
|
|
61
|
-
console.log('\n成功上传的文件:');
|
|
62
|
-
results.success.forEach(file => {
|
|
63
|
-
console.log(`- ${file.file} (${file.url})`);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (results.failed.length > 0) {
|
|
68
|
-
console.log('\n上传失败的文件:');
|
|
69
|
-
results.failed.forEach(file => {
|
|
70
|
-
console.log(`- ${file.file}: ${file.error}`);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
} catch (err) {
|
|
74
|
-
console.error(`上传错误: ${err.message}`);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// 解析命令行参数
|
|
80
|
-
program.parse(process.argv);
|
|
81
|
-
|
|
82
|
-
// 如果没有提供任何命令,显示帮助信息
|
|
83
|
-
if (!process.argv.slice(2).length) {
|
|
84
|
-
program.outputHelp();
|
|
85
|
-
}
|