@gadicc/loom 1.38.0 → 2.0.1

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 (836) hide show
  1. package/.loom-source-manifest.json +97 -0
  2. package/README.md +103 -31
  3. package/db/databaseTls.js +6 -3
  4. package/db/databaseUrl.js +3 -2
  5. package/db/drizzle-config.js +14 -16
  6. package/db/fixtures.d.ts +1 -3
  7. package/db/fixtures.js +4 -7
  8. package/esm/bin/loom.d.ts +2 -1
  9. package/esm/bin/loom.d.ts.map +1 -1
  10. package/esm/bin/loom.js +37 -10
  11. package/esm/bin/loom.js.map +1 -0
  12. package/esm/mod.d.ts +0 -1
  13. package/esm/mod.d.ts.map +1 -1
  14. package/esm/mod.js +1 -1
  15. package/esm/mod.js.map +1 -0
  16. package/esm/src/apiKeys/authorize.d.ts.map +1 -1
  17. package/esm/src/apiKeys/authorize.js +15 -14
  18. package/esm/src/apiKeys/authorize.js.map +1 -0
  19. package/esm/src/apiKeys/betterAuth.d.ts.map +1 -1
  20. package/esm/src/apiKeys/betterAuth.js +1 -0
  21. package/esm/src/apiKeys/betterAuth.js.map +1 -0
  22. package/esm/src/apiKeys/country.d.ts.map +1 -1
  23. package/esm/src/apiKeys/country.js +1 -0
  24. package/esm/src/apiKeys/country.js.map +1 -0
  25. package/esm/src/apiKeys/credentials.d.ts.map +1 -1
  26. package/esm/src/apiKeys/credentials.js +3 -1
  27. package/esm/src/apiKeys/credentials.js.map +1 -0
  28. package/esm/src/apiKeys/fingerprint.d.ts.map +1 -1
  29. package/esm/src/apiKeys/fingerprint.js +1 -0
  30. package/esm/src/apiKeys/fingerprint.js.map +1 -0
  31. package/esm/src/apiKeys/lifecycle.d.ts.map +1 -1
  32. package/esm/src/apiKeys/lifecycle.js +1 -0
  33. package/esm/src/apiKeys/lifecycle.js.map +1 -0
  34. package/esm/src/apiKeys/limits.d.ts.map +1 -1
  35. package/esm/src/apiKeys/limits.js +10 -10
  36. package/esm/src/apiKeys/limits.js.map +1 -0
  37. package/esm/src/apiKeys/mod.d.ts +0 -1
  38. package/esm/src/apiKeys/mod.d.ts.map +1 -1
  39. package/esm/src/apiKeys/mod.js +1 -1
  40. package/esm/src/apiKeys/mod.js.map +1 -0
  41. package/esm/src/apiKeys/permissions.d.ts.map +1 -1
  42. package/esm/src/apiKeys/permissions.js +1 -0
  43. package/esm/src/apiKeys/permissions.js.map +1 -0
  44. package/esm/src/apiKeys/policy.d.ts.map +1 -1
  45. package/esm/src/apiKeys/policy.js +1 -0
  46. package/esm/src/apiKeys/policy.js.map +1 -0
  47. package/esm/src/apiKeys/retention.d.ts.map +1 -1
  48. package/esm/src/apiKeys/retention.js +1 -0
  49. package/esm/src/apiKeys/retention.js.map +1 -0
  50. package/esm/src/apiKeys/types.d.ts.map +1 -1
  51. package/esm/src/apiKeys/types.js +1 -0
  52. package/esm/src/apiKeys/types.js.map +1 -0
  53. package/esm/src/cli/atomicText.d.ts +3 -0
  54. package/esm/src/cli/atomicText.d.ts.map +1 -0
  55. package/esm/src/cli/atomicText.js +33 -0
  56. package/esm/src/cli/atomicText.js.map +1 -0
  57. package/esm/src/cli/bunLocalDev.d.ts +65 -0
  58. package/esm/src/cli/bunLocalDev.d.ts.map +1 -0
  59. package/esm/src/cli/bunLocalDev.js +459 -0
  60. package/esm/src/cli/bunLocalDev.js.map +1 -0
  61. package/esm/src/cli/bunProject.d.ts +30 -0
  62. package/esm/src/cli/bunProject.d.ts.map +1 -0
  63. package/esm/src/cli/bunProject.js +309 -0
  64. package/esm/src/cli/bunProject.js.map +1 -0
  65. package/esm/src/cli/cliBootstrap.d.ts +83 -0
  66. package/esm/src/cli/cliBootstrap.d.ts.map +1 -0
  67. package/esm/src/cli/cliBootstrap.js +186 -0
  68. package/esm/src/cli/cliBootstrap.js.map +1 -0
  69. package/esm/src/cli/externalSkills.d.ts.map +1 -1
  70. package/esm/src/cli/externalSkills.js +9 -5
  71. package/esm/src/cli/externalSkills.js.map +1 -0
  72. package/esm/src/cli/filesR2Policy.d.ts.map +1 -1
  73. package/esm/src/cli/filesR2Policy.js +18 -11
  74. package/esm/src/cli/filesR2Policy.js.map +1 -0
  75. package/esm/src/cli/generatedBuild.d.ts +42 -0
  76. package/esm/src/cli/generatedBuild.d.ts.map +1 -0
  77. package/esm/src/cli/generatedBuild.js +259 -0
  78. package/esm/src/cli/generatedBuild.js.map +1 -0
  79. package/esm/src/cli/generatedCleanup.d.ts +7 -0
  80. package/esm/src/cli/generatedCleanup.d.ts.map +1 -0
  81. package/esm/src/cli/generatedCleanup.js +67 -0
  82. package/esm/src/cli/generatedCleanup.js.map +1 -0
  83. package/esm/src/cli/generatedDevLease.d.ts +8 -0
  84. package/esm/src/cli/generatedDevLease.d.ts.map +1 -0
  85. package/esm/src/cli/generatedDevLease.js +39 -0
  86. package/esm/src/cli/generatedDevLease.js.map +1 -0
  87. package/esm/src/cli/generatedInstall.d.ts +64 -0
  88. package/esm/src/cli/generatedInstall.d.ts.map +1 -0
  89. package/esm/src/cli/generatedInstall.js +466 -0
  90. package/esm/src/cli/generatedInstall.js.map +1 -0
  91. package/esm/src/cli/generatedWorkflow.d.ts +34 -0
  92. package/esm/src/cli/generatedWorkflow.d.ts.map +1 -0
  93. package/esm/src/cli/generatedWorkflow.js +85 -0
  94. package/esm/src/cli/generatedWorkflow.js.map +1 -0
  95. package/esm/src/cli/legacyManagedOutputs.d.ts.map +1 -1
  96. package/esm/src/cli/legacyManagedOutputs.js +1 -0
  97. package/esm/src/cli/legacyManagedOutputs.js.map +1 -0
  98. package/esm/src/cli/localDb.d.ts.map +1 -1
  99. package/esm/src/cli/localDb.js +33 -28
  100. package/esm/src/cli/localDb.js.map +1 -0
  101. package/esm/src/cli/localDevLock.d.ts +9 -0
  102. package/esm/src/cli/localDevLock.d.ts.map +1 -1
  103. package/esm/src/cli/localDevLock.js +54 -13
  104. package/esm/src/cli/localDevLock.js.map +1 -0
  105. package/esm/src/cli/localDevPackage.d.ts +6 -11
  106. package/esm/src/cli/localDevPackage.d.ts.map +1 -1
  107. package/esm/src/cli/localDevPackage.js +51 -48
  108. package/esm/src/cli/localDevPackage.js.map +1 -0
  109. package/esm/src/cli/managedFiles.d.ts.map +1 -1
  110. package/esm/src/cli/managedFiles.js +34 -18
  111. package/esm/src/cli/managedFiles.js.map +1 -0
  112. package/esm/src/cli/migrationEnv.d.ts +16 -3
  113. package/esm/src/cli/migrationEnv.d.ts.map +1 -1
  114. package/esm/src/cli/migrationEnv.js +7 -4
  115. package/esm/src/cli/migrationEnv.js.map +1 -0
  116. package/esm/src/cli/mod.d.ts +19 -7
  117. package/esm/src/cli/mod.d.ts.map +1 -1
  118. package/esm/src/cli/mod.js +2010 -745
  119. package/esm/src/cli/mod.js.map +1 -0
  120. package/esm/src/cli/packageTreeSignature.d.ts +8 -0
  121. package/esm/src/cli/packageTreeSignature.d.ts.map +1 -0
  122. package/esm/src/cli/packageTreeSignature.js +60 -0
  123. package/esm/src/cli/packageTreeSignature.js.map +1 -0
  124. package/esm/src/cli/processIdentity.d.ts +7 -0
  125. package/esm/src/cli/processIdentity.d.ts.map +1 -0
  126. package/esm/src/cli/processIdentity.js +39 -0
  127. package/esm/src/cli/processIdentity.js.map +1 -0
  128. package/esm/src/cli/projectSkills.d.ts +1 -1
  129. package/esm/src/cli/projectSkills.d.ts.map +1 -1
  130. package/esm/src/cli/projectSkills.js +31 -23
  131. package/esm/src/cli/projectSkills.js.map +1 -0
  132. package/esm/src/cli/projectTooling.d.ts +6 -3
  133. package/esm/src/cli/projectTooling.d.ts.map +1 -1
  134. package/esm/src/cli/projectTooling.js +86 -41
  135. package/esm/src/cli/projectTooling.js.map +1 -0
  136. package/esm/src/cli/releaseConfig.d.ts.map +1 -1
  137. package/esm/src/cli/releaseConfig.js +5 -3
  138. package/esm/src/cli/releaseConfig.js.map +1 -0
  139. package/esm/src/cli/releaseCredentials.d.ts.map +1 -1
  140. package/esm/src/cli/releaseCredentials.js +19 -31
  141. package/esm/src/cli/releaseCredentials.js.map +1 -0
  142. package/esm/src/cli/releaseTrust.d.ts.map +1 -1
  143. package/esm/src/cli/releaseTrust.js +11 -4
  144. package/esm/src/cli/releaseTrust.js.map +1 -0
  145. package/esm/src/cli/releaseTrustCommand.d.ts.map +1 -1
  146. package/esm/src/cli/releaseTrustCommand.js +6 -4
  147. package/esm/src/cli/releaseTrustCommand.js.map +1 -0
  148. package/esm/src/cli/sourceConfig.d.ts +3 -0
  149. package/esm/src/cli/sourceConfig.d.ts.map +1 -0
  150. package/esm/src/cli/sourceConfig.js +91 -0
  151. package/esm/src/cli/sourceConfig.js.map +1 -0
  152. package/esm/src/cli/sourceDev.d.ts +77 -0
  153. package/esm/src/cli/sourceDev.d.ts.map +1 -0
  154. package/esm/src/cli/sourceDev.js +974 -0
  155. package/esm/src/cli/sourceDev.js.map +1 -0
  156. package/esm/src/cli/vercelBuildEnv.d.ts.map +1 -1
  157. package/esm/src/cli/vercelBuildEnv.js +21 -15
  158. package/esm/src/cli/vercelBuildEnv.js.map +1 -0
  159. package/esm/src/cli/vercelEnvMask.d.ts +2 -2
  160. package/esm/src/cli/vercelEnvMask.d.ts.map +1 -1
  161. package/esm/src/cli/vercelEnvMask.js +8 -4
  162. package/esm/src/cli/vercelEnvMask.js.map +1 -0
  163. package/esm/src/cli/vercelProjectRelease.d.ts.map +1 -1
  164. package/esm/src/cli/vercelProjectRelease.js +45 -22
  165. package/esm/src/cli/vercelProjectRelease.js.map +1 -0
  166. package/esm/src/cli/vercelPulledEnv.d.ts +1 -1
  167. package/esm/src/cli/vercelPulledEnv.d.ts.map +1 -1
  168. package/esm/src/cli/vercelPulledEnv.js +1 -0
  169. package/esm/src/cli/vercelPulledEnv.js.map +1 -0
  170. package/esm/src/clientData/identity.d.ts.map +1 -1
  171. package/esm/src/clientData/identity.js +1 -0
  172. package/esm/src/clientData/identity.js.map +1 -0
  173. package/esm/src/clientData/mod.d.ts +0 -1
  174. package/esm/src/clientData/mod.d.ts.map +1 -1
  175. package/esm/src/clientData/mod.js +1 -0
  176. package/esm/src/clientData/mod.js.map +1 -0
  177. package/esm/src/files/client.d.ts +1 -1
  178. package/esm/src/files/client.d.ts.map +1 -1
  179. package/esm/src/files/client.js +3 -4
  180. package/esm/src/files/client.js.map +1 -0
  181. package/esm/src/files/errors.d.ts.map +1 -1
  182. package/esm/src/files/errors.js +3 -12
  183. package/esm/src/files/errors.js.map +1 -0
  184. package/esm/src/files/hash.d.ts +1 -1
  185. package/esm/src/files/hash.d.ts.map +1 -1
  186. package/esm/src/files/hash.js +1 -0
  187. package/esm/src/files/hash.js.map +1 -0
  188. package/esm/src/files/memory.d.ts.map +1 -1
  189. package/esm/src/files/memory.js +2 -1
  190. package/esm/src/files/memory.js.map +1 -0
  191. package/esm/src/files/metadata.d.ts.map +1 -1
  192. package/esm/src/files/metadata.js +11 -18
  193. package/esm/src/files/metadata.js.map +1 -0
  194. package/esm/src/files/mod.d.ts +0 -1
  195. package/esm/src/files/mod.d.ts.map +1 -1
  196. package/esm/src/files/mod.js +1 -1
  197. package/esm/src/files/mod.js.map +1 -0
  198. package/esm/src/files/s3.d.ts.map +1 -1
  199. package/esm/src/files/s3.js +6 -4
  200. package/esm/src/files/s3.js.map +1 -0
  201. package/esm/src/files/service.d.ts.map +1 -1
  202. package/esm/src/files/service.js +3 -4
  203. package/esm/src/files/service.js.map +1 -0
  204. package/esm/src/files/types.d.ts.map +1 -1
  205. package/esm/src/files/types.js +1 -0
  206. package/esm/src/files/types.js.map +1 -0
  207. package/esm/src/jobs/catalog.d.ts.map +1 -1
  208. package/esm/src/jobs/catalog.js +5 -1
  209. package/esm/src/jobs/catalog.js.map +1 -0
  210. package/esm/src/jobs/controller.d.ts +1 -1
  211. package/esm/src/jobs/controller.d.ts.map +1 -1
  212. package/esm/src/jobs/controller.js +11 -55
  213. package/esm/src/jobs/controller.js.map +1 -0
  214. package/esm/src/jobs/direct.d.ts.map +1 -1
  215. package/esm/src/jobs/direct.js +3 -3
  216. package/esm/src/jobs/direct.js.map +1 -0
  217. package/esm/src/jobs/events.d.ts.map +1 -1
  218. package/esm/src/jobs/events.js +1 -0
  219. package/esm/src/jobs/events.js.map +1 -0
  220. package/esm/src/jobs/format.d.ts +5 -5
  221. package/esm/src/jobs/format.d.ts.map +1 -1
  222. package/esm/src/jobs/format.js +2 -1
  223. package/esm/src/jobs/format.js.map +1 -0
  224. package/esm/src/jobs/http.d.ts +3 -3
  225. package/esm/src/jobs/http.d.ts.map +1 -1
  226. package/esm/src/jobs/http.js +1 -0
  227. package/esm/src/jobs/http.js.map +1 -0
  228. package/esm/src/jobs/log.d.ts.map +1 -1
  229. package/esm/src/jobs/log.js +1 -0
  230. package/esm/src/jobs/log.js.map +1 -0
  231. package/esm/src/jobs/mod.d.ts.map +1 -1
  232. package/esm/src/jobs/mod.js +1 -0
  233. package/esm/src/jobs/mod.js.map +1 -0
  234. package/esm/src/jobs/run.d.ts.map +1 -1
  235. package/esm/src/jobs/run.js +1 -0
  236. package/esm/src/jobs/run.js.map +1 -0
  237. package/esm/src/jobs/sanitize.d.ts.map +1 -1
  238. package/esm/src/jobs/sanitize.js +1 -0
  239. package/esm/src/jobs/sanitize.js.map +1 -0
  240. package/esm/src/jobs/types.d.ts +1 -0
  241. package/esm/src/jobs/types.d.ts.map +1 -1
  242. package/esm/src/jobs/types.js +1 -0
  243. package/esm/src/jobs/types.js.map +1 -0
  244. package/esm/src/mail/errors.d.ts.map +1 -1
  245. package/esm/src/mail/errors.js +8 -42
  246. package/esm/src/mail/errors.js.map +1 -0
  247. package/esm/src/mail/memory.d.ts +1 -1
  248. package/esm/src/mail/memory.d.ts.map +1 -1
  249. package/esm/src/mail/memory.js +10 -14
  250. package/esm/src/mail/memory.js.map +1 -0
  251. package/esm/src/mail/mod.d.ts +0 -1
  252. package/esm/src/mail/mod.d.ts.map +1 -1
  253. package/esm/src/mail/mod.js +1 -1
  254. package/esm/src/mail/mod.js.map +1 -0
  255. package/esm/src/mail/postal.d.ts +1 -2
  256. package/esm/src/mail/postal.d.ts.map +1 -1
  257. package/esm/src/mail/postal.js +22 -18
  258. package/esm/src/mail/postal.js.map +1 -0
  259. package/esm/src/mail/retry.d.ts.map +1 -1
  260. package/esm/src/mail/retry.js +1 -0
  261. package/esm/src/mail/retry.js.map +1 -0
  262. package/esm/src/mail/sender.d.ts.map +1 -1
  263. package/esm/src/mail/sender.js +1 -0
  264. package/esm/src/mail/sender.js.map +1 -0
  265. package/esm/src/mail/service.d.ts.map +1 -1
  266. package/esm/src/mail/service.js +6 -7
  267. package/esm/src/mail/service.js.map +1 -0
  268. package/esm/src/mail/types.d.ts.map +1 -1
  269. package/esm/src/mail/types.js +1 -0
  270. package/esm/src/mail/types.js.map +1 -0
  271. package/esm/src/mui/apiKeys.d.ts +10 -11
  272. package/esm/src/mui/apiKeys.d.ts.map +1 -1
  273. package/esm/src/mui/apiKeys.js +83 -214
  274. package/esm/src/mui/apiKeys.js.map +1 -0
  275. package/esm/src/mui/apiKeysView.d.ts +1 -1
  276. package/esm/src/mui/apiKeysView.d.ts.map +1 -1
  277. package/esm/src/mui/apiKeysView.js +11 -9
  278. package/esm/src/mui/apiKeysView.js.map +1 -0
  279. package/esm/src/mui/confirm.d.ts +2 -2
  280. package/esm/src/mui/confirm.d.ts.map +1 -1
  281. package/esm/src/mui/confirm.js +3 -7
  282. package/esm/src/mui/confirm.js.map +1 -0
  283. package/esm/src/mui/mail.d.ts +4 -4
  284. package/esm/src/mui/mail.d.ts.map +1 -1
  285. package/esm/src/mui/mail.js +11 -71
  286. package/esm/src/mui/mail.js.map +1 -0
  287. package/esm/src/mui/mailView.d.ts +1 -1
  288. package/esm/src/mui/mailView.d.ts.map +1 -1
  289. package/esm/src/mui/mailView.js +1 -0
  290. package/esm/src/mui/mailView.js.map +1 -0
  291. package/esm/src/mui/mod.d.ts +0 -1
  292. package/esm/src/mui/mod.d.ts.map +1 -1
  293. package/esm/src/mui/mod.js +1 -0
  294. package/esm/src/mui/mod.js.map +1 -0
  295. package/esm/src/next/apiKeys/mod.d.ts +2 -3
  296. package/esm/src/next/apiKeys/mod.d.ts.map +1 -1
  297. package/esm/src/next/apiKeys/mod.js +6 -5
  298. package/esm/src/next/apiKeys/mod.js.map +1 -0
  299. package/esm/src/next/auth/client.d.ts +0 -1
  300. package/esm/src/next/auth/client.d.ts.map +1 -1
  301. package/esm/src/next/auth/client.js +1 -0
  302. package/esm/src/next/auth/client.js.map +1 -0
  303. package/esm/src/next/auth/config.d.ts.map +1 -1
  304. package/esm/src/next/auth/config.js +11 -17
  305. package/esm/src/next/auth/config.js.map +1 -0
  306. package/esm/src/next/auth/localTestLogin.d.ts.map +1 -1
  307. package/esm/src/next/auth/localTestLogin.js +13 -9
  308. package/esm/src/next/auth/localTestLogin.js.map +1 -0
  309. package/esm/src/next/auth/mod.d.ts.map +1 -1
  310. package/esm/src/next/auth/mod.js +1 -0
  311. package/esm/src/next/auth/mod.js.map +1 -0
  312. package/esm/src/next/auth/server.d.ts +2 -2
  313. package/esm/src/next/auth/server.d.ts.map +1 -1
  314. package/esm/src/next/auth/server.js +1 -0
  315. package/esm/src/next/auth/server.js.map +1 -0
  316. package/esm/src/next/files/mod.d.ts +0 -1
  317. package/esm/src/next/files/mod.d.ts.map +1 -1
  318. package/esm/src/next/files/mod.js +1 -1
  319. package/esm/src/next/files/mod.js.map +1 -0
  320. package/esm/src/next/files/route.d.ts +1 -1
  321. package/esm/src/next/files/route.d.ts.map +1 -1
  322. package/esm/src/next/files/route.js +11 -11
  323. package/esm/src/next/files/route.js.map +1 -0
  324. package/esm/src/next/jobs/list.d.ts +5 -5
  325. package/esm/src/next/jobs/list.d.ts.map +1 -1
  326. package/esm/src/next/jobs/list.js +15 -19
  327. package/esm/src/next/jobs/list.js.map +1 -0
  328. package/esm/src/next/jobs/mod.d.ts.map +1 -1
  329. package/esm/src/next/jobs/mod.js +1 -0
  330. package/esm/src/next/jobs/mod.js.map +1 -0
  331. package/esm/src/next/jobs/paths.d.ts +2 -2
  332. package/esm/src/next/jobs/paths.d.ts.map +1 -1
  333. package/esm/src/next/jobs/paths.js +1 -0
  334. package/esm/src/next/jobs/paths.js.map +1 -0
  335. package/esm/src/next/jobs/route.d.ts +2 -2
  336. package/esm/src/next/jobs/route.d.ts.map +1 -1
  337. package/esm/src/next/jobs/route.js +4 -4
  338. package/esm/src/next/jobs/route.js.map +1 -0
  339. package/esm/src/next/jobs/run.d.ts +2 -2
  340. package/esm/src/next/jobs/run.d.ts.map +1 -1
  341. package/esm/src/next/jobs/run.js +68 -132
  342. package/esm/src/next/jobs/run.js.map +1 -0
  343. package/esm/src/next/jobs/runRequest.d.ts +1 -1
  344. package/esm/src/next/jobs/runRequest.d.ts.map +1 -1
  345. package/esm/src/next/jobs/runRequest.js +3 -4
  346. package/esm/src/next/jobs/runRequest.js.map +1 -0
  347. package/esm/src/next/jobs/stream.d.ts.map +1 -1
  348. package/esm/src/next/jobs/stream.js +1 -0
  349. package/esm/src/next/jobs/stream.js.map +1 -0
  350. package/esm/src/next/mail/mod.d.ts +0 -1
  351. package/esm/src/next/mail/mod.d.ts.map +1 -1
  352. package/esm/src/next/mail/mod.js +1 -1
  353. package/esm/src/next/mail/mod.js.map +1 -0
  354. package/esm/src/next/mail/route.d.ts +2 -2
  355. package/esm/src/next/mail/route.d.ts.map +1 -1
  356. package/esm/src/next/mail/route.js +1 -0
  357. package/esm/src/next/mail/route.js.map +1 -0
  358. package/esm/src/next/pwa/mod.d.ts +0 -4
  359. package/esm/src/next/pwa/mod.d.ts.map +1 -1
  360. package/esm/src/next/pwa/mod.js +32 -16
  361. package/esm/src/next/pwa/mod.js.map +1 -0
  362. package/esm/src/next/pwa/worker.d.ts +0 -1
  363. package/esm/src/next/pwa/worker.d.ts.map +1 -1
  364. package/esm/src/next/pwa/worker.js +1 -0
  365. package/esm/src/next/pwa/worker.js.map +1 -0
  366. package/esm/src/next/secrets/constants.d.ts +3 -0
  367. package/esm/src/next/secrets/constants.d.ts.map +1 -0
  368. package/esm/src/next/secrets/constants.js +3 -0
  369. package/esm/src/next/secrets/constants.js.map +1 -0
  370. package/esm/src/next/secrets/mod.d.ts +1 -3
  371. package/esm/src/next/secrets/mod.d.ts.map +1 -1
  372. package/esm/src/next/secrets/mod.js +6 -7
  373. package/esm/src/next/secrets/mod.js.map +1 -0
  374. package/esm/src/next/sourceDev.d.ts +6 -0
  375. package/esm/src/next/sourceDev.d.ts.map +1 -0
  376. package/esm/src/next/sourceDev.js +41 -0
  377. package/esm/src/next/sourceDev.js.map +1 -0
  378. package/esm/src/secrets/encoding.d.ts.map +1 -1
  379. package/esm/src/secrets/encoding.js +1 -0
  380. package/esm/src/secrets/encoding.js.map +1 -0
  381. package/esm/src/secrets/errors.d.ts.map +1 -1
  382. package/esm/src/secrets/errors.js +3 -7
  383. package/esm/src/secrets/errors.js.map +1 -0
  384. package/esm/src/secrets/fingerprint.d.ts.map +1 -1
  385. package/esm/src/secrets/fingerprint.js +1 -0
  386. package/esm/src/secrets/fingerprint.js.map +1 -0
  387. package/esm/src/secrets/frame.d.ts.map +1 -1
  388. package/esm/src/secrets/frame.js +4 -3
  389. package/esm/src/secrets/frame.js.map +1 -0
  390. package/esm/src/secrets/keyring.d.ts.map +1 -1
  391. package/esm/src/secrets/keyring.js +6 -6
  392. package/esm/src/secrets/keyring.js.map +1 -0
  393. package/esm/src/secrets/legacy.d.ts +0 -1
  394. package/esm/src/secrets/legacy.d.ts.map +1 -1
  395. package/esm/src/secrets/legacy.js +13 -10
  396. package/esm/src/secrets/legacy.js.map +1 -0
  397. package/esm/src/secrets/maintenance.d.ts +0 -1
  398. package/esm/src/secrets/maintenance.d.ts.map +1 -1
  399. package/esm/src/secrets/maintenance.js +9 -24
  400. package/esm/src/secrets/maintenance.js.map +1 -0
  401. package/esm/src/secrets/mod.d.ts +0 -1
  402. package/esm/src/secrets/mod.d.ts.map +1 -1
  403. package/esm/src/secrets/mod.js +1 -1
  404. package/esm/src/secrets/mod.js.map +1 -0
  405. package/esm/src/secrets/secrets.d.ts.map +1 -1
  406. package/esm/src/secrets/secrets.js +38 -30
  407. package/esm/src/secrets/secrets.js.map +1 -0
  408. package/package.json +111 -135
  409. package/skills/loom/SKILL.md +40 -5
  410. package/skills/loom/references/esm-package.md +35 -0
  411. package/skills/loom/references/local-development.md +261 -29
  412. package/skills/loom-mail/SKILL.md +1 -0
  413. package/skills/upgrade-deps/SKILL.md +4 -2
  414. package/source/bin/loom.ts +50 -0
  415. package/source/mod.ts +10 -0
  416. package/source/src/apiKeys/authorize.ts +294 -0
  417. package/source/src/apiKeys/betterAuth.ts +253 -0
  418. package/source/src/apiKeys/country.ts +7 -0
  419. package/source/src/apiKeys/credentials.ts +171 -0
  420. package/source/src/apiKeys/fingerprint.ts +10 -0
  421. package/{script/src/apiKeys/lifecycle.d.ts → source/src/apiKeys/lifecycle.ts} +21 -23
  422. package/source/src/apiKeys/limits.ts +372 -0
  423. package/source/src/apiKeys/mod.ts +11 -0
  424. package/source/src/apiKeys/permissions.ts +153 -0
  425. package/source/src/apiKeys/policy.ts +189 -0
  426. package/source/src/apiKeys/retention.ts +136 -0
  427. package/source/src/apiKeys/types.ts +288 -0
  428. package/source/src/cli/atomicText.ts +38 -0
  429. package/source/src/cli/bunLocalDev.ts +646 -0
  430. package/source/src/cli/bunProject.ts +433 -0
  431. package/source/src/cli/cliBootstrap.ts +313 -0
  432. package/source/src/cli/externalSkills.ts +315 -0
  433. package/source/src/cli/filesR2Policy.ts +212 -0
  434. package/source/src/cli/generatedBuild.ts +380 -0
  435. package/source/src/cli/generatedCleanup.ts +87 -0
  436. package/source/src/cli/generatedDevLease.ts +52 -0
  437. package/source/src/cli/generatedInstall.ts +630 -0
  438. package/source/src/cli/generatedWorkflow.ts +135 -0
  439. package/{script/src/cli/legacyManagedOutputs.js → source/src/cli/legacyManagedOutputs.ts} +36 -30
  440. package/source/src/cli/localDb.ts +548 -0
  441. package/source/src/cli/localDevLock.ts +462 -0
  442. package/source/src/cli/localDevPackage.ts +754 -0
  443. package/source/src/cli/managedFiles.ts +688 -0
  444. package/source/src/cli/migrationEnv.ts +267 -0
  445. package/source/src/cli/mod.ts +26794 -0
  446. package/source/src/cli/packageTreeSignature.ts +65 -0
  447. package/source/src/cli/processIdentity.ts +38 -0
  448. package/source/src/cli/projectSkills.ts +1102 -0
  449. package/source/src/cli/projectTooling.ts +1140 -0
  450. package/source/src/cli/releaseConfig.ts +36 -0
  451. package/source/src/cli/releaseCredentials.ts +642 -0
  452. package/source/src/cli/releaseTrust.ts +194 -0
  453. package/source/src/cli/releaseTrustCommand.ts +210 -0
  454. package/source/src/cli/sourceConfig.ts +106 -0
  455. package/source/src/cli/sourceDev.ts +1279 -0
  456. package/source/src/cli/vercelBuildEnv.ts +714 -0
  457. package/source/src/cli/vercelEnvMask.ts +182 -0
  458. package/source/src/cli/vercelProjectRelease.ts +807 -0
  459. package/source/src/cli/vercelPulledEnv.ts +174 -0
  460. package/source/src/clientData/identity.ts +229 -0
  461. package/source/src/clientData/mod.ts +1 -0
  462. package/source/src/files/client.ts +75 -0
  463. package/source/src/files/errors.ts +69 -0
  464. package/source/src/files/hash.ts +109 -0
  465. package/source/src/files/memory.ts +158 -0
  466. package/source/src/files/metadata.ts +251 -0
  467. package/source/src/files/mod.ts +8 -0
  468. package/source/src/files/s3.ts +182 -0
  469. package/source/src/files/service.ts +210 -0
  470. package/source/src/files/types.ts +171 -0
  471. package/source/src/jobs/catalog.ts +303 -0
  472. package/source/src/jobs/controller.ts +156 -0
  473. package/source/src/jobs/direct.ts +177 -0
  474. package/source/src/jobs/events.ts +74 -0
  475. package/source/src/jobs/format.ts +233 -0
  476. package/source/src/jobs/http.ts +83 -0
  477. package/source/src/jobs/log.ts +10 -0
  478. package/source/src/jobs/mod.ts +10 -0
  479. package/source/src/jobs/run.ts +141 -0
  480. package/source/src/jobs/sanitize.ts +142 -0
  481. package/source/src/jobs/types.ts +43 -0
  482. package/source/src/mail/errors.ts +77 -0
  483. package/source/src/mail/memory.ts +451 -0
  484. package/source/src/mail/mod.ts +5 -0
  485. package/source/src/mail/postal.ts +363 -0
  486. package/source/src/mail/retry.ts +30 -0
  487. package/source/src/mail/sender.ts +57 -0
  488. package/source/src/mail/service.ts +252 -0
  489. package/source/src/mail/types.ts +229 -0
  490. package/source/src/mui/apiKeys.tsx +1044 -0
  491. package/source/src/mui/apiKeysView.ts +535 -0
  492. package/source/src/mui/confirm.tsx +138 -0
  493. package/source/src/mui/mail.tsx +279 -0
  494. package/source/src/mui/mailView.ts +50 -0
  495. package/source/src/mui/mod.ts +3 -0
  496. package/source/src/next/apiKeys/mod.ts +393 -0
  497. package/{script/src/next/auth/client.d.ts → source/src/next/auth/client.ts} +19 -5
  498. package/source/src/next/auth/config.ts +207 -0
  499. package/source/src/next/auth/localTestLogin.ts +412 -0
  500. package/source/src/next/auth/mod.ts +3 -0
  501. package/source/src/next/auth/server.ts +94 -0
  502. package/source/src/next/files/mod.ts +1 -0
  503. package/source/src/next/files/route.ts +621 -0
  504. package/source/src/next/jobs/list.tsx +90 -0
  505. package/source/src/next/jobs/mod.ts +5 -0
  506. package/source/src/next/jobs/paths.ts +70 -0
  507. package/source/src/next/jobs/route.ts +207 -0
  508. package/source/src/next/jobs/run.tsx +888 -0
  509. package/source/src/next/jobs/runRequest.ts +92 -0
  510. package/source/src/next/jobs/stream.ts +33 -0
  511. package/source/src/next/mail/mod.ts +1 -0
  512. package/source/src/next/mail/route.ts +75 -0
  513. package/source/src/next/pwa/mod.tsx +453 -0
  514. package/source/src/next/pwa/worker.ts +59 -0
  515. package/source/src/next/secrets/constants.ts +2 -0
  516. package/source/src/next/secrets/mod.ts +319 -0
  517. package/source/src/next/sourceDev.ts +50 -0
  518. package/source/src/secrets/encoding.ts +102 -0
  519. package/source/src/secrets/errors.ts +58 -0
  520. package/source/src/secrets/fingerprint.ts +132 -0
  521. package/source/src/secrets/frame.ts +119 -0
  522. package/source/src/secrets/keyring.ts +225 -0
  523. package/source/src/secrets/legacy.ts +244 -0
  524. package/source/src/secrets/maintenance.ts +517 -0
  525. package/source/src/secrets/mod.ts +38 -0
  526. package/source/src/secrets/secrets.ts +926 -0
  527. package/db/databaseTls.test.ts +0 -171
  528. package/db/databaseUrl.test.ts +0 -72
  529. package/db/neonEndpoint.test.ts +0 -51
  530. package/db/testing.test.ts +0 -28
  531. package/deno.json +0 -3
  532. package/esm/_dnt.polyfills.d.ts +0 -166
  533. package/esm/_dnt.polyfills.d.ts.map +0 -1
  534. package/esm/_dnt.polyfills.js +0 -177
  535. package/esm/_dnt.shims.d.ts +0 -2
  536. package/esm/_dnt.shims.d.ts.map +0 -1
  537. package/esm/_dnt.shims.js +0 -57
  538. package/esm/package.json +0 -3
  539. package/script/_dnt.polyfills.d.ts +0 -166
  540. package/script/_dnt.polyfills.d.ts.map +0 -1
  541. package/script/_dnt.polyfills.js +0 -180
  542. package/script/_dnt.shims.d.ts +0 -2
  543. package/script/_dnt.shims.d.ts.map +0 -1
  544. package/script/_dnt.shims.js +0 -60
  545. package/script/bin/loom.d.ts +0 -2
  546. package/script/bin/loom.d.ts.map +0 -1
  547. package/script/bin/loom.js +0 -17
  548. package/script/mod.d.ts +0 -12
  549. package/script/mod.d.ts.map +0 -1
  550. package/script/mod.js +0 -27
  551. package/script/package.json +0 -3
  552. package/script/src/apiKeys/authorize.d.ts +0 -4
  553. package/script/src/apiKeys/authorize.d.ts.map +0 -1
  554. package/script/src/apiKeys/authorize.js +0 -258
  555. package/script/src/apiKeys/betterAuth.d.ts +0 -123
  556. package/script/src/apiKeys/betterAuth.d.ts.map +0 -1
  557. package/script/src/apiKeys/betterAuth.js +0 -169
  558. package/script/src/apiKeys/country.d.ts +0 -3
  559. package/script/src/apiKeys/country.d.ts.map +0 -1
  560. package/script/src/apiKeys/country.js +0 -10
  561. package/script/src/apiKeys/credentials.d.ts +0 -39
  562. package/script/src/apiKeys/credentials.d.ts.map +0 -1
  563. package/script/src/apiKeys/credentials.js +0 -121
  564. package/script/src/apiKeys/fingerprint.d.ts +0 -3
  565. package/script/src/apiKeys/fingerprint.d.ts.map +0 -1
  566. package/script/src/apiKeys/fingerprint.js +0 -8
  567. package/script/src/apiKeys/lifecycle.d.ts.map +0 -1
  568. package/script/src/apiKeys/lifecycle.js +0 -7
  569. package/script/src/apiKeys/limits.d.ts +0 -132
  570. package/script/src/apiKeys/limits.d.ts.map +0 -1
  571. package/script/src/apiKeys/limits.js +0 -254
  572. package/script/src/apiKeys/mod.d.ts +0 -13
  573. package/script/src/apiKeys/mod.d.ts.map +0 -1
  574. package/script/src/apiKeys/mod.js +0 -28
  575. package/script/src/apiKeys/permissions.d.ts +0 -56
  576. package/script/src/apiKeys/permissions.d.ts.map +0 -1
  577. package/script/src/apiKeys/permissions.js +0 -136
  578. package/script/src/apiKeys/policy.d.ts +0 -61
  579. package/script/src/apiKeys/policy.d.ts.map +0 -1
  580. package/script/src/apiKeys/policy.js +0 -94
  581. package/script/src/apiKeys/retention.d.ts +0 -55
  582. package/script/src/apiKeys/retention.d.ts.map +0 -1
  583. package/script/src/apiKeys/retention.js +0 -70
  584. package/script/src/apiKeys/types.d.ts +0 -242
  585. package/script/src/apiKeys/types.d.ts.map +0 -1
  586. package/script/src/apiKeys/types.js +0 -2
  587. package/script/src/cli/externalSkills.d.ts +0 -39
  588. package/script/src/cli/externalSkills.d.ts.map +0 -1
  589. package/script/src/cli/externalSkills.js +0 -204
  590. package/script/src/cli/filesR2Policy.d.ts +0 -33
  591. package/script/src/cli/filesR2Policy.d.ts.map +0 -1
  592. package/script/src/cli/filesR2Policy.js +0 -135
  593. package/script/src/cli/legacyManagedOutputs.d.ts +0 -33
  594. package/script/src/cli/legacyManagedOutputs.d.ts.map +0 -1
  595. package/script/src/cli/localDb.d.ts +0 -28
  596. package/script/src/cli/localDb.d.ts.map +0 -1
  597. package/script/src/cli/localDb.js +0 -370
  598. package/script/src/cli/localDevLock.d.ts +0 -97
  599. package/script/src/cli/localDevLock.d.ts.map +0 -1
  600. package/script/src/cli/localDevLock.js +0 -320
  601. package/script/src/cli/localDevPackage.d.ts +0 -172
  602. package/script/src/cli/localDevPackage.d.ts.map +0 -1
  603. package/script/src/cli/localDevPackage.js +0 -635
  604. package/script/src/cli/managedFiles.d.ts +0 -131
  605. package/script/src/cli/managedFiles.d.ts.map +0 -1
  606. package/script/src/cli/managedFiles.js +0 -536
  607. package/script/src/cli/migrationEnv.d.ts +0 -63
  608. package/script/src/cli/migrationEnv.d.ts.map +0 -1
  609. package/script/src/cli/migrationEnv.js +0 -217
  610. package/script/src/cli/mod.d.ts +0 -582
  611. package/script/src/cli/mod.d.ts.map +0 -1
  612. package/script/src/cli/mod.js +0 -17010
  613. package/script/src/cli/projectSkills.d.ts +0 -109
  614. package/script/src/cli/projectSkills.d.ts.map +0 -1
  615. package/script/src/cli/projectSkills.js +0 -749
  616. package/script/src/cli/projectTooling.d.ts +0 -164
  617. package/script/src/cli/projectTooling.d.ts.map +0 -1
  618. package/script/src/cli/projectTooling.js +0 -847
  619. package/script/src/cli/releaseConfig.d.ts +0 -10
  620. package/script/src/cli/releaseConfig.d.ts.map +0 -1
  621. package/script/src/cli/releaseConfig.js +0 -26
  622. package/script/src/cli/releaseCredentials.d.ts +0 -32
  623. package/script/src/cli/releaseCredentials.d.ts.map +0 -1
  624. package/script/src/cli/releaseCredentials.js +0 -392
  625. package/script/src/cli/releaseTrust.d.ts +0 -39
  626. package/script/src/cli/releaseTrust.d.ts.map +0 -1
  627. package/script/src/cli/releaseTrust.js +0 -130
  628. package/script/src/cli/releaseTrustCommand.d.ts +0 -18
  629. package/script/src/cli/releaseTrustCommand.d.ts.map +0 -1
  630. package/script/src/cli/releaseTrustCommand.js +0 -145
  631. package/script/src/cli/vercelBuildEnv.d.ts +0 -62
  632. package/script/src/cli/vercelBuildEnv.d.ts.map +0 -1
  633. package/script/src/cli/vercelBuildEnv.js +0 -418
  634. package/script/src/cli/vercelEnvMask.d.ts +0 -38
  635. package/script/src/cli/vercelEnvMask.d.ts.map +0 -1
  636. package/script/src/cli/vercelEnvMask.js +0 -142
  637. package/script/src/cli/vercelProjectRelease.d.ts +0 -38
  638. package/script/src/cli/vercelProjectRelease.d.ts.map +0 -1
  639. package/script/src/cli/vercelProjectRelease.js +0 -607
  640. package/script/src/cli/vercelPulledEnv.d.ts +0 -65
  641. package/script/src/cli/vercelPulledEnv.d.ts.map +0 -1
  642. package/script/src/cli/vercelPulledEnv.js +0 -138
  643. package/script/src/clientData/identity.d.ts +0 -89
  644. package/script/src/clientData/identity.d.ts.map +0 -1
  645. package/script/src/clientData/identity.js +0 -134
  646. package/script/src/clientData/mod.d.ts +0 -3
  647. package/script/src/clientData/mod.d.ts.map +0 -1
  648. package/script/src/clientData/mod.js +0 -18
  649. package/script/src/files/client.d.ts +0 -29
  650. package/script/src/files/client.d.ts.map +0 -1
  651. package/script/src/files/client.js +0 -45
  652. package/script/src/files/errors.d.ts +0 -37
  653. package/script/src/files/errors.d.ts.map +0 -1
  654. package/script/src/files/errors.js +0 -76
  655. package/script/src/files/hash.d.ts +0 -15
  656. package/script/src/files/hash.d.ts.map +0 -1
  657. package/script/src/files/hash.js +0 -89
  658. package/script/src/files/memory.d.ts +0 -29
  659. package/script/src/files/memory.d.ts.map +0 -1
  660. package/script/src/files/memory.js +0 -113
  661. package/script/src/files/metadata.d.ts +0 -10
  662. package/script/src/files/metadata.d.ts.map +0 -1
  663. package/script/src/files/metadata.js +0 -189
  664. package/script/src/files/mod.d.ts +0 -10
  665. package/script/src/files/mod.d.ts.map +0 -1
  666. package/script/src/files/mod.js +0 -25
  667. package/script/src/files/s3.d.ts +0 -29
  668. package/script/src/files/s3.d.ts.map +0 -1
  669. package/script/src/files/s3.js +0 -110
  670. package/script/src/files/service.d.ts +0 -27
  671. package/script/src/files/service.d.ts.map +0 -1
  672. package/script/src/files/service.js +0 -139
  673. package/script/src/files/types.d.ts +0 -134
  674. package/script/src/files/types.d.ts.map +0 -1
  675. package/script/src/files/types.js +0 -2
  676. package/script/src/jobs/catalog.d.ts +0 -32
  677. package/script/src/jobs/catalog.d.ts.map +0 -1
  678. package/script/src/jobs/catalog.js +0 -223
  679. package/script/src/jobs/controller.d.ts +0 -41
  680. package/script/src/jobs/controller.d.ts.map +0 -1
  681. package/script/src/jobs/controller.js +0 -151
  682. package/script/src/jobs/direct.d.ts +0 -36
  683. package/script/src/jobs/direct.d.ts.map +0 -1
  684. package/script/src/jobs/direct.js +0 -128
  685. package/script/src/jobs/events.d.ts +0 -23
  686. package/script/src/jobs/events.d.ts.map +0 -1
  687. package/script/src/jobs/events.js +0 -50
  688. package/script/src/jobs/format.d.ts +0 -16
  689. package/script/src/jobs/format.d.ts.map +0 -1
  690. package/script/src/jobs/format.js +0 -193
  691. package/script/src/jobs/http.d.ts +0 -22
  692. package/script/src/jobs/http.d.ts.map +0 -1
  693. package/script/src/jobs/http.js +0 -50
  694. package/script/src/jobs/log.d.ts +0 -2
  695. package/script/src/jobs/log.d.ts.map +0 -1
  696. package/script/src/jobs/log.js +0 -13
  697. package/script/src/jobs/mod.d.ts +0 -11
  698. package/script/src/jobs/mod.d.ts.map +0 -1
  699. package/script/src/jobs/mod.js +0 -26
  700. package/script/src/jobs/run.d.ts +0 -39
  701. package/script/src/jobs/run.d.ts.map +0 -1
  702. package/script/src/jobs/run.js +0 -86
  703. package/script/src/jobs/sanitize.d.ts +0 -30
  704. package/script/src/jobs/sanitize.d.ts.map +0 -1
  705. package/script/src/jobs/sanitize.js +0 -97
  706. package/script/src/jobs/types.d.ts +0 -31
  707. package/script/src/jobs/types.d.ts.map +0 -1
  708. package/script/src/jobs/types.js +0 -2
  709. package/script/src/mail/errors.d.ts +0 -33
  710. package/script/src/mail/errors.d.ts.map +0 -1
  711. package/script/src/mail/errors.js +0 -97
  712. package/script/src/mail/memory.d.ts +0 -30
  713. package/script/src/mail/memory.d.ts.map +0 -1
  714. package/script/src/mail/memory.js +0 -345
  715. package/script/src/mail/mod.d.ts +0 -7
  716. package/script/src/mail/mod.d.ts.map +0 -1
  717. package/script/src/mail/mod.js +0 -22
  718. package/script/src/mail/postal.d.ts +0 -57
  719. package/script/src/mail/postal.d.ts.map +0 -1
  720. package/script/src/mail/postal.js +0 -251
  721. package/script/src/mail/retry.d.ts +0 -9
  722. package/script/src/mail/retry.d.ts.map +0 -1
  723. package/script/src/mail/retry.js +0 -22
  724. package/script/src/mail/sender.d.ts +0 -5
  725. package/script/src/mail/sender.d.ts.map +0 -1
  726. package/script/src/mail/sender.js +0 -52
  727. package/script/src/mail/service.d.ts +0 -23
  728. package/script/src/mail/service.d.ts.map +0 -1
  729. package/script/src/mail/service.js +0 -191
  730. package/script/src/mail/types.d.ts +0 -176
  731. package/script/src/mail/types.d.ts.map +0 -1
  732. package/script/src/mail/types.js +0 -2
  733. package/script/src/mui/apiKeys.d.ts +0 -171
  734. package/script/src/mui/apiKeys.d.ts.map +0 -1
  735. package/script/src/mui/apiKeys.js +0 -470
  736. package/script/src/mui/apiKeysView.d.ts +0 -193
  737. package/script/src/mui/apiKeysView.d.ts.map +0 -1
  738. package/script/src/mui/apiKeysView.js +0 -331
  739. package/script/src/mui/confirm.d.ts +0 -12
  740. package/script/src/mui/confirm.d.ts.map +0 -1
  741. package/script/src/mui/confirm.js +0 -85
  742. package/script/src/mui/mail.d.ts +0 -29
  743. package/script/src/mui/mail.d.ts.map +0 -1
  744. package/script/src/mui/mail.js +0 -159
  745. package/script/src/mui/mailView.d.ts +0 -20
  746. package/script/src/mui/mailView.d.ts.map +0 -1
  747. package/script/src/mui/mailView.js +0 -32
  748. package/script/src/mui/mod.d.ts +0 -5
  749. package/script/src/mui/mod.d.ts.map +0 -1
  750. package/script/src/mui/mod.js +0 -20
  751. package/script/src/next/apiKeys/mod.d.ts +0 -71
  752. package/script/src/next/apiKeys/mod.d.ts.map +0 -1
  753. package/script/src/next/apiKeys/mod.js +0 -227
  754. package/script/src/next/auth/client.d.ts.map +0 -1
  755. package/script/src/next/auth/client.js +0 -39
  756. package/script/src/next/auth/config.d.ts +0 -62
  757. package/script/src/next/auth/config.d.ts.map +0 -1
  758. package/script/src/next/auth/config.js +0 -178
  759. package/script/src/next/auth/localTestLogin.d.ts +0 -75
  760. package/script/src/next/auth/localTestLogin.d.ts.map +0 -1
  761. package/script/src/next/auth/localTestLogin.js +0 -291
  762. package/script/src/next/auth/mod.d.ts +0 -4
  763. package/script/src/next/auth/mod.d.ts.map +0 -1
  764. package/script/src/next/auth/mod.js +0 -19
  765. package/script/src/next/auth/server.d.ts +0 -44
  766. package/script/src/next/auth/server.d.ts.map +0 -1
  767. package/script/src/next/auth/server.js +0 -39
  768. package/script/src/next/files/mod.d.ts +0 -3
  769. package/script/src/next/files/mod.d.ts.map +0 -1
  770. package/script/src/next/files/mod.js +0 -18
  771. package/script/src/next/files/route.d.ts +0 -99
  772. package/script/src/next/files/route.d.ts.map +0 -1
  773. package/script/src/next/files/route.js +0 -353
  774. package/script/src/next/jobs/list.d.ts +0 -25
  775. package/script/src/next/jobs/list.d.ts.map +0 -1
  776. package/script/src/next/jobs/list.js +0 -48
  777. package/script/src/next/jobs/mod.d.ts +0 -6
  778. package/script/src/next/jobs/mod.d.ts.map +0 -1
  779. package/script/src/next/jobs/mod.js +0 -21
  780. package/script/src/next/jobs/paths.d.ts +0 -14
  781. package/script/src/next/jobs/paths.d.ts.map +0 -1
  782. package/script/src/next/jobs/paths.js +0 -47
  783. package/script/src/next/jobs/route.d.ts +0 -48
  784. package/script/src/next/jobs/route.d.ts.map +0 -1
  785. package/script/src/next/jobs/route.js +0 -105
  786. package/script/src/next/jobs/run.d.ts +0 -58
  787. package/script/src/next/jobs/run.d.ts.map +0 -1
  788. package/script/src/next/jobs/run.js +0 -592
  789. package/script/src/next/jobs/runRequest.d.ts +0 -19
  790. package/script/src/next/jobs/runRequest.d.ts.map +0 -1
  791. package/script/src/next/jobs/runRequest.js +0 -81
  792. package/script/src/next/jobs/stream.d.ts +0 -3
  793. package/script/src/next/jobs/stream.d.ts.map +0 -1
  794. package/script/src/next/jobs/stream.js +0 -28
  795. package/script/src/next/mail/mod.d.ts +0 -3
  796. package/script/src/next/mail/mod.d.ts.map +0 -1
  797. package/script/src/next/mail/mod.js +0 -18
  798. package/script/src/next/mail/route.d.ts +0 -12
  799. package/script/src/next/mail/route.d.ts.map +0 -1
  800. package/script/src/next/mail/route.js +0 -46
  801. package/script/src/next/pwa/mod.d.ts +0 -112
  802. package/script/src/next/pwa/mod.d.ts.map +0 -1
  803. package/script/src/next/pwa/mod.js +0 -303
  804. package/script/src/next/pwa/worker.d.ts +0 -27
  805. package/script/src/next/pwa/worker.d.ts.map +0 -1
  806. package/script/src/next/pwa/worker.js +0 -33
  807. package/script/src/next/secrets/mod.d.ts +0 -108
  808. package/script/src/next/secrets/mod.d.ts.map +0 -1
  809. package/script/src/next/secrets/mod.js +0 -218
  810. package/script/src/secrets/encoding.d.ts +0 -32
  811. package/script/src/secrets/encoding.d.ts.map +0 -1
  812. package/script/src/secrets/encoding.js +0 -95
  813. package/script/src/secrets/errors.d.ts +0 -45
  814. package/script/src/secrets/errors.d.ts.map +0 -1
  815. package/script/src/secrets/errors.js +0 -45
  816. package/script/src/secrets/fingerprint.d.ts +0 -43
  817. package/script/src/secrets/fingerprint.d.ts.map +0 -1
  818. package/script/src/secrets/fingerprint.js +0 -92
  819. package/script/src/secrets/frame.d.ts +0 -34
  820. package/script/src/secrets/frame.d.ts.map +0 -1
  821. package/script/src/secrets/frame.js +0 -91
  822. package/script/src/secrets/keyring.d.ts +0 -62
  823. package/script/src/secrets/keyring.d.ts.map +0 -1
  824. package/script/src/secrets/keyring.js +0 -202
  825. package/script/src/secrets/legacy.d.ts +0 -60
  826. package/script/src/secrets/legacy.d.ts.map +0 -1
  827. package/script/src/secrets/legacy.js +0 -186
  828. package/script/src/secrets/maintenance.d.ts +0 -173
  829. package/script/src/secrets/maintenance.d.ts.map +0 -1
  830. package/script/src/secrets/maintenance.js +0 -323
  831. package/script/src/secrets/mod.d.ts +0 -6
  832. package/script/src/secrets/mod.d.ts.map +0 -1
  833. package/script/src/secrets/mod.js +0 -24
  834. package/script/src/secrets/secrets.d.ts +0 -192
  835. package/script/src/secrets/secrets.d.ts.map +0 -1
  836. package/script/src/secrets/secrets.js +0 -532
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveApiKeyCredentialOptions = resolveApiKeyCredentialOptions;
4
- exports.describeApiKeyTransports = describeApiKeyTransports;
5
- exports.extractApiKeyCredential = extractApiKeyCredential;
6
- const DEFAULT_QUERY_NAME = "apiKey";
7
- const DEFAULT_X_API_KEY_HEADER = "x-api-key";
8
- /**
9
- * Applies Loom's credential defaults: Bearer and the `x-api-key` header are
10
- * accepted unless disabled, and query credentials only when enabled.
11
- * `extractApiKeyCredential` uses the same resolution.
12
- */
13
- function resolveApiKeyCredentialOptions(options = {}) {
14
- return {
15
- allowAuthorizationBearer: options.allowAuthorizationBearer !== false,
16
- allowQuery: options.allowQuery === true,
17
- allowXApiKey: options.allowXApiKey !== false,
18
- queryName: options.queryName ?? DEFAULT_QUERY_NAME,
19
- xApiKeyHeaderName: options.xApiKeyHeaderName ?? DEFAULT_X_API_KEY_HEADER,
20
- };
21
- }
22
- /**
23
- * Describes which transports `options` accept and which to recommend, so UI
24
- * copy can derive from the same object the authorizer uses. Pure and
25
- * import-free at runtime, so client components can call it.
26
- */
27
- function describeApiKeyTransports(options = {}) {
28
- const resolved = resolveApiKeyCredentialOptions(options);
29
- const accepted = [];
30
- if (resolved.allowAuthorizationBearer)
31
- accepted.push("authorization-bearer");
32
- if (resolved.allowXApiKey)
33
- accepted.push("x-api-key");
34
- if (resolved.allowQuery)
35
- accepted.push("query");
36
- return {
37
- accepted,
38
- bearer: resolved.allowAuthorizationBearer,
39
- headerName: resolved.allowXApiKey ? resolved.xApiKeyHeaderName : null,
40
- preferred: accepted[0] ?? null,
41
- queryName: resolved.allowQuery ? resolved.queryName : null,
42
- };
43
- }
44
- // API keys and Bearer tokens (RFC 6750) never contain a comma, so a comma
45
- // means several credentials arrived, never one key. Repeated `x-api-key` lines
46
- // reach `Headers.get` joined with ", " on Node and in fetch runtimes. Node's
47
- // HTTP parser instead keeps only the first of repeated `Authorization` lines,
48
- // so there the comma check only covers a literal comma in the header (and any
49
- // runtime that joins); the first value still goes through full verification.
50
- function bearerCandidate(headers) {
51
- const value = headers.get("authorization");
52
- if (value === null)
53
- return null;
54
- if (value.includes(",")) {
55
- return { ambiguous: true, transport: "authorization-bearer" };
56
- }
57
- // The auth-scheme name is case-insensitive (RFC 7235); the single space
58
- // and the whitespace-free token are not relaxed.
59
- const match = /^Bearer ([^\s]+)$/i.exec(value);
60
- return match
61
- ? { credential: match[1], transport: "authorization-bearer" }
62
- : { malformed: true, transport: "authorization-bearer" };
63
- }
64
- function valueCandidate(value, transport) {
65
- if (value === null)
66
- return null;
67
- if (transport === "x-api-key" && value.includes(",")) {
68
- return { ambiguous: true, transport };
69
- }
70
- if (value.trim() === "" || value !== value.trim()) {
71
- return { malformed: true, transport };
72
- }
73
- return { credential: value, transport };
74
- }
75
- function queryCandidate(searchParams, name) {
76
- const values = searchParams?.getAll(name) ?? [];
77
- if (values.length > 1)
78
- return { ambiguous: true, transport: "query" };
79
- return valueCandidate(values[0] ?? null, "query");
80
- }
81
- /**
82
- * Extracts exactly one API-key credential without selecting a precedence.
83
- * Several transports, a repeated header (a comma in its value), or a repeated
84
- * query parameter are `ambiguous`.
85
- */
86
- function extractApiKeyCredential(source, options = {}) {
87
- const resolved = resolveApiKeyCredentialOptions(options);
88
- const candidates = [];
89
- if (resolved.allowAuthorizationBearer) {
90
- const candidate = bearerCandidate(source.headers);
91
- if (candidate)
92
- candidates.push(candidate);
93
- }
94
- if (resolved.allowXApiKey) {
95
- const candidate = valueCandidate(source.headers.get(resolved.xApiKeyHeaderName), "x-api-key");
96
- if (candidate)
97
- candidates.push(candidate);
98
- }
99
- if (resolved.allowQuery) {
100
- const candidate = queryCandidate(source.searchParams, resolved.queryName);
101
- if (candidate)
102
- candidates.push(candidate);
103
- }
104
- if (candidates.length === 0)
105
- return { kind: "missing" };
106
- if (candidates.length > 1 || candidates.some((candidate) => candidate.ambiguous)) {
107
- return {
108
- kind: "ambiguous",
109
- transports: candidates.map((candidate) => candidate.transport),
110
- };
111
- }
112
- const candidate = candidates[0];
113
- if (candidate.malformed || candidate.credential === undefined) {
114
- return { kind: "malformed", transport: candidate.transport };
115
- }
116
- return {
117
- credential: candidate.credential,
118
- kind: "present",
119
- transport: candidate.transport,
120
- };
121
- }
@@ -1,3 +0,0 @@
1
- /** Produces a lowercase SHA-256 fingerprint without retaining the credential. */
2
- export declare function fingerprintApiKeyCredential(credential: string): Promise<string>;
3
- //# sourceMappingURL=fingerprint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../../src/src/apiKeys/fingerprint.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,wBAAsB,2BAA2B,CAAC,UAAU,EAAE,MAAM,mBASnE"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fingerprintApiKeyCredential = fingerprintApiKeyCredential;
4
- /** Produces a lowercase SHA-256 fingerprint without retaining the credential. */
5
- async function fingerprintApiKeyCredential(credential) {
6
- const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(credential));
7
- return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
8
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/src/apiKeys/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,MAAM,wBAAwB,GAChC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GACzC,mBAAmB,CAAC;AAExB,0DAA0D;AAC1D,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG,mBAAmB,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /**
3
- * Type-only contracts shared by an app's API-key lifecycle server actions and
4
- * the optional MUI components. This module has no runtime code, so server
5
- * action files can import these types without touching a client module.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,132 +0,0 @@
1
- /**
2
- * Bounds shared by API-key lifecycle validation, the MUI dialogs, and the
3
- * consumer's Better Auth api-key plugin configuration.
4
- *
5
- * Pass the same values to the plugin (see `betterAuthApiKeyLimitOptions`) and
6
- * to these validators so input the app accepts is never rejected later by the
7
- * plugin with a raw library message.
8
- */
9
- export interface ApiKeyLimits {
10
- /**
11
- * Longest custom expiry, in days (plugin `keyExpiration.maxExpiresIn`).
12
- * Keys created without an expiry never expire and are not bound by this.
13
- */
14
- maxExpiresInDays: number;
15
- /** Longest trimmed key name (plugin `maximumNameLength`). */
16
- maxNameLength: number;
17
- /** Shortest custom expiry, in days (plugin `keyExpiration.minExpiresIn`). */
18
- minExpiresInDays: number;
19
- /** Shortest trimmed key name (plugin `minimumNameLength`). At least 1. */
20
- minNameLength: number;
21
- }
22
- /** A validated value, or a message that is safe to show to the user. */
23
- export type ApiKeyValidationResult<TValue> = {
24
- ok: true;
25
- value: TValue;
26
- } | {
27
- message: string;
28
- ok: false;
29
- };
30
- /** User-facing messages derived from one set of limits. */
31
- export interface ApiKeyLimitMessages {
32
- /** A custom expiry that is not a parseable date. */
33
- expiryInvalid: string;
34
- /** No expiry was chosen although no-expiry keys are not allowed. */
35
- expiryRequired: string;
36
- /** A custom expiry beyond `maxExpiresInDays`. */
37
- expiryTooLate: string;
38
- /** A custom expiry before `minExpiresInDays`, or not in the future. */
39
- expiryTooSoon: string;
40
- /** A blank or out-of-range trimmed key name. */
41
- nameLength: string;
42
- }
43
- /** Options for `resolveApiKeyExpiresIn`. */
44
- export interface ResolveApiKeyExpiresInOptions {
45
- /**
46
- * Whether a missing expiry (`null`/`undefined`) is accepted. It means
47
- * "never expires" only while the plugin's `keyExpiration.defaultExpiresIn`
48
- * is `null`. Defaults to `true`; pass `false` when the app requires every
49
- * key to expire.
50
- */
51
- allowNoExpiry?: boolean;
52
- /** Reference time; defaults to `Date.now()`. */
53
- now?: Date | number;
54
- /**
55
- * Slack, in seconds, for an expiry chosen right at a limit. Defaults to
56
- * `API_KEY_EXPIRY_TOLERANCE_SECONDS`.
57
- */
58
- toleranceSeconds?: number;
59
- }
60
- /** Better Auth api-key plugin options derived from `ApiKeyLimits`. */
61
- export interface BetterAuthApiKeyLimitOptions {
62
- /** Both values are in days, matching the plugin. */
63
- keyExpiration: {
64
- maxExpiresIn: number;
65
- minExpiresIn: number;
66
- };
67
- maximumNameLength: number;
68
- minimumNameLength: number;
69
- }
70
- /** Seconds in one day; the plugin compares `expiresIn / 86400` to its limits. */
71
- export declare const API_KEY_SECONDS_PER_DAY = 86400;
72
- /**
73
- * Default slack for a custom expiry chosen right at a limit. The browser
74
- * converts the chosen date before the request reaches the server, and clocks
75
- * drift, so "one day from now" arrives a little under one day away. Values
76
- * within this slack are clamped onto the limit instead of being rejected.
77
- */
78
- export declare const API_KEY_EXPIRY_TOLERANCE_SECONDS = 300;
79
- /**
80
- * Builds the user-facing messages for one set of limits.
81
- *
82
- * Server validation, the MUI dialogs, and `betterAuthApiKeyInputErrorMessage`
83
- * all use these, so the same input produces the same text everywhere. Bounds
84
- * omitted from `limits` fall back to the generic messages Loom's dialogs used
85
- * before limits existed.
86
- */
87
- export declare function apiKeyLimitMessages(limits: Partial<ApiKeyLimits>): ApiKeyLimitMessages;
88
- /**
89
- * Validates and trims an untrusted key name.
90
- *
91
- * Accepts `unknown` because server-action arguments are untrusted. A blank
92
- * name is always rejected. Omitted bounds are not enforced here, so pass the
93
- * same complete `ApiKeyLimits` given to the plugin.
94
- */
95
- export declare function validateApiKeyName(name: unknown, limits: Partial<ApiKeyLimits>): ApiKeyValidationResult<string>;
96
- /**
97
- * Converts an untrusted absolute expiry into the plugin's relative
98
- * `expiresIn` seconds, or `null` when no expiry was chosen.
99
- *
100
- * Only strings are accepted (parsed with `Date`; send ISO timestamps), and
101
- * `null`/`undefined` mean no expiry unless `allowNoExpiry` is `false`. Values
102
- * beyond the tolerance past a limit are rejected with a readable message;
103
- * values within it are clamped onto the limit, so a returned number always
104
- * lies inside the plugin's inclusive bounds. The result is never below 1,
105
- * because the plugin treats a falsy `expiresIn` as "not given". Pass
106
- * `value ?? undefined` to `createApiKey`.
107
- *
108
- * For a key without `expiresIn` the plugin applies
109
- * `keyExpiration.defaultExpiresIn`, so `null` only means "never expires"
110
- * while that option is `null` (the plugin default).
111
- */
112
- export declare function resolveApiKeyExpiresIn(expiresAt: unknown, limits: Partial<ApiKeyLimits>, options?: ResolveApiKeyExpiresInOptions): ApiKeyValidationResult<number | null>;
113
- /**
114
- * Maps a correctable Better Auth api-key plugin rejection to the same message
115
- * local validation would show, or returns `null` for anything else.
116
- *
117
- * Structural, like Better Auth's own `isAPIError`: it reads `error.body.code`
118
- * from an error named `APIError` without importing Better Auth. Every other
119
- * error, including other plugin codes, returns `null` and should be rethrown
120
- * unchanged.
121
- */
122
- export declare function betterAuthApiKeyInputErrorMessage(error: unknown, limits: ApiKeyLimits): string | null;
123
- /**
124
- * Returns the Better Auth api-key plugin options that enforce `limits`.
125
- *
126
- * Merge `keyExpiration` with any other expiration options the app sets, for
127
- * example `keyExpiration: { ...options.keyExpiration, defaultExpiresIn: null }`.
128
- * It deliberately leaves `defaultExpiresIn` alone: keep it `null` (the plugin
129
- * default) when "Never" should mean a key that never expires.
130
- */
131
- export declare function betterAuthApiKeyLimitOptions(limits: ApiKeyLimits): BetterAuthApiKeyLimitOptions;
132
- //# sourceMappingURL=limits.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/src/apiKeys/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,gBAAgB,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wEAAwE;AACxE,MAAM,MAAM,sBAAsB,CAAC,MAAM,IACrC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnC,2DAA2D;AAC3D,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gDAAgD;IAChD,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,sEAAsE;AACtE,MAAM,WAAW,4BAA4B;IAC3C,oDAAoD;IACpD,aAAa,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAwFpD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAC5B,mBAAmB,CA4BrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAC5B,sBAAsB,CAAC,MAAM,CAAC,CAahC;AAcD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,EAC7B,OAAO,GAAE,6BAAkC,GAC1C,sBAAsB,CAAC,MAAM,GAAG,IAAI,CAAC,CA4CvC;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,YAAY,GACnB,MAAM,GAAG,IAAI,CAcf;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,GACnB,4BAA4B,CAU9B"}
@@ -1,254 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_KEY_EXPIRY_TOLERANCE_SECONDS = exports.API_KEY_SECONDS_PER_DAY = void 0;
4
- exports.apiKeyLimitMessages = apiKeyLimitMessages;
5
- exports.validateApiKeyName = validateApiKeyName;
6
- exports.resolveApiKeyExpiresIn = resolveApiKeyExpiresIn;
7
- exports.betterAuthApiKeyInputErrorMessage = betterAuthApiKeyInputErrorMessage;
8
- exports.betterAuthApiKeyLimitOptions = betterAuthApiKeyLimitOptions;
9
- /** Seconds in one day; the plugin compares `expiresIn / 86400` to its limits. */
10
- exports.API_KEY_SECONDS_PER_DAY = 86_400;
11
- /**
12
- * Default slack for a custom expiry chosen right at a limit. The browser
13
- * converts the chosen date before the request reaches the server, and clocks
14
- * drift, so "one day from now" arrives a little under one day away. Values
15
- * within this slack are clamped onto the limit instead of being rejected.
16
- */
17
- exports.API_KEY_EXPIRY_TOLERANCE_SECONDS = 300;
18
- const NAME_REQUIRED_MESSAGE = "Enter a name for this key.";
19
- const EXPIRY_IN_FUTURE_MESSAGE = "Choose a future expiry date.";
20
- function formatDays(days) {
21
- return days === 1 ? "1 day" : `${days} days`;
22
- }
23
- function formatCharacters(count) {
24
- return count === 1 ? "1 character" : `${count} characters`;
25
- }
26
- function assertDays(field, value) {
27
- if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
28
- throw new Error(`Invalid API-key limits: ${field} must be a finite number of days >= 0.`);
29
- }
30
- }
31
- function assertNameLength(field, value) {
32
- if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1) {
33
- throw new Error(`Invalid API-key limits: ${field} must be a safe integer >= 1.`);
34
- }
35
- }
36
- /**
37
- * Rejects malformed limits so a misconfiguration fails loudly rather than
38
- * silently validating nothing. Omitted fields are allowed here; the public
39
- * Better Auth helpers require every field through their types.
40
- */
41
- function assertLimits(limits) {
42
- if (!limits || typeof limits !== "object") {
43
- throw new Error("Invalid API-key limits: expected an object.");
44
- }
45
- const { maxExpiresInDays, maxNameLength, minExpiresInDays, minNameLength } = limits;
46
- if (minExpiresInDays !== undefined) {
47
- assertDays("minExpiresInDays", minExpiresInDays);
48
- }
49
- if (maxExpiresInDays !== undefined) {
50
- assertDays("maxExpiresInDays", maxExpiresInDays);
51
- }
52
- if (minNameLength !== undefined) {
53
- assertNameLength("minNameLength", minNameLength);
54
- }
55
- if (maxNameLength !== undefined) {
56
- assertNameLength("maxNameLength", maxNameLength);
57
- }
58
- if (minExpiresInDays !== undefined && maxExpiresInDays !== undefined &&
59
- minExpiresInDays > maxExpiresInDays) {
60
- throw new Error("Invalid API-key limits: minExpiresInDays exceeds maxExpiresInDays.");
61
- }
62
- if (minNameLength !== undefined && maxNameLength !== undefined &&
63
- minNameLength > maxNameLength) {
64
- throw new Error("Invalid API-key limits: minNameLength exceeds maxNameLength.");
65
- }
66
- }
67
- function assertCompleteLimits(limits) {
68
- assertLimits(limits);
69
- for (const field of [
70
- "maxExpiresInDays",
71
- "maxNameLength",
72
- "minExpiresInDays",
73
- "minNameLength",
74
- ]) {
75
- if (limits[field] === undefined) {
76
- throw new Error(`Invalid API-key limits: ${field} is required.`);
77
- }
78
- }
79
- }
80
- /**
81
- * Builds the user-facing messages for one set of limits.
82
- *
83
- * Server validation, the MUI dialogs, and `betterAuthApiKeyInputErrorMessage`
84
- * all use these, so the same input produces the same text everywhere. Bounds
85
- * omitted from `limits` fall back to the generic messages Loom's dialogs used
86
- * before limits existed.
87
- */
88
- function apiKeyLimitMessages(limits) {
89
- assertLimits(limits);
90
- const { maxExpiresInDays, maxNameLength, minExpiresInDays, minNameLength } = limits;
91
- let nameLength = NAME_REQUIRED_MESSAGE;
92
- if (minNameLength !== undefined && maxNameLength !== undefined) {
93
- nameLength =
94
- `Key names must be between ${minNameLength} and ${maxNameLength} characters.`;
95
- }
96
- else if (maxNameLength !== undefined) {
97
- nameLength = `Key names must be at most ${formatCharacters(maxNameLength)}.`;
98
- }
99
- else if (minNameLength !== undefined) {
100
- nameLength = `Key names must be at least ${formatCharacters(minNameLength)}.`;
101
- }
102
- return {
103
- expiryInvalid: "Expiry must be a valid date.",
104
- expiryRequired: "Choose an expiry date.",
105
- expiryTooLate: maxExpiresInDays === undefined
106
- ? "Expiry is too far in the future."
107
- : `Expiry must be no more than ${formatDays(maxExpiresInDays)} from now.`,
108
- expiryTooSoon: minExpiresInDays === undefined || minExpiresInDays === 0
109
- ? EXPIRY_IN_FUTURE_MESSAGE
110
- : `Expiry must be at least ${formatDays(minExpiresInDays)} from now.`,
111
- nameLength,
112
- };
113
- }
114
- /**
115
- * Validates and trims an untrusted key name.
116
- *
117
- * Accepts `unknown` because server-action arguments are untrusted. A blank
118
- * name is always rejected. Omitted bounds are not enforced here, so pass the
119
- * same complete `ApiKeyLimits` given to the plugin.
120
- */
121
- function validateApiKeyName(name, limits) {
122
- const messages = apiKeyLimitMessages(limits);
123
- const trimmed = typeof name === "string" ? name.trim() : "";
124
- if (trimmed.length === 0 ||
125
- (limits.minNameLength !== undefined &&
126
- trimmed.length < limits.minNameLength) ||
127
- (limits.maxNameLength !== undefined &&
128
- trimmed.length > limits.maxNameLength)) {
129
- return { message: messages.nameLength, ok: false };
130
- }
131
- return { ok: true, value: trimmed };
132
- }
133
- function referenceTime(now) {
134
- const value = now === undefined
135
- ? Date.now()
136
- : typeof now === "number"
137
- ? now
138
- : now.valueOf();
139
- if (!Number.isFinite(value)) {
140
- throw new Error("resolveApiKeyExpiresIn: `now` must be a valid time.");
141
- }
142
- return value;
143
- }
144
- /**
145
- * Converts an untrusted absolute expiry into the plugin's relative
146
- * `expiresIn` seconds, or `null` when no expiry was chosen.
147
- *
148
- * Only strings are accepted (parsed with `Date`; send ISO timestamps), and
149
- * `null`/`undefined` mean no expiry unless `allowNoExpiry` is `false`. Values
150
- * beyond the tolerance past a limit are rejected with a readable message;
151
- * values within it are clamped onto the limit, so a returned number always
152
- * lies inside the plugin's inclusive bounds. The result is never below 1,
153
- * because the plugin treats a falsy `expiresIn` as "not given". Pass
154
- * `value ?? undefined` to `createApiKey`.
155
- *
156
- * For a key without `expiresIn` the plugin applies
157
- * `keyExpiration.defaultExpiresIn`, so `null` only means "never expires"
158
- * while that option is `null` (the plugin default).
159
- */
160
- function resolveApiKeyExpiresIn(expiresAt, limits, options = {}) {
161
- const messages = apiKeyLimitMessages(limits);
162
- const tolerance = options.toleranceSeconds ??
163
- exports.API_KEY_EXPIRY_TOLERANCE_SECONDS;
164
- if (!Number.isFinite(tolerance) || tolerance < 0) {
165
- throw new Error("resolveApiKeyExpiresIn: toleranceSeconds must be a finite number >= 0.");
166
- }
167
- if (expiresAt === null || expiresAt === undefined) {
168
- return options.allowNoExpiry === false
169
- ? { message: messages.expiryRequired, ok: false }
170
- : { ok: true, value: null };
171
- }
172
- const target = typeof expiresAt === "string"
173
- ? new Date(expiresAt).valueOf()
174
- : Number.NaN;
175
- if (!Number.isFinite(target)) {
176
- return { message: messages.expiryInvalid, ok: false };
177
- }
178
- const seconds = Math.floor((target - referenceTime(options.now)) / 1000);
179
- // The slack only ever applies above "in the future": a past expiry is never
180
- // clamped into a valid one, whatever the configured minimum.
181
- const minSeconds = (limits.minExpiresInDays ?? 0) * exports.API_KEY_SECONDS_PER_DAY;
182
- if (seconds < Math.max(1, minSeconds - tolerance)) {
183
- return { message: messages.expiryTooSoon, ok: false };
184
- }
185
- if (limits.maxExpiresInDays !== undefined) {
186
- const maxSeconds = limits.maxExpiresInDays * exports.API_KEY_SECONDS_PER_DAY;
187
- if (seconds > maxSeconds + tolerance) {
188
- return { message: messages.expiryTooLate, ok: false };
189
- }
190
- }
191
- const lower = Math.max(1, Math.ceil(minSeconds));
192
- const upper = limits.maxExpiresInDays === undefined
193
- ? Number.POSITIVE_INFINITY
194
- : Math.floor(limits.maxExpiresInDays * exports.API_KEY_SECONDS_PER_DAY);
195
- if (upper < lower) {
196
- // A sub-second maximum cannot express any expiry the plugin accepts.
197
- return { message: messages.expiryTooLate, ok: false };
198
- }
199
- return { ok: true, value: Math.min(Math.max(seconds, lower), upper) };
200
- }
201
- /**
202
- * Plugin rejection codes a user can correct, mapped to message keys. Local
203
- * validation with the same limits should make these unreachable; mapping them
204
- * keeps configuration drift from showing a raw library message.
205
- */
206
- const BETTER_AUTH_INPUT_ERROR_MESSAGE_KEYS = new Map([
207
- ["EXPIRES_IN_IS_TOO_SMALL", "expiryTooSoon"],
208
- ["EXPIRES_IN_IS_TOO_LARGE", "expiryTooLate"],
209
- ["INVALID_NAME_LENGTH", "nameLength"],
210
- ["NAME_REQUIRED", "nameLength"],
211
- ]);
212
- /**
213
- * Maps a correctable Better Auth api-key plugin rejection to the same message
214
- * local validation would show, or returns `null` for anything else.
215
- *
216
- * Structural, like Better Auth's own `isAPIError`: it reads `error.body.code`
217
- * from an error named `APIError` without importing Better Auth. Every other
218
- * error, including other plugin codes, returns `null` and should be rethrown
219
- * unchanged.
220
- */
221
- function betterAuthApiKeyInputErrorMessage(error, limits) {
222
- assertCompleteLimits(limits);
223
- if (!error || typeof error !== "object" ||
224
- error.name !== "APIError") {
225
- return null;
226
- }
227
- const body = error.body;
228
- if (!body || typeof body !== "object")
229
- return null;
230
- const code = body.code;
231
- if (typeof code !== "string")
232
- return null;
233
- const key = BETTER_AUTH_INPUT_ERROR_MESSAGE_KEYS.get(code);
234
- return key ? apiKeyLimitMessages(limits)[key] : null;
235
- }
236
- /**
237
- * Returns the Better Auth api-key plugin options that enforce `limits`.
238
- *
239
- * Merge `keyExpiration` with any other expiration options the app sets, for
240
- * example `keyExpiration: { ...options.keyExpiration, defaultExpiresIn: null }`.
241
- * It deliberately leaves `defaultExpiresIn` alone: keep it `null` (the plugin
242
- * default) when "Never" should mean a key that never expires.
243
- */
244
- function betterAuthApiKeyLimitOptions(limits) {
245
- assertCompleteLimits(limits);
246
- return {
247
- keyExpiration: {
248
- maxExpiresIn: limits.maxExpiresInDays,
249
- minExpiresIn: limits.minExpiresInDays,
250
- },
251
- maximumNameLength: limits.maxNameLength,
252
- minimumNameLength: limits.minNameLength,
253
- };
254
- }
@@ -1,13 +0,0 @@
1
- import "../../_dnt.polyfills.js";
2
- export * from "./authorize.js";
3
- export * from "./betterAuth.js";
4
- export * from "./country.js";
5
- export * from "./credentials.js";
6
- export * from "./fingerprint.js";
7
- export * from "./lifecycle.js";
8
- export * from "./limits.js";
9
- export * from "./permissions.js";
10
- export * from "./policy.js";
11
- export * from "./retention.js";
12
- export * from "./types.js";
13
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/apiKeys/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- require("../../_dnt.polyfills.js");
18
- __exportStar(require("./authorize.js"), exports);
19
- __exportStar(require("./betterAuth.js"), exports);
20
- __exportStar(require("./country.js"), exports);
21
- __exportStar(require("./credentials.js"), exports);
22
- __exportStar(require("./fingerprint.js"), exports);
23
- __exportStar(require("./lifecycle.js"), exports);
24
- __exportStar(require("./limits.js"), exports);
25
- __exportStar(require("./permissions.js"), exports);
26
- __exportStar(require("./policy.js"), exports);
27
- __exportStar(require("./retention.js"), exports);
28
- __exportStar(require("./types.js"), exports);
@@ -1,56 +0,0 @@
1
- import type { ApiKeyScopeDefinitions, DefinedApiKeyScopes } from "./policy.js";
2
- import type { ApiKeyPermission } from "./types.js";
3
- /** Native Better Auth api-key permissions: resource name to action list. */
4
- export type ApiKeyPermissionRecord = Record<string, string[]>;
5
- type ScopeId<TDefinitions extends ApiKeyScopeDefinitions> = Extract<keyof TDefinitions, string>;
6
- /**
7
- * Reports whether decoded api-key permissions grant exactly `permission`.
8
- *
9
- * `decoded` must already be decoded: Better Auth's `verifyApiKey` result, or a
10
- * raw column passed through `decodeStoredApiKeyPermissions`. Strings are never
11
- * decoded here, because Better Auth has already decoded the column once; a
12
- * string at this point means double-encoded storage, which Better Auth's own
13
- * check denies too.
14
- *
15
- * Fails closed: anything but a plain or null-prototype object, inherited
16
- * properties, non-array action lists, and non-identical action strings never
17
- * match. This is stricter than Better Auth's check, which reads inherited
18
- * properties and would substring-match an action list stored as a string.
19
- */
20
- export declare function hasApiKeyPermission(decoded: unknown, permission: ApiKeyPermission): boolean;
21
- /**
22
- * Decodes a raw stored `apikey.permissions` value exactly once.
23
- *
24
- * Better Auth stores permissions as JSON text. A string is parsed once, and
25
- * malformed JSON yields `null`; any other value is returned unchanged so a
26
- * database driver that already decoded the column still works. JSON that
27
- * decodes to another string, i.e. double-encoded storage, is returned as that
28
- * string and therefore grants nothing.
29
- */
30
- export declare function decodeStoredApiKeyPermissions(stored: unknown): unknown;
31
- /**
32
- * Converts scope IDs into the native permissions to store on a new key.
33
- *
34
- * Actions for scopes that share a resource are merged rather than replaced,
35
- * and duplicates are removed. An ID that is not an own registry entry throws:
36
- * validate untrusted input against the registry first.
37
- */
38
- export declare function apiKeyPermissionsFromScopeIds<TDefinitions extends ApiKeyScopeDefinitions>(registry: DefinedApiKeyScopes<TDefinitions>, scopeIds: readonly string[]): ApiKeyPermissionRecord;
39
- /**
40
- * Lists the registry scope IDs that decoded permissions grant exactly, in
41
- * registry order. Grants outside the registry are ignored.
42
- */
43
- export declare function apiKeyScopeIdsFromPermissions<TDefinitions extends ApiKeyScopeDefinitions>(registry: DefinedApiKeyScopes<TDefinitions>, decoded: unknown): ScopeId<TDefinitions>[];
44
- /**
45
- * Builds the explicit principal permissions for a verified key: the registry
46
- * permissions that decoded permissions grant exactly, in registry order.
47
- */
48
- export declare function apiKeyPrincipalPermissions<TDefinitions extends ApiKeyScopeDefinitions>(registry: DefinedApiKeyScopes<TDefinitions>, decoded: unknown): ApiKeyPermission[];
49
- /**
50
- * Flattens every exact grant in decoded permissions, for verifiers without a
51
- * registry. Non-plain objects, inherited properties, non-array action lists,
52
- * and non-string or empty actions are skipped.
53
- */
54
- export declare function apiKeyGrantedPermissions(decoded: unknown): ApiKeyPermission[];
55
- export {};
56
- //# sourceMappingURL=permissions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/src/apiKeys/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,4EAA4E;AAC5E,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAE9D,KAAK,OAAO,CAAC,YAAY,SAAS,sBAAsB,IAAI,OAAO,CACjE,MAAM,YAAY,EAClB,MAAM,CACP,CAAC;AAaF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,gBAAgB,GAC3B,OAAO,CAST;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAOtE;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,SAAS,sBAAsB,EAE3C,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,EAC3C,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,sBAAsB,CAiBxB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,SAAS,sBAAsB,EAE3C,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,EAC3C,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC,EAAE,CAIzB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,SAAS,sBAAsB,EAE3C,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,EAC3C,OAAO,EAAE,OAAO,GACf,gBAAgB,EAAE,CAOpB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,EAAE,CAe7E"}