@redocly/redoc 0.133.0-next.1 → 0.133.0-next.3
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.
- package/CHANGELOG.md +60 -2
- package/dist/server/constants/plugins/catalog-entities.d.ts +2 -0
- package/dist/server/constants/plugins/catalog-entities.js +1 -1
- package/dist/server/persistence/cache/mappers/create-cache-db-record.d.ts +1 -1
- package/dist/server/persistence/cache/mappers/create-cache-read-model.d.ts +1 -1
- package/dist/server/persistence/cache/repositories/{cache-local-repository.d.ts → cache-repository.d.ts} +3 -3
- package/dist/server/persistence/cache/repositories/cache-repository.js +1 -0
- package/dist/server/persistence/cache/services/cache-service.d.ts +2 -2
- package/dist/server/persistence/cache/services/cache-service.js +1 -1
- package/dist/server/persistence/file-hashes/mappers/create-file-hash-db-record.d.ts +1 -1
- package/dist/server/persistence/file-hashes/mappers/create-file-hash-read-model.d.ts +2 -2
- package/dist/server/persistence/file-hashes/mappers/create-file-hash-read-model.js +1 -1
- package/dist/server/persistence/file-hashes/repositories/{file-hashes-local-read-repository.d.ts → file-hashes-read-repository.d.ts} +3 -7
- package/dist/server/persistence/file-hashes/repositories/file-hashes-read-repository.js +1 -0
- package/dist/server/persistence/file-hashes/repositories/{file-hashes-local-repository.d.ts → file-hashes-repository.d.ts} +4 -3
- package/dist/server/persistence/file-hashes/repositories/file-hashes-repository.js +1 -0
- package/dist/server/persistence/file-hashes/repositories/{file-hashes-local-write-repository.d.ts → file-hashes-write-repository.d.ts} +2 -2
- package/dist/server/persistence/file-hashes/repositories/file-hashes-write-repository.js +1 -0
- package/dist/server/persistence/file-hashes/services/file-hashes-service.d.ts +3 -5
- package/dist/server/persistence/file-hashes/services/file-hashes-service.js +1 -1
- package/dist/server/persistence/kv/mappers/create-kv-db-record.d.ts +1 -1
- package/dist/server/persistence/kv/mappers/create-kv-list-entry.d.ts +1 -1
- package/dist/server/persistence/kv/mappers/create-kv-value.d.ts +1 -1
- package/dist/server/persistence/kv/repositories/{kv-remote-repository.d.ts → kv-repository.d.ts} +3 -3
- package/dist/server/persistence/kv/repositories/kv-repository.js +2 -0
- package/dist/server/persistence/kv/services/kv-service.d.ts +2 -2
- package/dist/server/persistence/kv/services/kv-service.js +1 -1
- package/dist/server/plugins/catalog-entities/database/catalog-entities-publisher.d.ts +6 -0
- package/dist/server/plugins/catalog-entities/database/catalog-entities-publisher.js +12 -0
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts +29 -66
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.js +1 -1
- package/dist/server/plugins/catalog-entities/database/consts.d.ts +45 -0
- package/dist/server/plugins/catalog-entities/database/consts.js +1 -0
- package/dist/server/plugins/catalog-entities/database/mappers/create-bff-entity.d.ts +1 -2
- package/dist/server/plugins/catalog-entities/database/mappers/create-bff-entity.js +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-attributes-db-record.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-db-record.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-read-model.d.ts +1 -3
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-read-model.js +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-relation-db-record-from-dto.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-relation-db-record-from-file-schema.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-relation-read-model.d.ts +3 -3
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-relation-read-model.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/{local/catalog-entities-bff-repository.d.ts → bffEntities/bff-entities-read-repository.d.ts} +4 -4
- package/dist/server/plugins/catalog-entities/database/repositories/bffEntities/bff-entities-read-repository.js +131 -0
- package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.d.ts +26 -0
- package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.js +1 -0
- package/dist/server/plugins/catalog-entities/database/repositories/common/filters-repository.d.ts +8 -0
- package/dist/server/plugins/catalog-entities/database/repositories/common/filters-repository.js +82 -0
- package/dist/server/plugins/catalog-entities/database/repositories/common/revision-repository.d.ts +7 -7
- package/dist/server/plugins/catalog-entities/database/repositories/common/revision-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/common/version-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-read-repository.d.ts +27 -0
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-read-repository.js +1 -0
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.d.ts +27 -0
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.js +1 -0
- package/dist/server/plugins/catalog-entities/database/repositories/entityAttributes/entity-attributes-write-repository.d.ts +12 -0
- package/dist/server/plugins/catalog-entities/database/repositories/entityAttributes/entity-attributes-write-repository.js +1 -0
- package/dist/server/plugins/catalog-entities/database/repositories/{local/catalog-entities-relations-repository.d.ts → relations/relations-read-repository.d.ts} +7 -4
- package/dist/server/plugins/catalog-entities/database/repositories/relations/relations-read-repository.js +1 -0
- package/dist/server/plugins/catalog-entities/database/repositories/relations/relations-write-repository.d.ts +28 -0
- package/dist/server/plugins/catalog-entities/database/repositories/relations/relations-write-repository.js +1 -0
- package/dist/server/plugins/catalog-entities/database/repositories/types.d.ts +39 -0
- package/dist/server/plugins/catalog-entities/database/repositories/types.js +0 -0
- package/dist/server/plugins/catalog-entities/database/types.d.ts +26 -0
- package/dist/server/plugins/catalog-entities/database/types.js +0 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.js +2 -2
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/get-server-props.js +1 -1
- package/dist/server/plugins/catalog-entities/plugin.js +1 -1
- package/dist/server/plugins/catalog-entities/schemas/database-schemas.d.ts +38 -36
- package/dist/server/plugins/catalog-entities/schemas/database-schemas.js +1 -1
- package/dist/server/plugins/catalog-entities/schemas/dto-schemas.d.ts +1 -3
- package/dist/server/plugins/catalog-entities/schemas/read-model-schemas.d.ts +3 -1
- package/dist/server/plugins/catalog-entities/utils/catalog-data-collector.d.ts +15 -0
- package/dist/server/plugins/catalog-entities/utils/catalog-data-collector.js +1 -1
- package/dist/server/plugins/catalog-entities/utils/hash-manager.d.ts +1 -0
- package/dist/server/plugins/catalog-entities/utils/hash-manager.js +1 -1
- package/dist/server/plugins/catalog-entities/utils/rbac-config-hash-cache.d.ts +18 -0
- package/dist/server/plugins/catalog-entities/utils/rbac-config-hash-cache.js +1 -0
- package/dist/server/plugins/entitlements/index.js +1 -1
- package/dist/server/plugins/entitlements/utils/get-billed-catalog-build-pages-count.d.ts +0 -1
- package/dist/server/plugins/entitlements/utils/get-billed-catalog-build-pages-count.js +1 -1
- package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
- package/dist/server/plugins/mcp/types.d.ts +5 -0
- package/dist/server/plugins/mcp/workers/execute-mcp-tool.d.ts +1 -0
- package/dist/server/plugins/mcp/workers/execute-mcp-tool.js +1 -1
- package/dist/server/plugins/scorecards/database/repositories/{local/scorecards-config-local-repository.d.ts → scorecards-config-repository.d.ts} +4 -4
- package/dist/server/plugins/scorecards/database/repositories/scorecards-config-repository.js +1 -0
- package/dist/server/plugins/scorecards/database/scorecards-config-service.js +1 -1
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +1 -1
- package/dist/server/providers/database/base-repository.js +2 -2
- package/dist/server/providers/database/client.d.ts +1 -1
- package/dist/server/providers/database/client.js +1 -1
- package/dist/server/providers/database/constants.d.ts +4 -9
- package/dist/server/providers/database/constants.js +1 -1
- package/dist/server/providers/database/copy-migrations.js +1 -1
- package/dist/server/providers/database/database-connection-factory.d.ts +2 -2
- package/dist/server/providers/database/database-connection-factory.js +1 -1
- package/dist/server/providers/database/database-connections-manager.d.ts +3 -8
- package/dist/server/providers/database/database-connections-manager.js +1 -1
- package/dist/server/providers/database/database-preconnect-service.js +1 -1
- package/dist/server/providers/database/databases/sqlite-db/drizzle.config.d.ts +12 -0
- package/dist/server/providers/database/databases/sqlite-db/drizzle.config.js +1 -0
- package/dist/server/providers/database/databases/{catalog-sqlite → sqlite-db}/schemas/entities-relations-table.d.ts +19 -0
- package/dist/server/providers/database/databases/{catalog-sqlite → sqlite-db}/schemas/entities-relations-table.js +1 -1
- package/dist/server/providers/database/databases/{catalog-sqlite → sqlite-db}/schemas/entities-table.d.ts +19 -0
- package/dist/server/providers/database/databases/{catalog-sqlite → sqlite-db}/schemas/entities-table.js +1 -1
- package/dist/server/providers/database/pagination/limit.d.ts +5 -0
- package/dist/server/providers/database/pagination/limit.js +1 -1
- package/dist/server/providers/database/transient-sqld-error.d.ts +14 -0
- package/dist/server/providers/database/transient-sqld-error.js +1 -0
- package/dist/server/providers/database/types.d.ts +6 -6
- package/dist/server/providers/database/utils/get-first-row.d.ts +19 -0
- package/dist/server/providers/database/utils/get-first-row.js +1 -0
- package/dist/server/store.d.ts +1 -0
- package/dist/server/store.js +1 -1
- package/dist/server/types/plugins/common.d.ts +1 -0
- package/dist/server/web-server/routes/catalog/catalog-relations.js +1 -1
- package/dist/server/web-server/routes/catalog/catalog.js +1 -1
- package/dist/server/web-server/routes/catalog/helpers/create-entity-schema.d.ts +0 -147
- package/dist/server/web-server/routes/catalog/helpers/create-entity-schema.js +1 -1
- package/dist/server/web-server/routes/catalog/helpers/upsert-pages-stats.js +1 -1
- package/dist/server/web-server/routes/catalog/parsers/entities/parse-entities.d.ts +1 -2
- package/dist/server/web-server/routes/catalog/parsers/entities/parse-entity-update-data.d.ts +1 -2
- package/dist/server/web-server/routes/catalog/parsers/entities/parse-entity.d.ts +1 -2
- package/dist/server/web-server/routes/catalog/parsers/relations/parse-entities-relations.d.ts +1 -1
- package/dist/server/web-server/routes/catalog/parsers/relations/parse-entity-relation-update-data.d.ts +1 -1
- package/dist/server/web-server/routes/catalog/parsers/relations/parse-entity-relation.d.ts +1 -1
- package/dist/server/workers/mcp-tool-worker-pool.d.ts +1 -0
- package/dist/server/workers/mcp-tool-worker-pool.js +1 -1
- package/dist/server/workers/mcp-tool-worker.js +1 -1
- package/dist/server/workers/types.d.ts +5 -1
- package/package.json +9 -9
- package/dist/server/persistence/cache/repositories/cache-local-repository.js +0 -1
- package/dist/server/persistence/file-hashes/repositories/file-hashes-local-read-repository.js +0 -1
- package/dist/server/persistence/file-hashes/repositories/file-hashes-local-repository.js +0 -1
- package/dist/server/persistence/file-hashes/repositories/file-hashes-local-write-repository.js +0 -1
- package/dist/server/persistence/file-hashes/repositories/utils.d.ts +0 -10
- package/dist/server/persistence/file-hashes/repositories/utils.js +0 -1
- package/dist/server/persistence/kv/repositories/kv-remote-repository.js +0 -2
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-bff-repository.js +0 -123
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.d.ts +0 -98
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.js +0 -145
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.d.ts +0 -100
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.js +0 -1
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-write-repository.d.ts +0 -43
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-write-repository.js +0 -1
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-relations-repository.js +0 -1
- package/dist/server/plugins/catalog-entities/database/repositories/remote/catalog-entities-remote-repository.d.ts +0 -20
- package/dist/server/plugins/catalog-entities/database/repositories/remote/catalog-entities-remote-repository.js +0 -1
- package/dist/server/plugins/scorecards/database/repositories/local/scorecards-config-local-repository.js +0 -1
- package/dist/server/providers/database/database-initialization-strategy.d.ts +0 -17
- package/dist/server/providers/database/database-initialization-strategy.js +0 -1
- package/dist/server/providers/database/databases/catalog-sqlite/drizzle.config.d.ts +0 -11
- package/dist/server/providers/database/databases/catalog-sqlite/drizzle.config.js +0 -1
- package/dist/server/providers/database/databases/main-sqlite/drizzle.config.d.ts +0 -10
- package/dist/server/providers/database/databases/main-sqlite/drizzle.config.js +0 -1
- package/dist/server/providers/database/databases/sqld-sqlite/drizzle.config.d.ts +0 -14
- package/dist/server/providers/database/databases/sqld-sqlite/drizzle.config.js +0 -1
- /package/dist/server/providers/database/databases/{main-sqlite → sqlite-db}/schemas/cache-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{main-sqlite → sqlite-db}/schemas/cache-table.js +0 -0
- /package/dist/server/providers/database/databases/{catalog-sqlite → sqlite-db}/schemas/entities-attributes-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{catalog-sqlite → sqlite-db}/schemas/entities-attributes-table.js +0 -0
- /package/dist/server/providers/database/databases/{main-sqlite → sqlite-db}/schemas/file-hashes-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{main-sqlite → sqlite-db}/schemas/file-hashes-table.js +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/kv-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/kv-table.js +0 -0
- /package/dist/server/providers/database/databases/{main-sqlite → sqlite-db}/schemas/scorecards-config-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{main-sqlite → sqlite-db}/schemas/scorecards-config-table.js +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-evaluation-runs-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-evaluation-runs-table.js +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-level-results-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-level-results-table.js +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-levels-rules-results-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-levels-rules-results-table.js +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-results-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-results-table.js +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-rule-results-table.d.ts +0 -0
- /package/dist/server/providers/database/databases/{sqld-sqlite → sqlite-db}/schemas/scorecards-rule-results-table.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @redocly/redoc
|
|
2
2
|
|
|
3
|
+
## 0.133.0-next.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e2b2f2e27f3: Updated Markdown links to display a clearer underline with a thicker underline on hover for improved visibility and accessibility.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [e2b2f2e27f3]
|
|
12
|
+
- @redocly/theme@0.65.0-next.3
|
|
13
|
+
- @redocly/asyncapi-docs@1.10.0-next.3
|
|
14
|
+
- @redocly/graphql-docs@1.10.0-next.3
|
|
15
|
+
- @redocly/openapi-docs@3.21.0-next.3
|
|
16
|
+
- @redocly/portal-plugin-mock-server@0.18.0-next.3
|
|
17
|
+
|
|
18
|
+
## 0.133.0-next.2
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- 76cad3a2f35: Updated styles for page navigation buttons.
|
|
23
|
+
- b5906fb936b: Updated the icon displayed alongside hyperlinks in the project.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- e271a42c40a: Prevented search engines from indexing markdown pages generated by the `llms.txt` feature.
|
|
28
|
+
- 5b052600400: Updated `@redocly/openapi-core` to version `2.30.2`.
|
|
29
|
+
- fac8607a7b0: Fixed an issue where closing the search dialog modal locked page scrolling.
|
|
30
|
+
- 4d93e20695b: Fixed an issue where MCP connect actions were hidden for OpenAPI pages excluded from search (`openapi.excludeFromSearch`).
|
|
31
|
+
- c58bb350c00: Updated @redocly/openapi-core to version 2.30.1.
|
|
32
|
+
- Updated dependencies [76cad3a2f35]
|
|
33
|
+
- Updated dependencies [b5906fb936b]
|
|
34
|
+
- Updated dependencies [5b052600400]
|
|
35
|
+
- Updated dependencies [fac8607a7b0]
|
|
36
|
+
- Updated dependencies [4d93e20695b]
|
|
37
|
+
- Updated dependencies [c58bb350c00]
|
|
38
|
+
- Updated dependencies [4a857b489dd]
|
|
39
|
+
- Updated dependencies [62ea0748ec5]
|
|
40
|
+
- @redocly/theme@0.65.0-next.2
|
|
41
|
+
- @redocly/asyncapi-docs@1.10.0-next.2
|
|
42
|
+
- @redocly/graphql-docs@1.10.0-next.2
|
|
43
|
+
- @redocly/openapi-docs@3.21.0-next.2
|
|
44
|
+
- @redocly/realm-asyncapi-sdk@0.11.0-next.2
|
|
45
|
+
- @redocly/portal-plugin-mock-server@0.18.0-next.2
|
|
46
|
+
|
|
3
47
|
## 0.133.0-next.1
|
|
4
48
|
|
|
5
49
|
### Minor Changes
|
|
@@ -35,8 +79,6 @@
|
|
|
35
79
|
### Patch Changes
|
|
36
80
|
|
|
37
81
|
- 8a1e45e9493: Fixed security vulnerability `GHSA-39q2-94rc-95cp` by upgrading `dompurify` to version `3.4.0`.
|
|
38
|
-
- 27cc506931d: Updated `@redocly/openapi-core` to version `2.29.0`.
|
|
39
|
-
- 39f8473e10e: Updated `@redocly/openapi-core` to version `2.27.1`.
|
|
40
82
|
- db587e909d6: Fixed security vulnerability `CVE-2026-39356` by upgrading `drizzle-orm` to version `0.45.2`.
|
|
41
83
|
- a1bb760b292: Fixed an issue where the tooltips in API docs and Replay might partially render outside the viewport.
|
|
42
84
|
- b90d4351949: Fixed multiple moderate security vulnerabilities in `hono` dependency by upgrading it to version `4.12.14`.
|
|
@@ -57,6 +99,22 @@
|
|
|
57
99
|
- @redocly/asyncapi-docs@1.10.0-next.0
|
|
58
100
|
- @redocly/graphql-docs@1.10.0-next.0
|
|
59
101
|
|
|
102
|
+
## 0.132.1
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- 2c6eb90f48: Fixed security vulnerability `GHSA-39q2-94rc-95cp` by upgrading `dompurify` to version `3.4.0`.
|
|
107
|
+
- adc17017f1: Fixed security vulnerability `CVE-2026-41650` by upgrading `fast-xml-parser` to version `5.7.1`.
|
|
108
|
+
- 3246b1da21: Fixed security vulnerability `CVE-2026-39356` by upgrading `drizzle-orm` to version `0.45.2`.
|
|
109
|
+
- 387d761304: Fixed security vulnerability `CVE-2026-41673` by upgrading `@xmldom/xmldom` to version `0.9.10`.
|
|
110
|
+
- 2ac1683944: Fixed multiple moderate security vulnerabilities in `hono` dependency by upgrading it to version `4.12.14`.
|
|
111
|
+
- Updated dependencies [2c6eb90f48]
|
|
112
|
+
- Updated dependencies [adc17017f1]
|
|
113
|
+
- @redocly/openapi-docs@3.20.1
|
|
114
|
+
- @redocly/asyncapi-docs@1.9.1
|
|
115
|
+
- @redocly/graphql-docs@1.9.1
|
|
116
|
+
- @redocly/portal-plugin-mock-server@0.17.1
|
|
117
|
+
|
|
60
118
|
## 0.132.0
|
|
61
119
|
|
|
62
120
|
### Minor Changes
|
|
@@ -3,6 +3,8 @@ export declare const ENTITY_SCHEMA_EXCLUDED_FOLDERS: string[];
|
|
|
3
3
|
export declare const ENTITIES_MAP_GLOBAL_DATA_KEY = "catalog:entitySources";
|
|
4
4
|
export declare const CATALOG_FILTERS_CACHE_NAMESPACE = "catalog-filters";
|
|
5
5
|
export declare const CATALOG_FILTERS_CACHE_TTL_IN_SECONDS: number;
|
|
6
|
+
export declare const CATALOG_META_CACHE_NAMESPACE = "catalog-meta";
|
|
7
|
+
export declare const RBAC_CONFIG_HASH_CACHE_KEY = "rbac-config-hash";
|
|
6
8
|
export declare const CATALOG_ENTITIES_DEFAULT_CONFIG: EntitiesCatalogConfig;
|
|
7
9
|
export declare const CATALOG_ENTITIES_FILES_REGEX: RegExp;
|
|
8
10
|
export declare const ALLOWED_CATALOG_QUERY_PARAMS: readonly ["after", "before", "sort", "filter", "search", "limit", "skip"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CATALOG_SLUGS as a}from"../../../constants/catalog-entities.js";const l=["node_modules","dist","build",".git","@l10n"],i="catalog:entitySources",s="catalog-filters",o=300,t=[{title:"Domains",property:"domains"},{title:"Owner",property:"owners"},{title:"Tags",property:"tags"}],
|
|
1
|
+
import{CATALOG_SLUGS as a}from"../../../constants/catalog-entities.js";const l=["node_modules","dist","build",".git","@l10n"],i="catalog:entitySources",s="catalog-filters",o=300,c="catalog-meta",r="rbac-config-hash",t=[{title:"Domains",property:"domains"},{title:"Owner",property:"owners"},{title:"Tags",property:"tags"}],n={show:!1,catalogs:{all:{slug:a.ALL,hide:!1,includes:[],excludes:[],filters:[{title:"Type",property:"type"},...t],titleTranslationKey:"catalog.catalogs.all.title",descriptionTranslationKey:"catalog.catalogs.all.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.all.switcherLabel"},services:{slug:a.SERVICES,hide:!1,includes:[{type:"service"}],excludes:[],filters:t,titleTranslationKey:"catalog.catalogs.service.title",descriptionTranslationKey:"catalog.catalogs.service.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.service.switcherLabel"},domains:{slug:a.DOMAINS,hide:!1,includes:[{type:"domain"}],excludes:[],filters:t,titleTranslationKey:"catalog.catalogs.domain.title",descriptionTranslationKey:"catalog.catalogs.domain.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.domain.switcherLabel"},teams:{slug:a.TEAMS,hide:!1,includes:[{type:"team"}],excludes:[],filters:t,titleTranslationKey:"catalog.catalogs.team.title",descriptionTranslationKey:"catalog.catalogs.team.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.team.switcherLabel"},users:{slug:a.USERS,hide:!1,includes:[{type:"user"}],excludes:[],filters:t,titleTranslationKey:"catalog.catalogs.user.title",descriptionTranslationKey:"catalog.catalogs.user.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.user.switcherLabel"},apiDescriptions:{slug:a.API_DESCRIPTIONS,hide:!1,includes:[{type:"api-description"}],excludes:[],filters:t,titleTranslationKey:"catalog.catalogs.apiDescription.title",descriptionTranslationKey:"catalog.catalogs.apiDescription.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.apiDescription.switcherLabel"},dataSchemas:{slug:a.DATA_SCHEMAS,hide:!1,includes:[{type:"data-schema"}],excludes:[],filters:t,titleTranslationKey:"catalog.catalogs.dataSchema.title",descriptionTranslationKey:"catalog.catalogs.dataSchema.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.dataSchema.switcherLabel"},apiOperations:{slug:a.API_OPERATIONS,hide:!1,includes:[{type:"api-operation"}],excludes:[],filters:t,titleTranslationKey:"catalog.catalogs.apiOperation.title",descriptionTranslationKey:"catalog.catalogs.apiOperation.description",catalogSwitcherLabelTranslationKey:"catalog.catalogs.apiOperation.switcherLabel"}}},g=/\.(entity|entities)\.(yaml|yml)$/,p=["after","before","sort","filter","search","limit","skip"],T="NO_SQLD_DEPLOYMENT_YET";export{p as ALLOWED_CATALOG_QUERY_PARAMS,n as CATALOG_ENTITIES_DEFAULT_CONFIG,g as CATALOG_ENTITIES_FILES_REGEX,s as CATALOG_FILTERS_CACHE_NAMESPACE,o as CATALOG_FILTERS_CACHE_TTL_IN_SECONDS,c as CATALOG_META_CACHE_NAMESPACE,i as ENTITIES_MAP_GLOBAL_DATA_KEY,l as ENTITY_SCHEMA_EXCLUDED_FOLDERS,r as RBAC_CONFIG_HASH_CACHE_KEY,T as SQLD_REMOTE_DATABASE_URL_NO_DEPLOYMENT_YET_VAR};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DatabaseCacheDto } from '../../../providers/database/databases/
|
|
1
|
+
import type { DatabaseCacheDto } from '../../../providers/database/databases/sqlite-db/schemas/cache-table.js';
|
|
2
2
|
export declare function createCacheDbRecord({ key, value, namespace, ttlInSeconds, }: {
|
|
3
3
|
key: string;
|
|
4
4
|
value: Record<string, unknown> | unknown[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DatabaseCache } from '../../../providers/database/databases/
|
|
1
|
+
import type { DatabaseCache } from '../../../providers/database/databases/sqlite-db/schemas/cache-table.js';
|
|
2
2
|
import type { CacheReadModelSchema } from '../types.js';
|
|
3
3
|
export declare function createCacheReadModel(cache: DatabaseCache): CacheReadModelSchema;
|
|
4
4
|
//# sourceMappingURL=create-cache-read-model.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { CacheReadModelSchema, SetCacheParams } from '../types.js';
|
|
2
2
|
import type { DatabaseConnection, RepositoryInstanceOptions } from '../../../providers/database/types.js';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class CacheRepository {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(dbConnection: DatabaseConnection);
|
|
6
|
-
static getInstance(options: RepositoryInstanceOptions): Promise<
|
|
6
|
+
static getInstance(options: RepositoryInstanceOptions): Promise<CacheRepository>;
|
|
7
7
|
get(key: string, namespace: string): Promise<CacheReadModelSchema | null>;
|
|
8
8
|
set(params: SetCacheParams): Promise<string | null>;
|
|
9
9
|
delete(key: string, namespace: string): Promise<boolean>;
|
|
10
10
|
deleteByNamespace(namespace: string): Promise<boolean>;
|
|
11
11
|
clearAll(): Promise<boolean>;
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=cache-
|
|
13
|
+
//# sourceMappingURL=cache-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{and as l,eq as a}from"drizzle-orm";import{isTtlExpired as d}from"../../../utils/is-ttl-expired.js";import{logger as o}from"../../../tools/notifiers/logger.js";import{DatabaseConnectionFactory as m}from"../../../providers/database/database-connection-factory.js";import{cacheTable as r}from"../../../providers/database/databases/sqlite-db/schemas/cache-table.js";import{createCacheDbRecord as u}from"../mappers/create-cache-db-record.js";import{createCacheReadModel as h}from"../mappers/create-cache-read-model.js";class c{static#t;#e;constructor(t){this.#e=t.client}static async getInstance(t){if(!c.#t){const e=await m.create(t);if(!e)throw new Error("Failed to create db connection for cache repository");c.#t=new c(e)}return c.#t}async get(t,e){const n=[a(r.key,t)];e&&n.push(a(r.namespace,e));const i=await this.#e.client.select().from(r).where(l(...n)).get();if(!i)return null;const s=h(i);return d(s.ttlInSeconds,s.createdAt)?(await this.delete(t,e),null):s}async set(t){try{const e=u(t);return await this.#e.client.insert(r).values(e).onConflictDoUpdate({target:[r.key],set:{value:e.value,namespace:e.namespace,ttl:e.ttl,updatedAt:e.updatedAt}}),e.key}catch(e){return o.error("Error setting cache: "+e.message),null}}async delete(t,e){try{return await this.#e.client.delete(r).where(l(a(r.key,t),a(r.namespace,e))),!0}catch(n){return o.error("Error deleting cache: "+n.message),!1}}async deleteByNamespace(t){try{return await this.#e.client.delete(r).where(a(r.namespace,t)),!0}catch(e){return o.error("Error deleting cache by namespace: "+e.message),!1}}async clearAll(){try{return await this.#e.client.delete(r),!0}catch(t){return o.error("Error clearing all cache: "+t.message),!1}}}export{c as CacheRepository};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ServiceInstanceOptions } from '../../../providers/database/types.js';
|
|
2
2
|
import type { SetCacheParams, GetCacheParams } from '../types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { CacheRepository } from '../repositories/cache-repository.js';
|
|
4
4
|
export declare class CacheService {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(repository: CacheRepository);
|
|
7
7
|
static getInstance(options: ServiceInstanceOptions): Promise<CacheService>;
|
|
8
8
|
/**
|
|
9
9
|
* Get a cache entry by key and namespace
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isTtlCorrect as
|
|
1
|
+
import{isTtlCorrect as a}from"../../../utils/is-ttl-correct.js";import{CacheRepository as i}from"../repositories/cache-repository.js";class s{static#e;#t;constructor(t){this.#t=t}static async#s(t){const e=await i.getInstance(t),n=new s(e);s.#e=n}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,t.namespace);return e?e.value:null}async set(t){if(!a(t.ttlInSeconds))throw new Error("TTL must be null or a positive number");return await this.#t.set(t)}async delete(t,e){return await this.#t.delete(t,e)}async deleteByNamespace(t){return await this.#t.deleteByNamespace(t)}async clear(){return await this.#t.clearAll()}}export{s as CacheService};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileType, FileHashStatus } from '../types.js';
|
|
2
|
-
import type { DatabaseFileHashDto } from '../../../providers/database/databases/
|
|
2
|
+
import type { DatabaseFileHashDto } from '../../../providers/database/databases/sqlite-db/schemas/file-hashes-table.js';
|
|
3
3
|
export declare function createFileHashDbRecord({ id, fileType, filePath, hash, status, }: {
|
|
4
4
|
id?: string;
|
|
5
5
|
fileType: FileType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Row } from '@libsql/client';
|
|
2
1
|
import type { FileHashReadModelSchema } from '../types.js';
|
|
3
|
-
|
|
2
|
+
import type { DatabaseFileHash } from '../../../providers/database/databases/sqlite-db/schemas/file-hashes-table.js';
|
|
3
|
+
export declare function createFileHashReadModel(fileHash: DatabaseFileHash): FileHashReadModelSchema;
|
|
4
4
|
//# sourceMappingURL=create-file-hash-read-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FileHashStatus as e}from"../types.js";function d(t){return{id:t.id,fileType:t.
|
|
1
|
+
import{FileHashStatus as e}from"../types.js";function d(t){return{id:t.id,fileType:t.fileType,filePath:t.filePath,hash:t.hash,status:t.status===e.UP_TO_DATE?e.UP_TO_DATE:e.OUTDATED,createdAt:t.createdAt,updatedAt:t.updatedAt,object:"fileHash"}}export{d as createFileHashReadModel};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import type { FileHashReadModelSchema } from '../types.js';
|
|
2
2
|
import type { DatabaseClient } from '../../../providers/database/client.js';
|
|
3
|
-
export
|
|
4
|
-
items: T[];
|
|
5
|
-
hasMore?: boolean;
|
|
6
|
-
total: number;
|
|
7
|
-
};
|
|
8
|
-
export declare class FileHashesLocalReadRepository {
|
|
3
|
+
export declare class FileHashesReadRepository {
|
|
9
4
|
#private;
|
|
10
5
|
constructor(db: DatabaseClient);
|
|
11
6
|
getByPath(filePath: string): Promise<FileHashReadModelSchema | null>;
|
|
12
7
|
getAllOutdated(fileType: string): Promise<FileHashReadModelSchema[]>;
|
|
8
|
+
getAllByFileType(fileType: string): Promise<FileHashReadModelSchema[]>;
|
|
13
9
|
}
|
|
14
|
-
//# sourceMappingURL=file-hashes-
|
|
10
|
+
//# sourceMappingURL=file-hashes-read-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{and as l,eq as s}from"drizzle-orm";import{getFirstRow as o}from"../../../providers/database/utils/get-first-row.js";import{createFileHashReadModel as a}from"../mappers/create-file-hash-read-model.js";import{fileHashesTable as t}from"../../../providers/database/databases/sqlite-db/schemas/file-hashes-table.js";class f{#e;constructor(e){this.#e=e}async getByPath(e){const r=await o(this.#e.client.select().from(t).where(s(t.filePath,e)));return r?a(r):null}async getAllOutdated(e){return(await this.#e.client.select().from(t).where(l(s(t.fileType,e),s(t.status,"outdated"))).all()).map(a)}async getAllByFileType(e){return(await this.#e.client.select().from(t).where(s(t.fileType,e)).all()).map(a)}}export{f as FileHashesReadRepository};
|
|
@@ -3,14 +3,15 @@ import type { Filter } from '../../../providers/database/pagination/types.js';
|
|
|
3
3
|
import type { FileHashStatus, UpsertFileHashParams } from '../types.js';
|
|
4
4
|
import type { DatabaseConnection, RepositoryInstanceOptions } from '../../../providers/database/types.js';
|
|
5
5
|
import { BaseRepository } from '../../../providers/database/base-repository.js';
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class FileHashesRepository extends BaseRepository {
|
|
7
7
|
#private;
|
|
8
8
|
constructor(dbConnection: DatabaseConnection);
|
|
9
|
-
static getInstance(options: RepositoryInstanceOptions): Promise<
|
|
9
|
+
static getInstance(options: RepositoryInstanceOptions): Promise<FileHashesRepository>;
|
|
10
10
|
getByPath(filePath: string): Promise<FileHashReadModelSchema | null>;
|
|
11
11
|
getAllOutdated(fileType: string): Promise<FileHashReadModelSchema[]>;
|
|
12
|
+
getAllByFileType(fileType: string): Promise<FileHashReadModelSchema[]>;
|
|
12
13
|
upsertFileHash(upsertFileHashParams: UpsertFileHashParams): Promise<string | null>;
|
|
13
14
|
updateFileHashesStatus(status: FileHashStatus, filter: Filter): Promise<boolean>;
|
|
14
15
|
deleteFileHashes(filter: Filter): Promise<boolean>;
|
|
15
16
|
}
|
|
16
|
-
//# sourceMappingURL=file-hashes-
|
|
17
|
+
//# sourceMappingURL=file-hashes-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DatabaseConnectionFactory as a}from"../../../providers/database/database-connection-factory.js";import{BaseRepository as r}from"../../../providers/database/base-repository.js";import{FileHashesWriteRepository as i}from"./file-hashes-write-repository.js";import{FileHashesReadRepository as n}from"./file-hashes-read-repository.js";class e extends r{static#s;#t;#e;constructor(t){super(t),this.#t=new n(this.databaseClient),this.#e=new i(this.databaseClient)}static async getInstance(t){if(!e.#s){const s=await a.create(t);if(!s)throw new Error("Failed to create db connection for file hashes repository");e.#s=new e(s)}return e.#s}async getByPath(t){return this.#t.getByPath(t)}async getAllOutdated(t){return this.#t.getAllOutdated(t)}async getAllByFileType(t){return this.#t.getAllByFileType(t)}async upsertFileHash(t){return await this.#e.upsertFileHash(t)}async updateFileHashesStatus(t,s){return this.#e.updateFileHashes(t,s)}async deleteFileHashes(t){return this.#e.deleteFileHashes(t)}}export{e as FileHashesRepository};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { DatabaseClient } from '../../../providers/database/client.js';
|
|
2
2
|
import type { Filter } from '../../../providers/database/pagination/types.js';
|
|
3
3
|
import type { FileHashStatus, UpsertFileHashParams } from '../types.js';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class FileHashesWriteRepository {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(db: DatabaseClient);
|
|
7
7
|
upsertFileHash(upsertFileHashParams: UpsertFileHashParams): Promise<string | null>;
|
|
8
8
|
updateFileHashes(status: FileHashStatus, filter: Filter): Promise<boolean>;
|
|
9
9
|
deleteFileHashes(filter: Filter): Promise<boolean>;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=file-hashes-
|
|
11
|
+
//# sourceMappingURL=file-hashes-write-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{logger as a}from"../../../tools/notifiers/logger.js";import{convertFilterToWhereCondition as i}from"../../../providers/database/pagination/filter.js";import{createFileHashDbRecord as o}from"../mappers/create-file-hash-db-record.js";import{fileHashesTable as t}from"../../../providers/database/databases/sqlite-db/schemas/file-hashes-table.js";class d{#e;constructor(r){this.#e=r}async upsertFileHash(r){try{const e=o({...r});return await this.#e.client.insert(t).values(e).onConflictDoUpdate({target:[t.fileType,t.filePath],set:{hash:e.hash,status:e.status,updatedAt:e.updatedAt}}),e.id}catch(e){return a.error("Error upserting file hash",e),null}}async updateFileHashes(r,e){try{const s=i(e);return s?(await this.#e.client.update(t).set({status:r}).where(s),!0):!1}catch(s){return a.error("Error updating file hashes",s),!1}}async deleteFileHashes(r){try{const e=i(r);return e?(await this.#e.client.delete(t).where(e),!0):!1}catch(e){return a.error("Error deleting file hashes",e),!1}}}export{d as FileHashesWriteRepository};
|
|
@@ -2,18 +2,16 @@ import type { ServiceInstanceOptions } from '../../../providers/database/types.j
|
|
|
2
2
|
import type { Filter } from '../../../providers/database/pagination/types.js';
|
|
3
3
|
import type { FileHashStatus, UpsertFileHashParams } from '../types.js';
|
|
4
4
|
import type { FileHashReadModelSchema } from '../types.js';
|
|
5
|
-
import {
|
|
5
|
+
import { FileHashesRepository } from '../repositories/file-hashes-repository.js';
|
|
6
6
|
export declare class FileHashesService {
|
|
7
7
|
#private;
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(repository: FileHashesRepository);
|
|
9
9
|
static getInstance(options: ServiceInstanceOptions): Promise<FileHashesService>;
|
|
10
10
|
getByPath(filePath: string): Promise<FileHashReadModelSchema | null>;
|
|
11
11
|
getAllOutdated(fileType: string): Promise<FileHashReadModelSchema[]>;
|
|
12
|
+
getAllByFileType(fileType: string): Promise<FileHashReadModelSchema[]>;
|
|
12
13
|
upsertFileHash(upsertFileHashParams: UpsertFileHashParams): Promise<string | null>;
|
|
13
14
|
updateFileHashes(status: FileHashStatus, filter: Filter): Promise<boolean>;
|
|
14
|
-
/**
|
|
15
|
-
* Use only internally, everything that is deleted via API should be deleted in the remote database.
|
|
16
|
-
*/
|
|
17
15
|
deleteFileHashes(filter: Filter): Promise<boolean>;
|
|
18
16
|
}
|
|
19
17
|
//# sourceMappingURL=file-hashes-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{FileHashesRepository as i}from"../repositories/file-hashes-repository.js";class e{static#e;#t;constructor(t){this.#t=t}static async#a(t){const a=await i.getInstance(t),s=new e(a);e.#e=s}static async getInstance(t){return t.removeExisting===void 0&&(t.removeExisting=!1),e.#e||await e.#a(t),e.#e}async getByPath(t){return await this.#t.getByPath(t)}async getAllOutdated(t){return await this.#t.getAllOutdated(t)}async getAllByFileType(t){return await this.#t.getAllByFileType(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{e as FileHashesService};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KvValue, KvKey } from '@redocly/config';
|
|
2
|
-
import type { DatabaseKvDbInsertSchema } from '../../../providers/database/databases/
|
|
2
|
+
import type { DatabaseKvDbInsertSchema } from '../../../providers/database/databases/sqlite-db/schemas/kv-table.js';
|
|
3
3
|
export declare const KV_KEY_SEPARATOR = "\u0001";
|
|
4
4
|
export declare function createKvDbRecord({ key, value, ttlInSeconds, }: {
|
|
5
5
|
key: KvKey;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KvKey, KvListEntry, KvValue } from '@redocly/config';
|
|
2
|
-
import type { DatabaseKvDbSchema } from '../../../providers/database/databases/
|
|
2
|
+
import type { DatabaseKvDbSchema } from '../../../providers/database/databases/sqlite-db/schemas/kv-table.js';
|
|
3
3
|
export declare function createKvListEntry<T extends KvValue>(kvDbEntry: Pick<DatabaseKvDbSchema, 'encodedKey' | 'value'>): KvListEntry<T>;
|
|
4
4
|
export declare function decodeKvKey(encodedKey: string): KvKey;
|
|
5
5
|
//# sourceMappingURL=create-kv-list-entry.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { KvValue } from '@redocly/config';
|
|
2
|
-
import type { DatabaseKvDbSchema } from '../../../providers/database/databases/
|
|
2
|
+
import type { DatabaseKvDbSchema } from '../../../providers/database/databases/sqlite-db/schemas/kv-table.js';
|
|
3
3
|
export declare function createKvValue<T extends KvValue>(kvDbEntry: Pick<DatabaseKvDbSchema, 'encodedKey' | 'value'>): T | null;
|
|
4
4
|
//# sourceMappingURL=create-kv-value.d.ts.map
|
package/dist/server/persistence/kv/repositories/{kv-remote-repository.d.ts → kv-repository.d.ts}
RENAMED
|
@@ -2,10 +2,10 @@ import type { KvKey, KvListEntry, KvSetOptions, KvValue, KvListSelector, KvListO
|
|
|
2
2
|
import type { DatabaseConnection, RepositoryInstanceOptions } from '../../../providers/database/types.js';
|
|
3
3
|
import { BaseRepository } from '../../../providers/database/base-repository.js';
|
|
4
4
|
export declare const KV_KEY_END_BOUNDARY = "\u0002";
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class KvRepository extends BaseRepository {
|
|
6
6
|
#private;
|
|
7
7
|
constructor(dbConnection: DatabaseConnection);
|
|
8
|
-
static getInstance(options: RepositoryInstanceOptions): Promise<
|
|
8
|
+
static getInstance(options: RepositoryInstanceOptions): Promise<KvRepository | null>;
|
|
9
9
|
sync(): Promise<void>;
|
|
10
10
|
get<T extends KvValue = KvValue>(key: KvKey): Promise<T | null>;
|
|
11
11
|
getMany<T extends KvValue = KvValue>(keys: KvKey[]): Promise<(KvListEntry<T> | null)[]>;
|
|
@@ -17,4 +17,4 @@ export declare class KvRemoteRepository extends BaseRepository {
|
|
|
17
17
|
getTotalStoredEntryBytes(): Promise<number>;
|
|
18
18
|
getStoredEntrySizeByEncodedKey(encodedKey: string): Promise<number>;
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=kv-
|
|
20
|
+
//# sourceMappingURL=kv-repository.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{eq as K,and as h,gte as u,gt as B,lt as f,asc as S,desc as L,or as w,isNull as b,sql as s,inArray as M,count as N}from"drizzle-orm";import{logger as i}from"../../../tools/notifiers/logger.js";import{kvTable as t}from"../../../providers/database/databases/sqlite-db/schemas/kv-table.js";import{BaseRepository as T}from"../../../providers/database/base-repository.js";import{DatabaseConnectionFactory as $}from"../../../providers/database/database-connection-factory.js";import{createKvValue as D}from"../mappers/create-kv-value.js";import{createKvDbRecord as I,encodeKvKey as l}from"../mappers/create-kv-db-record.js";import{decodeCursor as O}from"../helpers/decode-cursor.js";import{encodeCursor as q}from"../helpers/encode-cursor.js";import{createKvListEntry as E}from"../mappers/create-kv-list-entry.js";const z="";class y extends T{static#e;#t=!1;constructor(e){super(e)}static async getInstance(e){if(!y.#e)try{const r=await $.create(e);if(!r)return y.#e=null,null;y.#e=new y(r)}catch(r){return i.error("Error creating kv remote repository",r),y.#e=null,null}return y.#e}async sync(){if(this.isNonRemoteDatabaseMode()){this.#t||(i.warn(`KV database is currently operating in local mode: not connected to the remote database.
|
|
2
|
+
All changes and data will only persist locally and will not be synced remotely.`),this.#t=!0);return}await this.databaseClient.sync()}async get(e){try{const r=l(e),n=await this.databaseClient.client.select().from(t).where(h(K(t.encodedKey,r),w(b(t.expiresAt),u(s`datetime(${t.expiresAt})`,s`datetime('now')`)))).get();return n?D(n):null}catch(r){return i.error("Error getting kv entry by key",r),null}}async getMany(e){try{if(e.length===0)return[];const r=e.map(d=>l(d)),n=w(b(t.expiresAt),u(s`datetime(${t.expiresAt})`,s`datetime('now')`)),o=await this.databaseClient.client.select().from(t).where(h(M(t.encodedKey,r),n)).all(),a=new Map(o.map(d=>[d.encodedKey,d]));return e.map((d,C)=>{const g=r[C],x=a.get(g);return x?E(x):null})}catch(r){return i.error("Error getting multiple kv entries",r),[]}}async list(e,r){try{const n=r?.limit??100,o=r?.reverse??!1,a=[],A=w(b(t.expiresAt),u(s`datetime(${t.expiresAt})`,s`datetime('now')`));if(a.push(A),"prefix"in e){const c=l(e.prefix),m="start"in e?l(e.start):c,k="end"in e?l(e.end):c+z;a.push(u(t.encodedKey,m)),a.push(f(t.encodedKey,k))}else if("start"in e&&"end"in e){const c=l(e.start),m=l(e.end);a.push(u(t.encodedKey,c)),a.push(f(t.encodedKey,m))}if(r?.cursor){const c=O(r.cursor),m=o?f(t.encodedKey,c):B(t.encodedKey,c);a.push(m)}const d=this.databaseClient.client.select().from(t),C=a.length>0?d.where(h(...a)):d,g=this.databaseClient.client.select({count:N()}).from(t),v=(await(a.length>0?g.where(h(...a)):g).get())?.count??0,p=await C.orderBy(o?L(t.encodedKey):S(t.encodedKey)).limit(n).all();return{items:p.map(c=>E(c)),total:v,cursor:v>p.length?q(p[p.length-1]?.encodedKey):null}}catch(n){return i.error("Error listing kv entries",n),{items:[],total:0,cursor:null}}}async set(e,r,n){try{const o=I({key:e,value:r,ttlInSeconds:n?.ttlInSeconds});return await this.databaseClient.client.insert(t).values(o).onConflictDoUpdate({target:[t.encodedKey],set:{value:o.value,expiresAt:o.expiresAt,updatedAt:o.updatedAt}}),E(o)}catch(o){return i.error("Error saving kv entry",o),null}}async delete(e){try{const r=l(e);await this.databaseClient.client.delete(t).where(K(t.encodedKey,r))}catch(r){i.error("Error deleting kv entry by key",r)}}async clearExpired(){try{await this.databaseClient.client.delete(t).where(f(s`datetime(${t.expiresAt})`,s`datetime('now')`))}catch(e){i.error("Error clearing expired kv entries",e)}}async transaction(e){return this.databaseClient.transactionsManager.transaction(async()=>e({get:async n=>this.get(n),getMany:async n=>this.getMany(n),set:async(n,o,a)=>this.set(n,o,a),delete:async n=>this.delete(n)}))}async getTotalStoredEntryBytes(){try{return await this.getTableSizeInBytes("kv")}catch(e){return i.error("Error getting total kv stored entry bytes",e),0}}async getStoredEntrySizeByEncodedKey(e){try{const r=w(b(t.expiresAt),u(s`datetime(${t.expiresAt})`,s`datetime('now')`)),n=await this.databaseClient.client.select({bytes:s`COALESCE(LENGTH(CAST(${t.encodedKey} AS BLOB)) + LENGTH(CAST(${t.value} AS BLOB)), 0)`}).from(t).where(h(K(t.encodedKey,e),r)).get();return Number(n?.bytes??0)}catch(r){return i.error("Error getting kv entry size by encoded key",r),0}}}export{z as KV_KEY_END_BOUNDARY,y as KvRepository};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { KvValue, KvKey, KvListEntry, KvSetOptions, KvListOptions, KvListResponse, KvListSelector, KvTransaction } from '@redocly/config';
|
|
2
2
|
import type { ServiceInstanceOptions } from '../../../providers/database/types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { KvRepository } from '../repositories/kv-repository.js';
|
|
4
4
|
export declare class KvService {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(repository: KvRepository | null);
|
|
7
7
|
static getInstance(options: ServiceInstanceOptions): Promise<KvService>;
|
|
8
8
|
/**
|
|
9
9
|
* Get a kv entry by key
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PLAN_GATES_DEFAULTS as
|
|
1
|
+
import{PLAN_GATES_DEFAULTS as u}from"../../../constants/entitlements.js";import{EntitlementsProvider as d}from"../../../entitlements/entitlements-provider.js";import{StorageLimitValidator as h}from"../../../providers/database/utils/storage-limit-validator.js";import{KvRepository as m}from"../repositories/kv-repository.js";import{encodeKvKey as g}from"../mappers/create-kv-db-record.js";import{kvKeyValidator as a,kvListOptionsValidator as f,kvListSelectorValidator as w,kvSetOptionsValidator as l}from"../schemas/kv-schemas.js";const E=100*1024*1024;class o{static#e;#t;#s;constructor(t){this.#t=t,this.#s=new h}static async#a(t){const e=await m.getInstance(t),s=new o(e);o.#e=s}static async getInstance(t){return o.#e||await o.#a(t),o.#e}async get(t){const e=a.parse(t);return await this.#t?.sync(),await this.#t?.get(e)??null}async getMany(t){if(t.length===0)return[];const e=t.map(s=>a.parse(s));return await this.#t?.sync(),await this.#t?.getMany(e)??[]}async list(t,e){const s=w.parse(t),r=f.parse(e??{});return await this.#t?.sync(),await this.#t?.list(s,r)??{items:[],total:0,cursor:null}}async set(t,e,s){const r=a.parse(t),n=l.parse(s??{});this.#r(e);const i=JSON.stringify(e);return this.#n(i),await this.#i(r,i),await this.#t?.set(r,e,n)??null}async delete(t){const e=a.parse(t);return this.#t?.delete(e)}async clearExpired(){return await this.#t?.clearExpired()}async transaction(t){if(!this.#t)throw new Error("Remote repository not available for transactions");return await this.#t.sync(),this.#t.transaction(async e=>t({get:async r=>{const n=a.parse(r);return e.get(n)},getMany:async r=>{const n=r.map(i=>a.parse(i));return e.getMany(n)},set:async(r,n,i)=>{const c=a.parse(r),p=l.parse(i??{});this.#r(n);const y=JSON.stringify(n);return this.#n(y),await this.#i(c,y),e.set(c,n,p)},delete:async r=>{const n=a.parse(r);return e.delete(n)}}))}#r(t){try{JSON.stringify(t)}catch(e){const s=e instanceof Error?e.message:"Unknown error";throw new Error(`Value is not JSON serializable: ${s}`)}}#n(t){const s=Buffer.byteLength(t,"utf8");if(s>1048576){const r=(s/1024).toFixed(2);throw new Error(`Value size (${r} KB) exceeds the maximum allowed size of 1 MB (1024 KB)`)}}async#i(t,e){if(!this.#t)return;const s=g(t),r=await this.#t.getTotalStoredEntryBytes(),n=Math.max(0,r-E),i=await this.#t.getStoredEntrySizeByEncodedKey(s),c=Buffer.byteLength(s,"utf8")+Buffer.byteLength(e,"utf8");this.#s.validate({storageLimitGb:this.#o(),currentTotalBytes:n,existingEntryBytes:i,incomingEntryBytes:c,errorMessagePrefix:"KV storage limit"})}#o(){const t=d.instance().entitlements?.kvStorageLimit;return typeof t=="number"&&t>0?t:u.pro.kvStorageLimit}}export{o as KvService};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PublishCatalogEntitiesParams } from './types';
|
|
2
|
+
export declare class CatalogEntitiesPublisher {
|
|
3
|
+
#private;
|
|
4
|
+
static publishFromLocalToRemote(params: PublishCatalogEntitiesParams): Promise<boolean>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=catalog-entities-publisher.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{and as h,eq as g,inArray as R,isNotNull as A,isNull as E,ne as k,or as I,sql as S}from"drizzle-orm";import{ulid as $}from"ulid";import{logger as F}from"../../../tools/notifiers/logger.js";import{DatabaseConnectionFactory as v}from"../../../providers/database/database-connection-factory.js";import{entitiesAttributesTable as m}from"../../../providers/database/databases/sqlite-db/schemas/entities-attributes-table.js";import{entitiesRelationsTable as u}from"../../../providers/database/databases/sqlite-db/schemas/entities-relations-table.js";import{entitiesTable as d}from"../../../providers/database/databases/sqlite-db/schemas/entities-table.js";import{BATCH_TRANSIENT_RETRY as L,withTransientErrorRetry as O}from"../../../providers/database/transient-sqld-error.js";import{envConfig as D}from"../../../config/env-config.js";import{ATTRIBUTES_UPSERT_SET as U,DEFAULT_CHUNK_SIZE as B,ENTITIES_UPSERT_SET as K,MAX_BATCH_PAYLOAD_BYTES as M,MAX_LOGGED_DB_ERROR_LENGTH as b,MIN_RETRYABLE_BATCH_SIZE as H,RELATIONS_UPSERT_SET as x}from"./consts.js";class c{static async publishFromLocalToRemote(e){if(D.isDevelopMode||!D.isProductionEnv)return!1;const{baseDbDir:t,chunkSize:s=B,changedSourceFiles:o=[],removedSourceFiles:n=[]}=e,a=$(),[i,r]=await Promise.all([v.create({baseDbDir:t,databaseType:"local"}),v.create({baseDbDir:t,databaseType:"remote"})]);if(!i||!r)return F.warn("Skipping entities remote sync: local or remote connection is unavailable"),!1;const l="changedSourceFiles"in e||"removedSourceFiles"in e,p=Array.from(new Set([...o,...n]));if(l&&p.length===0)return!0;const y=l?o.length?o:"none":void 0;try{return await c.#i({runId:a,chunkSize:s,localConnection:i,remoteConnection:r,sourceFilesFilter:y}),await c.#c({runId:a,chunkSize:s,localConnection:i,remoteConnection:r,sourceFilesFilter:y}),await c.#a({chunkSize:s,localConnection:i,remoteConnection:r,sourceFilesFilter:y}),await c.#l({runId:a,remoteConnection:r,sourceFilesFilter:l?p:void 0}),!0}catch(f){const w=c.#o(f);throw F.error(`[CatalogEntitiesPublisher.publishFromLocalToRemote] Failed runId=${a}. ${w}`),new Error(`[CatalogEntitiesPublisher.publishFromLocalToRemote] Failed runId=${a}. ${w}`,{cause:f instanceof Error?f:void 0})}}static#i(e){const{runId:t,localConnection:s,remoteConnection:o,sourceFilesFilter:n,chunkSize:a}=e,i=c.#e(n);return c.#t({chunkSize:a,sourceFilesFilter:n,selectRows:(r,l)=>s.client.client.select().from(d).where(h(g(d.source,"file"),i?R(d.sourceFile,i):void 0)).limit(l).offset(r).all(),decorateRow:r=>({...r,lastSeenRunId:t}),runUpsert:async r=>{await o.client.client.insert(d).values(r).onConflictDoUpdate({target:[d.key,d.source,d.revision,d.version],set:K}).run()},describeSkippedRow:r=>`entity key=${String(r.key)}`})}static#c(e){const{runId:t,localConnection:s,remoteConnection:o,sourceFilesFilter:n,chunkSize:a}=e,i=c.#e(n);return c.#t({chunkSize:a,sourceFilesFilter:n,selectRows:(r,l)=>s.client.client.select().from(u).where(h(A(u.sourceFile),i?R(u.sourceFile,i):void 0)).limit(l).offset(r).all(),decorateRow:r=>({...r,lastSeenRunId:t}),runUpsert:async r=>{await o.client.client.insert(u).values(r).onConflictDoUpdate({target:[u.sourceKey,u.targetKey,u.sourceVersion,u.targetVersion,u.sourceRevision,u.targetRevision,u.sourceToTargetRelation],set:x}).run()},describeSkippedRow:r=>{const l=r;return`relation sourceKey=${String(l.sourceKey)} targetKey=${String(l.targetKey)}`}})}static#a(e){const{localConnection:t,remoteConnection:s,sourceFilesFilter:o,chunkSize:n}=e,a=c.#e(o);return c.#t({chunkSize:n,sourceFilesFilter:o,selectRows:(i,r)=>t.client.client.select().from(m).where(a?S`EXISTS (
|
|
2
|
+
SELECT 1
|
|
3
|
+
FROM entities e
|
|
4
|
+
WHERE e.key = ${m.entityKey}
|
|
5
|
+
AND e.source = 'file'
|
|
6
|
+
AND e.source_file IN (${S.join(a.map(l=>S`${l}`),S`, `)})
|
|
7
|
+
)`:void 0).limit(r).offset(i).all(),runUpsert:async i=>{await s.client.client.insert(m).values(i).onConflictDoUpdate({target:[m.entityKey],set:U}).run()}})}static#e(e){return Array.isArray(e)&&e.length>0?e:void 0}static async#t({chunkSize:e,sourceFilesFilter:t,selectRows:s,decorateRow:o,runUpsert:n,describeSkippedRow:a}){if(t==="none")return{upserted:0,skipped:0};let i=0,r=0,l=0;for(;;){const p=await s(i,e);if(!p.length)return{upserted:r,skipped:l};const y=o?p.map(f=>o(f)):p;for(const f of c.#u(y,e,M)){const w=await c.#n({rows:f,runOperation:n,shouldSkipIsolatedRow:a?(N,T)=>c.#f(T)?(F.warn(`[CatalogEntitiesPublisher.publishFromLocalToRemote] Skipping ${a(N)} due to remote insert error: ${c.#o(T)}`),!0):!1:void 0});r+=w.upserted,l+=w.skipped}i+=e}}static async#l({runId:e,remoteConnection:t,sourceFilesFilter:s}){const o=t.client.client,n=s?.length?s:void 0,a=await c.#r(()=>o.delete(u).where(h(A(u.sourceFile),n?R(u.sourceFile,n):void 0,I(E(u.lastSeenRunId),k(u.lastSeenRunId,e)))).run()),i=await c.#r(()=>o.delete(d).where(h(g(d.source,"file"),n?R(d.sourceFile,n):void 0,I(E(d.lastSeenRunId),k(d.lastSeenRunId,e)))).run()),r=await c.#r(()=>o.delete(m).where(S`NOT EXISTS (
|
|
8
|
+
SELECT 1
|
|
9
|
+
FROM entities e
|
|
10
|
+
WHERE e.key = ${m.entityKey}
|
|
11
|
+
AND COALESCE(e.is_deleted, 0) = 0
|
|
12
|
+
)`).run());return{staleEntitiesDeleted:i,staleRelationsDeleted:a,orphanAttributesDeleted:r}}static async#r(e){const t=await c.#s(e);return Number(t.rowsAffected??0)}static#u(e,t,s){const o=[];let n=[],a=0;for(const i of e){const r=c.#d(i);n.length>0&&(n.length>=t||a+r>s)&&(o.push(n),n=[],a=0),n.push(i),a+=r}return n.length>0&&o.push(n),o}static#d(e){try{return JSON.stringify(e).length}catch{return 0}}static async#n({rows:e,runOperation:t,shouldSkipIsolatedRow:s}){try{return await c.#s(()=>t(e)),{upserted:e.length,skipped:0}}catch(o){if(e.length<H){if(!s)throw o;if(await s(e[0],o))return{upserted:0,skipped:1};throw o}const n=Math.floor(e.length/2),a=await c.#n({rows:e.slice(0,n),runOperation:t,shouldSkipIsolatedRow:s}),i=await c.#n({rows:e.slice(n),runOperation:t,shouldSkipIsolatedRow:s});return{upserted:a.upserted+i.upserted,skipped:a.skipped+i.skipped}}}static#f(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("code: 11")||t.includes("too many sql variables")||t.includes("string or blob too big")||t.includes("statement too long")||t.includes("request body too large")||t.includes("payload too large")||t.includes("body too large")||t.includes("resource exhausted")}static#o(e){const s=(e instanceof Error?e.message:typeof e=="string"?e:JSON.stringify(e)).split(" params:")[0],n=c.#p(s).replace(/\s+/g," ").trim();return n.length>b?`${n.slice(0,b)}...`:n}static#p(e){const t="Failed query:",s=e.indexOf(t);if(s===-1)return e;const o=e.slice(0,s).trim();return o?`${o}. ${t} <omitted for brevity>`:`${t} <omitted for brevity>`}static#s(e){return O(e,L)}}export{c as CatalogEntitiesPublisher};
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
import type { PaginationParams } from '../../../providers/database/pagination/schemas.js';
|
|
2
|
-
import type { EntityReadModelSchema, EntityRelationReadModelSchema } from '../schemas/read-model-schemas.js';
|
|
3
|
-
import type { CatalogFiltersParams } from './repositories/
|
|
4
|
-
import type { BffCatalogEntity, BffCatalogEntityList, BffCatalogRelatedEntityList } from '@redocly/theme/core/types';
|
|
2
|
+
import type { EntityReadModelSchema, EntitySource, EntityRelationReadModelSchema } from '../schemas/read-model-schemas.js';
|
|
3
|
+
import type { CatalogFiltersParams, CreateEntityParams } from './repositories/types.js';
|
|
4
|
+
import type { BffCatalogEntity, BffCatalogEntityList, BffCatalogRelatedEntityList, SidebarConnectedEntity } from '@redocly/theme/core/types';
|
|
5
5
|
import type { ServiceInstanceOptions } from '../../../providers/database/types.js';
|
|
6
6
|
import type { TransactionsManager } from '../../../providers/database/transactions-manager.js';
|
|
7
|
-
import type { CreateEntityParams } from './repositories/local/catalog-entities-local-write-repository.js';
|
|
8
7
|
import type { Filter } from '../../../providers/database/pagination/types.js';
|
|
9
8
|
import type { ScorecardsStatus } from '../entities/types.js';
|
|
10
9
|
import type { GetEntityByIdParams } from '../types/params.js';
|
|
10
|
+
import type { BulkSyncResult } from './types.js';
|
|
11
11
|
import { type EntityDtoSchema, type EntityRelationDtoSchema } from '../schemas/dto-schemas.js';
|
|
12
|
-
import {
|
|
13
|
-
import { CatalogEntitiesRemoteRepository } from './repositories/remote/catalog-entities-remote-repository.js';
|
|
12
|
+
import { CatalogEntitiesRepository } from './repositories/catalog-entities-repository.js';
|
|
14
13
|
import { type ListResponseResult } from '../../../web-server/utils/prepare-list-response.js';
|
|
15
|
-
type BulkSyncResult<T> = Array<{
|
|
16
|
-
status: 'ok';
|
|
17
|
-
resource: T | null;
|
|
18
|
-
} | {
|
|
19
|
-
key: string;
|
|
20
|
-
status: 'error';
|
|
21
|
-
error: string;
|
|
22
|
-
}>;
|
|
23
14
|
export declare class CatalogEntitiesService {
|
|
24
15
|
#private;
|
|
25
|
-
constructor(
|
|
16
|
+
constructor(catalogEntitiesRepository: CatalogEntitiesRepository, options?: ServiceInstanceOptions);
|
|
26
17
|
static getInstance(options: ServiceInstanceOptions): Promise<CatalogEntitiesService>;
|
|
18
|
+
sync(): Promise<void>;
|
|
27
19
|
transaction<T>(...args: Parameters<TransactionsManager['transaction']>): Promise<T>;
|
|
28
|
-
remoteTransaction<T>(operation: () => Promise<T>): Promise<T>;
|
|
29
20
|
getEntities({ paginationParams, rbacTeams, excludedTypes, excludedEntities, }: {
|
|
30
21
|
paginationParams: PaginationParams;
|
|
31
22
|
rbacTeams?: string[];
|
|
@@ -38,48 +29,9 @@ export declare class CatalogEntitiesService {
|
|
|
38
29
|
type: string;
|
|
39
30
|
count: number;
|
|
40
31
|
}[]>;
|
|
41
|
-
getCatalogFilters(params: CatalogFiltersParams): Promise<Record<string, import("./repositories/
|
|
42
|
-
createEntity(entity: EntityDtoSchema): Promise<EntityReadModelSchema | null>;
|
|
43
|
-
createEntities(entities: EntityDtoSchema[]): Promise<BulkSyncResult<EntityReadModelSchema>>;
|
|
44
|
-
getEntitySources(): Record<string, import("@redocly/theme").SidebarConnectedEntity>;
|
|
45
|
-
/**
|
|
46
|
-
* Use only internally, everything that is created via API should be created in the remote database.
|
|
47
|
-
* @param entity - The entity to create.
|
|
48
|
-
*/
|
|
49
|
-
createEntityInLocalDatabase(createEntityParams: CreateEntityParams): Promise<import("./repositories/local/catalog-entities-local-write-repository.js").CreateEntityResult>;
|
|
50
|
-
/**
|
|
51
|
-
* Use only internally, everything that is created via API should be created in the remote database.
|
|
52
|
-
* @param entities - The entities to create.
|
|
53
|
-
*/
|
|
54
|
-
createEntitiesInLocalDatabase(createEntitiesParams: CreateEntityParams[]): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Use only internally, everything that is created via API should be created in the remote database.
|
|
57
|
-
* @param relation - The entity to create.
|
|
58
|
-
*/
|
|
59
|
-
createEntityRelationInLocalDatabase(relation: EntityRelationDtoSchema): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Use only internally, everything that is created via API should be created in the remote database.
|
|
62
|
-
* @param relations - The entity to create.
|
|
63
|
-
*/
|
|
64
|
-
createEntityRelationsInLocalDatabase(relations: EntityRelationDtoSchema[]): Promise<void>;
|
|
65
|
-
updateEntity(incomingEntity: Partial<EntityDtoSchema>, entityToBeUpdated: EntityReadModelSchema): Promise<EntityReadModelSchema | null | undefined>;
|
|
66
|
-
deleteEntity(entityToBeRemoved: EntityReadModelSchema): Promise<string | null | undefined>;
|
|
67
|
-
/**
|
|
68
|
-
* Use only internally, everything that is created via API should be created in the remote database.
|
|
69
|
-
* @param filter - The conditions used to select which entities to delete.
|
|
70
|
-
*/
|
|
71
|
-
deleteEntitiesInLocalDatabase(filter: Filter): Promise<void>;
|
|
32
|
+
getCatalogFilters(params: CatalogFiltersParams): Promise<Record<string, import("./repositories/types.js").FilterOption[]>>;
|
|
72
33
|
getEntityRelationById(id: string): Promise<EntityRelationReadModelSchema | null>;
|
|
73
34
|
getEntitiesRelations(paginationParams?: PaginationParams): Promise<ListResponseResult<EntityRelationReadModelSchema>>;
|
|
74
|
-
createEntityRelation(relation: EntityRelationDtoSchema): Promise<EntityRelationReadModelSchema | null | undefined>;
|
|
75
|
-
createEntitiesRelations(entities: EntityRelationDtoSchema[]): Promise<BulkSyncResult<EntityRelationReadModelSchema>>;
|
|
76
|
-
updateEntityRelation(incomingRelationData: Partial<EntityRelationDtoSchema>, relationToBeUpdated: EntityRelationReadModelSchema): Promise<EntityRelationReadModelSchema | null | undefined>;
|
|
77
|
-
deleteEntityRelation(id: string): Promise<string | null>;
|
|
78
|
-
/**
|
|
79
|
-
* Use only internally, everything that is created via API should be created in the remote database.
|
|
80
|
-
* @param filter - The conditions used to select which entity relations to delete.
|
|
81
|
-
*/
|
|
82
|
-
deleteEntityRelationsInLocalDatabase(filter: Filter): Promise<void>;
|
|
83
35
|
getEntitiesWithRelations({ paginationParams, rbacTeams, excludedTypes, excludedEntities, }: {
|
|
84
36
|
paginationParams: PaginationParams;
|
|
85
37
|
rbacTeams?: string[];
|
|
@@ -103,22 +55,33 @@ export declare class CatalogEntitiesService {
|
|
|
103
55
|
excludedTypes?: string[];
|
|
104
56
|
excludedEntities?: string[];
|
|
105
57
|
}): Promise<BffCatalogRelatedEntityList>;
|
|
106
|
-
|
|
58
|
+
listEntityRevisions(entityKey: string, version?: string | null): Promise<import("../schemas/read-model-schemas.js").EntityRevisionSummary[]>;
|
|
59
|
+
getOutdatedEntities(filter?: Filter): Promise<EntityReadModelSchema[]>;
|
|
60
|
+
getEntitiesCount(source: EntitySource, addedEntities?: EntityReadModelSchema[], entitiesRemovedCount?: number): Promise<{
|
|
61
|
+
total: number;
|
|
62
|
+
}>;
|
|
63
|
+
createEntity(createEntityParams: CreateEntityParams): Promise<EntityReadModelSchema | null>;
|
|
64
|
+
createEntities(entities: EntityDtoSchema[], source: EntitySource): Promise<BulkSyncResult<EntityReadModelSchema>>;
|
|
65
|
+
getEntitySources(): Record<string, SidebarConnectedEntity>;
|
|
66
|
+
/**
|
|
67
|
+
* Use only internally, everything that is created via API should be created in the remote database.
|
|
68
|
+
* @param relations - The entity to create.
|
|
69
|
+
*/
|
|
70
|
+
createEntityRelations(relations: EntityRelationDtoSchema[]): Promise<void>;
|
|
71
|
+
updateEntity(incomingEntity: Partial<EntityDtoSchema>, entityToBeUpdated: EntityReadModelSchema): Promise<EntityReadModelSchema | null>;
|
|
72
|
+
deleteEntity(entityToBeRemoved: EntityReadModelSchema): Promise<string | null>;
|
|
73
|
+
deleteEntities(filter: Filter): Promise<void>;
|
|
74
|
+
createEntityRelation(relation: EntityRelationDtoSchema): Promise<EntityRelationReadModelSchema | null>;
|
|
75
|
+
createEntitiesRelations(entities: EntityRelationDtoSchema[]): Promise<BulkSyncResult<EntityRelationReadModelSchema>>;
|
|
76
|
+
updateEntityRelation(incomingRelationData: Partial<EntityRelationDtoSchema>, relationToBeUpdated: EntityRelationReadModelSchema): Promise<EntityRelationReadModelSchema | null>;
|
|
77
|
+
deleteEntityRelation(id: string): Promise<string | null>;
|
|
78
|
+
softDeleteEntitiesWithRelations({ filter, revision, fileHash, }: {
|
|
107
79
|
filter: Filter;
|
|
108
80
|
revision: string;
|
|
109
81
|
fileHash: string;
|
|
110
82
|
}): Promise<void>;
|
|
111
|
-
listEntityRevisions(entityKey: string, version?: string | null): Promise<import("../schemas/read-model-schemas.js").EntityRevisionSummary[]>;
|
|
112
83
|
updateEntityScorecardsStatus(entityId: string, status: ScorecardsStatus): Promise<boolean>;
|
|
113
84
|
updateEntityScorecardsStatusIfCalculating(entityId: string, status: Extract<ScorecardsStatus, 'UP_TO_DATE' | 'OUTDATED'>): Promise<boolean>;
|
|
114
|
-
getOutdatedEntities(filter?: Filter): Promise<EntityReadModelSchema[]>;
|
|
115
85
|
setEntitiesAsOutdated(filter: Filter): Promise<void>;
|
|
116
|
-
getEntitiesCount(source: 'file' | 'remote', addedEntities?: EntityReadModelSchema[], entitiesRemovedCount?: number): Promise<{
|
|
117
|
-
total: number;
|
|
118
|
-
}>;
|
|
119
|
-
getDuplicatedEntitiesCount(addedEntities?: EntityReadModelSchema[], removedEntities?: EntityReadModelSchema[]): Promise<{
|
|
120
|
-
total: number;
|
|
121
|
-
}>;
|
|
122
86
|
}
|
|
123
|
-
export {};
|
|
124
87
|
//# sourceMappingURL=catalog-entities-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{promiseMapLimit as
|
|
1
|
+
import{promiseMapLimit as h}from"../../../utils/async/promise-map-limit.js";import{logger as g}from"../../../tools/notifiers/logger.js";import{envConfig as y}from"../../../config/env-config.js";import{HTTP_TRANSIENT_RETRY as l,describeTransientError as m,isTransientSqldError as w,withTransientErrorRetry as d}from"../../../providers/database/transient-sqld-error.js";import{CatalogEntitiesRepository as E}from"./repositories/catalog-entities-repository.js";import{prepareListResponse as u}from"../../../web-server/utils/prepare-list-response.js";import{ENTITY_RELATION_FROM_DATABASE as R}from"./mappers/field-transformations.js";import{hasOptionsChanged as W}from"../utils/has-options-changed.js";const p=15;class s{static#s;static#n;#i;#r;#a={};constructor(t,e){this.#i=t,this.#r=e?.databaseType==="local"}static async#c(t){const e=await E.getInstance(t),i=new s(e,t);return s.#s=i,s.#n=t,i}static async getInstance(t){const e={...t,removeExisting:t.removeExisting??!1};return s.#s&&!W(s.#n,e)?s.#s:s.#c(e)}async sync(){await this.#o()}async transaction(...t){return this.#i.transactionsManager.transaction(...t)}async getEntities({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n}){return this.#e(async r=>{const{items:a,total:o,hasMore:c}=await r.entitiesRead.getEntities({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n});return u({data:a,params:t,totalCount:o,hasMore:c})})}async getEntityById(t,e){return this.#e(async i=>await i.entitiesRead.getEntityById(t,e)??null)}async getEntityKeysAndVersionsBySourceFile(t){return this.#e(e=>e.entitiesRead.getEntityKeysAndVersionsBySourceFile(t))}async getEntitiesCountByTypes(){return this.#e(t=>t.entitiesRead.getEntitiesCountByTypes())}async getCatalogFilters(t){return this.#e(e=>e.filters.getCatalogFilters(t))}async getEntityRelationById(t){return this.#e(async e=>await e.relationsRead.getEntityRelationById(t)??null)}async getEntitiesRelations(t={}){return this.#e(async e=>{const{items:i,total:n,hasMore:r}=await e.relationsRead.getEntitiesRelations(t);return u({data:i,params:t,totalCount:n,nameTransformationsFromDatabase:R,hasMore:r})})}async getEntitiesWithRelations({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n}){return this.#e(async r=>{const{items:a,total:o,hasMore:c}=await r.bffEntitiesRead.getEntitiesWithRelations({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n});return u({data:a,params:t,totalCount:o,hasMore:c})})}async getEntityWithRelationsByKey({entityKey:t,filter:e,rbacTeams:i,excludedTypes:n,excludedEntities:r}){return this.#e(a=>a.bffEntitiesRead.getEntityWithRelationsByKey({entityKey:t,filter:e,rbacTeams:i,excludedTypes:n,excludedEntities:r}))}async getRelatedEntities({entityKey:t,paginationParams:e,rbacTeams:i,excludedTypes:n,excludedEntities:r}){return this.#e(async a=>{const{items:o,total:c,hasMore:f}=await a.relationsRead.getRelatedEntities({key:t,paginationParams:e,rbacTeams:i,excludedTypes:n,excludedEntities:r});return u({data:o,params:e,totalCount:c,nameTransformationsFromDatabase:R,hasMore:f})})}async listEntityRevisions(t,e){return this.#e(i=>i.revisions.listEntityRevisions(t,e))}async getOutdatedEntities(t){return this.#e(e=>e.entitiesRead.getOutdatedEntities(t))}async getEntitiesCount(t,e,i){return this.#e(n=>n.entitiesRead.getEntitiesCount(t,e,i))}async createEntity(t){if(y.isDevelopMode&&t.source==="remote")throw new Error("API based entity creation is not supported in the develop mode");return t.isRootEntity&&t.sourceFile&&(this.#a[t.sourceFile]={key:t.entity.key,version:t.entity.version??void 0}),this.#t(e=>e.entitiesWrite.createEntity(t))}async createEntities(t,e){if(y.isDevelopMode&&e==="remote")throw new Error("API based entity creation is not supported in the develop mode");return await h(t,p,async i=>this.#t(n=>n.entitiesWrite.createEntity({entity:i,source:e})).then(n=>({status:"ok",resource:n})).catch(n=>({key:i.key,status:"error",error:n})))}getEntitySources(){return this.#a}async createEntityRelations(t){await this.#t(e=>e.relationsWrite.createEntityRelations(t))}async updateEntity(t,e){if(y.isDevelopMode&&e.source==="remote")throw new Error("Entity update is not supported in the develop mode");return this.#t(i=>i.transactionsManager.transaction(()=>i.entitiesWrite.updateEntity(t,e)))}async deleteEntity(t){if(y.isDevelopMode&&t.source==="remote")throw new Error("Entity deletion is not supported in the develop mode");return this.#t(e=>e.entitiesWrite.deleteEntity(t))}async deleteEntities(t){await this.#t(async e=>{await e.entitiesWrite.deleteEntities(t)})}async createEntityRelation(t){return this.#t(e=>e.relationsWrite.createEntityRelation(t))}async createEntitiesRelations(t){return await h(t,p,async e=>this.#t(i=>i.relationsWrite.createEntityRelation(e)).then(i=>({status:"ok",resource:i})).catch(i=>({key:e.sourceKey,status:"error",error:i})))}async updateEntityRelation(t,e){const i={...e,...t,type:t.type??e.type};return this.#t(n=>n.relationsWrite.createEntityRelation(i))}async deleteEntityRelation(t){return this.#t(e=>e.relationsWrite.deleteEntityRelation(t))}async softDeleteEntitiesWithRelations({filter:t,revision:e,fileHash:i}){return this.#t(n=>n.entitiesWrite.softDeleteEntitiesWithRelations({filter:t,revision:e,fileHash:i}))}async updateEntityScorecardsStatus(t,e){return this.#t(i=>i.entitiesWrite.updateEntityScorecardsStatus(t,e))}async updateEntityScorecardsStatusIfCalculating(t,e){return this.#t(i=>i.entitiesWrite.updateEntityScorecardsStatusIfCalculating(t,e))}async setEntitiesAsOutdated(t){await this.#t(async e=>{await e.entitiesWrite.setEntitiesAsOutdated(t)})}async#o(){if(this.#r)return;const t=this.#i;await d(()=>t.sync(),l)}async#e(t){return await this.#o(),d(()=>t(this.#i),l)}async#t(t){return this.#r?t(this.#i):d(async()=>{try{return await t(this.#i)}catch(e){throw await this.#y(e),e}},l)}async#y(t){if(!(!w(t)||!s.#n))try{this.#i=await E.recreateInstance(s.#n)}catch(e){g.warn(`Reconnect attempt failed, letting original error propagate: ${m(e)}`)}}}export{s as CatalogEntitiesService};
|