@gadicc/loom 0.0.0-oidc-bootstrap.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 (342) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +6 -0
  3. package/README.md +448 -0
  4. package/THIRD_PARTY_NOTICES.md +25 -0
  5. package/db/drizzle-config.d.ts +20 -0
  6. package/db/drizzle-config.js +34 -0
  7. package/db/fixtures.d.ts +31 -0
  8. package/db/fixtures.js +52 -0
  9. package/db/neon.d.ts +3 -0
  10. package/db/neon.js +20 -0
  11. package/db/neonFull.d.ts +12 -0
  12. package/db/neonFull.js +33 -0
  13. package/db/package.json +3 -0
  14. package/db/testing.d.ts +26 -0
  15. package/db/testing.js +76 -0
  16. package/db/testing.test.ts +28 -0
  17. package/db/valibot.d.ts +23 -0
  18. package/db/valibot.js +8 -0
  19. package/esm/_dnt.polyfills.d.ts +149 -0
  20. package/esm/_dnt.polyfills.d.ts.map +1 -0
  21. package/esm/_dnt.polyfills.js +163 -0
  22. package/esm/_dnt.shims.d.ts +2 -0
  23. package/esm/_dnt.shims.d.ts.map +1 -0
  24. package/esm/_dnt.shims.js +57 -0
  25. package/esm/bin/loom.d.ts +2 -0
  26. package/esm/bin/loom.d.ts.map +1 -0
  27. package/esm/bin/loom.js +11 -0
  28. package/esm/mod.d.ts +9 -0
  29. package/esm/mod.d.ts.map +1 -0
  30. package/esm/mod.js +8 -0
  31. package/esm/package.json +3 -0
  32. package/esm/src/apiKeys/authorize.d.ts +4 -0
  33. package/esm/src/apiKeys/authorize.d.ts.map +1 -0
  34. package/esm/src/apiKeys/authorize.js +184 -0
  35. package/esm/src/apiKeys/country.d.ts +3 -0
  36. package/esm/src/apiKeys/country.d.ts.map +1 -0
  37. package/esm/src/apiKeys/country.js +7 -0
  38. package/esm/src/apiKeys/credentials.d.ts +4 -0
  39. package/esm/src/apiKeys/credentials.d.ts.map +1 -0
  40. package/esm/src/apiKeys/credentials.js +55 -0
  41. package/esm/src/apiKeys/fingerprint.d.ts +3 -0
  42. package/esm/src/apiKeys/fingerprint.d.ts.map +1 -0
  43. package/esm/src/apiKeys/fingerprint.js +5 -0
  44. package/esm/src/apiKeys/mod.d.ts +9 -0
  45. package/esm/src/apiKeys/mod.d.ts.map +1 -0
  46. package/esm/src/apiKeys/mod.js +8 -0
  47. package/esm/src/apiKeys/policy.d.ts +59 -0
  48. package/esm/src/apiKeys/policy.d.ts.map +1 -0
  49. package/esm/src/apiKeys/policy.js +88 -0
  50. package/esm/src/apiKeys/retention.d.ts +55 -0
  51. package/esm/src/apiKeys/retention.d.ts.map +1 -0
  52. package/esm/src/apiKeys/retention.js +65 -0
  53. package/esm/src/apiKeys/types.d.ts +175 -0
  54. package/esm/src/apiKeys/types.d.ts.map +1 -0
  55. package/esm/src/apiKeys/types.js +1 -0
  56. package/esm/src/cli/externalSkills.d.ts +39 -0
  57. package/esm/src/cli/externalSkills.d.ts.map +1 -0
  58. package/esm/src/cli/externalSkills.js +177 -0
  59. package/esm/src/cli/mod.d.ts +337 -0
  60. package/esm/src/cli/mod.d.ts.map +1 -0
  61. package/esm/src/cli/mod.js +9268 -0
  62. package/esm/src/cli/projectSkills.d.ts +102 -0
  63. package/esm/src/cli/projectSkills.d.ts.map +1 -0
  64. package/esm/src/cli/projectSkills.js +592 -0
  65. package/esm/src/files/client.d.ts +29 -0
  66. package/esm/src/files/client.d.ts.map +1 -0
  67. package/esm/src/files/client.js +41 -0
  68. package/esm/src/files/errors.d.ts +37 -0
  69. package/esm/src/files/errors.d.ts.map +1 -0
  70. package/esm/src/files/errors.js +66 -0
  71. package/esm/src/files/hash.d.ts +15 -0
  72. package/esm/src/files/hash.d.ts.map +1 -0
  73. package/esm/src/files/hash.js +82 -0
  74. package/esm/src/files/memory.d.ts +29 -0
  75. package/esm/src/files/memory.d.ts.map +1 -0
  76. package/esm/src/files/memory.js +109 -0
  77. package/esm/src/files/metadata.d.ts +10 -0
  78. package/esm/src/files/metadata.d.ts.map +1 -0
  79. package/esm/src/files/metadata.js +186 -0
  80. package/esm/src/files/mod.d.ts +10 -0
  81. package/esm/src/files/mod.d.ts.map +1 -0
  82. package/esm/src/files/mod.js +9 -0
  83. package/esm/src/files/s3.d.ts +29 -0
  84. package/esm/src/files/s3.d.ts.map +1 -0
  85. package/esm/src/files/s3.js +107 -0
  86. package/esm/src/files/service.d.ts +27 -0
  87. package/esm/src/files/service.d.ts.map +1 -0
  88. package/esm/src/files/service.js +136 -0
  89. package/esm/src/files/types.d.ts +134 -0
  90. package/esm/src/files/types.d.ts.map +1 -0
  91. package/esm/src/files/types.js +1 -0
  92. package/esm/src/jobs/catalog.d.ts +32 -0
  93. package/esm/src/jobs/catalog.d.ts.map +1 -0
  94. package/esm/src/jobs/catalog.js +208 -0
  95. package/esm/src/jobs/controller.d.ts +28 -0
  96. package/esm/src/jobs/controller.d.ts.map +1 -0
  97. package/esm/src/jobs/controller.js +95 -0
  98. package/esm/src/jobs/direct.d.ts +36 -0
  99. package/esm/src/jobs/direct.d.ts.map +1 -0
  100. package/esm/src/jobs/direct.js +122 -0
  101. package/esm/src/jobs/events.d.ts +15 -0
  102. package/esm/src/jobs/events.d.ts.map +1 -0
  103. package/esm/src/jobs/events.js +30 -0
  104. package/esm/src/jobs/format.d.ts +16 -0
  105. package/esm/src/jobs/format.d.ts.map +1 -0
  106. package/esm/src/jobs/format.js +183 -0
  107. package/esm/src/jobs/http.d.ts +22 -0
  108. package/esm/src/jobs/http.d.ts.map +1 -0
  109. package/esm/src/jobs/http.js +44 -0
  110. package/esm/src/jobs/log.d.ts +2 -0
  111. package/esm/src/jobs/log.d.ts.map +1 -0
  112. package/esm/src/jobs/log.js +10 -0
  113. package/esm/src/jobs/mod.d.ts +10 -0
  114. package/esm/src/jobs/mod.d.ts.map +1 -0
  115. package/esm/src/jobs/mod.js +9 -0
  116. package/esm/src/jobs/run.d.ts +20 -0
  117. package/esm/src/jobs/run.d.ts.map +1 -0
  118. package/esm/src/jobs/run.js +57 -0
  119. package/esm/src/jobs/types.d.ts +31 -0
  120. package/esm/src/jobs/types.d.ts.map +1 -0
  121. package/esm/src/jobs/types.js +1 -0
  122. package/esm/src/mui/apiKeys.d.ts +65 -0
  123. package/esm/src/mui/apiKeys.d.ts.map +1 -0
  124. package/esm/src/mui/apiKeys.js +301 -0
  125. package/esm/src/mui/apiKeysView.d.ts +48 -0
  126. package/esm/src/mui/apiKeysView.d.ts.map +1 -0
  127. package/esm/src/mui/apiKeysView.js +34 -0
  128. package/esm/src/mui/confirm.d.ts +12 -0
  129. package/esm/src/mui/confirm.d.ts.map +1 -0
  130. package/esm/src/mui/confirm.js +78 -0
  131. package/esm/src/mui/mod.d.ts +4 -0
  132. package/esm/src/mui/mod.d.ts.map +1 -0
  133. package/esm/src/mui/mod.js +2 -0
  134. package/esm/src/next/apiKeys/mod.d.ts +64 -0
  135. package/esm/src/next/apiKeys/mod.d.ts.map +1 -0
  136. package/esm/src/next/apiKeys/mod.js +217 -0
  137. package/esm/src/next/auth/config.d.ts +34 -0
  138. package/esm/src/next/auth/config.d.ts.map +1 -0
  139. package/esm/src/next/auth/config.js +103 -0
  140. package/esm/src/next/auth/mod.d.ts +3 -0
  141. package/esm/src/next/auth/mod.d.ts.map +1 -0
  142. package/esm/src/next/auth/mod.js +2 -0
  143. package/esm/src/next/auth/server.d.ts +28 -0
  144. package/esm/src/next/auth/server.d.ts.map +1 -0
  145. package/esm/src/next/auth/server.js +24 -0
  146. package/esm/src/next/files/mod.d.ts +3 -0
  147. package/esm/src/next/files/mod.d.ts.map +1 -0
  148. package/esm/src/next/files/mod.js +2 -0
  149. package/esm/src/next/files/route.d.ts +99 -0
  150. package/esm/src/next/files/route.d.ts.map +1 -0
  151. package/esm/src/next/files/route.js +349 -0
  152. package/esm/src/next/jobs/list.d.ts +25 -0
  153. package/esm/src/next/jobs/list.d.ts.map +1 -0
  154. package/esm/src/next/jobs/list.js +39 -0
  155. package/esm/src/next/jobs/mod.d.ts +6 -0
  156. package/esm/src/next/jobs/mod.d.ts.map +1 -0
  157. package/esm/src/next/jobs/mod.js +5 -0
  158. package/esm/src/next/jobs/paths.d.ts +14 -0
  159. package/esm/src/next/jobs/paths.d.ts.map +1 -0
  160. package/esm/src/next/jobs/paths.js +40 -0
  161. package/esm/src/next/jobs/route.d.ts +48 -0
  162. package/esm/src/next/jobs/route.d.ts.map +1 -0
  163. package/esm/src/next/jobs/route.js +101 -0
  164. package/esm/src/next/jobs/run.d.ts +51 -0
  165. package/esm/src/next/jobs/run.d.ts.map +1 -0
  166. package/esm/src/next/jobs/run.js +563 -0
  167. package/esm/src/next/jobs/stream.d.ts +3 -0
  168. package/esm/src/next/jobs/stream.d.ts.map +1 -0
  169. package/esm/src/next/jobs/stream.js +25 -0
  170. package/esm/src/next/pwa/mod.d.ts +104 -0
  171. package/esm/src/next/pwa/mod.d.ts.map +1 -0
  172. package/esm/src/next/pwa/mod.js +169 -0
  173. package/esm/src/next/pwa/worker.d.ts +27 -0
  174. package/esm/src/next/pwa/worker.d.ts.map +1 -0
  175. package/esm/src/next/pwa/worker.js +27 -0
  176. package/package.json +293 -0
  177. package/script/_dnt.polyfills.d.ts +149 -0
  178. package/script/_dnt.polyfills.d.ts.map +1 -0
  179. package/script/_dnt.polyfills.js +166 -0
  180. package/script/_dnt.shims.d.ts +2 -0
  181. package/script/_dnt.shims.d.ts.map +1 -0
  182. package/script/_dnt.shims.js +60 -0
  183. package/script/bin/loom.d.ts +2 -0
  184. package/script/bin/loom.d.ts.map +1 -0
  185. package/script/bin/loom.js +17 -0
  186. package/script/mod.d.ts +9 -0
  187. package/script/mod.d.ts.map +1 -0
  188. package/script/mod.js +24 -0
  189. package/script/package.json +3 -0
  190. package/script/src/apiKeys/authorize.d.ts +4 -0
  191. package/script/src/apiKeys/authorize.d.ts.map +1 -0
  192. package/script/src/apiKeys/authorize.js +187 -0
  193. package/script/src/apiKeys/country.d.ts +3 -0
  194. package/script/src/apiKeys/country.d.ts.map +1 -0
  195. package/script/src/apiKeys/country.js +10 -0
  196. package/script/src/apiKeys/credentials.d.ts +4 -0
  197. package/script/src/apiKeys/credentials.d.ts.map +1 -0
  198. package/script/src/apiKeys/credentials.js +58 -0
  199. package/script/src/apiKeys/fingerprint.d.ts +3 -0
  200. package/script/src/apiKeys/fingerprint.d.ts.map +1 -0
  201. package/script/src/apiKeys/fingerprint.js +8 -0
  202. package/script/src/apiKeys/mod.d.ts +9 -0
  203. package/script/src/apiKeys/mod.d.ts.map +1 -0
  204. package/script/src/apiKeys/mod.js +24 -0
  205. package/script/src/apiKeys/policy.d.ts +59 -0
  206. package/script/src/apiKeys/policy.d.ts.map +1 -0
  207. package/script/src/apiKeys/policy.js +92 -0
  208. package/script/src/apiKeys/retention.d.ts +55 -0
  209. package/script/src/apiKeys/retention.d.ts.map +1 -0
  210. package/script/src/apiKeys/retention.js +70 -0
  211. package/script/src/apiKeys/types.d.ts +175 -0
  212. package/script/src/apiKeys/types.d.ts.map +1 -0
  213. package/script/src/apiKeys/types.js +2 -0
  214. package/script/src/cli/externalSkills.d.ts +39 -0
  215. package/script/src/cli/externalSkills.d.ts.map +1 -0
  216. package/script/src/cli/externalSkills.js +181 -0
  217. package/script/src/cli/mod.d.ts +337 -0
  218. package/script/src/cli/mod.d.ts.map +1 -0
  219. package/script/src/cli/mod.js +9337 -0
  220. package/script/src/cli/projectSkills.d.ts +102 -0
  221. package/script/src/cli/projectSkills.d.ts.map +1 -0
  222. package/script/src/cli/projectSkills.js +606 -0
  223. package/script/src/files/client.d.ts +29 -0
  224. package/script/src/files/client.d.ts.map +1 -0
  225. package/script/src/files/client.js +45 -0
  226. package/script/src/files/errors.d.ts +37 -0
  227. package/script/src/files/errors.d.ts.map +1 -0
  228. package/script/src/files/errors.js +76 -0
  229. package/script/src/files/hash.d.ts +15 -0
  230. package/script/src/files/hash.d.ts.map +1 -0
  231. package/script/src/files/hash.js +89 -0
  232. package/script/src/files/memory.d.ts +29 -0
  233. package/script/src/files/memory.d.ts.map +1 -0
  234. package/script/src/files/memory.js +113 -0
  235. package/script/src/files/metadata.d.ts +10 -0
  236. package/script/src/files/metadata.d.ts.map +1 -0
  237. package/script/src/files/metadata.js +189 -0
  238. package/script/src/files/mod.d.ts +10 -0
  239. package/script/src/files/mod.d.ts.map +1 -0
  240. package/script/src/files/mod.js +25 -0
  241. package/script/src/files/s3.d.ts +29 -0
  242. package/script/src/files/s3.d.ts.map +1 -0
  243. package/script/src/files/s3.js +110 -0
  244. package/script/src/files/service.d.ts +27 -0
  245. package/script/src/files/service.d.ts.map +1 -0
  246. package/script/src/files/service.js +139 -0
  247. package/script/src/files/types.d.ts +134 -0
  248. package/script/src/files/types.d.ts.map +1 -0
  249. package/script/src/files/types.js +2 -0
  250. package/script/src/jobs/catalog.d.ts +32 -0
  251. package/script/src/jobs/catalog.d.ts.map +1 -0
  252. package/script/src/jobs/catalog.js +223 -0
  253. package/script/src/jobs/controller.d.ts +28 -0
  254. package/script/src/jobs/controller.d.ts.map +1 -0
  255. package/script/src/jobs/controller.js +100 -0
  256. package/script/src/jobs/direct.d.ts +36 -0
  257. package/script/src/jobs/direct.d.ts.map +1 -0
  258. package/script/src/jobs/direct.js +128 -0
  259. package/script/src/jobs/events.d.ts +15 -0
  260. package/script/src/jobs/events.d.ts.map +1 -0
  261. package/script/src/jobs/events.js +37 -0
  262. package/script/src/jobs/format.d.ts +16 -0
  263. package/script/src/jobs/format.d.ts.map +1 -0
  264. package/script/src/jobs/format.js +193 -0
  265. package/script/src/jobs/http.d.ts +22 -0
  266. package/script/src/jobs/http.d.ts.map +1 -0
  267. package/script/src/jobs/http.js +50 -0
  268. package/script/src/jobs/log.d.ts +2 -0
  269. package/script/src/jobs/log.d.ts.map +1 -0
  270. package/script/src/jobs/log.js +13 -0
  271. package/script/src/jobs/mod.d.ts +10 -0
  272. package/script/src/jobs/mod.d.ts.map +1 -0
  273. package/script/src/jobs/mod.js +25 -0
  274. package/script/src/jobs/run.d.ts +20 -0
  275. package/script/src/jobs/run.d.ts.map +1 -0
  276. package/script/src/jobs/run.js +61 -0
  277. package/script/src/jobs/types.d.ts +31 -0
  278. package/script/src/jobs/types.d.ts.map +1 -0
  279. package/script/src/jobs/types.js +2 -0
  280. package/script/src/mui/apiKeys.d.ts +65 -0
  281. package/script/src/mui/apiKeys.d.ts.map +1 -0
  282. package/script/src/mui/apiKeys.js +327 -0
  283. package/script/src/mui/apiKeysView.d.ts +48 -0
  284. package/script/src/mui/apiKeysView.d.ts.map +1 -0
  285. package/script/src/mui/apiKeysView.js +40 -0
  286. package/script/src/mui/confirm.d.ts +12 -0
  287. package/script/src/mui/confirm.d.ts.map +1 -0
  288. package/script/src/mui/confirm.js +85 -0
  289. package/script/src/mui/mod.d.ts +4 -0
  290. package/script/src/mui/mod.d.ts.map +1 -0
  291. package/script/src/mui/mod.js +19 -0
  292. package/script/src/next/apiKeys/mod.d.ts +64 -0
  293. package/script/src/next/apiKeys/mod.d.ts.map +1 -0
  294. package/script/src/next/apiKeys/mod.js +224 -0
  295. package/script/src/next/auth/config.d.ts +34 -0
  296. package/script/src/next/auth/config.d.ts.map +1 -0
  297. package/script/src/next/auth/config.js +142 -0
  298. package/script/src/next/auth/mod.d.ts +3 -0
  299. package/script/src/next/auth/mod.d.ts.map +1 -0
  300. package/script/src/next/auth/mod.js +18 -0
  301. package/script/src/next/auth/server.d.ts +28 -0
  302. package/script/src/next/auth/server.d.ts.map +1 -0
  303. package/script/src/next/auth/server.js +27 -0
  304. package/script/src/next/files/mod.d.ts +3 -0
  305. package/script/src/next/files/mod.d.ts.map +1 -0
  306. package/script/src/next/files/mod.js +18 -0
  307. package/script/src/next/files/route.d.ts +99 -0
  308. package/script/src/next/files/route.d.ts.map +1 -0
  309. package/script/src/next/files/route.js +353 -0
  310. package/script/src/next/jobs/list.d.ts +25 -0
  311. package/script/src/next/jobs/list.d.ts.map +1 -0
  312. package/script/src/next/jobs/list.js +48 -0
  313. package/script/src/next/jobs/mod.d.ts +6 -0
  314. package/script/src/next/jobs/mod.d.ts.map +1 -0
  315. package/script/src/next/jobs/mod.js +21 -0
  316. package/script/src/next/jobs/paths.d.ts +14 -0
  317. package/script/src/next/jobs/paths.d.ts.map +1 -0
  318. package/script/src/next/jobs/paths.js +47 -0
  319. package/script/src/next/jobs/route.d.ts +48 -0
  320. package/script/src/next/jobs/route.d.ts.map +1 -0
  321. package/script/src/next/jobs/route.js +105 -0
  322. package/script/src/next/jobs/run.d.ts +51 -0
  323. package/script/src/next/jobs/run.d.ts.map +1 -0
  324. package/script/src/next/jobs/run.js +570 -0
  325. package/script/src/next/jobs/stream.d.ts +3 -0
  326. package/script/src/next/jobs/stream.d.ts.map +1 -0
  327. package/script/src/next/jobs/stream.js +28 -0
  328. package/script/src/next/pwa/mod.d.ts +104 -0
  329. package/script/src/next/pwa/mod.d.ts.map +1 -0
  330. package/script/src/next/pwa/mod.js +192 -0
  331. package/script/src/next/pwa/worker.d.ts +27 -0
  332. package/script/src/next/pwa/worker.d.ts.map +1 -0
  333. package/script/src/next/pwa/worker.js +33 -0
  334. package/skills/loom/SKILL.md +200 -0
  335. package/skills/loom-api-keys/SKILL.md +123 -0
  336. package/skills/loom-auth/SKILL.md +70 -0
  337. package/skills/loom-db/SKILL.md +94 -0
  338. package/skills/loom-db/references/db-stack.md +39 -0
  339. package/skills/loom-files/SKILL.md +97 -0
  340. package/skills/loom-jobs/SKILL.md +148 -0
  341. package/skills/upgrade-deps/SKILL.md +165 -0
  342. package/skills/upgrade-deps/agents/openai.yaml +4 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Base error for file runtime failures that can be translated into HTTP
3
+ * responses by route adapters.
4
+ */
5
+ export declare class LoomFileError extends Error {
6
+ readonly code: string;
7
+ readonly status: number;
8
+ constructor(message: string, options: {
9
+ code: string;
10
+ status: number;
11
+ });
12
+ }
13
+ export declare class LoomFileDigestMismatchError extends LoomFileError {
14
+ constructor(options: {
15
+ actual: string;
16
+ expected: string;
17
+ });
18
+ }
19
+ export declare class LoomFileDuplicateError extends LoomFileError {
20
+ constructor(message?: string);
21
+ }
22
+ export declare class LoomFileInvalidDigestError extends LoomFileError {
23
+ constructor(value: string);
24
+ }
25
+ export declare class LoomFileNotFoundError extends LoomFileError {
26
+ constructor(message?: string);
27
+ }
28
+ export declare class LoomFileSizeLimitError extends LoomFileError {
29
+ constructor(options: {
30
+ actual: number;
31
+ maxBytes: number;
32
+ });
33
+ }
34
+ export declare class LoomFileStorageReadUnsupportedError extends LoomFileError {
35
+ constructor();
36
+ }
37
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/src/files/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAMvE;AAED,qBAAa,2BAA4B,SAAQ,aAAa;gBAChD,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAO1D;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAErD,OAAO,SAAwD;CAKlE;AAED,qBAAa,0BAA2B,SAAQ,aAAa;gBAC/C,KAAK,EAAE,MAAM;CAO1B;AAED,qBAAa,qBAAsB,SAAQ,aAAa;gBAC1C,OAAO,SAAoB;CAIxC;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAC3C,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAO1D;AAED,qBAAa,mCAAoC,SAAQ,aAAa;;CAQrE"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Base error for file runtime failures that can be translated into HTTP
3
+ * responses by route adapters.
4
+ */
5
+ export class LoomFileError extends Error {
6
+ constructor(message, options) {
7
+ super(message);
8
+ Object.defineProperty(this, "code", {
9
+ enumerable: true,
10
+ configurable: true,
11
+ writable: true,
12
+ value: void 0
13
+ });
14
+ Object.defineProperty(this, "status", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: void 0
19
+ });
20
+ this.name = "LoomFileError";
21
+ this.code = options.code;
22
+ this.status = options.status;
23
+ }
24
+ }
25
+ export class LoomFileDigestMismatchError extends LoomFileError {
26
+ constructor(options) {
27
+ super(`SHA-256 digest mismatch: expected ${options.expected}, received ${options.actual}.`, { code: "digest_mismatch", status: 400 });
28
+ this.name = "LoomFileDigestMismatchError";
29
+ }
30
+ }
31
+ export class LoomFileDuplicateError extends LoomFileError {
32
+ constructor(message = "A file with the same SHA-256 digest already exists.") {
33
+ super(message, { code: "duplicate_file", status: 409 });
34
+ this.name = "LoomFileDuplicateError";
35
+ }
36
+ }
37
+ export class LoomFileInvalidDigestError extends LoomFileError {
38
+ constructor(value) {
39
+ super(`Invalid SHA-256 digest: ${value}.`, {
40
+ code: "invalid_digest",
41
+ status: 400,
42
+ });
43
+ this.name = "LoomFileInvalidDigestError";
44
+ }
45
+ }
46
+ export class LoomFileNotFoundError extends LoomFileError {
47
+ constructor(message = "File not found.") {
48
+ super(message, { code: "not_found", status: 404 });
49
+ this.name = "LoomFileNotFoundError";
50
+ }
51
+ }
52
+ export class LoomFileSizeLimitError extends LoomFileError {
53
+ constructor(options) {
54
+ super(`File is too large: ${options.actual} bytes exceeds ${options.maxBytes} bytes.`, { code: "size_limit_exceeded", status: 413 });
55
+ this.name = "LoomFileSizeLimitError";
56
+ }
57
+ }
58
+ export class LoomFileStorageReadUnsupportedError extends LoomFileError {
59
+ constructor() {
60
+ super("The configured file storage adapter does not support reads.", {
61
+ code: "storage_read_unsupported",
62
+ status: 501,
63
+ });
64
+ this.name = "LoomFileStorageReadUnsupportedError";
65
+ }
66
+ }
@@ -0,0 +1,15 @@
1
+ import type { LoomFileBody } from "./types.js";
2
+ export interface ReadLoomFileBodyOptions {
3
+ maxBytes?: number;
4
+ }
5
+ /**
6
+ * Reads a supported file body into bytes and enforces an optional size limit.
7
+ * Route adapters use this before hashing so server-side limits are applied
8
+ * consistently for raw and multipart uploads.
9
+ */
10
+ export declare function readLoomFileBodyBytes(body: LoomFileBody, options?: ReadLoomFileBodyOptions): Promise<Uint8Array<any>>;
11
+ export declare function sha256Hex(body: Uint8Array | ArrayBuffer): Promise<string>;
12
+ export declare function isSha256Hex(value: string): boolean;
13
+ export declare function normalizeSha256Hex(value: string): string;
14
+ export declare function assertExpectedSha256(actual: string, expected: string | null): void;
15
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/src/files/hash.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAoBD;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE,uBAA4B,4BAwCtC;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,mBAI7D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,WAExC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,UAM/C;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,QAY3E"}
@@ -0,0 +1,82 @@
1
+ import { LoomFileDigestMismatchError, LoomFileInvalidDigestError, LoomFileSizeLimitError, } from "./errors.js";
2
+ function toHex(bytes) {
3
+ return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
4
+ }
5
+ function isReadableStream(value) {
6
+ return value instanceof ReadableStream;
7
+ }
8
+ function isArrayBufferView(value) {
9
+ return ArrayBuffer.isView(value);
10
+ }
11
+ function assertWithinLimit(byteSize, maxBytes) {
12
+ if (maxBytes !== undefined && byteSize > maxBytes) {
13
+ throw new LoomFileSizeLimitError({ actual: byteSize, maxBytes });
14
+ }
15
+ }
16
+ /**
17
+ * Reads a supported file body into bytes and enforces an optional size limit.
18
+ * Route adapters use this before hashing so server-side limits are applied
19
+ * consistently for raw and multipart uploads.
20
+ */
21
+ export async function readLoomFileBodyBytes(body, options = {}) {
22
+ if (body instanceof Blob) {
23
+ assertWithinLimit(body.size, options.maxBytes);
24
+ return new Uint8Array(await body.arrayBuffer());
25
+ }
26
+ if (body instanceof ArrayBuffer) {
27
+ assertWithinLimit(body.byteLength, options.maxBytes);
28
+ return new Uint8Array(body);
29
+ }
30
+ if (isArrayBufferView(body)) {
31
+ assertWithinLimit(body.byteLength, options.maxBytes);
32
+ return new Uint8Array(body.buffer, body.byteOffset, body.byteLength);
33
+ }
34
+ if (isReadableStream(body)) {
35
+ const reader = body.getReader();
36
+ const chunks = [];
37
+ let size = 0;
38
+ while (true) {
39
+ const { done, value } = await reader.read();
40
+ if (done)
41
+ break;
42
+ size += value.byteLength;
43
+ assertWithinLimit(size, options.maxBytes);
44
+ chunks.push(value);
45
+ }
46
+ const bytes = new Uint8Array(size);
47
+ let offset = 0;
48
+ for (const chunk of chunks) {
49
+ bytes.set(chunk, offset);
50
+ offset += chunk.byteLength;
51
+ }
52
+ return bytes;
53
+ }
54
+ throw new TypeError("Unsupported Loom file body.");
55
+ }
56
+ export async function sha256Hex(body) {
57
+ const bytes = body instanceof ArrayBuffer ? new Uint8Array(body) : body;
58
+ const digest = await crypto.subtle.digest("SHA-256", bytes.slice().buffer);
59
+ return toHex(new Uint8Array(digest));
60
+ }
61
+ export function isSha256Hex(value) {
62
+ return /^[a-f0-9]{64}$/i.test(value);
63
+ }
64
+ export function normalizeSha256Hex(value) {
65
+ const normalized = value.trim().toLowerCase();
66
+ if (!isSha256Hex(normalized)) {
67
+ throw new LoomFileInvalidDigestError(value);
68
+ }
69
+ return normalized;
70
+ }
71
+ export function assertExpectedSha256(actual, expected) {
72
+ if (!expected) {
73
+ return;
74
+ }
75
+ const normalizedExpected = normalizeSha256Hex(expected);
76
+ if (actual !== normalizedExpected) {
77
+ throw new LoomFileDigestMismatchError({
78
+ actual,
79
+ expected: normalizedExpected,
80
+ });
81
+ }
82
+ }
@@ -0,0 +1,29 @@
1
+ import type { LoomFileRepository, LoomFileStorageAdapter } from "./types.js";
2
+ export interface CreateMemoryFileRepositoryOptions {
3
+ createId?: () => string;
4
+ now?: () => Date;
5
+ }
6
+ export interface MemoryFileStorageObject {
7
+ body: Uint8Array;
8
+ byteSize: number;
9
+ contentType: string | null;
10
+ detectedContentType: string | null;
11
+ metadata: Record<string, string>;
12
+ sha256: string;
13
+ }
14
+ export interface MemoryFileStorageAdapter extends LoomFileStorageAdapter {
15
+ objects: ReadonlyMap<string, MemoryFileStorageObject>;
16
+ }
17
+ /**
18
+ * In-memory repository for tests, examples, and non-persistent local tools.
19
+ */
20
+ export declare function createMemoryFileRepository(options?: CreateMemoryFileRepositoryOptions): LoomFileRepository;
21
+ /**
22
+ * In-memory object storage adapter with the same contract as external storage
23
+ * providers. It is intentionally small and deterministic for route tests.
24
+ */
25
+ export declare function createMemoryFileStorage(options?: {
26
+ bucket?: string | null;
27
+ provider?: string;
28
+ }): MemoryFileStorageAdapter;
29
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/src/files/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAClB,sBAAsB,EAKvB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;IACtE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;CACvD;AAiCD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,iCAAsC,GAC9C,kBAAkB,CAuCpB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,GAAE;IAC/C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,wBAAwB,CA0ChC"}
@@ -0,0 +1,109 @@
1
+ function defaultCreateId() {
2
+ return crypto.randomUUID?.() ?? `file_${Date.now().toString(36)}`;
3
+ }
4
+ function normalizeRecord(input, options) {
5
+ return {
6
+ audioMeta: input.audioMeta ?? null,
7
+ bucket: input.bucket ?? null,
8
+ byteSize: input.byteSize,
9
+ contentType: input.contentType ?? null,
10
+ createdAt: options.now,
11
+ deletedAt: null,
12
+ detectedContentType: input.detectedContentType ?? null,
13
+ id: options.id,
14
+ imageMeta: input.imageMeta ?? null,
15
+ kind: input.kind,
16
+ meta: input.meta ?? {},
17
+ objectKey: input.objectKey,
18
+ originalFilename: input.originalFilename ?? null,
19
+ ownerId: input.ownerId ?? null,
20
+ ownerType: input.ownerType ?? null,
21
+ sha256: input.sha256,
22
+ storageProvider: input.storageProvider,
23
+ updatedAt: options.now,
24
+ visibility: input.visibility ?? "private",
25
+ };
26
+ }
27
+ /**
28
+ * In-memory repository for tests, examples, and non-persistent local tools.
29
+ */
30
+ export function createMemoryFileRepository(options = {}) {
31
+ const records = new Map();
32
+ const sha256Index = new Map();
33
+ const now = options.now ?? (() => new Date());
34
+ const createId = options.createId ?? defaultCreateId;
35
+ return {
36
+ findById(id) {
37
+ return Promise.resolve(records.get(id) ?? null);
38
+ },
39
+ findBySha256(sha256) {
40
+ const id = sha256Index.get(sha256);
41
+ return Promise.resolve(id ? records.get(id) ?? null : null);
42
+ },
43
+ insert(input) {
44
+ if (sha256Index.has(input.sha256)) {
45
+ throw new Error(`Duplicate Loom file sha256: ${input.sha256}`);
46
+ }
47
+ const record = normalizeRecord(input, { id: createId(), now: now() });
48
+ records.set(record.id, record);
49
+ sha256Index.set(record.sha256, record.id);
50
+ return Promise.resolve(record);
51
+ },
52
+ updateVisibility(id, visibility) {
53
+ const record = records.get(id);
54
+ if (!record) {
55
+ throw new Error(`Unknown Loom file id: ${id}`);
56
+ }
57
+ const updated = {
58
+ ...record,
59
+ updatedAt: now(),
60
+ visibility,
61
+ };
62
+ records.set(id, updated);
63
+ return Promise.resolve(updated);
64
+ },
65
+ };
66
+ }
67
+ /**
68
+ * In-memory object storage adapter with the same contract as external storage
69
+ * providers. It is intentionally small and deterministic for route tests.
70
+ */
71
+ export function createMemoryFileStorage(options = {}) {
72
+ const objects = new Map();
73
+ const provider = options.provider ?? "memory";
74
+ const bucket = options.bucket ?? null;
75
+ return {
76
+ bucket,
77
+ objects,
78
+ provider,
79
+ deleteObject(input) {
80
+ objects.delete(input.objectKey);
81
+ return Promise.resolve();
82
+ },
83
+ getObject(input) {
84
+ const object = objects.get(input.objectKey);
85
+ if (!object)
86
+ return Promise.resolve(null);
87
+ return Promise.resolve({
88
+ body: object.body.slice(),
89
+ byteSize: object.byteSize,
90
+ contentType: object.detectedContentType ?? object.contentType,
91
+ });
92
+ },
93
+ putObject(input) {
94
+ objects.set(input.objectKey, {
95
+ body: input.body.slice(),
96
+ byteSize: input.byteSize,
97
+ contentType: input.contentType ?? null,
98
+ detectedContentType: input.detectedContentType ?? null,
99
+ metadata: input.metadata ?? {},
100
+ sha256: input.sha256,
101
+ });
102
+ return Promise.resolve({
103
+ bucket,
104
+ objectKey: input.objectKey,
105
+ storageProvider: provider,
106
+ });
107
+ },
108
+ };
109
+ }
@@ -0,0 +1,10 @@
1
+ import type { LoomFileDetectedMetadata } from "./types.js";
2
+ export interface DetectLoomFileMetadataOptions {
3
+ contentType?: string | null;
4
+ }
5
+ /**
6
+ * Detects a stable metadata subset without a native image-processing
7
+ * dependency. Apps can enrich the resulting `meta` fields in local code.
8
+ */
9
+ export declare function detectLoomFileMetadata(bytes: Uint8Array, options?: DetectLoomFileMetadataOptions): LoomFileDetectedMetadata;
10
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/src/files/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAGzB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,6BAA6B;IAC5C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAmLD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,6BAAkC,GAC1C,wBAAwB,CA8D1B"}
@@ -0,0 +1,186 @@
1
+ function startsWith(bytes, prefix) {
2
+ if (bytes.byteLength < prefix.length)
3
+ return false;
4
+ return prefix.every((byte, index) => bytes[index] === byte);
5
+ }
6
+ function ascii(bytes, start, length) {
7
+ if (bytes.byteLength < start + length)
8
+ return "";
9
+ return String.fromCharCode(...bytes.slice(start, start + length));
10
+ }
11
+ function readUint16Big(bytes, offset) {
12
+ return (bytes[offset] << 8) + bytes[offset + 1];
13
+ }
14
+ function readUint16Little(bytes, offset) {
15
+ return bytes[offset] + (bytes[offset + 1] << 8);
16
+ }
17
+ function readUint32Big(bytes, offset) {
18
+ return ((bytes[offset] * 0x1000000) +
19
+ ((bytes[offset + 1] << 16) | (bytes[offset + 2] << 8) | bytes[offset + 3]));
20
+ }
21
+ function readUint24Little(bytes, offset) {
22
+ return bytes[offset] + (bytes[offset + 1] << 8) + (bytes[offset + 2] << 16);
23
+ }
24
+ function image(format, width, height) {
25
+ return { format, height, width };
26
+ }
27
+ function detectPng(bytes) {
28
+ if (!startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) ||
29
+ ascii(bytes, 12, 4) !== "IHDR" ||
30
+ bytes.byteLength < 24) {
31
+ return null;
32
+ }
33
+ return image("png", readUint32Big(bytes, 16), readUint32Big(bytes, 20));
34
+ }
35
+ function detectGif(bytes) {
36
+ const signature = ascii(bytes, 0, 6);
37
+ if ((signature !== "GIF87a" && signature !== "GIF89a") || bytes.length < 10) {
38
+ return null;
39
+ }
40
+ return image("gif", readUint16Little(bytes, 6), readUint16Little(bytes, 8));
41
+ }
42
+ function detectJpeg(bytes) {
43
+ if (!startsWith(bytes, [0xff, 0xd8])) {
44
+ return null;
45
+ }
46
+ let offset = 2;
47
+ while (offset + 8 < bytes.byteLength) {
48
+ if (bytes[offset] !== 0xff) {
49
+ offset += 1;
50
+ continue;
51
+ }
52
+ while (bytes[offset] === 0xff) {
53
+ offset += 1;
54
+ }
55
+ const marker = bytes[offset];
56
+ offset += 1;
57
+ if (marker === 0xd9 || marker === 0xda) {
58
+ break;
59
+ }
60
+ if (offset + 2 > bytes.byteLength) {
61
+ break;
62
+ }
63
+ const segmentLength = readUint16Big(bytes, offset);
64
+ if (segmentLength < 2 || offset + segmentLength > bytes.byteLength) {
65
+ break;
66
+ }
67
+ const isStartOfFrame = [
68
+ 0xc0,
69
+ 0xc1,
70
+ 0xc2,
71
+ 0xc3,
72
+ 0xc5,
73
+ 0xc6,
74
+ 0xc7,
75
+ 0xc9,
76
+ 0xca,
77
+ 0xcb,
78
+ 0xcd,
79
+ 0xce,
80
+ 0xcf,
81
+ ].includes(marker);
82
+ if (isStartOfFrame && segmentLength >= 7) {
83
+ return image("jpeg", readUint16Big(bytes, offset + 5), readUint16Big(bytes, offset + 3));
84
+ }
85
+ offset += segmentLength;
86
+ }
87
+ return image("jpeg", 0, 0);
88
+ }
89
+ function detectWebp(bytes) {
90
+ if (ascii(bytes, 0, 4) !== "RIFF" || ascii(bytes, 8, 4) !== "WEBP") {
91
+ return null;
92
+ }
93
+ const chunk = ascii(bytes, 12, 4);
94
+ if (chunk === "VP8X" && bytes.byteLength >= 30) {
95
+ return image("webp", readUint24Little(bytes, 24) + 1, readUint24Little(bytes, 27) + 1);
96
+ }
97
+ if (chunk === "VP8L" && bytes.byteLength >= 25 && bytes[20] === 0x2f) {
98
+ const b1 = bytes[21];
99
+ const b2 = bytes[22];
100
+ const b3 = bytes[23];
101
+ const b4 = bytes[24];
102
+ return image("webp", 1 + (((b2 & 0x3f) << 8) | b1), 1 + (((b4 & 0x0f) << 10) | (b3 << 2) | ((b2 & 0xc0) >> 6)));
103
+ }
104
+ if (chunk === "VP8 " && bytes.byteLength >= 30 &&
105
+ startsWith(bytes.slice(23), [0x9d, 0x01, 0x2a])) {
106
+ return image("webp", readUint16Little(bytes, 26) & 0x3fff, readUint16Little(bytes, 28) & 0x3fff);
107
+ }
108
+ return image("webp", 0, 0);
109
+ }
110
+ function kindFromContentType(contentType) {
111
+ if (!contentType)
112
+ return "other";
113
+ const lower = contentType.toLowerCase();
114
+ if (lower.startsWith("image/"))
115
+ return "image";
116
+ if (lower.startsWith("audio/"))
117
+ return "audio";
118
+ if (lower.startsWith("video/"))
119
+ return "video";
120
+ if (lower.startsWith("text/"))
121
+ return "text";
122
+ if (lower === "application/pdf")
123
+ return "pdf";
124
+ if (lower === "application/zip" ||
125
+ lower === "application/gzip" ||
126
+ lower === "application/x-tar") {
127
+ return "archive";
128
+ }
129
+ return "other";
130
+ }
131
+ /**
132
+ * Detects a stable metadata subset without a native image-processing
133
+ * dependency. Apps can enrich the resulting `meta` fields in local code.
134
+ */
135
+ export function detectLoomFileMetadata(bytes, options = {}) {
136
+ const imageMeta = detectPng(bytes) ?? detectJpeg(bytes) ?? detectGif(bytes) ??
137
+ detectWebp(bytes);
138
+ if (imageMeta) {
139
+ return {
140
+ detectedContentType: `image/${imageMeta.format === "jpeg" ? "jpeg" : imageMeta.format}`,
141
+ imageMeta,
142
+ kind: "image",
143
+ };
144
+ }
145
+ if (startsWith(bytes, [0x25, 0x50, 0x44, 0x46, 0x2d])) {
146
+ return {
147
+ detectedContentType: "application/pdf",
148
+ imageMeta: null,
149
+ kind: "pdf",
150
+ };
151
+ }
152
+ if (startsWith(bytes, [0x49, 0x44, 0x33]) || startsWith(bytes, [0xff, 0xfb])) {
153
+ return {
154
+ detectedContentType: "audio/mpeg",
155
+ imageMeta: null,
156
+ kind: "audio",
157
+ };
158
+ }
159
+ if (ascii(bytes, 0, 4) === "RIFF" && ascii(bytes, 8, 4) === "WAVE") {
160
+ return { detectedContentType: "audio/wav", imageMeta: null, kind: "audio" };
161
+ }
162
+ if (ascii(bytes, 0, 4) === "OggS") {
163
+ return {
164
+ detectedContentType: "application/ogg",
165
+ imageMeta: null,
166
+ kind: "audio",
167
+ };
168
+ }
169
+ if (ascii(bytes, 4, 4) === "ftyp") {
170
+ return { detectedContentType: "video/mp4", imageMeta: null, kind: "video" };
171
+ }
172
+ if (startsWith(bytes, [0x50, 0x4b, 0x03, 0x04])) {
173
+ return {
174
+ detectedContentType: "application/zip",
175
+ imageMeta: null,
176
+ kind: "archive",
177
+ };
178
+ }
179
+ const suppliedContentType = options.contentType?.split(";")[0]?.trim()
180
+ .toLowerCase() || null;
181
+ return {
182
+ detectedContentType: null,
183
+ imageMeta: null,
184
+ kind: kindFromContentType(suppliedContentType),
185
+ };
186
+ }
@@ -0,0 +1,10 @@
1
+ import "../../_dnt.polyfills.js";
2
+ export * from "./client.js";
3
+ export * from "./errors.js";
4
+ export * from "./hash.js";
5
+ export * from "./memory.js";
6
+ export * from "./metadata.js";
7
+ export * from "./s3.js";
8
+ export * from "./service.js";
9
+ export * from "./types.js";
10
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/files/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,9 @@
1
+ import "../../_dnt.polyfills.js";
2
+ export * from "./client.js";
3
+ export * from "./errors.js";
4
+ export * from "./hash.js";
5
+ export * from "./memory.js";
6
+ export * from "./metadata.js";
7
+ export * from "./s3.js";
8
+ export * from "./service.js";
9
+ export * from "./types.js";
@@ -0,0 +1,29 @@
1
+ import type { LoomFileStorageAdapter } from "./types.js";
2
+ export interface S3LikeClient {
3
+ send(command: unknown): Promise<Record<string, unknown>>;
4
+ }
5
+ export type S3CommandConstructor = new (input: any) => unknown;
6
+ export interface S3StorageCommands {
7
+ DeleteObjectCommand?: S3CommandConstructor;
8
+ GetObjectCommand: S3CommandConstructor;
9
+ PutObjectCommand: S3CommandConstructor;
10
+ }
11
+ export interface CreateS3FileStorageOptions {
12
+ bucket: string;
13
+ client: S3LikeClient;
14
+ commands: S3StorageCommands;
15
+ keyPrefix?: string;
16
+ /**
17
+ * Sends conditional writes with `IfNoneMatch: "*"`. Use this with
18
+ * content-addressed keys when overwriting an existing object would hide a
19
+ * duplicate-upload bug.
20
+ */
21
+ preventOverwrite?: boolean;
22
+ provider?: string;
23
+ }
24
+ /**
25
+ * Creates an S3-compatible storage adapter without making AWS SDK v3 a Loom
26
+ * dependency. Consumers pass their own client and command constructors.
27
+ */
28
+ export declare function createS3FileStorage(options: CreateS3FileStorageOptions): LoomFileStorageAdapter;
29
+ //# sourceMappingURL=s3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/src/files/s3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EAKvB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC1D;AAED,MAAM,MAAM,oBAAoB,GAAG,KACjC,KAAK,EAAE,GAAG,KACP,OAAO,CAAC;AAEb,MAAM,WAAW,iBAAiB;IAChC,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;IAC3C,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,gBAAgB,EAAE,oBAAoB,CAAC;CACxC;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,sBAAsB,CAuExB"}