@hs-x/cli 0.1.0

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 (302) hide show
  1. package/README.md +1001 -0
  2. package/dist/account-store.d.ts +51 -0
  3. package/dist/account-store.d.ts.map +1 -0
  4. package/dist/account-store.js +138 -0
  5. package/dist/account-store.js.map +1 -0
  6. package/dist/bin/hs-x.d.ts +3 -0
  7. package/dist/bin/hs-x.d.ts.map +1 -0
  8. package/dist/bin/hs-x.js +47 -0
  9. package/dist/bin/hs-x.js.map +1 -0
  10. package/dist/cli/index.d.ts +3 -0
  11. package/dist/cli/index.d.ts.map +1 -0
  12. package/dist/cli/index.js +595 -0
  13. package/dist/cli/index.js.map +1 -0
  14. package/dist/cli-error.d.ts +36 -0
  15. package/dist/cli-error.d.ts.map +1 -0
  16. package/dist/cli-error.js +40 -0
  17. package/dist/cli-error.js.map +1 -0
  18. package/dist/cloudflare-auth.d.ts +25 -0
  19. package/dist/cloudflare-auth.d.ts.map +1 -0
  20. package/dist/cloudflare-auth.js +251 -0
  21. package/dist/cloudflare-auth.js.map +1 -0
  22. package/dist/cloudflare-kv.d.ts +23 -0
  23. package/dist/cloudflare-kv.d.ts.map +1 -0
  24. package/dist/cloudflare-kv.js +101 -0
  25. package/dist/cloudflare-kv.js.map +1 -0
  26. package/dist/cloudflare-oauth-store.d.ts +16 -0
  27. package/dist/cloudflare-oauth-store.d.ts.map +1 -0
  28. package/dist/cloudflare-oauth-store.js +80 -0
  29. package/dist/cloudflare-oauth-store.js.map +1 -0
  30. package/dist/cloudflare-oauth.d.ts +82 -0
  31. package/dist/cloudflare-oauth.d.ts.map +1 -0
  32. package/dist/cloudflare-oauth.js +336 -0
  33. package/dist/cloudflare-oauth.js.map +1 -0
  34. package/dist/cloudflare-pointer.d.ts +13 -0
  35. package/dist/cloudflare-pointer.d.ts.map +1 -0
  36. package/dist/cloudflare-pointer.js +46 -0
  37. package/dist/cloudflare-pointer.js.map +1 -0
  38. package/dist/command-history.d.ts +7 -0
  39. package/dist/command-history.d.ts.map +1 -0
  40. package/dist/command-history.js +34 -0
  41. package/dist/command-history.js.map +1 -0
  42. package/dist/commands/account.d.ts +7 -0
  43. package/dist/commands/account.d.ts.map +1 -0
  44. package/dist/commands/account.js +315 -0
  45. package/dist/commands/account.js.map +1 -0
  46. package/dist/commands/api.d.ts +36 -0
  47. package/dist/commands/api.d.ts.map +1 -0
  48. package/dist/commands/api.js +521 -0
  49. package/dist/commands/api.js.map +1 -0
  50. package/dist/commands/completion.d.ts +7 -0
  51. package/dist/commands/completion.d.ts.map +1 -0
  52. package/dist/commands/completion.js +121 -0
  53. package/dist/commands/completion.js.map +1 -0
  54. package/dist/commands/connect.d.ts +7 -0
  55. package/dist/commands/connect.d.ts.map +1 -0
  56. package/dist/commands/connect.js +1123 -0
  57. package/dist/commands/connect.js.map +1 -0
  58. package/dist/commands/control-plane-read.d.ts +22 -0
  59. package/dist/commands/control-plane-read.d.ts.map +1 -0
  60. package/dist/commands/control-plane-read.js +350 -0
  61. package/dist/commands/control-plane-read.js.map +1 -0
  62. package/dist/commands/deploy-promote.d.ts +14 -0
  63. package/dist/commands/deploy-promote.d.ts.map +1 -0
  64. package/dist/commands/deploy-promote.js +105 -0
  65. package/dist/commands/deploy-promote.js.map +1 -0
  66. package/dist/commands/deploy.d.ts +18 -0
  67. package/dist/commands/deploy.d.ts.map +1 -0
  68. package/dist/commands/deploy.js +2764 -0
  69. package/dist/commands/deploy.js.map +1 -0
  70. package/dist/commands/dev.d.ts +7 -0
  71. package/dist/commands/dev.d.ts.map +1 -0
  72. package/dist/commands/dev.js +913 -0
  73. package/dist/commands/dev.js.map +1 -0
  74. package/dist/commands/doctor.d.ts +8 -0
  75. package/dist/commands/doctor.d.ts.map +1 -0
  76. package/dist/commands/doctor.js +258 -0
  77. package/dist/commands/doctor.js.map +1 -0
  78. package/dist/commands/flags.d.ts +22 -0
  79. package/dist/commands/flags.d.ts.map +1 -0
  80. package/dist/commands/flags.js +185 -0
  81. package/dist/commands/flags.js.map +1 -0
  82. package/dist/commands/help-command.d.ts +13 -0
  83. package/dist/commands/help-command.d.ts.map +1 -0
  84. package/dist/commands/help-command.js +482 -0
  85. package/dist/commands/help-command.js.map +1 -0
  86. package/dist/commands/history.d.ts +6 -0
  87. package/dist/commands/history.d.ts.map +1 -0
  88. package/dist/commands/history.js +42 -0
  89. package/dist/commands/history.js.map +1 -0
  90. package/dist/commands/init.d.ts +8 -0
  91. package/dist/commands/init.d.ts.map +1 -0
  92. package/dist/commands/init.js +233 -0
  93. package/dist/commands/init.js.map +1 -0
  94. package/dist/commands/link.d.ts +26 -0
  95. package/dist/commands/link.d.ts.map +1 -0
  96. package/dist/commands/link.js +441 -0
  97. package/dist/commands/link.js.map +1 -0
  98. package/dist/commands/login.d.ts +8 -0
  99. package/dist/commands/login.d.ts.map +1 -0
  100. package/dist/commands/login.js +381 -0
  101. package/dist/commands/login.js.map +1 -0
  102. package/dist/commands/migrate.d.ts +8 -0
  103. package/dist/commands/migrate.d.ts.map +1 -0
  104. package/dist/commands/migrate.js +258 -0
  105. package/dist/commands/migrate.js.map +1 -0
  106. package/dist/commands/rollback.d.ts +21 -0
  107. package/dist/commands/rollback.d.ts.map +1 -0
  108. package/dist/commands/rollback.js +301 -0
  109. package/dist/commands/rollback.js.map +1 -0
  110. package/dist/commands/secrets.d.ts +7 -0
  111. package/dist/commands/secrets.d.ts.map +1 -0
  112. package/dist/commands/secrets.js +230 -0
  113. package/dist/commands/secrets.js.map +1 -0
  114. package/dist/commands/status.d.ts +7 -0
  115. package/dist/commands/status.d.ts.map +1 -0
  116. package/dist/commands/status.js +241 -0
  117. package/dist/commands/status.js.map +1 -0
  118. package/dist/commands/unlink.d.ts +21 -0
  119. package/dist/commands/unlink.d.ts.map +1 -0
  120. package/dist/commands/unlink.js +83 -0
  121. package/dist/commands/unlink.js.map +1 -0
  122. package/dist/commands/update.d.ts +11 -0
  123. package/dist/commands/update.d.ts.map +1 -0
  124. package/dist/commands/update.js +154 -0
  125. package/dist/commands/update.js.map +1 -0
  126. package/dist/commands/validate.d.ts +9 -0
  127. package/dist/commands/validate.d.ts.map +1 -0
  128. package/dist/commands/validate.js +39 -0
  129. package/dist/commands/validate.js.map +1 -0
  130. package/dist/config.d.ts +12 -0
  131. package/dist/config.d.ts.map +1 -0
  132. package/dist/config.js +64 -0
  133. package/dist/config.js.map +1 -0
  134. package/dist/constants.d.ts +4 -0
  135. package/dist/constants.d.ts.map +1 -0
  136. package/dist/constants.js +4 -0
  137. package/dist/constants.js.map +1 -0
  138. package/dist/control-plane-fetch.d.ts +34 -0
  139. package/dist/control-plane-fetch.d.ts.map +1 -0
  140. package/dist/control-plane-fetch.js +73 -0
  141. package/dist/control-plane-fetch.js.map +1 -0
  142. package/dist/control-plane-loader.d.ts +16 -0
  143. package/dist/control-plane-loader.d.ts.map +1 -0
  144. package/dist/control-plane-loader.js +24 -0
  145. package/dist/control-plane-loader.js.map +1 -0
  146. package/dist/dev/compat-shim.d.ts +40 -0
  147. package/dist/dev/compat-shim.d.ts.map +1 -0
  148. package/dist/dev/compat-shim.js +65 -0
  149. package/dist/dev/compat-shim.js.map +1 -0
  150. package/dist/dev/event-bus.d.ts +27 -0
  151. package/dist/dev/event-bus.d.ts.map +1 -0
  152. package/dist/dev/event-bus.js +32 -0
  153. package/dist/dev/event-bus.js.map +1 -0
  154. package/dist/dev/log-server.d.ts +52 -0
  155. package/dist/dev/log-server.d.ts.map +1 -0
  156. package/dist/dev/log-server.js +216 -0
  157. package/dist/dev/log-server.js.map +1 -0
  158. package/dist/dev/session-manager.d.ts +33 -0
  159. package/dist/dev/session-manager.d.ts.map +1 -0
  160. package/dist/dev/session-manager.js +132 -0
  161. package/dist/dev/session-manager.js.map +1 -0
  162. package/dist/dev/stream-renderer.d.ts +22 -0
  163. package/dist/dev/stream-renderer.d.ts.map +1 -0
  164. package/dist/dev/stream-renderer.js +65 -0
  165. package/dist/dev/stream-renderer.js.map +1 -0
  166. package/dist/dev/tunnel.d.ts +40 -0
  167. package/dist/dev/tunnel.d.ts.map +1 -0
  168. package/dist/dev/tunnel.js +139 -0
  169. package/dist/dev/tunnel.js.map +1 -0
  170. package/dist/effect-http.d.ts +10 -0
  171. package/dist/effect-http.d.ts.map +1 -0
  172. package/dist/effect-http.js +38 -0
  173. package/dist/effect-http.js.map +1 -0
  174. package/dist/errors-registry.d.ts +11 -0
  175. package/dist/errors-registry.d.ts.map +1 -0
  176. package/dist/errors-registry.js +554 -0
  177. package/dist/errors-registry.js.map +1 -0
  178. package/dist/errors.d.ts +58 -0
  179. package/dist/errors.d.ts.map +1 -0
  180. package/dist/errors.js +30 -0
  181. package/dist/errors.js.map +1 -0
  182. package/dist/help.d.ts +6 -0
  183. package/dist/help.d.ts.map +1 -0
  184. package/dist/help.js +100 -0
  185. package/dist/help.js.map +1 -0
  186. package/dist/history.d.ts +15 -0
  187. package/dist/history.d.ts.map +1 -0
  188. package/dist/history.js +69 -0
  189. package/dist/history.js.map +1 -0
  190. package/dist/hubspot-auth.d.ts +53 -0
  191. package/dist/hubspot-auth.d.ts.map +1 -0
  192. package/dist/hubspot-auth.js +301 -0
  193. package/dist/hubspot-auth.js.map +1 -0
  194. package/dist/hubspot-developer-client.d.ts +10 -0
  195. package/dist/hubspot-developer-client.d.ts.map +1 -0
  196. package/dist/hubspot-developer-client.js +212 -0
  197. package/dist/hubspot-developer-client.js.map +1 -0
  198. package/dist/index.d.ts +5 -0
  199. package/dist/index.d.ts.map +1 -0
  200. package/dist/index.js +4 -0
  201. package/dist/index.js.map +1 -0
  202. package/dist/init/templates.d.ts +18 -0
  203. package/dist/init/templates.d.ts.map +1 -0
  204. package/dist/init/templates.js +239 -0
  205. package/dist/init/templates.js.map +1 -0
  206. package/dist/load-env.d.ts +16 -0
  207. package/dist/load-env.d.ts.map +1 -0
  208. package/dist/load-env.js +69 -0
  209. package/dist/load-env.js.map +1 -0
  210. package/dist/machine-id.d.ts +3 -0
  211. package/dist/machine-id.d.ts.map +1 -0
  212. package/dist/machine-id.js +41 -0
  213. package/dist/machine-id.js.map +1 -0
  214. package/dist/paths.d.ts +4 -0
  215. package/dist/paths.d.ts.map +1 -0
  216. package/dist/paths.js +19 -0
  217. package/dist/paths.js.map +1 -0
  218. package/dist/prompt.d.ts +43 -0
  219. package/dist/prompt.d.ts.map +1 -0
  220. package/dist/prompt.js +379 -0
  221. package/dist/prompt.js.map +1 -0
  222. package/dist/reporter/human.d.ts +28 -0
  223. package/dist/reporter/human.d.ts.map +1 -0
  224. package/dist/reporter/human.js +126 -0
  225. package/dist/reporter/human.js.map +1 -0
  226. package/dist/reporter/index.d.ts +14 -0
  227. package/dist/reporter/index.d.ts.map +1 -0
  228. package/dist/reporter/index.js +37 -0
  229. package/dist/reporter/index.js.map +1 -0
  230. package/dist/reporter/json.d.ts +43 -0
  231. package/dist/reporter/json.d.ts.map +1 -0
  232. package/dist/reporter/json.js +146 -0
  233. package/dist/reporter/json.js.map +1 -0
  234. package/dist/reporter/style.d.ts +34 -0
  235. package/dist/reporter/style.d.ts.map +1 -0
  236. package/dist/reporter/style.js +97 -0
  237. package/dist/reporter/style.js.map +1 -0
  238. package/dist/reporter/types.d.ts +41 -0
  239. package/dist/reporter/types.d.ts.map +1 -0
  240. package/dist/reporter/types.js +2 -0
  241. package/dist/reporter/types.js.map +1 -0
  242. package/dist/result.d.ts +4 -0
  243. package/dist/result.d.ts.map +1 -0
  244. package/dist/result.js +2 -0
  245. package/dist/result.js.map +1 -0
  246. package/dist/services/account-store.d.ts +31 -0
  247. package/dist/services/account-store.d.ts.map +1 -0
  248. package/dist/services/account-store.js +135 -0
  249. package/dist/services/account-store.js.map +1 -0
  250. package/dist/services/app-paths.d.ts +25 -0
  251. package/dist/services/app-paths.d.ts.map +1 -0
  252. package/dist/services/app-paths.js +34 -0
  253. package/dist/services/app-paths.js.map +1 -0
  254. package/dist/services/cloudflare-auth.d.ts +83 -0
  255. package/dist/services/cloudflare-auth.d.ts.map +1 -0
  256. package/dist/services/cloudflare-auth.js +30 -0
  257. package/dist/services/cloudflare-auth.js.map +1 -0
  258. package/dist/services/cloudflare-kv.d.ts +45 -0
  259. package/dist/services/cloudflare-kv.d.ts.map +1 -0
  260. package/dist/services/cloudflare-kv.js +151 -0
  261. package/dist/services/cloudflare-kv.js.map +1 -0
  262. package/dist/services/command-history.d.ts +29 -0
  263. package/dist/services/command-history.d.ts.map +1 -0
  264. package/dist/services/command-history.js +62 -0
  265. package/dist/services/command-history.js.map +1 -0
  266. package/dist/services/control-plane.d.ts +32 -0
  267. package/dist/services/control-plane.d.ts.map +1 -0
  268. package/dist/services/control-plane.js +57 -0
  269. package/dist/services/control-plane.js.map +1 -0
  270. package/dist/services/env-loader.d.ts +18 -0
  271. package/dist/services/env-loader.d.ts.map +1 -0
  272. package/dist/services/env-loader.js +34 -0
  273. package/dist/services/env-loader.js.map +1 -0
  274. package/dist/services/http.d.ts +19 -0
  275. package/dist/services/http.d.ts.map +1 -0
  276. package/dist/services/http.js +9 -0
  277. package/dist/services/http.js.map +1 -0
  278. package/dist/services/live.d.ts +16 -0
  279. package/dist/services/live.d.ts.map +1 -0
  280. package/dist/services/live.js +26 -0
  281. package/dist/services/live.js.map +1 -0
  282. package/dist/services/machine-id.d.ts +18 -0
  283. package/dist/services/machine-id.d.ts.map +1 -0
  284. package/dist/services/machine-id.js +39 -0
  285. package/dist/services/machine-id.js.map +1 -0
  286. package/dist/services/reporter.d.ts +55 -0
  287. package/dist/services/reporter.d.ts.map +1 -0
  288. package/dist/services/reporter.js +49 -0
  289. package/dist/services/reporter.js.map +1 -0
  290. package/dist/state-store.d.ts +39 -0
  291. package/dist/state-store.d.ts.map +1 -0
  292. package/dist/state-store.js +89 -0
  293. package/dist/state-store.js.map +1 -0
  294. package/dist/telemetry.d.ts +13 -0
  295. package/dist/telemetry.d.ts.map +1 -0
  296. package/dist/telemetry.js +129 -0
  297. package/dist/telemetry.js.map +1 -0
  298. package/dist/tenant-state.d.ts +69 -0
  299. package/dist/tenant-state.d.ts.map +1 -0
  300. package/dist/tenant-state.js +161 -0
  301. package/dist/tenant-state.js.map +1 -0
  302. package/package.json +38 -0
@@ -0,0 +1,554 @@
1
+ export const ERROR_REGISTRY = [
2
+ // Input errors (10–19)
3
+ {
4
+ code: 'HSX_E_INPUT_UNKNOWN_COMMAND',
5
+ title: 'Unknown command',
6
+ summary: "You ran `hs-x` with a verb it doesn't recognize.",
7
+ causes: ['Typo in the command name', 'Trying to use a command that was removed or renamed'],
8
+ fixes: [
9
+ 'Run `hs-x help` to see all commands',
10
+ 'Check the spelling — hs-x suggests the closest match',
11
+ ],
12
+ exitCode: 10,
13
+ },
14
+ {
15
+ code: 'HSX_E_INPUT_UNKNOWN_SUBCOMMAND',
16
+ title: 'Unknown subcommand',
17
+ summary: "The command exists but the subcommand you passed doesn't.",
18
+ causes: ['Typo in the subcommand'],
19
+ fixes: ['Run `hs-x <command> help` to see the supported subcommands'],
20
+ exitCode: 10,
21
+ },
22
+ {
23
+ code: 'HSX_E_INPUT_UNKNOWN_FLAG',
24
+ title: 'Unknown flag',
25
+ summary: "You passed a flag the command doesn't accept.",
26
+ causes: ['Typo', 'Flag renamed or removed'],
27
+ fixes: ['Run `hs-x <command> --help` to see supported flags'],
28
+ exitCode: 10,
29
+ },
30
+ {
31
+ code: 'HSX_E_INPUT_MISSING_VALUE',
32
+ title: 'Flag missing value',
33
+ summary: 'A flag that takes a value was passed without one.',
34
+ causes: ['Flag was the last token on the command line', 'Value got eaten by quoting'],
35
+ fixes: ['Pass the value: `--flag <value>`'],
36
+ exitCode: 10,
37
+ },
38
+ {
39
+ code: 'HSX_E_INPUT_MISSING_PATH',
40
+ title: 'Missing API path',
41
+ summary: '`hs-x api` was invoked without a path.',
42
+ causes: ['Forgot to pass the endpoint'],
43
+ fixes: ['Usage: `hs-x api <path>`', 'Example: `hs-x api v1/accounts/me`'],
44
+ exitCode: 10,
45
+ },
46
+ {
47
+ code: 'HSX_E_INPUT_MISSING_ACCOUNT_ID',
48
+ title: 'Missing account id',
49
+ summary: "A command that operates on an account couldn't determine which one.",
50
+ causes: [
51
+ 'No `--account-id` flag',
52
+ 'No `HSX_ACCOUNT_ID` env',
53
+ 'No default account in `$XDG_CONFIG_HOME/hs-x/config.json`',
54
+ ],
55
+ fixes: [
56
+ 'Run `hs-x accounts list` to see options',
57
+ 'Pass `--account-id <id>` or set `HSX_ACCOUNT_ID`',
58
+ 'Run `hs-x accounts switch <id>` to set a default',
59
+ ],
60
+ exitCode: 10,
61
+ },
62
+ {
63
+ code: 'HSX_E_INPUT_MISSING_PROJECT_ID',
64
+ title: 'Missing project id',
65
+ summary: 'A deploy command could not determine which HS-X project to operate on.',
66
+ causes: [
67
+ 'No `--project-id` flag',
68
+ 'No `HSX_PROJECT_ID` env',
69
+ 'No usable `name` in `hsx.config.ts`',
70
+ ],
71
+ fixes: [
72
+ 'Pass `--project-id <id>`',
73
+ 'Set `HSX_PROJECT_ID`',
74
+ 'Add a valid `name` to `hsx.config.ts`',
75
+ ],
76
+ exitCode: 10,
77
+ },
78
+ {
79
+ code: 'HSX_E_INPUT_INVALID_DEPLOY_PLAN',
80
+ title: 'Invalid deploy plan input',
81
+ summary: 'The CLI could not build a schema-valid deploy plan request.',
82
+ causes: [
83
+ 'Missing account or project identity',
84
+ 'Generated manifest shape did not match the type graph',
85
+ ],
86
+ fixes: [
87
+ 'Run `hs-x deploy --plan --json` and inspect the error detail',
88
+ 'Pass both `--account-id` and `--project-id` when deploying through the control plane',
89
+ ],
90
+ exitCode: 10,
91
+ },
92
+ {
93
+ code: 'HSX_E_INPUT_MISSING_PAK',
94
+ title: 'Missing HubSpot PAK',
95
+ summary: '`hs-x connect` needs a HubSpot personal access key.',
96
+ causes: [
97
+ 'No `--pak` flag',
98
+ 'No `HSX_HUBSPOT_PAK` env',
99
+ 'No PAK in HubSpot CLI config to auto-discover',
100
+ ],
101
+ fixes: [
102
+ 'Run `hs accounts auth` to authenticate via the HubSpot CLI',
103
+ 'Or pass `--pak <token>`',
104
+ 'Or run hs-x interactively to be prompted',
105
+ ],
106
+ exitCode: 10,
107
+ },
108
+ {
109
+ code: 'HSX_E_INPUT_MISSING_API_TOKEN',
110
+ title: 'Missing Cloudflare API token',
111
+ summary: '`hs-x connect cloudflare` needs an API token.',
112
+ causes: ['No `--api-token` flag', 'No `HSX_CLOUDFLARE_API_TOKEN` env'],
113
+ fixes: [
114
+ 'Run interactively to be guided through Cloudflare token creation',
115
+ 'Or pass `--api-token <token>`',
116
+ ],
117
+ exitCode: 10,
118
+ },
119
+ {
120
+ code: 'HSX_E_INPUT_NO_HSX_ACCOUNT',
121
+ title: 'No HS-X account exists',
122
+ summary: 'A command needs an HS-X account but none is configured.',
123
+ causes: ["Haven't run `hs-x connect` yet"],
124
+ fixes: ['Run `hs-x connect` to create your first HS-X account'],
125
+ exitCode: 10,
126
+ },
127
+ {
128
+ code: 'HSX_E_INPUT_BAD_FIELD',
129
+ title: 'Cannot parse field',
130
+ summary: "An httpie-style field on `hs-x api` couldn't be parsed.",
131
+ causes: ['Wrong separator (e.g. `:` where `=` was expected)'],
132
+ fixes: [
133
+ 'key=value (string)',
134
+ 'key:=value (typed JSON)',
135
+ 'key==value (query param)',
136
+ 'Header:Value (request header)',
137
+ ],
138
+ exitCode: 10,
139
+ },
140
+ {
141
+ code: 'HSX_E_INPUT_BAD_JSON',
142
+ title: 'Typed field is not valid JSON',
143
+ summary: "A `field:=value` argument value wasn't valid JSON.",
144
+ causes: [
145
+ 'Used `:=` for a string value (should be `=`)',
146
+ 'Missing quotes inside an object literal',
147
+ ],
148
+ fixes: [
149
+ 'For strings use `field=value`',
150
+ 'For JSON use real JSON: `archived:=true`, `tags:=\'["a","b"]\'`',
151
+ ],
152
+ exitCode: 10,
153
+ },
154
+ {
155
+ code: 'HSX_E_INPUT_BAD_NAME',
156
+ title: 'Invalid project name',
157
+ summary: 'The project name failed validation.',
158
+ causes: [
159
+ 'Contains characters other than letters, digits, dashes, or underscores',
160
+ 'Starts with a non-alphanumeric',
161
+ ],
162
+ fixes: ['Use letters, numbers, dashes, or underscores', 'Start with a letter or number'],
163
+ exitCode: 10,
164
+ },
165
+ // Init errors
166
+ {
167
+ code: 'HSX_E_INIT_DIR_NOT_EMPTY',
168
+ title: 'Project directory already exists',
169
+ summary: '`hs-x init` refused to overwrite an existing project.',
170
+ causes: ['You ran init in a directory that already has an hsx.config.ts'],
171
+ fixes: [
172
+ 'Pick a different name or directory',
173
+ 'Delete the existing one',
174
+ 'Pass `--force` to overwrite',
175
+ ],
176
+ exitCode: 10,
177
+ },
178
+ // Account store
179
+ {
180
+ code: 'HSX_E_ACCOUNT_NOT_FOUND',
181
+ title: 'HS-X account not found',
182
+ summary: 'No account with that id exists in `$XDG_CONFIG_HOME/hs-x/config.json`.',
183
+ causes: ['Typo in the account id', 'Account was previously removed'],
184
+ fixes: ['Run `hs-x accounts list` to see all accounts'],
185
+ exitCode: 10,
186
+ },
187
+ // API (HS-X control plane + HubSpot)
188
+ {
189
+ code: 'HSX_E_API_NO_CONTROL_PLANE',
190
+ title: 'No HS-X control plane configured',
191
+ summary: '`hs-x api` (HS-X target) had no base URL to call.',
192
+ causes: ['`HSX_CONTROL_PLANE_URL` not set', '`--base-url` not passed'],
193
+ fixes: [
194
+ 'Set `HSX_CONTROL_PLANE_URL`',
195
+ 'Or use `hs-x api hubspot <path>` to call HubSpot instead',
196
+ ],
197
+ exitCode: 10,
198
+ },
199
+ {
200
+ code: 'HSX_E_API_NO_HUBSPOT_AUTH',
201
+ title: 'No HubSpot API credential',
202
+ summary: '`hs-x api hubspot` needs a PAK or developer API key.',
203
+ causes: [
204
+ 'No `--pak` / `HSX_HUBSPOT_PAK`',
205
+ 'No `--developer-api-key` / `HSX_HUBSPOT_DEVELOPER_API_KEY`',
206
+ ],
207
+ fixes: ['Run `hs-x connect` to authenticate', 'Or pass a credential explicitly'],
208
+ exitCode: 10,
209
+ },
210
+ {
211
+ code: 'HSX_E_API_UNAUTHORIZED',
212
+ title: 'API rejected your credentials',
213
+ summary: '401 or 403 from HubSpot or HS-X.',
214
+ causes: [
215
+ 'PAK expired or revoked',
216
+ 'PAK lacks scope for this endpoint',
217
+ 'Per-portal CRM data (HubSpot)',
218
+ ],
219
+ fixes: ['Run `hs-x connect` to re-auth', 'Check the scopes on your app'],
220
+ exitCode: 10,
221
+ },
222
+ {
223
+ code: 'HSX_E_API_NOT_FOUND',
224
+ title: 'API resource not found',
225
+ summary: '404 from the upstream API.',
226
+ causes: ['Typo in the path', "Resource doesn't exist", 'Resource not shared with your PAK'],
227
+ fixes: ['Double-check the path', 'Re-run with `--debug` to see the wire request'],
228
+ exitCode: 50,
229
+ },
230
+ {
231
+ code: 'HSX_E_API_CONFLICT',
232
+ title: 'API conflict',
233
+ summary: '409 from the upstream API.',
234
+ causes: ['Concurrent modification', 'Precondition failed'],
235
+ fixes: ['Refetch and retry', 'Pass a force flag if the endpoint supports one'],
236
+ exitCode: 50,
237
+ },
238
+ {
239
+ code: 'HSX_E_API_RATE_LIMITED',
240
+ title: 'Rate limited',
241
+ summary: '429 from the upstream API.',
242
+ causes: ['Too many requests in a short window'],
243
+ fixes: ['Back off and retry', 'Consider increasing app rate limits in HubSpot'],
244
+ exitCode: 50,
245
+ },
246
+ {
247
+ code: 'HSX_E_API_BAD_REQUEST',
248
+ title: 'Bad request to the API',
249
+ summary: '4xx response other than the dedicated codes.',
250
+ causes: ['Bad request body shape', 'Missing required field'],
251
+ fixes: ['Re-run with `--debug` to see the response body'],
252
+ exitCode: 50,
253
+ },
254
+ {
255
+ code: 'HSX_E_API_SERVER',
256
+ title: 'Upstream server error',
257
+ summary: '5xx response from HubSpot or HS-X.',
258
+ causes: ['Transient upstream incident'],
259
+ fixes: ['Retry with backoff', 'Check the upstream status page'],
260
+ exitCode: 51,
261
+ },
262
+ {
263
+ code: 'HSX_E_API_NETWORK',
264
+ title: 'Network error',
265
+ summary: 'Request failed before reaching the upstream API.',
266
+ causes: ['DNS failure', 'Proxy misconfigured', 'TLS handshake failed', 'Wrong `--base-url`'],
267
+ fixes: ['Check connectivity', 'Verify your base URL', 'Check any HTTPS proxy env vars'],
268
+ exitCode: 40,
269
+ },
270
+ {
271
+ code: 'HSX_E_API_UNEXPECTED',
272
+ title: 'Unexpected API response',
273
+ summary: 'Upstream returned a status outside the expected 2xx/4xx/5xx ranges.',
274
+ causes: ['Bug', 'Unusual proxy in front of the API'],
275
+ fixes: ['Re-run with `--debug` and file an issue if it reproduces'],
276
+ exitCode: 50,
277
+ },
278
+ // Control-plane bearer session (hs-x login)
279
+ {
280
+ code: 'HSX_E_NOT_LOGGED_IN',
281
+ title: 'No HS-X session on this machine',
282
+ summary: 'A command tried to call the control plane without a stored bearer session.',
283
+ causes: ['`hs-x login` has not been run on this machine', 'Local session was cleared'],
284
+ fixes: ['Run `hs-x login` and complete the magic-link flow'],
285
+ exitCode: 10,
286
+ },
287
+ {
288
+ code: 'HSX_E_SESSION_EXPIRED',
289
+ title: 'HS-X session expired',
290
+ summary: 'The locally-stored bearer session has passed its expiresAt.',
291
+ causes: ['Sessions live ~30 days; this one timed out'],
292
+ fixes: ['Run `hs-x login` again to mint a new session'],
293
+ exitCode: 10,
294
+ },
295
+ // HubSpot PAK exchange
296
+ {
297
+ code: 'HSX_E_HUBSPOT_PAK_INVALID',
298
+ title: 'HubSpot PAK rejected',
299
+ summary: "HubSpot's PAK exchange endpoint returned 401/403.",
300
+ causes: ['PAK is wrong', 'PAK has expired', 'PAK was revoked'],
301
+ fixes: ['Generate a new PAK at https://app.hubspot.com/l/personal-access-key'],
302
+ exitCode: 10,
303
+ },
304
+ {
305
+ code: 'HSX_E_HUBSPOT_PAK_EXCHANGE',
306
+ title: 'HubSpot PAK exchange failed',
307
+ summary: 'HubSpot returned an unexpected response when exchanging the PAK.',
308
+ causes: ['HubSpot incident', 'Unexpected payload shape'],
309
+ fixes: ['Retry', 'Re-run with `--debug` to see the response'],
310
+ exitCode: 10,
311
+ },
312
+ // Dev session (UI extensions)
313
+ {
314
+ code: 'HSX_E_DEV_SESSION_NO_HUBSPOT_ACCOUNT',
315
+ title: 'HubSpot account not in CLI config',
316
+ summary: 'The HubSpot portal id is not registered in `~/.hscli/config.yml`.',
317
+ causes: ['You have not authenticated with the HubSpot CLI for this portal'],
318
+ fixes: ['Run `hs accounts auth` (HubSpot CLI) or `hs-x connect` to add the portal'],
319
+ exitCode: 10,
320
+ },
321
+ {
322
+ code: 'HSX_E_DEV_SESSION_NO_NODES',
323
+ title: 'No matching nodes in project IR',
324
+ summary: 'The selected component UIDs were not found in the project IR.',
325
+ causes: ['Stale node ids passed via flag', 'Project source has changed since the picker ran'],
326
+ fixes: ['Re-run `hs-x dev` to refresh the IR and re-select'],
327
+ exitCode: 10,
328
+ },
329
+ {
330
+ code: 'HSX_E_DEV_SESSION_REGISTER',
331
+ title: 'Dev session register failed',
332
+ summary: 'HubSpot did not return a sessionId from `dev-sessions/register`.',
333
+ causes: ['HubSpot API changed shape', 'Auth scope insufficient'],
334
+ fixes: ['Re-run with --debug to inspect', 'Run `hs-x doctor` to verify PAK validity'],
335
+ exitCode: 50,
336
+ },
337
+ {
338
+ code: 'HSX_E_CLOUDFLARED_MISSING',
339
+ title: 'cloudflared binary missing',
340
+ summary: '`hs-x dev` auto-manages a Cloudflare quick tunnel for telemetry, but the `cloudflared` binary is not on PATH.',
341
+ causes: ['cloudflared is not installed'],
342
+ fixes: [
343
+ 'Install from https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/',
344
+ 'On macOS: `brew install cloudflared`',
345
+ ],
346
+ exitCode: 50,
347
+ },
348
+ {
349
+ code: 'HSX_E_CLOUDFLARED_SPAWN',
350
+ title: 'cloudflared spawn failed',
351
+ summary: 'Found `cloudflared` but the process could not be spawned.',
352
+ causes: ['File-system permission denied', 'cloudflared binary is corrupted'],
353
+ fixes: ['Re-run `chmod +x` on the cloudflared binary', 'Reinstall cloudflared'],
354
+ exitCode: 50,
355
+ },
356
+ {
357
+ code: 'HSX_E_CLOUDFLARED_EXITED',
358
+ title: 'cloudflared exited before reporting a tunnel URL',
359
+ summary: 'The cloudflared subprocess exited before printing a trycloudflare.com URL.',
360
+ causes: ['Network outage', 'cloudflared was rejected by Cloudflare'],
361
+ fixes: ['Re-run with --debug to see the captured stderr', 'Try again in a minute'],
362
+ exitCode: 50,
363
+ },
364
+ {
365
+ code: 'HSX_E_CLOUDFLARED_TIMEOUT',
366
+ title: 'cloudflared did not report a tunnel URL in time',
367
+ summary: 'Timed out waiting for the auto-managed Cloudflare quick tunnel to come up.',
368
+ causes: ['Slow network', 'cloudflared stuck in a retry loop'],
369
+ fixes: ['Retry the command', 'Run `cloudflared tunnel --url http://localhost:9099` manually to diagnose'],
370
+ exitCode: 50,
371
+ },
372
+ // Cloudflare OAuth
373
+ {
374
+ code: 'HSX_E_CLOUDFLARE_OAUTH_NOT_CONFIGURED',
375
+ title: 'Cloudflare OAuth not configured',
376
+ summary: 'This build of HS-X does not have a Cloudflare OAuth client baked in.',
377
+ causes: [
378
+ '`HSX_CLOUDFLARE_OAUTH_CLIENT_ID` is not set',
379
+ 'You ran on a CI image without OAuth secrets',
380
+ ],
381
+ fixes: ['Set HSX_CLOUDFLARE_OAUTH_CLIENT_ID', 'Or use `--auth-method api-token`'],
382
+ exitCode: 10,
383
+ },
384
+ {
385
+ code: 'HSX_E_CLOUDFLARE_OAUTH_LISTENER',
386
+ title: 'OAuth callback listener failed',
387
+ summary: 'The local HTTP listener for the Cloudflare OAuth redirect could not start.',
388
+ causes: [
389
+ 'Another process is bound to the OAuth callback port',
390
+ 'Loopback interface unavailable',
391
+ ],
392
+ fixes: ['Pass `--oauth-port <port>` to pick another port', 'Stop the conflicting process'],
393
+ exitCode: 10,
394
+ },
395
+ {
396
+ code: 'HSX_E_CLOUDFLARE_OAUTH_TIMEOUT',
397
+ title: 'OAuth callback timed out',
398
+ summary: 'No OAuth callback arrived before the timeout.',
399
+ causes: [
400
+ 'User closed the browser before authorizing',
401
+ 'Network blocked the loopback redirect',
402
+ ],
403
+ fixes: [
404
+ 'Re-run `hs-x connect cloudflare --auth-method oauth`',
405
+ 'Increase `--oauth-timeout-ms`',
406
+ ],
407
+ exitCode: 10,
408
+ },
409
+ {
410
+ code: 'HSX_E_CLOUDFLARE_OAUTH_AUTHORIZE',
411
+ title: 'Cloudflare denied authorization',
412
+ summary: 'Cloudflare returned an error on the OAuth authorize callback.',
413
+ causes: ['User clicked deny', 'Bad scope', 'Misconfigured client_id'],
414
+ fixes: [
415
+ 'Retry and approve the requested scopes',
416
+ 'Verify `HSX_CLOUDFLARE_OAUTH_CLIENT_ID`',
417
+ ],
418
+ exitCode: 10,
419
+ },
420
+ {
421
+ code: 'HSX_E_CLOUDFLARE_OAUTH_STATE_MISMATCH',
422
+ title: 'OAuth state mismatch',
423
+ summary: 'The callback `state` did not match the value HS-X sent — possible CSRF.',
424
+ causes: [
425
+ 'Replay of an old callback URL',
426
+ 'Two concurrent OAuth flows on the same machine',
427
+ ],
428
+ fixes: [
429
+ 'Re-run `hs-x connect cloudflare --auth-method oauth` and use the newest browser tab',
430
+ ],
431
+ exitCode: 10,
432
+ },
433
+ {
434
+ code: 'HSX_E_CLOUDFLARE_OAUTH_EXCHANGE',
435
+ title: 'OAuth token exchange failed',
436
+ summary: 'Cloudflare rejected the authorization code exchange.',
437
+ causes: ['Code already used or expired', 'PKCE verifier mismatch', 'Client misconfigured'],
438
+ fixes: ['Re-run `hs-x connect cloudflare --auth-method oauth`'],
439
+ exitCode: 10,
440
+ },
441
+ {
442
+ code: 'HSX_E_CLOUDFLARE_OAUTH_REFRESH',
443
+ title: 'OAuth refresh failed',
444
+ summary: 'Cloudflare rejected the refresh-token exchange.',
445
+ causes: ['Refresh token revoked', 'Scopes changed since last connect'],
446
+ fixes: ['Re-run `hs-x connect cloudflare --auth-method oauth` to re-authorize'],
447
+ exitCode: 10,
448
+ },
449
+ // Cloudflare token
450
+ {
451
+ code: 'HSX_E_CLOUDFLARE_TOKEN_INVALID',
452
+ title: 'Cloudflare token rejected',
453
+ summary: "Cloudflare's `/user/tokens/verify` returned 401/403.",
454
+ causes: ['Token is wrong', 'Token has expired', 'Token was revoked'],
455
+ fixes: [
456
+ 'Generate a new token at https://dash.cloudflare.com/profile/api-tokens',
457
+ 'Make sure it has Workers Scripts:Edit, KV:Edit, D1:Edit, Queues:Edit',
458
+ ],
459
+ exitCode: 10,
460
+ },
461
+ {
462
+ code: 'HSX_E_CLOUDFLARE_TOKEN_VERIFY',
463
+ title: 'Cloudflare token verify failed',
464
+ summary: 'Cloudflare returned an unexpected response during verification.',
465
+ causes: ['Cloudflare incident', 'Token belongs to a different account scope'],
466
+ fixes: ['Retry', "Check Cloudflare's status page"],
467
+ exitCode: 10,
468
+ },
469
+ {
470
+ code: 'HSX_E_CLOUDFLARE_TOKEN_PERMISSIONS',
471
+ title: 'Cloudflare token is missing required permissions',
472
+ summary: 'The token verified but does not grant every permission group HS-X needs to deploy.',
473
+ causes: [
474
+ 'Token was created with a narrower permission template',
475
+ 'Required permission groups were removed from the token policy',
476
+ ],
477
+ fixes: [
478
+ 'Regenerate the token at https://dash.cloudflare.com/profile/api-tokens with the HS-X template',
479
+ 'Add the missing permission groups to the token policy',
480
+ ],
481
+ exitCode: 10,
482
+ },
483
+ {
484
+ code: 'HSX_E_LINK_REQUIRED',
485
+ title: 'Command requires a linked HS-X account',
486
+ summary: 'This command (promote, drift, audit, etc.) operates on control-plane state that only exists once the project is linked to an HS-X account.',
487
+ causes: ['Running an HS-X-managed command unlinked', 'Bearer session expired or cleared'],
488
+ fixes: [
489
+ 'Run `hs-x link` to attach this Cloudflare + HubSpot Developer account pair to an HS-X account',
490
+ 'Or pass `--control-plane-url <url>` explicitly if you are operating against a specific control plane for dev/test',
491
+ ],
492
+ exitCode: 10,
493
+ },
494
+ {
495
+ code: 'HSX_E_LINK_NO_POINTER',
496
+ title: 'Project has no Cloudflare pointer yet',
497
+ summary: '`hs-x link` was run in a project that has never been deployed.',
498
+ causes: [
499
+ '`.hs-x/cloudflare.json` is missing because the project has never run `hs-x deploy`',
500
+ 'The pointer file was deleted',
501
+ ],
502
+ fixes: [
503
+ 'Run `hs-x deploy` once to provision tenant state and the pointer',
504
+ 'Or `cd` to a project directory that has been deployed',
505
+ ],
506
+ exitCode: 10,
507
+ },
508
+ {
509
+ code: 'HSX_E_LINK_NOT_CLAIMABLE',
510
+ title: 'Project owner is already attached to a different HS-X account',
511
+ summary: 'The current `cloudflare.json` ownerId starts with `acct_`, meaning a prior link claim already attached it to an HS-X account. Re-claiming under a different account would silently rewrite cross-account state.',
512
+ causes: [
513
+ 'Project was previously linked to another HS-X account',
514
+ 'Pointer file was copied between projects',
515
+ ],
516
+ fixes: [
517
+ 'Run `hs-x unlink` to clear the session, then delete `.hs-x/cloudflare.json` to reset the local pointer',
518
+ 'Or contact support to transfer ownership between accounts',
519
+ ],
520
+ exitCode: 10,
521
+ },
522
+ {
523
+ code: 'HSX_E_INTERNAL',
524
+ title: 'Internal error',
525
+ summary: 'HS-X hit an unexpected internal failure — a bug or an unhandled edge case rather than something you did wrong.',
526
+ causes: [
527
+ 'A bug in the CLI',
528
+ 'An unexpected failure in an underlying operation (filesystem, parsing, or a wrapped error)',
529
+ ],
530
+ fixes: [
531
+ 'Re-run with `--json` and include the output in a bug report',
532
+ 'Check you are on the latest `hs-x` version',
533
+ ],
534
+ exitCode: 1,
535
+ },
536
+ {
537
+ code: 'HSX_E_INPUT_INVALID',
538
+ title: 'Invalid input',
539
+ summary: 'A value you supplied (a flag, environment variable, or argument) failed validation.',
540
+ causes: [
541
+ 'A malformed value such as a misformatted `HSX_MACHINE_ID`',
542
+ 'A flag or env var that does not match its required shape',
543
+ ],
544
+ fixes: [
545
+ 'Check the message — it names the offending value and the expected format',
546
+ 'Correct the value and re-run',
547
+ ],
548
+ exitCode: 10,
549
+ },
550
+ ];
551
+ export function getError(code) {
552
+ return ERROR_REGISTRY.find((e) => e.code === code);
553
+ }
554
+ //# sourceMappingURL=errors-registry.js.map
@@ -0,0 +1 @@
1
+ {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E,EAAE;KACb;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,gBAAgB;QACvB,OAAO,EACL,gHAAgH;QAClH,MAAM,EAAE;YACN,kBAAkB;YAClB,4FAA4F;SAC7F;QACD,KAAK,EAAE;YACL,6DAA6D;YAC7D,4CAA4C;SAC7C;QACD,QAAQ,EAAE,CAAC;KACZ;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,eAAe;QACtB,OAAO,EAAE,qFAAqF;QAC9F,MAAM,EAAE;YACN,2DAA2D;YAC3D,0DAA0D;SAC3D;QACD,KAAK,EAAE;YACL,0EAA0E;YAC1E,8BAA8B;SAC/B;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,58 @@
1
+ declare const OAuthListenerTimeout_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
2
+ readonly _tag: "OAuthListenerTimeout";
3
+ } & Readonly<A>;
4
+ export declare class OAuthListenerTimeout extends OAuthListenerTimeout_base<{
5
+ readonly timeoutMs: number;
6
+ }> {
7
+ }
8
+ declare const OAuthListenerBindFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
9
+ readonly _tag: "OAuthListenerBindFailed";
10
+ } & Readonly<A>;
11
+ export declare class OAuthListenerBindFailed extends OAuthListenerBindFailed_base<{
12
+ readonly cause: string;
13
+ }> {
14
+ }
15
+ declare const OAuthCallbackInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
16
+ readonly _tag: "OAuthCallbackInvalid";
17
+ } & Readonly<A>;
18
+ export declare class OAuthCallbackInvalid extends OAuthCallbackInvalid_base<{
19
+ readonly code: 'HSX_E_CLOUDFLARE_OAUTH_AUTHORIZE' | 'HSX_E_CLOUDFLARE_OAUTH_STATE_MISMATCH';
20
+ readonly message: string;
21
+ readonly detail: string;
22
+ }> {
23
+ }
24
+ declare const CloudflareTokenInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
25
+ readonly _tag: "CloudflareTokenInvalid";
26
+ } & Readonly<A>;
27
+ /** The token verification endpoint reported the token as invalid (401/403/success:false). */
28
+ export declare class CloudflareTokenInvalid extends CloudflareTokenInvalid_base<{
29
+ readonly detail: string;
30
+ }> {
31
+ }
32
+ declare const CloudflareTokenMissingPermissions_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
33
+ readonly _tag: "CloudflareTokenMissingPermissions";
34
+ } & Readonly<A>;
35
+ /**
36
+ * The token is valid but missing one or more required permission groups. Not
37
+ * raised by the current verification flow (callers compute the diff themselves
38
+ * to keep partial info available), but exposed for downstream guards that
39
+ * want a hard failure on incomplete tokens.
40
+ */
41
+ export declare class CloudflareTokenMissingPermissions extends CloudflareTokenMissingPermissions_base<{
42
+ readonly missing: readonly string[];
43
+ readonly detail: string;
44
+ }> {
45
+ }
46
+ declare const CloudflareAccountListFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
47
+ readonly _tag: "CloudflareAccountListFailed";
48
+ } & Readonly<A>;
49
+ /**
50
+ * The token verified but the listing endpoint indicates the caller cannot enumerate
51
+ * accounts. Surfaced as a soft warning by the caller — token info still returns.
52
+ */
53
+ export declare class CloudflareAccountListFailed extends CloudflareAccountListFailed_base<{
54
+ readonly detail: string;
55
+ }> {
56
+ }
57
+ export {};
58
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAEA,qBAAa,oBAAqB,SAAQ,0BAAyC;IACjF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;CAAG;;;;AAEL,qBAAa,uBAAwB,SAAQ,6BAA4C;IACvF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;CAAG;;;;AAEL,qBAAa,oBAAqB,SAAQ,0BAAyC;IACjF,QAAQ,CAAC,IAAI,EACT,kCAAkC,GAClC,uCAAuC,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;CAAG;;;;AAQL,6FAA6F;AAC7F,qBAAa,sBAAuB,SAAQ,4BAA2C;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;CAAG;;;;AAEL;;;;;GAKG;AACH,qBAAa,iCAAkC,SAAQ,uCAErD;IACA,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;CAAG;;;;AAEL;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,iCAAgD;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;CAAG"}
package/dist/errors.js ADDED
@@ -0,0 +1,30 @@
1
+ import { Data } from 'effect';
2
+ export class OAuthListenerTimeout extends Data.TaggedError('OAuthListenerTimeout') {
3
+ }
4
+ export class OAuthListenerBindFailed extends Data.TaggedError('OAuthListenerBindFailed') {
5
+ }
6
+ export class OAuthCallbackInvalid extends Data.TaggedError('OAuthCallbackInvalid') {
7
+ }
8
+ // --- Cloudflare API (token verification / introspection) ----------------------
9
+ //
10
+ // Tagged errors emitted by the Effect-based flow in `cloudflare-auth.ts`. The
11
+ // public Promise boundary maps these back to `CloudflareAuthError` so existing
12
+ // callers keep working unchanged.
13
+ /** The token verification endpoint reported the token as invalid (401/403/success:false). */
14
+ export class CloudflareTokenInvalid extends Data.TaggedError('CloudflareTokenInvalid') {
15
+ }
16
+ /**
17
+ * The token is valid but missing one or more required permission groups. Not
18
+ * raised by the current verification flow (callers compute the diff themselves
19
+ * to keep partial info available), but exposed for downstream guards that
20
+ * want a hard failure on incomplete tokens.
21
+ */
22
+ export class CloudflareTokenMissingPermissions extends Data.TaggedError('CloudflareTokenMissingPermissions') {
23
+ }
24
+ /**
25
+ * The token verified but the listing endpoint indicates the caller cannot enumerate
26
+ * accounts. Surfaced as a soft warning by the caller — token info still returns.
27
+ */
28
+ export class CloudflareAccountListFailed extends Data.TaggedError('CloudflareAccountListFailed') {
29
+ }
30
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,OAAO,oBAAqB,SAAQ,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAE/E;CAAG;AAEL,MAAM,OAAO,uBAAwB,SAAQ,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAErF;CAAG;AAEL,MAAM,OAAO,oBAAqB,SAAQ,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAM/E;CAAG;AAEL,iFAAiF;AACjF,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,kCAAkC;AAElC,6FAA6F;AAC7F,MAAM,OAAO,sBAAuB,SAAQ,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAEnF;CAAG;AAEL;;;;;GAKG;AACH,MAAM,OAAO,iCAAkC,SAAQ,IAAI,CAAC,WAAW,CACrE,mCAAmC,CAInC;CAAG;AAEL;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,IAAI,CAAC,WAAW,CAAC,6BAA6B,CAE7F;CAAG"}