@walde.ai/walde-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (447) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +5 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/sdk/contracts/frontend-content/v1/content-format-v1.d.ts +8 -0
  8. package/dist/sdk/contracts/frontend-content/v1/content-format-v1.d.ts.map +1 -0
  9. package/dist/sdk/contracts/frontend-content/v1/content-format-v1.js +2 -0
  10. package/dist/sdk/contracts/frontend-content/v1/content-format-v1.js.map +1 -0
  11. package/dist/sdk/contracts/frontend-content/v1/content-part-v1.d.ts +8 -0
  12. package/dist/sdk/contracts/frontend-content/v1/content-part-v1.d.ts.map +1 -0
  13. package/dist/sdk/contracts/frontend-content/v1/content-part-v1.js +2 -0
  14. package/dist/sdk/contracts/frontend-content/v1/content-part-v1.js.map +1 -0
  15. package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.d.ts +13 -0
  16. package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.d.ts.map +1 -0
  17. package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.js +2 -0
  18. package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.js.map +1 -0
  19. package/dist/sdk/contracts/manifest/v1/manifest-content-v1.d.ts +12 -0
  20. package/dist/sdk/contracts/manifest/v1/manifest-content-v1.d.ts.map +1 -0
  21. package/dist/sdk/contracts/manifest/v1/manifest-content-v1.js +2 -0
  22. package/dist/sdk/contracts/manifest/v1/manifest-content-v1.js.map +1 -0
  23. package/dist/sdk/contracts/manifest/v1/manifest-v1.d.ts +9 -0
  24. package/dist/sdk/contracts/manifest/v1/manifest-v1.d.ts.map +1 -0
  25. package/dist/sdk/contracts/manifest/v1/manifest-v1.js +2 -0
  26. package/dist/sdk/contracts/manifest/v1/manifest-v1.js.map +1 -0
  27. package/dist/sdk/domain/entities/content-format.d.ts +9 -0
  28. package/dist/sdk/domain/entities/content-format.d.ts.map +1 -0
  29. package/dist/sdk/domain/entities/content-format.js +12 -0
  30. package/dist/sdk/domain/entities/content-format.js.map +1 -0
  31. package/dist/sdk/domain/entities/content-part.d.ts +26 -0
  32. package/dist/sdk/domain/entities/content-part.d.ts.map +1 -0
  33. package/dist/sdk/domain/entities/content-part.js +36 -0
  34. package/dist/sdk/domain/entities/content-part.js.map +1 -0
  35. package/dist/sdk/domain/entities/content-state.d.ts +8 -0
  36. package/dist/sdk/domain/entities/content-state.d.ts.map +1 -0
  37. package/dist/sdk/domain/entities/content-state.js +9 -0
  38. package/dist/sdk/domain/entities/content-state.js.map +1 -0
  39. package/dist/sdk/domain/entities/content-version.d.ts +27 -0
  40. package/dist/sdk/domain/entities/content-version.d.ts.map +1 -0
  41. package/dist/sdk/domain/entities/content-version.js +37 -0
  42. package/dist/sdk/domain/entities/content-version.js.map +1 -0
  43. package/dist/sdk/domain/entities/content.d.ts +21 -0
  44. package/dist/sdk/domain/entities/content.d.ts.map +1 -0
  45. package/dist/sdk/domain/entities/content.js +26 -0
  46. package/dist/sdk/domain/entities/content.js.map +1 -0
  47. package/dist/sdk/domain/entities/credentials.d.ts +14 -0
  48. package/dist/sdk/domain/entities/credentials.d.ts.map +1 -0
  49. package/dist/sdk/domain/entities/credentials.js +20 -0
  50. package/dist/sdk/domain/entities/credentials.js.map +1 -0
  51. package/dist/sdk/domain/entities/dns-entry.d.ts +10 -0
  52. package/dist/sdk/domain/entities/dns-entry.d.ts.map +1 -0
  53. package/dist/sdk/domain/entities/dns-entry.js +14 -0
  54. package/dist/sdk/domain/entities/dns-entry.js.map +1 -0
  55. package/dist/sdk/domain/entities/file.d.ts +14 -0
  56. package/dist/sdk/domain/entities/file.d.ts.map +1 -0
  57. package/dist/sdk/domain/entities/file.js +17 -0
  58. package/dist/sdk/domain/entities/file.js.map +1 -0
  59. package/dist/sdk/domain/entities/format-part.d.ts +16 -0
  60. package/dist/sdk/domain/entities/format-part.d.ts.map +1 -0
  61. package/dist/sdk/domain/entities/format-part.js +2 -0
  62. package/dist/sdk/domain/entities/format-part.js.map +1 -0
  63. package/dist/sdk/domain/entities/format.d.ts +14 -0
  64. package/dist/sdk/domain/entities/format.d.ts.map +1 -0
  65. package/dist/sdk/domain/entities/format.js +23 -0
  66. package/dist/sdk/domain/entities/format.js.map +1 -0
  67. package/dist/sdk/domain/entities/frontend-content.d.ts +13 -0
  68. package/dist/sdk/domain/entities/frontend-content.d.ts.map +1 -0
  69. package/dist/sdk/domain/entities/frontend-content.js +16 -0
  70. package/dist/sdk/domain/entities/frontend-content.js.map +1 -0
  71. package/dist/sdk/domain/entities/key-value-part.d.ts +20 -0
  72. package/dist/sdk/domain/entities/key-value-part.d.ts.map +1 -0
  73. package/dist/sdk/domain/entities/key-value-part.js +31 -0
  74. package/dist/sdk/domain/entities/key-value-part.js.map +1 -0
  75. package/dist/sdk/domain/entities/manifest-content.d.ts +12 -0
  76. package/dist/sdk/domain/entities/manifest-content.d.ts.map +1 -0
  77. package/dist/sdk/domain/entities/manifest-content.js +18 -0
  78. package/dist/sdk/domain/entities/manifest-content.js.map +1 -0
  79. package/dist/sdk/domain/entities/manifest.d.ts +9 -0
  80. package/dist/sdk/domain/entities/manifest.d.ts.map +1 -0
  81. package/dist/sdk/domain/entities/manifest.js +10 -0
  82. package/dist/sdk/domain/entities/manifest.js.map +1 -0
  83. package/dist/sdk/domain/entities/markdown-part.d.ts +14 -0
  84. package/dist/sdk/domain/entities/markdown-part.d.ts.map +1 -0
  85. package/dist/sdk/domain/entities/markdown-part.js +15 -0
  86. package/dist/sdk/domain/entities/markdown-part.js.map +1 -0
  87. package/dist/sdk/domain/entities/site.d.ts +16 -0
  88. package/dist/sdk/domain/entities/site.d.ts.map +1 -0
  89. package/dist/sdk/domain/entities/site.js +21 -0
  90. package/dist/sdk/domain/entities/site.js.map +1 -0
  91. package/dist/sdk/domain/entities/string-part.d.ts +14 -0
  92. package/dist/sdk/domain/entities/string-part.d.ts.map +1 -0
  93. package/dist/sdk/domain/entities/string-part.js +15 -0
  94. package/dist/sdk/domain/entities/string-part.js.map +1 -0
  95. package/dist/sdk/domain/entities/ui-upload-credentials.d.ts +22 -0
  96. package/dist/sdk/domain/entities/ui-upload-credentials.d.ts.map +1 -0
  97. package/dist/sdk/domain/entities/ui-upload-credentials.js +38 -0
  98. package/dist/sdk/domain/entities/ui-upload-credentials.js.map +1 -0
  99. package/dist/sdk/domain/entities/walde-admin-config.d.ts +51 -0
  100. package/dist/sdk/domain/entities/walde-admin-config.d.ts.map +1 -0
  101. package/dist/sdk/domain/entities/walde-admin-config.js +69 -0
  102. package/dist/sdk/domain/entities/walde-admin-config.js.map +1 -0
  103. package/dist/sdk/domain/entities/workspace-config.d.ts +20 -0
  104. package/dist/sdk/domain/entities/workspace-config.d.ts.map +1 -0
  105. package/dist/sdk/domain/entities/workspace-config.js +17 -0
  106. package/dist/sdk/domain/entities/workspace-config.js.map +1 -0
  107. package/dist/sdk/domain/errors/index.d.ts +11 -0
  108. package/dist/sdk/domain/errors/index.d.ts.map +1 -0
  109. package/dist/sdk/domain/errors/index.js +11 -0
  110. package/dist/sdk/domain/errors/index.js.map +1 -0
  111. package/dist/sdk/domain/errors/walde-authentication-error.d.ts +21 -0
  112. package/dist/sdk/domain/errors/walde-authentication-error.d.ts.map +1 -0
  113. package/dist/sdk/domain/errors/walde-authentication-error.js +23 -0
  114. package/dist/sdk/domain/errors/walde-authentication-error.js.map +1 -0
  115. package/dist/sdk/domain/errors/walde-configuration-error.d.ts +21 -0
  116. package/dist/sdk/domain/errors/walde-configuration-error.d.ts.map +1 -0
  117. package/dist/sdk/domain/errors/walde-configuration-error.js +23 -0
  118. package/dist/sdk/domain/errors/walde-configuration-error.js.map +1 -0
  119. package/dist/sdk/domain/errors/walde-error.d.ts +9 -0
  120. package/dist/sdk/domain/errors/walde-error.d.ts.map +1 -0
  121. package/dist/sdk/domain/errors/walde-error.js +12 -0
  122. package/dist/sdk/domain/errors/walde-error.js.map +1 -0
  123. package/dist/sdk/domain/errors/walde-local-error.d.ts +22 -0
  124. package/dist/sdk/domain/errors/walde-local-error.d.ts.map +1 -0
  125. package/dist/sdk/domain/errors/walde-local-error.js +24 -0
  126. package/dist/sdk/domain/errors/walde-local-error.js.map +1 -0
  127. package/dist/sdk/domain/errors/walde-network-error.d.ts +21 -0
  128. package/dist/sdk/domain/errors/walde-network-error.d.ts.map +1 -0
  129. package/dist/sdk/domain/errors/walde-network-error.js +23 -0
  130. package/dist/sdk/domain/errors/walde-network-error.js.map +1 -0
  131. package/dist/sdk/domain/errors/walde-system-error.d.ts +10 -0
  132. package/dist/sdk/domain/errors/walde-system-error.d.ts.map +1 -0
  133. package/dist/sdk/domain/errors/walde-system-error.js +13 -0
  134. package/dist/sdk/domain/errors/walde-system-error.js.map +1 -0
  135. package/dist/sdk/domain/errors/walde-unexpected-error.d.ts +21 -0
  136. package/dist/sdk/domain/errors/walde-unexpected-error.d.ts.map +1 -0
  137. package/dist/sdk/domain/errors/walde-unexpected-error.js +23 -0
  138. package/dist/sdk/domain/errors/walde-unexpected-error.js.map +1 -0
  139. package/dist/sdk/domain/errors/walde-usage-error.d.ts +21 -0
  140. package/dist/sdk/domain/errors/walde-usage-error.d.ts.map +1 -0
  141. package/dist/sdk/domain/errors/walde-usage-error.js +23 -0
  142. package/dist/sdk/domain/errors/walde-usage-error.js.map +1 -0
  143. package/dist/sdk/domain/errors/walde-user-error.d.ts +9 -0
  144. package/dist/sdk/domain/errors/walde-user-error.d.ts.map +1 -0
  145. package/dist/sdk/domain/errors/walde-user-error.js +11 -0
  146. package/dist/sdk/domain/errors/walde-user-error.js.map +1 -0
  147. package/dist/sdk/domain/errors/walde-validation-error.d.ts +20 -0
  148. package/dist/sdk/domain/errors/walde-validation-error.d.ts.map +1 -0
  149. package/dist/sdk/domain/errors/walde-validation-error.js +22 -0
  150. package/dist/sdk/domain/errors/walde-validation-error.js.map +1 -0
  151. package/dist/sdk/domain/interactors/api-call.d.ts +19 -0
  152. package/dist/sdk/domain/interactors/api-call.d.ts.map +1 -0
  153. package/dist/sdk/domain/interactors/api-call.js +31 -0
  154. package/dist/sdk/domain/interactors/api-call.js.map +1 -0
  155. package/dist/sdk/domain/interactors/associate-site-certificates.d.ts +11 -0
  156. package/dist/sdk/domain/interactors/associate-site-certificates.d.ts.map +1 -0
  157. package/dist/sdk/domain/interactors/associate-site-certificates.js +20 -0
  158. package/dist/sdk/domain/interactors/associate-site-certificates.js.map +1 -0
  159. package/dist/sdk/domain/interactors/content/list-contents.d.ts +16 -0
  160. package/dist/sdk/domain/interactors/content/list-contents.d.ts.map +1 -0
  161. package/dist/sdk/domain/interactors/content/list-contents.js +18 -0
  162. package/dist/sdk/domain/interactors/content/list-contents.js.map +1 -0
  163. package/dist/sdk/domain/interactors/content/parse-content-file.d.ts +19 -0
  164. package/dist/sdk/domain/interactors/content/parse-content-file.d.ts.map +1 -0
  165. package/dist/sdk/domain/interactors/content/parse-content-file.js +68 -0
  166. package/dist/sdk/domain/interactors/content/parse-content-file.js.map +1 -0
  167. package/dist/sdk/domain/interactors/content/push-content.d.ts +21 -0
  168. package/dist/sdk/domain/interactors/content/push-content.d.ts.map +1 -0
  169. package/dist/sdk/domain/interactors/content/push-content.js +31 -0
  170. package/dist/sdk/domain/interactors/content/push-content.js.map +1 -0
  171. package/dist/sdk/domain/interactors/create-site.d.ts +9 -0
  172. package/dist/sdk/domain/interactors/create-site.d.ts.map +1 -0
  173. package/dist/sdk/domain/interactors/create-site.js +19 -0
  174. package/dist/sdk/domain/interactors/create-site.js.map +1 -0
  175. package/dist/sdk/domain/interactors/get-credentials.d.ts +14 -0
  176. package/dist/sdk/domain/interactors/get-credentials.d.ts.map +1 -0
  177. package/dist/sdk/domain/interactors/get-credentials.js +16 -0
  178. package/dist/sdk/domain/interactors/get-credentials.js.map +1 -0
  179. package/dist/sdk/domain/interactors/get-token.d.ts +13 -0
  180. package/dist/sdk/domain/interactors/get-token.d.ts.map +1 -0
  181. package/dist/sdk/domain/interactors/get-token.js +21 -0
  182. package/dist/sdk/domain/interactors/get-token.js.map +1 -0
  183. package/dist/sdk/domain/interactors/list-sites.d.ts +9 -0
  184. package/dist/sdk/domain/interactors/list-sites.d.ts.map +1 -0
  185. package/dist/sdk/domain/interactors/list-sites.js +17 -0
  186. package/dist/sdk/domain/interactors/list-sites.js.map +1 -0
  187. package/dist/sdk/domain/interactors/refresh-credentials.d.ts +16 -0
  188. package/dist/sdk/domain/interactors/refresh-credentials.d.ts.map +1 -0
  189. package/dist/sdk/domain/interactors/refresh-credentials.js +25 -0
  190. package/dist/sdk/domain/interactors/refresh-credentials.js.map +1 -0
  191. package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.d.ts +24 -0
  192. package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.d.ts.map +1 -0
  193. package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.js +58 -0
  194. package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.js.map +1 -0
  195. package/dist/sdk/domain/interactors/update-site.d.ts +9 -0
  196. package/dist/sdk/domain/interactors/update-site.d.ts.map +1 -0
  197. package/dist/sdk/domain/interactors/update-site.js +19 -0
  198. package/dist/sdk/domain/interactors/update-site.js.map +1 -0
  199. package/dist/sdk/domain/interactors/workspace/init-workspace.d.ts +19 -0
  200. package/dist/sdk/domain/interactors/workspace/init-workspace.d.ts.map +1 -0
  201. package/dist/sdk/domain/interactors/workspace/init-workspace.js +26 -0
  202. package/dist/sdk/domain/interactors/workspace/init-workspace.js.map +1 -0
  203. package/dist/sdk/domain/ports/backend/backend-client.d.ts +7 -0
  204. package/dist/sdk/domain/ports/backend/backend-client.d.ts.map +1 -0
  205. package/dist/sdk/domain/ports/backend/backend-client.js +2 -0
  206. package/dist/sdk/domain/ports/backend/backend-client.js.map +1 -0
  207. package/dist/sdk/domain/ports/in/content-file-reader.d.ts +15 -0
  208. package/dist/sdk/domain/ports/in/content-file-reader.d.ts.map +1 -0
  209. package/dist/sdk/domain/ports/in/content-file-reader.js +2 -0
  210. package/dist/sdk/domain/ports/in/content-file-reader.js.map +1 -0
  211. package/dist/sdk/domain/ports/in/token-provider.d.ts +10 -0
  212. package/dist/sdk/domain/ports/in/token-provider.d.ts.map +1 -0
  213. package/dist/sdk/domain/ports/in/token-provider.js +2 -0
  214. package/dist/sdk/domain/ports/in/token-provider.js.map +1 -0
  215. package/dist/sdk/domain/ports/out/backend-communication.d.ts +22 -0
  216. package/dist/sdk/domain/ports/out/backend-communication.d.ts.map +1 -0
  217. package/dist/sdk/domain/ports/out/backend-communication.js +2 -0
  218. package/dist/sdk/domain/ports/out/backend-communication.js.map +1 -0
  219. package/dist/sdk/domain/ports/out/content-file-writer.d.ts +12 -0
  220. package/dist/sdk/domain/ports/out/content-file-writer.d.ts.map +1 -0
  221. package/dist/sdk/domain/ports/out/content-file-writer.js +2 -0
  222. package/dist/sdk/domain/ports/out/content-file-writer.js.map +1 -0
  223. package/dist/sdk/domain/ports/out/content-repo.d.ts +27 -0
  224. package/dist/sdk/domain/ports/out/content-repo.d.ts.map +1 -0
  225. package/dist/sdk/domain/ports/out/content-repo.js +2 -0
  226. package/dist/sdk/domain/ports/out/content-repo.js.map +1 -0
  227. package/dist/sdk/domain/ports/out/credentials-provider.d.ts +15 -0
  228. package/dist/sdk/domain/ports/out/credentials-provider.d.ts.map +1 -0
  229. package/dist/sdk/domain/ports/out/credentials-provider.js +2 -0
  230. package/dist/sdk/domain/ports/out/credentials-provider.js.map +1 -0
  231. package/dist/sdk/domain/ports/out/file-system-reader.d.ts +13 -0
  232. package/dist/sdk/domain/ports/out/file-system-reader.d.ts.map +1 -0
  233. package/dist/sdk/domain/ports/out/file-system-reader.js +2 -0
  234. package/dist/sdk/domain/ports/out/file-system-reader.js.map +1 -0
  235. package/dist/sdk/domain/ports/out/remote-files-repo.d.ts +20 -0
  236. package/dist/sdk/domain/ports/out/remote-files-repo.d.ts.map +1 -0
  237. package/dist/sdk/domain/ports/out/remote-files-repo.js +2 -0
  238. package/dist/sdk/domain/ports/out/remote-files-repo.js.map +1 -0
  239. package/dist/sdk/domain/ports/out/site-repository.d.ts +35 -0
  240. package/dist/sdk/domain/ports/out/site-repository.d.ts.map +1 -0
  241. package/dist/sdk/domain/ports/out/site-repository.js +2 -0
  242. package/dist/sdk/domain/ports/out/site-repository.js.map +1 -0
  243. package/dist/sdk/domain/ports/out/token-refresh-provider.d.ts +11 -0
  244. package/dist/sdk/domain/ports/out/token-refresh-provider.d.ts.map +1 -0
  245. package/dist/sdk/domain/ports/out/token-refresh-provider.js +2 -0
  246. package/dist/sdk/domain/ports/out/token-refresh-provider.js.map +1 -0
  247. package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.d.ts +11 -0
  248. package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.d.ts.map +1 -0
  249. package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.js +2 -0
  250. package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.js.map +1 -0
  251. package/dist/sdk/domain/ports/out/upload-progress-callback.d.ts +26 -0
  252. package/dist/sdk/domain/ports/out/upload-progress-callback.d.ts.map +1 -0
  253. package/dist/sdk/domain/ports/out/upload-progress-callback.js +2 -0
  254. package/dist/sdk/domain/ports/out/upload-progress-callback.js.map +1 -0
  255. package/dist/sdk/domain/ports/out/workspace-config-repo.d.ts +25 -0
  256. package/dist/sdk/domain/ports/out/workspace-config-repo.d.ts.map +1 -0
  257. package/dist/sdk/domain/ports/out/workspace-config-repo.js +2 -0
  258. package/dist/sdk/domain/ports/out/workspace-config-repo.js.map +1 -0
  259. package/dist/sdk/index.d.ts +35 -0
  260. package/dist/sdk/index.d.ts.map +1 -0
  261. package/dist/sdk/index.js +35 -0
  262. package/dist/sdk/index.js.map +1 -0
  263. package/dist/sdk/infra/adapters/api-client.d.ts +58 -0
  264. package/dist/sdk/infra/adapters/api-client.d.ts.map +1 -0
  265. package/dist/sdk/infra/adapters/api-client.js +73 -0
  266. package/dist/sdk/infra/adapters/api-client.js.map +1 -0
  267. package/dist/sdk/infra/adapters/base-http-client.d.ts +25 -0
  268. package/dist/sdk/infra/adapters/base-http-client.d.ts.map +1 -0
  269. package/dist/sdk/infra/adapters/base-http-client.js +110 -0
  270. package/dist/sdk/infra/adapters/base-http-client.js.map +1 -0
  271. package/dist/sdk/infra/adapters/cognito-token-refresh-provider.d.ts +16 -0
  272. package/dist/sdk/infra/adapters/cognito-token-refresh-provider.d.ts.map +1 -0
  273. package/dist/sdk/infra/adapters/cognito-token-refresh-provider.js +46 -0
  274. package/dist/sdk/infra/adapters/cognito-token-refresh-provider.js.map +1 -0
  275. package/dist/sdk/infra/adapters/default-http-client.d.ts +38 -0
  276. package/dist/sdk/infra/adapters/default-http-client.d.ts.map +1 -0
  277. package/dist/sdk/infra/adapters/default-http-client.js +133 -0
  278. package/dist/sdk/infra/adapters/default-http-client.js.map +1 -0
  279. package/dist/sdk/infra/adapters/default-token-provider.d.ts +14 -0
  280. package/dist/sdk/infra/adapters/default-token-provider.d.ts.map +1 -0
  281. package/dist/sdk/infra/adapters/default-token-provider.js +23 -0
  282. package/dist/sdk/infra/adapters/default-token-provider.js.map +1 -0
  283. package/dist/sdk/infra/adapters/filesystem/file-content-reader.d.ts +16 -0
  284. package/dist/sdk/infra/adapters/filesystem/file-content-reader.d.ts.map +1 -0
  285. package/dist/sdk/infra/adapters/filesystem/file-content-reader.js +27 -0
  286. package/dist/sdk/infra/adapters/filesystem/file-content-reader.js.map +1 -0
  287. package/dist/sdk/infra/adapters/filesystem/file-content-writer.d.ts +13 -0
  288. package/dist/sdk/infra/adapters/filesystem/file-content-writer.d.ts.map +1 -0
  289. package/dist/sdk/infra/adapters/filesystem/file-content-writer.js +36 -0
  290. package/dist/sdk/infra/adapters/filesystem/file-content-writer.js.map +1 -0
  291. package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.d.ts +21 -0
  292. package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.d.ts.map +1 -0
  293. package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.js +52 -0
  294. package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.js.map +1 -0
  295. package/dist/sdk/infra/adapters/frontend-http-client.d.ts +12 -0
  296. package/dist/sdk/infra/adapters/frontend-http-client.d.ts.map +1 -0
  297. package/dist/sdk/infra/adapters/frontend-http-client.js +18 -0
  298. package/dist/sdk/infra/adapters/frontend-http-client.js.map +1 -0
  299. package/dist/sdk/infra/adapters/http/http-content-repo.d.ts +33 -0
  300. package/dist/sdk/infra/adapters/http/http-content-repo.d.ts.map +1 -0
  301. package/dist/sdk/infra/adapters/http/http-content-repo.js +85 -0
  302. package/dist/sdk/infra/adapters/http/http-content-repo.js.map +1 -0
  303. package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.d.ts +22 -0
  304. package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.d.ts.map +1 -0
  305. package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.js +73 -0
  306. package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.js.map +1 -0
  307. package/dist/sdk/infra/adapters/repositories/credentials-file-repo.d.ts +18 -0
  308. package/dist/sdk/infra/adapters/repositories/credentials-file-repo.d.ts.map +1 -0
  309. package/dist/sdk/infra/adapters/repositories/credentials-file-repo.js +41 -0
  310. package/dist/sdk/infra/adapters/repositories/credentials-file-repo.js.map +1 -0
  311. package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.d.ts +11 -0
  312. package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.d.ts.map +1 -0
  313. package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.js +20 -0
  314. package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.js.map +1 -0
  315. package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.d.ts +11 -0
  316. package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.d.ts.map +1 -0
  317. package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.js +38 -0
  318. package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.js.map +1 -0
  319. package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.d.ts +26 -0
  320. package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.d.ts.map +1 -0
  321. package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.js +86 -0
  322. package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.js.map +1 -0
  323. package/dist/sdk/infra/adapters/repositories/http-site-repo.d.ts +15 -0
  324. package/dist/sdk/infra/adapters/repositories/http-site-repo.d.ts.map +1 -0
  325. package/dist/sdk/infra/adapters/repositories/http-site-repo.js +51 -0
  326. package/dist/sdk/infra/adapters/repositories/http-site-repo.js.map +1 -0
  327. package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.d.ts +9 -0
  328. package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.d.ts.map +1 -0
  329. package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.js +13 -0
  330. package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.js.map +1 -0
  331. package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.d.ts +15 -0
  332. package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.d.ts.map +1 -0
  333. package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.js +25 -0
  334. package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.js.map +1 -0
  335. package/dist/sdk/infra/backend/walde-client.d.ts +13 -0
  336. package/dist/sdk/infra/backend/walde-client.d.ts.map +1 -0
  337. package/dist/sdk/infra/backend/walde-client.js +29 -0
  338. package/dist/sdk/infra/backend/walde-client.js.map +1 -0
  339. package/dist/sdk/infra/factories/s3-files-repo-factory.d.ts +9 -0
  340. package/dist/sdk/infra/factories/s3-files-repo-factory.d.ts.map +1 -0
  341. package/dist/sdk/infra/factories/s3-files-repo-factory.js +10 -0
  342. package/dist/sdk/infra/factories/s3-files-repo-factory.js.map +1 -0
  343. package/dist/sdk/infra/factories/walde-admin-config-factory.d.ts +24 -0
  344. package/dist/sdk/infra/factories/walde-admin-config-factory.d.ts.map +1 -0
  345. package/dist/sdk/infra/factories/walde-admin-config-factory.js +99 -0
  346. package/dist/sdk/infra/factories/walde-admin-config-factory.js.map +1 -0
  347. package/dist/sdk/infra/factories/walde-admin-factory.d.ts +17 -0
  348. package/dist/sdk/infra/factories/walde-admin-factory.d.ts.map +1 -0
  349. package/dist/sdk/infra/factories/walde-admin-factory.js +42 -0
  350. package/dist/sdk/infra/factories/walde-admin-factory.js.map +1 -0
  351. package/dist/sdk/infra/factories/walde-factory.d.ts +13 -0
  352. package/dist/sdk/infra/factories/walde-factory.d.ts.map +1 -0
  353. package/dist/sdk/infra/factories/walde-factory.js +19 -0
  354. package/dist/sdk/infra/factories/walde-factory.js.map +1 -0
  355. package/dist/sdk/infra/futures/api-future.d.ts +15 -0
  356. package/dist/sdk/infra/futures/api-future.d.ts.map +1 -0
  357. package/dist/sdk/infra/futures/api-future.js +28 -0
  358. package/dist/sdk/infra/futures/api-future.js.map +1 -0
  359. package/dist/sdk/infra/futures/content-future.d.ts +26 -0
  360. package/dist/sdk/infra/futures/content-future.d.ts.map +1 -0
  361. package/dist/sdk/infra/futures/content-future.js +63 -0
  362. package/dist/sdk/infra/futures/content-future.js.map +1 -0
  363. package/dist/sdk/infra/futures/content-item-future.d.ts +25 -0
  364. package/dist/sdk/infra/futures/content-item-future.d.ts.map +1 -0
  365. package/dist/sdk/infra/futures/content-item-future.js +47 -0
  366. package/dist/sdk/infra/futures/content-item-future.js.map +1 -0
  367. package/dist/sdk/infra/futures/content-iterator.d.ts +44 -0
  368. package/dist/sdk/infra/futures/content-iterator.d.ts.map +1 -0
  369. package/dist/sdk/infra/futures/content-iterator.js +123 -0
  370. package/dist/sdk/infra/futures/content-iterator.js.map +1 -0
  371. package/dist/sdk/infra/futures/content-list-future.d.ts +16 -0
  372. package/dist/sdk/infra/futures/content-list-future.d.ts.map +1 -0
  373. package/dist/sdk/infra/futures/content-list-future.js +19 -0
  374. package/dist/sdk/infra/futures/content-list-future.js.map +1 -0
  375. package/dist/sdk/infra/futures/contents-future.d.ts +23 -0
  376. package/dist/sdk/infra/futures/contents-future.d.ts.map +1 -0
  377. package/dist/sdk/infra/futures/contents-future.js +33 -0
  378. package/dist/sdk/infra/futures/contents-future.js.map +1 -0
  379. package/dist/sdk/infra/futures/credentials-future.d.ts +14 -0
  380. package/dist/sdk/infra/futures/credentials-future.d.ts.map +1 -0
  381. package/dist/sdk/infra/futures/credentials-future.js +67 -0
  382. package/dist/sdk/infra/futures/credentials-future.js.map +1 -0
  383. package/dist/sdk/infra/futures/frontend-contents-future.d.ts +37 -0
  384. package/dist/sdk/infra/futures/frontend-contents-future.d.ts.map +1 -0
  385. package/dist/sdk/infra/futures/frontend-contents-future.js +62 -0
  386. package/dist/sdk/infra/futures/frontend-contents-future.js.map +1 -0
  387. package/dist/sdk/infra/futures/manifest-future.d.ts +18 -0
  388. package/dist/sdk/infra/futures/manifest-future.d.ts.map +1 -0
  389. package/dist/sdk/infra/futures/manifest-future.js +28 -0
  390. package/dist/sdk/infra/futures/manifest-future.js.map +1 -0
  391. package/dist/sdk/infra/futures/site-future.d.ts +41 -0
  392. package/dist/sdk/infra/futures/site-future.d.ts.map +1 -0
  393. package/dist/sdk/infra/futures/site-future.js +113 -0
  394. package/dist/sdk/infra/futures/site-future.js.map +1 -0
  395. package/dist/sdk/infra/futures/sites-future.d.ts +19 -0
  396. package/dist/sdk/infra/futures/sites-future.d.ts.map +1 -0
  397. package/dist/sdk/infra/futures/sites-future.js +35 -0
  398. package/dist/sdk/infra/futures/sites-future.js.map +1 -0
  399. package/dist/sdk/infra/futures/ui-future.d.ts +25 -0
  400. package/dist/sdk/infra/futures/ui-future.d.ts.map +1 -0
  401. package/dist/sdk/infra/futures/ui-future.js +35 -0
  402. package/dist/sdk/infra/futures/ui-future.js.map +1 -0
  403. package/dist/sdk/infra/futures/walde-admin-future.d.ts +41 -0
  404. package/dist/sdk/infra/futures/walde-admin-future.d.ts.map +1 -0
  405. package/dist/sdk/infra/futures/walde-admin-future.js +50 -0
  406. package/dist/sdk/infra/futures/walde-admin-future.js.map +1 -0
  407. package/dist/sdk/infra/futures/walde-future.d.ts +40 -0
  408. package/dist/sdk/infra/futures/walde-future.d.ts.map +1 -0
  409. package/dist/sdk/infra/futures/walde-future.js +66 -0
  410. package/dist/sdk/infra/futures/walde-future.js.map +1 -0
  411. package/dist/sdk/infra/futures/workspace-future.d.ts +38 -0
  412. package/dist/sdk/infra/futures/workspace-future.d.ts.map +1 -0
  413. package/dist/sdk/infra/futures/workspace-future.js +45 -0
  414. package/dist/sdk/infra/futures/workspace-future.js.map +1 -0
  415. package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.d.ts +20 -0
  416. package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.d.ts.map +1 -0
  417. package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.js +54 -0
  418. package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.js.map +1 -0
  419. package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.d.ts +24 -0
  420. package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.d.ts.map +1 -0
  421. package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.js +49 -0
  422. package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.js.map +1 -0
  423. package/dist/sdk/make-walde-admin.d.ts +15 -0
  424. package/dist/sdk/make-walde-admin.d.ts.map +1 -0
  425. package/dist/sdk/make-walde-admin.js +8 -0
  426. package/dist/sdk/make-walde-admin.js.map +1 -0
  427. package/dist/sdk/make-walde.d.ts +12 -0
  428. package/dist/sdk/make-walde.d.ts.map +1 -0
  429. package/dist/sdk/make-walde.js +8 -0
  430. package/dist/sdk/make-walde.js.map +1 -0
  431. package/dist/std/domain/entities/future.d.ts +28 -0
  432. package/dist/std/domain/entities/future.d.ts.map +1 -0
  433. package/dist/std/domain/entities/future.js +21 -0
  434. package/dist/std/domain/entities/future.js.map +1 -0
  435. package/dist/std/domain/entities/option.d.ts +53 -0
  436. package/dist/std/domain/entities/option.d.ts.map +1 -0
  437. package/dist/std/domain/entities/option.js +58 -0
  438. package/dist/std/domain/entities/option.js.map +1 -0
  439. package/dist/std/domain/entities/result.d.ts +87 -0
  440. package/dist/std/domain/entities/result.d.ts.map +1 -0
  441. package/dist/std/domain/entities/result.js +104 -0
  442. package/dist/std/domain/entities/result.js.map +1 -0
  443. package/dist/std/index.d.ts +6 -0
  444. package/dist/std/index.d.ts.map +1 -0
  445. package/dist/std/index.js +4 -0
  446. package/dist/std/index.js.map +1 -0
  447. package/package.json +33 -0
@@ -0,0 +1,52 @@
1
+ import { readdir, readFile, stat } from 'fs/promises';
2
+ import { join, relative } from 'path';
3
+ import { File } from '@/sdk/domain/entities/file';
4
+ import { WaldeLocalError } from '@/sdk/domain/errors';
5
+ /**
6
+ * Reads files from the local filesystem
7
+ */
8
+ export class FileSystemLocalFilesReader {
9
+ /**
10
+ * Recursively reads all files from a directory
11
+ * @param directoryPath - The path to the directory to read
12
+ * @returns Array of File entities with relative paths
13
+ */
14
+ async readAllFiles(directoryPath) {
15
+ const files = [];
16
+ await this.readDirectoryRecursive(directoryPath, directoryPath, files);
17
+ return files;
18
+ }
19
+ /**
20
+ * Recursively reads files from a directory
21
+ * @param currentPath - Current directory being processed
22
+ * @param basePath - Base directory for calculating relative paths
23
+ * @param files - Array to accumulate files
24
+ */
25
+ async readDirectoryRecursive(currentPath, basePath, files) {
26
+ try {
27
+ const entries = await readdir(currentPath);
28
+ for (const entry of entries) {
29
+ const fullPath = join(currentPath, entry);
30
+ const stats = await stat(fullPath);
31
+ if (stats.isDirectory()) {
32
+ // Skip hidden directories and common build/dependency directories
33
+ if (!entry.startsWith('.') && !['node_modules', 'dist', 'build'].includes(entry)) {
34
+ await this.readDirectoryRecursive(fullPath, basePath, files);
35
+ }
36
+ }
37
+ else if (stats.isFile()) {
38
+ // Skip hidden files
39
+ if (!entry.startsWith('.')) {
40
+ const relativePath = relative(basePath, fullPath);
41
+ const content = await readFile(fullPath);
42
+ files.push(new File(relativePath, content));
43
+ }
44
+ }
45
+ }
46
+ }
47
+ catch (error) {
48
+ throw new WaldeLocalError('Failed to read directory', error, { currentPath });
49
+ }
50
+ }
51
+ }
52
+ //# sourceMappingURL=file-system-local-files-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system-local-files-reader.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/filesystem/file-system-local-files-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACrC;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,aAAqB;QAC7C,MAAM,KAAK,GAAW,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,sBAAsB,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,sBAAsB,CAClC,WAAmB,EACnB,QAAgB,EAChB,KAAa;QAEb,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;YAE3C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAEnC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;oBACxB,kEAAkE;oBAClE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;wBACjF,MAAM,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;oBAC/D,CAAC;gBACH,CAAC;qBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;oBAC1B,oBAAoB;oBACpB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;wBAC3B,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;wBAClD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;wBACzC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,eAAe,CAAC,0BAA0B,EAAE,KAAc,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { BaseHttpClient } from './base-http-client';
2
+ /**
3
+ * HTTP client for making unauthenticated frontend API requests
4
+ */
5
+ export declare class FrontendHttpClient extends BaseHttpClient {
6
+ constructor(baseUrl: string);
7
+ /**
8
+ * Get basic headers without authentication
9
+ */
10
+ protected getHeaders(): Record<string, string>;
11
+ }
12
+ //# sourceMappingURL=frontend-http-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend-http-client.d.ts","sourceRoot":"","sources":["../../../../src/sdk/infra/adapters/frontend-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;gBACxC,OAAO,EAAE,MAAM;IAI3B;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAK/C"}
@@ -0,0 +1,18 @@
1
+ import { BaseHttpClient } from './base-http-client';
2
+ /**
3
+ * HTTP client for making unauthenticated frontend API requests
4
+ */
5
+ export class FrontendHttpClient extends BaseHttpClient {
6
+ constructor(baseUrl) {
7
+ super(baseUrl);
8
+ }
9
+ /**
10
+ * Get basic headers without authentication
11
+ */
12
+ getHeaders() {
13
+ return {
14
+ 'Content-Type': 'application/json',
15
+ };
16
+ }
17
+ }
18
+ //# sourceMappingURL=frontend-http-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend-http-client.js","sourceRoot":"","sources":["../../../../src/sdk/infra/adapters/frontend-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IACpD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED;;OAEG;IACO,UAAU;QAClB,OAAO;YACL,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ import { ContentRepo } from '@/sdk/domain/ports/out/content-repo';
2
+ import { Content } from '@/sdk/domain/entities/content';
3
+ import { ContentVersion } from '@/sdk/domain/entities/content-version';
4
+ import { ApiClient } from '@/sdk/infra/adapters/api-client';
5
+ /**
6
+ * HTTP implementation of ContentRepo using ApiClient for standard response handling
7
+ */
8
+ export declare class HttpContentRepo implements ContentRepo {
9
+ private readonly apiClient;
10
+ constructor(apiClient: ApiClient);
11
+ /**
12
+ * Lists contents for a site
13
+ */
14
+ list(siteId: string): Promise<Content[]>;
15
+ /**
16
+ * Pushes content and version to the API
17
+ * @param content - The content entity
18
+ * @param contentVersion - The content version entity
19
+ * @returns Promise resolving to the created/updated content with ID
20
+ */
21
+ pushContent(content: Content, contentVersion: ContentVersion): Promise<Content>;
22
+ /**
23
+ * Gets all contents, optionally filtered by site
24
+ * @param siteId - Optional site identifier to filter by
25
+ * @returns Promise resolving to array of contents
26
+ */
27
+ getAll(siteId?: string): Promise<Content[]>;
28
+ /**
29
+ * Transform ContentParts map to API format
30
+ */
31
+ private transformParts;
32
+ }
33
+ //# sourceMappingURL=http-content-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-content-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/http/http-content-repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AA0B5D;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;IAE/C,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAGvC;;OAEG;IACU,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIrD;;;;;OAKG;IACU,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAmC5F;;;;OAIG;IACU,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA0BxD;;OAEG;IACH,OAAO,CAAC,cAAc;CAYvB"}
@@ -0,0 +1,85 @@
1
+ import { Content } from '@/sdk/domain/entities/content';
2
+ import { WaldeUnexpectedError } from '@/sdk/domain/errors';
3
+ /**
4
+ * HTTP implementation of ContentRepo using ApiClient for standard response handling
5
+ */
6
+ export class HttpContentRepo {
7
+ apiClient;
8
+ constructor(apiClient) {
9
+ this.apiClient = apiClient;
10
+ }
11
+ /**
12
+ * Lists contents for a site
13
+ */
14
+ async list(siteId) {
15
+ return this.getAll(siteId);
16
+ }
17
+ /**
18
+ * Pushes content and version to the API
19
+ * @param content - The content entity
20
+ * @param contentVersion - The content version entity
21
+ * @returns Promise resolving to the created/updated content with ID
22
+ */
23
+ async pushContent(content, contentVersion) {
24
+ // Transform entities to API format matching specs/body.json
25
+ const payload = {
26
+ ...(content.id && { id: content.id }),
27
+ name: content.name,
28
+ key: content.key,
29
+ state: content.state,
30
+ siteId: content.siteId,
31
+ format: {
32
+ id: contentVersion.format.id
33
+ },
34
+ parts: this.transformParts(contentVersion.getParts())
35
+ };
36
+ try {
37
+ // Use correct endpoint: /v1/contents/<id> for updates, /v1/contents for new content
38
+ const endpoint = content.id ? `/v1/contents/${content.id}` : '/v1/contents';
39
+ // ApiClient automatically extracts payload from standard response format
40
+ const response = await this.apiClient.post(endpoint, payload);
41
+ // Return updated Content with ID from response payload
42
+ return new Content(response.id, content.siteId, content.name, content.key, content.state);
43
+ }
44
+ catch (error) {
45
+ // Preserve the original error with response data
46
+ throw error;
47
+ }
48
+ }
49
+ /**
50
+ * Gets all contents, optionally filtered by site
51
+ * @param siteId - Optional site identifier to filter by
52
+ * @returns Promise resolving to array of contents
53
+ */
54
+ async getAll(siteId) {
55
+ try {
56
+ // Backend returns all content regardless of siteId parameter, so just get all
57
+ const response = await this.apiClient.get('/v1/contents');
58
+ // Map API response to Content entities
59
+ const allContents = response.map(item => new Content(item.id, item.siteId, item.name, item.key, item.state));
60
+ // Client-side filtering by siteId if provided
61
+ if (siteId) {
62
+ return allContents.filter(content => content.siteId === siteId);
63
+ }
64
+ // Return all contents if no siteId filter
65
+ return allContents;
66
+ }
67
+ catch (error) {
68
+ throw new WaldeUnexpectedError('Failed to get contents', error);
69
+ }
70
+ }
71
+ /**
72
+ * Transform ContentParts map to API format
73
+ */
74
+ transformParts(parts) {
75
+ const result = {};
76
+ for (const [key, part] of parts) {
77
+ result[key] = {
78
+ data: part.data,
79
+ format: part.format
80
+ };
81
+ }
82
+ return result;
83
+ }
84
+ }
85
+ //# sourceMappingURL=http-content-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-content-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/http/http-content-repo.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,22 @@
1
+ import { RemoteFilesRepo } from '@/sdk/domain/ports/out/remote-files-repo';
2
+ import { File } from '@/sdk/domain/entities/file';
3
+ import { UiUploadCredentials } from '@/sdk/domain/entities/ui-upload-credentials';
4
+ /**
5
+ * AWS S3 implementation for uploading UI files
6
+ */
7
+ export declare class AwsS3FilesRepo implements RemoteFilesRepo {
8
+ constructor();
9
+ /**
10
+ * Upload files to AWS S3 using temporary credentials
11
+ */
12
+ uploadFiles(files: File[], credentials: UiUploadCredentials): Promise<void>;
13
+ /**
14
+ * Upload a single file to AWS S3 using temporary credentials
15
+ */
16
+ uploadFile(file: File, credentials: UiUploadCredentials): Promise<void>;
17
+ /**
18
+ * Determine content type based on file extension
19
+ */
20
+ private getContentType;
21
+ }
22
+ //# sourceMappingURL=aws-s3-files-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws-s3-files-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/aws-s3-files-repo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAGlF;;GAEG;AACH,qBAAa,cAAe,YAAW,eAAe;;IAGpD;;OAEG;IACU,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxF;;OAEG;IACU,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBpF;;OAEG;IACH,OAAO,CAAC,cAAc;CA2BvB"}
@@ -0,0 +1,73 @@
1
+ import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
2
+ import { WaldeLocalError } from '@/sdk/domain/errors';
3
+ /**
4
+ * AWS S3 implementation for uploading UI files
5
+ */
6
+ export class AwsS3FilesRepo {
7
+ constructor() { }
8
+ /**
9
+ * Upload files to AWS S3 using temporary credentials
10
+ */
11
+ async uploadFiles(files, credentials) {
12
+ // Upload all files - errors will be thrown and handled by the interactor
13
+ for (const file of files) {
14
+ await this.uploadFile(file, credentials);
15
+ }
16
+ }
17
+ /**
18
+ * Upload a single file to AWS S3 using temporary credentials
19
+ */
20
+ async uploadFile(file, credentials) {
21
+ // Create S3 client with temporary AWS credentials and region from credentials
22
+ const s3Client = new S3Client({
23
+ region: credentials.region,
24
+ credentials: {
25
+ accessKeyId: credentials.accessKey,
26
+ secretAccessKey: credentials.secretKey,
27
+ sessionToken: credentials.sessionToken
28
+ }
29
+ });
30
+ const command = new PutObjectCommand({
31
+ Bucket: credentials.bucketName,
32
+ Key: file.path,
33
+ Body: file.content,
34
+ ContentType: this.getContentType(file.path)
35
+ });
36
+ try {
37
+ await s3Client.send(command);
38
+ }
39
+ catch (error) {
40
+ throw new WaldeLocalError('Failed to upload to S3', error, { filePath: file.path });
41
+ }
42
+ }
43
+ /**
44
+ * Determine content type based on file extension
45
+ */
46
+ getContentType(filePath) {
47
+ const extension = filePath.split('.').pop()?.toLowerCase();
48
+ switch (extension) {
49
+ case 'html':
50
+ return 'text/html';
51
+ case 'css':
52
+ return 'text/css';
53
+ case 'js':
54
+ return 'application/javascript';
55
+ case 'json':
56
+ return 'application/json';
57
+ case 'png':
58
+ return 'image/png';
59
+ case 'jpg':
60
+ case 'jpeg':
61
+ return 'image/jpeg';
62
+ case 'gif':
63
+ return 'image/gif';
64
+ case 'svg':
65
+ return 'image/svg+xml';
66
+ case 'ico':
67
+ return 'image/x-icon';
68
+ default:
69
+ return 'application/octet-stream';
70
+ }
71
+ }
72
+ }
73
+ //# sourceMappingURL=aws-s3-files-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws-s3-files-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/aws-s3-files-repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAIhE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,gBAAe,CAAC;IAEhB;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,KAAa,EAAE,WAAgC;QACtE,yEAAyE;QACzE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,UAAU,CAAC,IAAU,EAAE,WAAgC;QAClE,8EAA8E;QAC9E,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC;YAC5B,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,WAAW,EAAE;gBACX,WAAW,EAAE,WAAW,CAAC,SAAS;gBAClC,eAAe,EAAE,WAAW,CAAC,SAAS;gBACtC,YAAY,EAAE,WAAW,CAAC,YAAY;aACvC;SACF,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;YACnC,MAAM,EAAE,WAAW,CAAC,UAAU;YAC9B,GAAG,EAAE,IAAI,CAAC,IAAI;YACd,IAAI,EAAE,IAAI,CAAC,OAAO;YAClB,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5C,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,eAAe,CAAC,wBAAwB,EAAE,KAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;IAED;;OAEG;IACK,cAAc,CAAC,QAAgB;QACrC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;QAE3D,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,MAAM;gBACT,OAAO,WAAW,CAAC;YACrB,KAAK,KAAK;gBACR,OAAO,UAAU,CAAC;YACpB,KAAK,IAAI;gBACP,OAAO,wBAAwB,CAAC;YAClC,KAAK,MAAM;gBACT,OAAO,kBAAkB,CAAC;YAC5B,KAAK,KAAK;gBACR,OAAO,WAAW,CAAC;YACrB,KAAK,KAAK,CAAC;YACX,KAAK,MAAM;gBACT,OAAO,YAAY,CAAC;YACtB,KAAK,KAAK;gBACR,OAAO,WAAW,CAAC;YACrB,KAAK,KAAK;gBACR,OAAO,eAAe,CAAC;YACzB,KAAK,KAAK;gBACR,OAAO,cAAc,CAAC;YACxB;gBACE,OAAO,0BAA0B,CAAC;QACtC,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import { CredentialsProvider } from '@/sdk/domain/ports/out/credentials-provider';
2
+ import { Credentials } from '@/sdk/domain/entities/credentials';
3
+ /**
4
+ * File-based repository for user credentials
5
+ */
6
+ export declare class CredentialsFileRepo implements CredentialsProvider {
7
+ private readonly filePath;
8
+ constructor(filePath: string);
9
+ /**
10
+ * Retrieve user credentials from JSON file
11
+ */
12
+ retrieve(): Promise<Credentials>;
13
+ /**
14
+ * Save user credentials to JSON file
15
+ */
16
+ save(credentials: Credentials): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=credentials-file-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-file-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/credentials-file-repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE;;GAEG;AACH,qBAAa,mBAAoB,YAAW,mBAAmB;IACjD,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,MAAM;IAE7C;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAe7C;;OAEG;IACU,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAc3D"}
@@ -0,0 +1,41 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import { Credentials } from '@/sdk/domain/entities/credentials';
4
+ /**
5
+ * File-based repository for user credentials
6
+ */
7
+ export class CredentialsFileRepo {
8
+ filePath;
9
+ constructor(filePath) {
10
+ this.filePath = filePath;
11
+ }
12
+ /**
13
+ * Retrieve user credentials from JSON file
14
+ */
15
+ async retrieve() {
16
+ try {
17
+ const fileContent = fs.readFileSync(this.filePath, 'utf-8');
18
+ const data = JSON.parse(fileContent);
19
+ return new Credentials(data.accessToken, data.refreshToken, data.idToken);
20
+ }
21
+ catch (error) {
22
+ return new Credentials('', '', '');
23
+ }
24
+ }
25
+ /**
26
+ * Save user credentials to JSON file
27
+ */
28
+ async save(credentials) {
29
+ const data = {
30
+ accessToken: credentials.accessToken,
31
+ refreshToken: credentials.refreshToken,
32
+ idToken: credentials.idToken
33
+ };
34
+ const dir = path.dirname(this.filePath);
35
+ if (!fs.existsSync(dir)) {
36
+ fs.mkdirSync(dir, { recursive: true });
37
+ }
38
+ fs.writeFileSync(this.filePath, JSON.stringify(data, null, 2));
39
+ }
40
+ }
41
+ //# sourceMappingURL=credentials-file-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-file-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/credentials-file-repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,mBAAmB;IACD;IAA7B,YAA6B,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAEjD;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAErC,OAAO,IAAI,WAAW,CACpB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,CACb,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,IAAI,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,IAAI,GAAG;YACX,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,YAAY,EAAE,WAAW,CAAC,YAAY;YACtC,OAAO,EAAE,WAAW,CAAC,OAAO;SAC7B,CAAC;QAEF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { StaticWaldeAdminConfig } from './static-walde-admin-config';
2
+ /**
3
+ * Factory for creating default configuration with fallback values
4
+ */
5
+ export declare class DefaultWaldeAdminConfig {
6
+ /**
7
+ * Create a StaticWaldeAdminConfig with default values
8
+ */
9
+ static create(): StaticWaldeAdminConfig;
10
+ }
11
+ //# sourceMappingURL=default-walde-admin-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-walde-admin-config.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/default-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE;;GAEG;AACH,qBAAa,uBAAuB;IAClC;;OAEG;WACW,MAAM,IAAI,sBAAsB;CAW/C"}
@@ -0,0 +1,20 @@
1
+ import { StaticWaldeAdminConfig } from './static-walde-admin-config';
2
+ /**
3
+ * Factory for creating default configuration with fallback values
4
+ */
5
+ export class DefaultWaldeAdminConfig {
6
+ /**
7
+ * Create a StaticWaldeAdminConfig with default values
8
+ */
9
+ static create() {
10
+ const defaultConfig = {
11
+ endpoint: 'https://api.walde.ai',
12
+ clientId: '2na3vdtebghu3se9rvimtuiaej',
13
+ region: 'eu-central-1',
14
+ userPoolId: 'eu-central-1_XLyUuL5PG'
15
+ };
16
+ // Cast to partial for StaticWaldeAdminConfig constructor
17
+ return new StaticWaldeAdminConfig(defaultConfig);
18
+ }
19
+ }
20
+ //# sourceMappingURL=default-walde-admin-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-walde-admin-config.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/default-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAClC;;OAEG;IACI,MAAM,CAAC,MAAM;QAClB,MAAM,aAAa,GAAyB;YAC1C,QAAQ,EAAE,sBAAsB;YAChC,QAAQ,EAAE,4BAA4B;YACtC,MAAM,EAAE,cAAc;YACtB,UAAU,EAAE,wBAAwB;SACrC,CAAC;QAEF,yDAAyD;QACzD,OAAO,IAAI,sBAAsB,CAAC,aAA4C,CAAC,CAAC;IAClF,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { WaldeAdminConfig, PartialWaldeAdminConfigData } from '@/sdk/domain/entities/walde-admin-config';
2
+ /**
3
+ * File-based configuration implementation
4
+ */
5
+ export declare class FileWaldeAdminConfig extends WaldeAdminConfig {
6
+ private filePath;
7
+ constructor(filePath: string);
8
+ private loadFromFile;
9
+ protected createInstance(data: PartialWaldeAdminConfigData): FileWaldeAdminConfig;
10
+ }
11
+ //# sourceMappingURL=file-walde-admin-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-walde-admin-config.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAGzG;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,gBAAgB;IACxD,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,EAAE,MAAM;IAM5B,OAAO,CAAC,YAAY;IAkBpB,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,2BAA2B,GAAG,oBAAoB;CAMlF"}
@@ -0,0 +1,38 @@
1
+ import { WaldeAdminConfig } from '@/sdk/domain/entities/walde-admin-config';
2
+ import * as fs from 'fs';
3
+ /**
4
+ * File-based configuration implementation
5
+ */
6
+ export class FileWaldeAdminConfig extends WaldeAdminConfig {
7
+ filePath;
8
+ constructor(filePath) {
9
+ super();
10
+ this.filePath = filePath;
11
+ this.loadFromFile();
12
+ }
13
+ loadFromFile() {
14
+ if (fs.existsSync(this.filePath)) {
15
+ try {
16
+ const fileContent = fs.readFileSync(this.filePath, 'utf8');
17
+ const configData = JSON.parse(fileContent);
18
+ this.data = {
19
+ endpoint: configData.endpoint,
20
+ clientId: configData.clientId,
21
+ region: configData.region,
22
+ userPoolId: configData.userPoolId
23
+ };
24
+ }
25
+ catch (error) {
26
+ // File exists but is invalid, keep empty config
27
+ this.data = {};
28
+ }
29
+ }
30
+ }
31
+ createInstance(data) {
32
+ // Create a new FileWaldeAdminConfig with the same file path but merged data
33
+ const merged = new FileWaldeAdminConfig(this.filePath);
34
+ merged.data = data;
35
+ return merged;
36
+ }
37
+ }
38
+ //# sourceMappingURL=file-walde-admin-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-walde-admin-config.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA+B,MAAM,0CAA0C,CAAC;AACzG,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,gBAAgB;IAChD,QAAQ,CAAS;IAEzB,YAAY,QAAgB;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAEO,YAAY;QAClB,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBAC3C,IAAI,CAAC,IAAI,GAAG;oBACV,QAAQ,EAAE,UAAU,CAAC,QAAQ;oBAC7B,QAAQ,EAAE,UAAU,CAAC,QAAQ;oBAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;oBACzB,UAAU,EAAE,UAAU,CAAC,UAAU;iBAClC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,gDAAgD;gBAChD,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAES,cAAc,CAAC,IAAiC;QACxD,4EAA4E;QAC5E,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,26 @@
1
+ import { WorkspaceConfigRepo } from '@/sdk/domain/ports/out/workspace-config-repo';
2
+ import { WorkspaceConfig } from '@/sdk/domain/entities/workspace-config';
3
+ /**
4
+ * File system implementation of WorkspaceConfigRepo
5
+ */
6
+ export declare class FileWorkspaceConfigRepo implements WorkspaceConfigRepo {
7
+ /**
8
+ * Saves workspace configuration to walde.json
9
+ * @param targetPath - Directory path where walde.json should be created
10
+ * @param config - Workspace configuration to save
11
+ */
12
+ save(targetPath: string, config: WorkspaceConfig): Promise<void>;
13
+ /**
14
+ * Loads workspace configuration from walde.json
15
+ * @param targetPath - Directory path where walde.json is located
16
+ * @returns Promise resolving to workspace configuration
17
+ */
18
+ load(targetPath: string): Promise<WorkspaceConfig>;
19
+ /**
20
+ * Searches for workspace configuration starting from the given path and moving up the directory tree
21
+ * @param startPath - Starting directory path (defaults to current working directory)
22
+ * @returns Promise resolving to workspace configuration or null if not found
23
+ */
24
+ findWorkspace(startPath?: string): Promise<WorkspaceConfig | null>;
25
+ }
26
+ //# sourceMappingURL=file-workspace-config-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-workspace-config-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-workspace-config-repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAKzE;;GAEG;AACH,qBAAa,uBAAwB,YAAW,mBAAmB;IACjE;;;;OAIG;IACU,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB7E;;;;OAIG;IACU,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAyB/D;;;;OAIG;IACU,aAAa,CAAC,SAAS,GAAE,MAAsB,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;CAsB/F"}
@@ -0,0 +1,86 @@
1
+ import { WorkspaceConfig } from '@/sdk/domain/entities/workspace-config';
2
+ import { promises as fs } from 'fs';
3
+ import path from 'path';
4
+ import { WaldeLocalError } from '@/sdk/domain/errors';
5
+ /**
6
+ * File system implementation of WorkspaceConfigRepo
7
+ */
8
+ export class FileWorkspaceConfigRepo {
9
+ /**
10
+ * Saves workspace configuration to walde.json
11
+ * @param targetPath - Directory path where walde.json should be created
12
+ * @param config - Workspace configuration to save
13
+ */
14
+ async save(targetPath, config) {
15
+ const configPath = path.join(targetPath, 'walde.json');
16
+ const configData = {
17
+ siteId: config.siteId,
18
+ paths: config.paths
19
+ };
20
+ try {
21
+ // Ensure target directory exists
22
+ await fs.mkdir(targetPath, { recursive: true });
23
+ await fs.writeFile(configPath, JSON.stringify(configData, null, 2), 'utf-8');
24
+ }
25
+ catch (error) {
26
+ throw new WaldeLocalError('Failed to save workspace configuration', error, { configPath });
27
+ }
28
+ }
29
+ /**
30
+ * Loads workspace configuration from walde.json
31
+ * @param targetPath - Directory path where walde.json is located
32
+ * @returns Promise resolving to workspace configuration
33
+ */
34
+ async load(targetPath) {
35
+ const configPath = path.join(targetPath, 'walde.json');
36
+ try {
37
+ const configContent = await fs.readFile(configPath, 'utf-8');
38
+ const configData = JSON.parse(configContent);
39
+ // Handle both old and new format for backward compatibility during development
40
+ let paths;
41
+ if (configData.paths) {
42
+ paths = configData.paths;
43
+ }
44
+ else if (configData.contentPath) {
45
+ // Legacy format - convert to new format
46
+ paths = { content: configData.contentPath, ui: 'ui' };
47
+ }
48
+ else {
49
+ // Default paths
50
+ paths = { content: 'content', ui: 'ui' };
51
+ }
52
+ return new WorkspaceConfig(configData.siteId, paths);
53
+ }
54
+ catch (error) {
55
+ throw new WaldeLocalError('Failed to load workspace configuration', error);
56
+ }
57
+ }
58
+ /**
59
+ * Searches for workspace configuration starting from the given path and moving up the directory tree
60
+ * @param startPath - Starting directory path (defaults to current working directory)
61
+ * @returns Promise resolving to workspace configuration or null if not found
62
+ */
63
+ async findWorkspace(startPath = process.cwd()) {
64
+ let currentPath = path.resolve(startPath);
65
+ const root = path.parse(currentPath).root;
66
+ while (currentPath !== root) {
67
+ try {
68
+ const config = await this.load(currentPath);
69
+ return config;
70
+ }
71
+ catch (error) {
72
+ // Continue searching up the directory tree
73
+ currentPath = path.dirname(currentPath);
74
+ }
75
+ }
76
+ // Check root directory as well
77
+ try {
78
+ const config = await this.load(currentPath);
79
+ return config;
80
+ }
81
+ catch (error) {
82
+ return null;
83
+ }
84
+ }
85
+ }
86
+ //# sourceMappingURL=file-workspace-config-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-workspace-config-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-workspace-config-repo.ts"],"names":[],"mappings":"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"}