bkper 3.8.0 → 4.0.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 (343) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/README.md +217 -183
  3. package/lib/auth/auth-page.d.ts +14 -0
  4. package/lib/auth/auth-page.d.ts.map +1 -0
  5. package/lib/auth/auth-page.js +110 -0
  6. package/lib/auth/auth-page.js.map +1 -0
  7. package/lib/auth/local-auth-service.d.ts.map +1 -1
  8. package/lib/auth/local-auth-service.js +135 -17
  9. package/lib/auth/local-auth-service.js.map +1 -1
  10. package/lib/bkper-factory.d.ts.map +1 -0
  11. package/lib/{mcp/bkper-factory.js → bkper-factory.js} +5 -2
  12. package/lib/bkper-factory.js.map +1 -0
  13. package/lib/cli.d.ts +1 -1
  14. package/lib/cli.d.ts.map +1 -1
  15. package/lib/cli.js +839 -67
  16. package/lib/cli.js.map +1 -1
  17. package/lib/commands/accounts/create.d.ts +10 -0
  18. package/lib/commands/accounts/create.d.ts.map +1 -0
  19. package/lib/commands/accounts/create.js +42 -0
  20. package/lib/commands/accounts/create.js.map +1 -0
  21. package/lib/commands/accounts/delete.d.ts +3 -0
  22. package/lib/commands/accounts/delete.d.ts.map +1 -0
  23. package/lib/commands/accounts/delete.js +22 -0
  24. package/lib/commands/accounts/delete.js.map +1 -0
  25. package/lib/commands/accounts/get.d.ts +3 -0
  26. package/lib/commands/accounts/get.d.ts.map +1 -0
  27. package/lib/commands/accounts/get.js +22 -0
  28. package/lib/commands/accounts/get.js.map +1 -0
  29. package/lib/commands/accounts/index.d.ts +6 -0
  30. package/lib/commands/accounts/index.d.ts.map +1 -0
  31. package/lib/commands/accounts/index.js +6 -0
  32. package/lib/commands/accounts/index.js.map +1 -0
  33. package/lib/commands/accounts/list.d.ts +3 -0
  34. package/lib/commands/accounts/list.d.ts.map +1 -0
  35. package/lib/commands/accounts/list.js +19 -0
  36. package/lib/commands/accounts/list.js.map +1 -0
  37. package/lib/commands/accounts/update.d.ts +9 -0
  38. package/lib/commands/accounts/update.d.ts.map +1 -0
  39. package/lib/commands/accounts/update.js +40 -0
  40. package/lib/commands/accounts/update.js.map +1 -0
  41. package/lib/commands/apps/build.d.ts +11 -0
  42. package/lib/commands/apps/build.d.ts.map +1 -0
  43. package/lib/commands/apps/build.js +144 -0
  44. package/lib/commands/apps/build.js.map +1 -0
  45. package/lib/commands/apps/bundler.d.ts +34 -0
  46. package/lib/commands/apps/bundler.d.ts.map +1 -0
  47. package/lib/commands/apps/bundler.js +112 -0
  48. package/lib/commands/apps/bundler.js.map +1 -0
  49. package/lib/commands/apps/config.d.ts +51 -0
  50. package/lib/commands/apps/config.d.ts.map +1 -0
  51. package/lib/commands/apps/config.js +146 -0
  52. package/lib/commands/apps/config.js.map +1 -0
  53. package/lib/commands/apps/deploy.d.ts +23 -0
  54. package/lib/commands/apps/deploy.d.ts.map +1 -0
  55. package/lib/commands/apps/deploy.js +344 -0
  56. package/lib/commands/apps/deploy.js.map +1 -0
  57. package/lib/commands/apps/dev.d.ts +28 -0
  58. package/lib/commands/apps/dev.d.ts.map +1 -0
  59. package/lib/commands/apps/dev.js +393 -0
  60. package/lib/commands/apps/dev.js.map +1 -0
  61. package/lib/commands/apps/index.d.ts +12 -0
  62. package/lib/commands/apps/index.d.ts.map +1 -0
  63. package/lib/commands/apps/index.js +24 -0
  64. package/lib/commands/apps/index.js.map +1 -0
  65. package/lib/commands/apps/init.d.ts +7 -0
  66. package/lib/commands/apps/init.d.ts.map +1 -0
  67. package/lib/commands/apps/init.js +249 -0
  68. package/lib/commands/apps/init.js.map +1 -0
  69. package/lib/commands/apps/install.d.ts +3 -0
  70. package/lib/commands/apps/install.d.ts.map +1 -0
  71. package/lib/commands/apps/install.js +18 -0
  72. package/lib/commands/apps/install.js.map +1 -0
  73. package/lib/commands/apps/list.d.ts +7 -0
  74. package/lib/commands/apps/list.d.ts.map +1 -0
  75. package/lib/commands/apps/list.js +23 -0
  76. package/lib/commands/apps/list.js.map +1 -0
  77. package/lib/commands/apps/secrets.d.ts +22 -0
  78. package/lib/commands/apps/secrets.d.ts.map +1 -0
  79. package/lib/commands/apps/secrets.js +209 -0
  80. package/lib/commands/apps/secrets.js.map +1 -0
  81. package/lib/commands/{apps.d.ts → apps/sync.d.ts} +8 -7
  82. package/lib/commands/apps/sync.d.ts.map +1 -0
  83. package/lib/commands/apps/sync.js +76 -0
  84. package/lib/commands/apps/sync.js.map +1 -0
  85. package/lib/commands/apps/types.d.ts +54 -0
  86. package/lib/commands/apps/types.d.ts.map +1 -0
  87. package/lib/commands/apps/types.js +2 -0
  88. package/lib/commands/apps/types.js.map +1 -0
  89. package/lib/commands/apps/uninstall.d.ts +3 -0
  90. package/lib/commands/apps/uninstall.d.ts.map +1 -0
  91. package/lib/commands/apps/uninstall.js +23 -0
  92. package/lib/commands/apps/uninstall.js.map +1 -0
  93. package/lib/commands/balances/get.d.ts +12 -0
  94. package/lib/commands/balances/get.d.ts.map +1 -0
  95. package/lib/commands/balances/get.js +32 -0
  96. package/lib/commands/balances/get.js.map +1 -0
  97. package/lib/commands/balances/index.d.ts +2 -0
  98. package/lib/commands/balances/index.d.ts.map +1 -0
  99. package/lib/commands/balances/index.js +2 -0
  100. package/lib/commands/balances/index.js.map +1 -0
  101. package/lib/commands/books/create.d.ts +12 -0
  102. package/lib/commands/books/create.d.ts.map +1 -0
  103. package/lib/commands/books/create.js +37 -0
  104. package/lib/commands/books/create.js.map +1 -0
  105. package/lib/commands/books/get.d.ts +3 -0
  106. package/lib/commands/books/get.d.ts.map +1 -0
  107. package/lib/commands/books/get.js +17 -0
  108. package/lib/commands/books/get.js.map +1 -0
  109. package/lib/commands/books/index.d.ts +5 -0
  110. package/lib/commands/books/index.d.ts.map +1 -0
  111. package/lib/commands/books/index.js +5 -0
  112. package/lib/commands/books/index.js.map +1 -0
  113. package/lib/commands/books/list.d.ts +3 -0
  114. package/lib/commands/books/list.d.ts.map +1 -0
  115. package/lib/commands/books/list.js +17 -0
  116. package/lib/commands/books/list.js.map +1 -0
  117. package/lib/commands/books/update.d.ts +14 -0
  118. package/lib/commands/books/update.d.ts.map +1 -0
  119. package/lib/commands/books/update.js +46 -0
  120. package/lib/commands/books/update.js.map +1 -0
  121. package/lib/commands/collections/add-book.d.ts +3 -0
  122. package/lib/commands/collections/add-book.d.ts.map +1 -0
  123. package/lib/commands/collections/add-book.js +27 -0
  124. package/lib/commands/collections/add-book.js.map +1 -0
  125. package/lib/commands/collections/create.d.ts +6 -0
  126. package/lib/commands/collections/create.d.ts.map +1 -0
  127. package/lib/commands/collections/create.js +19 -0
  128. package/lib/commands/collections/create.js.map +1 -0
  129. package/lib/commands/collections/delete.d.ts +3 -0
  130. package/lib/commands/collections/delete.d.ts.map +1 -0
  131. package/lib/commands/collections/delete.js +22 -0
  132. package/lib/commands/collections/delete.js.map +1 -0
  133. package/lib/commands/collections/get.d.ts +3 -0
  134. package/lib/commands/collections/get.d.ts.map +1 -0
  135. package/lib/commands/collections/get.js +22 -0
  136. package/lib/commands/collections/get.js.map +1 -0
  137. package/lib/commands/collections/index.d.ts +8 -0
  138. package/lib/commands/collections/index.d.ts.map +1 -0
  139. package/lib/commands/collections/index.js +8 -0
  140. package/lib/commands/collections/index.js.map +1 -0
  141. package/lib/commands/collections/list.d.ts +3 -0
  142. package/lib/commands/collections/list.d.ts.map +1 -0
  143. package/lib/commands/collections/list.js +18 -0
  144. package/lib/commands/collections/list.js.map +1 -0
  145. package/lib/commands/collections/remove-book.d.ts +3 -0
  146. package/lib/commands/collections/remove-book.d.ts.map +1 -0
  147. package/lib/commands/collections/remove-book.js +27 -0
  148. package/lib/commands/collections/remove-book.js.map +1 -0
  149. package/lib/commands/collections/update.d.ts +6 -0
  150. package/lib/commands/collections/update.d.ts.map +1 -0
  151. package/lib/commands/collections/update.js +24 -0
  152. package/lib/commands/collections/update.js.map +1 -0
  153. package/lib/commands/groups/create.d.ts +9 -0
  154. package/lib/commands/groups/create.d.ts.map +1 -0
  155. package/lib/commands/groups/create.js +40 -0
  156. package/lib/commands/groups/create.js.map +1 -0
  157. package/lib/commands/groups/delete.d.ts +3 -0
  158. package/lib/commands/groups/delete.d.ts.map +1 -0
  159. package/lib/commands/groups/delete.js +22 -0
  160. package/lib/commands/groups/delete.js.map +1 -0
  161. package/lib/commands/groups/get.d.ts +3 -0
  162. package/lib/commands/groups/get.d.ts.map +1 -0
  163. package/lib/commands/groups/get.js +22 -0
  164. package/lib/commands/groups/get.js.map +1 -0
  165. package/lib/commands/groups/index.d.ts +6 -0
  166. package/lib/commands/groups/index.d.ts.map +1 -0
  167. package/lib/commands/groups/index.js +6 -0
  168. package/lib/commands/groups/index.js.map +1 -0
  169. package/lib/commands/groups/list.d.ts +3 -0
  170. package/lib/commands/groups/list.d.ts.map +1 -0
  171. package/lib/commands/groups/list.js +19 -0
  172. package/lib/commands/groups/list.js.map +1 -0
  173. package/lib/commands/groups/update.d.ts +8 -0
  174. package/lib/commands/groups/update.d.ts.map +1 -0
  175. package/lib/commands/groups/update.js +38 -0
  176. package/lib/commands/groups/update.js.map +1 -0
  177. package/lib/commands/skills.d.ts +17 -0
  178. package/lib/commands/skills.d.ts.map +1 -0
  179. package/lib/commands/skills.js +248 -0
  180. package/lib/commands/skills.js.map +1 -0
  181. package/lib/commands/transactions/check.d.ts +3 -0
  182. package/lib/commands/transactions/check.d.ts.map +1 -0
  183. package/lib/commands/transactions/check.js +22 -0
  184. package/lib/commands/transactions/check.js.map +1 -0
  185. package/lib/commands/transactions/create.d.ts +13 -0
  186. package/lib/commands/transactions/create.d.ts.map +1 -0
  187. package/lib/commands/transactions/create.js +55 -0
  188. package/lib/commands/transactions/create.js.map +1 -0
  189. package/lib/commands/transactions/index.d.ts +8 -0
  190. package/lib/commands/transactions/index.d.ts.map +1 -0
  191. package/lib/commands/transactions/index.js +8 -0
  192. package/lib/commands/transactions/index.js.map +1 -0
  193. package/lib/commands/transactions/list.d.ts +14 -0
  194. package/lib/commands/transactions/list.d.ts.map +1 -0
  195. package/lib/commands/transactions/list.js +26 -0
  196. package/lib/commands/transactions/list.js.map +1 -0
  197. package/lib/commands/transactions/merge.d.ts +8 -0
  198. package/lib/commands/transactions/merge.d.ts.map +1 -0
  199. package/lib/commands/transactions/merge.js +44 -0
  200. package/lib/commands/transactions/merge.js.map +1 -0
  201. package/lib/commands/transactions/post.d.ts +3 -0
  202. package/lib/commands/transactions/post.d.ts.map +1 -0
  203. package/lib/commands/transactions/post.js +22 -0
  204. package/lib/commands/transactions/post.js.map +1 -0
  205. package/lib/commands/transactions/trash.d.ts +3 -0
  206. package/lib/commands/transactions/trash.d.ts.map +1 -0
  207. package/lib/commands/transactions/trash.js +22 -0
  208. package/lib/commands/transactions/trash.js.map +1 -0
  209. package/lib/commands/transactions/update.d.ts +12 -0
  210. package/lib/commands/transactions/update.d.ts.map +1 -0
  211. package/lib/commands/transactions/update.js +53 -0
  212. package/lib/commands/transactions/update.js.map +1 -0
  213. package/lib/dev/auth-middleware.d.ts +18 -0
  214. package/lib/dev/auth-middleware.d.ts.map +1 -0
  215. package/lib/dev/auth-middleware.js +113 -0
  216. package/lib/dev/auth-middleware.js.map +1 -0
  217. package/lib/dev/cleanup.d.ts +10 -0
  218. package/lib/dev/cleanup.d.ts.map +1 -0
  219. package/lib/dev/cleanup.js +36 -0
  220. package/lib/dev/cleanup.js.map +1 -0
  221. package/lib/dev/cloudflared/constants.d.ts +35 -0
  222. package/lib/dev/cloudflared/constants.d.ts.map +1 -0
  223. package/lib/dev/cloudflared/constants.js +48 -0
  224. package/lib/dev/cloudflared/constants.js.map +1 -0
  225. package/lib/dev/cloudflared/index.d.ts +11 -0
  226. package/lib/dev/cloudflared/index.d.ts.map +1 -0
  227. package/lib/dev/cloudflared/index.js +10 -0
  228. package/lib/dev/cloudflared/index.js.map +1 -0
  229. package/lib/dev/cloudflared/install.d.ts +15 -0
  230. package/lib/dev/cloudflared/install.d.ts.map +1 -0
  231. package/lib/dev/cloudflared/install.js +140 -0
  232. package/lib/dev/cloudflared/install.js.map +1 -0
  233. package/lib/dev/cloudflared/tunnel.d.ts +64 -0
  234. package/lib/dev/cloudflared/tunnel.d.ts.map +1 -0
  235. package/lib/dev/cloudflared/tunnel.js +109 -0
  236. package/lib/dev/cloudflared/tunnel.js.map +1 -0
  237. package/lib/dev/esbuild.d.ts +28 -0
  238. package/lib/dev/esbuild.d.ts.map +1 -0
  239. package/lib/dev/esbuild.js +83 -0
  240. package/lib/dev/esbuild.js.map +1 -0
  241. package/lib/dev/logger.d.ts +51 -0
  242. package/lib/dev/logger.d.ts.map +1 -0
  243. package/lib/dev/logger.js +102 -0
  244. package/lib/dev/logger.js.map +1 -0
  245. package/lib/dev/miniflare.d.ts +32 -0
  246. package/lib/dev/miniflare.d.ts.map +1 -0
  247. package/lib/dev/miniflare.js +111 -0
  248. package/lib/dev/miniflare.js.map +1 -0
  249. package/lib/dev/preflight.d.ts +7 -0
  250. package/lib/dev/preflight.d.ts.map +1 -0
  251. package/lib/dev/preflight.js +61 -0
  252. package/lib/dev/preflight.js.map +1 -0
  253. package/lib/dev/shared.d.ts +7 -0
  254. package/lib/dev/shared.d.ts.map +1 -0
  255. package/lib/dev/shared.js +99 -0
  256. package/lib/dev/shared.js.map +1 -0
  257. package/lib/dev/tunnel.d.ts +31 -0
  258. package/lib/dev/tunnel.d.ts.map +1 -0
  259. package/lib/dev/tunnel.js +110 -0
  260. package/lib/dev/tunnel.js.map +1 -0
  261. package/lib/dev/types.d.ts +53 -0
  262. package/lib/dev/types.d.ts.map +1 -0
  263. package/lib/dev/types.js +223 -0
  264. package/lib/dev/types.js.map +1 -0
  265. package/lib/dev/vite.d.ts +50 -0
  266. package/lib/dev/vite.d.ts.map +1 -0
  267. package/lib/dev/vite.js +114 -0
  268. package/lib/dev/vite.js.map +1 -0
  269. package/lib/dev/webhook-dev.d.ts +9 -0
  270. package/lib/dev/webhook-dev.d.ts.map +1 -0
  271. package/lib/dev/webhook-dev.js +28 -0
  272. package/lib/dev/webhook-dev.js.map +1 -0
  273. package/lib/domain/transaction/merge-operation.d.ts.map +1 -0
  274. package/lib/{mcp/domain → domain}/transaction/merge-operation.js +10 -11
  275. package/lib/domain/transaction/merge-operation.js.map +1 -0
  276. package/lib/domain/transaction/merge-types.d.ts.map +1 -0
  277. package/lib/domain/transaction/merge-types.js.map +1 -0
  278. package/lib/index.d.ts.map +1 -1
  279. package/lib/index.js.map +1 -1
  280. package/lib/platform/client.d.ts +37 -0
  281. package/lib/platform/client.d.ts.map +1 -0
  282. package/lib/platform/client.js +37 -0
  283. package/lib/platform/client.js.map +1 -0
  284. package/lib/render/index.d.ts +3 -0
  285. package/lib/render/index.d.ts.map +1 -0
  286. package/lib/render/index.js +3 -0
  287. package/lib/render/index.js.map +1 -0
  288. package/lib/render/output.d.ts +15 -0
  289. package/lib/render/output.d.ts.map +1 -0
  290. package/lib/render/output.js +30 -0
  291. package/lib/render/output.js.map +1 -0
  292. package/lib/render/table-formatter.d.ts +34 -0
  293. package/lib/render/table-formatter.d.ts.map +1 -0
  294. package/lib/render/table-formatter.js +221 -0
  295. package/lib/render/table-formatter.js.map +1 -0
  296. package/lib/utils/properties.d.ts +12 -0
  297. package/lib/utils/properties.d.ts.map +1 -0
  298. package/lib/utils/properties.js +23 -0
  299. package/lib/utils/properties.js.map +1 -0
  300. package/package.json +23 -22
  301. package/lib/auth/keys.json +0 -12
  302. package/lib/commands/apps.d.ts.map +0 -1
  303. package/lib/commands/apps.js +0 -93
  304. package/lib/commands/apps.js.map +0 -1
  305. package/lib/mcp/bkper-factory.d.ts.map +0 -1
  306. package/lib/mcp/bkper-factory.js.map +0 -1
  307. package/lib/mcp/domain/transaction/merge-operation.d.ts.map +0 -1
  308. package/lib/mcp/domain/transaction/merge-operation.js.map +0 -1
  309. package/lib/mcp/domain/transaction/merge-types.d.ts.map +0 -1
  310. package/lib/mcp/domain/transaction/merge-types.js.map +0 -1
  311. package/lib/mcp/server.d.ts +0 -13
  312. package/lib/mcp/server.d.ts.map +0 -1
  313. package/lib/mcp/server.js +0 -161
  314. package/lib/mcp/server.js.map +0 -1
  315. package/lib/mcp/system-prompt.md +0 -192
  316. package/lib/mcp/tools/create_transactions.d.ts +0 -59
  317. package/lib/mcp/tools/create_transactions.d.ts.map +0 -1
  318. package/lib/mcp/tools/create_transactions.js +0 -163
  319. package/lib/mcp/tools/create_transactions.js.map +0 -1
  320. package/lib/mcp/tools/get_balances.d.ts +0 -26
  321. package/lib/mcp/tools/get_balances.d.ts.map +0 -1
  322. package/lib/mcp/tools/get_balances.js +0 -106
  323. package/lib/mcp/tools/get_balances.js.map +0 -1
  324. package/lib/mcp/tools/get_book.d.ts +0 -21
  325. package/lib/mcp/tools/get_book.d.ts.map +0 -1
  326. package/lib/mcp/tools/get_book.js +0 -126
  327. package/lib/mcp/tools/get_book.js.map +0 -1
  328. package/lib/mcp/tools/list_books.d.ts +0 -21
  329. package/lib/mcp/tools/list_books.d.ts.map +0 -1
  330. package/lib/mcp/tools/list_books.js +0 -67
  331. package/lib/mcp/tools/list_books.js.map +0 -1
  332. package/lib/mcp/tools/list_transactions.d.ts +0 -38
  333. package/lib/mcp/tools/list_transactions.d.ts.map +0 -1
  334. package/lib/mcp/tools/list_transactions.js +0 -109
  335. package/lib/mcp/tools/list_transactions.js.map +0 -1
  336. package/lib/mcp/tools/merge_transactions.d.ts +0 -40
  337. package/lib/mcp/tools/merge_transactions.d.ts.map +0 -1
  338. package/lib/mcp/tools/merge_transactions.js +0 -120
  339. package/lib/mcp/tools/merge_transactions.js.map +0 -1
  340. /package/lib/{mcp/bkper-factory.d.ts → bkper-factory.d.ts} +0 -0
  341. /package/lib/{mcp/domain → domain}/transaction/merge-operation.d.ts +0 -0
  342. /package/lib/{mcp/domain → domain}/transaction/merge-types.d.ts +0 -0
  343. /package/lib/{mcp/domain → domain}/transaction/merge-types.js +0 -0
@@ -0,0 +1,53 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { getBkperInstance } from '../../bkper-factory.js';
11
+ import { parsePropertyFlag } from '../../utils/properties.js';
12
+ export function updateTransaction(bookId, transactionId, options) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ const bkper = getBkperInstance();
15
+ const book = yield bkper.getBook(bookId);
16
+ const transaction = yield book.getTransaction(transactionId);
17
+ if (!transaction) {
18
+ throw new Error(`Transaction not found: ${transactionId}`);
19
+ }
20
+ if (options.date !== undefined)
21
+ transaction.setDate(options.date);
22
+ if (options.amount !== undefined)
23
+ transaction.setAmount(options.amount);
24
+ if (options.description !== undefined)
25
+ transaction.setDescription(options.description);
26
+ if (options.from !== undefined) {
27
+ const creditAccount = yield book.getAccount(options.from);
28
+ if (creditAccount)
29
+ transaction.setCreditAccount(creditAccount);
30
+ }
31
+ if (options.to !== undefined) {
32
+ const debitAccount = yield book.getAccount(options.to);
33
+ if (debitAccount)
34
+ transaction.setDebitAccount(debitAccount);
35
+ }
36
+ if (options.url !== undefined) {
37
+ transaction.setUrls(options.url);
38
+ }
39
+ if (options.property) {
40
+ for (const raw of options.property) {
41
+ const [key, value] = parsePropertyFlag(raw);
42
+ if (value === '') {
43
+ transaction.deleteProperty(key);
44
+ }
45
+ else {
46
+ transaction.setProperty(key, value);
47
+ }
48
+ }
49
+ }
50
+ return transaction.update();
51
+ });
52
+ }
53
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/transactions/update.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,E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,GAAG,KAAK,SAAS,EAAE,CAAC;YAC5B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACnB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACjC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;gBAC5C,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;oBACf,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC;qBAAM,CAAC;oBACJ,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACxC,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,WAAW,CAAC,MAAM,EAAE,CAAC;IAChC,CAAC;CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { Connect } from 'vite';
2
+ /**
3
+ * Creates Vite middleware that handles /auth/refresh requests.
4
+ *
5
+ * This middleware intercepts POST /auth/refresh requests and returns
6
+ * an access token from the CLI's stored credentials, allowing web
7
+ * clients to authenticate during local development without needing
8
+ * to set up session cookies or connect to production auth servers.
9
+ *
10
+ * Response format matches production:
11
+ * - 200: { userId: string, accessToken: string }
12
+ * - 401: { error: string } - when not logged in
13
+ * - 500: { error: string } - on unexpected errors
14
+ *
15
+ * @returns Vite/Connect middleware function
16
+ */
17
+ export declare function createAuthMiddleware(): Connect.NextHandleFunction;
18
+ //# sourceMappingURL=auth-middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-middleware.d.ts","sourceRoot":"","sources":["../../src/dev/auth-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAoEpC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAAC,kBAAkB,CAuCjE"}
@@ -0,0 +1,113 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { isLoggedIn, getOAuthToken } from '../auth/local-auth-service.js';
11
+ /**
12
+ * Decodes a JWT token and extracts the payload.
13
+ * Does NOT verify the signature - only extracts the payload.
14
+ *
15
+ * @param token - JWT token string
16
+ * @returns Decoded payload object or null if invalid
17
+ */
18
+ function decodeJwtPayload(token) {
19
+ try {
20
+ const parts = token.split('.');
21
+ if (parts.length !== 3)
22
+ return null;
23
+ const payload = parts[1];
24
+ // JWT uses base64url encoding
25
+ const decoded = Buffer.from(payload, 'base64url').toString('utf8');
26
+ return JSON.parse(decoded);
27
+ }
28
+ catch (_a) {
29
+ return null;
30
+ }
31
+ }
32
+ /**
33
+ * Extracts user ID (email) from Google OAuth credentials.
34
+ * The id_token is a JWT containing the user's email in the 'email' claim.
35
+ *
36
+ * @param accessToken - OAuth access token (not used for extraction, but triggers refresh)
37
+ * @returns User ID (email) or 'unknown' if extraction fails
38
+ */
39
+ function extractUserId() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ // Read stored credentials to get id_token
42
+ // The id_token contains user info as JWT claims
43
+ try {
44
+ const fs = yield import('fs');
45
+ const os = yield import('os');
46
+ const credentialsPath = `${os.homedir()}/.config/bkper/.bkper-credentials.json`;
47
+ const credentials = JSON.parse(fs.readFileSync(credentialsPath, 'utf8'));
48
+ if (credentials.id_token) {
49
+ const payload = decodeJwtPayload(credentials.id_token);
50
+ if (payload && typeof payload.email === 'string') {
51
+ return payload.email;
52
+ }
53
+ }
54
+ }
55
+ catch (_a) {
56
+ // Fall through to unknown
57
+ }
58
+ return 'unknown';
59
+ });
60
+ }
61
+ /**
62
+ * Creates Vite middleware that handles /auth/refresh requests.
63
+ *
64
+ * This middleware intercepts POST /auth/refresh requests and returns
65
+ * an access token from the CLI's stored credentials, allowing web
66
+ * clients to authenticate during local development without needing
67
+ * to set up session cookies or connect to production auth servers.
68
+ *
69
+ * Response format matches production:
70
+ * - 200: { userId: string, accessToken: string }
71
+ * - 401: { error: string } - when not logged in
72
+ * - 500: { error: string } - on unexpected errors
73
+ *
74
+ * @returns Vite/Connect middleware function
75
+ */
76
+ export function createAuthMiddleware() {
77
+ return (req, res, next) => __awaiter(this, void 0, void 0, function* () {
78
+ // Only handle POST /auth/refresh
79
+ if (req.url !== '/auth/refresh' || req.method !== 'POST') {
80
+ next();
81
+ return;
82
+ }
83
+ res.setHeader('Content-Type', 'application/json');
84
+ // Check if user is logged in to CLI
85
+ if (!isLoggedIn()) {
86
+ res.statusCode = 401;
87
+ const errorResponse = {
88
+ error: 'Not logged in. Run: bkper login',
89
+ };
90
+ res.end(JSON.stringify(errorResponse));
91
+ return;
92
+ }
93
+ try {
94
+ // Get fresh access token (auto-refreshes if expired)
95
+ const accessToken = yield getOAuthToken();
96
+ const userId = yield extractUserId();
97
+ const response = {
98
+ userId,
99
+ accessToken,
100
+ };
101
+ res.statusCode = 200;
102
+ res.end(JSON.stringify(response));
103
+ }
104
+ catch (err) {
105
+ res.statusCode = 500;
106
+ const errorResponse = {
107
+ error: err instanceof Error ? err.message : 'Failed to get access token',
108
+ };
109
+ res.end(JSON.stringify(errorResponse));
110
+ }
111
+ });
112
+ }
113
+ //# sourceMappingURL=auth-middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-middleware.js","sourceRoot":"","sources":["../../src/dev/auth-middleware.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,M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C3C,CAAC;IACL,CAAC,CAAA,CAAC;AACN,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface CleanupStepOptions {
2
+ label: string;
3
+ timeoutMs: number;
4
+ action: () => Promise<void>;
5
+ }
6
+ /**
7
+ * Runs a cleanup step with timeout. Throws on timeout or failure.
8
+ */
9
+ export declare function runCleanupStep(options: CleanupStepOptions): Promise<void>;
10
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../src/dev/cleanup.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB/E"}
@@ -0,0 +1,36 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ /**
11
+ * Runs a cleanup step with timeout. Throws on timeout or failure.
12
+ */
13
+ export function runCleanupStep(options) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ const { label, timeoutMs, action } = options;
16
+ let timeoutId;
17
+ const timeoutPromise = new Promise((_resolve, reject) => {
18
+ timeoutId = setTimeout(() => {
19
+ reject(new Error(`${label} cleanup timed out`));
20
+ }, timeoutMs);
21
+ });
22
+ try {
23
+ yield Promise.race([action(), timeoutPromise]);
24
+ }
25
+ catch (err) {
26
+ const message = err instanceof Error ? err.message : String(err);
27
+ throw new Error(`${label}: ${message}`);
28
+ }
29
+ finally {
30
+ if (timeoutId) {
31
+ clearTimeout(timeoutId);
32
+ }
33
+ }
34
+ });
35
+ }
36
+ //# sourceMappingURL=cleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../src/dev/cleanup.ts"],"names":[],"mappings":";;;;;;;;;AAMA;;GAEG;AACH,MAAM,UAAgB,cAAc,CAAC,OAA2B;;QAC5D,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAE7C,IAAI,SAAoD,CAAC;QACzD,MAAM,cAAc,GAAG,IAAI,OAAO,CAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YAC1D,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBACxB,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAC,CAAC;YACpD,CAAC,EAAE,SAAS,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC;YACD,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC;QAC5C,CAAC;gBAAS,CAAC;YACP,IAAI,SAAS,EAAE,CAAC;gBACZ,YAAY,CAAC,SAAS,CAAC,CAAC;YAC5B,CAAC;QACL,CAAC;IACL,CAAC;CAAA"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Directory where bkper stores configuration and binaries.
3
+ * Uses ~/.config/bkper on Unix-like systems.
4
+ */
5
+ export declare const BKPER_CONFIG_DIR: string;
6
+ /**
7
+ * Directory for bkper-managed binaries.
8
+ */
9
+ export declare const BKPER_BIN_DIR: string;
10
+ /**
11
+ * Default path to the cloudflared binary.
12
+ */
13
+ export declare const DEFAULT_CLOUDFLARED_BIN: string;
14
+ /**
15
+ * Path to the cloudflared binary.
16
+ * Can be overridden with CLOUDFLARED_BIN environment variable.
17
+ */
18
+ export declare const bin: string;
19
+ /**
20
+ * Base URL for cloudflared releases on GitHub.
21
+ */
22
+ export declare const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
23
+ /**
24
+ * Download URLs for Linux by architecture.
25
+ */
26
+ export declare const LINUX_BINARIES: Partial<Record<string, string>>;
27
+ /**
28
+ * Download URLs for macOS by architecture.
29
+ */
30
+ export declare const MACOS_BINARIES: Partial<Record<string, string>>;
31
+ /**
32
+ * Download URLs for Windows by architecture.
33
+ */
34
+ export declare const WINDOWS_BINARIES: Partial<Record<string, string>>;
35
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/dev/cloudflared/constants.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAA8C,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,aAAa,QAAqC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAGnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,GAAG,QAAyD,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,YAAY,wDAAwD,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAK1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAG1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAG5D,CAAC"}
@@ -0,0 +1,48 @@
1
+ import path from 'path';
2
+ import os from 'os';
3
+ /**
4
+ * Directory where bkper stores configuration and binaries.
5
+ * Uses ~/.config/bkper on Unix-like systems.
6
+ */
7
+ export const BKPER_CONFIG_DIR = path.join(os.homedir(), '.config', 'bkper');
8
+ /**
9
+ * Directory for bkper-managed binaries.
10
+ */
11
+ export const BKPER_BIN_DIR = path.join(BKPER_CONFIG_DIR, 'bin');
12
+ /**
13
+ * Default path to the cloudflared binary.
14
+ */
15
+ export const DEFAULT_CLOUDFLARED_BIN = path.join(BKPER_BIN_DIR, process.platform === 'win32' ? 'cloudflared.exe' : 'cloudflared');
16
+ /**
17
+ * Path to the cloudflared binary.
18
+ * Can be overridden with CLOUDFLARED_BIN environment variable.
19
+ */
20
+ export const bin = process.env.CLOUDFLARED_BIN || DEFAULT_CLOUDFLARED_BIN;
21
+ /**
22
+ * Base URL for cloudflared releases on GitHub.
23
+ */
24
+ export const RELEASE_BASE = 'https://github.com/cloudflare/cloudflared/releases/';
25
+ /**
26
+ * Download URLs for Linux by architecture.
27
+ */
28
+ export const LINUX_BINARIES = {
29
+ arm64: 'cloudflared-linux-arm64',
30
+ arm: 'cloudflared-linux-arm',
31
+ x64: 'cloudflared-linux-amd64',
32
+ ia32: 'cloudflared-linux-386',
33
+ };
34
+ /**
35
+ * Download URLs for macOS by architecture.
36
+ */
37
+ export const MACOS_BINARIES = {
38
+ arm64: 'cloudflared-darwin-arm64.tgz',
39
+ x64: 'cloudflared-darwin-amd64.tgz',
40
+ };
41
+ /**
42
+ * Download URLs for Windows by architecture.
43
+ */
44
+ export const WINDOWS_BINARIES = {
45
+ x64: 'cloudflared-windows-amd64.exe',
46
+ ia32: 'cloudflared-windows-386.exe',
47
+ };
48
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dev/cloudflared/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,IAAI,CAC5C,aAAa,EACb,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CACnE,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,qDAAqD,CAAC;AAElF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAoC;IAC3D,KAAK,EAAE,yBAAyB;IAChC,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,yBAAyB;IAC9B,IAAI,EAAE,uBAAuB;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAoC;IAC3D,KAAK,EAAE,8BAA8B;IACrC,GAAG,EAAE,8BAA8B;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoC;IAC7D,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,6BAA6B;CACtC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Cloudflared tunnel management for local development.
3
+ *
4
+ * This module provides a programmatic interface to cloudflared Quick Tunnels,
5
+ * with lazy binary download on first use.
6
+ */
7
+ export { bin, DEFAULT_CLOUDFLARED_BIN, BKPER_BIN_DIR } from './constants.js';
8
+ export { install, UnsupportedPlatformError } from './install.js';
9
+ export { Tunnel } from './tunnel.js';
10
+ export type { Connection, TunnelEvents } from './tunnel.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dev/cloudflared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Cloudflared tunnel management for local development.
3
+ *
4
+ * This module provides a programmatic interface to cloudflared Quick Tunnels,
5
+ * with lazy binary download on first use.
6
+ */
7
+ export { bin, DEFAULT_CLOUDFLARED_BIN, BKPER_BIN_DIR } from './constants.js';
8
+ export { install, UnsupportedPlatformError } from './install.js';
9
+ export { Tunnel } from './tunnel.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dev/cloudflared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Error thrown when the platform or architecture is not supported.
3
+ */
4
+ export declare class UnsupportedPlatformError extends Error {
5
+ constructor(message: string);
6
+ }
7
+ /**
8
+ * Installs the cloudflared binary to the specified path.
9
+ *
10
+ * @param to - The path where the binary should be installed.
11
+ * @param version - The version to install. Defaults to 'latest'.
12
+ * @returns The path to the installed binary.
13
+ */
14
+ export declare function install(to: string, version?: string): Promise<string>;
15
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/dev/cloudflared/install.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI9B;AA8GD;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,SAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAW7E"}
@@ -0,0 +1,140 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import fs from 'fs';
11
+ import path from 'path';
12
+ import https from 'https';
13
+ import { execSync } from 'child_process';
14
+ import { RELEASE_BASE, LINUX_BINARIES, MACOS_BINARIES, WINDOWS_BINARIES } from './constants.js';
15
+ /**
16
+ * Error thrown when the platform or architecture is not supported.
17
+ */
18
+ export class UnsupportedPlatformError extends Error {
19
+ constructor(message) {
20
+ super(message);
21
+ this.name = 'UnsupportedPlatformError';
22
+ }
23
+ }
24
+ /**
25
+ * Resolves the base URL for a specific cloudflared version.
26
+ */
27
+ function resolveReleaseUrl(version) {
28
+ if (version === 'latest') {
29
+ return `${RELEASE_BASE}latest/download/`;
30
+ }
31
+ return `${RELEASE_BASE}download/${version}/`;
32
+ }
33
+ /**
34
+ * Downloads a file from a URL to a local path, following redirects.
35
+ */
36
+ function download(url, to, redirectCount = 0) {
37
+ return new Promise((resolve, reject) => {
38
+ if (!fs.existsSync(path.dirname(to))) {
39
+ fs.mkdirSync(path.dirname(to), { recursive: true });
40
+ }
41
+ const request = https.get(url, res => {
42
+ var _a;
43
+ const redirectCodes = [301, 302, 303, 307, 308];
44
+ if (redirectCodes.includes((_a = res.statusCode) !== null && _a !== void 0 ? _a : 0) && res.headers.location) {
45
+ request.destroy();
46
+ resolve(download(res.headers.location, to, redirectCount + 1));
47
+ return;
48
+ }
49
+ if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
50
+ const file = fs.createWriteStream(to);
51
+ file.on('finish', () => {
52
+ file.close(() => resolve(to));
53
+ });
54
+ file.on('error', err => {
55
+ fs.unlink(to, () => reject(err));
56
+ });
57
+ res.pipe(file);
58
+ }
59
+ else {
60
+ request.destroy();
61
+ reject(new Error(`HTTP request failed with status code: ${res.statusCode}`));
62
+ }
63
+ });
64
+ request.on('error', err => {
65
+ reject(err);
66
+ });
67
+ request.end();
68
+ });
69
+ }
70
+ /**
71
+ * Installs cloudflared for Linux.
72
+ */
73
+ function installLinux(to, version) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ const file = LINUX_BINARIES[process.arch];
76
+ if (!file) {
77
+ throw new UnsupportedPlatformError(`Unsupported Linux architecture: ${process.arch}`);
78
+ }
79
+ yield download(resolveReleaseUrl(version) + file, to);
80
+ fs.chmodSync(to, '755');
81
+ return to;
82
+ });
83
+ }
84
+ /**
85
+ * Installs cloudflared for macOS.
86
+ */
87
+ function installMacOS(to, version) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ const file = MACOS_BINARIES[process.arch];
90
+ if (!file) {
91
+ throw new UnsupportedPlatformError(`Unsupported macOS architecture: ${process.arch}`);
92
+ }
93
+ const tgzPath = `${to}.tgz`;
94
+ yield download(resolveReleaseUrl(version) + file, tgzPath);
95
+ // Extract the tarball
96
+ execSync(`tar -xzf ${path.basename(tgzPath)}`, { cwd: path.dirname(to) });
97
+ fs.unlinkSync(tgzPath);
98
+ // The extracted binary is named 'cloudflared'
99
+ const extractedPath = path.join(path.dirname(to), 'cloudflared');
100
+ if (extractedPath !== to) {
101
+ fs.renameSync(extractedPath, to);
102
+ }
103
+ return to;
104
+ });
105
+ }
106
+ /**
107
+ * Installs cloudflared for Windows.
108
+ */
109
+ function installWindows(to, version) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ const file = WINDOWS_BINARIES[process.arch];
112
+ if (!file) {
113
+ throw new UnsupportedPlatformError(`Unsupported Windows architecture: ${process.arch}`);
114
+ }
115
+ yield download(resolveReleaseUrl(version) + file, to);
116
+ return to;
117
+ });
118
+ }
119
+ /**
120
+ * Installs the cloudflared binary to the specified path.
121
+ *
122
+ * @param to - The path where the binary should be installed.
123
+ * @param version - The version to install. Defaults to 'latest'.
124
+ * @returns The path to the installed binary.
125
+ */
126
+ export function install(to_1) {
127
+ return __awaiter(this, arguments, void 0, function* (to, version = 'latest') {
128
+ switch (process.platform) {
129
+ case 'linux':
130
+ return installLinux(to, version);
131
+ case 'darwin':
132
+ return installMacOS(to, version);
133
+ case 'win32':
134
+ return installWindows(to, version);
135
+ default:
136
+ throw new UnsupportedPlatformError(`Unsupported platform: ${process.platform}`);
137
+ }
138
+ });
139
+ }
140
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/dev/cloudflared/install.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,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AAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE5C,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,MAAM,IAAI,wBAAwB,CAAC,qCAAqC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5F,CAAC;QAED,MAAM,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;QACtD,OAAO,EAAE,CAAC;IACd,CAAC;CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAgB,OAAO;yDAAC,EAAU,EAAE,OAAO,GAAG,QAAQ;QACxD,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;YACvB,KAAK,OAAO;gBACR,OAAO,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YACrC,KAAK,QAAQ;gBACT,OAAO,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YACrC,KAAK,OAAO;gBACR,OAAO,cAAc,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YACvC;gBACI,MAAM,IAAI,wBAAwB,CAAC,yBAAyB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxF,CAAC;IACL,CAAC;CAAA"}
@@ -0,0 +1,64 @@
1
+ import { ChildProcess } from 'child_process';
2
+ import { EventEmitter } from 'events';
3
+ /**
4
+ * Connection information from cloudflared.
5
+ */
6
+ export interface Connection {
7
+ id: string;
8
+ ip: string;
9
+ location: string;
10
+ }
11
+ /**
12
+ * Events emitted by the Tunnel class.
13
+ */
14
+ export interface TunnelEvents {
15
+ /** Emitted when the tunnel URL is assigned. */
16
+ url: (url: string) => void;
17
+ /** Emitted when a connection is established. */
18
+ connected: (connection: Connection) => void;
19
+ /** Emitted when a connection is lost. */
20
+ disconnected: (connection: Connection) => void;
21
+ /** Emitted on stdout data. */
22
+ stdout: (data: string) => void;
23
+ /** Emitted on stderr data. */
24
+ stderr: (data: string) => void;
25
+ /** Emitted on error. */
26
+ error: (error: Error) => void;
27
+ /** Emitted when the process exits. */
28
+ exit: (code: number | null, signal: NodeJS.Signals | null) => void;
29
+ }
30
+ /**
31
+ * Manages a cloudflared tunnel process.
32
+ */
33
+ export declare class Tunnel extends EventEmitter {
34
+ private _process;
35
+ private _url;
36
+ constructor(args: string[]);
37
+ /**
38
+ * The underlying child process.
39
+ */
40
+ get process(): ChildProcess;
41
+ /**
42
+ * The assigned tunnel URL, if available.
43
+ */
44
+ get url(): string | null;
45
+ private createProcess;
46
+ private setupEventHandlers;
47
+ /**
48
+ * Stops the tunnel process.
49
+ */
50
+ stop(): boolean;
51
+ on<E extends keyof TunnelEvents>(event: E, listener: TunnelEvents[E]): this;
52
+ once<E extends keyof TunnelEvents>(event: E, listener: TunnelEvents[E]): this;
53
+ off<E extends keyof TunnelEvents>(event: E, listener: TunnelEvents[E]): this;
54
+ emit<E extends keyof TunnelEvents>(event: E, ...args: Parameters<TunnelEvents[E]>): boolean;
55
+ /**
56
+ * Creates a Quick Tunnel (no Cloudflare account required).
57
+ *
58
+ * @param url - The local URL to tunnel (e.g., 'http://localhost:8080').
59
+ * If not provided, uses cloudflared's hello-world mode.
60
+ * @returns A new Tunnel instance.
61
+ */
62
+ static quick(url?: string): Tunnel;
63
+ }
64
+ //# sourceMappingURL=tunnel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../src/dev/cloudflared/tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,YAAY,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,+CAA+C;IAC/C,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,I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