@redocly/revel-reef 0.124.0-next.23 → 0.124.0-next.25
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 +31 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/server/plugins/api-functions/api-functions-handler-worker.d.ts.map +1 -1
- package/dist/server/plugins/api-functions/api-functions-handler-worker.js +1 -1
- package/dist/server/plugins/api-functions/api-functions-handler-worker.js.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/catalog-entities-service.d.ts +17 -2
- package/dist/server/plugins/catalog-entities/databases/catalog-entities-service.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/catalog-entities-service.js +1 -1
- package/dist/server/plugins/catalog-entities/databases/catalog-entities-service.js.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/database/client.d.ts +12 -2
- package/dist/server/plugins/catalog-entities/databases/database/client.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/database/client.js +1 -1
- package/dist/server/plugins/catalog-entities/databases/database/client.js.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/database/transactions-manager.d.ts +12 -0
- package/dist/server/plugins/catalog-entities/databases/database/transactions-manager.d.ts.map +1 -0
- package/dist/server/plugins/catalog-entities/databases/database/transactions-manager.js +1 -0
- package/dist/server/plugins/catalog-entities/databases/database/transactions-manager.js.map +1 -0
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.d.ts +19 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.js.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.d.ts +3 -5
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.js.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.d.ts +1 -0
- package/dist/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.js.map +1 -1
- package/dist/server/plugins/catalog-entities/entities/validate-entity.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/entities/validate-entity.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/entities/validate-entity.js +1 -1
- package/dist/server/plugins/catalog-entities/entities/validate-entity.js.map +1 -1
- package/dist/server/plugins/catalog-entities/extensions/entity-batch-processor.d.ts +24 -0
- package/dist/server/plugins/catalog-entities/extensions/entity-batch-processor.d.ts.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/entity-batch-processor.js +1 -0
- package/dist/server/plugins/catalog-entities/extensions/entity-batch-processor.js.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/{api-description/extractors → extractors/api-description}/asyncapi-entities-extractor.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.js +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.js.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/{api-description/extractors → extractors/api-description}/base.d.ts +4 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.d.ts.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/{api-description/extractors → extractors/api-description}/openapi-entities-extractor.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/base.d.ts +4 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/base.d.ts.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/base.js +0 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/base.js.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.d.ts +17 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.d.ts.map +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.js +1 -0
- package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.js.map +1 -0
- package/dist/server/plugins/catalog-entities/{merge-catalog-config.d.ts → get-complete-catalog-config.d.ts} +2 -2
- package/dist/server/plugins/catalog-entities/get-complete-catalog-config.d.ts.map +1 -0
- package/dist/server/plugins/catalog-entities/get-complete-catalog-config.js +1 -0
- package/dist/server/plugins/catalog-entities/get-complete-catalog-config.js.map +1 -0
- package/dist/server/plugins/catalog-entities/plugin.d.ts.map +1 -1
- package/dist/server/plugins/catalog-entities/plugin.js +1 -1
- package/dist/server/plugins/catalog-entities/plugin.js.map +1 -1
- package/dist/server/plugins/catalog-entities/types.d.ts +1 -0
- package/dist/server/plugins/catalog-entities/types.d.ts.map +1 -1
- package/dist/server/plugins/default-theme/index.d.ts.map +1 -1
- package/dist/server/plugins/default-theme/index.js +1 -1
- package/dist/server/plugins/default-theme/index.js.map +1 -1
- package/dist/server/plugins/default-theme/resolve-products-config.d.ts.map +1 -1
- package/dist/server/plugins/default-theme/resolve-products-config.js +1 -1
- package/dist/server/plugins/default-theme/resolve-products-config.js.map +1 -1
- package/dist/server/plugins/nav-utils.d.ts.map +1 -1
- package/dist/server/plugins/nav-utils.js +1 -1
- package/dist/server/plugins/nav-utils.js.map +1 -1
- package/dist/server/plugins/sidebars/index.d.ts.map +1 -1
- package/dist/server/plugins/sidebars/index.js +3 -3
- package/dist/server/plugins/sidebars/index.js.map +1 -1
- package/dist/server/plugins/sidebars/utils.d.ts +5 -0
- package/dist/server/plugins/sidebars/utils.d.ts.map +1 -1
- package/dist/server/plugins/sidebars/utils.js +1 -1
- package/dist/server/plugins/sidebars/utils.js.map +1 -1
- package/dist/server/telemetry/telemetry.js +1 -1
- package/dist/server/telemetry/telemetry.js.map +1 -1
- package/dist/server/types/plugins/common.d.ts +4 -0
- package/dist/server/types/plugins/common.d.ts.map +1 -1
- package/dist/server/utils/async.d.ts +1 -1
- package/dist/server/utils/async.d.ts.map +1 -1
- package/dist/server/utils/async.js.map +1 -1
- package/dist/server/utils/queue.d.ts +34 -0
- package/dist/server/utils/queue.d.ts.map +1 -0
- package/dist/server/utils/queue.js +1 -0
- package/dist/server/utils/queue.js.map +1 -0
- package/dist/server/utils/reporter/formatter.js +3 -3
- package/dist/server/utils/reporter/formatter.js.map +1 -1
- package/dist/server/utils/reporter/logger.d.ts +1 -0
- package/dist/server/utils/reporter/logger.d.ts.map +1 -1
- package/dist/server/utils/reporter/logger.js +1 -1
- package/dist/server/utils/reporter/logger.js.map +1 -1
- package/dist/server/web-server/routes/catalog/catalog-relations.d.ts.map +1 -1
- package/dist/server/web-server/routes/catalog/catalog-relations.js +1 -1
- package/dist/server/web-server/routes/catalog/catalog-relations.js.map +1 -1
- package/dist/server/web-server/routes/feedback.d.ts +6 -1
- package/dist/server/web-server/routes/feedback.d.ts.map +1 -1
- package/dist/server/web-server/routes/feedback.js +1 -1
- package/dist/server/web-server/routes/feedback.js.map +1 -1
- package/dist/server/web-server/routes/index.js +1 -1
- package/dist/server/web-server/routes/index.js.map +1 -1
- package/dist/shared/l10n/langs/ar.d.ts.map +1 -1
- package/dist/shared/l10n/langs/ar.js +1 -1
- package/dist/shared/l10n/langs/ar.js.map +1 -1
- package/dist/shared/l10n/langs/de.d.ts.map +1 -1
- package/dist/shared/l10n/langs/de.js +1 -1
- package/dist/shared/l10n/langs/de.js.map +1 -1
- package/dist/shared/l10n/langs/en.d.ts.map +1 -1
- package/dist/shared/l10n/langs/en.js +1 -1
- package/dist/shared/l10n/langs/en.js.map +1 -1
- package/dist/shared/l10n/langs/es.d.ts.map +1 -1
- package/dist/shared/l10n/langs/es.js +1 -1
- package/dist/shared/l10n/langs/es.js.map +1 -1
- package/dist/shared/l10n/langs/fr.d.ts.map +1 -1
- package/dist/shared/l10n/langs/fr.js +1 -1
- package/dist/shared/l10n/langs/fr.js.map +1 -1
- package/dist/shared/l10n/langs/hi.d.ts.map +1 -1
- package/dist/shared/l10n/langs/hi.js +1 -1
- package/dist/shared/l10n/langs/hi.js.map +1 -1
- package/dist/shared/l10n/langs/it.d.ts.map +1 -1
- package/dist/shared/l10n/langs/it.js +1 -1
- package/dist/shared/l10n/langs/it.js.map +1 -1
- package/dist/shared/l10n/langs/ja.d.ts.map +1 -1
- package/dist/shared/l10n/langs/ja.js +1 -1
- package/dist/shared/l10n/langs/ja.js.map +1 -1
- package/dist/shared/l10n/langs/ko.d.ts.map +1 -1
- package/dist/shared/l10n/langs/ko.js +1 -1
- package/dist/shared/l10n/langs/ko.js.map +1 -1
- package/dist/shared/l10n/langs/pl.d.ts.map +1 -1
- package/dist/shared/l10n/langs/pl.js +1 -1
- package/dist/shared/l10n/langs/pl.js.map +1 -1
- package/dist/shared/l10n/langs/pt-BR.d.ts.map +1 -1
- package/dist/shared/l10n/langs/pt-BR.js +1 -1
- package/dist/shared/l10n/langs/pt-BR.js.map +1 -1
- package/dist/shared/l10n/langs/pt.d.ts.map +1 -1
- package/dist/shared/l10n/langs/pt.js +1 -1
- package/dist/shared/l10n/langs/pt.js.map +1 -1
- package/dist/shared/l10n/langs/ru.d.ts.map +1 -1
- package/dist/shared/l10n/langs/ru.js +1 -1
- package/dist/shared/l10n/langs/ru.js.map +1 -1
- package/dist/shared/l10n/langs/uk.d.ts.map +1 -1
- package/dist/shared/l10n/langs/uk.js +1 -1
- package/dist/shared/l10n/langs/uk.js.map +1 -1
- package/dist/shared/l10n/langs/zh.d.ts.map +1 -1
- package/dist/shared/l10n/langs/zh.js +1 -1
- package/dist/shared/l10n/langs/zh.js.map +1 -1
- package/package.json +7 -7
- package/dist/server/plugins/catalog-entities/extensions/api-description/extractors/asyncapi-entities-extractor.js +0 -1
- package/dist/server/plugins/catalog-entities/extensions/api-description/extractors/asyncapi-entities-extractor.js.map +0 -1
- package/dist/server/plugins/catalog-entities/extensions/api-description/extractors/base.d.ts.map +0 -1
- package/dist/server/plugins/catalog-entities/extensions/api-description/extractors/base.js +0 -1
- package/dist/server/plugins/catalog-entities/extensions/api-description/extractors/base.js.map +0 -1
- package/dist/server/plugins/catalog-entities/extensions/api-description/extractors/openapi-entities-extractor.js +0 -1
- package/dist/server/plugins/catalog-entities/extensions/api-description/extractors/openapi-entities-extractor.js.map +0 -1
- package/dist/server/plugins/catalog-entities/merge-catalog-config.d.ts.map +0 -1
- package/dist/server/plugins/catalog-entities/merge-catalog-config.js +0 -1
- package/dist/server/plugins/catalog-entities/merge-catalog-config.js.map +0 -1
- /package/dist/server/plugins/catalog-entities/extensions/{api-description/extractors → extractors/api-description}/asyncapi-entities-extractor.d.ts +0 -0
- /package/dist/server/plugins/catalog-entities/extensions/{api-description/extractors → extractors/api-description}/openapi-entities-extractor.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-functions-handler-worker.d.ts","sourceRoot":"","sources":["../../../../../../src/server/plugins/api-functions/api-functions-handler-worker.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAM9D,OAAO,EAAU,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"api-functions-handler-worker.d.ts","sourceRoot":"","sources":["../../../../../../src/server/plugins/api-functions/api-functions-handler-worker.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAM9D,OAAO,EAAU,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,MAAM,WAAW,aAAa;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,wBAAwB,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE;QACH,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,YAAY,CAAC;QACpB,WAAW,EAAE,kBAAkB,CAAC;QAChC,WAAW,EAAE,kBAAkB,CAAC;QAChC,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,WAAW,CAAC;QAClB,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,cAAc,CAAC;KAChC,CAAC;IACF,iBAAiB,EAAE,iBAAiB,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as f from"workerpool";import{Hono as d}from"hono";import{TrieRouter as l}from"hono/router/trie-router";import{importApiRequestHandler as m}from"../../web-server/handle-api-request.js";import{ResponseSizeLimitError as
|
|
1
|
+
import*as f from"workerpool";import{Hono as d}from"hono";import{TrieRouter as l}from"hono/router/trie-router";import{importApiRequestHandler as m}from"../../web-server/handle-api-request.js";import{ResponseSizeLimitError as S}from"./errors.js";import{readStreamWithSizeLimit as g}from"./utils/read-stream-with-size-limit.js";import{enhanceContext as w}from"./utils/enhance-context.js";import{Logger as y}from"../../utils/reporter/logger.js";import{API_FUNCTIONS_REQUEST_HANDLER_ID as p}from"./index.js";async function h(e,r=5){return e.body?await g({stream:e.body,maxSizeMB:r,onSizeExceededErrorHandler:()=>{throw new S(`Response size exceeded limit of ${r}MB`)}}):await e.arrayBuffer()}const n=new y;n.patchConsole();function q(e,r){n.setStickyState(e);const i=r.replace(`${p}:`,"");n.updateContext({apiFunction:i})}async function E(e){q(e.loggerStickyState,e.requestHandlerId);const r=new d({router:new l}),{requestHandlers:i}=await m(e.serverOutDir),s=i[e.requestHandlerId],u=(await s()).default;r.all(e.slug,async t=>{const o=await u(t.req.raw,w(t,e.ctxData),e.staticData);return o instanceof Response?o:typeof o=="string"?t.text(o):t.json(o)}),r.onError((t,o)=>{if(n.error(`[${e.requestHandlerId}] ${t.message} ${t.stack}`),t instanceof SyntaxError)return o.text(t.message,500);throw t});const a=await r.request(e.req.url,e.req),c=await h(a,e.maxResponseSizeMB);return{status:a.status,headers:Object.fromEntries(a.headers.entries()),body:c,loggerStickyState:n.getStickyState()}}f.worker({runHandler:E});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-functions-handler-worker.js","sourceRoot":"","sources":["../../../../../../src/server/plugins/api-functions/api-functions-handler-worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAqB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"api-functions-handler-worker.js","sourceRoot":"","sources":["../../../../../../src/server/plugins/api-functions/api-functions-handler-worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAqB,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AA2B9D,KAAK,UAAU,oBAAoB,CACjC,QAAkB,EAClB,oBAA4B,CAAC;IAE7B,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnB,OAAO,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC;QAC3C,MAAM,EAAE,QAAQ,CAAC,IAAI;QACrB,SAAS,EAAE,iBAAiB;QAC5B,0BAA0B,EAAE,GAAG,EAAE;YAC/B,MAAM,IAAI,sBAAsB,CAAC,mCAAmC,iBAAiB,IAAI,CAAC,CAAC;QAC7F,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAC5B,MAAM,CAAC,YAAY,EAAE,CAAC;AAEtB,SAAS,WAAW,CAAC,iBAAoC,EAAE,gBAAwB;IACjF,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAEzC,MAAM,eAAe,GAAG,gBAAgB,CAAC,O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AK,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7E,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAE1E,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrD,IAAI;QACJ,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE;KAC3C,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,MAAM,CAAC;IAChB,UAAU;CACX,CAAC,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { type EntityDtoSchema, type EntityRelationDtoSchema } from '../schemas/d
|
|
|
5
5
|
import { type EntityFileSchema } from '../schemas/file-schemas.js';
|
|
6
6
|
import { type ListResponseResult } from '../../../web-server/utils/prepare-list-response.js';
|
|
7
7
|
import { RepositoryOptions } from '../types.js';
|
|
8
|
+
import { TransactionsManager } from './database/transactions-manager.js';
|
|
8
9
|
export declare class CatalogEntitiesService {
|
|
9
10
|
private readonly localRepository;
|
|
10
11
|
private readonly remoteRepository?;
|
|
@@ -12,6 +13,7 @@ export declare class CatalogEntitiesService {
|
|
|
12
13
|
private constructor();
|
|
13
14
|
private static initialize;
|
|
14
15
|
static getInstance(options: RepositoryOptions): Promise<CatalogEntitiesService>;
|
|
16
|
+
transaction<T>(...args: Parameters<TransactionsManager['transaction']>): Promise<T>;
|
|
15
17
|
getEntities(paginationParams: PaginationParams): Promise<ListResponseResult<EntityReadModelSchema>>;
|
|
16
18
|
getEntityByKey(key: string): Promise<EntityReadModelSchema | null>;
|
|
17
19
|
createEntity(entity: EntityDtoSchema): Promise<EntityReadModelSchema | null>;
|
|
@@ -22,9 +24,22 @@ export declare class CatalogEntitiesService {
|
|
|
22
24
|
createEntityInLocalDatabase(entity: EntityFileSchema, sourceFile?: string): Promise<void>;
|
|
23
25
|
/**
|
|
24
26
|
* Use only internally, everything that is created via API should be created in the remote database.
|
|
25
|
-
* @param
|
|
27
|
+
* @param entities - The entities to create.
|
|
28
|
+
*/
|
|
29
|
+
createEntitiesInLocalDatabase(entities: {
|
|
30
|
+
entity: EntityFileSchema;
|
|
31
|
+
sourceFile?: string;
|
|
32
|
+
}[]): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Use only internally, everything that is created via API should be created in the remote database.
|
|
35
|
+
* @param relation - The entity to create.
|
|
36
|
+
*/
|
|
37
|
+
createEntityRelationInLocalDatabase(relation: EntityRelationDtoSchema): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Use only internally, everything that is created via API should be created in the remote database.
|
|
40
|
+
* @param relations - The entity to create.
|
|
26
41
|
*/
|
|
27
|
-
|
|
42
|
+
createEntityRelationsInLocalDatabase(relations: EntityRelationDtoSchema[]): Promise<void>;
|
|
28
43
|
updateEntityByKey(key: string, incomingEntity: Record<string, {
|
|
29
44
|
metadata: Record<string, unknown>;
|
|
30
45
|
}>): Promise<EntityReadModelSchema | null | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/databases/catalog-entities-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAIrF,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-entities-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/databases/catalog-entities-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAIrF,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAWzE,qBAAa,sBAAsB;IAI/B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAJpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAyB;IAEhD,OAAO;mBAKc,UAAU;WAmBX,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAs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,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;CAexC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{entityRelationDtoSchema as R}from"../schemas/dto-schemas.js";import{deepMerge as r}from"../../../../shared/jsUtils.js";import{entityFileSchema as
|
|
1
|
+
import{entityRelationDtoSchema as R}from"../schemas/dto-schemas.js";import{deepMerge as r}from"../../../../shared/jsUtils.js";import{entityFileSchema as p}from"../schemas/file-schemas.js";import{CatalogEntitiesLocalRepository as m}from"./repositories/local/catalog-entities-local-repository.js";import{CatalogEntitiesRemoteRepository as E}from"./repositories/remote/catalog-entities-remote-repository.js";import y from"../../../utils/reporter/logger.js";import{prepareListResponse as s}from"../../../web-server/utils/prepare-list-response.js";import{ENTITY_RELATION_FROM_DATABASE as l}from"./mappers/field-transformations.js";import{createValidator as c}from"../utils/ajv-validator.js";const d=c(R,"Entity relation validation failed"),h=c(p,"Entity file validation failed");class n{localRepository;remoteRepository;static instance;constructor(t,e){this.localRepository=t,this.remoteRepository=e}static async initialize(t){const[e,a]=await Promise.all([m.getInstance(t),t.runOnlyLocalDatabase?void 0:E.getInstance(t)]),i=new n(e,a);a&&(process.env.NODE_ENV==="development"&&y.info("Attaching remote database to local database"),await i.localRepository.attachDatabase(a.path)),n.instance=i}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.instance||await n.initialize(t),n.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 s({data:e,params:t,totalCount:a,hasMore:i})}async getEntityByKey(t){return await this.remoteRepository?.sync(),await this.localRepository.getEntityByKey(t)}async createEntity(t){return this.remoteRepository?this.remoteRepository.createEntity(t):(y.warn("No remote database found"),null)}async createEntityInLocalDatabase(t,e){await this.localRepository.createEntity(t,e)}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=r(a,e),o=h(i);return await this.remoteRepository?.updateEntity({...o,id:a.id,createdAt:a.createdAt||""})}async deleteEntityByKey(t){let e=await this.remoteRepository?.deleteEntity(t);return e||(e=await this.localRepository.deleteEntity(t)),e}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 s({data:e,params:t,totalCount:a,nameTransformationsFromDatabase:l,hasMore:i})}async createEntityRelation(t){return this.remoteRepository?.createEntityRelation(t)}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=r(a,e),o=d(i);return this.remoteRepository?.createEntityRelation(o)}async deleteEntityRelation(t){let e=await this.remoteRepository?.deleteEntityRelation(t);return e||(e=await this.localRepository.deleteEntityRelation(t)),e}async getEntitiesWithRelations(t={}){await this.remoteRepository?.sync();const{items:e,total:a,hasMore:i}=await this.localRepository.getEntitiesWithRelations(t);return s({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:o}=await this.localRepository.getRelatedEntities(t,e);return s({data:a,params:e,totalCount:i,nameTransformationsFromDatabase:l,hasMore:o})}}export{n as CatalogEntitiesService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-service.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/databases/catalog-entities-service.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,4BAA4B,CAAC;AACrF,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;
|
|
1
|
+
{"version":3,"file":"catalog-entities-service.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/databases/catalog-entities-service.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,4BAA4B,CAAC;AACrF,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,CAA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,kBAAkB,CAC7E,SAAS,EACT,gBAAgB,CACjB,CAAC;QACF,OAAO,mBAAmB,CAAC;YACzB,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,gBAAgB;YACxB,UAAU,EAAE,KAAK;YACjB,+BAA+B,EAAE,6BAA6B;YAC9D,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { Config } from '@libsql/client';
|
|
1
|
+
import { type Config } from '@libsql/client';
|
|
2
2
|
import { drizzle } from 'drizzle-orm/libsql';
|
|
3
|
+
import { DrizzleTransaction, TransactionsManager } from './transactions-manager.js';
|
|
4
|
+
export type DrizzleClient = ReturnType<typeof drizzle>;
|
|
5
|
+
type DatabaseClientInitOptions = {
|
|
6
|
+
runWithPragmaWalWriteOptimization?: boolean;
|
|
7
|
+
};
|
|
3
8
|
export declare class DatabaseClient {
|
|
4
|
-
readonly
|
|
9
|
+
readonly dbClient: DrizzleClient;
|
|
10
|
+
private readonly txManager;
|
|
5
11
|
constructor(config: Config);
|
|
12
|
+
get transactionsManager(): TransactionsManager;
|
|
13
|
+
get client(): DrizzleClient | DrizzleTransaction;
|
|
14
|
+
static init(config: Config, options?: DatabaseClientInitOptions): Promise<DatabaseClient>;
|
|
6
15
|
migrate(prefix: string): Promise<void>;
|
|
7
16
|
close(): Promise<void>;
|
|
8
17
|
sync(): Promise<import("@libsql/client").Replicated>;
|
|
9
18
|
}
|
|
19
|
+
export {};
|
|
10
20
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../../../src/server/plugins/catalog-entities/databases/database/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../../../src/server/plugins/catalog-entities/databases/database/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI7C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAEvD,KAAK,yBAAyB,GAAG;IAC/B,iCAAiC,CAAC,EAAE,OAAO,CAAC;CAC7C,CAAC;AAEF,qBAAa,cAAc;IACzB,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsB;gBAEpC,MAAM,EAAE,MAAM;IAQ1B,IAAI,mBAAmB,IAAI,mBAAmB,CAE7C;IAED,IAAI,MAAM,IAAI,aAAa,GAAG,kBAAkB,CAE/C;WAEY,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC;IAQzF,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,IAAI;CAGX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createClient as
|
|
1
|
+
import{createClient as r}from"@libsql/client";import{sql as a}from"drizzle-orm";import{drizzle as s}from"drizzle-orm/libsql";import{migrate as o}from"drizzle-orm/libsql/migrator";import{entitiesTable as l,entitiesRelationsTable as c}from"../schemas/index.js";import{TransactionsManager as m}from"./transactions-manager.js";class e{dbClient;txManager;constructor(t){this.dbClient=s(r(t),{schema:{entities:l,entitiesRelations:c}}),this.txManager=new m(this.dbClient)}get transactionsManager(){return this.txManager}get client(){return this.txManager.tx??this.dbClient}static async init(t,n){const i=new e(t);return n?.runWithPragmaWalWriteOptimization&&await i.dbClient.run(a.raw("PRAGMA journal_mode = WAL;")),i}async migrate(t){await o(this.dbClient,{migrationsFolder:t+"/migrations"})}async close(){this.dbClient.$client.close()}async sync(){return this.dbClient.$client.sync()}}export{e as DatabaseClient};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../src/server/plugins/catalog-entities/databases/database/client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../src/server/plugins/catalog-entities/databases/database/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAsB,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAQpF,MAAM,OAAO,cAAc;IAChB,QAAQ,CAAgB;IAChB,SAAS,CAAsB;IAEhD,YAAY,MAAc;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;YAC5C,MAAM,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,sBAAsB,EAAE;SAC/E,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAc,EAAE,OAAmC;QACnE,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,OAAO,EAAE,iCAAiC,EAAE,CAAC;YAC/C,MAAM,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAc;QAC1B,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,gBAAgB,EAAE,MAAM,GAAG,aAAa,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SQLiteTransactionConfig } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
import type { DrizzleClient } from './client';
|
|
3
|
+
export type DrizzleTransaction = Parameters<Parameters<DrizzleClient['transaction']>[0]>[0];
|
|
4
|
+
export declare class TransactionsManager {
|
|
5
|
+
private readonly client;
|
|
6
|
+
private currentTransaction;
|
|
7
|
+
private readonly queue;
|
|
8
|
+
constructor(client: DrizzleClient);
|
|
9
|
+
get tx(): DrizzleTransaction | undefined;
|
|
10
|
+
transaction<T>(operation: () => Promise<T>, behavior?: SQLiteTransactionConfig['behavior']): Promise<T>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=transactions-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions-manager.d.ts","sourceRoot":"","sources":["../../../../../../../../src/server/plugins/catalog-entities/databases/database/transactions-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK9C,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5F,qBAAa,mBAAmB;IAIlB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,kBAAkB,CAAiC;IAC3D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;gBAEpB,MAAM,EAAE,aAAa;IAWlD,IAAI,EAAE,IAAI,kBAAkB,GAAG,SAAS,CAEvC;IAEK,WAAW,CAAC,CAAC,EACjB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,QAAQ,CAAC,EAAE,uBAAuB,CAAC,UAAU,CAAC,GAC7C,OAAO,CAAC,CAAC,CAAC;CAiBd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BatchQueue as e}from"../../../../utils/queue.js";import{promiseMapLimit as a}from"../../../../utils/async.js";class u{client;currentTransaction;queue;constructor(t){this.client=t,this.queue=new e({batchSize:1,batchProcessor:async n=>{await a(n,1,async r=>r.execute())}})}get tx(){return this.currentTransaction}async transaction(t,n){return this.queue.addItem({execute:async()=>{try{return await this.client.transaction(async r=>(this.currentTransaction=r,t()),{behavior:n})}finally{this.currentTransaction=void 0}}})}}export{u as TransactionsManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions-manager.js","sourceRoot":"","sources":["../../../../../../../../src/server/plugins/catalog-entities/databases/database/transactions-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAI7D,MAAM,OAAO,mBAAmB;IAID;IAHrB,kBAAkB,CAAiC;IAC1C,KAAK,CAA2B;IAEjD,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC;YAC1B,SAAS,EAAE,CAAC;YACZ,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;gBAC9B,MAAM,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;oBAC7C,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;gBACxB,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,WAAW,CACf,SAA2B,EAC3B,QAA8C;QAE9C,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YACxB,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,IAAI,CAAC;oBACH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAClC,KAAK,EAAE,EAAsB,EAAE,EAAE;wBAC/B,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;wBAC7B,OAAO,SAAS,EAAE,CAAC;oBACrB,CAAC,EACD,EAAE,QAAQ,EAAE,CACb,CAAC;gBACJ,CAAC;wBAAS,CAAC;oBACT,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;gBACtC,CAAC;YACH,CAAC;SACF,CAAe,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -11,6 +11,7 @@ export declare class CatalogEntitiesLocalRepository {
|
|
|
11
11
|
private readRepository;
|
|
12
12
|
private writeRepository;
|
|
13
13
|
private constructor();
|
|
14
|
+
get transactionsManager(): import("../../database/transactions-manager.js").TransactionsManager;
|
|
14
15
|
private static initialize;
|
|
15
16
|
static getInstance(options: RepositoryOptions): Promise<CatalogEntitiesLocalRepository>;
|
|
16
17
|
attachDatabase(databasePath: string): Promise<void>;
|
|
@@ -45,6 +46,10 @@ export declare class CatalogEntitiesLocalRepository {
|
|
|
45
46
|
getEntityWithRelationsByKey(entityKey: string): Promise<import("@redocly/theme").BffCatalogEntity | null>;
|
|
46
47
|
getRelatedEntities(entityKey: string, paginationParams?: PaginationParams): Promise<import("./catalog-entities-local-read-repository.js").ListResult<import("@redocly/theme").BffCatalogRelatedEntity>>;
|
|
47
48
|
createEntity(entity: EntityFileSchema, sourceFile?: string): Promise<void>;
|
|
49
|
+
createEntities(entities: {
|
|
50
|
+
entity: EntityFileSchema;
|
|
51
|
+
sourceFile?: string;
|
|
52
|
+
}[]): Promise<void[]>;
|
|
48
53
|
createEntityRelation(entityRelation: EntityRelationDtoSchema): Promise<{
|
|
49
54
|
id: string;
|
|
50
55
|
createdAt: string;
|
|
@@ -59,7 +64,20 @@ export declare class CatalogEntitiesLocalRepository {
|
|
|
59
64
|
sourceToTargetRelation: string;
|
|
60
65
|
targetToSourceRelation: string;
|
|
61
66
|
} | null>;
|
|
62
|
-
createEntityRelations(
|
|
67
|
+
createEntityRelations(relations: EntityRelationDtoSchema[]): Promise<({
|
|
68
|
+
id: string;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
organizationId: string;
|
|
71
|
+
projectId: string;
|
|
72
|
+
sourceKey: string;
|
|
73
|
+
targetKey: string;
|
|
74
|
+
sourceId: string | null;
|
|
75
|
+
targetId: string | null;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
schemaVersion: number;
|
|
78
|
+
sourceToTargetRelation: string;
|
|
79
|
+
targetToSourceRelation: string;
|
|
80
|
+
} | null)[]>;
|
|
63
81
|
deleteEntity(entityKey: string): Promise<string | null>;
|
|
64
82
|
deleteEntityRelation(id: string): Promise<string | null>;
|
|
65
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-local-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-entities-local-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAYlG,qBAAa,8BAA8B;IAQvC,OAAO,CAAC,QAAQ,CAAC,MAAM;aACP,IAAI,EAAE,MAAM;IAR9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiC;IACxD,OAAO,CAAC,cAAc,CAAqC;IAC3D,OAAO,CAAC,eAAe,CAAsC;IAE7D,OAAO;IAmBP,IAAI,mBAAmB,yEAEtB;mBAEoB,UAAU;WA4BX,WAAW,CAC7B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,8BAA8B,CAAC;IAO7B,cAAc,CAAC,YAAY,EAAE,MAAM;IAI1C,KAAK;IAIX,WAAW,CAAC,gBAAgB,GAAE,gBAAqB;IAGnD,cAAc,CAAC,GAAG,EAAE,MAAM;IAG1B,oBAAoB,CAAC,gBAAgB,GAAE,gBAAqB;;;;;;;;;;;;IAG5D,qBAAqB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;IAIhC,wBAAwB,CAAC,gBAAgB,GAAE,gBAAqB;IAIhE,2BAA2B,CAAC,SAAS,EAAE,MAAM;IAI7C,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,GAAE,gBAAqB;IAI7E,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,MAAM;IAI1D,cAAc,CAAC,QAAQ,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE;IAM5E,oBAAoB,CAAC,cAAc,EAAE,uBAAuB;;;;;;;;;;;;;;IAS5D,qBAAqB,CAAC,SAAS,EAAE,uBAAuB,EAAE;;;;;;;;;;;;;;IAM1D,YAAY,CAAC,SAAS,EAAE,MAAM;IAG9B,oBAAoB,CAAC,EAAE,EAAE,MAAM;CAGhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DatabaseClient as
|
|
1
|
+
import{DatabaseClient as d}from"../../database/client.js";import{DatabasePathGenerator as p}from"../../database-path-generator.js";import r from"../../../../../utils/reporter/logger.js";import{CatalogEntitiesLocalReadRepository as E}from"./catalog-entities-local-read-repository.js";import{CatalogEntitiesLocalWriteRepository as g}from"./catalog-entities-local-write-repository.js";import{createEntityRelationDbRecordFromDto as I}from"../../mappers/create-entity-relation-db-record-from-dto.js";import{promiseMapLimit as c}from"../../../../../utils/async.js";const y=50;class n{client;path;organizationId;projectId;static instance;readRepository;writeRepository;constructor(t,e){this.client=t,this.path=e;const i=process.env.ORGANIZATION_ID,a=process.env.PROJECT_ID;if(!i||!a)throw new Error("ORGANIZATION_ID and PROJECT_ID must be set");this.organizationId=i,this.projectId=a,this.readRepository=new E(this.client),this.writeRepository=new g(this.client,this.organizationId,this.projectId)}get transactionsManager(){return this.client.transactionsManager}static async initialize({removeExisting:t,baseDbDir:e,runWithPragmaWalWriteOptimization:i}){r.info("Initializing local database...");const a=r.startTiming(),{databasePath:s,alreadyExisted:l}=await p.prepareLocalDatabasePath(e,t),h={url:`file:${s}`},o=await d.init(h,{runWithPragmaWalWriteOptimization:i});l||await o.migrate(e),r.infoTime(a,"Local database initialized");const R=new n(o,s);n.instance=R}static async getInstance(t){return n.instance||await n.initialize(t),n.instance}async attachDatabase(t){await this.readRepository.attachDatabase(t)}async close(){await this.client.close()}getEntities(t={}){return this.readRepository.getEntities(t)}getEntityByKey(t){return this.readRepository.getEntityByKey(t)}getEntitiesRelations(t={}){return this.readRepository.getEntitiesRelations(t)}getEntityRelationById(t){return this.readRepository.getEntityRelationById(t)}getEntitiesWithRelations(t={}){return this.readRepository.getEntitiesWithRelations(t)}getEntityWithRelationsByKey(t){return this.readRepository.getEntityWithRelationsByKey(t)}getRelatedEntities(t,e={}){return this.readRepository.getRelatedEntities(t,e)}createEntity(t,e){return this.writeRepository.createEntity(t,e)}createEntities(t){return c(t,y,({entity:e,sourceFile:i})=>this.createEntity(e,i))}createEntityRelation(t){const e=I(t,this.organizationId,this.projectId);return this.writeRepository.createEntityRelation(e)}createEntityRelations(t){return c(t,y,e=>this.createEntityRelation(e))}deleteEntity(t){return this.writeRepository.deleteEntity(t)}deleteEntityRelation(t){return this.writeRepository.deleteEntityRelation(t)}}export{n as CatalogEntitiesLocalRepository};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-local-repository.js","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,MAAM,MAAM,yCAAyC,CAAC;AAC7D,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-entities-local-repository.js","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-repository.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,MAAM,MAAM,yCAAyC,CAAC;AAC7D,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAC;AACnG,OAAO,EAAE,mCAAmC,EAAE,MAAM,4DAA4D,CAAC;AACjH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,OAAO,8BAA8B;IAQtB;IACD;IARD,cAAc,CAAS;IACvB,SAAS,CAAS;IAC3B,MAAM,CAAC,QAAQ,CAAiC;IAChD,cAAc,CAAqC;IACnD,eAAe,CAAsC;IAE7D,YACmB,MAAsB,EACvB,IAAY;QADX,WAAM,GAAN,MAAM,CAAgB;QACvB,SAAI,GAAJ,IAAI,CAAQ;QAE5B,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QACnD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,cAAc,IAAI,CAAC,SAAS,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,kCAAkC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1E,IAAI,CAAC,eAAe,GAAG,IAAI,mCAAmC,CAC5D,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,cAAc,EACnB,IAAI,CAA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;IAED,oBAAoB,CAAC,cAAuC;QAC1D,MAAM,cAAc,GAAG,mCAAmC,CACxD,cAAc,EACd,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,SAAS,CACf,CAAC;QACF,OAAO,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;IAED,qBAAqB,CAAC,SAAoC;QACxD,OAAO,eAAe,CAAC,SAAS,EAAE,iBAAiB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAChE,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CACpC,CAAC;IACJ,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;IACD,oBAAoB,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { DatabaseClient } from '../../database/client
|
|
1
|
+
import type { DatabaseClient } from '../../database/client';
|
|
2
2
|
import { EntityFileSchema } from '../../../schemas/file-schemas.js';
|
|
3
|
-
import {
|
|
4
|
-
import { DatabaseEntityRelation } from '../../schemas/entities-relations-table.js';
|
|
3
|
+
import { DatabaseEntityRelation, DatabaseEntityRelationDto } from '../../schemas/entities-relations-table.js';
|
|
5
4
|
export declare class CatalogEntitiesLocalWriteRepository {
|
|
6
5
|
private readonly db;
|
|
7
6
|
private readonly organizationId;
|
|
@@ -9,8 +8,7 @@ export declare class CatalogEntitiesLocalWriteRepository {
|
|
|
9
8
|
constructor(db: DatabaseClient, organizationId: string, projectId: string);
|
|
10
9
|
createEntity(entity: EntityFileSchema, sourceFile?: string): Promise<void>;
|
|
11
10
|
deleteEntity(entityKey: string): Promise<string | null>;
|
|
12
|
-
createEntityRelations(entity: EntityFileSchema): Promise<void>;
|
|
13
11
|
deleteEntityRelation(id: string): Promise<string | null>;
|
|
14
|
-
createEntityRelation(entityRelation:
|
|
12
|
+
createEntityRelation(entityRelation: DatabaseEntityRelationDto): Promise<DatabaseEntityRelation | null>;
|
|
15
13
|
}
|
|
16
14
|
//# sourceMappingURL=catalog-entities-local-write-repository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-local-write-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"catalog-entities-local-write-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EAE1B,MAAM,2CAA2C,CAAC;AAMnD,qBAAa,mCAAmC;IAE5C,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAFT,EAAE,EAAE,cAAc,EAClB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM;IAGvB,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCjF,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAWvD,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IASxD,oBAAoB,CACxB,cAAc,EAAE,yBAAyB,GACxC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;CA+B1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eq as
|
|
1
|
+
import{eq as s}from"drizzle-orm";import{createEntityDbRecord as y}from"../../mappers/create-entity-db-record.js";import{createEntityRelationDbRecordFromFileSchema as m}from"../../mappers/create-entity-relation-db-record-from-file-schema.js";import{entitiesTable as i}from"../../schemas/entities-table.js";import{entitiesRelationsTable as o}from"../../schemas/entities-relations-table.js";import p from"../../../../../utils/reporter/logger.js";import{promiseMapLimit as h}from"../../../../../utils/async.js";const g=50;class z{db;organizationId;projectId;constructor(t,e,r){this.db=t,this.organizationId=e,this.projectId=r}async createEntity(t,e){try{const r=y({entity:t,sourceFile:e,organizationId:this.organizationId,projectId:this.projectId,source:"file"}),{key:c,source:a,...n}=r,l=this.db.client.insert(i).values(r).onConflictDoUpdate({target:[i.key,i.source],set:n}),d=h(t.relations??[],g,async u=>this.createEntityRelation(m(u,t.key,this.organizationId,this.projectId)));await Promise.all([l,d])}catch(r){console.error("Error adding entity",r)}}async deleteEntity(t){try{return await this.db.client.delete(i).where(s(i.key,t)),t}catch(e){return console.error("Error deleting entity",e),null}}async deleteEntityRelation(t){try{return await this.db.client.delete(o).where(s(o.id,t)),t}catch{return null}}async createEntityRelation(t){if(!t)return null;try{const{sourceKey:e,targetKey:r,targetToSourceRelation:c,...a}=t,n=await this.db.client.insert(o).values(t).onConflictDoUpdate({target:[o.sourceKey,o.targetToSourceRelation,o.targetKey],set:a}).returning();return n?.length?n[0]:null}catch(e){return p.error("Error creating entity relation",e),null}}}export{z as CatalogEntitiesLocalWriteRepository};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-local-write-repository.js","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-entities-local-write-repository.js","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/local/catalog-entities-local-write-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAIjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,0CAA0C,EAAE,MAAM,oEAAoE,CAAC;AAChI,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAGL,sBAAsB,GACvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,MAAM,MAAM,yCAAyC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,OAAO,mCAAmC;IAE3B;IACA;IACA;IAHnB,YACmB,EAAkB,EAClB,cAAsB,EACtB,SAAiB;QAFjB,OAAE,GAAF,EAAE,CAAgB;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,cAAS,GAAT,SAAS,CAAQ;IACjC,CAAC;IAEG,KAAK,CAAC,YAAY,CAAC,MAAwB,EAAE,UAAmB;QACrE,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,oBAAoB,CAAC;gBACxC,MAAM;gBACN,UAAU;gBACV,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;YAEH,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,YAAY,CAAC;YAEtD,MAAM,mBAAmB,GAAG,IAAI,CAAC,EAAE,CAAC,MAAM;iBACvC,MAAM,CAAC,aAAa,CAAC;iBACrB,MAAM,CAAC,YAAY,CAAC;iBACpB,kBAAkB,CAAC;gBAClB,MAAM,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC;gBACjD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,KAAK,CAAC,oBAAoB,CACxB,cAAyC;QAEzC,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC;YACH,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,sBAAsB,EAAE,GAAG,YAAY,EAAE,GAAG,cAAc,CAAC;YAEzF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM;iBAChC,MAAM,CAAC,sBAAsB,CAAC;iBAC9B,MAAM,CAAC,cAAc,CAAC;iBACtB,kBAAkB,CAAC;gBAClB,MAAM,EAAE;oBACN,sBAAsB,CAAC,SAAS;oBAChC,sBAAsB,CAAC,sBAAsB;oBAC7C,sBAAsB,CAAC,SAAS;iBACjC;gBACD,GAAG,EAAE,YAAY;aAClB,CAAC;iBACD,SAAS,EAAE,CAAC;YAEf,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YAED,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -9,6 +9,7 @@ export declare class CatalogEntitiesRemoteRepository {
|
|
|
9
9
|
private readonly projectId;
|
|
10
10
|
private static instance;
|
|
11
11
|
private constructor();
|
|
12
|
+
get transactionsManager(): import("../../database/transactions-manager.js").TransactionsManager;
|
|
12
13
|
private static initialize;
|
|
13
14
|
static getInstance(options: RepositoryOptions): Promise<CatalogEntitiesRemoteRepository | undefined>;
|
|
14
15
|
close(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-remote-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAO9E,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAI3F,OAAO,EACL,sBAAsB,EAEvB,MAAM,2CAA2C,CAAC;AAEnD,qBAAa,+BAA+B;IAMxC,OAAO,CAAC,QAAQ,CAAC,EAAE;aACH,IAAI,EAAE,MAAM;IAN9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA8C;IAErE,OAAO;
|
|
1
|
+
{"version":3,"file":"catalog-entities-remote-repository.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAO9E,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAI3F,OAAO,EACL,sBAAsB,EAEvB,MAAM,2CAA2C,CAAC;AAEnD,qBAAa,+BAA+B;IAMxC,OAAO,CAAC,QAAQ,CAAC,EAAE;aACH,IAAI,EAAE,MAAM;IAN9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA8C;IAErE,OAAO;IAaP,IAAI,mBAAmB,yEAEtB;mBAEoB,UAAU;WA4CX,WAAW,CAC7B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,+BAA+B,GAAG,SAAS,CAAC;IAO1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAgC5E,YAAY,CACvB,MAAM,EAAE,eAAe,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5D,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAgClC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAYvD,oBAAoB,CACxB,cAAc,EAAE,uBAAuB,GACtC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAsCnC,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAS/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eq as y}from"drizzle-orm";import{DatabaseClient as g}from"../../database/client.js";import{DatabasePathGenerator as E}from"../../database-path-generator.js";import n from"../../../../../utils/reporter/logger.js";import{createEntityDbRecord as p}from"../../mappers/create-entity-db-record.js";import{retryAsyncOperation as f}from"../../../utils/retry-async-operation.js";import{createEntityReadModel as
|
|
1
|
+
import{eq as y}from"drizzle-orm";import{DatabaseClient as g}from"../../database/client.js";import{DatabasePathGenerator as E}from"../../database-path-generator.js";import n from"../../../../../utils/reporter/logger.js";import{createEntityDbRecord as p}from"../../mappers/create-entity-db-record.js";import{retryAsyncOperation as f}from"../../../utils/retry-async-operation.js";import{createEntityReadModel as h}from"../../mappers/create-entity-read-model.js";import{createEntityRelationDbRecordFromDto as I}from"../../mappers/create-entity-relation-db-record-from-dto.js";import{entitiesTable as o}from"../../schemas/entities-table.js";import{entitiesRelationsTable as d}from"../../schemas/entities-relations-table.js";class s{db;path;organizationId;projectId;static instance;constructor(e,t){this.db=e,this.path=t;const a=process.env.ORGANIZATION_ID,i=process.env.PROJECT_ID;if(!a||!i)throw new Error("ORGANIZATION_ID and PROJECT_ID must be set");this.organizationId=a,this.projectId=i}get transactionsManager(){return this.db.transactionsManager}static async initialize({removeExisting:e,baseDbDir:t}){const a=process.env.SQLD_REMOTE_DATABASE_URL,i=process.env.SQLD_REMOTE_DATABASE_AUTH_TOKEN;if(!a||!i)throw new Error("SQLD_REMOTE_DATABASE_URL and SQLD_REMOTE_DATABASE_AUTH_TOKEN must be set");n.info("Initializing remote database...");const c=n.startTiming();try{return await f(async()=>{const{databasePath:r,alreadyExisted:l}=await E.prepareRemoteDatabasePath(t,e),u=await g.init({url:`file:${r}`,syncUrl:a,authToken:i});l||await u.migrate(t),n.infoTime(c,"Remote database initialized");const m=new s(u,r);s.instance=m},{maxRetries:3,retryStrategy:"exponential",delay:1e3,logger:n,messages:{retry:"Retrying remote database initialization",maxRetriesReached:"Max retries reached, remote database initialization failed"}})}catch(r){n.error("Error initializing remote database: "+r.message),s.instance=void 0;return}}static async getInstance(e){return s.instance||await s.initialize(e),s.instance}async close(){await this.db.close()}async sync(){await this.db.sync()}async createEntity(e){try{n.info(`Adding entity ${e.key} to remote database`);const t=p({entity:e,organizationId:this.organizationId,projectId:this.projectId,source:"remote"}),{key:a,source:i,...c}=t,r=await this.db.client.insert(o).values(t).onConflictDoUpdate({target:[o.key,o.source],set:c}).returning();return r.length?h(r[0]):null}catch(t){return console.error("Error adding entity",t),null}}async updateEntity(e){try{n.info(`Updating entity ${e.key} in remote database`);const t=p({entity:e,organizationId:this.organizationId,projectId:this.projectId,source:"remote"}),{key:a,source:i,...c}=t,r=await this.db.client.insert(o).values(t).onConflictDoUpdate({target:[o.key,o.source],set:c}).returning();return r.length?h(r[0]):null}catch(t){return n.error("Error updating entity",t),null}}async deleteEntity(e){try{return await this.db.client.delete(o).where(y(o.key,e)),e}catch(t){return console.error("Error deleting entity",t),null}}async createEntityRelation(e){if(!e)return null;try{const t=I(e,this.organizationId,this.projectId),{sourceKey:a,targetKey:i,targetToSourceRelation:c,...r}=t,l=await this.db.client.insert(d).values(t).onConflictDoUpdate({target:[d.sourceKey,d.targetToSourceRelation,d.targetKey],set:r}).returning();return l.length?l[0]:null}catch(t){return n.error("Error creating entity relation",t),null}}async deleteEntityRelation(e){try{return await this.db.client.delete(d).where(y(d.id,e)),e}catch(t){return n.error("Error deleting entity relation",t),null}}}export{s as CatalogEntitiesRemoteRepository};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-entities-remote-repository.js","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAMjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,MAAM,MAAM,yCAAyC,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,mCAAmC,EAAE,MAAM,4DAA4D,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAEL,sBAAsB,GACvB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,OAAO,+BAA+B;IAMvB;IACD;IAND,cAAc,CAAS;IACvB,SAAS,CAAS;IAC3B,MAAM,CAAC,QAAQ,CAA8C;IAErE,YACmB,EAAkB,EACnB,IAAY;QADX,OAAE,GAAF,EAAE,CAAgB;QACnB,SAAI,GAAJ,IAAI,CAAQ;QAE5B,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QACnD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,cAAc,IAAI,CAAC,SAAS,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,cAAc,EAAE,SAAS,EAAqB;QAC9E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;QACrD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC;QAC9D,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;QAC9F,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC/C,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAC7C,IAAI,CAAC;YACH,OAAO,MAAM,mBAAmB,CAC9B,KAAK,IAAI,EAAE;gBACT,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GACpC,MAAM,qBAAqB,CAAC,yBAAyB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;gBAEnF,MAAM,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"catalog-entities-remote-repository.js","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/databases/repositories/remote/catalog-entities-remote-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAMjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,MAAM,MAAM,yCAAyC,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0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,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC7F,OAAO,EAAE,CAAC;QACZ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function validateEntity(
|
|
1
|
+
import { type EntityFileSchema } from '../schemas/file-schemas.js';
|
|
2
|
+
export declare function validateEntity(entity: unknown): asserts entity is EntityFileSchema;
|
|
3
3
|
//# sourceMappingURL=validate-entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-entity.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/entities/validate-entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"validate-entity.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/entities/validate-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQrF,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,IAAI,gBAAgB,CAElF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{entityFileSchema as
|
|
1
|
+
import{entityFileSchema as i}from"../schemas/file-schemas.js";import{createValidator as a}from"../utils/ajv-validator.js";const e=a(i,"Entity validation failed");function r(t){e(t)}export{r as validateEntity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-entity.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/entities/validate-entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-entity.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/entities/validate-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,eAAe,GAAG,eAAe,CACrC,gBAAgB,EAChB,0BAA0B,CAC3B,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,eAAe,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LifecycleContext } from '../../../types';
|
|
2
|
+
import { CatalogEntitiesService } from '../databases/index.js';
|
|
3
|
+
import { EntityFileSchema } from '../schemas/file-schemas.js';
|
|
4
|
+
import { EntityRelationDtoSchema } from '../schemas/dto-schemas';
|
|
5
|
+
type EntityBatchProcessorParams = {
|
|
6
|
+
catalogEntitiesService: CatalogEntitiesService;
|
|
7
|
+
context: LifecycleContext;
|
|
8
|
+
batchSize?: number;
|
|
9
|
+
};
|
|
10
|
+
type Entity = {
|
|
11
|
+
entity: EntityFileSchema;
|
|
12
|
+
sourceFile?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class EntityBatchProcessor {
|
|
15
|
+
private catalogEntitiesService;
|
|
16
|
+
private entitiesBatchQueue;
|
|
17
|
+
private relationsBatchQueue;
|
|
18
|
+
constructor({ catalogEntitiesService }: EntityBatchProcessorParams);
|
|
19
|
+
addEntity(entity: Entity): void;
|
|
20
|
+
addRelation(relation: EntityRelationDtoSchema): void;
|
|
21
|
+
processRemainingTasks(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=entity-batch-processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-batch-processor.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/extensions/entity-batch-processor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,KAAK,0BAA0B,GAAG;IAChC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,OAAO,EAAE,gBAAgB,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,MAAM,GAAG;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,sBAAsB,CAAyB;IACvD,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,mBAAmB,CAA8C;gBAE7D,EAAE,sBAAsB,EAAE,EAAE,0BAA0B;IAgBlE,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B,WAAW,CAAC,QAAQ,EAAE,uBAAuB,GAAG,IAAI;IAI9C,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;CAM7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BatchQueue as i}from"../../../utils/queue.js";class n{catalogEntitiesService;entitiesBatchQueue;relationsBatchQueue;constructor({catalogEntitiesService:t}){this.catalogEntitiesService=t,this.entitiesBatchQueue=new i({batchProcessor:async e=>this.catalogEntitiesService.createEntitiesInLocalDatabase(e.map(a=>a.data))}),this.relationsBatchQueue=new i({batchProcessor:async e=>this.catalogEntitiesService.createEntityRelationsInLocalDatabase(e.map(a=>a.data))})}addEntity(t){this.entitiesBatchQueue.addItem({data:t})}addRelation(t){this.relationsBatchQueue.addItem({data:t})}async processRemainingTasks(){await Promise.all([this.entitiesBatchQueue.processRemainingItems(),this.relationsBatchQueue.processRemainingItems()])}}export{n as EntityBatchProcessor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-batch-processor.js","sourceRoot":"","sources":["../../../../../../../src/server/plugins/catalog-entities/extensions/entity-batch-processor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAWrD,MAAM,OAAO,oBAAoB;IACvB,sBAAsB,CAAyB;IAC/C,kBAAkB,CAA6B;IAC/C,mBAAmB,CAA8C;IAEzE,YAAY,EAAE,sBAAsB,EAA8B;QAChE,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;QAErD,IAAI,CAAC,kBAAkB,GAAG,IAAI,UAAU,CAAC;YACvC,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAC9B,IAAI,CAAC,sBAAsB,CAAC,6BAA6B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC5F,CAAC,CAAC;QAEH,IAAI,CAAC,mBAAmB,GAAG,IAAI,UAAU,CAAC;YACxC,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAC9B,IAAI,CAAC,sBAAsB,CAAC,oCAAoC,CAC9D,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAC/B;SACJ,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,WAAW,CAAC,QAAiC;QAC3C,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,EAAE;YAC/C,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,EAAE;SACjD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-entities-extractor.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/extensions/api-description/
|
|
1
|
+
{"version":3,"file":"asyncapi-entities-extractor.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE,OAAO,EAAE,wBAAwB,EAAE,KAAK,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAE1F,KAAK,MAAM,GAAG,8BAA8B,CAAC;AAI7C,qBAAa,yBAA0B,SAAQ,wBAAwB,CAAC,iBAAiB,CAAC;gBAC5E,MAAM,EAAE,MAAM;IAI1B,wBAAwB,CAAC,UAAU,EAAE,iBAAiB,GAAG,gBAAgB;IAmBnE,kBAAkB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIlD,gCAAgC,CACpC,UAAU,EAAE,iBAAiB,EAC7B,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAAC,IAAI,CAAC;YA2CF,oCAAoC;YA6BpC,qCAAqC;YAkBrC,mCAAmC;YAqBnC,wBAAwB;YA4BxB,0CAA0C;YA8B1C,wCAAwC;IAoDtD,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,mBAAmB;CAO5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{removeLeadingSlash as p}from"@redocly/theme";import{promiseMapLimit as m,promiseMapLimitWithStatus as l}from"../../../../../utils/async.js";import{formatToKebabCase as o,capitalizeFirstLetter as u}from"../../../../../../shared/jsUtils.js";import{removeMarkdocTags as d}from"../../../../../../shared/markdoc.js";import{BaseApiEntitiesExtractor as A}from"./base.js";const y=25;class P extends A{constructor(t){super("asyncapi",t)}mapApiDefinitionToEntity(t){const e=p(t.realRelativePath),a=t.document.info.title,c=o(a);return{type:this.type,key:c,title:a,summary:d(t.document.info.description),tags:t.document.info.tags?.map(s=>s.name),metadata:{specType:this.specType,schema:JSON.stringify(t.document),descriptionFile:e}}}async loadApiDefinitions(){return(await this.context.cache.load(".","asyncapi-docs")).data}async extractEntitiesFromApiDefinition(t,e){if(!t?.document?.operations){this.context.logger.info(`No operations found in AsyncAPI definition for ${e}`);return}const a=Object.entries(t.document.operations).map(([i,n])=>({operationName:i,operation:n})),c=await l(a,y,async({operationName:i,operation:n})=>{await this.extractEntitiesFromAsyncApiOperation(n,i,t,e)},this.context.logger),s=c.count.ok,r=c.count.failed;r>0?this.context.logger.warn(`AsyncAPI extraction completed with ${r} failures out of ${a.length} operations`):this.context.logger.info(`AsyncAPI extraction completed successfully for ${s} operations`)}async extractEntitiesFromAsyncApiOperation(t,e,a,c){let s=[];t.messages&&Array.isArray(t.messages)&&(s=await this.createDataSchemasFromAsyncApiMessages(t.messages,e,a));const r=await this.createApiOperationEntity(e,t,s,a.realRelativePath);await this.createApiOperationRelationsWithDataSchemas(r,s,c)}async createDataSchemasFromAsyncApiMessages(t,e,a){return(await m(t,y,async s=>await this.createDataSchemaFromAsyncApiMessage(s,e,a)??"")).filter(s=>!!s)}async createDataSchemaFromAsyncApiMessage(t,e,a){const c=t.name||t.title;return t.payload?await this.createDataSchemaEntityFromAsyncApiSchema({schema:t.payload,definition:a,operationName:e,messageName:c,schemaType:"payload"}):null}async createApiOperationEntity(t,e,a,c){const s={type:"api-operation",key:o(t),title:e.title||t,summary:e.summary??"",tags:e.tags?.map(r=>r.name)??[],metadata:{method:e.action==="send"?"PUBLISH":"SUBSCRIBE",path:e.channel.address??"",payload:e.action==="receive"?a:[],responses:e.action==="send"?a:[]}};return this.entityBatchProcessor.addEntity({entity:s,sourceFile:c}),s.key}async createApiOperationRelationsWithDataSchemas(t,e,a){this.entityBatchProcessor.addRelation({sourceKey:t,type:"partOf",targetKey:a}),this.entityBatchProcessor.addRelation({sourceKey:a,type:"hasParts",targetKey:t}),await m(e,y,async c=>{this.entityBatchProcessor.addRelation({sourceKey:t,type:"uses",targetKey:c}),this.entityBatchProcessor.addRelation({sourceKey:c,type:"usedBy",targetKey:t})})}async createDataSchemaEntityFromAsyncApiSchema({schema:t,definition:e,operationName:a,messageName:c,schemaType:s}){try{const r=this.extractSchemaContent(t);if(!r)return null;const i=this.generateSchemaTitle(a,c),n=o(i),h={type:"data-schema",key:n,title:i,summary:"description"in r?r.description:`${u(s)} schema for ${a} operation.`,metadata:{specType:this.specType,schema:JSON.stringify(r)}};return this.entityBatchProcessor.addEntity({entity:h,sourceFile:e.realRelativePath}),n}catch(r){return this.context.logger.error(`Failed to create schema entity for ${a} ${s}:`,r),null}}extractSchemaContent(t){return t&&"schema"in t&&"schemaFormat"in t?t.schema:t}generateSchemaTitle(t,e){const a=[t];return e&&a.push(e),a.join("-")}}export{P as AsyncApiEntitiesExtractor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncapi-entities-extractor.js","sourceRoot":"","sources":["../../../../../../../../../src/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAUpD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAuC,MAAM,WAAW,CAAC;AAI1F,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,OAAO,yBAA0B,SAAQ,wBAA2C;IACxF,YAAY,MAAc;QACxB,KAAK,CAAC,UAAU,E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