surgio 3.2.1 → 3.2.3

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 (47) hide show
  1. package/build/base-command.d.ts +1 -0
  2. package/build/base-command.js +8 -1
  3. package/build/base-command.js.map +1 -1
  4. package/build/commands/check.js +1 -2
  5. package/build/commands/check.js.map +1 -1
  6. package/build/commands/clean-cache.js +1 -2
  7. package/build/commands/clean-cache.js.map +1 -1
  8. package/build/commands/doctor.js +1 -2
  9. package/build/commands/doctor.js.map +1 -1
  10. package/build/commands/generate.js +1 -2
  11. package/build/commands/generate.js.map +1 -1
  12. package/build/commands/lint.js +1 -0
  13. package/build/commands/lint.js.map +1 -1
  14. package/build/commands/new.js +3 -2
  15. package/build/commands/new.js.map +1 -1
  16. package/build/commands/subscriptions.js +1 -2
  17. package/build/commands/subscriptions.js.map +1 -1
  18. package/build/commands/upload.js +1 -3
  19. package/build/commands/upload.js.map +1 -1
  20. package/build/configurables.d.ts +1 -1
  21. package/build/utils/cache.d.ts +1 -1
  22. package/build/utils/loon.js +6 -0
  23. package/build/utils/loon.js.map +1 -1
  24. package/build/utils/remote-snippet.js +1 -0
  25. package/build/utils/remote-snippet.js.map +1 -1
  26. package/build/utils/surge.js +5 -6
  27. package/build/utils/surge.js.map +1 -1
  28. package/build/validators/common.d.ts +146 -2
  29. package/build/validators/common.js +5 -0
  30. package/build/validators/common.js.map +1 -1
  31. package/build/validators/http.d.ts +149 -5
  32. package/build/validators/hysteria2.d.ts +75 -3
  33. package/build/validators/shadowsocks.d.ts +74 -2
  34. package/build/validators/shadowsocksr.d.ts +74 -2
  35. package/build/validators/snell.d.ts +74 -2
  36. package/build/validators/socks5.d.ts +74 -2
  37. package/build/validators/surgio-config.d.ts +44 -4
  38. package/build/validators/surgio-config.js +23 -31
  39. package/build/validators/surgio-config.js.map +1 -1
  40. package/build/validators/trojan.d.ts +75 -3
  41. package/build/validators/tuic.d.ts +300 -12
  42. package/build/validators/vmess.d.ts +74 -2
  43. package/build/validators/wireguard.d.ts +72 -0
  44. package/hygen-template/artifact/new/index.js +2 -2
  45. package/hygen-template/provider/new/index.js +10 -5
  46. package/hygen-template/provider/new/template.ejs.t +2 -2
  47. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const { types } = require('../../../build/internal')
4
- const { SupportProviderEnum } = types
3
+ const { SupportProviderEnum } = require('../../../build/internal')
5
4
 
6
5
  module.exports = {
7
6
  prompt: ({ prompter: inquirer }) => {
@@ -57,9 +56,8 @@ module.exports = {
57
56
  },
58
57
  {
59
58
  type: 'confirm',
60
- name: 'relayUrl',
61
- message:
62
- '是否开启订阅转发,推荐使用了封锁 now.sh IP 的机场开启(默认关闭)',
59
+ name: 'isRelayUrlEnabled',
60
+ message: '是否开启订阅转发(默认关闭)',
63
61
  default: false,
64
62
  when: (results) => {
65
63
  return [
@@ -71,6 +69,13 @@ module.exports = {
71
69
  ].includes(results.type)
72
70
  },
73
71
  },
72
+ {
73
+ type: 'input',
74
+ name: 'relayUrl',
75
+ message: '输入订阅转发地址',
76
+ when: (results) => results.isRelayUrlEnabled,
77
+ validate: (str) => /^https?:\/{2}/.test(str),
78
+ },
74
79
  ])
75
80
  },
76
81
  }
@@ -20,8 +20,8 @@ module.exports = {
20
20
  <% if (typeof udpRelay !== 'undefined' && udpRelay === true) { -%>
21
21
  udpRelay: true,
22
22
  <% } -%>
23
- <% if (typeof relayUrl !== 'undefined' && relayUrl === true) { -%>
24
- relayUrl: true,
23
+ <% if (typeof relayUrl === 'string') { -%>
24
+ relayUrl: '<%= relayUrl %>',
25
25
  <% } -%>
26
26
  };
27
27
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "surgio",
3
3
  "description": "Generating rules for Surge, Clash, Quantumult like a PRO",
4
- "version": "3.2.1",
4
+ "version": "3.2.3",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
7
7
  "bin": {