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.
Files changed (190) hide show
  1. package/dist/bin/cli.js +67 -0
  2. package/dist/package.json +1 -1
  3. package/dist/src/cache.d.ts +1 -1
  4. package/dist/src/cache.js +5 -2
  5. package/dist/src/uploadWithConfig.js +1 -1
  6. package/package.json +1 -1
  7. package/.cdn.cache.json +0 -96
  8. package/bin/cli.js +0 -85
  9. package/bin/cli.ts +0 -417
  10. package/debug-upload.js +0 -206
  11. package/docs/deploy.md +0 -286
  12. package/docs/usage.md +0 -223
  13. package/examples/sample.txt +0 -7
  14. package/examples/upload-example.js +0 -53
  15. package/i18n/de-de.json +0 -1211
  16. package/i18n/en-us.json +0 -1211
  17. package/i18n/es-es.json +0 -1211
  18. package/i18n/fr-fr.json +0 -1211
  19. package/i18n/it-it.json +0 -1211
  20. package/i18n/keys/aiAgent.json +0 -259
  21. package/i18n/keys/dev_20250102.json +0 -14
  22. package/i18n/keys/h5.json +0 -37
  23. package/i18n/keys/main.json +0 -436
  24. package/i18n/keys/newsite.json +0 -473
  25. package/i18n/lang/de-de/aiAgent.json +0 -259
  26. package/i18n/lang/de-de/dev_20250102.json +0 -14
  27. package/i18n/lang/de-de/h5.json +0 -37
  28. package/i18n/lang/de-de/main.json +0 -436
  29. package/i18n/lang/de-de/newsite.json +0 -473
  30. package/i18n/lang/en-us/aiAgent.json +0 -259
  31. package/i18n/lang/en-us/dev_20250102.json +0 -14
  32. package/i18n/lang/en-us/dev_241116.json +0 -49
  33. package/i18n/lang/en-us/h5.json +0 -37
  34. package/i18n/lang/en-us/main.json +0 -436
  35. package/i18n/lang/en-us/newsite.json +0 -473
  36. package/i18n/lang/es-es/aiAgent.json +0 -259
  37. package/i18n/lang/es-es/dev_20250102.json +0 -14
  38. package/i18n/lang/es-es/h5.json +0 -37
  39. package/i18n/lang/es-es/main.json +0 -436
  40. package/i18n/lang/es-es/newsite.json +0 -473
  41. package/i18n/lang/fr-fr/aiAgent.json +0 -259
  42. package/i18n/lang/fr-fr/dev_20250102.json +0 -14
  43. package/i18n/lang/fr-fr/h5.json +0 -37
  44. package/i18n/lang/fr-fr/main.json +0 -436
  45. package/i18n/lang/fr-fr/newsite.json +0 -473
  46. package/i18n/lang/it-it/aiAgent.json +0 -259
  47. package/i18n/lang/it-it/dev_20250102.json +0 -14
  48. package/i18n/lang/it-it/h5.json +0 -37
  49. package/i18n/lang/it-it/main.json +0 -436
  50. package/i18n/lang/it-it/newsite.json +0 -473
  51. package/i18n/lang/pt-pt/aiAgent.json +0 -259
  52. package/i18n/lang/pt-pt/dev_20250102.json +0 -14
  53. package/i18n/lang/pt-pt/h5.json +0 -37
  54. package/i18n/lang/pt-pt/main.json +0 -436
  55. package/i18n/lang/pt-pt/newsite.json +0 -473
  56. package/i18n/lang/ru-ru/aiAgent.json +0 -259
  57. package/i18n/lang/ru-ru/dev_20250102.json +0 -14
  58. package/i18n/lang/ru-ru/h5.json +0 -37
  59. package/i18n/lang/ru-ru/main.json +0 -436
  60. package/i18n/lang/ru-ru/newsite.json +0 -473
  61. package/i18n/lang/zh-cn/aiAgent.json +0 -259
  62. package/i18n/lang/zh-cn/dev_20250102.json +0 -14
  63. package/i18n/lang/zh-cn/dev_241116.json +0 -49
  64. package/i18n/lang/zh-cn/h5.json +0 -37
  65. package/i18n/lang/zh-cn/main.json +0 -436
  66. package/i18n/lang/zh-cn/newsite.json +0 -473
  67. package/i18n/lang/zh-hk/dev_241116.json +0 -49
  68. package/i18n/lang/zh-hk/main.json +0 -128
  69. package/i18n/pt-pt.json +0 -1211
  70. package/i18n/ru-ru.json +0 -1211
  71. package/i18n/zh-cn.json +0 -1211
  72. package/i18n/zh-hk.json +0 -128
  73. package/out/404.html +0 -1
  74. package/out/_next/static/chunks/1328.dd74ae6e3b15ff04.js +0 -1
  75. package/out/_next/static/chunks/1386-ecc75214ecbee698.js +0 -1
  76. package/out/_next/static/chunks/2433-e7a7a662dbf652f6.js +0 -1
  77. package/out/_next/static/chunks/2690-0095f1624d934453.js +0 -1
  78. package/out/_next/static/chunks/275-72255fc3d50dc50c.js +0 -1
  79. package/out/_next/static/chunks/2959.ae3acbd23e5f6cda.js +0 -1
  80. package/out/_next/static/chunks/3225-d85abacd3899a814.js +0 -1
  81. package/out/_next/static/chunks/3675-28b72a3b32730d1c.js +0 -1
  82. package/out/_next/static/chunks/3748.264b42930465e3e2.js +0 -1
  83. package/out/_next/static/chunks/4037-2b7b438dbc62c0d7.js +0 -1
  84. package/out/_next/static/chunks/4398.5d9a05b91ef7245f.js +0 -1
  85. package/out/_next/static/chunks/4622-c0099488d417e118.js +0 -1
  86. package/out/_next/static/chunks/4959-ad724f5ec8938d01.js +0 -1
  87. package/out/_next/static/chunks/5074.36b4aee9d001a900.js +0 -1
  88. package/out/_next/static/chunks/508-ba5053bf494548a6.js +0 -1
  89. package/out/_next/static/chunks/527-e5943a23b7cb1339.js +0 -1
  90. package/out/_next/static/chunks/5364-c39e26834b019bf3.js +0 -1
  91. package/out/_next/static/chunks/5538-bbaa8d71d26838f4.js +0 -1
  92. package/out/_next/static/chunks/5546-9819a4f3addbda7d.js +0 -1
  93. package/out/_next/static/chunks/5646-deba957ab6368360.js +0 -1
  94. package/out/_next/static/chunks/6360-f8ffe176e0fb126a.js +0 -1
  95. package/out/_next/static/chunks/6377.2de8a90471ccb1f2.js +0 -1
  96. package/out/_next/static/chunks/6459-b13d29c55a4ccc17.js +0 -1
  97. package/out/_next/static/chunks/6499-73f4ba916cde84ec.js +0 -1
  98. package/out/_next/static/chunks/6703.87e72c53c45ac649.js +0 -1
  99. package/out/_next/static/chunks/6831-ddb4f2c5325ed9e1.js +0 -1
  100. package/out/_next/static/chunks/6878-413d4147840a9d3f.js +0 -1
  101. package/out/_next/static/chunks/7136-92e74a77d4fe1c09.js +0 -1
  102. package/out/_next/static/chunks/7300-60bd937826e2889a.js +0 -1
  103. package/out/_next/static/chunks/7640-25157b4bebca756f.js +0 -1
  104. package/out/_next/static/chunks/7660-71eef9eb7f0e25f4.js +0 -1
  105. package/out/_next/static/chunks/8141-fc059567bae11835.js +0 -1
  106. package/out/_next/static/chunks/8229-27cb99a1348167ef.js +0 -1
  107. package/out/_next/static/chunks/8482-12ab17377a4689a4.js +0 -1
  108. package/out/_next/static/chunks/8671-531e97f50b7ac7e2.js +0 -1
  109. package/out/_next/static/chunks/8976-517d30d3cb7d450b.js +0 -1
  110. package/out/_next/static/chunks/8990-7bfc97b8a13369db.js +0 -1
  111. package/out/_next/static/chunks/9774-0752c9ec02a672b1.js +0 -1
  112. package/out/_next/static/chunks/framework-4e48f2cc6a39465a.js +0 -1
  113. package/out/_next/static/chunks/main-691aa8a7a04c0676.js +0 -1
  114. package/out/_next/static/chunks/pages/[lang]/help/[docs]-da22f062530993f0.js +0 -1
  115. package/out/_next/static/chunks/pages/[lang]/user/addr-add-66110024b03a0619.js +0 -1
  116. package/out/_next/static/chunks/pages/[lang]/user/address-756133e40329d810.js +0 -1
  117. package/out/_next/static/chunks/pages/[lang]/user/cart-a108662aa517644d.js +0 -1
  118. package/out/_next/static/chunks/pages/[lang]/user/coin-history-a3080e2211a22b4a.js +0 -1
  119. package/out/_next/static/chunks/pages/[lang]/user/coupons-73b673123e7dc947.js +0 -1
  120. package/out/_next/static/chunks/pages/[lang]/user/package-83495f0992231f5d.js +0 -1
  121. package/out/_next/static/chunks/pages/[lang]/user/promotion-669a234cb0b244a3.js +0 -1
  122. package/out/_next/static/chunks/pages/[lang]/user/top-up-54a68d160bc9712d.js +0 -1
  123. package/out/_next/static/chunks/pages/[lang]/user/user-trans-729e81ff7835ecd4.js +0 -1
  124. package/out/_next/static/chunks/pages/[lang]/user-fdd23283e1809971.js +0 -1
  125. package/out/_next/static/chunks/pages/[lang]-4c5942ab30d5820a.js +0 -1
  126. package/out/_next/static/chunks/pages/_app-9e17b6a9fc7f7fd6.js +0 -5
  127. package/out/_next/static/chunks/pages/_error-6df9c3943cfa136b.js +0 -1
  128. package/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  129. package/out/_next/static/chunks/webpack-02d8ee89c01f16cc.js +0 -1
  130. package/out/_next/static/css/0ea4ceb6ceb58b84.css +0 -3
  131. package/out/_next/static/css/5812f5a1673562f2.css +0 -1
  132. package/out/_next/static/css/ebee78a7b84ab4db.css +0 -1
  133. package/out/de-de.html +0 -1
  134. package/out/en-us.html +0 -1
  135. package/out/es-es.html +0 -1
  136. package/out/favicon.ico +0 -0
  137. package/out/file.svg +0 -1
  138. package/out/fr-fr.html +0 -1
  139. package/out/globe.svg +0 -1
  140. package/out/it-it.html +0 -1
  141. package/out/next.svg +0 -1
  142. package/out/pt-pt.html +0 -1
  143. package/out/zh-cn/help/about-us.html +0 -41
  144. package/out/zh-cn/help/beginner-guide.html +0 -123
  145. package/out/zh-cn/help/delivery-agreement.html +0 -153
  146. package/out/zh-cn/help/faq.html +0 -102
  147. package/out/zh-cn/help/incentive-system.html +0 -254
  148. package/out/zh-cn/help/privacy-statement.html +0 -61
  149. package/out/zh-cn/help/promotion.html +0 -132
  150. package/out/zh-cn/help/return-refunds.html +0 -206
  151. package/out/zh-cn/help/service-agreement.html +0 -89
  152. package/out/zh-cn/help/user-guide.html +0 -169
  153. package/out/zh-cn/help/why-us.html +0 -138
  154. package/out/zh-cn/user/addr-add.html +0 -1
  155. package/out/zh-cn/user/address.html +0 -1
  156. package/out/zh-cn/user/cart.html +0 -1
  157. package/out/zh-cn/user/coin-history.html +0 -1
  158. package/out/zh-cn/user/coupons.html +0 -1
  159. package/out/zh-cn/user/package.html +0 -1
  160. package/out/zh-cn/user/promotion.html +0 -1
  161. package/out/zh-cn/user/top-up.html +0 -1
  162. package/out/zh-cn/user/user-trans.html +0 -1
  163. package/out/zh-cn/user.html +0 -1
  164. package/out/zh-cn.html +0 -1
  165. package/src/cache.ts +0 -167
  166. package/src/config.ts +0 -105
  167. package/src/deploy.ts +0 -578
  168. package/src/download.ts +0 -232
  169. package/src/index.js +0 -88
  170. package/src/index.ts +0 -98
  171. package/src/pullCrowdin.ts +0 -482
  172. package/src/types/analyze.ts +0 -37
  173. package/src/types/deploy.ts +0 -77
  174. package/src/types/download.ts +0 -67
  175. package/src/types/index.ts +0 -22
  176. package/src/types/pullCrowdin.ts +0 -164
  177. package/src/types/upload.ts +0 -125
  178. package/src/upload.js +0 -197
  179. package/src/upload.ts +0 -466
  180. package/src/uploadWithConfig.ts +0 -277
  181. package/src/utils/compression.ts +0 -61
  182. package/test/cli-test/test-exclude.js +0 -43
  183. package/test/cli-test/test-queue-upload.js +0 -49
  184. package/test/cli-test/test-retry.js +0 -71
  185. package/test/cli-test/test-upload-queue.js +0 -80
  186. package/test/compression.test.ts +0 -88
  187. package/test/download.test.ts +0 -162
  188. package/test/index.test.js +0 -38
  189. package/test/index.test.ts +0 -39
  190. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-yuca",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "一个用AI生成的开发辅助工具",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -26,7 +26,7 @@ export declare class CacheManager {
26
26
  /**
27
27
  * 检查文件是否已经上传过
28
28
  */
29
- isFileUploaded(filePath: string): boolean;
29
+ isFileUploaded(filePath: string, replacePath?: string): boolean;
30
30
  /**
31
31
  * 获取已上传文件的URL
32
32
  */
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
- return hash in this.cache;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-yuca",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "一个用AI生成的开发辅助工具",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
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
- }