@redocly/revel 0.127.0-next.10 → 0.127.0-next.11

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 (266) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/cli/develop.js +1 -1
  4. package/dist/cli/develop.js.map +1 -1
  5. package/dist/cli/prepare/index.js +1 -1
  6. package/dist/cli/prepare/index.js.map +1 -1
  7. package/dist/server/constants/plugins/catalog-entities.d.ts +2 -0
  8. package/dist/server/constants/plugins/catalog-entities.d.ts.map +1 -1
  9. package/dist/server/constants/plugins/catalog-entities.js +1 -1
  10. package/dist/server/constants/plugins/catalog-entities.js.map +1 -1
  11. package/dist/server/fs/cache.d.ts +6 -1
  12. package/dist/server/fs/cache.d.ts.map +1 -1
  13. package/dist/server/fs/cache.js +1 -1
  14. package/dist/server/fs/cache.js.map +1 -1
  15. package/dist/server/persistence/cache/mappers/create-cache-db-record.d.ts +8 -0
  16. package/dist/server/persistence/cache/mappers/create-cache-db-record.d.ts.map +1 -0
  17. package/dist/server/persistence/cache/mappers/create-cache-db-record.js +1 -0
  18. package/dist/server/persistence/cache/mappers/create-cache-db-record.js.map +1 -0
  19. package/dist/server/persistence/cache/mappers/create-cache-read-model.d.ts +4 -0
  20. package/dist/server/persistence/cache/mappers/create-cache-read-model.d.ts.map +1 -0
  21. package/dist/server/persistence/cache/mappers/create-cache-read-model.js +1 -0
  22. package/dist/server/persistence/cache/mappers/create-cache-read-model.js.map +1 -0
  23. package/dist/server/persistence/cache/repositories/cache-local-repository.d.ts +13 -0
  24. package/dist/server/persistence/cache/repositories/cache-local-repository.d.ts.map +1 -0
  25. package/dist/server/persistence/cache/repositories/cache-local-repository.js +1 -0
  26. package/dist/server/persistence/cache/repositories/cache-local-repository.js.map +1 -0
  27. package/dist/server/persistence/cache/services/cache-service.d.ts +29 -0
  28. package/dist/server/persistence/cache/services/cache-service.d.ts.map +1 -0
  29. package/dist/server/persistence/cache/services/cache-service.js +1 -0
  30. package/dist/server/persistence/cache/services/cache-service.js.map +1 -0
  31. package/dist/server/persistence/cache/types.d.ts +20 -0
  32. package/dist/server/persistence/cache/types.d.ts.map +1 -0
  33. package/dist/server/persistence/cache/types.js +0 -0
  34. package/dist/server/persistence/cache/types.js.map +1 -0
  35. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-read-repository.d.ts +1 -1
  36. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-read-repository.d.ts.map +1 -1
  37. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-read-repository.js +1 -1
  38. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-read-repository.js.map +1 -1
  39. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-repository.d.ts +3 -5
  40. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-repository.d.ts.map +1 -1
  41. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-repository.js +1 -1
  42. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-repository.js.map +1 -1
  43. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-write-repository.d.ts +1 -1
  44. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-write-repository.d.ts.map +1 -1
  45. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-write-repository.js +1 -1
  46. package/dist/server/persistence/file-hashes/repositories/file-hashes-local-write-repository.js.map +1 -1
  47. package/dist/server/persistence/file-hashes/services/file-hashes-service.d.ts +3 -4
  48. package/dist/server/persistence/file-hashes/services/file-hashes-service.d.ts.map +1 -1
  49. package/dist/server/persistence/file-hashes/services/file-hashes-service.js +1 -1
  50. package/dist/server/persistence/file-hashes/services/file-hashes-service.js.map +1 -1
  51. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-db-record.d.ts +7 -0
  52. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-db-record.d.ts.map +1 -0
  53. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-db-record.js +1 -0
  54. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-db-record.js.map +1 -0
  55. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-read-model.d.ts +4 -0
  56. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-read-model.d.ts.map +1 -0
  57. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-read-model.js +1 -0
  58. package/dist/server/persistence/plugin-storage/mappers/create-plugin-storage-read-model.js.map +1 -0
  59. package/dist/server/persistence/plugin-storage/repositories/plugin-storage-local-repository.d.ts +12 -0
  60. package/dist/server/persistence/plugin-storage/repositories/plugin-storage-local-repository.d.ts.map +1 -0
  61. package/dist/server/persistence/plugin-storage/repositories/plugin-storage-local-repository.js +1 -0
  62. package/dist/server/persistence/plugin-storage/repositories/plugin-storage-local-repository.js.map +1 -0
  63. package/dist/server/persistence/plugin-storage/services/plugin-storage-service.d.ts +25 -0
  64. package/dist/server/persistence/plugin-storage/services/plugin-storage-service.d.ts.map +1 -0
  65. package/dist/server/persistence/plugin-storage/services/plugin-storage-service.js +1 -0
  66. package/dist/server/persistence/plugin-storage/services/plugin-storage-service.js.map +1 -0
  67. package/dist/server/persistence/plugin-storage/types.d.ts +18 -0
  68. package/dist/server/persistence/plugin-storage/types.d.ts.map +1 -0
  69. package/dist/server/persistence/plugin-storage/types.js +0 -0
  70. package/dist/server/persistence/plugin-storage/types.js.map +1 -0
  71. package/dist/server/plugins/analytics/heap/browser-hooks.js.map +1 -1
  72. package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts +4 -7
  73. package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts.map +1 -1
  74. package/dist/server/plugins/catalog-entities/database/catalog-entities-service.js +1 -1
  75. package/dist/server/plugins/catalog-entities/database/catalog-entities-service.js.map +1 -1
  76. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.d.ts +2 -10
  77. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.d.ts.map +1 -1
  78. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.js +19 -19
  79. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.js.map +1 -1
  80. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.d.ts +3 -7
  81. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.d.ts.map +1 -1
  82. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.js +1 -1
  83. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.js.map +1 -1
  84. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-write-repository.d.ts +1 -3
  85. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-write-repository.d.ts.map +1 -1
  86. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-write-repository.js +1 -1
  87. package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-write-repository.js.map +1 -1
  88. package/dist/server/plugins/catalog-entities/database/repositories/remote/catalog-entities-remote-repository.d.ts +3 -3
  89. package/dist/server/plugins/catalog-entities/database/repositories/remote/catalog-entities-remote-repository.d.ts.map +1 -1
  90. package/dist/server/plugins/catalog-entities/database/repositories/remote/catalog-entities-remote-repository.js +1 -1
  91. package/dist/server/plugins/catalog-entities/database/repositories/remote/catalog-entities-remote-repository.js.map +1 -1
  92. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.d.ts +1 -4
  93. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.d.ts.map +1 -1
  94. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.js +1 -1
  95. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.js.map +1 -1
  96. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.d.ts +1 -14
  97. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.d.ts.map +1 -1
  98. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.js +1 -1
  99. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.js.map +1 -1
  100. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.d.ts +1 -1
  101. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.d.ts.map +1 -1
  102. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js +1 -1
  103. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js.map +1 -1
  104. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.d.ts +1 -16
  105. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.d.ts.map +1 -1
  106. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.js +2 -2
  107. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.js.map +1 -1
  108. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.d.ts +1 -16
  109. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.d.ts.map +1 -1
  110. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js +1 -1
  111. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js.map +1 -1
  112. package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.d.ts +1 -8
  113. package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.d.ts.map +1 -1
  114. package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.js +1 -1
  115. package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.js.map +1 -1
  116. package/dist/server/plugins/catalog-entities/get-server-props.d.ts.map +1 -1
  117. package/dist/server/plugins/catalog-entities/get-server-props.js +1 -1
  118. package/dist/server/plugins/catalog-entities/get-server-props.js.map +1 -1
  119. package/dist/server/plugins/catalog-entities/plugin.d.ts.map +1 -1
  120. package/dist/server/plugins/catalog-entities/plugin.js +1 -1
  121. package/dist/server/plugins/catalog-entities/plugin.js.map +1 -1
  122. package/dist/server/plugins/catalog-entities/utils/hash-manager.d.ts +1 -9
  123. package/dist/server/plugins/catalog-entities/utils/hash-manager.d.ts.map +1 -1
  124. package/dist/server/plugins/catalog-entities/utils/hash-manager.js +1 -1
  125. package/dist/server/plugins/catalog-entities/utils/hash-manager.js.map +1 -1
  126. package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.d.ts +1 -1
  127. package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.d.ts.map +1 -1
  128. package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.js +1 -1
  129. package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.js.map +1 -1
  130. package/dist/server/plugins/catalog-entities/utils/openapi-schema-resolver.d.ts +1 -2
  131. package/dist/server/plugins/catalog-entities/utils/openapi-schema-resolver.d.ts.map +1 -1
  132. package/dist/server/plugins/catalog-entities/utils/openapi-schema-resolver.js +1 -1
  133. package/dist/server/plugins/catalog-entities/utils/openapi-schema-resolver.js.map +1 -1
  134. package/dist/server/plugins/config-parser/apply-l10n-to-redirects.d.ts +14 -0
  135. package/dist/server/plugins/config-parser/apply-l10n-to-redirects.d.ts.map +1 -0
  136. package/dist/server/plugins/config-parser/apply-l10n-to-redirects.js +1 -0
  137. package/dist/server/plugins/config-parser/apply-l10n-to-redirects.js.map +1 -0
  138. package/dist/server/plugins/config-parser/index.d.ts.map +1 -1
  139. package/dist/server/plugins/config-parser/index.js +1 -1
  140. package/dist/server/plugins/config-parser/index.js.map +1 -1
  141. package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.d.ts.map +1 -1
  142. package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
  143. package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js.map +1 -1
  144. package/dist/server/plugins/markdown/attribute-resolvers/resolve-native-md-link.js +1 -1
  145. package/dist/server/plugins/markdown/attribute-resolvers/resolve-native-md-link.js.map +1 -1
  146. package/dist/server/providers/database/base-repository.d.ts +1 -5
  147. package/dist/server/providers/database/base-repository.d.ts.map +1 -1
  148. package/dist/server/providers/database/base-repository.js +1 -1
  149. package/dist/server/providers/database/base-repository.js.map +1 -1
  150. package/dist/server/providers/database/client.d.ts +1 -1
  151. package/dist/server/providers/database/client.d.ts.map +1 -1
  152. package/dist/server/providers/database/client.js +1 -1
  153. package/dist/server/providers/database/client.js.map +1 -1
  154. package/dist/server/providers/database/constants.d.ts +7 -0
  155. package/dist/server/providers/database/constants.d.ts.map +1 -0
  156. package/dist/server/providers/database/constants.js +1 -0
  157. package/dist/server/providers/database/constants.js.map +1 -0
  158. package/dist/{cli/prepare → server/providers/database}/copy-migrations.d.ts +1 -1
  159. package/dist/server/providers/database/copy-migrations.d.ts.map +1 -0
  160. package/dist/server/providers/database/copy-migrations.js +1 -0
  161. package/dist/server/providers/database/copy-migrations.js.map +1 -0
  162. package/dist/server/providers/database/database-connections-manager.d.ts +1 -7
  163. package/dist/server/providers/database/database-connections-manager.d.ts.map +1 -1
  164. package/dist/server/providers/database/database-connections-manager.js +1 -1
  165. package/dist/server/providers/database/database-connections-manager.js.map +1 -1
  166. package/dist/server/providers/database/database-initialization-strategy.d.ts +1 -2
  167. package/dist/server/providers/database/database-initialization-strategy.d.ts.map +1 -1
  168. package/dist/server/providers/database/database-initialization-strategy.js +1 -1
  169. package/dist/server/providers/database/database-initialization-strategy.js.map +1 -1
  170. package/dist/server/providers/database/database-path-generator.d.ts +1 -1
  171. package/dist/server/providers/database/database-path-generator.d.ts.map +1 -1
  172. package/dist/server/providers/database/database-path-generator.js +1 -1
  173. package/dist/server/providers/database/database-path-generator.js.map +1 -1
  174. package/dist/server/providers/database/database-preconnect-service.d.ts +1 -2
  175. package/dist/server/providers/database/database-preconnect-service.d.ts.map +1 -1
  176. package/dist/server/providers/database/database-preconnect-service.js +1 -1
  177. package/dist/server/providers/database/database-preconnect-service.js.map +1 -1
  178. package/dist/server/providers/database/databases/catalog-sqlite/drizzle.config.d.ts +14 -0
  179. package/dist/server/providers/database/databases/catalog-sqlite/drizzle.config.d.ts.map +1 -0
  180. package/dist/server/providers/database/databases/catalog-sqlite/drizzle.config.js +1 -0
  181. package/dist/server/providers/database/databases/catalog-sqlite/drizzle.config.js.map +1 -0
  182. package/dist/server/providers/database/databases/main-sqlite/drizzle.config.d.ts +10 -0
  183. package/dist/server/providers/database/databases/main-sqlite/drizzle.config.d.ts.map +1 -0
  184. package/dist/server/providers/database/databases/main-sqlite/drizzle.config.js +1 -0
  185. package/dist/server/providers/database/databases/main-sqlite/drizzle.config.js.map +1 -0
  186. package/dist/server/providers/database/databases/main-sqlite/schemas/cache-table.d.ts +122 -0
  187. package/dist/server/providers/database/databases/main-sqlite/schemas/cache-table.d.ts.map +1 -0
  188. package/dist/server/providers/database/databases/main-sqlite/schemas/cache-table.js +1 -0
  189. package/dist/server/providers/database/databases/main-sqlite/schemas/cache-table.js.map +1 -0
  190. package/dist/server/providers/database/databases/plugin-storage-sqlite/drizzle.config.d.ts +10 -0
  191. package/dist/server/providers/database/databases/plugin-storage-sqlite/drizzle.config.d.ts.map +1 -0
  192. package/dist/server/providers/database/databases/plugin-storage-sqlite/drizzle.config.js +1 -0
  193. package/dist/server/providers/database/databases/plugin-storage-sqlite/drizzle.config.js.map +1 -0
  194. package/dist/server/providers/database/databases/plugin-storage-sqlite/schemas/plugin-storage-table.d.ts +103 -0
  195. package/dist/server/providers/database/databases/plugin-storage-sqlite/schemas/plugin-storage-table.d.ts.map +1 -0
  196. package/dist/server/providers/database/databases/plugin-storage-sqlite/schemas/plugin-storage-table.js +1 -0
  197. package/dist/server/providers/database/databases/plugin-storage-sqlite/schemas/plugin-storage-table.js.map +1 -0
  198. package/dist/server/providers/database/transactions-manager.d.ts +1 -3
  199. package/dist/server/providers/database/transactions-manager.d.ts.map +1 -1
  200. package/dist/server/providers/database/transactions-manager.js +1 -1
  201. package/dist/server/providers/database/transactions-manager.js.map +1 -1
  202. package/dist/server/store.d.ts +4 -1
  203. package/dist/server/store.d.ts.map +1 -1
  204. package/dist/server/store.js +1 -1
  205. package/dist/server/store.js.map +1 -1
  206. package/dist/server/types/index.d.ts +1 -0
  207. package/dist/server/types/index.d.ts.map +1 -1
  208. package/dist/server/types/index.js +1 -1
  209. package/dist/server/types/index.js.map +1 -1
  210. package/dist/server/types/redirects.d.ts +6 -0
  211. package/dist/server/types/redirects.d.ts.map +1 -0
  212. package/dist/server/types/redirects.js +0 -0
  213. package/dist/server/types/redirects.js.map +1 -0
  214. package/dist/server/utils/is-ttl-correct.d.ts +23 -0
  215. package/dist/server/utils/is-ttl-correct.d.ts.map +1 -0
  216. package/dist/server/utils/is-ttl-correct.js +1 -0
  217. package/dist/server/utils/is-ttl-correct.js.map +1 -0
  218. package/dist/server/utils/is-ttl-expired.d.ts +23 -0
  219. package/dist/server/utils/is-ttl-expired.d.ts.map +1 -0
  220. package/dist/server/utils/is-ttl-expired.js +1 -0
  221. package/dist/server/utils/is-ttl-expired.js.map +1 -0
  222. package/dist/server/utils/redirects/add-wildcard-redirect-to-tree.d.ts +21 -0
  223. package/dist/server/utils/redirects/add-wildcard-redirect-to-tree.d.ts.map +1 -0
  224. package/dist/server/utils/redirects/add-wildcard-redirect-to-tree.js +1 -0
  225. package/dist/server/utils/redirects/add-wildcard-redirect-to-tree.js.map +1 -0
  226. package/dist/server/utils/redirects/build-wildcard-redirects-tree.d.ts +21 -0
  227. package/dist/server/utils/redirects/build-wildcard-redirects-tree.d.ts.map +1 -0
  228. package/dist/server/utils/redirects/build-wildcard-redirects-tree.js +1 -0
  229. package/dist/server/utils/redirects/build-wildcard-redirects-tree.js.map +1 -0
  230. package/dist/server/utils/{redirects.d.ts → redirects/find-redirect.d.ts} +9 -10
  231. package/dist/server/utils/redirects/find-redirect.d.ts.map +1 -0
  232. package/dist/server/utils/redirects/find-redirect.js +1 -0
  233. package/dist/server/utils/redirects/find-redirect.js.map +1 -0
  234. package/dist/server/utils/resolve-asset-path.d.ts.map +1 -1
  235. package/dist/server/utils/resolve-asset-path.js +1 -1
  236. package/dist/server/utils/resolve-asset-path.js.map +1 -1
  237. package/dist/server/utils/with-timestamp.d.ts +25 -0
  238. package/dist/server/utils/with-timestamp.d.ts.map +1 -0
  239. package/dist/server/utils/with-timestamp.js +1 -0
  240. package/dist/server/utils/with-timestamp.js.map +1 -0
  241. package/dist/server/web-server/routes/catalog/catalog-relations.d.ts.map +1 -1
  242. package/dist/server/web-server/routes/catalog/catalog-relations.js +1 -1
  243. package/dist/server/web-server/routes/catalog/catalog-relations.js.map +1 -1
  244. package/dist/server/web-server/routes/catalog/catalog.d.ts.map +1 -1
  245. package/dist/server/web-server/routes/catalog/catalog.js +1 -1
  246. package/dist/server/web-server/routes/catalog/catalog.js.map +1 -1
  247. package/dist/server/web-server/routes/dynamic-route.d.ts.map +1 -1
  248. package/dist/server/web-server/routes/dynamic-route.js +1 -1
  249. package/dist/server/web-server/routes/dynamic-route.js.map +1 -1
  250. package/dist/server/web-server/routes/helpers/process-redirects.d.ts +26 -5
  251. package/dist/server/web-server/routes/helpers/process-redirects.d.ts.map +1 -1
  252. package/dist/server/web-server/routes/helpers/process-redirects.js +1 -1
  253. package/dist/server/web-server/routes/helpers/process-redirects.js.map +1 -1
  254. package/dist/server/web-server/routes/page-data.js +1 -1
  255. package/dist/server/web-server/routes/page-data.js.map +1 -1
  256. package/package.json +6 -6
  257. package/dist/cli/prepare/copy-migrations.d.ts.map +0 -1
  258. package/dist/cli/prepare/copy-migrations.js +0 -1
  259. package/dist/cli/prepare/copy-migrations.js.map +0 -1
  260. package/dist/server/providers/database/consts.d.ts +0 -4
  261. package/dist/server/providers/database/consts.d.ts.map +0 -1
  262. package/dist/server/providers/database/consts.js +0 -1
  263. package/dist/server/providers/database/consts.js.map +0 -1
  264. package/dist/server/utils/redirects.d.ts.map +0 -1
  265. package/dist/server/utils/redirects.js +0 -1
  266. package/dist/server/utils/redirects.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"file-hashes-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/persistence/file-hashes/services/file-hashes-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAEnB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,iDAAiD,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGtD,qBAAa,iBAAiB;IAGR,OAAO,CAAC,QAAQ,CAAC,eAAe;IAFpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAoB;IAE3C,OAAO;mBAEc,UAAU;WAOX,WAAW,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAWtF,aAAa,CACjB,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;IAWjD,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAIxE,cAAc,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIlF,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhF;;OAEG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGzD"}
1
+ {"version":3,"file":"file-hashes-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/persistence/file-hashes/services/file-hashes-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAEnB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,iDAAiD,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAE5F,qBAAa,iBAAiB;;gBAIhB,eAAe,EAAE,yBAAyB;WAWzC,WAAW,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAW/E,aAAa,CACjB,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;IAWjD,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAIxE,cAAc,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIlF,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhF;;OAEG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGzD"}
@@ -1 +1 @@
1
- import{prepareListResponse as o}from"../../../web-server/utils/prepare-list-response.js";import{FileHashesLocalRepository as n}from"../repositories/file-hashes-local-repository.js";class a{localRepository;static instance;constructor(t){this.localRepository=t}static async initialize(t){const s=await n.getInstance(t),e=new a(s);a.instance=e}static async getInstance(t){return t.removeExisting===void 0&&(t.removeExisting=!1),a.instance||await a.initialize(t),a.instance}async getFileHashes(t={}){const{items:s,total:e,hasMore:i}=await this.localRepository.getFileHashes(t);return o({data:s,params:t,totalCount:e,hasMore:i})}async getFileHashByHash(t){return await this.localRepository.getFileHashByHash(t)}async upsertFileHash(t){return await this.localRepository.upsertFileHash(t)}async updateFileHashes(t,s){return await this.localRepository.updateFileHashesStatus(t,s)}async deleteFileHashes(t){return await this.localRepository.deleteFileHashes(t)}}export{a as FileHashesService};
1
+ import{prepareListResponse as n}from"../../../web-server/utils/prepare-list-response.js";import{FileHashesLocalRepository as r}from"../repositories/file-hashes-local-repository.js";class s{static#s;#t;constructor(t){this.#t=t}static async#a(t){const a=await r.getInstance(t),e=new s(a);s.#s=e}static async getInstance(t){return t.removeExisting===void 0&&(t.removeExisting=!1),s.#s||await s.#a(t),s.#s}async getFileHashes(t={}){const{items:a,total:e,hasMore:i}=await this.#t.getFileHashes(t);return n({data:a,params:t,totalCount:e,hasMore:i})}async getFileHashByHash(t){return await this.#t.getFileHashByHash(t)}async upsertFileHash(t){return await this.#t.upsertFileHash(t)}async updateFileHashes(t,a){return await this.#t.updateFileHashesStatus(t,a)}async deleteFileHashes(t){return await this.#t.deleteFileHashes(t)}}export{s as FileHashesService};
@@ -1 +1 @@
1
- {"version":3,"file":"file-hashes-service.js","sourceRoot":"","sources":["../../../../../../../src/server/persistence/file-hashes/services/file-hashes-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,GACpB,MAAM,oDAAoD,CAAC;AAM5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAE5F,MAAM,OAAO,iBAAiB;IAGS;IAF7B,MAAM,CAAC,QAAQ,CAAoB;IAE3C,YAAqC,eAA0C;QAA1C,oBAAe,GAAf,eAAe,CAA2B;IAAG,CAAC;IAE3E,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,OAA+B;QAC7D,MAAM,eAAe,GAAG,MAAM,yBAAyB,CAAC,WAAW,CAAC,OAAO,C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O,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;CACF"}
1
+ {"version":3,"file":"file-hashes-service.js","sourceRoot":"","sources":["../../../../../../../src/server/persistence/file-hashes/services/file-hashes-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,GACpB,MAAM,oDAAoD,CAAC;AAM5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAE5F,MAAM,OAAO,iBAAiB;IAC5B,MAAM,CAAC,SAAS,CAAoB;IAC3B,gBAAgB,CAA4B;IAErD,YAAY,eAA0C;QACpD,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAA+B;QACtD,MAAM,eAAe,GAAG,MAAM,yBAAyB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC7E,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAEvD,iBAAiB,CAAC,SAAS,GAAG,OAAO,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAA+B;QACtD,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACzC,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACjC,MAAM,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,iBAAiB,CAAC,SAAS,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,mBAAqC,EAAE;QAEvC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAE9F,OAAO,mBAAmB,CAAC;YACzB,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,gBAAgB;YACxB,UAAU,EAAE,KAAK;YACjB,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,IAAY;QAClC,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,oBAA0C;QAC7D,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,MAAsB,EAAE,MAAc;QAC3D,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CAAC,MAAc;QACnC,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { DatabasePluginStorageDto } from '../../../providers/database/databases/plugin-storage-sqlite/schemas/plugin-storage-table.js';
2
+ export declare function createPluginStorageDbRecord({ key, value, ttlInSeconds, }: {
3
+ key: string;
4
+ value: Record<string, unknown> | unknown[];
5
+ ttlInSeconds?: number;
6
+ }): DatabasePluginStorageDto;
7
+ //# sourceMappingURL=create-plugin-storage-db-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-plugin-storage-db-record.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/mappers/create-plugin-storage-db-record.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6FAA6F,CAAC;AAEvI,wBAAgB,2BAA2B,CAAC,EAC1C,GAAG,EACH,KAAK,EACL,YAAY,GACb,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,wBAAwB,CAM3B"}
@@ -0,0 +1 @@
1
+ import{withTimestamp as i}from"../../../utils/with-timestamp.js";function o({key:t,value:r,ttlInSeconds:e}){return i({key:t,value:JSON.stringify(r),ttl:e??null})}export{o as createPluginStorageDbRecord};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-plugin-storage-db-record.js","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/mappers/create-plugin-storage-db-record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAIjE,MAAM,UAAU,2BAA2B,CAAC,EAC1C,GAAG,EACH,KAAK,EACL,YAAY,GAKb;IACC,OAAO,aAAa,CAAC;QACnB,GAAG;QACH,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QAC5B,GAAG,EAAE,YAAY,IAAI,IAAI;KAC1B,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { DatabasePluginStorage } from '../../../providers/database/databases/plugin-storage-sqlite/schemas/plugin-storage-table.js';
2
+ import { StorageReadModelSchema } from '../types.js';
3
+ export declare function createPluginStorageReadModel(storageEntry: DatabasePluginStorage): StorageReadModelSchema;
4
+ //# sourceMappingURL=create-plugin-storage-read-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-plugin-storage-read-model.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/mappers/create-plugin-storage-read-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6FAA6F,CAAC;AACpI,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,qBAAqB,GAClC,sBAAsB,CAkBxB"}
@@ -0,0 +1 @@
1
+ function c(e){const a=e.value;let t;try{t=JSON.parse(a)}catch{t={}}return{key:e.key,value:t,ttlInSeconds:e.ttl,createdAt:e.createdAt,updatedAt:e.updatedAt,object:"storage"}}export{c as createPluginStorageReadModel};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-plugin-storage-read-model.js","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/mappers/create-plugin-storage-read-model.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,4BAA4B,CAC1C,YAAmC;IAEnC,MAAM,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC;IACvC,IAAI,WAAoC,CAAC;IAEzC,IAAI,CAAC;QACH,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,GAAG,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,EAAE,YAAY,CAAC,GAAG;QACrB,KAAK,EAAE,WAAW;QAClB,YAAY,EAAE,YAAY,CAAC,GAAG;QAC9B,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,MAAM,EAAE,SAAS;KACe,CAAC;AACrC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { StorageReadModelSchema, SetStorageParams } from '../types.js';
2
+ import type { DatabaseInitializationResult, RepositoryInstanceOptions } from '../../../providers/database/types.js';
3
+ export declare class PluginStorageLocalRepository {
4
+ #private;
5
+ constructor(initializationResult: DatabaseInitializationResult);
6
+ static getInstance(options: RepositoryInstanceOptions): Promise<PluginStorageLocalRepository>;
7
+ get(key: string): Promise<StorageReadModelSchema | null>;
8
+ set(params: SetStorageParams): Promise<string | null>;
9
+ delete(key: string): Promise<boolean>;
10
+ clearAll(): Promise<boolean>;
11
+ }
12
+ //# sourceMappingURL=plugin-storage-local-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-storage-local-repository.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/repositories/plugin-storage-local-repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,sCAAsC,CAAC;AAgB9C,qBAAa,4BAA4B;;gBAI3B,oBAAoB,EAAE,4BAA4B;WAIjD,WAAW,CACtB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,4BAA4B,CAAC;IAiBlC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAoBxD,GAAG,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAuBrD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAarC,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;CAUnC"}
@@ -0,0 +1 @@
1
+ import{eq as o}from"drizzle-orm";import{isTtlExpired as l}from"../../../utils/is-ttl-expired.js";import n from"../../../utils/reporter/logger.js";import{LocalDatabaseInitializationStrategy as s}from"../../../providers/database/database-initialization-strategy.js";import{PLUGIN_STORAGE_LOCAL_DATABASE_FOLDER as c,PLUGIN_STORAGE_DATABASE_MIGRATIONS_FOLDER as u,PLUGIN_STORAGE_LOCAL_DATABASE_NAME as d}from"../../../providers/database/constants.js";import{pluginStorageTable as r}from"../../../providers/database/databases/plugin-storage-sqlite/schemas/plugin-storage-table.js";import{createPluginStorageDbRecord as g}from"../mappers/create-plugin-storage-db-record.js";import{createPluginStorageReadModel as m}from"../mappers/create-plugin-storage-read-model.js";class i{static#e;#t;constructor(e){this.#t=e.client}static async getInstance(e){if(!i.#e){const a=await new s().initialize({...e,databaseName:d,additionalFolder:c,migrationsFolder:u});i.#e=new i(a)}return i.#e}async get(e){const t=await this.#t.client.select().from(r).where(o(r.key,e)).get();if(!t)return null;const a=m(t);return l(a.ttlInSeconds,a.createdAt)?(await this.delete(e),null):a}async set(e){try{const t=g(e);return await this.#t.client.insert(r).values(t).onConflictDoUpdate({target:[r.key],set:{value:t.value,ttl:t.ttl,updatedAt:t.updatedAt}}),t.key}catch(t){return n.error("Error setting storage in plugin storage",t),null}}async delete(e){try{return await this.#t.client.delete(r).where(o(r.key,e)),!0}catch(t){return n.error("Error deleting storage from plugin storage",t),!1}}async clearAll(){try{return await this.#t.client.delete(r),!0}catch(e){return n.error("Error clearing all storage from plugin storage",e),!1}}}export{i as PluginStorageLocalRepository};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-storage-local-repository.js","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/repositories/plugin-storage-local-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AASjC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,MAAM,MAAM,mCAAmC,CAAC;AAEvD,OAAO,EAAE,mCAAmC,EAAE,MAAM,iEAAiE,CAAC;AACtH,OAAO,EACL,oCAAoC,EACpC,yCAAyC,EACzC,kCAAkC,GACnC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6FAA6F,CAAC;AACjI,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAE9F,MAAM,OAAO,4BAA4B;IACvC,MAAM,CAAC,SAAS,CAA+B;IACtC,eAAe,CAAiB;IAEzC,YAAY,oBAAkD;QAC5D,IAAI,CAAC,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CACtB,OAAkC;QAElC,IAAI,CAAC,4BAA4B,CAAC,SAAS,EAAE,CAAC;YAC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,EAAE;oBACH,KAAK,EAAE,YAAY,CAAC,KAAK;oBACzB,GAAG,EAAE,YAAY,CAAC,GAAG;oBACrB,SAAS,EAAE,YAAY,CAAC,SAAS;iBAClC;aACF,CAAC,CAAC;YAEL,OAAO,YAAY,CAAC,GAAG,CAAC;QAC1B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;YAC/D,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM;iBAC9B,MAAM,CAAC,kBAAkB,CAAC;iBAC1B,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YAE1C,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAC;YAClE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YAE7D,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,gDAAgD,EAAE,KAAK,CAAC,CAAC;YACtE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,25 @@
1
+ import { ServiceInstanceOptions } from '../../../providers/database/types.js';
2
+ import { SetStorageParams, GetStorageParams, StorageValue } from '../types.js';
3
+ import { PluginStorageLocalRepository } from '../repositories/plugin-storage-local-repository.js';
4
+ export declare class PluginStorageService {
5
+ #private;
6
+ constructor(localRepository: PluginStorageLocalRepository);
7
+ static getInstance(options: ServiceInstanceOptions): Promise<PluginStorageService>;
8
+ /**
9
+ * Get a storage entry by key
10
+ */
11
+ get<T extends StorageValue>(params: GetStorageParams): Promise<T | null>;
12
+ /**
13
+ * Set a storage entry with optional TTL
14
+ */
15
+ set(params: SetStorageParams): Promise<string | null>;
16
+ /**
17
+ * Delete a specific storage entry by key
18
+ */
19
+ delete(key: string): Promise<boolean>;
20
+ /**
21
+ * Clear all storage entries
22
+ */
23
+ clear(): Promise<boolean>;
24
+ }
25
+ //# sourceMappingURL=plugin-storage-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-storage-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/services/plugin-storage-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,qBAAa,oBAAoB;;gBAInB,eAAe,EAAE,4BAA4B;WAW5C,WAAW,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAWxF;;OAEG;IACG,GAAG,CAAC,CAAC,SAAS,YAAY,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAK9E;;OAEG;IACG,GAAG,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAS3D;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3C;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;CAYhC"}
@@ -0,0 +1 @@
1
+ import{isTtlCorrect as n}from"../../../utils/is-ttl-correct.js";import{PluginStorageLocalRepository as a}from"../repositories/plugin-storage-local-repository.js";class s{static#e;#t;constructor(t){this.#t=t}static async#s(t){const e=await a.getInstance(t),r=new s(e);s.#e=r}static async getInstance(t){return t.removeExisting===void 0&&(t.removeExisting=!1),s.#e||await s.#s(t),s.#e}async get(t){const e=await this.#t.get(t.key);return e?e.value:null}async set(t){if(this.#r(t.value),!n(t.ttlInSeconds))throw new Error("TTL must be null or a positive number");return await this.#t.set(t)}async delete(t){return await this.#t.delete(t)}async clear(){return await this.#t.clearAll()}#r(t){try{JSON.stringify(t)}catch(e){const r=e instanceof Error?e.message:"Unknown error";throw new Error(`Value is not JSON serializable: ${r}`)}}}export{s as PluginStorageService};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-storage-service.js","sourceRoot":"","sources":["../../../../../../../src/server/persistence/plugin-storage/services/plugin-storage-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIhE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,MAAM,OAAO,oBAAoB;IAC/B,MAAM,CAAC,SAAS,CAAuB;IAC9B,gBAAgB,CAA+B;IAExD,YAAY,eAA6C;QACvD,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAA+B;QACtD,MAAM,eAAe,GAAG,MAAM,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChF,MAAM,OAAO,GAAG,IAAI,oBAAoB,CAAC,eAAe,CAAC,CAAC;QAE1D,oBAAoB,CAAC,SAAS,GAAG,OAAO,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAA+B;QACtD,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACzC,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE,CAA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AAC;QAChE,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ export type StorageValue = Record<string, unknown> | unknown[];
2
+ export type SetStorageParams = {
3
+ key: string;
4
+ value: StorageValue;
5
+ ttlInSeconds?: number;
6
+ };
7
+ export type GetStorageParams = {
8
+ key: string;
9
+ };
10
+ export type StorageReadModelSchema = {
11
+ key: string;
12
+ value: StorageValue;
13
+ ttlInSeconds: number | null;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ object: 'storage';
17
+ };
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/persistence/plugin-storage/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/server/persistence/plugin-storage/types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"browser-hooks.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/analytics/heap/browser-hooks.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC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,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7E,CAAC,CAAC;gBACJ,CAAC,EACD,CAAC,GAAG;oBACF,oBAAoB;oBACpB,mBAAmB;oBACnB,sBAAsB;oBACtB,UAAU;oBACV,eAAe;oBACf,qBAAqB;oBACrB,oBAAoB;oBACpB,OAAO;oBACP,oBAAoB;iBACrB,EACD,CAAC,GAAG,CAAC,EACP,CAAC,GAAG,CAAC,CAAC,MAAM,EACZ,CAAC,EAAE;oBAEF,MAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;QAEL,4CAA4C;QAC3C,MAAc,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"browser-hooks.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/analytics/heap/browser-hooks.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAsB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;IACvE,MAAM,aAAa,GAAG,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC;IAEnD,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,8DAA8D;IAC9D,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC1B,CAAC,CAAE,MAAc,CAAC,IAAI,GAAI,MAAc,CAAC,IAAI,IAAI,EAAE,CAAC;YAClD,CAAE,MAAc,CAAC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAS,EAAE,CAAM;gBACtD,CAAC,CAAE,MAAc,CAAC,IAAI,CAA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AEF,MAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC,CAAC;QAEN,4CAA4C;QAC3C,MAAc,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;AACH,CAAC,CAAC"}
@@ -4,6 +4,8 @@ import type { EntityReadModelSchema, EntityRelationReadModelSchema } from '../sc
4
4
  import type { CatalogFiltersParams } from './repositories/local/catalog-entities-local-read-repository.js';
5
5
  import { DatabaseEntityRelation } from '../../../providers/database/databases/catalog-sqlite/schemas/entities-relations-table.js';
6
6
  import { type EntityDtoSchema, type EntityRelationDtoSchema } from '../schemas/dto-schemas.js';
7
+ import { CatalogEntitiesLocalRepository } from './repositories/local/catalog-entities-local-repository.js';
8
+ import { CatalogEntitiesRemoteRepository } from './repositories/remote/catalog-entities-remote-repository.js';
7
9
  import { type ListResponseResult } from '../../../web-server/utils/prepare-list-response.js';
8
10
  import { ServiceInstanceOptions } from '../../../providers/database/types.js';
9
11
  import { TransactionsManager } from '../../../providers/database/transactions-manager.js';
@@ -19,12 +21,8 @@ type BulkSyncResult<T> = Array<{
19
21
  error: string;
20
22
  }>;
21
23
  export declare class CatalogEntitiesService implements HashManagerUpdateService {
22
- private readonly localRepository;
23
- private readonly remoteRepository?;
24
- private static instance;
25
- private static initializationOptions;
26
- private constructor();
27
- private static initialize;
24
+ #private;
25
+ constructor(localRepository: CatalogEntitiesLocalRepository, remoteRepository?: CatalogEntitiesRemoteRepository);
28
26
  static getInstance(options: ServiceInstanceOptions): Promise<CatalogEntitiesService>;
29
27
  transaction<T>(...args: Parameters<TransactionsManager['transaction']>): Promise<T>;
30
28
  getEntities(paginationParams: PaginationParams): Promise<ListResponseResult<EntityReadModelSchema>>;
@@ -124,7 +122,6 @@ export declare class CatalogEntitiesService implements HashManagerUpdateService
124
122
  deleteEntitiesAndRelationsByFilePathInLocalDatabase(sourceFilePath: string): Promise<void>;
125
123
  deleteEntitiesAndRelationsByHashInLocalDatabase(hash: string): Promise<void>;
126
124
  clearOutdatedRecords(outdatedHash: string): Promise<void>;
127
- private deleteEntitiesRelationsByEntityKey;
128
125
  }
129
126
  export {};
130
127
  //# sourceMappingURL=catalog-entities-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-entities-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/database/catalog-entities-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAC;AAI3G,OAAO,EAAE,sBAAsB,EAAE,MAAM,0FAA0F,CAAC;AAElI,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC7B,MAAM,2BAA2B,CAAC;AAInC,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,iDAAiD,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAKpE,KAAK,cAAc,CAAC,CAAC,IAAI,KAAK,CAC1B;IACE,MAAM,EAAE,IAAI,CAAC;IACb,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC;CACpB,GACD;IACE,GAAG,EAAE,MA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M,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAiBjE,iBAAiB,CAAC,GAAG,EAAE,MAAM;IAQnC;;;OAGG;IACG,6BAA6B,CAAC,MAAM,EAAE,MAAM;IAI5C,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,GAAG,IAAI,CAAC;IAQhF,oBAAoB,CAAC,gBAAgB,GAAE,gBAAqB;;;;;;;;;;;;IAc5D,oBAAoB,CAAC,QAAQ,EAAE,uBAAuB;;;;;;;;;;;;;;;;IAItD,uBAAuB,CAC3B,QAAQ,EAAE,uBAAuB,EAAE,GAClC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;IAmB5C,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB;;;;;;;;;;;;;;;;IAWlE,oBAAoB,CAAC,EAAE,EAAE,MAAM;IAQrC;;;OAGG;IACG,oCAAoC,CAAC,MAAM,EAAE,MAAM;IAInD,wBAAwB,CAC5B,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,oBAAoB,CAAC;IAa1B,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAIhF,kBAAkB,CACtB,SAAS,EAAE,MAAM,EACjB,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,2BAA2B,CAAC;IAgBvC;;;OAGG;IACG,mDAAmD,CAAC,cAAc,EAAE,MAAM;IAY1E,+CAA+C,CAAC,IAAI,EAAE,MAAM;IAW5D,oBAAoB,CAAC,YAAY,EAAE,MAAM;YAIjC,kCAAkC;CAiBjD"}
1
+ {"version":3,"file":"catalog-entities-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/database/catalog-entities-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,gBAAgB,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B5C,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB;;;;;;;;;;;;;;;;IAWlE,oBAAoB,CAAC,EAAE,EAAE,MAAM;IAQrC;;;OAGG;IACG,oCAAoC,CAAC,MAAM,EAAE,MAAM;IAInD,wBAAwB,CAC5B,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,oBAAoB,CAAC;IAa1B,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAIhF,kBAAkB,CACtB,SAAS,EAAE,MAAM,EACjB,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,2BAA2B,CAAC;IAgBvC;;;OAGG;IACG,mDAAmD,CAAC,cAAc,EAAE,MAAM;IAY1E,+CAA+C,CAAC,IAAI,EAAE,MAAM;IAW5D,oBAAoB,CAAC,YAAY,EAAE,MAAM;CAqBhD"}
@@ -1 +1 @@
1
- import{entityFileSchema as p}from"@redocly/config";import{deepMerge as l}from"../../../../utils/object/deep-merge.js";import{promiseMapLimit as y}from"../../../utils/async.js";import{entityRelationDtoSchema as E}from"../schemas/dto-schemas.js";import{CatalogEntitiesLocalRepository as h}from"./repositories/local/catalog-entities-local-repository.js";import{CatalogEntitiesRemoteRepository as m}from"./repositories/remote/catalog-entities-remote-repository.js";import s from"../../../utils/reporter/logger.js";import{prepareListResponse as r}from"../../../web-server/utils/prepare-list-response.js";import{ENTITY_RELATION_FROM_DATABASE as c}from"./mappers/field-transformations.js";import{createValidator as R}from"../utils/ajv-validator.js";import{hasOptionsChanged as u}from"../utils/has-options-changed.js";const d=15,w=R(E,{errorPrefix:"Entity relation validation failed:",dataVar:"entity relation"}),f=R(p,{errorPrefix:"Entity file validation failed:",dataVar:"entity"});class o{localRepository;remoteRepository;static instance;static initializationOptions;constructor(t,e){this.localRepository=t,this.remoteRepository=e}static async initialize(t){const[e,a]=await Promise.all([h.getInstance(t),t.runOnlyLocalDatabase?void 0:m.getInstance(t)]),i=new o(e,a);a&&(process.env.NODE_ENV==="development"&&s.info("Attaching remote database to local database"),await i.localRepository.attachDatabase(a.path)),o.instance=i,o.initializationOptions=t}static async getInstance(t){return t.runOnlyLocalDatabase===void 0&&(t.runOnlyLocalDatabase=process.env.REDOCLY_LOCAL_DEV==="true"||process.env.CI==="true"),t.removeExisting===void 0&&(t.removeExisting=!1),(!o.instance||u(o.initializationOptions,t))&&await o.initialize(t),o.instance}async transaction(...t){return this.localRepository.transactionsManager.transaction(...t)}async getEntities(t){await this.remoteRepository?.sync();const{items:e,total:a,hasMore:i}=await this.localRepository.getEntities(t);return r({data:e,params:t,totalCount:a,hasMore:i})}async getEntityByKey(t){return await this.remoteRepository?.sync(),await this.localRepository.getEntityByKey(t)}async getCatalogFilters(t){return await this.remoteRepository?.sync(),this.localRepository.getCatalogFilters(t)}async createEntity(t){return this.remoteRepository?this.remoteRepository.createEntity(t):(s.warn("No remote database found"),null)}async createEntities(t){const e=this.remoteRepository;return e?await y(t,d,async a=>e.createEntity(a).then(i=>({status:"ok",resource:i})).catch(i=>({key:a.key,status:"error",error:i}))):(s.warn("No remote database found"),[])}getEntitySources(){return this.localRepository.getEntitySources()}async createEntityInLocalDatabase(t){await this.localRepository.createEntity(t)}async createEntitiesInLocalDatabase(t){await this.localRepository.createEntities(t)}async createEntityRelationInLocalDatabase(t){await this.localRepository.createEntityRelation(t)}async createEntityRelationsInLocalDatabase(t){await this.localRepository.createEntityRelations(t)}async updateEntityByKey(t,e){const a=await this.localRepository.getEntityByKey(t);if(!a)throw new Error(`Entity with key ${t} not found`);const i=l(a,e),n=f(i);return await this.remoteRepository?.updateEntity({...n,id:a.id,createdAt:a.createdAt||""})}async deleteEntityByKey(t){const e=await this.remoteRepository?.deleteEntity(t);return await this.deleteEntitiesRelationsByEntityKey(t),e}async deleteEntitiesInLocalDatabase(t){await this.localRepository.deleteEntities(t)}async getEntityRelationById(t){return await this.remoteRepository?.sync(),await this.localRepository.getEntityRelationById(t)}async getEntitiesRelations(t={}){await this.remoteRepository?.sync();const{items:e,total:a,hasMore:i}=await this.localRepository.getEntitiesRelations(t);return r({data:e,params:t,totalCount:a,nameTransformationsFromDatabase:c,hasMore:i})}async createEntityRelation(t){return this.remoteRepository?.createEntityRelation(t)}async createEntitiesRelations(t){const e=this.remoteRepository;return e?await y(t,d,async a=>e.createEntityRelation(a).then(i=>({status:"ok",resource:i})).catch(i=>({key:a.sourceKey,status:"error",error:i}))):(s.warn("No remote database found"),[])}async updateEntityRelation(t,e){const a=await this.localRepository.getEntityRelationById(t);if(!a)throw new Error(`Entity relation with id ${t} not found`);const i=l(a,e),n=w(i);return this.remoteRepository?.createEntityRelation(n)}async deleteEntityRelation(t){let e=await this.remoteRepository?.deleteEntityRelation(t);return e||(e=await this.localRepository.deleteEntityRelation(t)),e}async deleteEntityRelationsInLocalDatabase(t){await this.localRepository.deleteEntityRelations(t)}async getEntitiesWithRelations(t={}){await this.remoteRepository?.sync();const{items:e,total:a,hasMore:i}=await this.localRepository.getEntitiesWithRelations(t);return r({data:e,params:t,totalCount:a,hasMore:i})}async getEntityWithRelationsByKey(t){return this.localRepository.getEntityWithRelationsByKey(t)}async getRelatedEntities(t,e={}){await this.remoteRepository?.sync();const{items:a,total:i,hasMore:n}=await this.localRepository.getRelatedEntities(t,e);return r({data:a,params:e,totalCount:i,nameTransformationsFromDatabase:c,hasMore:n})}async deleteEntitiesAndRelationsByFilePathInLocalDatabase(t){const e={field:"source_file",operator:"equal",value:t};await this.deleteEntitiesInLocalDatabase(e),await this.deleteEntityRelationsInLocalDatabase(e)}async deleteEntitiesAndRelationsByHashInLocalDatabase(t){const e={field:"file_hash",operator:"equal",value:t};await this.deleteEntitiesInLocalDatabase(e),await this.deleteEntityRelationsInLocalDatabase(e)}async clearOutdatedRecords(t){await this.deleteEntitiesAndRelationsByHashInLocalDatabase(t)}async deleteEntitiesRelationsByEntityKey(t){await this.remoteRepository?.deleteEntitiesRelations({op:"OR",conditions:[{field:"source_key",operator:"equal",value:t},{field:"target_key",operator:"equal",value:t}]})}}export{o as CatalogEntitiesService};
1
+ import{entityFileSchema as h}from"@redocly/config";import{deepMerge as l}from"../../../../utils/object/deep-merge.js";import{promiseMapLimit as c}from"../../../utils/async.js";import{entityRelationDtoSchema as u}from"../schemas/dto-schemas.js";import{CatalogEntitiesLocalRepository as R}from"./repositories/local/catalog-entities-local-repository.js";import{CatalogEntitiesRemoteRepository as m}from"./repositories/remote/catalog-entities-remote-repository.js";import o from"../../../utils/reporter/logger.js";import{prepareListResponse as r}from"../../../web-server/utils/prepare-list-response.js";import{ENTITY_RELATION_FROM_DATABASE as y}from"./mappers/field-transformations.js";import{createValidator as d}from"../utils/ajv-validator.js";import{hasOptionsChanged as w}from"../utils/has-options-changed.js";const E=15,f=d(u,{errorPrefix:"Entity relation validation failed:",dataVar:"entity relation"}),p=d(h,{errorPrefix:"Entity file validation failed:",dataVar:"entity"});class n{static#a;static#i;#t;#e;constructor(t,e){this.#t=t,this.#e=e}static async#n(t){const[e,a]=await Promise.all([R.getInstance(t),t.runOnlyLocalDatabase?void 0:m.getInstance(t)]),i=new n(e,a);a&&(process.env.NODE_ENV==="development"&&o.info("Attaching remote database to local database"),await i.#t.attachDatabase(a.path)),n.#a=i,n.#i=t}static async getInstance(t){return t.runOnlyLocalDatabase===void 0&&(t.runOnlyLocalDatabase=process.env.REDOCLY_LOCAL_DEV==="true"||process.env.CI==="true"),t.removeExisting===void 0&&(t.removeExisting=!1),(!n.#a||w(n.#i,t))&&await n.#n(t),n.#a}async transaction(...t){return this.#t.transactionsManager.transaction(...t)}async getEntities(t){await this.#e?.sync();const{items:e,total:a,hasMore:i}=await this.#t.getEntities(t);return r({data:e,params:t,totalCount:a,hasMore:i})}async getEntityByKey(t){return await this.#e?.sync(),await this.#t.getEntityByKey(t)}async getCatalogFilters(t){return await this.#e?.sync(),this.#t.getCatalogFilters(t)}async createEntity(t){return this.#e?this.#e.createEntity(t):(o.warn("No remote database found"),null)}async createEntities(t){const e=this.#e;return e?await c(t,E,async a=>e.createEntity(a).then(i=>({status:"ok",resource:i})).catch(i=>({key:a.key,status:"error",error:i}))):(o.warn("No remote database found"),[])}getEntitySources(){return this.#t.getEntitySources()}async createEntityInLocalDatabase(t){await this.#t.createEntity(t)}async createEntitiesInLocalDatabase(t){await this.#t.createEntities(t)}async createEntityRelationInLocalDatabase(t){await this.#t.createEntityRelation(t)}async createEntityRelationsInLocalDatabase(t){await this.#t.createEntityRelations(t)}async updateEntityByKey(t,e){const a=await this.#t.getEntityByKey(t);if(!a)throw new Error(`Entity with key ${t} not found`);const i=l(a,e),s=p(i);return await this.#e?.updateEntity({...s,id:a.id,createdAt:a.createdAt||""})}async deleteEntityByKey(t){const e=await this.#e?.deleteEntity(t);return await this.#s(t),e}async deleteEntitiesInLocalDatabase(t){await this.#t.deleteEntities(t)}async getEntityRelationById(t){return await this.#e?.sync(),await this.#t.getEntityRelationById(t)}async getEntitiesRelations(t={}){await this.#e?.sync();const{items:e,total:a,hasMore:i}=await this.#t.getEntitiesRelations(t);return r({data:e,params:t,totalCount:a,nameTransformationsFromDatabase:y,hasMore:i})}async createEntityRelation(t){return this.#e?.createEntityRelation(t)}async createEntitiesRelations(t){const e=this.#e;return e?await c(t,E,async a=>e.createEntityRelation(a).then(i=>({status:"ok",resource:i})).catch(i=>({key:a.sourceKey,status:"error",error:i}))):(o.warn("No remote database found"),[])}async updateEntityRelation(t,e){const a=await this.#t.getEntityRelationById(t);if(!a)throw new Error(`Entity relation with id ${t} not found`);const i=l(a,e),s=f(i);return this.#e?.createEntityRelation(s)}async deleteEntityRelation(t){let e=await this.#e?.deleteEntityRelation(t);return e||(e=await this.#t.deleteEntityRelation(t)),e}async deleteEntityRelationsInLocalDatabase(t){await this.#t.deleteEntityRelations(t)}async getEntitiesWithRelations(t={}){await this.#e?.sync();const{items:e,total:a,hasMore:i}=await this.#t.getEntitiesWithRelations(t);return r({data:e,params:t,totalCount:a,hasMore:i})}async getEntityWithRelationsByKey(t){return this.#t.getEntityWithRelationsByKey(t)}async getRelatedEntities(t,e={}){await this.#e?.sync();const{items:a,total:i,hasMore:s}=await this.#t.getRelatedEntities(t,e);return r({data:a,params:e,totalCount:i,nameTransformationsFromDatabase:y,hasMore:s})}async deleteEntitiesAndRelationsByFilePathInLocalDatabase(t){const e={field:"source_file",operator:"equal",value:t};await this.deleteEntitiesInLocalDatabase(e),await this.deleteEntityRelationsInLocalDatabase(e)}async deleteEntitiesAndRelationsByHashInLocalDatabase(t){const e={field:"file_hash",operator:"equal",value:t};await this.deleteEntitiesInLocalDatabase(e),await this.deleteEntityRelationsInLocalDatabase(e)}async clearOutdatedRecords(t){await this.deleteEntitiesAndRelationsByHashInLocalDatabase(t)}async#s(t){await this.#e?.deleteEntitiesRelations({op:"OR",conditions:[{field:"source_key",operator:"equal",value:t},{field:"target_key",operator:"equal",value:t}]})}}export{n as CatalogEntitiesService};
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-entities-service.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/database/catalog-entities-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,iBAAiB,CAAC;AAS1E,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,2DAA2D,CAAC;AAC3G,OAAO,EAAE,+BAA+B,EAAE,MAAM,6DAA6D,CAAC;AAC9G,OAAO,MAAM,MAAM,mCAAmC,CAAC;AACvD,OAAO,EAEL,mBAAmB,GACpB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAK5D,OAAO,EAAE,iBAAiB,EAAE,M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AAI,CAAC,6BAA6B,CAAC,cAAc,CAAC,CAAC;QAEzD,MAAM,IAAI,CAAC,oCAAoC,CAAC,cAAc,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,+CAA+C,CAAC,IAAY;QAChE,MAAM,sBAAsB,GAAW;YACrC,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF,MAAM,IAAI,CAAC,6BAA6B,CAAC,sBAAsB,CAAC,CAAC;QACjE,MAAM,IAAI,CAAC,oCAAoC,CAAC,sBAAsB,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,YAAoB;QAC7C,MAAM,IAAI,CAAC,+CAA+C,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;IAEO,KAAK,CAAC,kCAAkC,CAAC,GAAW;QAC1D,MAAM,IAAI,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;YACnD,EAAE,EAAE,IAAI;YACR,UAAU,EAAE;gBACV;oBACE,KAAK,EAAE,YAAY;oBACnB,QAAQ,EAAE,OAAO;oBACjB,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,KAAK,EAAE,YAAY;oBACnB,QAAQ,EAAE,OAAO;oBACjB,KAAK,EAAE,GAAG;iBACX;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"catalog-entities-service.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/database/catalog-entities-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,iBAAiB,CAAC;AAS1E,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,2DAA2D,CAAC;AAC3G,OAAO,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terOption = {
16
16
  count: number;
17
17
  };
18
18
  export declare class CatalogEntitiesLocalReadRepository {
19
- private readonly db;
20
- private attachedDatabasePath;
21
- constructor(db: DatabaseClient, attachedDatabasePath?: string | undefined);
19
+ #private;
20
+ constructor(db: DatabaseClient);
22
21
  attachDatabase(databasePath: string): Promise<void>;
23
22
  getEntities(paginationParams?: PaginationParams): Promise<ListResult<EntityReadModelSchema>>;
24
23
  getEntityByKey(key: string): Promise<EntityReadModelSchema | null>;
@@ -28,12 +27,5 @@ export declare class CatalogEntitiesLocalReadRepository {
28
27
  getEntityWithRelationsByKey(entityKey: string): Promise<BffCatalogEntity | null>;
29
28
  getRelatedEntities(entityKey: string, paginationParams?: PaginationParams): Promise<ListResult<BffCatalogRelatedEntity>>;
30
29
  getCatalogFilters({ entitiesTypes, emptyFilters, }: CatalogFiltersParams): Promise<Record<string, FilterOption[]>>;
31
- private materializeCombinedEntities;
32
- private materializeCombinedRelations;
33
- private executeFilterQueries;
34
- private executeMetadataFilterQuery;
35
- private cleanupTempTables;
36
- private _getEntititiesDomainsSubquery;
37
- private _getEntititiesOwnersSubquery;
38
30
  }
39
31
  //# sourceMappingURL=catalog-entities-local-read-repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-entities-local-read-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yDAAyD,CAAC;AAEhG,OAAO,EACL,KAAK,qBAAqB,EAC1B,6BAA6B,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAkB7E,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,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B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YAwBnD,2BAA2B;YAqD3B,4BAA4B;YAwC5B,oBAAoB;YAsGpB,0BAA0B;YA6B1B,iBAAiB;IAU/B,OAAO,CAAC,6BAA6B;IAiCrC,OAAO,CAAC,4BAA4B;CAkCrC"}
1
+ {"version":3,"file":"catalog-entities-local-read-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yDAAyD,CAAC;AAEhG,OAAO,EACL,KAAK,qBAAqB,EAC1B,6BAA6B,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAkB7E,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qBAAa,kCAAkC;;gBAIjC,EAAE,EAAE,cAAc;IAIxB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnD,WAAW,CACf,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IA2DvC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAmClE,oBAAoB,CACxB,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;IAiE/C,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,GAAG,IAAI,CAAC;IAoChF,wBAAwB,CAC5B,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IA+HlC,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IA0FhF,kBAAkB,CACtB,SAAS,EAAE,MAAM,EACjB,gBAAgB,GAAE,gBAAqB,GACtC,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAwKzC,iBAAiB,CAAC,EACtB,aAAkB,EAClB,YAAiB,GAClB,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;CAmUlE"}
@@ -1,4 +1,4 @@
1
- import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm";import{unionAll as b}from"drizzle-orm/sqlite-core";import{asc as U}from"drizzle-orm";import{applyPagination as k}from"../../../../../providers/database/pagination/index.js";import{createBffRelatedEntity as q}from"../../mappers/create-bff-related-entity.js";import{createBffEntity as M}from"../../mappers/create-bff-entity.js";import{FIELDS_TO_SELECT_FOR_ENTITY as n,FIELDS_TO_SELECT_FOR_ENTITY_RELATION as d,createEntityFieldsForSelect as F,createEntityRelationFieldsForSelect as Q,createQualifiedEntityFieldsForSelect as v,createQualifiedEntityFieldsForSelectWithAliases as j}from"../utils.js";import{createEntityReadModel as P}from"../../mappers/create-entity-read-model.js";import{createEntityRelation as H}from"../../mappers/create-entity-relation.js";import{entitiesTable as r}from"../../../../../providers/database/databases/catalog-sqlite/schemas/entities-table.js";import{entitiesRelationsTable as o}from"../../../../../providers/database/databases/catalog-sqlite/schemas/entities-relations-table.js";import X from"../../../../../utils/reporter/logger.js";class re{db;attachedDatabasePath;constructor(t,i=void 0){this.db=t,this.attachedDatabasePath=i}async attachDatabase(t){this.attachedDatabasePath!==t&&(this.attachedDatabasePath=t,await this.db.client.run(e`ATTACH DATABASE ${t} AS remote`))}async getEntities(t={}){const i=this.attachedDatabasePath?b(this.db.client.select(n).from(e`remote.entities`),this.db.client.select(n).from(r).where(y(this.db.client.select({id:n.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.db.client.select(n).from(r),s=this.db.client.select(n).from(i.as("combined_entities")),c=this.db.client.select(n).from(i.as("combined_entities")).$dynamic(),_=k(c,{...t,limit:void 0,skip:void 0,after:void 0,before:void 0}),u=this.db.client.$count(_),m=s.$dynamic(),a=t.limit||10,E=k(m,{...t,limit:a+1}),[h,f]=await Promise.all([E.run(),u]),T=h.rows,w=T.length>a;return{items:T.slice(0,a).map(N=>P(N)).filter(N=>N!==null),hasMore:w,total:f}}async getEntityByKey(t){const c=(await(this.attachedDatabasePath?b(this.db.client.select(n).from(e`remote.entities`).where(l(r.key,t)),this.db.client.select(n).from(r).where(R(l(r.key,t),y(this.db.client.select({id:n.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`))))):this.db.client.select(n).from(r).where(l(r.key,t))).run()).rows[0];return c?P(c):null}async getEntitiesRelations(t={}){const i=this.attachedDatabasePath?b(this.db.client.select(d).from(e`remote.entities_relations`),this.db.client.select(d).from(o).where(y(this.db.client.select({id:d.id}).from(e`remote.entities_relations as remote`).where(e`remote.source_key = ${o.sourceKey}`)))):this.db.client.select(d).from(o),s=this.db.client.select(d).from(i.as("combined_entities_relations")).$dynamic(),c=this.db.client.select(d).from(i.as("combined_entities_relations")).$dynamic(),_=k(c,{...t,limit:void 0,skip:void 0,after:void 0,before:void 0}),u=this.db.client.$count(_),m=t.limit||10,a=k(s,{...t,limit:m+1}),[E,h]=await Promise.all([a.run(),u]),f=E.rows,T=f.length>m;return{items:f.slice(0,m).map(w=>H(w)).filter(w=>w!==null),hasMore:T,total:h}}async getEntityRelationById(t){const c=(await(this.attachedDatabasePath?b(this.db.client.select(d).from(e`remote.entities_relations`).where(l(o.id,t)),this.db.client.select(d).from(o).where(R(l(o.id,t),y(this.db.client.select({id:d.id}).from(e`remote.entities_relations as remote`).where(e`remote.id = ${o.id}`))))):this.db.client.select(d).from(o).where(l(o.id,t))).run()).rows[0];return c?H(c):null}async getEntitiesWithRelations(t={}){const s=(this.attachedDatabasePath?b(this.db.client.select(n).from(e`remote.entities`),this.db.client.select(n).from(r).where(y(this.db.client.select({id:n.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.db.client.select(n).from(r)).as("e"),_=(this.attachedDatabasePath?b(this.db.client.select(d).from(e`remote.entities_relations`),this.db.client.select(d).from(o).where(y(this.db.client.select({id:d.id}).from(e`remote.entities_relations as remote`).where(e`remote.source_key = ${o.sourceKey}`)))):this.db.client.select(d).from(o)).as("combined_relations"),m=(this.attachedDatabasePath?b(this.db.client.select(n).from(e`remote.entities`),this.db.client.select(n).from(r).where(y(this.db.client.select({id:n.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.db.client.select(n).from(r)).as("combined_target_entities"),a=this.db.client.with(s,_,m).select({...F("e"),domains:this._getEntititiesDomainsSubquery("e").as("domains"),owners:this._getEntititiesOwnersSubquery("e").as("owners")}).from(s).as("entities_with_relations"),E={...n,domains:a.domains,owners:a.owners},h=this.db.client.with(a).select(E).from(a).$dynamic(),f=this.db.client.with(a).select(E).from(a).$dynamic();try{const T=k(f,{...t,limit:void 0,skip:void 0,after:void 0,before:void 0}),w=this.db.client.$count(T),N=t.limit||10,C=k(h,{...t,limit:N+1}),[g,A]=await Promise.all([C.run(),w]),O=g.rows,L=O.length>N;return{items:O.slice(0,N).map(S=>M(S)).filter(S=>S!==null),hasMore:L,total:A}}catch{return{items:[],hasMore:!1,total:0}}}async getEntityWithRelationsByKey(t){const s=(this.attachedDatabasePath?b(this.db.client.select(n).from(e`remote.entities`).where(l(r.key,t)),this.db.client.select(n).from(r).where(R(l(r.key,t),y(this.db.client.select({id:n.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`))))):this.db.client.select(n).from(r).where(l(r.key,t))).as("e"),_=(this.attachedDatabasePath?b(this.db.client.select(d).from(e`remote.entities_relations`),this.db.client.select(d).from(o).where(y(this.db.client.select({id:d.id}).from(e`remote.entities_relations as remote`).where(e`remote.source_key = ${o.sourceKey}`)))):this.db.client.select(d).from(o)).as("combined_relations"),m=(this.attachedDatabasePath?b(this.db.client.select(n).from(e`remote.entities`),this.db.client.select(n).from(r).where(y(this.db.client.select({id:n.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.db.client.select(n).from(r)).as("combined_target_entities"),E=await this.db.client.with(s,_,m).select({...F("e"),domains:this._getEntititiesDomainsSubquery("e").as("domains"),owners:this._getEntititiesOwnersSubquery("e").as("owners")}).from(s).limit(1).run();if(E.rows.length===0)return null;const h=E.rows[0];return M(h)}async getRelatedEntities(t,i={}){const s=Q("","relation_id"),_=(this.attachedDatabasePath?b(this.db.client.select(s).from(e`remote.entities_relations`).where(p(l(o.sourceKey,t),l(o.targetKey,t))),this.db.client.select(s).from(o).where(R(p(l(o.sourceKey,t),l(o.targetKey,t)),y(this.db.client.select({id:d.id}).from(e`remote.entities_relations as remote`).where(R(e`remote.source_key = ${o.sourceKey}`,e`remote.target_key = ${o.targetKey}`,e`remote.source_to_target_relation = ${o.sourceToTargetRelation}`)))))):this.db.client.select(s).from(o).where(p(l(o.sourceKey,t),l(o.targetKey,t)))).as("combined_relations"),u=F("","entity_id"),a=(this.attachedDatabasePath?b(this.db.client.select(u).from(e`remote.entities`),this.db.client.select(u).from(r).where(y(this.db.client.select({id:n.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.db.client.select(u).from(r)).as("combined_target_entities"),E=j("combined_target_entities"),h=Object.values(v("combined_target_entities")),f={...E,relation_type:e`
1
+ import{and as p,eq as l,ne as I,notExists as h,or as O,sql as e}from"drizzle-orm";import{unionAll as f}from"drizzle-orm/sqlite-core";import{asc as v}from"drizzle-orm";import{applyPagination as g}from"../../../../../providers/database/pagination/index.js";import{createBffRelatedEntity as j}from"../../mappers/create-bff-related-entity.js";import{createBffEntity as M}from"../../mappers/create-bff-entity.js";import{FIELDS_TO_SELECT_FOR_ENTITY as s,FIELDS_TO_SELECT_FOR_ENTITY_RELATION as m,createEntityFieldsForSelect as $,createEntityRelationFieldsForSelect as q,createQualifiedEntityFieldsForSelect as Q,createQualifiedEntityFieldsForSelectWithAliases as X}from"../utils.js";import{createEntityReadModel as H}from"../../mappers/create-entity-read-model.js";import{createEntityRelation as W}from"../../mappers/create-entity-relation.js";import{entitiesTable as r}from"../../../../../providers/database/databases/catalog-sqlite/schemas/entities-table.js";import{entitiesRelationsTable as o}from"../../../../../providers/database/databases/catalog-sqlite/schemas/entities-relations-table.js";import P from"../../../../../utils/reporter/logger.js";class re{#e;#t=void 0;constructor(t){this.#e=t}async attachDatabase(t){this.#t!==t&&(this.#t=t,await this.#e.client.run(e`ATTACH DATABASE ${t} AS remote`))}async getEntities(t={}){const i=this.#t?f(this.#e.client.select(s).from(e`remote.entities`),this.#e.client.select(s).from(r).where(h(this.#e.client.select({id:s.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.#e.client.select(s).from(r),n=this.#e.client.select(s).from(i.as("combined_entities")),c=this.#e.client.select(s).from(i.as("combined_entities")).$dynamic(),_=g(c,{...t,limit:void 0,skip:void 0,after:void 0,before:void 0}),u=this.#e.client.$count(_),d=n.$dynamic(),a=t.limit||10,E=g(d,{...t,limit:a+1}),[y,T]=await Promise.all([E.run(),u]),N=y.rows,w=N.length>a;return{items:N.slice(0,a).map(k=>H(k)).filter(k=>k!==null),hasMore:w,total:T}}async getEntityByKey(t){const c=(await(this.#t?f(this.#e.client.select(s).from(e`remote.entities`).where(l(r.key,t)),this.#e.client.select(s).from(r).where(p(l(r.key,t),h(this.#e.client.select({id:s.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`))))):this.#e.client.select(s).from(r).where(l(r.key,t))).run()).rows[0];return c?H(c):null}async getEntitiesRelations(t={}){const i=this.#t?f(this.#e.client.select(m).from(e`remote.entities_relations`),this.#e.client.select(m).from(o).where(h(this.#e.client.select({id:m.id}).from(e`remote.entities_relations as remote`).where(e`remote.source_key = ${o.sourceKey}`)))):this.#e.client.select(m).from(o),n=this.#e.client.select(m).from(i.as("combined_entities_relations")).$dynamic(),c=this.#e.client.select(m).from(i.as("combined_entities_relations")).$dynamic(),_=g(c,{...t,limit:void 0,skip:void 0,after:void 0,before:void 0}),u=this.#e.client.$count(_),d=t.limit||10,a=g(n,{...t,limit:d+1}),[E,y]=await Promise.all([a.run(),u]),T=E.rows,N=T.length>d;return{items:T.slice(0,d).map(w=>W(w)).filter(w=>w!==null),hasMore:N,total:y}}async getEntityRelationById(t){const c=(await(this.#t?f(this.#e.client.select(m).from(e`remote.entities_relations`).where(l(o.id,t)),this.#e.client.select(m).from(o).where(p(l(o.id,t),h(this.#e.client.select({id:m.id}).from(e`remote.entities_relations as remote`).where(e`remote.id = ${o.id}`))))):this.#e.client.select(m).from(o).where(l(o.id,t))).run()).rows[0];return c?W(c):null}async getEntitiesWithRelations(t={}){const n=(this.#t?f(this.#e.client.select(s).from(e`remote.entities`),this.#e.client.select(s).from(r).where(h(this.#e.client.select({id:s.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.#e.client.select(s).from(r)).as("e"),_=(this.#t?f(this.#e.client.select(m).from(e`remote.entities_relations`),this.#e.client.select(m).from(o).where(h(this.#e.client.select({id:m.id}).from(e`remote.entities_relations as remote`).where(e`remote.source_key = ${o.sourceKey}`)))):this.#e.client.select(m).from(o)).as("combined_relations"),d=(this.#t?f(this.#e.client.select(s).from(e`remote.entities`),this.#e.client.select(s).from(r).where(h(this.#e.client.select({id:s.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.#e.client.select(s).from(r)).as("combined_target_entities"),a=this.#e.client.with(n,_,d).select({...$("e"),domains:this.#i("e").as("domains"),owners:this.#n("e").as("owners")}).from(n).as("entities_with_relations"),E={...s,domains:a.domains,owners:a.owners},y=this.#e.client.with(a).select(E).from(a).$dynamic(),T=this.#e.client.with(a).select(E).from(a).$dynamic();try{const N=g(T,{...t,limit:void 0,skip:void 0,after:void 0,before:void 0}),w=this.#e.client.$count(N),k=t.limit||10,C=g(y,{...t,limit:k+1}),[R,A]=await Promise.all([C.run(),w]),b=R.rows,L=b.length>k;return{items:b.slice(0,k).map(S=>M(S)).filter(S=>S!==null),hasMore:L,total:A}}catch{return{items:[],hasMore:!1,total:0}}}async getEntityWithRelationsByKey(t){const n=(this.#t?f(this.#e.client.select(s).from(e`remote.entities`).where(l(r.key,t)),this.#e.client.select(s).from(r).where(p(l(r.key,t),h(this.#e.client.select({id:s.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`))))):this.#e.client.select(s).from(r).where(l(r.key,t))).as("e"),_=(this.#t?f(this.#e.client.select(m).from(e`remote.entities_relations`),this.#e.client.select(m).from(o).where(h(this.#e.client.select({id:m.id}).from(e`remote.entities_relations as remote`).where(e`remote.source_key = ${o.sourceKey}`)))):this.#e.client.select(m).from(o)).as("combined_relations"),d=(this.#t?f(this.#e.client.select(s).from(e`remote.entities`),this.#e.client.select(s).from(r).where(h(this.#e.client.select({id:s.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.#e.client.select(s).from(r)).as("combined_target_entities"),E=await this.#e.client.with(n,_,d).select({...$("e"),domains:this.#i("e").as("domains"),owners:this.#n("e").as("owners")}).from(n).limit(1).run();if(E.rows.length===0)return null;const y=E.rows[0];return M(y)}async getRelatedEntities(t,i={}){const n=q("","relation_id"),_=(this.#t?f(this.#e.client.select(n).from(e`remote.entities_relations`).where(O(l(o.sourceKey,t),l(o.targetKey,t))),this.#e.client.select(n).from(o).where(p(O(l(o.sourceKey,t),l(o.targetKey,t)),h(this.#e.client.select({id:m.id}).from(e`remote.entities_relations as remote`).where(p(e`remote.source_key = ${o.sourceKey}`,e`remote.target_key = ${o.targetKey}`,e`remote.source_to_target_relation = ${o.sourceToTargetRelation}`)))))):this.#e.client.select(n).from(o).where(O(l(o.sourceKey,t),l(o.targetKey,t)))).as("combined_relations"),u=$("","entity_id"),a=(this.#t?f(this.#e.client.select(u).from(e`remote.entities`),this.#e.client.select(u).from(r).where(h(this.#e.client.select({id:s.id}).from(e`remote.entities as remote`).where(e`remote.key = ${r.key}`)))):this.#e.client.select(u).from(r)).as("combined_target_entities"),E=X("combined_target_entities"),y=Object.values(Q("combined_target_entities")),T={...E,relation_type:e`
2
2
  CASE
3
3
  WHEN COUNT(CASE WHEN combined_target_entities.key = combined_relations.source_key THEN 1 END) > 0
4
4
  THEN MIN(CASE WHEN combined_target_entities.key = combined_relations.source_key THEN combined_relations.source_to_target_relation END)
@@ -10,7 +10,7 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
10
10
  THEN 'source'
11
11
  ELSE 'target'
12
12
  END
13
- `.as("relation_role")},T=this.db.client.with(_,a).select(f).from(_).innerJoin(a,p(l(e.raw("combined_relations.source_key"),e.raw("combined_target_entities.key")),l(e.raw("combined_relations.target_key"),e.raw("combined_target_entities.key")))).where(I(e.raw("combined_target_entities.key"),t)).groupBy(...h).having(I(e.raw("MIN(combined_target_entities.key)"),t)).orderBy(U(e.raw("relation_role"))).$dynamic(),w=this.db.client.with(_,a).select(E).from(_).innerJoin(a,p(l(e.raw("combined_relations.source_key"),e.raw("combined_target_entities.key")),l(e.raw("combined_relations.target_key"),e.raw("combined_target_entities.key")))).where(I(e.raw("combined_target_entities.key"),t)).groupBy(...h).having(I(e.raw("MIN(combined_target_entities.key)"),t)).$dynamic(),N=k(w,{...i,limit:void 0,skip:void 0,after:void 0,before:void 0}),C=this.db.client.$count(N),g=i.limit||10,A={...i,limit:g+1},O=k(T,A),[L,S]=await Promise.all([O.run(),C]),B=L.rows,W=B.length>g;return{items:B.slice(0,g).map(D=>q(D)).filter(D=>D!==null),hasMore:W,total:S}}async getCatalogFilters({entitiesTypes:t=[],emptyFilters:i=[]}){if(!i.length)return{};try{return await this.materializeCombinedEntities(t),(i.includes("domains")||i.includes("owners"))&&await this.materializeCombinedRelations(),await this.executeFilterQueries(i)}catch(s){return console.error("Error fetching catalog filters:",s),{}}finally{await this.cleanupTempTables()}}async materializeCombinedEntities(t){if(this.attachedDatabasePath?await this.db.client.run(e`
13
+ `.as("relation_role")},N=this.#e.client.with(_,a).select(T).from(_).innerJoin(a,O(l(e.raw("combined_relations.source_key"),e.raw("combined_target_entities.key")),l(e.raw("combined_relations.target_key"),e.raw("combined_target_entities.key")))).where(I(e.raw("combined_target_entities.key"),t)).groupBy(...y).having(I(e.raw("MIN(combined_target_entities.key)"),t)).orderBy(v(e.raw("relation_role"))).$dynamic(),w=this.#e.client.with(_,a).select(E).from(_).innerJoin(a,O(l(e.raw("combined_relations.source_key"),e.raw("combined_target_entities.key")),l(e.raw("combined_relations.target_key"),e.raw("combined_target_entities.key")))).where(I(e.raw("combined_target_entities.key"),t)).groupBy(...y).having(I(e.raw("MIN(combined_target_entities.key)"),t)).$dynamic(),k=g(w,{...i,limit:void 0,skip:void 0,after:void 0,before:void 0}),C=this.#e.client.$count(k),R=i.limit||10,A={...i,limit:R+1},b=g(N,A),[L,S]=await Promise.all([b.run(),C]),B=L.rows,U=B.length>R;return{items:B.slice(0,R).map(F=>j(F)).filter(F=>F!==null),hasMore:U,total:S}}async getCatalogFilters({entitiesTypes:t=[],emptyFilters:i=[]}){if(!i.length)return{};try{return await this.#s(t),(i.includes("domains")||i.includes("owners"))&&await this.#r(),await this.#o(i)}catch(n){return console.error("Error fetching catalog filters:",n),{}}finally{await this.#c()}}async#s(t){if(this.#t?await this.#e.client.run(e`
14
14
  CREATE TEMP TABLE IF NOT EXISTS temp_combined_entities AS
15
15
  SELECT
16
16
  e.key,
@@ -27,7 +27,7 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
27
27
  FROM entities e
28
28
  LEFT JOIN remote.entities r ON r.key = e.key
29
29
  WHERE r.key IS NULL
30
- `):await this.db.client.run(e`
30
+ `):await this.#e.client.run(e`
31
31
  CREATE TEMP TABLE IF NOT EXISTS temp_combined_entities AS
32
32
  SELECT
33
33
  key,
@@ -35,16 +35,16 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
35
35
  tags,
36
36
  metadata
37
37
  FROM entities
38
- `),t.length){const i=t.map(s=>`'${s.replace(/'/g,"''")}'`).join(",");await this.db.client.run(e.raw(`
38
+ `),t.length){const i=t.map(n=>`'${n.replace(/'/g,"''")}'`).join(",");await this.#e.client.run(e.raw(`
39
39
  CREATE TEMP TABLE IF NOT EXISTS temp_filtered_entities AS
40
40
  SELECT * FROM temp_combined_entities
41
41
  WHERE type IN (${i})
42
- `))}else await this.db.client.run(e`
42
+ `))}else await this.#e.client.run(e`
43
43
  CREATE TEMP TABLE IF NOT EXISTS temp_filtered_entities AS
44
44
  SELECT * FROM temp_combined_entities
45
- `);await this.db.client.run(e`
45
+ `);await this.#e.client.run(e`
46
46
  CREATE INDEX IF NOT EXISTS idx_temp_filtered_type ON temp_filtered_entities(type)
47
- `)}async materializeCombinedRelations(){this.attachedDatabasePath?await this.db.client.run(e`
47
+ `)}async#r(){this.#t?await this.#e.client.run(e`
48
48
  CREATE TEMP TABLE IF NOT EXISTS temp_combined_relations AS
49
49
  SELECT
50
50
  source_key,
@@ -59,25 +59,25 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
59
59
  FROM entities_relations er
60
60
  LEFT JOIN remote.entities_relations r ON r.source_key = er.source_key
61
61
  WHERE r.source_key IS NULL
62
- `):await this.db.client.run(e`
62
+ `):await this.#e.client.run(e`
63
63
  CREATE TEMP TABLE IF NOT EXISTS temp_combined_relations AS
64
64
  SELECT
65
65
  source_key,
66
66
  target_key,
67
67
  source_to_target_relation
68
68
  FROM entities_relations
69
- `),await this.db.client.run(e`
69
+ `),await this.#e.client.run(e`
70
70
  CREATE INDEX IF NOT EXISTS idx_temp_rel_source ON temp_combined_relations(source_key)
71
- `),await this.db.client.run(e`
71
+ `),await this.#e.client.run(e`
72
72
  CREATE INDEX IF NOT EXISTS idx_temp_rel_target ON temp_combined_relations(target_key)
73
- `),await this.db.client.run(e`
73
+ `),await this.#e.client.run(e`
74
74
  CREATE INDEX IF NOT EXISTS idx_temp_rel_relation ON temp_combined_relations(source_to_target_relation)
75
- `)}async executeFilterQueries(t){const i={},s=[],c=t.filter(m=>m.startsWith("metadata."));t.includes("type")&&s.push(`
75
+ `)}async#o(t){const i={},n=[],c=t.filter(d=>d.startsWith("metadata."));t.includes("type")&&n.push(`
76
76
  SELECT 'type' as filter_name, type as value, COUNT(*) as count
77
77
  FROM temp_filtered_entities
78
78
  WHERE type IS NOT NULL
79
79
  GROUP BY type
80
- `),t.includes("tags")&&s.push(`
80
+ `),t.includes("tags")&&n.push(`
81
81
  SELECT 'tags' as filter_name, tag.value as value, COUNT(DISTINCT tfe.key) as count
82
82
  FROM temp_filtered_entities tfe,
83
83
  json_each(COALESCE(tfe.tags, json_array())) as tag
@@ -86,7 +86,7 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
86
86
  AND tag.value IS NOT NULL
87
87
  AND tag.value != ''
88
88
  GROUP BY tag.value
89
- `),t.includes("domains")&&s.push(`
89
+ `),t.includes("domains")&&n.push(`
90
90
  SELECT 'domains' as filter_name, tce.key as value, COUNT(DISTINCT tfe.key) as count
91
91
  FROM temp_combined_relations tcr
92
92
  INNER JOIN temp_filtered_entities tfe ON (
@@ -99,7 +99,7 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
99
99
  )
100
100
  WHERE tce.type = 'domain'
101
101
  GROUP BY tce.key
102
- `),t.includes("owners")&&s.push(`
102
+ `),t.includes("owners")&&n.push(`
103
103
  SELECT 'owners' as filter_name, owner_key as value, COUNT(DISTINCT entity_key) as count
104
104
  FROM (
105
105
  SELECT
@@ -119,7 +119,7 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
119
119
  INNER JOIN temp_combined_entities tce ON tce.key = owner_key
120
120
  WHERE owner_key IS NOT NULL
121
121
  GROUP BY owner_key
122
- `);for(const m of c)await this.executeMetadataFilterQuery(m,i);if(s.length===0)return i;const _=s.join(" UNION ALL "),u=await this.db.client.run(e.raw(_));if(u?.rows)for(const m of u.rows){const a=m.filter_name,E=m.value,h=Number(m.count)||0;i[a]||(i[a]=[]),E&&i[a].push({value:E,count:h})}return i}async executeMetadataFilterQuery(t,i){const s=t.substring(9),c=`$.${x(s)}`,_=await this.db.client.run(e.raw(`
122
+ `);for(const d of c)await this.#a(d,i);if(n.length===0)return i;const _=n.join(" UNION ALL "),u=await this.#e.client.run(e.raw(_));if(u?.rows)for(const d of u.rows){const a=d.filter_name,E=d.value,y=Number(d.count)||0;i[a]||(i[a]=[]),E&&i[a].push({value:E,count:y})}return i}async#a(t,i){const n=t.substring(9),c=`$.${x(n)}`,_=await this.#e.client.run(e.raw(`
123
123
  SELECT json_extract(metadata, '${c}') as value, COUNT(*) as count
124
124
  FROM temp_filtered_entities
125
125
  WHERE metadata IS NOT NULL
@@ -127,7 +127,7 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
127
127
  AND json_extract(metadata, '${c}') IS NOT NULL
128
128
  AND json_extract(metadata, '${c}') != ''
129
129
  GROUP BY value
130
- `));_?.rows&&(i[t]=_.rows.map(u=>({value:u.value,count:Number(u.count)||0})).filter(u=>u.value))}async cleanupTempTables(){try{await this.db.client.run(e`DROP TABLE IF EXISTS temp_combined_entities`),await this.db.client.run(e`DROP TABLE IF EXISTS temp_filtered_entities`),await this.db.client.run(e`DROP TABLE IF EXISTS temp_combined_relations`)}catch(t){X.error("Error cleaning up temp tables:",t)}}_getEntititiesDomainsSubquery(t){return e`
130
+ `));_?.rows&&(i[t]=_.rows.map(u=>({value:u.value,count:Number(u.count)||0})).filter(u=>u.value))}async#c(){try{await this.#e.client.run(e`DROP TABLE IF EXISTS temp_combined_entities`),await this.#e.client.run(e`DROP TABLE IF EXISTS temp_filtered_entities`),await this.#e.client.run(e`DROP TABLE IF EXISTS temp_combined_relations`)}catch(t){P.error("Error cleaning up temp tables:",t)}}#i(t){return e`
131
131
  COALESCE(
132
132
  (
133
133
  SELECT json_group_array(
@@ -156,7 +156,7 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
156
156
  ),
157
157
  json_array()
158
158
  )
159
- `}_getEntititiesOwnersSubquery(t){return e`
159
+ `}#n(t){return e`
160
160
  COALESCE(
161
161
  (
162
162
  SELECT json_group_array(
@@ -187,4 +187,4 @@ import{and as R,eq as l,ne as I,notExists as y,or as p,sql as e}from"drizzle-orm
187
187
  ),
188
188
  json_array()
189
189
  )
190
- `}}function x($){return $.replace(/[^a-zA-Z0-9._-]/g,"")}export{re as CatalogEntitiesLocalReadRepository};
190
+ `}}function x(D){return D.replace(/[^a-zA-Z0-9._-]/g,"")}export{re as CatalogEntitiesLocalReadRepository};