Bundle: redb-route / vscode-redb-route (vscode-redb-route.txt), 63 files Snapshot: development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Index: https://redbase.app/src/dev-2026-12-06/redb-route/_index.txt ==== Path: redb-route/vscode-redb-route/.vscode/launch.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/.vscode/launch.json ---- { "version": "0.2.0", "configurations": [ { "name": "Run Extension", "type": "extensionHost", "request": "launch", "args": ["--extensionDevelopmentPath=${workspaceFolder}"], "outFiles": ["${workspaceFolder}/out/**/*.js"], "preLaunchTask": "npm: compile" } ] } Path: redb-route/vscode-redb-route/.vscode/tasks.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/.vscode/tasks.json ---- { "version": "2.0.0", "tasks": [ { "type": "npm", "script": "compile", "group": "build", "problemMatcher": "$tsc", "label": "npm: compile" } ] } Path: redb-route/vscode-redb-route/LICENSE Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/LICENSE ---- Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may accept and charge a fee in exchange for, or offer support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2024-2026 RedBase Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Path: redb-route/vscode-redb-route/README.md Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/README.md ---- # redb Route XML Editor support for [redb.Route](https://github.com/redbase-app/redb-route) XML routes in VS Code: new projects from the redb templates, completion and validation from the format's schema, a route tree, composite skeletons, bean reference hints and a graph editor over the XML text. The format does not need an editor. A route file is plain XML that the runtime loads as it is; this extension only makes writing and reading it easier. ## Features ### New project **redb: New Project** from the Command Palette opens a page that creates a project from the redb templates through `dotnet new`: - **Status.** The top of the page shows the installed .NET SDKs and the two template packages, `redb.Templates` and `redb.Tsak.Templates`, with an **Install** button for a missing package and an **Update** button when nuget.org has a newer version. - **Templates.** Every project and solution template of the installed packages is a card, grouped as redb.Route XML modules, redb.Tsak hosts and applications (console, Blazor, Razor Pages, worker, chat). The basic `redb-route` module is selected when the page opens. - **Form.** The chosen template's form asks for the project name, the parameters that template declares (for example the target framework or the database) and the location. A target framework with no SDK for it on this machine is marked, and a location where a folder of that name already holds files is refused. - **Create.** **Create** runs `dotnet new` and, when the project carries a local tool manifest, `dotnet tool restore`. Their output shows on the page and in the **redb Route** output channel, and a running step can be cancelled. When it is done, the page offers to open the project in this window, in a new window or to add it to the workspace. The cards and the form come from the templates themselves, so a new template in the redb template packages appears without an update of this extension. ### Schema: completion and validation Completion of elements, attributes and enum values, and validation as you type, for every element of the format and for the typed options of every connector (``, ``, `` and so on). The schema also knows which side an option belongs to: an option that only a consumer takes is accepted inside `` and refused inside ``. The work is done by [Red Hat XML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml) reading the schema this extension ships. The binding goes by namespace, not by file name: a document gets the schema because its root element declares `urn:redb:route:1.0`. Any other XML file, including someone else's `route.xml`, is left alone. ### Skeletons Composite inserts the schema cannot offer, served only in redb route documents and only where a new element may start: | Skeleton | Inserts | |---|---| | `` declarations of the current document, then those of the module's `context.xml`. The module is the nearest folder with a `.csproj` up to three levels above the file, the project root `redb-route-xml pack` builds from; an unsaved `context.xml` open in an editor is read as it stands. This works in route files and in `context.xml` itself, in three places: the whole attribute value (`dataSource="#"`), the path right after the scheme (`bean:#`) and a URI option value (`?headerFilterStrategy=#`). A `#` inside other text, such as the SQL parameter `:#name`, is not a reference and gets no hint. An attribute that only takes a reference (`predicate=`, `repository=`, `processor=`, `onRedelivery=` and the others the schema types that way) offers the same list on an empty value, before the `#` is typed, and inserts the name with it. So does a connector option that names a registry object (`dataSource` of `sql`, `connectionFactory`, `headerFilterStrategy`, `idempotentRepository` and the others the connector catalog marks), as a URI option (`uri="sql:select 1?dataSource="`) and as an attribute of the structured form (``); the item and the hover on the option name show the type the connector expects. The bean step `` (or `beanType="Namespace.Type, Assembly"`) in a route or a scope is completed and validated like any other step, its `ref=` gets the same list, and the graph shows it as a user-code tile, the same one as `` and ``. A `` directly under `` or `` stays a declaration: it is what the list offers and what the graph shows in its beans row. A bean call of the expression language gets the same list for its bean name: after `${bean:` in any template (``, element text, `toD`), and after a bare `bean:` in an expression attribute (``), at the start or after an operator. The method after the `.` is not offered: the editor does not know the bean's methods. A registry read `${ref:` or a bare `ref:` (``) gets the list in the same places; its name is the whole run, so nothing follows it. The list is not filtered by type, and beans registered from C# code are not in it. A reference to a bean that is not declared, or of the wrong type, is reported by `redb-route-xml check` and `redb-route-xml pack`. ### Data formats In ``, `` and ``, `format=` offers the registered format names (`xmljson`, `csv`, `yaml`...) and `type=` the format type names. Once `type=` names a format, the attribute list offers that format's options with their kind and default (`schema`, `arrays`, `namespaces` for xmljson), an enum or boolean option offers its values, and `target=` of `` offers the targets the format accepts. Hovering an option or the `type=`/`format=` value shows its description. A path option offers what the package will carry: `schema=` the files under the module's `resources/` folder, as the short path the runtime reads (`xsd/order.xsd`), and `schemaRoot=` the folders under `resources/` relative to the schema's folder (`..`, `common`). A file elsewhere in the project folder is not offered: `pack` does not ship it. ### Route tree The **redb** button in the Activity Bar opens the **Routes** view: every routes document of the workspace (`*.route.xml`, `*.redb-route.xml`), with the id and the `from` endpoint of each route. A click opens the route at its line. The view's title bar has **New Project** and **Refresh**; in a workspace without route files the view offers **New Project** and a link to the format. ### Route graph **Open With...** > **redb Route Graph**, the graph button in the editor title, or **redb Route: Open Route Graph** from the Command Palette opens the route file as a graph. The graph is a second view of the same text: every edit in it is an edit of the XML, and undo works as in the text editor. - **Reading.** Every step is a tile of one size with a glyph and a short caption (`from`, `bean`, `sql`, `set`, `choice`, `loop`, `log`...). The tooltip and the properties panel show what the step does: the property name, the condition, the SQL. Wrappers (`metered`, `loop`, `split`, a transaction) put their steps on the route's line between their own tile and an `end` tile; `choice`, `tryCatch` and `filter` fan out into branches. A run of `setHeader` or `setProperty` steps is one tile `set ×N`. - **Paths.** Conditional paths are dashed: orange where a message goes past a step (filter not passed, no match, duplicate), grey with a cross where it is dropped (`sample`, `debounce`), red where a step raises (`catch`, `onException`, error). - **Colors.** Green where a message comes in, blue where it goes out, purple your code (`bean`), orange data changes, cyan routing, grey observation, red errors. - **Editing.** Insert a step from the palette at any `+` between steps, delete with `Delete`, drag a step to reorder it or to move it into or out of a container, rename an element, edit attributes and child texts in the properties panel. The palette's **Send to** list holds the connectors that can send; one that only receives (`imap`, `pop3`, `timer`, `cron`, `qtimer`) is not offered there. - **Endpoints.** For a step with a URI the panel splits it into the scheme, the path and the options of that connector, with enum values offered as a list. A sensitive option (a password, a key) is masked and cannot be edited from the panel. - **Placeholders.** A `{{key}}` or `{{key:default}}` value is shown together with what it resolves to, read from `context.sample.json` and `config/*.json` found next to the route file or in up to three folders above it. The edit always keeps the placeholder. - **Layout.** The toolbar switches left to right or top down, folds or unfolds every container at once, zooms and switches the tile look (glyph over the caption or beside it). A route folds to its title with the arrow before its name. ### Mermaid diagram **redb Route: Show Mermaid Diagram** renders the current route file as a Mermaid diagram with the `redb-route-xml` .NET tool: ```bash dotnet tool install -g redb.Route.Xml.CodeGen ``` This and **New Project** are the only features that need .NET on the machine. ## Requirements - [Red Hat XML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml) (`redhat.vscode-xml`). VS Code installs it together with this extension when it has network access. - The `redb-route-xml` .NET tool, only for the Mermaid diagram. - A .NET SDK and the redb template packages (`dotnet new install redb.Templates`, `dotnet new install redb.Tsak.Templates`), only for **New Project**. Its page offers to install the packages itself. ## Installation From the Visual Studio Marketplace: in the **Extensions** view search for `redb Route XML` and click **Install**, or open the [extension page](https://marketplace.visualstudio.com/items?itemName=redb.redb-route-xml). From a terminal: `code --install-extension redb.redb-route-xml`. VS Code then keeps the extension up to date. Every redb.Route release also carries the extension as a file, for a machine without access to the Marketplace or to pin a version: 1. Open the [releases of redb-route](https://github.com/redbase-app/redb-route/releases), pick the version you use and download `redb-route-xml-.vsix` from its assets. 2. In VS Code: **Extensions** view > `...` > **Install from VSIX...** > the downloaded file. From a terminal: `code --install-extension redb-route-xml-.vsix`. 3. Run **Developer: Reload Window**. A graph tab opened before an update keeps the old view until it is closed and opened again. On a machine without network access, download the Red Hat XML `.vsix` from its Marketplace page and install it first, the same way. ## Settings The extension has no settings of its own. It registers its XML catalog with Red Hat XML through that extension's API. With an older Red Hat XML that has no such API, it adds the catalog to the user setting `xml.catalogs` once. ## Documentation - [redb.Route.Xml](https://github.com/redbase-app/redb-route/blob/main/redb.Route.Xml/README.md): the XML format, elements, endpoints, beans, the context document. - [Schema and editor support](https://github.com/redbase-app/redb-route/blob/main/redb.Route.Xml/README.md#schema-and-editor-support) and [tooling](https://github.com/redbase-app/redb-route/blob/main/redb.Route.Xml/README.md#tooling-scaffold-pack-generate): the schemas, `check`, `pack` and the code generator. ## Development ```bash npm install npm run compile npm test ``` `npm test` runs the unit tests with `node:test`, without VS Code. Press `F5` to start an Extension Development Host with the extension loaded. The files in `media/` other than the graph's script and styles are generated by the `redb-route-xml` tool from the built connector assemblies (`catalog`, `elements` and `xsd` commands). They are not edited by hand. ## License [Apache License 2.0](https://github.com/redbase-app/redb-route/blob/main/vscode-redb-route/LICENSE). ## Credits The graph glyphs follow the notation of *Enterprise Integration Patterns* by Gregor Hohpe and Bobby Woolf ([enterpriseintegrationpatterns.com](https://www.enterpriseintegrationpatterns.com/), pattern icons under CC BY 4.0), redrawn as 24×24 line icons. Steps the notation has no symbol for are drawn in the same style. Path: redb-route/vscode-redb-route/media/catalog.xml Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/catalog.xml ---- Path: redb-route/vscode-redb-route/media/graph.css Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/graph.css ---- /* The Ф8 graph: every color is a VSCode THEME variable (09-UX §6) — the view lives in the user's theme, light and dark both, nothing hard-coded. */ body { font-family: var(--vscode-font-family); font-size: 12px; color: var(--vscode-foreground); background: var(--vscode-editor-background); margin: 0; padding: 10px 14px; } /* ── route ─────────────────────────────────────────────────────────── */ .route { margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; } .route-header { font-weight: 600; margin: 6px 0 4px; color: var(--vscode-foreground); } .route-header .description { font-weight: 400; opacity: 0.7; margin-left: 8px; } /* ── the strip above (onException etc, §3.9) ───────────────────────── */ .strip { border-bottom: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); padding: 2px 0 4px; margin-bottom: 6px; opacity: 0.9; } .strip > summary { cursor: pointer; color: var(--vscode-editorWarning-foreground); list-style: none; } .strip > summary::before { content: "▲ "; } /* ── the main line: a horizontal row that wraps only inside branches ── */ .seq { display: flex; flex-direction: row; /* the main line runs through the vertical CENTER: a branching block forks off it and the continuation visibly rejoins after the whole block, not after its first row */ align-items: center; flex-wrap: nowrap; width: max-content; } .seq > * { flex: none; } /* The gap between two steps: the SVG overlay draws the curve and its arrowhead through it. */ .edge { align-self: center; width: 30px; flex: none; margin: 0 1px; position: relative; } /* ── nodes (§3.2, §6): category first, icon second ─────────────────── */ .node { display: inline-flex; align-items: baseline; gap: 4px; border-radius: 3px; padding: 1px 6px; cursor: pointer; /* every element is a BOX (owner request 2026-09-09): neutral steps get the muted outline, category colors override it and keep the visual hierarchy */ border: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border, #555)); max-width: 260px; white-space: nowrap; } .node:hover { outline: 1px solid var(--vscode-focusBorder); } .node .t { opacity: 0.6; font-size: 0.85em; } .node .icon { opacity: 0.9; } /* category weights and colors */ .cat-source { border-color: var(--vscode-charts-green, #89d185); border-left-width: 4px; } .cat-sendExternal { background: var(--vscode-button-background); color: var(--vscode-button-foreground); } .cat-sendExternal .t { opacity: 0.8; } .cat-sendInternal { border-color: var(--vscode-button-background); color: var(--vscode-foreground); } .cat-transform { opacity: 0.85; } .cat-flow { border-color: var(--vscode-charts-blue, #75beff); font-weight: 600; padding: 3px 10px; } .cat-errors { border-color: var(--vscode-editorWarning-foreground, #cca700); color: var(--vscode-editorWarning-foreground, #cca700); } .cat-userCode { border-color: var(--vscode-charts-purple, #b180d7); } .cat-unknown { border-style: dashed; border-color: var(--vscode-descriptionForeground); opacity: 0.8; } /* ── scope: a bracket over its stretch (§3.3, §3.7) ────────────────── */ .scope { border: 1px solid var(--vscode-charts-blue, #75beff); border-radius: 6px; padding: 3px 6px 4px; margin: 0 2px; } .scope.cat-errors { border-color: var(--vscode-editorWarning-foreground, #cca700); } .scope.cat-transform { border-color: var(--vscode-editorWidget-border, #666); } .scope > .scope-head { font-size: 0.85em; opacity: 0.85; margin-bottom: 2px; cursor: pointer; white-space: nowrap; } .scope > .scope-head .repeat { margin-left: 4px; } /* ── branching: a stack of rows (§3.4, §3.6) ───────────────────────── */ /* The decision diamond with the stack of branches beside it; the curves of the overlay carry the fan out and the merge back, so the group needs no box and no rail of its own. */ .branching { display: flex; flex-direction: row; align-items: center; gap: 40px; margin: 0 2px; } /* the stack of branch rows to the right of the diamond */ .lstack { display: flex; flex-direction: column; gap: 14px; } .branch { display: flex; align-items: center; gap: 0; } .branch > .branch-label { flex: none; font-size: 0.85em; opacity: 0.85; border: 1px solid var(--vscode-editorWidget-border, #666); border-radius: 3px; padding: 1px 6px; cursor: pointer; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .branch > .branch-label.warn { color: var(--vscode-editorWarning-foreground, #cca700); border-color: var(--vscode-editorWarning-foreground, #cca700); } /* ── bean declarations: a muted registry row, not steps ────────────── */ .beans { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; margin: 4px 0 10px; opacity: 0.85; } .beans-title { opacity: 0.6; font-size: 0.85em; } .bean-chip { border: 1px solid var(--vscode-charts-purple, #b180d7); border-radius: 8px; padding: 0 7px; cursor: pointer; font-size: 0.9em; } .bean-chip:hover { outline: 1px solid var(--vscode-focusBorder); } /* ── the layout toggle ─────────────────────────────────────────────── */ .toolbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; justify-content: flex-end; padding: 2px 0 6px; background: var(--vscode-editor-background); } .toolbar button { background: none; border: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); color: var(--vscode-foreground); border-radius: 3px; padding: 1px 8px; cursor: pointer; font-size: 0.85em; opacity: 0.7; } .toolbar button.active { opacity: 1; border-color: var(--vscode-focusBorder); background: var(--vscode-list-activeSelectionBackground, transparent); } .toolbar .zoom-box { display: inline-flex; gap: 2px; margin-left: 10px; } .toolbar .zoom-pct { min-width: 46px; } /* The zoomed drawing surface (the toolbar and the panel stay 1:1). max-content keeps the box hugging its widest child, so the curve overlay's rect covers ALL of the content. */ .canvas { position: relative; width: max-content; min-width: 100%; } /* ── the vertical layout: TD columns, routes side by side ──────────── */ .routes-grid { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-start; } .routeV { flex: none; max-width: 100%; margin-bottom: 10px; } .vcol { display: flex; flex-direction: column; align-items: flex-start; width: max-content; max-width: 100%; } /* vertical edge with a DOWN arrowhead — the message goes that way */ .vedge { align-self: center; height: 14px; width: 0; border-left: 1px solid var(--vscode-descriptionForeground); opacity: 0.55; position: relative; margin: 1px 0; } .vedge::after { content: ""; position: absolute; left: -3.5px; bottom: -1px; border-top: 5px solid var(--vscode-descriptionForeground); border-left: 3px solid transparent; border-right: 3px solid transparent; } /* nodes and slots center on the column's spine */ .vcol > .node, .vcol > .slot, .vcol > .scope, .vcol > .vbranching { align-self: center; } .vcol > .slot { height: 12px; } .vertical .seq:hover > .slot { opacity: 0.45; } .vcol:hover > .slot { opacity: 0.45; } .vscope { margin: 2px 0; } .vscope > .vcol { padding: 2px 8px; } .vbranching { display: flex; flex-direction: column; align-items: center; margin: 2px 0; /* the group contour: choice/tryCatch and their branches are ONE visible box */ border: 1px solid var(--vscode-charts-blue, #75beff); border-radius: 6px; padding: 5px 10px 6px; } .vbranching.cat-errors { border-color: var(--vscode-editorWarning-foreground, #cca700); } .vbranch-head { display: inline-flex; align-items: baseline; gap: 4px; border: 1px solid var(--vscode-charts-blue, #75beff); border-radius: 3px; padding: 1px 8px; font-weight: 600; cursor: pointer; } .vbranch-head.cat-errors { border-color: var(--vscode-editorWarning-foreground, #cca700); } /* the RAIL under the head; every branch hangs off it with a vertical stub */ .vfan { display: flex; align-items: flex-start; gap: 18px; margin-top: 8px; border-top: 1px solid var(--vscode-descriptionForeground); } .vbranch { display: flex; flex-direction: column; align-items: center; } .vbranch::before { content: ""; height: 9px; border-left: 1px solid var(--vscode-descriptionForeground); opacity: 0.55; margin-bottom: 2px; } .vbranch > .branch-label { margin-top: 0; } /* ── the mermaid look: SVG curves + shapes over the columnar layout ── */ .mermaid-look { position: relative; } .edge-overlay { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; } .edge-overlay path { stroke: var(--vscode-descriptionForeground); stroke-width: 1.5; opacity: 1; } .edge-overlay path.head { fill: var(--vscode-descriptionForeground); stroke: none; } /* the curves carry the flow — the stub edges and rails step aside */ .mermaid-look .vedge, .mermaid-look .vbranch::before { display: none; } .mermaid-look .vfan { border-top: none; margin-top: 30px; gap: 26px; } .mermaid-look .vcol { row-gap: 26px; } .mermaid-look .vbranching { border: none; padding: 0; } .mermaid-look .routes-grid { gap: 8px 44px; } .mermaid-look .routeV { z-index: 1; } .mermaid-look .node, .mermaid-look .scope, .mermaid-look .vbranch-head, .mermaid-look .branch-label { position: relative; z-index: 1; } /* slots stay silent until pointed at — a blue plus ON a curve is noise */ .mermaid-look .vcol:hover > .slot { opacity: 0; } .mermaid-look .slot:hover, .mermaid-look .slot.drop { opacity: 1 !important; } /* mermaid-ish fills and shapes */ .mermaid-look .node { background: var(--vscode-editorWidget-background, var(--vscode-editor-background)); padding: 3px 10px; border-radius: 4px; } .mermaid-look .vbranch-head { /* the decision diamond */ clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border: none; background: var(--vscode-list-hoverBackground, var(--vscode-editorWidget-background)); padding: 14px 36px; } .mermaid-look .branch-label { /* the condition hexagon */ clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); border: none; background: var(--vscode-list-hoverBackground, var(--vscode-editorWidget-background)); box-shadow: none; padding: 5px 18px; max-width: 340px; } /* the bracket as a mermaid subgraph: light rounded box, muted title top-left, the category kept as a thin left accent */ .mermaid-look .scope { border: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); border-left: 3px solid var(--vscode-charts-blue, #75beff); border-radius: 10px; padding: 6px 14px 10px; } .mermaid-look .scope.cat-errors { border-left-color: var(--vscode-editorWarning-foreground, #cca700); } .mermaid-look .scope.cat-transform { border-left-color: var(--vscode-editorWidget-border, #666); } /* The vscope is a plain block outside this mode; align-self on the head needs a flex parent, or the head stays a full-width block hugging the left edge. */ .mermaid-look .vscope { display: flex; flex-direction: column; align-items: center; } .mermaid-look .scope > .scope-head { /* centered above the content column — the entry curve is a short vertical, not a dive from the far-left corner of a wide box */ align-self: center; opacity: 0.75; border: none; padding: 0 0 6px; } /* ── the snake: the main line wrapped into rows (§2, §11) ──────────── */ .seq.measure { position: absolute; visibility: hidden; left: -10000px; top: 0; } .atom { display: inline-flex; align-items: center; flex: none; } .snake { display: flex; flex-direction: column; gap: 2px; width: max-content; max-width: 100%; } .snake-row { min-height: 34px; } /* The elbows at the ends of a wrapped row: they only hold the room the carriage return turns in, the overlay draws the turn itself. */ .wrap { flex: none; align-self: stretch; width: 14px; position: relative; min-height: 22px; } .wrap.out { margin-left: 2px; } .wrap.in { margin-right: 2px; } /* The lane between two rows the carriage return runs along; the overlay draws it, the lane only holds its height. Width is set inline to the actual row width. */ .uturn { position: relative; height: 24px; flex: none; } /* ── collapse (§4) ─────────────────────────────────────────────────── */ .fold { cursor: pointer; opacity: 0.6; padding: 0 3px; user-select: none; } .fold:hover { opacity: 1; } .node.collapsed { font-weight: 600; border-style: solid; } .scope.compact { display: flex; align-items: center; border: none; padding: 0; } .scope.compact > .scope-head { margin-bottom: 0; border: 1px solid var(--vscode-charts-blue, #75beff); border-radius: 4px; padding: 1px 6px; } .scope.compact.cat-errors > .scope-head { border-color: var(--vscode-editorWarning-foreground, #cca700); } /* ── insert slots and the palette (§8.4, §8.5) ─────────────────────── */ .slot { align-self: center; flex: none; width: 10px; height: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.1s; } .seq:hover > .slot { opacity: 0.45; } .slot:hover { opacity: 1 !important; } .slot.drop { opacity: 1 !important; } .slot-plus { font-weight: 700; color: var(--vscode-charts-blue, #75beff); pointer-events: none; } .slot.drop .slot-plus { color: var(--vscode-focusBorder); } [draggable="true"] { cursor: grab; } #overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 10; } #overlay.open { display: block; } .palette { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); width: 340px; max-height: 70vh; display: flex; flex-direction: column; background: var(--vscode-editorWidget-background, var(--vscode-editor-background)); border: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); } .palette-search { margin: 8px; background: var(--vscode-input-background); color: var(--vscode-input-foreground); border: 1px solid var(--vscode-input-border, transparent); border-radius: 2px; padding: 4px 8px; } .palette-list { overflow-y: auto; padding: 0 4px 8px; } .palette-cat { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55; margin: 8px 6px 3px; } .palette-item { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 3px; cursor: pointer; } .palette-item:hover { background: var(--vscode-list-hoverBackground); } .palette-hint { opacity: 0.55; font-size: 0.85em; } .panel-actions button.danger { margin-left: 6px; color: var(--vscode-editorError-foreground, #f66); } /* ── the context menu: editing verbs one right-click away ──────────── */ .ctx-menu { position: fixed; z-index: 30; min-width: 170px; background: var(--vscode-menu-background, var(--vscode-editorWidget-background)); color: var(--vscode-menu-foreground, var(--vscode-foreground)); border: 1px solid var(--vscode-menu-border, var(--vscode-editorWidget-border)); border-radius: 5px; padding: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); } .ctx-item { padding: 4px 12px; border-radius: 3px; cursor: pointer; white-space: nowrap; } .ctx-item:hover { background: var(--vscode-menu-selectionBackground, var(--vscode-list-hoverBackground)); color: var(--vscode-menu-selectionForeground, inherit); } .ctx-item.danger { color: var(--vscode-editorError-foreground, #f66); } /* while dragging, every drop slot lights up — mermaid mode included */ .dragging .slot { opacity: 0.55 !important; } /* ── selection and the properties panel (§8) ───────────────────────── */ .selected { outline: 2px solid var(--vscode-focusBorder) !important; outline-offset: 1px; } body.with-panel { padding-right: calc(var(--panel-width, 380px) + 12px); } #panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-width, 380px); overflow-y: auto; background: var(--vscode-sideBar-background, var(--vscode-editor-background)); border-left: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); padding: 8px 10px; box-sizing: border-box; } #panel:empty { display: none; } .panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; } .panel-type { font-weight: 600; } .panel-close { cursor: pointer; opacity: 0.6; padding: 2px 5px; } .panel-close:hover { opacity: 1; } .field { display: flex; flex-direction: column; gap: 2px; margin-bottom: 7px; } .field label { font-size: 0.85em; opacity: 0.75; } .field.undeclared label { font-style: italic; } .field .value { background: var(--vscode-input-background); color: var(--vscode-input-foreground); border: 1px solid var(--vscode-input-border, transparent); border-radius: 2px; padding: 3px 6px; font-family: var(--vscode-editor-font-family, monospace); font-size: 0.95em; } .field .value:focus { outline: 1px solid var(--vscode-focusBorder); } .field .value:disabled { opacity: 0.55; } .panel-section { margin: 12px 0 6px; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55; border-top: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); padding-top: 8px; } .content-row { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; } .content-type { flex: none; font-size: 0.8em; opacity: 0.6; min-width: 52px; } .content-row .value { flex: 1; min-width: 0; } .content-opaque { flex: 1; font-family: var(--vscode-editor-font-family, monospace); font-size: 0.85em; opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .content-remove { flex: none; cursor: pointer; opacity: 0.5; padding: 0 3px; } .content-remove:hover { opacity: 1; color: var(--vscode-editorError-foreground, #f66); } .content-add { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; } .content-add button { background: none; border: 1px dashed var(--vscode-descriptionForeground); color: var(--vscode-foreground); border-radius: 3px; padding: 1px 8px; cursor: pointer; font-size: 0.85em; opacity: 0.8; } .content-add button:hover { opacity: 1; border-style: solid; } .panel-actions { margin-top: 10px; border-top: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); padding-top: 8px; } .panel-actions button { background: var(--vscode-button-secondaryBackground, var(--vscode-button-background)); color: var(--vscode-button-secondaryForeground, var(--vscode-button-foreground)); border: none; border-radius: 3px; padding: 4px 10px; cursor: pointer; } /* ── whole-file states ─────────────────────────────────────────────── */ .notice { margin: 30px auto; max-width: 480px; text-align: center; opacity: 0.85; } .notice button { margin-top: 10px; background: var(--vscode-button-background); color: var(--vscode-button-foreground); border: none; border-radius: 3px; padding: 5px 12px; cursor: pointer; } /* ── the mermaid look over the snake: left to right, curves carry the flow ── */ /* the rows sit right under one another: the curve, not a gap, carries the eye across */ .mermaid-look.lr .snake { gap: 0; } /* a bracket reads left to right as well: its title first, the body beside it */ .mermaid-look.lr .scope { display: flex; flex-direction: row; align-items: center; gap: 30px; padding: 10px 16px; } .mermaid-look.lr .scope > .scope-head { align-self: center; padding: 0; margin: 0; } .mermaid-look .lbranch-head { /* the decision diamond, as in the top-down mermaid look */ position: relative; z-index: 1; flex: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--vscode-list-hoverBackground, var(--vscode-editorWidget-background)); padding: 14px 34px; white-space: nowrap; cursor: pointer; } /* ── tiles: one size for every step, a glyph and a short caption (owner, 2026-09-24) ── The glyph carries the color of its group, the tile stays neutral; the details of a step live in the tooltip and the properties panel. "stacked" puts the glyph over the caption, "inline" (root.tiles-inline) beside it. */ .tile { --tone: var(--vscode-descriptionForeground); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: none; box-sizing: border-box; width: 66px; height: 52px; padding: 4px 2px 3px; position: relative; cursor: pointer; white-space: nowrap; max-width: none; } .tile .glyph { display: block; width: 24px; height: 24px; flex: none; color: var(--tone); } .tile .glyph svg { display: block; width: 24px; height: 24px; } .tile .cap { font-size: 10.5px; line-height: 12px; max-width: 62px; overflow: hidden; text-overflow: ellipsis; color: var(--vscode-foreground); opacity: 0.9; } .tiles-inline .tile { flex-direction: row; justify-content: flex-start; gap: 6px; width: 108px; height: 30px; padding: 0 8px; } .tiles-inline .tile .glyph, .tiles-inline .tile .glyph svg { width: 20px; height: 20px; } .tiles-inline .tile .cap { font-size: 11.5px; line-height: 14px; max-width: 70px; } /* the colors of the groups: where the message comes from and goes, how it is routed, what is done to its data, what only watches, what handles failure */ .tone-in { --tone: var(--vscode-charts-green, #89d185); } .tone-out { --tone: var(--vscode-charts-blue, #3794ff); } .tone-inner { --tone: var(--vscode-charts-blue, #3794ff); } .tone-code { --tone: var(--vscode-charts-purple, #b180d7); } .tone-data { --tone: var(--vscode-charts-orange, #d18616); } .tone-route { --tone: var(--vscode-terminal-ansiCyan, #29b8db); } .tone-watch { --tone: var(--vscode-descriptionForeground, #9d9d9d); } .tone-error { --tone: var(--vscode-charts-red, #f14c4c); } .tone-muted { --tone: var(--vscode-descriptionForeground, #9d9d9d); } /* one neutral box for every tile, the group color as a soft border — beats the old category boxes (filled endpoints, diamonds, hexagons) in both looks */ .tile, .mermaid-look .tile, .mermaid-look .tile.branch-label, .mermaid-look .tile.vbranch-head, .mermaid-look .tile.lbranch-head, .mermaid-look .scope > .tile.scope-head, .scope.compact > .tile.scope-head { clip-path: none; background: var(--vscode-editorWidget-background, var(--vscode-editor-background)); color: var(--vscode-foreground); border: 1px solid color-mix(in srgb, var(--tone) 55%, transparent); border-radius: 7px; font-weight: 400; opacity: 1; box-shadow: none; } .mermaid-look .tile { padding: 4px 2px 3px; } .mermaid-look.tiles-inline .tile, .tiles-inline .mermaid-look .tile { padding: 0 8px; } .tile.tone-inner { border-style: dashed; } .tile.cat-unknown { border-style: dashed; } .tile.branch-label { max-width: none; } .tile:hover { outline: 1px solid var(--vscode-focusBorder); } /* the fold toggle and the counter ride the corners of a container tile */ .tile > .fold { position: absolute; top: 0; right: 2px; font-size: 10px; line-height: 12px; padding: 0 2px; } .tile > .badge { position: absolute; bottom: 1px; right: 4px; font-size: 9.5px; line-height: 11px; opacity: 0.8; } .tiles-inline .tile > .fold { top: 50%; transform: translateY(-50%); right: 3px; } .tiles-inline .tile > .badge { bottom: 0; right: 16px; } /* ── left to right: one top line through every row ───────────────────── Steps hang from the TOP of a row, so the line through the tiles stays straight however tall a container beside them is. A container's head tile sits on that line: the box starts 9px higher (its border and padding), every plain step drops 9px to meet it, and the body pulls up 9px so its first row is on the same line as the head. */ .mermaid-look.lr .snake-row, .mermaid-look.lr .atom { align-items: flex-start; } .mermaid-look.lr .atom > .node, .mermaid-look.lr .atom > .branching, .mermaid-look.lr .atom > .scope.compact { margin-top: 9px; } .mermaid-look.lr .atom > .slot { align-self: flex-start; margin-top: 27px; } .mermaid-look.lr .scope { align-items: flex-start; gap: 28px; padding: 8px 18px 10px 10px; } .mermaid-look.lr .scope.compact { padding: 0; gap: 0; align-items: center; } .mermaid-look.lr .scope > .scope-head { align-self: flex-start; } .mermaid-look.lr .scope > .snake { margin-top: -9px; } /* a container opening a container's body must not share its parent's top border */ .mermaid-look.lr .scope > .snake > .snake-row:first-child > .atom > .scope:not(.compact) { margin-top: 9px; } .mermaid-look.lr .branching { align-items: flex-start; gap: 30px; } .mermaid-look.lr .lstack { gap: 12px; } .mermaid-look.lr .branch { align-items: flex-start; } .mermaid-look.lr .branch > .snake { margin-top: -9px; } .mermaid-look.lr .snake-row { min-height: 70px; } .tiles-inline .mermaid-look.lr .snake-row, .mermaid-look.lr.tiles-inline .snake-row { min-height: 48px; } .mermaid-look.lr.tiles-inline .atom > .slot { margin-top: 16px; } /* ── top down: the tiles sit on the column spine ─────────────────────── */ .mermaid-look .vbranch-head.tile { padding: 4px 2px 3px; } .mermaid-look.tiles-inline .vbranch-head.tile { padding: 0 8px; } /* the caption on an edge: the loop's «repeat» */ .edge-overlay text.edge-label { fill: var(--vscode-descriptionForeground); font-size: 10px; font-family: var(--vscode-font-family); } /* the `end` tile of a wrapper: the same glyph, quieter — it closes, it does not act */ .tile.wrapper-end { border-style: dashed; opacity: 0.75; } .tile.wrapper-end .cap { font-size: 10px; } /* a row that closes a loop keeps room under it for the `repeat` lane */ .mermaid-look.lr .snake-row:has(> .atom > .wrapper-end[data-wrapper-type="loop"]) { padding-bottom: 28px; } /* a setter row in the panel: name, then `=` constant or `ƒ` expression, then the value */ .content-assign { display: flex; align-items: center; gap: 4px; flex: 1.6; min-width: 0; } .content-row .content-assign .content-kind { flex: none; width: 38px; } /* ── conditional paths (owner, 2026-09-24): where a message goes when the condition fails ── skip — the condition did not hold, the message goes past (filter, choice without otherwise, ofType, a duplicate at idempotentConsumer); drop — the message goes nowhere (sample, debounce); error — the step raises, the message goes to the catch / onException. */ .edge-overlay path.cond { fill: none; stroke-dasharray: 5 3; stroke-width: 1.5; } .edge-overlay path.cond.skip { stroke: var(--vscode-charts-orange, #d18616); } .edge-overlay path.cond.drop { stroke: var(--vscode-descriptionForeground, #9d9d9d); } .edge-overlay path.cond.error { stroke: var(--vscode-charts-red, #f14c4c); } .edge-overlay path.head.skip { fill: var(--vscode-charts-orange, #d18616); } .edge-overlay path.head.drop { fill: var(--vscode-descriptionForeground, #9d9d9d); } .edge-overlay path.head.error { fill: var(--vscode-charts-red, #f14c4c); } .edge-overlay text.edge-label.skip { fill: var(--vscode-charts-orange, #d18616); } .edge-overlay text.edge-label.error { fill: var(--vscode-charts-red, #f14c4c); } /* rows keep room under them for the lanes and stubs of conditional paths */ .mermaid-look.lr .snake-row:has(> .atom > [data-cond]), .mermaid-look.lr .snake-row:has(> .atom > .wrapper-open[data-wrapper-type="ofType"]), .mermaid-look.lr .snake-row:has(> .atom > .wrapper-open[data-wrapper-type="idempotentConsumer"]), .mermaid-look.lr .snake-row:has(> .atom > .branching[data-type="filter"]), .mermaid-look.lr .snake-row:has(> .atom > .branching[data-type="choice"]) { padding-bottom: 28px; } .content-row .content-kind-target { flex: none; width: 82px; } /* the grip on the panel's left edge: drag to widen, the width is remembered for all documents */ #panel-grip { position: fixed; top: 0; bottom: 0; right: var(--panel-width, 380px); width: 6px; margin-right: -3px; cursor: ew-resize; z-index: 5; display: none; } body.with-panel #panel-grip { display: block; } #panel-grip:hover, body.resizing-panel #panel-grip { background: var(--vscode-focusBorder); opacity: 0.6; } body.resizing-panel { cursor: ew-resize; user-select: none; } /* top down: the columns stand in the middle of the window, not against its left edge */ .vertical .routes-grid { justify-content: center; } /* ── top down, compact (owner, 2026-09-25: the gaps read as breaks) ───────── The insert slot takes no height of its own: it sits in the gap between two tiles (its negative margins cancel its height) and stays clickable there. One short gap per step is left for the arrow; a branch column no longer ends with a tall empty tail. */ .mermaid-look .vcol { row-gap: 12px; } .mermaid-look .vbranch > .vcol { margin-top: 6px; } .mermaid-look .vcol > .slot { height: 12px; margin: -6px 0; position: relative; z-index: 2; } .mermaid-look .vfan { margin-top: 22px; } /* ── folding, visible (owner, 2026-09-25: the tiny triangle did not tell folded from open) ── The toggle is a small boxed button in the tile's corner; a folded container looks like a stack of cards with the count of what it hides. */ .tile > .fold { top: 3px; right: 3px; width: 16px; height: 16px; padding: 0; font-size: 12px; line-height: 16px; text-align: center; border-radius: 4px; opacity: 1; color: var(--vscode-foreground); background: color-mix(in srgb, var(--vscode-foreground) 12%, transparent); } .tile > .fold:hover { background: var(--vscode-focusBorder); color: var(--vscode-button-foreground, #fff); } .tiles-inline .tile > .fold { top: 50%; transform: translateY(-50%); right: 4px; } /* a folded container: two cards peeking out behind it, and the count as a chip */ .tile.collapsed { box-shadow: 3px 3px 0 -1px var(--vscode-editorWidget-background, var(--vscode-editor-background)), 3px 3px 0 0 color-mix(in srgb, var(--tone) 55%, transparent), 6px 6px 0 -1px var(--vscode-editorWidget-background, var(--vscode-editor-background)), 6px 6px 0 0 color-mix(in srgb, var(--tone) 35%, transparent); } .tile.collapsed > .fold { background: var(--vscode-focusBorder); color: var(--vscode-button-foreground, #fff); } .tile.collapsed > .badge { bottom: auto; top: 3px; left: 3px; right: auto; min-width: 16px; height: 16px; padding: 0 3px; box-sizing: border-box; border-radius: 8px; font-size: 10px; line-height: 16px; text-align: center; opacity: 1; color: var(--vscode-button-foreground, #fff); background: var(--vscode-focusBorder); } .tiles-inline .tile.collapsed > .badge { top: 50%; transform: translateY(-50%); left: auto; right: 24px; } /* volume for a folded container: the stack of cards casts a soft shadow, it lifts off the graph */ .tile.collapsed { box-shadow: 3px 3px 0 -1px var(--vscode-editorWidget-background, var(--vscode-editor-background)), 3px 3px 0 0 color-mix(in srgb, var(--tone) 55%, transparent), 6px 6px 0 -1px var(--vscode-editorWidget-background, var(--vscode-editor-background)), 6px 6px 0 0 color-mix(in srgb, var(--tone) 35%, transparent), 4px 8px 14px 0 rgba(0, 0, 0, 0.45); } /* a whole route folds to its title line: the same boxed button as a container's fold */ .route-header { display: flex; align-items: center; gap: 6px; } .route-fold { display: inline-block; width: 16px; height: 16px; font-size: 12px; line-height: 16px; text-align: center; border-radius: 4px; cursor: pointer; user-select: none; font-weight: 400; color: var(--vscode-foreground); background: color-mix(in srgb, var(--vscode-foreground) 12%, transparent); } .route-fold:hover, .route-fold.folded { background: var(--vscode-focusBorder); color: var(--vscode-button-foreground, #fff); } .route-count { font-weight: 400; font-size: 10.5px; padding: 0 7px; border-radius: 8px; line-height: 16px; color: var(--vscode-button-foreground, #fff); background: var(--vscode-focusBorder); } .route-folded { margin: 2px 0 8px; } /* ── the properties panel as a property grid (owner, 2026-09-25: "деловые стили") ────── A sticky title with the step's glyph, then label | value rows on hairlines like the VS Code settings editor, section captions in small caps, and a sticky action bar at the bottom. */ #panel { padding: 0; display: flex; flex-direction: column; } #panel > * { flex: none; } .panel-head { position: sticky; top: 0; z-index: 3; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; background: var(--vscode-sideBar-background, var(--vscode-editor-background)); border-bottom: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); } .panel-head .glyph { width: 22px; height: 22px; flex: none; } .panel-head .glyph svg { width: 22px; height: 22px; display: block; } .panel-type { flex: 1; font-size: 13px; letter-spacing: 0.01em; } .panel-close { width: 22px; height: 22px; line-height: 22px; padding: 0; text-align: center; border-radius: 4px; } .panel-close:hover { background: color-mix(in srgb, var(--vscode-foreground) 12%, transparent); } #panel .field { display: grid; grid-template-columns: minmax(84px, 34%) 1fr; align-items: center; gap: 8px; margin: 0; padding: 5px 12px; border-bottom: 1px solid color-mix(in srgb, var(--vscode-editorWidget-border, #454545) 50%, transparent); } #panel .field:hover { background: color-mix(in srgb, var(--vscode-foreground) 4%, transparent); } #panel .field label { font-size: 12px; opacity: 0.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #panel .field .value, #panel .content-row .value { width: 100%; box-sizing: border-box; min-height: 24px; padding: 2px 7px; border-radius: 3px; border: 1px solid var(--vscode-input-border, color-mix(in srgb, var(--vscode-foreground) 16%, transparent)); background: var(--vscode-input-background); font-size: 12px; } #panel .field .value:focus, #panel .content-row .value:focus { outline: none; border-color: var(--vscode-focusBorder); } #panel .panel-section { margin: 0; padding: 12px 12px 5px; border-top: none; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; opacity: 0.6; } #panel .content-row { margin: 0; padding: 4px 12px; gap: 6px; border-bottom: 1px solid color-mix(in srgb, var(--vscode-editorWidget-border, #454545) 50%, transparent); } #panel .content-row:hover { background: color-mix(in srgb, var(--vscode-foreground) 4%, transparent); } #panel .content-add { padding: 8px 12px; margin: 0; } .panel-actions { position: sticky; bottom: 0; margin-top: auto !important; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--vscode-editorWidget-border, var(--vscode-panel-border)); background: var(--vscode-sideBar-background, var(--vscode-editor-background)); } .panel-actions button { padding: 5px 12px; border-radius: 3px; font-size: 12px; background: var(--vscode-button-background); color: var(--vscode-button-foreground); } .panel-actions button:hover { filter: brightness(1.1); } .panel-actions button.danger { margin-left: auto; background: transparent; color: var(--vscode-editorError-foreground, #f14c4c); border: 1px solid color-mix(in srgb, var(--vscode-editorError-foreground, #f14c4c) 60%, transparent); } .panel-actions button.danger:hover { background: color-mix(in srgb, var(--vscode-editorError-foreground, #f14c4c) 14%, transparent); filter: none; } .panel-head .glyph { color: var(--tone); } /* a setter row shares its width: kind | name | = / ƒ | value | ✕ — never 100% each */ #panel { overflow-x: hidden; } #panel .value { color: var(--vscode-input-foreground, var(--vscode-foreground)); } #panel select.value option { color: var(--vscode-foreground); background: var(--vscode-dropdown-background, var(--vscode-input-background)); } #panel .content-row { display: flex; align-items: center; } #panel .content-row > .value, #panel .content-row .content-assign .value { width: auto; min-width: 0; flex: 1 1 0; } #panel .content-row > .content-kind-target { flex: none; width: 84px; } #panel .content-row .content-assign { flex: 1.6 1 0; min-width: 0; display: flex; gap: 4px; } #panel .content-row .content-assign .content-kind { flex: none; width: 40px; } #panel .content-row > .content-type { flex: none; width: 64px; min-width: 0; } #panel .content-remove { flex: none; width: 16px; text-align: center; } #panel .content-row .content-assign .content-kind { width: 48px; padding: 2px 3px; } Path: redb-route/vscode-redb-route/media/graph.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/graph.js ---- // The webview side of the Ф8 graph: render, selection, the properties panel (§8) and the // four editing operations (§8.4) — insert via slots+palette, Delete, drag to reorder, drag // into/out of a bracket. Every edit is a message; the document state lives in the text // editor, never here. (function () { "use strict"; const vscode = acquireVsCodeApi(); const root = document.getElementById("root"); const panel = document.getElementById("panel"); // The shell may be a version older than this script (an extension update with the // window not yet reloaded) — never die on a missing container, build it. let overlay = document.getElementById("overlay"); if (!overlay) { overlay = document.createElement("div"); overlay.id = "overlay"; document.body.appendChild(overlay); } // ── tiles: one size for every step, a glyph and a short caption ────── // // The glyphs follow the Enterprise Integration Patterns notation (G. Hohpe, B. Woolf, // enterpriseintegrationpatterns.com, CC BY 4.0) redrawn as 24×24 line icons; the steps the // notation has no symbol for (set, log, delay, try…) are drawn in the same style. The stroke // takes currentColor, the tone class gives the color, so the theme decides light or dark. const GLYPHS = { consumer: '', endpoint: '', direct: '', channel: '', http: '', database: '', activator: '', tag: '', document: '', template: '', translator: '', json: '', router: '', when: '', otherwise: '', filter: '', loop: '', clock: '', history: '', gauge: '', log: '', shield: '', warning: '', flag: '', bolt: '', stop: '', splitter: '', aggregator: '', recipients: '', wiretap: '', enricher: '', eraser: '', check: '', lock: '', idempotent: '', throttle: '', route: '', unknown: '', }; /** The glyph and the color tone of a step; tones are the groups of the legend. */ const STEP_LOOK = { from: ["consumer", "in"], choice: ["router", "route"], when: ["when", "route"], otherwise: ["otherwise", "route"], filter: ["filter", "route"], ofType: ["filter", "route"], loop: ["loop", "route"], split: ["splitter", "route"], aggregate: ["aggregator", "route"], multicast: ["recipients", "route"], recipientList: ["recipients", "route"], routingSlip: ["recipients", "route"], dynamicRouter: ["router", "route"], scatterGather: ["recipients", "route"], loadBalance: ["recipients", "route"], resequence: ["aggregator", "route"], idempotentConsumer: ["idempotent", "route"], throttle: ["throttle", "route"], debounce: ["throttle", "route"], sample: ["throttle", "route"], threads: ["recipients", "route"], delay: ["clock", "route"], stop: ["stop", "route"], setProperty: ["tag", "data"], setProperties: ["tag", "data"], setHeader: ["tag", "data"], setHeaders: ["tag", "data"], setBody: ["document", "data"], transform: ["translator", "data"], convertBody: ["translator", "data"], marshal: ["translator", "data"], unmarshal: ["translator", "data"], normalize: ["translator", "data"], transformJson: ["json", "data"], payload: ["template", "data"], xslt: ["translator", "data"], removeHeader: ["eraser", "data"], removeHeaders: ["eraser", "data"], removeProperty: ["eraser", "data"], removeProperties: ["eraser", "data"], removeBody: ["eraser", "data"], sort: ["translator", "data"], claimCheck: ["enricher", "data"], enrich: ["enricher", "out"], pollEnrich: ["enricher", "out"], wireTap: ["wiretap", "out"], log: ["log", "watch"], metered: ["gauge", "watch"], traced: ["history", "watch"], messageHistory: ["history", "watch"], streamCaching: ["document", "watch"], tryCatch: ["shield", "error"], try: ["shield", "error"], catch: ["warning", "error"], finally: ["flag", "error"], throwException: ["bolt", "error"], onException: ["warning", "error"], onCompletion: ["flag", "error"], circuitBreaker: ["shield", "error"], validate: ["check", "error"], validateJsonSchema: ["check", "error"], validateXsd: ["check", "error"], transaction: ["lock", "error"], saga: ["lock", "error"], }; /** Transports by scheme — the tile of an endpoint step shows where the message goes. */ const SCHEME_GLYPH = { bean: "activator", sql: "database", jdbc: "database", redb: "database", http: "http", https: "http", rest: "http", soap: "http", grpc: "http", direct: "direct", seda: "direct", vm: "direct", "direct-vm": "direct", kafka: "channel", amqp: "channel", rabbitmq: "channel", ibmmq: "channel", sqs: "channel", sns: "channel", azureservicebus: "channel", mqtt: "channel", redis: "channel", jms: "channel", file: "document", ftp: "document", sftp: "document", s3: "document", timer: "clock", cron: "clock", quartz: "clock", }; /** The short caption under (or beside) the glyph: a word, not a sentence. */ const CAPTIONS = { setProperty: "set", setProperties: "set", setHeader: "set hdr", setHeaders: "set hdr", setBody: "set body", removeHeader: "rm hdr", removeHeaders: "rm hdrs", removeProperty: "rm prop", removeProperties: "rm props", removeBody: "rm body", convertBody: "convert", transformJson: "json", payload: "template", messageHistory: "history", tryCatch: "try-catch", throwException: "throw", idempotentConsumer: "idempotent", recipientList: "recipients", validateJsonSchema: "validate", validateXsd: "validate", onException: "on error", onCompletion: "on done", pollEnrich: "enrich", }; /** Glyph, tone and caption of a step: `type` is the element, `scheme` its transport. */ function lookOf(type, scheme, category) { let look = STEP_LOOK[type]; const endpoint = scheme && (type === "from" || type === "to" || type === "toD" || type === "wireTap" || type === "enrich" || type === "pollEnrich"); if (endpoint && type !== "from") { const tone = category === "userCode" ? "code" : category === "sendInternal" ? "inner" : "out"; look = [SCHEME_GLYPH[scheme] || "endpoint", tone]; } else if (!look) { look = category === "unknown" ? ["unknown", "muted"] : type === "to" || type === "toD" ? ["endpoint", "out"] : ["route", "muted"]; } const caption = endpoint && type !== "from" ? scheme : (CAPTIONS[type] || type); return { glyph: look[0], tone: look[1], caption: caption }; } function glyph(name) { const box = el("span", "glyph"); box.innerHTML = '"; return box; } /** * One tile: the glyph and the caption, the same size for every step. The details (the * property name, the condition, the SQL) live in the tooltip and the properties panel. */ function tile(type, scheme, category, tooltip, extraClass) { const look = lookOf(type, scheme, category); const box = el("span", "tile tone-" + look.tone + (extraClass ? " " + extraClass : "")); box.title = tooltip || type; box.appendChild(glyph(look.glyph)); box.appendChild(el("span", "cap", look.caption)); return box; } /** The width of one tile in the current look, matches .tile / .tiles-inline .tile in graph.css. */ function tileWidth() { return tileStyle === "inline" ? 108 : 66; } /** The element a branch label stands for: `when …` → when, `catch X` → catch. */ function branchType(label, parentType) { const first = (label || "").split(" ", 1)[0]; if (["when", "otherwise", "try", "catch", "finally"].includes(first)) return first; return parentType === "multicast" ? "multicast" : "when"; } let selectedKey = null; // "1,2,0" — survives full re-renders let selectedPath = null; let selectedGroup = null; // a run of assignments selected as one tile (its steps) // The properties panel is widened by dragging its left edge (owner, 2026-09-24: a dialog // would block clicking through the graph). The width is one choice for all documents. let panelWidth = 380; function applyPanelWidth() { document.body.style.setProperty("--panel-width", panelWidth + "px"); } applyPanelWidth(); (function panelGrip() { const grip = document.createElement("div"); grip.id = "panel-grip"; grip.title = "drag to resize the panel"; document.body.appendChild(grip); grip.addEventListener("mousedown", function (e) { e.preventDefault(); document.body.classList.add("resizing-panel"); function move(ev) { panelWidth = Math.round(Math.min(window.innerWidth * 0.75, Math.max(260, window.innerWidth - ev.clientX))); applyPanelWidth(); } function up() { document.body.classList.remove("resizing-panel"); window.removeEventListener("mousemove", move); window.removeEventListener("mouseup", up); vscode.postMessage({ type: "setPanelWidth", width: panelWidth }); rerender(); // the snake re-chunks for the new width } window.addEventListener("mousemove", move); window.addEventListener("mouseup", up); }); })(); let paletteData = []; // categories from the extension let dragKey = null; // the path being dragged (string key) let dragPath = null; let toggled = new Set(); // explicit collapse/expand toggles (workspaceState, Р5) // Two layouts, one look: the snake left to right (§2) and the columns top down, both drawn // the mermaid way. The plain snake with CSS elbows is gone (owner, 2026-09-20). let layout = "snake-mermaid"; const LAYOUTS = ["snake-mermaid", "mermaid"]; /** Left to right: the wrapping snake. The other layout is top down. */ function lrMermaid() { return layout === "snake-mermaid"; } // The tile look is the viewer's choice for every document (globalState): the glyph over the // caption ("stacked", square tiles) or beside it ("inline", one-line tiles). let tileStyle = "stacked"; const TILE_STYLES = ["stacked", "inline"]; let zoom = 1; // viewer zoom, workspaceState per doc like the layout let canvas = null; // the zoomed drawing surface, rebuilt on every render /** * §4 revisited with the snake in place: width no longer needs a depth default, so * everything renders EXPANDED unless the viewer folded it (the strip stays folded on * its own
). Toggles live in workspaceState. */ function isCollapsed(step) { return toggled.has(keyOf(step.path)); } function countSteps(step) { if (step.kind === "scope") return step.steps.length; if (step.kind === "branching") return step.branches.length; return 0; } /** Every container of the drawn file (scopes and branchings, nested ones too), by key. */ function containerKeys(graph) { const keys = []; function walk(steps) { (steps || []).forEach(function (step) { if (step.kind === "scope") { keys.push(keyOf(step.path)); walk(step.steps); } else if (step.kind === "branching") { keys.push(keyOf(step.path)); step.branches.forEach(function (b) { walk(b.steps); }); } }); } (graph.routes || []).forEach(function (r) { walk(r.steps); }); return keys; } /** Folds (true) or unfolds (false) every container at once; remembered like single toggles. */ function setAllCollapsed(collapsed) { if (!lastGraph) return; // folding all containers keeps the routes folded by hand; unfolding all opens everything const routes = Array.from(toggled).filter(function (k) { return k.indexOf("r:") === 0; }); toggled = new Set(collapsed ? containerKeys(lastGraph).concat(routes) : []); vscode.postMessage({ type: "setCollapsed", keys: Array.from(toggled) }); rerender(); } function collapseToggle(step) { const button = el("span", "fold", isCollapsed(step) ? "▸" : "▾"); button.title = isCollapsed(step) ? "folded — click to expand (" + countSteps(step) + (step.kind === "branching" ? " branches)" : " steps)") : "click to fold into one tile"; button.addEventListener("click", function (e) { e.stopPropagation(); const key = keyOf(step.path); if (toggled.has(key)) toggled.delete(key); else toggled.add(key); vscode.postMessage({ type: "toggleCollapse", key: key }); rerender(); }); return button; } function connector(kind) { // CSS elbows stretch to the row's full height, so tall scope rows stay visually // connected: out = center-right turning down, in = top-left turning right + arrow. const elbow = el("div", "wrap " + kind); if (kind === "in") elbow.appendChild(el("i")); return elbow; } let lastGraph = null; function rerender() { if (lastGraph) render(lastGraph); } // Re-chunk the snake on width changes (§2 wrap: the break point is COMPUTED from the // window, never stored - Р4 holds). let resizePending = null; window.addEventListener("resize", function () { clearTimeout(resizePending); resizePending = setTimeout(rerender, 150); }); /** The folded container: its tile with a counter badge (§4). */ function collapsedView(step) { const box = tile(step.type, null, step.category, (step.tooltip || step.type) + " — collapsed, " + countSteps(step) + (step.kind === "branching" ? " branch(es)" : " step(s)"), "node collapsed cat-" + step.category); box.appendChild(collapseToggle(step)); box.appendChild(el("span", "badge", String(countSteps(step)))); // a folded debounce / throttle still shows where a message may drop out or fail const cond = conditionOf(step.type, step.attrs); if (cond) box.dataset.cond = cond; selectable(box, step.path, step.span, "container"); draggable(box, step.path); return box; } function el(tag, className, text) { const node = document.createElement(tag); if (className) node.className = className; if (text !== undefined) node.textContent = text; return node; } function keyOf(path) { return path.join(","); } function reveal(span) { vscode.postMessage({ type: "reveal", start: span.start, end: span.end }); } function select(path) { selectedKey = keyOf(path); selectedPath = path; selectedGroup = null; highlightSelection(); vscode.postMessage({ type: "select", path: path }); } /** The panel's title: the step's glyph in its group color, then its name. */ function panelHeadTitle(head, type, scheme, text) { const look = lookOf(type, scheme, scheme === "bean" ? "userCode" : null); head.classList.add("tone-" + look.tone); head.appendChild(glyph(look.glyph)); head.appendChild(el("span", "panel-type", scheme && text === type ? text + " · " + scheme : text)); } /** A run of assignments is selected as one: its panel lists the rows, built here. */ function selectGroup(steps) { selectedKey = groupKey(steps); selectedPath = null; selectedGroup = steps; highlightSelection(); renderGroupPanel(steps); } /** Removes every element of a run in one message: the host does it bottom up. */ function removeGroup(steps) { vscode.postMessage({ type: "removeSteps", paths: steps.map(function (s) { return s.path; }) }); clearSelection(); } function revealGroup(steps) { reveal({ start: steps[0].span.start, end: steps[steps.length - 1].span.end }); } function openGroupMenu(x, y, steps) { closeContextMenu(); menuBox = el("div", "ctx-menu"); function item(label, action, danger) { const row = el("div", "ctx-item" + (danger ? " danger" : ""), label); row.addEventListener("click", function (e) { e.stopPropagation(); closeContextMenu(); action(); }); menuBox.appendChild(row); } const first = steps[0], last = steps[steps.length - 1]; item("Insert before", function () { openPalette({ parentPath: first.path.slice(0, -1), before: first.path[first.path.length - 1] }); }); item("Insert after", function () { openPalette({ parentPath: last.path.slice(0, -1), before: last.path[last.path.length - 1] + 1 }); }); item("Show in text", function () { revealGroup(steps); }); item("Delete all " + steps.length, function () { removeGroup(steps); }, true); document.body.appendChild(menuBox); const rect = menuBox.getBoundingClientRect(); menuBox.style.left = Math.min(x, window.innerWidth - rect.width - 6) + "px"; menuBox.style.top = Math.min(y, window.innerHeight - rect.height - 6) + "px"; } /** * The panel of a run: one row per element, in the file's order (the order matters — a * later row may read an earlier one), each with its name, `=` constant or `ƒ` expression, * and its value. Every edit goes to that element; the view is rebuilt from the file. */ function renderGroupPanel(steps) { panel.textContent = ""; if (!document.body.classList.contains("with-panel")) { document.body.classList.add("with-panel"); setTimeout(rerender, 0); } const head = el("div", "panel-head"); panelHeadTitle(head, steps[0].type, null, "set ×" + steps.length); const close = el("span", "panel-close", "✕"); close.addEventListener("click", clearSelection); head.appendChild(close); panel.appendChild(head); panel.appendChild(el("div", "panel-section", "rows, in order")); steps.forEach(function (step) { const row = contentRow({ path: step.path, type: "", text: null, name: step.assign.name, opaque: null, value: { attr: step.assign.attr, text: step.assign.text }, }, false); // the kind of the row: an exchange property or a message header — switching renames // the element ( <-> ), everything else stays const kind = el("select", "value content-kind-target"); [["setProperty", "property"], ["setHeader", "header"]].forEach(function (pair) { const o = el("option", null, pair[1]); o.value = pair[0]; kind.appendChild(o); }); kind.value = step.type; kind.title = "property: lives in the exchange only; header: travels with the message"; kind.addEventListener("change", function () { vscode.postMessage({ type: "renameElement", path: step.path, name: kind.value }); }); row.replaceChild(kind, row.querySelector(".content-type")); panel.appendChild(row); }); const actions = el("div", "panel-actions"); const show = el("button", null, "Show in text"); show.addEventListener("click", function () { revealGroup(steps); }); actions.appendChild(show); const removeButton = el("button", "danger", "Delete all " + steps.length); removeButton.addEventListener("click", function () { removeGroup(steps); }); actions.appendChild(removeButton); panel.appendChild(actions); } function clearSelection() { selectedKey = null; selectedPath = null; selectedGroup = null; panel.textContent = ""; if (document.body.classList.contains("with-panel")) { document.body.classList.remove("with-panel"); setTimeout(rerender, 0); } highlightSelection(); } function highlightSelection() { root.querySelectorAll(".selected").forEach(function (n) { n.classList.remove("selected"); }); if (selectedKey === null) return; const match = root.querySelector('[data-path="' + selectedKey + '"]'); if (match) match.classList.add("selected"); } function selectable(node, path, span, kind) { node.dataset.path = keyOf(path); node.addEventListener("click", function (e) { e.stopPropagation(); select(path); }); node.addEventListener("contextmenu", function (e) { e.preventDefault(); e.stopPropagation(); openContextMenu(e.clientX, e.clientY, path, span || null, kind || "step"); }); } // ── the context menu: the editing verbs one right-click away ───── let menuBox = null; function closeContextMenu() { if (menuBox) { menuBox.remove(); menuBox = null; } } function openContextMenu(x, y, path, span, kind) { closeContextMenu(); menuBox = el("div", "ctx-menu"); const parentPath = path.slice(0, -1); const index = path[path.length - 1]; function item(label, action, danger) { const row = el("div", "ctx-item" + (danger ? " danger" : ""), label); row.addEventListener("click", function (e) { e.stopPropagation(); closeContextMenu(); action(); }); menuBox.appendChild(row); } if (kind === "route" || kind === "container" || kind === "branch") { item("Insert inside (first)", function () { openPalette({ parentPath: path, before: 0 }); }); item("Insert inside (last)", function () { openPalette({ parentPath: path, before: 9999 }); }); } if (kind === "step" || kind === "container") { item("Insert before", function () { openPalette({ parentPath: parentPath, before: index }); }); item("Insert after", function () { openPalette({ parentPath: parentPath, before: index + 1 }); }); } if (span) item("Show in text", function () { reveal(span); }); if (kind !== "route") item("Delete", function () { vscode.postMessage({ type: "removeStep", path: path }); clearSelection(); }, true); document.body.appendChild(menuBox); const rect = menuBox.getBoundingClientRect(); menuBox.style.left = Math.min(x, window.innerWidth - rect.width - 6) + "px"; menuBox.style.top = Math.min(y, window.innerHeight - rect.height - 6) + "px"; } window.addEventListener("click", closeContextMenu); window.addEventListener("contextmenu", closeContextMenu); /** Drag source (§8.4: переставить/вложить): carries the element path. */ function draggable(node, path) { node.draggable = true; node.addEventListener("dragstart", function (e) { e.stopPropagation(); dragPath = path; dragKey = keyOf(path); root.classList.add("dragging"); e.dataTransfer.effectAllowed = "move"; e.dataTransfer.setData("text/plain", dragKey); }); node.addEventListener("dragend", function () { dragPath = null; dragKey = null; root.classList.remove("dragging"); }); } /** The «+» between steps: click opens the palette; a drag drops here. */ function slot(parentPath, before) { const s = el("div", "slot"); s.title = "insert here"; s.appendChild(el("span", "slot-plus", "+")); s.addEventListener("click", function (e) { e.stopPropagation(); openPalette({ parentPath: parentPath, before: before }); }); s.addEventListener("dragover", function (e) { if (dragPath === null) return; e.preventDefault(); e.stopPropagation(); s.classList.add("drop"); }); s.addEventListener("dragleave", function () { s.classList.remove("drop"); }); s.addEventListener("drop", function (e) { e.preventDefault(); e.stopPropagation(); s.classList.remove("drop"); if (dragPath === null) return; vscode.postMessage({ type: "moveStep", fromPath: dragPath, toParentPath: parentPath, before: before, }); dragPath = null; }); return s; } // ── graph rendering ────────────────────────────────────────────── function nodeView(step) { const box = tile(step.type, step.scheme || null, step.category, step.tooltip || step.type, "node cat-" + step.category); const cond = conditionOf(step.type, step.attrs); if (cond) box.dataset.cond = cond; // several assignments in one step: `set ×3`, the rows are in the tooltip and the panel if ((step.type === "setProperties" || step.type === "setHeaders") && /^×\d+$/.test(step.label || "")) box.querySelector(".cap").textContent += " " + step.label; selectable(box, step.path, step.span, "step"); draggable(box, step.path); return box; } /** A branch as a tile of its own kind: when / otherwise / try / catch / finally / 1, 2… */ function branchTile(branch, parentType) { const type = branchType(branch.label, parentType); const box = tile(type, null, parentType === "tryCatch" ? "errors" : "flow", branch.tooltip || branch.label, "branch-label" + (branch.warn ? " warn" : "")); if (type === "multicast") box.querySelector(".cap").textContent = branch.label; selectable(box, branch.path, branch.span, "branch"); return box; } /** * The horizontal line with insert slots: one before every step (its `before` is the * step's child-element index) and one append slot at the end. */ // ── the snake: the route's main line wraps like text, with a drawn U-turn ── /** * Builds a line as a SNAKE: atoms (slot+step, unbreakable) measured in the live root, * then chunked greedily into left-to-right rows by the width left at this nesting depth; * rows are joined by stretch elbows and a left spine says «still one line». RECURSIVE: * scope bodies and branch rows snake too, each one level deeper. */ function snakeSequence(steps, parentPath, available) { // The snake packs rows in LOCAL (unzoomed) units — the measure div sits in the // unzoomed root — so the viewport budget converts by the zoom factor. available = Math.max(240, available || (root.clientWidth - 44) / zoom); const entries = flatten(steps); const atoms = entries.map(function (entry) { const atom = el("span", "atom"); atom.appendChild(entrySlot(entry)); atom.appendChild(entryView(entry, function (step) { return stepView(step, available); })); return atom; }); const measure = el("div", "seq measure"); atoms.forEach(function (a) { measure.appendChild(a); }); root.appendChild(measure); const widths = atoms.map(function (a) { return a.getBoundingClientRect().width; }); root.removeChild(measure); // The edge is an empty gap the curve runs through; the turn is the room the carriage // return needs on the right of a row. const EDGE = 32, TURN = 40; const snake = el("div", "snake"); let row = null, used = 0, rowIndex = 0; function newRow(withEntry) { row = el("div", "seq snake-row"); if (withEntry) row.appendChild(connector("in")); snake.appendChild(row); used = withEntry ? 20 : 0; rowIndex++; } newRow(false); /** * A loop is kept on ONE row when it fits one: its return arrow then runs in a short * lane under that row instead of around the drawing. The width is the loop's whole * stretch, from its tile to its `end loop` tile. */ function loopWidth(i) { const entry = entries[i]; if (entry.role !== "open" || entry.step.type !== "loop") return 0; let w = 0; for (let j = i; j < entries.length; j++) { w += widths[j] + (j > i ? EDGE : 0); if (entries[j].role === "close" && entries[j].step === entry.step) return w; } return 0; } atoms.forEach(function (atom, i) { const need = widths[i] + (row.querySelector(".atom") ? EDGE : 0); const group = loopWidth(i); const keepLoop = group > 0 && used + EDGE + group + TURN > available && 20 + group + TURN <= available; if ((used + need + TURN > available || keepLoop) && row.querySelector(".atom")) { row.appendChild(connector("out")); // The RETURN lane: down at the row end, all the way back left, down into // the next row - the full carriage return the eye expects. const lane = el("div", "uturn"); lane.appendChild(el("i")); lane.style.width = (used + 16) + "px"; snake.appendChild(lane); newRow(true); } if (row.querySelector(".atom")) row.appendChild(el("div", "edge")); row.appendChild(atom); used += need; }); if (parentPath !== undefined) { // The append slot never breaks the line — it rides the last row. const tail = el("span", "atom"); tail.appendChild(slot(parentPath, 9999)); row.appendChild(tail); } return snake; } /** * No container draws a box (owner, 2026-09-24, after Talend/n8n). A wrapper (metered, * loop, split, transaction…) puts its steps into the enclosing line between an opening tile * and an `end` tile, and they wrap together with it — no stair of indents; a loop adds a * return arrow from its end to its start. Branchings keep their fan; a filter is a branching * with one branch and a bypass; a folded wrapper stays one tile. */ function flatten(steps) { const out = []; for (let i = 0; i < steps.length; i++) { const step = steps[i]; if (step.kind === "scope" && step.type !== "filter" && !isCollapsed(step)) { out.push({ role: "open", step: step }); out.push(...flatten(step.steps)); out.push({ role: "close", step: step }); continue; } // A run of assignments (setProperty and setHeader, mixed, in their order) is ONE tile // with rows, the Talend way (owner, 2026-09-24): the file keeps its elements, only // the view joins them. if (isAssignment(step)) { let j = i + 1; while (j < steps.length && isAssignment(steps[j])) j++; if (j - i >= 2) { out.push({ role: "group", step: step, steps: steps.slice(i, j) }); i = j - 1; continue; } } out.push({ role: "step", step: step }); } return out; } function isAssignment(step) { return step.kind === "leaf" && step.assign && (step.type === "setProperty" || step.type === "setHeader"); } /** The insert slot in front of an entry: before the step, or at the end of a wrapper. */ function entrySlot(entry) { const step = entry.step; if (entry.role === "close") return slot(step.path, 9999); return slot(step.path.slice(0, -1), step.path[step.path.length - 1]); } function entryView(entry, view) { if (entry.role === "open") return wrapperTile(entry.step, false); if (entry.role === "close") return wrapperTile(entry.step, true); if (entry.role === "group") return groupTile(entry.steps); return view(entry.step); } /** The row text of one assignment: a header marked, a constant quoted, an expression bare. */ function assignmentLine(step) { const a = step.assign; return (step.type === "setHeader" ? "header " : "") + a.name + " = " + (a.attr === "expr" ? a.text : '"' + a.text + '"'); } /** The key a group is selected by: its first element, marked so it never meets a step key. */ function groupKey(steps) { return "g:" + keyOf(steps[0].path); } /** One tile for a run of assignments: `set ×3`, the rows in the tooltip and the panel. */ function groupTile(steps) { const first = steps[0]; const oneKind = steps.every(function (s) { return s.type === first.type; }); const box = tile(first.type, null, first.category, ["set ×" + steps.length].concat(steps.map(assignmentLine)).join("\n"), "node cat-" + first.category); // all headers: `set hdr ×2`; properties or a mix: `set ×3` box.querySelector(".cap").textContent = (oneKind && first.type === "setHeader" ? "set hdr" : "set") + " ×" + steps.length; box.dataset.path = groupKey(steps); box.groupSteps = steps; box.addEventListener("click", function (e) { e.stopPropagation(); selectGroup(steps); }); box.addEventListener("contextmenu", function (e) { e.preventDefault(); e.stopPropagation(); openGroupMenu(e.clientX, e.clientY, steps); }); return box; } /** The opening or the closing tile of a wrapper; both select the wrapper itself. */ function wrapperTile(step, closing) { const box = tile(step.type, null, step.category, (closing ? "end of " : "") + (step.tooltip || step.type), "node wrapper-" + (closing ? "end" : "open") + " cat-" + step.category); box.dataset.wrapper = keyOf(step.path); box.dataset.wrapperType = step.type; if (closing) { const cap = box.querySelector(".cap"); cap.textContent = "end " + cap.textContent; // a consumer that lets duplicates through has no skip to draw if (step.type === "idempotentConsumer" && (step.attrs || {}).skipDuplicate === "false") box.dataset.noLane = "1"; } else { const cond = conditionOf(step.type, step.attrs); if (cond) box.dataset.cond = cond; box.appendChild(collapseToggle(step)); if (step.repeats) box.appendChild(el("span", "badge", "⟳")); if (step.parallel) box.appendChild(el("span", "badge", "∥")); } selectable(box, step.path, step.span, "container"); if (!closing) draggable(box, step.path); return box; } /** A filter drawn as a branching with its one conditional branch. */ function filterAsBranching(step) { return { kind: "branching", path: step.path, type: step.type, category: step.category, id: step.id, tooltip: step.tooltip, span: step.span, branches: [{ path: step.path, label: "when", tooltip: step.tooltip, warn: false, steps: step.steps, span: step.span, }], }; } /** A step that is not a wrapper (flatten() spliced those): a branching, a folded tile, a leaf. */ function stepView(step, available) { if (step.kind === "scope" || step.kind === "branching") { if (isCollapsed(step)) return collapsedView(step); if (step.kind === "scope") return branchingView(filterAsBranching(step), available); return branchingView(step, available); } return nodeView(step); } function branchingView(step, available) { const box = el("div", "branching"); box.dataset.path = keyOf(step.path); box.dataset.type = step.type; draggable(box, step.path); // The decision tile the fan starts from, with the stack of branches to the right. const head = tile(step.type, null, step.category, step.tooltip || step.type, "lbranch-head cat-" + step.category); head.appendChild(collapseToggle(step)); selectable(head, step.path, step.span, "container"); box.appendChild(head); const host = el("div", "lstack"); box.appendChild(host); step.branches.forEach(function (branch) { const row = el("div", "branch"); row.dataset.kind = branchType(branch.label, step.type); row.appendChild(branchTile(branch, step.type)); row.appendChild(el("div", "edge")); // the decision tile, the branch tile and the gaps take their share of the line row.appendChild(snakeSequence(branch.steps, branch.path, (available || root.clientWidth - 44) - (2 * tileWidth() + 96))); host.appendChild(row); }); return box; } function stripView(scope) { const details = el("details", "strip"); const summary = el("summary", null, scope.type + " " + (scope.label || "")); summary.title = scope.tooltip; details.appendChild(summary); details.appendChild(snakeSequence(scope.steps, scope.path, root.clientWidth - 60)); return details; } // ── a whole route folds to its header (owner, 2026-09-25) ───────── function routeKey(route) { return "r:" + keyOf(route.path); } function isRouteCollapsed(route) { return toggled.has(routeKey(route)); } /** All steps of a route, nested ones included — what a folded route hides. */ function countAllSteps(steps) { let n = 0; (steps || []).forEach(function (step) { n++; if (step.kind === "scope") n += countAllSteps(step.steps); else if (step.kind === "branching") step.branches.forEach(function (b) { n += countAllSteps(b.steps); }); }); return n; } /** The route's title line with its own fold button. */ function routeHeader(route) { const header = el("div", "route-header"); const folded = isRouteCollapsed(route); const button = el("span", "route-fold" + (folded ? " folded" : ""), folded ? "▸" : "▾"); button.title = folded ? "expand the route" : "fold the route to its title"; button.addEventListener("click", function (e) { e.stopPropagation(); const key = routeKey(route); if (toggled.has(key)) toggled.delete(key); else toggled.add(key); vscode.postMessage({ type: "toggleCollapse", key: key }); rerender(); }); header.appendChild(button); header.appendChild(document.createTextNode(route.id || "(no id)")); if (route.description) header.appendChild(el("span", "description", route.description)); if (folded) header.appendChild(el("span", "route-count", countAllSteps(route.steps) + " steps")); selectable(header, route.path, route.span, "route"); return header; } /** A folded route: its entry tile only — where the messages come from. */ function foldedRoute(route) { const line = el("div", "seq route-folded"); if (route.from) line.appendChild(nodeView(route.from)); return line; } function routeView(route) { const box = el("div", "route"); box.appendChild(routeHeader(route)); if (isRouteCollapsed(route)) { box.appendChild(foldedRoute(route)); return box; } route.strips.forEach(function (s) { box.appendChild(stripView(s)); }); const steps = route.from ? [route.from].concat(route.steps) : route.steps; box.appendChild(snakeSequence(steps, route.path, root.clientWidth - 44)); return box; } function beansRow(beans) { const row = el("div", "beans"); row.appendChild(el("span", "beans-title", "beans:")); beans.forEach(function (bean) { const chip = el("span", "bean-chip", "#" + bean.name); chip.title = bean.type; chip.addEventListener("click", function () { reveal(bean.span); }); row.appendChild(chip); }); return row; } // ── the vertical layout: TD columns, routes side by side ───────── function vedge() { return el("div", "vedge"); } function vstack(steps, parentPath) { const col = el("div", "vcol"); flatten(steps).forEach(function (entry, i) { if (i > 0) col.appendChild(vedge()); col.appendChild(entrySlot(entry)); col.appendChild(entryView(entry, stepViewV)); }); if (parentPath !== undefined) col.appendChild(slot(parentPath, 9999)); return col; } /** The top-down twin of stepView. */ function stepViewV(step) { if (step.kind === "scope" || step.kind === "branching") { if (isCollapsed(step)) return collapsedView(step); if (step.kind === "scope") return branchingViewV(filterAsBranching(step)); return branchingViewV(step); } return nodeView(step); } function branchingViewV(step) { const box = el("div", "vbranching cat-" + step.category); box.dataset.type = step.type; const head = tile(step.type, null, step.category, step.tooltip || step.type, "vbranch-head cat-" + step.category); head.appendChild(collapseToggle(step)); selectable(head, step.path, step.span, "container"); draggable(head, step.path); box.appendChild(head); const fan = el("div", "vfan"); step.branches.forEach(function (branch) { const column = el("div", "vbranch"); column.dataset.kind = branchType(branch.label, step.type); column.appendChild(branchTile(branch, step.type)); column.appendChild(vedge()); column.appendChild(vstack(branch.steps, branch.path)); fan.appendChild(column); }); box.appendChild(fan); return box; } function routeViewV(route) { const box = el("div", "routeV"); box.appendChild(routeHeader(route)); if (isRouteCollapsed(route)) { box.appendChild(foldedRoute(route)); return box; } route.strips.forEach(function (s) { box.appendChild(stripView(s)); }); const steps = route.from ? [route.from].concat(route.steps) : route.steps; box.appendChild(vstack(steps, route.path)); return box; } // ── the edges: orthogonal lines over the actual tile positions ── // // Every edge runs in straight segments with rounded corners (owner, 2026-09-24: a diagonal // across the drawing reads as a wire to nowhere). Three shapes cover the flow: // * a LINK between two steps: straight when they share a line, otherwise a step whose // cross segment runs right before the target, so several tails merging into one step // share it (the merge bus of a choice); // * a FAN from a decision tile to its branches: one trunk right after the tile; // * a container EXIT: from every inner tail along the inner edge of the container to its // exit port, never across the body. /** * The overlay both layouts draw into. It lives INSIDE the zoomed canvas, so every * coordinate is local. Engines disagree on whether client rects include an ancestor's CSS * zoom (the webview's engine: no), so the effective scale is MEASURED instead of assumed * to equal the zoom factor. */ function edgeOverlay() { const ns = "http://www.w3.org/2000/svg"; const svg = document.createElementNS(ns, "svg"); svg.setAttribute("class", "edge-overlay"); const canvasRect = canvas.getBoundingClientRect(); const scale = canvas.offsetWidth > 0 ? canvasRect.width / canvas.offsetWidth : 1; svg.setAttribute("width", String(canvasRect.width / scale)); svg.setAttribute("height", String(canvasRect.height / scale)); function local(x, y) { return { x: (x - canvasRect.left) / scale, y: (y - canvasRect.top) / scale }; } function rect(node) { const r = node.getBoundingClientRect(); const a = local(r.left, r.top), b = local(r.right, r.bottom); return { left: a.x, top: a.y, right: b.x, bottom: b.y, cx: (a.x + b.x) / 2, cy: (a.y + b.y) / 2, }; } function add(d, className) { const path = document.createElementNS(ns, "path"); path.setAttribute("d", d); if (className) path.setAttribute("class", className); else path.setAttribute("fill", "none"); svg.appendChild(path); } /** The arrowhead at `end`, pointing along the unit direction (dx, dy). */ function arrow(end, dx, dy, kind) { const px = -dy, py = dx; add("M" + (end.x - dx * 5 + px * 3.5) + " " + (end.y - dy * 5 + py * 3.5) + " L" + end.x + " " + end.y + " L" + (end.x - dx * 5 - px * 3.5) + " " + (end.y - dy * 5 - py * 3.5) + " Z", "head" + (kind ? " " + kind : "")); } /** * A polyline through the points with rounded corners; `withArrow` puts a head at the * end. Repeated points and points on one line are dropped first. `kind` colors a * conditional path: `skip` (the condition did not hold), `drop`, `error`. */ function ortho(points, withArrow, kind) { const pts = []; points.forEach(function (p) { const q = { x: Math.round(p.x * 2) / 2, y: Math.round(p.y * 2) / 2 }; const last = pts[pts.length - 1]; if (last && Math.abs(last.x - q.x) < 0.5 && Math.abs(last.y - q.y) < 0.5) return; if (pts.length >= 2) { const prev = pts[pts.length - 2]; const collinear = (Math.abs(prev.x - last.x) < 0.5 && Math.abs(last.x - q.x) < 0.5) || (Math.abs(prev.y - last.y) < 0.5 && Math.abs(last.y - q.y) < 0.5); if (collinear) pts.pop(); } pts.push(q); }); if (pts.length < 2) return; let d = "M" + pts[0].x + " " + pts[0].y; for (let i = 1; i < pts.length - 1; i++) { const p = pts[i], prev = pts[i - 1], next = pts[i + 1]; const inLen = Math.abs(p.x - prev.x) + Math.abs(p.y - prev.y); const outLen = Math.abs(next.x - p.x) + Math.abs(next.y - p.y); const radius = Math.min(6, inLen / 2, outLen / 2); const inX = Math.sign(p.x - prev.x), inY = Math.sign(p.y - prev.y); const outX = Math.sign(next.x - p.x), outY = Math.sign(next.y - p.y); d += " L" + (p.x - inX * radius) + " " + (p.y - inY * radius) + " Q" + p.x + " " + p.y + " " + (p.x + outX * radius) + " " + (p.y + outY * radius); } const end = pts[pts.length - 1], before = pts[pts.length - 2]; const dx = Math.sign(end.x - before.x), dy = Math.sign(end.y - before.y); add(d + " L" + (end.x - (withArrow ? dx * 4 : 0)) + " " + (end.y - (withArrow ? dy * 4 : 0)), kind ? "cond " + kind : null); if (withArrow) arrow(end, dx, dy, kind); } /** The end of a path that goes nowhere: a small cross (a dropped message). */ function cross(p, kind) { add("M" + (p.x - 4) + " " + (p.y - 4) + " L" + (p.x + 4) + " " + (p.y + 4) + " M" + (p.x + 4) + " " + (p.y - 4) + " L" + (p.x - 4) + " " + (p.y + 4), "cond " + kind); } /** A short caption on an edge (the loop's «repeat»). */ function label(x, y, text, vertical, kind) { const t = document.createElementNS(ns, "text"); t.setAttribute("x", String(x)); t.setAttribute("y", String(y)); if (vertical) t.setAttribute("transform", "rotate(-90 " + x + " " + y + ")"); t.setAttribute("class", "edge-label" + (kind ? " " + kind : "")); t.textContent = text; svg.appendChild(t); } return { local: local, rect: rect, ortho: ortho, label: label, cross: cross, done: function () { canvas.appendChild(svg); }, }; } /** The branch rows (LR) or columns (TD) of a branching box. */ function branchesOf(box, vertical) { return Array.from(box.querySelectorAll(vertical ? ":scope > .vfan > .vbranch" : ":scope > .lstack > .branch")); } /** * Which branches the flow LEAVES a branching through: every one of them, a tryCatch * included. Leaving through the finally alone left the try and catch tails hanging (owner, * 2026-09-24): no line can run from them back up into the finally without crossing. */ function leavingBranches(box, vertical) { return branchesOf(box, vertical); } /** * A branching also left by a message NO branch took: a filter's rejected message, a * choice without `otherwise` when no `when` matched. The path starts at its tile. */ function bypassOf(box, vertical) { const noOtherwise = box.dataset.type === "choice" && !branchesOf(box, vertical).some(function (b) { return b.dataset.kind === "otherwise"; }); if (box.dataset.type !== "filter" && !noOtherwise) return null; return box.querySelector(vertical ? ":scope > .vbranch-head" : ":scope > .lbranch-head"); } /** The caption of a bypass: what kind of message takes it. */ function bypassLabel(box) { return box.dataset.type === "filter" ? "not passed" : "no match"; } /** * The lanes a wrapper draws between its tile and its `end` tile: the loop's return, and the * skip of a wrapper that lets some messages past its body. */ const WRAPPER_LANES = { loop: { back: true, kind: null, label: "repeat" }, ofType: { back: false, kind: "skip", label: "other type" }, idempotentConsumer: { back: false, kind: "skip", label: "duplicate" }, }; /** * The conditional path of one step, if it has one: `drop` — the message may go nowhere * (sample, debounce); `error` — the step may raise (validate unless told not to, throw, * a throttle that rejects on overflow). */ function conditionOf(type, attrs) { attrs = attrs || {}; if (type === "sample" || type === "debounce") return "drop"; if (type === "throwException") return "error"; if ((type === "validate" || type === "validateJsonSchema" || type === "validateXsd") && attrs.throwOnFailure !== "false") return "error"; if (type === "throttle" && attrs.rejectOnOverflow === "true") return "error"; return null; } /** The short stubs of the `drop` and `error` paths, out of the tile that has one. */ function drawConditionStubs(o, vertical) { canvas.querySelectorAll("[data-cond]").forEach(function (t) { const kind = t.dataset.cond; const r = o.rect(t); const text = kind === "drop" ? "dropped" : errorTarget(t); if (vertical) { const a = { x: r.right, y: r.cy + 10 }, b = { x: r.right + 18, y: r.cy + 10 }; if (kind === "drop") { o.ortho([a, b], false, kind); o.cross({ x: b.x + 4, y: b.y }, kind); } else o.ortho([a, b], true, kind); o.label(b.x + 10, b.y + 3, text, false, kind); } else { const a = { x: r.cx + 14, y: r.bottom }, b = { x: r.cx + 14, y: r.bottom + 14 }; if (kind === "drop") { o.ortho([a, b], false, kind); o.cross({ x: b.x, y: b.y + 4 }, kind); } else o.ortho([a, b], true, kind); o.label(b.x + 6, b.y + 4, text, false, kind); } }); } /** * Where an error raised by a step goes: the catch of the nearest try-catch whose try branch * holds it, else the file's onException, else out of the route. */ function errorTarget(tile) { const tryBranch = tile.closest('.branch[data-kind="try"], .vbranch[data-kind="try"]'); if (tryBranch) { const box = tryBranch.closest(".branching, .vbranching"); if (box && box.dataset.type === "tryCatch" && branchesOf(box, box.classList.contains("vbranching")).some(function (b) { return b.dataset.kind === "catch"; })) return "→ catch"; } return canvas.querySelector(".strip") ? "→ onException" : "→ error"; } /** * Top-down: the column's spine. A tile hands the flow on from its bottom middle, a container * from the middle of its bottom edge; the flow enters a step at its top middle. */ function drawCurvedEdges() { const o = edgeOverlay(); const stepSelector = ":scope > .node, :scope > .scope, :scope > .vbranching"; const innerSelector = ":scope > .vcol > .node, :scope > .vcol > .scope, :scope > .vcol > .vbranching"; const GAP = 13; function top(node) { const r = o.rect(node); return { x: r.cx, y: r.top }; } function bottom(node) { const r = o.rect(node); return { x: r.cx, y: r.bottom }; } /** Where the flow enters a step: a branching through its decision tile. */ function entryOf(step) { return step.classList.contains("vbranching") ? step.querySelector(":scope > .vbranch-head") || step : step; } /** The visual EXITS of a step: a branching merges from the tails of its leaving branches. */ function exitsOf(step) { if (!step.classList.contains("vbranching") || !step.querySelector(":scope > .vfan")) return [step]; const exits = []; leavingBranches(step, true).forEach(function (branch) { const steps = branch.querySelectorAll(innerSelector); if (steps.length > 0) exits.push(...exitsOf(steps[steps.length - 1])); else { const label = branch.querySelector(":scope > .branch-label"); if (label) exits.push(label); } }); // a filter, a choice without otherwise: the bypass is an exit too (see the LR twin) const head = bypassOf(step, true); if (head) exits.push({ bypass: step, head: head }); return exits.length > 0 ? exits : [step]; } /** * Where a path out of an exit starts: a tile's bottom middle, or — a bypass — out of the * decision tile to the right and down past the whole branching. */ const bypassLabelled = new Set(); function exitStart(from) { if (!from.bypass) return { lead: [], end: bottom(from), kind: null }; const box = o.rect(from.bypass), h = o.rect(from.head); const x = box.right + 10; if (!bypassLabelled.has(from.bypass)) { bypassLabelled.add(from.bypass); o.label(x + 4, h.cy - 4, bypassLabel(from.bypass), false, "skip"); } return { lead: [{ x: h.right, y: h.cy }, { x: x, y: h.cy }], end: { x: x, y: box.bottom + 6 }, kind: "skip" }; } /** Down from an exit to b: straight on one spine, else across right above the target. */ function link(from, b) { const s = exitStart(from), a = s.end; if (!s.kind && Math.abs(a.x - b.x) < 1.5) { o.ortho([a, { x: a.x, y: b.y }], true); return; } const busY = Math.max(a.y + 6, b.y - GAP); o.ortho(s.lead.concat([a, { x: a.x, y: busY }, { x: b.x, y: busY }, b]), true, s.kind); } canvas.querySelectorAll(".vcol").forEach(function (col) { const steps = col.querySelectorAll(stepSelector); for (let i = 1; i < steps.length; i++) { const target = top(entryOf(steps[i])); exitsOf(steps[i - 1]).forEach(function (from) { link(from, target); }); } }); // The loop returns: from its `end loop` tile out to the right of everything between the // two tiles, up, and into the `loop` tile from its right (the left edge of a column is // often the edge of the drawing). // The same lane carries the skip of a wrapper that lets a message past its body // (ofType: another type, idempotentConsumer: a duplicate), from its tile to its end. canvas.querySelectorAll(".wrapper-end").forEach(function (end) { const lane = WRAPPER_LANES[end.dataset.wrapperType]; if (!lane || end.dataset.noLane) return; const open = canvas.querySelector('.wrapper-open[data-wrapper="' + end.dataset.wrapper + '"]'); if (!open || open.parentElement !== end.parentElement) return; const items = Array.from(end.parentElement.children); let right = Math.max(o.rect(open).right, o.rect(end).right); for (let i = items.indexOf(open) + 1; i < items.indexOf(end); i++) if (items[i].matches(".node, .scope, .vbranching")) right = Math.max(right, o.rect(items[i]).right); const e = o.rect(end), s = o.rect(open); const x = right + (lane.kind ? 34 : 22); const from = lane.back ? e : s, to = lane.back ? s : e; o.ortho([{ x: from.right, y: from.cy }, { x: x, y: from.cy }, { x: x, y: to.cy }, { x: to.right, y: to.cy }], true, lane.kind); o.label(x + 11, (e.cy + s.cy) / 2 + 16, lane.label, true, lane.kind); }); drawConditionStubs(o, true); canvas.querySelectorAll(".vbranching").forEach(function (box) { const head = box.querySelector(":scope > .vbranch-head"); if (!head) return; const h = bottom(head); const trunkY = h.y + GAP; branchesOf(box, true).forEach(function (branch) { const label = branch.querySelector(":scope > .branch-label"); if (!label) return; const t = top(label); o.ortho([h, { x: h.x, y: trunkY }, { x: t.x, y: trunkY }, t], true); const first = branch.querySelector(innerSelector); if (first) link(label, top(entryOf(first))); }); }); o.done(); } /** * Left to right over the snake: a tile hands the flow on from its right middle, a container * from its right edge at the height of its head tile; a wrapped row returns along the lane * between the rows. */ function drawCurvedEdgesLR() { const o = edgeOverlay(); const stepSelector = ":scope > .atom > .node, :scope > .atom > .scope, :scope > .atom > .branching"; const GAP = 14; function rowsOf(snake) { return Array.from(snake.querySelectorAll(":scope > .snake-row")); } function stepsOf(row) { return Array.from(row.querySelectorAll(stepSelector)); } function firstStepOf(snake) { for (const row of rowsOf(snake)) { const steps = stepsOf(row); if (steps.length > 0) return steps[0]; } return null; } function lastStepOf(snake) { const rows = rowsOf(snake); for (let i = rows.length - 1; i >= 0; i--) { const steps = stepsOf(rows[i]); if (steps.length > 0) return steps[steps.length - 1]; } return null; } /** Where the flow enters a step: a branching through its decision tile. */ function entryOf(step) { return step.classList.contains("branching") ? step.querySelector(":scope > .lbranch-head") || step : step; } function leftPort(step) { const r = o.rect(entryOf(step)); return { x: r.left, y: r.cy }; } function rightPort(node) { const r = o.rect(node); return { x: r.right, y: r.cy }; } /** * The visual EXITS of a step: a branching merges from the tails of its leaving branches, * and — a filter, a choice without otherwise — from its bypass too (`{ bypass, head }`), * so the bypass follows the flow wherever the branches' tails go: the next step, the * wrapped row, the tails of an enclosing branching. */ function exitsOf(step) { if (!step.classList.contains("branching") || !step.querySelector(":scope > .lstack")) return [step]; const exits = []; leavingBranches(step, false).forEach(function (branch) { const snake = branch.querySelector(":scope > .snake"); const last = snake ? lastStepOf(snake) : null; if (last) exits.push(...exitsOf(last)); else { const label = branch.querySelector(":scope > .branch-label"); if (label) exits.push(label); } }); const head = bypassOf(step, false); if (head) exits.push({ bypass: step, head: head }); return exits.length > 0 ? exits : [step]; } /** * Where a path out of an exit starts. A tile or tail leaves from its right middle; a * bypass leaves its decision tile downward and runs under the whole branching first. */ const bypassLabelled = new Set(); function exitStart(from) { if (!from.bypass) return { lead: [], end: rightPort(from), kind: null }; const box = o.rect(from.bypass), h = o.rect(from.head); const y = box.bottom + 8; if (!bypassLabelled.has(from.bypass)) { bypassLabelled.add(from.bypass); o.label(h.cx + 6, y - 3, bypassLabel(from.bypass), false, "skip"); } return { lead: [{ x: h.cx, y: h.bottom }], end: { x: h.cx, y: y }, kind: "skip" }; } /** Right from an exit to b: straight on one line, else a step right before the target. */ function link(from, b) { const s = exitStart(from), a = s.end; if (!s.kind && Math.abs(a.y - b.y) < 1.5) { o.ortho([a, { x: b.x, y: a.y }], true); return; } const busX = Math.max(a.x + 6, b.x - GAP); o.ortho(s.lead.concat([a, { x: busX, y: a.y }, { x: busX, y: b.y }, b]), true, s.kind); } canvas.querySelectorAll(".snake").forEach(function (snake) { const rows = rowsOf(snake); rows.forEach(function (row, r) { const steps = stepsOf(row); for (let i = 1; i < steps.length; i++) { const target = leftPort(steps[i]); exitsOf(steps[i - 1]).forEach(function (from) { link(from, target); }); } // The wrapped line: out on the right, back along the lane between the rows, // down, and into the first step of the next row. const next = rows[r + 1] ? stepsOf(rows[r + 1]) : []; if (steps.length === 0 || next.length === 0) return; const target = leftPort(next[0]); const rowBox = o.rect(row); const nextBox = o.rect(rows[r + 1]); const laneY = (rowBox.bottom + nextBox.top) / 2; const leftX = Math.min(nextBox.left, target.x - GAP); exitsOf(steps[steps.length - 1]).forEach(function (from) { const s = exitStart(from), a = s.end; const rightX = Math.max(rowBox.right, a.x) + 8; o.ortho(s.lead.concat([a, { x: rightX, y: a.y }, { x: rightX, y: laneY }, { x: leftX, y: laneY }, { x: leftX, y: target.y }, target]), true, s.kind); }); }); }); // The loop returns: from its `end loop` tile down under the row, back left and up into // the `loop` tile — the flowchart way. // The same lane carries the skip of a wrapper that lets a message past its body // (ofType: another type, idempotentConsumer: a duplicate), from its tile to its end. /** Under the tallest thing in a row, inside the room the row keeps for a lane. */ /** * Under the tallest step the lane passes: only the steps between its two tiles * (`from`/`to`, either may sit on another row — then the rest of this row counts), not * the whole row, so a tall branching elsewhere in the row does not push the lane down. */ function laneUnder(row, from, to) { const steps = Array.from(row.querySelectorAll(":scope > .atom > .node, :scope > .atom > .branching")); let i = from ? steps.indexOf(from) : -1, j = to ? steps.indexOf(to) : -1; if (i < 0) i = 0; if (j < 0) j = steps.length - 1; let lowest = 0; for (let k = Math.min(i, j); k <= Math.max(i, j); k++) lowest = Math.max(lowest, o.rect(steps[k]).bottom); return lowest + 12; } canvas.querySelectorAll(".wrapper-end").forEach(function (end) { const lane = WRAPPER_LANES[end.dataset.wrapperType]; if (!lane || end.dataset.noLane) return; const open = canvas.querySelector('.wrapper-open[data-wrapper="' + end.dataset.wrapper + '"]'); const row = end.closest(".snake-row"); const openRow = open ? open.closest(".snake-row") : null; if (!open || !row || !openRow) return; const e = o.rect(end), s = o.rect(open); // the skip runs a little left of the middle, clear of the loop's lane ends const ex = lane.back ? e.cx : e.cx - 10, sx = lane.back ? s.cx : s.cx - 10; if (openRow === row) { const y = laneUnder(row, open, end) + (lane.kind ? 8 : 0); const pts = [{ x: ex, y: e.bottom }, { x: ex, y: y }, { x: sx, y: y }, { x: sx, y: s.bottom }]; o.ortho(lane.back ? pts : pts.reverse(), true, lane.kind); o.label(sx + 8, y + 11, lane.label, false, lane.kind); return; } // The two tiles sit on different rows: around the right of the line, entering the // later-drawn tile from above, so the lane never crosses the rows in between. const rightX = o.rect(row.closest(".snake")).right + (lane.kind ? 26 : 16); if (lane.back) { const y = laneUnder(row, null, end), topY = s.top - 9; o.ortho([{ x: ex, y: e.bottom }, { x: ex, y: y }, { x: rightX, y: y }, { x: rightX, y: topY }, { x: sx, y: topY }, { x: sx, y: s.top }], true, lane.kind); o.label(rightX + 4, (y + topY) / 2, lane.label, false, lane.kind); } else { const y = laneUnder(openRow, open, null) + 8, topY = e.top - 9; o.ortho([{ x: sx, y: s.bottom }, { x: sx, y: y }, { x: rightX, y: y }, { x: rightX, y: topY }, { x: ex, y: topY }, { x: ex, y: e.top }], true, lane.kind); o.label(rightX + 4, (y + topY) / 2, lane.label, false, lane.kind); } }); drawConditionStubs(o, false); canvas.querySelectorAll(".branching").forEach(function (box) { const head = box.querySelector(":scope > .lbranch-head"); if (!head) return; const h = rightPort(head); const trunkX = h.x + GAP; branchesOf(box, false).forEach(function (branch) { const label = branch.querySelector(":scope > .branch-label"); if (!label) return; const l = leftPort(label); o.ortho([h, { x: trunkX, y: h.y }, { x: trunkX, y: l.y }, l], true); const snake = branch.querySelector(":scope > .snake"); const first = snake ? firstStepOf(snake) : null; if (first) link(label, leftPort(first)); }); }); o.done(); } /** * Draws the edges and draws them again if drawing moved the tiles: the overlay makes the * page taller, a scrollbar appears, the window narrows and centered columns shift — the * lines must follow the tiles where they finally stand. */ let edgeDraw = null; // the edge painter of the current layout, for redraws let edgeProbe = null; // where the first tile of the routes stood when the edges were drawn /** The first tile of the routes (not of the strip above them): what moves when the layout does. */ function probeTile() { return canvas && canvas.querySelector(".route .node, .routeV .node"); } function probeAt() { const probe = probeTile(); if (!probe) return null; const r = probe.getBoundingClientRect(); return { left: r.left, top: r.top }; } function redrawEdges() { if (!canvas || !edgeDraw) return; canvas.querySelectorAll(":scope > .edge-overlay").forEach(function (svg) { svg.remove(); }); edgeDraw(); edgeProbe = probeAt(); } /** Redraws when the tiles moved since the last drawing, horizontally or vertically. */ function followTiles() { const now = probeAt(); if (now && edgeProbe && (Math.abs(now.left - edgeProbe.left) > 0.5 || Math.abs(now.top - edgeProbe.top) > 0.5)) redrawEdges(); } function settleEdges(draw) { edgeDraw = draw; redrawEdges(); // the tiles may still move after this frame (a scrollbar appearing narrows the window, // centered columns shift): check once the layout has settled and follow them requestAnimationFrame(followTiles); } // any later change of the drawing's box (the window, the panel, a scrollbar, the strip // above the routes opening) redraws the lines where the tiles now stand if (typeof ResizeObserver === "function") { let pendingEdges = null; new ResizeObserver(function () { cancelAnimationFrame(pendingEdges); pendingEdges = requestAnimationFrame(followTiles); }).observe(root); } // the strip (onException…) opening or closing pushes every route down or up document.addEventListener("toggle", function (e) { if (e.target && e.target.classList && e.target.classList.contains("strip")) requestAnimationFrame(followTiles); }, true); // ── the layout toggle ──────────────────────────────────────────── function toolbar() { const bar = el("div", "toolbar"); [["snake-mermaid", "⇢ mermaid"], ["mermaid", "⇣ mermaid"]].forEach(function (pair) { const button = el("button", layout === pair[0] ? "active" : "", pair[1]); button.addEventListener("click", function () { if (layout === pair[0]) return; layout = pair[0]; vscode.postMessage({ type: "setLayout", layout: layout }); rerender(); }); bar.appendChild(button); }); // fold or unfold every container of the file at once const folds = el("span", "zoom-box"); [["⊟", "collapse all containers", true], ["⊞", "expand all containers", false]].forEach(function (f) { const button = el("button", "", f[0]); button.title = f[1]; button.addEventListener("click", function () { setAllCollapsed(f[2]); }); folds.appendChild(button); }); bar.appendChild(folds); const tiles = el("span", "zoom-box"); [["stacked", "▦", "glyph over the caption"], ["inline", "▭", "glyph beside the caption"]].forEach(function (t) { const button = el("button", tileStyle === t[0] ? "active" : "", t[1]); button.title = t[2]; button.addEventListener("click", function () { if (tileStyle === t[0]) return; tileStyle = t[0]; vscode.postMessage({ type: "setTileStyle", tileStyle: tileStyle }); rerender(); }); tiles.appendChild(button); }); bar.appendChild(tiles); const zoomBox = el("span", "zoom-box"); function zoomButton(text, factor) { const b = el("button", "", text); b.addEventListener("click", function () { setZoomLevel(zoom * factor); }); return b; } zoomBox.appendChild(zoomButton("−", 1 / 1.2)); const pct = el("button", "zoom-pct", Math.round(zoom * 100) + "%"); pct.title = "reset zoom"; pct.addEventListener("click", function () { setZoomLevel(1); }); zoomBox.appendChild(pct); zoomBox.appendChild(zoomButton("+", 1.2)); bar.appendChild(zoomBox); return bar; } function setZoomLevel(k) { k = Math.round(Math.min(2.5, Math.max(0.4, k)) * 100) / 100; if (k === zoom) return; zoom = k; vscode.postMessage({ type: "setZoom", zoom: zoom }); rerender(); } // Ctrl+wheel (a trackpad pinch arrives the same way) zooms the canvas. window.addEventListener("wheel", function (e) { if (!e.ctrlKey) return; e.preventDefault(); setZoomLevel(zoom * (e.deltaY < 0 ? 1.1 : 1 / 1.1)); }, { passive: false }); function render(graph) { root.textContent = ""; const columnar = layout === "mermaid"; root.classList.toggle("vertical", columnar); root.classList.toggle("mermaid-look", columnar || lrMermaid()); root.classList.toggle("lr", lrMermaid()); root.classList.toggle("tiles-inline", tileStyle === "inline"); root.appendChild(toolbar()); // Everything drawable lives on the zoomed canvas; the toolbar and the panel stay 1:1. canvas = el("div", "canvas"); canvas.style.zoom = String(zoom); root.appendChild(canvas); graph.strips.forEach(function (s) { canvas.appendChild(stripView(s)); }); if (columnar) { if (graph.beans && graph.beans.length > 0) canvas.appendChild(beansRow(graph.beans)); const grid = el("div", "routes-grid"); graph.routes.forEach(function (r) { grid.appendChild(routeViewV(r)); }); graph.others.forEach(function (o) { const cell = el("div", "routeV"); cell.appendChild(nodeView(o)); grid.appendChild(cell); }); canvas.appendChild(grid); highlightSelection(); settleEdges(drawCurvedEdges); return; } if (graph.beans && graph.beans.length > 0) canvas.appendChild(beansRow(graph.beans)); graph.routes.forEach(function (r) { canvas.appendChild(routeView(r)); }); graph.others.forEach(function (o) { const row = el("div", "seq"); row.appendChild(nodeView(o)); canvas.appendChild(row); }); highlightSelection(); alignLanes(); if (lrMermaid()) settleEdges(drawCurvedEdgesLR); } // The return lanes were sized from ESTIMATED row widths; true up against the real // layout so the right-hand corner sits exactly under the out-stub. function alignLanes() { root.querySelectorAll(".uturn").forEach(function (lane) { const row = lane.previousElementSibling; if (!row || !row.lastElementChild) return; // Same measured-scale story as the curve overlay: rect deltas may or may not // carry the canvas zoom depending on the engine. const scale = canvas && canvas.offsetWidth > 0 ? canvas.getBoundingClientRect().width / canvas.offsetWidth : 1; const width = (row.lastElementChild.getBoundingClientRect().right - row.getBoundingClientRect().left) / scale; if (width > 20) lane.style.width = width + "px"; }); } // ── the palette (§8.5) ─────────────────────────────────────────── function openPalette(target) { overlay.textContent = ""; overlay.classList.add("open"); const box = el("div", "palette"); const search = el("input", "palette-search"); search.placeholder = "filter…"; box.appendChild(search); const list = el("div", "palette-list"); box.appendChild(list); function renderList(filter) { list.textContent = ""; paletteData.forEach(function (category) { const items = category.items.filter(function (item) { return filter === "" || item.label.toLowerCase().includes(filter); }); if (items.length === 0) return; list.appendChild(el("div", "palette-cat", category.title)); items.forEach(function (item) { const row = el("div", "palette-item", item.label); if (item.hint) row.appendChild(el("span", "palette-hint", item.hint)); row.addEventListener("click", function () { vscode.postMessage({ type: "insertStep", parentPath: target.parentPath, before: target.before, fragment: item.fragment, }); closePalette(); }); list.appendChild(row); }); }); } search.addEventListener("input", function () { renderList(search.value.toLowerCase()); }); renderList(""); overlay.appendChild(box); search.focus(); } function closePalette() { overlay.classList.remove("open"); overlay.textContent = ""; } overlay.addEventListener("click", function (e) { if (e.target === overlay) closePalette(); }); window.addEventListener("keydown", function (e) { if (e.key === "Escape") { closePalette(); return; } const tag = document.activeElement ? document.activeElement.tagName : ""; if (tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA") return; if ((e.key === "Delete" || e.key === "Backspace") && selectedGroup !== null) { removeGroup(selectedGroup); } else if ((e.key === "Delete" || e.key === "Backspace") && selectedPath !== null) { vscode.postMessage({ type: "removeStep", path: selectedPath }); clearSelection(); } }); // ── the properties panel (§8) ──────────────────────────────────── function contentRow(row, parentPath) { const box = el("div", "content-row"); box.appendChild(el("span", "content-type", row.type)); if (row.opaque !== null) { box.appendChild(el("span", "content-opaque", row.opaque)); } else { const input = el("input", "value"); input.value = row.text !== null ? row.text : (row.name || ""); input.placeholder = row.text !== null ? "(text)" : "name"; input.addEventListener("change", function () { if (row.text !== null) vscode.postMessage({ type: "setChildText", path: row.path, value: input.value }); else vscode.postMessage({ type: "setAttr", path: row.path, refresh: parentPath, name: "name", value: input.value === "" ? null : input.value, }); }); input.addEventListener("keydown", function (e) { if (e.key === "Enter") input.blur(); }); box.appendChild(input); if (row.value) box.appendChild(assignmentEditor(row, parentPath)); } const remove = el("span", "content-remove", "✕"); remove.title = "remove"; remove.addEventListener("click", function () { // a row of a joined `set ×N` tile is a step of its own: removed as a step, and the // run's panel is rebuilt from the file (parentPath === false) if (parentPath === false) vscode.postMessage({ type: "removeStep", path: row.path }); else vscode.postMessage({ type: "removeChild", path: row.path }); }); box.appendChild(remove); return box; } /** * The value half of a setter row: `=` a constant or `ƒ` an expression, and the text. Switching * the kind moves the text to the other attribute (the format takes exactly one of them). */ function assignmentEditor(row, parentPath) { const wrap = el("span", "content-assign"); const kind = el("select", "value content-kind"); [["value", "="], ["expr", "ƒ"]].forEach(function (pair) { const o = el("option", null, pair[1]); o.value = pair[0]; o.title = pair[0] === "value" ? "constant (value=)" : "expression (expr=)"; kind.appendChild(o); }); kind.value = row.value.attr; kind.title = "constant or expression"; const text = el("input", "value"); text.value = row.value.text; text.placeholder = "value"; function set(name, value, removeAttr) { vscode.postMessage({ type: "setAttr", path: row.path, refresh: parentPath, name: name, value: value, removeAttr: removeAttr || null, }); } kind.addEventListener("change", function () { set(kind.value, text.value, kind.value === "value" ? "expr" : "value"); }); text.addEventListener("change", function () { set(kind.value, text.value); }); text.addEventListener("keydown", function (e) { if (e.key === "Enter") text.blur(); }); wrap.appendChild(kind); wrap.appendChild(text); return wrap; } function fieldRow(props, field, messageType) { const row = el("div", "field" + (field.declared ? "" : " undeclared")); const label = el("label", null, field.name + (field.required ? " *" : "")); label.title = field.declared ? field.type + (field.required ? ", required" : "") : "not declared — kept as written"; row.appendChild(label); row.appendChild(fieldControl(props, field, messageType)); return row; } function commit(messageType, props, field, value) { vscode.postMessage({ type: messageType, path: props.path, name: field.name, existing: field.value !== null, value: value === "" ? null : value, }); } function fieldControl(props, field, messageType) { if (field.secret) { const input = el("input", "value"); input.value = field.value || ""; input.disabled = true; input.title = "contains a secret — edit in the text editor"; return input; } if (field.enumValues || field.type === "Bool") { const selectBox = el("select", "value"); const options = [""].concat(field.enumValues || ["true", "false"]); options.forEach(function (option) { const o = el("option", null, option === "" ? "(not set)" : option); o.value = option; selectBox.appendChild(o); }); selectBox.value = field.value === null ? "" : field.value; selectBox.addEventListener("change", function () { commit(messageType, props, field, selectBox.value); }); return selectBox; } const input = el("input", "value"); input.value = field.value === null ? "" : field.value; input.placeholder = "(not set)"; input.addEventListener("change", function () { commit(messageType, props, field, input.value); }); input.addEventListener("keydown", function (e) { if (e.key === "Enter") input.blur(); }); return input; } function renderPanel(props) { panel.textContent = ""; if (!document.body.classList.contains("with-panel")) { // The panel narrows the viewport - the snake must re-chunk for the new width. document.body.classList.add("with-panel"); setTimeout(rerender, 0); } const head = el("div", "panel-head"); panelHeadTitle(head, props.type, props.endpoint ? props.endpoint.scheme : null, props.type); const close = el("span", "panel-close", "✕"); close.addEventListener("click", clearSelection); head.appendChild(close); panel.appendChild(head); props.fields.forEach(function (field) { panel.appendChild(fieldRow(props, field, "setAttr")); }); if (props.endpoint) { panel.appendChild(el("div", "panel-section", "endpoint · " + props.endpoint.scheme)); const pathField = { name: "path", type: "string", required: false, enumValues: null, value: props.endpoint.path, secret: false, declared: true, }; panel.appendChild(fieldRow(props, pathField, "setUriPath")); props.endpoint.options.forEach(function (field) { panel.appendChild(fieldRow(props, field, "setUriOption")); }); } if ((props.content && props.content.length > 0) || (props.addable && props.addable.length > 0)) { panel.appendChild(el("div", "panel-section", "content")); props.content.forEach(function (row) { panel.appendChild(contentRow(row, props.path)); }); if (props.addable && props.addable.length > 0) { const adders = el("div", "content-add"); props.addable.forEach(function (childName) { const button = el("button", null, "+ " + childName); button.addEventListener("click", function () { vscode.postMessage({ type: "addChild", path: props.path, childName: childName }); }); adders.appendChild(button); }); panel.appendChild(adders); } } const actions = el("div", "panel-actions"); const show = el("button", null, "Show in text"); show.addEventListener("click", function () { reveal(props.span); }); actions.appendChild(show); const removeButton = el("button", "danger", "Delete step"); removeButton.addEventListener("click", function () { vscode.postMessage({ type: "removeStep", path: props.path }); clearSelection(); }); actions.appendChild(removeButton); panel.appendChild(actions); } // ── messages and states ────────────────────────────────────────── window.addEventListener("message", function (event) { const message = event.data; if (message.type === "graph") { toggled = new Set(message.toggled || []); // A layout remembered from a retired mode (the plain columns, the plain snake) opens // as the default. if (message.layout) layout = LAYOUTS.includes(message.layout) ? message.layout : "snake-mermaid"; if (message.zoom) zoom = message.zoom; if (message.tileStyle) tileStyle = TILE_STYLES.includes(message.tileStyle) ? message.tileStyle : "stacked"; if (typeof message.panelWidth === "number" && message.panelWidth >= 260) { panelWidth = message.panelWidth; applyPanelWidth(); } lastGraph = message.graph; render(message.graph); // A selected run is rebuilt from the new file: its rows show what was just edited, // or the panel closes when the run is gone. if (selectedGroup !== null) { const tile = root.querySelector('[data-path="' + selectedKey + '"]'); if (tile && tile.groupSteps) { selectedGroup = tile.groupSteps; renderGroupPanel(selectedGroup); } else clearSelection(); } } else if (message.type === "props") renderPanel(message.props); else if (message.type === "palette") paletteData = message.palette; else if (message.type === "foreign") notice("This XML does not carry the urn:redb:route namespace — nothing to draw.", true); else if (message.type === "broken") notice("The document does not parse (line " + message.line + "): " + message.message + " — fix it in the text editor.", true); }); function notice(text, withOpenAsText) { root.textContent = ""; const box = el("div", "notice", text); if (withOpenAsText) { const button = el("button", null, "Open as text"); button.addEventListener("click", function () { vscode.postMessage({ type: "openAsText" }); }); box.appendChild(el("div")).appendChild(button); } root.appendChild(box); } })(); Path: redb-route/vscode-redb-route/media/newproject.css Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/newproject.css ---- /* The New redb Project page: every color is a VS Code theme variable, so the page follows the user's theme, light and dark, with nothing hard-coded. */ body { font-family: var(--vscode-font-family); font-size: var(--vscode-font-size); color: var(--vscode-foreground); background: var(--vscode-editor-background); margin: 0; padding: 16px 24px 32px; } h1 { font-size: 1.6em; font-weight: 400; margin: 0 0 12px; } h2 { font-size: 1.05em; font-weight: 600; margin: 18px 0 8px; } p { margin: 4px 0; } .note, .description, .field-hint { color: var(--vscode-descriptionForeground); } .empty { color: var(--vscode-descriptionForeground); font-style: italic; } button { font-family: inherit; font-size: inherit; color: var(--vscode-button-foreground); background: var(--vscode-button-background); border: 1px solid var(--vscode-button-border, transparent); border-radius: 2px; padding: 4px 12px; cursor: pointer; } button:hover:not(:disabled) { background: var(--vscode-button-hoverBackground); } button:disabled { opacity: 0.5; cursor: default; } button:focus-visible { outline: 1px solid var(--vscode-focusBorder); outline-offset: 2px; } button.secondary { color: var(--vscode-button-secondaryForeground); background: var(--vscode-button-secondaryBackground); } button.secondary:hover:not(:disabled) { background: var(--vscode-button-secondaryHoverBackground); } button.link { color: var(--vscode-textLink-foreground); background: none; border: none; padding: 2px 4px; } button.link:hover:not(:disabled) { color: var(--vscode-textLink-activeForeground); background: none; text-decoration: underline; } /* ── status ─────────────────────────────────────────────────────────── */ .status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 8px 12px; border: 1px solid var(--vscode-widget-border, var(--vscode-panel-border)); border-radius: 4px; background: var(--vscode-sideBar-background, transparent); } .status-row { display: flex; align-items: center; gap: 8px; } .badge { font-weight: 600; padding-left: 14px; position: relative; } .badge::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; } .badge.ok::before { background: var(--vscode-testing-iconPassed, var(--vscode-charts-green)); } .badge.warn::before { background: var(--vscode-editorWarning-foreground); } .badge.bad::before { background: var(--vscode-editorError-foreground); } /* ── layout ─────────────────────────────────────────────────────────── */ .main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 24px; margin-top: 8px; } @media (max-width: 760px) { .main { grid-template-columns: minmax(0, 1fr); } } /* ── template cards ─────────────────────────────────────────────────── */ .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; } .card { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; text-align: left; min-height: 84px; padding: 10px 12px; color: var(--vscode-foreground); background: var(--vscode-editorWidget-background); border: 1px solid var(--vscode-widget-border, var(--vscode-panel-border)); border-radius: 4px; } .card:hover:not(:disabled) { background: var(--vscode-list-hoverBackground); border-color: var(--vscode-focusBorder); } .card.selected { background: var(--vscode-list-activeSelectionBackground); color: var(--vscode-list-activeSelectionForeground); border-color: var(--vscode-focusBorder); } .card.selected:hover:not(:disabled) { background: var(--vscode-list-activeSelectionBackground); } .card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .card-icon { flex: none; width: 26px; height: 26px; margin-top: 1px; fill: none; stroke: var(--card-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; } .card.group-route-xml { --card-accent: var(--vscode-charts-orange, #d18616); } .card.group-tsak { --card-accent: var(--vscode-charts-green, #388a34); } .card.group-apps { --card-accent: var(--vscode-charts-blue, #3794ff); } .card.selected .card-icon { stroke: currentColor; } .card-title { font-weight: 600; } .card-name { font-family: var(--vscode-editor-font-family); font-size: 0.9em; opacity: 0.8; } .card-description { font-size: 0.92em; opacity: 0.85; } /* ── form ───────────────────────────────────────────────────────────── */ .form { align-self: start; position: sticky; top: 12px; padding: 4px 16px 16px; border-left: 1px solid var(--vscode-widget-border, var(--vscode-panel-border)); } .field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; } .field-label { font-weight: 600; } .field-hint { font-size: 0.92em; word-break: break-all; } .field-error { color: var(--vscode-errorForeground); font-size: 0.92em; } input[type="text"], select { font-family: inherit; font-size: inherit; color: var(--vscode-input-foreground); background: var(--vscode-input-background); border: 1px solid var(--vscode-input-border, var(--vscode-widget-border, transparent)); border-radius: 2px; padding: 4px 6px; min-width: 0; } select { color: var(--vscode-dropdown-foreground); background: var(--vscode-dropdown-background); border-color: var(--vscode-dropdown-border, var(--vscode-input-border, transparent)); } input[type="text"]:focus, select:focus { outline: 1px solid var(--vscode-focusBorder); outline-offset: -1px; } input::placeholder { color: var(--vscode-input-placeholderForeground); } .invalid { border-color: var(--vscode-inputValidation-errorBorder) !important; } .folder-row { display: flex; gap: 6px; } .folder-row input { flex: 1; } .actions { margin-top: 16px; } .actions button { padding: 6px 20px; } /* ── progress ───────────────────────────────────────────────────────── */ .progress { margin-top: 20px; } .busy, .result { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; } .result.ok > span { color: var(--vscode-testing-iconPassed, var(--vscode-foreground)); font-weight: 600; } .result.bad > span { color: var(--vscode-errorForeground); font-weight: 600; } .spinner { width: 12px; height: 12px; border: 2px solid var(--vscode-progressBar-background); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } .log { max-height: 220px; overflow: auto; margin: 8px 0 0; padding: 8px 10px; font-family: var(--vscode-editor-font-family); font-size: var(--vscode-editor-font-size); white-space: pre-wrap; color: var(--vscode-terminal-foreground, var(--vscode-foreground)); background: var(--vscode-terminal-background, var(--vscode-textCodeBlock-background)); border-radius: 4px; } Path: redb-route/vscode-redb-route/media/newproject.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/newproject.js ---- // The New redb Project page. It renders what the extension sends ("state", "errors", "log", ...) // and sends every action back as a message; it never runs anything itself. All text goes in // through textContent, never as markup. (function () { "use strict"; const vscode = acquireVsCodeApi(); const root = document.getElementById("root"); let state = null; // the PageState from the extension let selected = null; // short name of the chosen template let form = { name: "", folder: "", values: {} }; let errors = {}; let busy = null; // text of the running step, or null let done = null; // { ok, message } after a run const logLines = []; let validateTimer = 0; function el(tag, className, text) { const node = document.createElement(tag); if (className) node.className = className; if (text !== undefined && text !== null) node.textContent = text; return node; } // 24x24 line glyphs of the template cards, drawn in the card's color (templateIcon picks one). const GLYPHS = { route: "M2.5 12h5M15.5 12h3M9 8.5h6v7H9zM18 9l3.5 3-3.5 3z", stream: "M3 6h14M14 3l3 3-3 3M3 12h14M14 9l3 3-3 3M3 18h14M14 15l3 3-3 3", queue: "M2.5 8h4.5v8H2.5zM9.75 8h4.5v8h-4.5zM17 8h4.5v8H17z", database: "M4 6c0-1.7 3.6-3 8-3s8 1.3 8 3-3.6 3-8 3-8-1.3-8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3", api: "M8 4c-2 0-3 1-3 3v2c0 1.5-1 3-2 3 1 0 2 1.5 2 3v2c0 2 1 3 3 3M16 4c2 0 3 1 3 3v2c0 1.5 1 3 2 3-1 0-2 1.5-2 3v2c0 2-1 3-3 3", envelope: "M3 6h18v12H3zM3 6l9 7 9-7", split: "M3 12h5M8 12l5-6h5M8 12l5 6h5M16 3.5l2.5 2.5-2.5 2.5M16 15.5l2.5 2.5-2.5 2.5", fan: "M2.5 12h3.5l5-6h2l5 6h3.5M6 12h12M6 12l5 6h2l5-6", chat: "M4 5h16v10H10l-5 4v-4H4z", shield: "M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6zM9 12l2 2 4-4", browser: "M3 5h18v14H3zM3 9h18M6 7h.01M8.5 7h.01", server: "M4 4h16v6H4zM4 14h16v6H4zM7.5 7h.01M7.5 17h.01M11 7h5M11 17h5", check: "M6 3h9l4 4v14H6zM15 3v4h4M9 14l2 2 4-4", cube: "M12 3l8 4.5v9L12 21l-8-4.5v-9zM12 12l8-4.5M12 12v9M12 12L4 7.5", terminal: "M3 5h18v14H3zM7 10l3 2-3 2M12 15h5", document: "M6 3h9l4 4v14H6zM15 3v4h4M9 12h6M9 16h6", }; function glyph(name) { const ns = "http://www.w3.org/2000/svg"; const svg = document.createElementNS(ns, "svg"); svg.setAttribute("viewBox", "0 0 24 24"); svg.setAttribute("class", "card-icon"); svg.setAttribute("aria-hidden", "true"); const path = document.createElementNS(ns, "path"); path.setAttribute("d", GLYPHS[name] || GLYPHS.document); svg.appendChild(path); return svg; } function template() { return state && state.templates.find(function (t) { return t.shortName === selected; }); } function select(shortName) { selected = shortName; const t = template(); form.values = {}; if (t) t.fields.forEach(function (f) { form.values[f.name] = f.value; }); done = null; render(); validate(); } function send(message) { vscode.postMessage(message); } function currentForm() { return { template: selected || "", name: form.name, folder: form.folder, values: form.values }; } function validate() { clearTimeout(validateTimer); validateTimer = setTimeout(function () { send({ type: "validate", form: currentForm() }); }, 200); } // ── machine status ─────────────────────────────────────────────── function renderStatus() { const bar = el("section", "status"); const sdk = el("div", "status-row"); if (state.sdks === null) { sdk.appendChild(el("span", "badge bad", ".NET SDK")); sdk.appendChild(el("span", "note", "not found on the PATH. Creating a project needs it.")); const b = el("button", "secondary", "Download .NET"); b.addEventListener("click", function () { send({ type: "downloadDotnet" }); }); sdk.appendChild(b); } else { sdk.appendChild(el("span", "badge ok", ".NET SDK")); const majors = state.sdks.slice().sort(function (a, b) { return a - b; }) .filter(function (m, i, all) { return all.indexOf(m) === i; }); sdk.appendChild(el("span", "note", majors.length ? majors.map(function (m) { return m + ".0"; }).join(", ") : "none")); } bar.appendChild(sdk); state.packages.forEach(function (p) { const row = el("div", "status-row"); if (p.kind === "missing") { row.appendChild(el("span", "badge bad", p.packageId)); row.appendChild(el("span", "note", "not installed for dotnet new")); const b = el("button", "", "Install" + (p.latest ? " " + p.latest : "")); b.disabled = !!busy || state.sdks === null; b.addEventListener("click", function () { send({ type: "install", packageId: p.packageId, version: p.latest }); }); row.appendChild(b); } else if (p.kind === "outdated") { row.appendChild(el("span", "badge warn", p.packageId)); row.appendChild(el("span", "note", p.installed + " installed, " + p.latest + " available")); const b = el("button", "secondary", "Update to " + p.latest); b.disabled = !!busy; b.addEventListener("click", function () { send({ type: "install", packageId: p.packageId, version: p.latest }); }); row.appendChild(b); } else { row.appendChild(el("span", "badge ok", p.packageId)); row.appendChild(el("span", "note", p.installed ? p.installed : "installed from a folder")); } bar.appendChild(row); }); const refresh = el("button", "link", "Refresh"); refresh.disabled = !!busy; refresh.addEventListener("click", function () { send({ type: "refresh" }); }); bar.appendChild(refresh); return bar; } // ── templates ──────────────────────────────────────────────────── function renderTemplates() { const list = el("section", "templates"); if (state.templates.length === 0) { list.appendChild(el("p", "empty", "No redb templates are installed. Install the template packages above.")); return list; } state.groups.forEach(function (g) { list.appendChild(el("h2", null, g.title)); const grid = el("div", "cards"); state.templates.filter(function (t) { return t.group === g.group; }).forEach(function (t) { const card = el("button", "card group-" + t.group + (t.shortName === selected ? " selected" : "")); card.setAttribute("aria-pressed", t.shortName === selected ? "true" : "false"); card.appendChild(glyph(t.icon)); const text = el("span", "card-text"); text.appendChild(el("span", "card-title", t.name)); text.appendChild(el("span", "card-name", t.shortName + (t.type === "solution" ? " · solution" : ""))); if (t.description) text.appendChild(el("span", "card-description", t.description)); card.appendChild(text); card.addEventListener("click", function () { select(t.shortName); }); grid.appendChild(card); }); list.appendChild(grid); }); return list; } // ── form ───────────────────────────────────────────────────────── function field(label, control, error, hint) { const wrap = el("label", "field"); wrap.appendChild(el("span", "field-label", label)); wrap.appendChild(control); if (hint) wrap.appendChild(el("span", "field-hint", hint)); if (error) { wrap.appendChild(el("span", "field-error", error)); control.classList.add("invalid"); } return wrap; } function textInput(key, value, placeholder, onInput) { const input = el("input"); input.type = "text"; input.dataset.key = key; input.value = value; if (placeholder) input.placeholder = placeholder; input.disabled = !!busy; input.addEventListener("input", function () { onInput(input.value); validate(); }); return input; } function renderForm() { const t = template(); const panel = el("section", "form"); if (!t) { panel.appendChild(el("p", "empty", "Choose a template.")); return panel; } panel.appendChild(el("h2", null, t.name)); if (t.description) panel.appendChild(el("p", "description", t.description)); panel.appendChild(field("Project name", textInput("name", form.name, "MyProject", function (v) { form.name = v; }), form.name ? errors.name : null)); t.fields.forEach(function (f) { let control; if (f.kind === "select") { control = el("select"); f.options.forEach(function (o) { const option = el("option", null, o.description ? o.label + " (" + o.description + ")" : o.label); option.value = o.value; option.selected = form.values[f.name] === o.value; control.appendChild(option); }); control.disabled = !!busy; control.addEventListener("change", function () { form.values[f.name] = control.value; validate(); }); } else { control = textInput("param:" + f.name, form.values[f.name] || "", f.placeholder, function (v) { form.values[f.name] = v; }); } panel.appendChild(field(f.title, control, errors[f.name], f.kind === "select" ? f.description : null)); }); const folderRow = el("div", "folder-row"); const folder = textInput("folder", form.folder, "", function (v) { form.folder = v; }); folderRow.appendChild(folder); const browse = el("button", "secondary", "Browse..."); browse.type = "button"; browse.disabled = !!busy; browse.addEventListener("click", function (e) { e.preventDefault(); send({ type: "browse", folder: form.folder }); }); folderRow.appendChild(browse); const target = form.folder && form.name ? "Creates " + joinPath(form.folder, form.name) : null; panel.appendChild(field("Location", folderRow, errors.folder, target)); const actions = el("div", "actions"); const create = el("button", "", "Create"); create.disabled = !!busy || Object.keys(errors).length > 0 || !form.name || state.sdks === null; create.addEventListener("click", function () { done = null; send({ type: "create", form: currentForm() }); }); actions.appendChild(create); panel.appendChild(actions); return panel; } function joinPath(folder, name) { const separator = folder.indexOf("\\") >= 0 ? "\\" : "/"; return folder.replace(/[\\/]+$/, "") + separator + name; } // ── progress ───────────────────────────────────────────────────── function renderProgress() { const box = el("section", "progress"); if (busy) { const row = el("div", "busy"); row.appendChild(el("span", "spinner")); row.appendChild(el("span", null, busy)); const cancel = el("button", "link", "Cancel"); cancel.addEventListener("click", function () { send({ type: "cancel" }); }); row.appendChild(cancel); box.appendChild(row); } if (done) { const row = el("div", done.ok ? "result ok" : "result bad"); row.appendChild(el("span", null, done.message)); if (done.ok) { [["Open", "here"], ["Open in New Window", "new"], ["Add to Workspace", "add"]].forEach(function (pair, i) { const b = el("button", i === 0 ? "" : "secondary", pair[0]); b.addEventListener("click", function () { send({ type: "open", mode: pair[1] }); }); row.appendChild(b); }); } else { const b = el("button", "secondary", "Show Output"); b.addEventListener("click", function () { send({ type: "showOutput" }); }); row.appendChild(b); } box.appendChild(row); } if (logLines.length) box.appendChild(el("pre", "log", logLines.join(""))); return box; } function render() { const focused = document.activeElement && document.activeElement.tagName === "INPUT" ? document.activeElement : null; const caret = focused ? [focused.selectionStart, focused.selectionEnd, focused.dataset.key] : null; root.textContent = ""; root.appendChild(el("h1", null, "New redb Project")); if (!state) { root.appendChild(el("p", "note", busy || "Loading...")); return; } root.appendChild(renderStatus()); const main = el("div", "main"); main.appendChild(renderTemplates()); main.appendChild(renderForm()); root.appendChild(main); root.appendChild(renderProgress()); // Re-rendering replaces the inputs; keep the one being typed in focused. if (caret) { const again = Array.prototype.find.call(root.querySelectorAll("input"), function (i) { return i.dataset.key === caret[2]; }); if (again) { again.focus(); again.setSelectionRange(caret[0], caret[1]); } } const log = root.querySelector(".log"); if (log) log.scrollTop = log.scrollHeight; } window.addEventListener("message", function (event) { const message = event.data; switch (message.type) { case "state": state = message.state; busy = null; if (!form.folder) form.folder = state.folder; if (!state.templates.some(function (t) { return t.shortName === selected; })) { selected = null; if (state.selected) { select(state.selected); return; } } render(); validate(); break; case "busy": busy = message.text; render(); break; case "idle": busy = null; render(); break; case "log": logLines.push(message.text.endsWith("\n") ? message.text : message.text + "\n"); render(); break; case "errors": errors = message.errors || {}; render(); break; case "folder": form.folder = message.folder; render(); validate(); break; case "done": done = { ok: message.ok, message: message.message }; busy = null; render(); break; } }); send({ type: "ready" }); }()); Path: redb-route/vscode-redb-route/media/redb-route-1.0.catalog.xsd Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/redb-route-1.0.catalog.xsd ---- Read only by the producer (<to>): the consumer (<from>) refuses it. Read only by the consumer (<from>): the producer (<to>) refuses it. Path: redb-route/vscode-redb-route/media/redb-route-1.0.xsd Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/redb-route-1.0.xsd ---- Path: redb-route/vscode-redb-route/media/redb-route-catalog.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/redb-route-catalog.json ---- [ { "scheme": "amqp", "alternateSchemes": [], "package": "redb.Route.Amqp", "optionsType": "redb.Route.Amqp.AmqpEndpointOptions", "pathIsText": false, "options": [ { "name": "AckMode", "type": "enum", "default": "Manual", "sensitive": false, "enumValues": [ "Manual", "Auto" ] }, { "name": "Batching", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchingIntervalMs", "type": "int", "sensitive": false }, { "name": "Capabilities", "type": "string", "sensitive": false }, { "name": "ConcurrentConsumers", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Amqp.AmqpConnectionFactory, redb.Route.Amqp" }, { "name": "ContainerId", "type": "string", "sensitive": false }, { "name": "ContentType", "type": "string", "default": "text/plain", "sensitive": false }, { "name": "Credit", "type": "int", "default": "100", "sensitive": false }, { "name": "Declare", "type": "bool", "default": "false", "sensitive": false }, { "name": "DisableReplyTo", "type": "bool", "default": "false", "sensitive": false }, { "name": "DistributionMode", "type": "string", "sensitive": false }, { "name": "Durable", "type": "string", "default": "0", "sensitive": false }, { "name": "Dynamic", "type": "bool", "default": "false", "sensitive": false }, { "name": "ExpiryPolicy", "type": "string", "default": "session-end", "sensitive": false }, { "name": "FilterSelector", "type": "string", "sensitive": false }, { "name": "GroupId", "type": "string", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false }, { "name": "LocalTransactions", "type": "bool", "default": "false", "sensitive": false }, { "name": "MaxBatchMessages", "type": "int", "sensitive": false }, { "name": "MessageDurable", "type": "bool", "default": "true", "sensitive": false }, { "name": "MessagePriority", "type": "string", "default": "4", "sensitive": false }, { "name": "MessagePriorityExpression", "type": "string", "sensitive": false }, { "name": "MessageTtl", "type": "string", "default": "0", "sensitive": false }, { "name": "MessageTtlExpression", "type": "string", "sensitive": false }, { "name": "Password", "type": "string", "sensitive": true }, { "name": "PollTimeoutMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "Port", "type": "int", "default": "5672", "sensitive": false }, { "name": "PreserveMessageQos", "type": "bool", "default": "false", "sensitive": false }, { "name": "ReceiveTimeout", "type": "int", "default": "60", "sensitive": false }, { "name": "ReceiverSettleMode", "type": "int", "default": "0", "sensitive": false }, { "name": "ReplyTimeout", "type": "int", "default": "2", "sensitive": false }, { "name": "ReplyTo", "type": "bool", "default": "false", "sensitive": false }, { "name": "RoutingType", "type": "string", "default": "ANYCAST", "sensitive": false }, { "name": "SenderSettleMode", "type": "int", "default": "2", "sensitive": false }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "Subject", "type": "string", "sensitive": false }, { "name": "TerminusTimeout", "type": "string", "default": "0", "sensitive": false }, { "name": "Timeout", "type": "int", "default": "30", "sensitive": false }, { "name": "Transacted", "type": "bool", "sensitive": false }, { "name": "User", "type": "string", "sensitive": false }, { "name": "VirtualHost", "type": "string", "sensitive": false } ], "lenient": false }, { "scheme": "as2", "alternateSchemes": [ "as2s" ], "package": "redb.Route.As2", "optionsType": "redb.Route.As2.As2EndpointOptions", "pathIsText": false, "options": [ { "name": "AllowLegacyAlgorithms", "type": "bool", "default": "false", "sensitive": false }, { "name": "As2From", "type": "string", "sensitive": false }, { "name": "As2To", "type": "string", "sensitive": false }, { "name": "AsyncMdnAllowedHosts", "type": "string", "sensitive": false }, { "name": "AsyncMdnAttempts", "type": "int", "default": "3", "sensitive": false }, { "name": "AsyncMdnPoolSize", "type": "int", "default": "20", "sensitive": false }, { "name": "AsyncMdnRetryDelay", "type": "int", "default": "5000", "sensitive": false }, { "name": "AsyncMdnUrl", "type": "string", "sensitive": false }, { "name": "Compress", "type": "bool", "default": "false", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.As2.As2ConnectionFactory, redb.Route.As2" }, { "name": "Encrypt", "type": "bool", "default": "true", "sensitive": false }, { "name": "EncryptAlg", "type": "string", "default": "aes-128-cbc", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "IdempotentRepository", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IIdempotentRepository, redb.Route" }, { "name": "InFlightClaimTimeout", "type": "int", "default": "600000", "sensitive": false }, { "name": "MaxConcurrentRequests", "type": "int", "default": "32", "sensitive": false }, { "name": "MaxDecompressedSize", "type": "long", "sensitive": false }, { "name": "MaxRequestBodySize", "type": "long", "default": "104857600", "sensitive": false }, { "name": "MaxResponseBodySize", "type": "long", "default": "4194304", "sensitive": false }, { "name": "MdnMode", "type": "enum", "default": "Sync", "sensitive": false, "enumValues": [ "None", "Sync", "Async" ] }, { "name": "Mode", "type": "enum", "default": "Message", "sensitive": false, "enumValues": [ "Message", "Mdn" ] }, { "name": "PartnerUrl", "type": "string", "sensitive": false }, { "name": "Port", "type": "int", "default": "4080", "sensitive": false }, { "name": "RejectStatusCode", "type": "int", "default": "503", "sensitive": false }, { "name": "RequestQueueLimit", "type": "int", "default": "32", "sensitive": false }, { "name": "RequireValidMdn", "type": "bool", "default": "false", "sensitive": false }, { "name": "RetryAfterSeconds", "type": "int", "default": "30", "sensitive": false }, { "name": "Sign", "type": "bool", "default": "true", "sensitive": false }, { "name": "SignAlg", "type": "string", "default": "sha-256", "sensitive": false }, { "name": "SignedMdn", "type": "bool", "default": "true", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "StreamBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "Timeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "UseTls", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "as4", "alternateSchemes": [ "as4s" ], "package": "redb.Route.As4", "optionsType": "redb.Route.As4.As4EndpointOptions", "pathIsText": false, "options": [ { "name": "Action", "type": "string", "sensitive": false, "role": "producer" }, { "name": "AddressQuery", "type": "string", "sensitive": false, "role": "producer" }, { "name": "AllowedClientThumbprints", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "ClientCertificateMode", "type": "enum", "default": "NoCertificate", "sensitive": false, "enumValues": [ "NoCertificate", "AllowCertificate", "RequireCertificate" ], "role": "consumer" }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.As4.As4ConnectionFactory, redb.Route.As4" }, { "name": "ConversationId", "type": "string", "sensitive": false, "role": "producer" }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false, "role": "consumer" }, { "name": "IdempotentRepository", "type": "string", "sensitive": false, "role": "consumer", "reference": "redb.Route.Abstractions.IIdempotentRepository, redb.Route" }, { "name": "InFlightClaimTimeout", "type": "int", "default": "600000", "sensitive": false, "role": "consumer" }, { "name": "MaxConcurrentRequests", "type": "int", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MaxEnvelopeCharacters", "type": "long", "default": "1048576", "sensitive": false }, { "name": "MaxRequestBodySize", "type": "long", "default": "104857600", "sensitive": false, "role": "consumer" }, { "name": "MaxResponseBodySize", "type": "long", "default": "4194304", "sensitive": false, "role": "producer" }, { "name": "Partner", "type": "string", "sensitive": false, "role": "producer" }, { "name": "PayloadList", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "Port", "type": "int", "default": "4090", "sensitive": false, "role": "consumer" }, { "name": "RefToMessageId", "type": "string", "sensitive": false, "role": "producer" }, { "name": "RejectStatusCode", "type": "int", "default": "503", "sensitive": false, "role": "consumer" }, { "name": "RequestQueueLimit", "type": "int", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "RetryAfterSeconds", "type": "int", "default": "1", "sensitive": false, "role": "consumer" }, { "name": "Service", "type": "string", "sensitive": false, "role": "producer" }, { "name": "SslCertPassword", "type": "string", "sensitive": true, "role": "consumer" }, { "name": "SslCertPath", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "StreamBody", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "Timeout", "type": "int", "default": "60000", "sensitive": false, "role": "producer" }, { "name": "Transacted", "type": "bool", "sensitive": false, "role": "producer" }, { "name": "UseTls", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "asb", "alternateSchemes": [], "package": "redb.Route.AzureServiceBus", "optionsType": "redb.Route.AzureServiceBus.AzureServiceBusEndpointOptions", "pathIsText": false, "options": [ { "name": "AckMode", "type": "enum", "default": "Manual", "sensitive": false, "enumValues": [ "Manual", "Auto" ] }, { "name": "AutoDeadLetter", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchCommit", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchMaxSizeBytes", "type": "long", "default": "262144", "sensitive": false }, { "name": "Batching", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchingIntervalMs", "type": "int", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.AzureServiceBus.AzureServiceBusConnectionFactory, redb.Route.AzureServiceBus" }, { "name": "ConnectionString", "type": "string", "default": "", "sensitive": true }, { "name": "DeadLetterReason", "type": "string", "sensitive": false }, { "name": "EnableSessions", "type": "bool", "default": "false", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "MaxAutoLockRenewalDuration", "type": "int", "default": "300", "sensitive": false }, { "name": "MaxBatchMessages", "type": "int", "sensitive": false }, { "name": "MaxConcurrentCalls", "type": "string", "sensitive": false }, { "name": "MaxConcurrentSessions", "type": "int", "default": "1", "sensitive": false }, { "name": "MessageId", "type": "string", "sensitive": false }, { "name": "PartitionKey", "type": "string", "sensitive": false }, { "name": "PollTimeoutMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "PrefetchCount", "type": "int", "default": "0", "sensitive": false }, { "name": "ProducerSessionId", "type": "string", "sensitive": false }, { "name": "QueueName", "type": "string", "sensitive": false }, { "name": "RetryDelayMs", "type": "int", "default": "800", "sensitive": false }, { "name": "RetryMaxDelayMs", "type": "int", "default": "60000", "sensitive": false }, { "name": "RetryMaxRetries", "type": "int", "default": "3", "sensitive": false }, { "name": "RetryMode", "type": "string", "default": "Exponential", "sensitive": false }, { "name": "ScheduleDelaySeconds", "type": "int", "default": "0", "sensitive": false }, { "name": "SessionId", "type": "string", "sensitive": false }, { "name": "SessionIdleTimeout", "type": "int", "default": "0", "sensitive": false }, { "name": "SubQueue", "type": "string", "sensitive": false }, { "name": "SubscriptionName", "type": "string", "sensitive": false }, { "name": "TimeToLive", "type": "string", "sensitive": false }, { "name": "TopicName", "type": "string", "sensitive": false }, { "name": "Transacted", "type": "bool", "sensitive": false } ], "lenient": false }, { "scheme": "bean", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.Bean.BeanEndpointOptions", "pathIsText": false, "options": [ { "name": "Method", "type": "string", "sensitive": false } ], "lenient": true, "role": "producer" }, { "scheme": "cache", "alternateSchemes": [], "package": "redb.Route.Cache", "optionsType": "redb.Route.Cache.CacheEndpointOptions", "pathIsText": false, "options": [ { "name": "Action", "type": "string", "default": "get", "sensitive": false }, { "name": "Headers", "type": "string", "sensitive": false }, { "name": "Key", "type": "string", "sensitive": false }, { "name": "Provider", "type": "string", "sensitive": false }, { "name": "Sliding", "type": "string", "sensitive": false }, { "name": "Ttl", "type": "string", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "controlbus", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.ControlBus.ControlBusEndpointOptions", "pathIsText": false, "options": [ { "name": "Action", "type": "enum", "sensitive": false, "enumValues": [ "Start", "Stop", "Suspend", "Resume", "Restart", "Status", "Stats", "Fail" ] }, { "name": "Async", "type": "bool", "default": "false", "sensitive": false }, { "name": "Command", "type": "enum", "default": "Route", "sensitive": false, "enumValues": [ "Route", "Language", "Notify" ] }, { "name": "Events", "type": "string", "sensitive": false }, { "name": "Language", "type": "string", "sensitive": false }, { "name": "LoggingLevel", "type": "string", "default": "Info", "sensitive": false }, { "name": "RestartDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "RouteId", "type": "string", "sensitive": false } ], "lenient": false }, { "scheme": "cron", "alternateSchemes": [], "package": "redb.Route.Quartz", "optionsType": "redb.Route.Quartz.CronEndpointOptions", "pathIsText": false, "options": [ { "name": "CustomCalendar", "type": "string", "sensitive": false, "reference": "Quartz.ICalendar, Quartz" }, { "name": "DeleteJob", "type": "bool", "default": "true", "sensitive": false }, { "name": "DurableJob", "type": "bool", "default": "false", "sensitive": false }, { "name": "EndAt", "type": "string", "sensitive": false }, { "name": "GroupName", "type": "string", "default": "redb", "sensitive": false }, { "name": "JobName", "type": "string", "default": "", "sensitive": false }, { "name": "MisfireInstruction", "type": "enum", "default": "Default", "sensitive": false, "enumValues": [ "Default", "SimpleFireNow", "SimpleRescheduleNowWithExistingRepeatCount", "SimpleRescheduleNowWithRemainingRepeatCount", "SimpleRescheduleNextWithRemainingCount", "SimpleRescheduleNextWithExistingCount", "CronFireOnceNow", "CronDoNothing" ] }, { "name": "PauseJob", "type": "bool", "default": "false", "sensitive": false }, { "name": "PrefixJobNameWithEndpointId", "type": "bool", "default": "false", "sensitive": false }, { "name": "RecoverableJob", "type": "bool", "default": "false", "sensitive": false }, { "name": "Schedule", "type": "string", "default": "", "sensitive": false }, { "name": "StartAt", "type": "string", "sensitive": false }, { "name": "Stateful", "type": "bool", "default": "false", "sensitive": false }, { "name": "Threads", "type": "int", "default": "1", "sensitive": false }, { "name": "TimeZone", "type": "string", "sensitive": false }, { "name": "TriggerStartDelay", "type": "long", "default": "500", "sensitive": false } ], "lenient": false, "role": "consumer" }, { "scheme": "direct", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.DirectEndpointOptions", "pathIsText": false, "options": [], "lenient": false }, { "scheme": "direct-vm", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.DirectVmEndpointOptions", "pathIsText": false, "options": [ { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "role": "producer", "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" } ], "lenient": false }, { "scheme": "elasticsearch", "alternateSchemes": [ "es" ], "package": "redb.Route.Elasticsearch", "optionsType": "redb.Route.Elasticsearch.ElasticsearchEndpointOptions", "pathIsText": false, "options": [ { "name": "ApiKey", "type": "string", "default": "", "sensitive": true }, { "name": "BulkSize", "type": "int", "default": "100", "sensitive": false }, { "name": "CertificateFingerprint", "type": "string", "default": "", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.Elasticsearch.ElasticsearchConnectionFactory, redb.Route.Elasticsearch" }, { "name": "DeadTimeout", "type": "int", "default": "60000", "sensitive": false }, { "name": "Delay", "type": "int", "default": "5000", "sensitive": false }, { "name": "DeleteAfterRead", "type": "bool", "default": "false", "sensitive": false }, { "name": "DocumentId", "type": "string", "sensitive": false }, { "name": "EnableDebugMode", "type": "bool", "default": "false", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "MaxDeadTimeout", "type": "int", "default": "600000", "sensitive": false }, { "name": "MaxRetries", "type": "int", "default": "3", "sensitive": false }, { "name": "Nodes", "type": "string", "default": "http://localhost:9200", "sensitive": false }, { "name": "Operation", "type": "enum", "default": "Index", "sensitive": false, "enumValues": [ "Index", "Bulk", "Search", "Get", "Update", "Delete", "Count", "Exists", "MultiSearch" ] }, { "name": "Password", "type": "string", "default": "", "sensitive": true }, { "name": "PingTimeout", "type": "int", "default": "2000", "sensitive": false }, { "name": "Pipeline", "type": "string", "default": "", "sensitive": false }, { "name": "Query", "type": "string", "default": "", "sensitive": false }, { "name": "Refresh", "type": "string", "default": "", "sensitive": false }, { "name": "RequestTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "Routing", "type": "string", "default": "", "sensitive": false }, { "name": "ScrollTimeout", "type": "string", "default": "", "sensitive": false }, { "name": "Size", "type": "int", "default": "100", "sensitive": false }, { "name": "Sort", "type": "string", "default": "", "sensitive": false }, { "name": "SourceExcludes", "type": "string", "default": "", "sensitive": false }, { "name": "SourceIncludes", "type": "string", "default": "", "sensitive": false }, { "name": "TrackTotalHits", "type": "bool", "default": "true", "sensitive": false }, { "name": "Username", "type": "string", "default": "", "sensitive": false } ], "lenient": false }, { "scheme": "embed", "alternateSchemes": [], "package": "redb.Route.Llm", "optionsType": "redb.Route.Llm.Embeddings.EmbedEndpointOptions", "pathIsText": false, "options": [ { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Llm.LlmConnectionFactory, redb.Route.Llm" } ], "lenient": false, "role": "producer" }, { "scheme": "exec", "alternateSchemes": [], "package": "redb.Route.Exec", "optionsType": "redb.Route.Exec.ExecEndpointOptions", "pathIsText": false, "options": [ { "name": "AllowedCommands", "type": "string", "sensitive": false }, { "name": "Args", "type": "string", "sensitive": false }, { "name": "CaptureStderrInBody", "type": "bool", "default": "true", "sensitive": false }, { "name": "Command", "type": "string", "sensitive": false }, { "name": "EnvironmentOverrides", "type": "string", "sensitive": false }, { "name": "JsonResponse", "type": "bool", "default": "true", "sensitive": false }, { "name": "MaxStderrBytes", "type": "int", "default": "262144", "sensitive": false }, { "name": "MaxStdoutBytes", "type": "int", "default": "1048576", "sensitive": false }, { "name": "Schedule", "type": "string", "sensitive": false }, { "name": "ScrubEnvironment", "type": "bool", "default": "false", "sensitive": false }, { "name": "TimeoutMs", "type": "int", "default": "30000", "sensitive": false }, { "name": "WorkingDirectory", "type": "string", "sensitive": false } ], "lenient": false }, { "scheme": "fbstorage", "alternateSchemes": [], "package": "redb.Route.Firebase", "optionsType": "redb.Route.Firebase.FirebaseStorageEndpointOptions", "pathIsText": false, "options": [ { "name": "AutoCreateBucket", "type": "bool", "default": "false", "sensitive": false }, { "name": "BucketName", "type": "string", "sensitive": false }, { "name": "CacheControl", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Firebase.IFirebaseCredentialProvider, redb.Route.Firebase" }, { "name": "ContentType", "type": "string", "sensitive": false }, { "name": "CredentialPath", "type": "string", "sensitive": false }, { "name": "Delay", "type": "int", "default": "5000", "sensitive": false }, { "name": "DeleteAfterRead", "type": "bool", "default": "false", "sensitive": false }, { "name": "DestinationBucket", "type": "string", "sensitive": false }, { "name": "DestinationObjectName", "type": "string", "sensitive": false }, { "name": "Exclude", "type": "string", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false }, { "name": "IdempotentRepository", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IIdempotentRepository, redb.Route" }, { "name": "Include", "type": "string", "sensitive": false }, { "name": "IncludeBody", "type": "bool", "default": "true", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "MaxMessagesPerPoll", "type": "int", "default": "10", "sensitive": false }, { "name": "MoveAfterRead", "type": "string", "sensitive": false }, { "name": "MoveFailed", "type": "string", "sensitive": false }, { "name": "ObjectName", "type": "string", "sensitive": false }, { "name": "Operation", "type": "enum", "default": "Upload", "sensitive": false, "enumValues": [ "Upload", "Download", "Delete", "List", "GetMetadata", "Copy", "CreateDownloadLink", "CreateBucket", "DeleteBucket", "ListBuckets" ] }, { "name": "Prefix", "type": "string", "sensitive": false }, { "name": "ProjectId", "type": "string", "sensitive": false }, { "name": "SignedUrlExpiration", "type": "long", "default": "3600000", "sensitive": false }, { "name": "StreamBody", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "fcm", "alternateSchemes": [], "package": "redb.Route.Firebase", "optionsType": "redb.Route.Firebase.FcmEndpointOptions", "pathIsText": false, "options": [ { "name": "AndroidChannelId", "type": "string", "sensitive": false }, { "name": "AndroidPriority", "type": "string", "sensitive": false }, { "name": "AndroidTtlSeconds", "type": "int", "sensitive": false }, { "name": "ApnsCollapseId", "type": "string", "sensitive": false }, { "name": "ApnsContentAvailable", "type": "bool", "sensitive": false }, { "name": "ApnsMutableContent", "type": "bool", "sensitive": false }, { "name": "ApnsPriority", "type": "string", "sensitive": false }, { "name": "Body", "type": "string", "sensitive": false }, { "name": "Condition", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Firebase.IFirebaseCredentialProvider, redb.Route.Firebase" }, { "name": "CredentialPath", "type": "string", "sensitive": false }, { "name": "DataOnly", "type": "bool", "default": "false", "sensitive": false }, { "name": "DryRun", "type": "bool", "default": "false", "sensitive": false }, { "name": "ImageUrl", "type": "string", "sensitive": false }, { "name": "MessageType", "type": "enum", "default": "Token", "sensitive": false, "enumValues": [ "Token", "Topic", "Condition" ] }, { "name": "Operation", "type": "enum", "default": "Send", "sensitive": false, "enumValues": [ "Send", "Multicast", "SubscribeToTopic", "UnsubscribeFromTopic" ] }, { "name": "ProjectId", "type": "string", "sensitive": false }, { "name": "Title", "type": "string", "sensitive": false }, { "name": "Token", "type": "string", "sensitive": true }, { "name": "Topic", "type": "string", "sensitive": false }, { "name": "WebPushLink", "type": "string", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "file", "alternateSchemes": [], "package": "redb.Route.File", "optionsType": "redb.Route.File.FileEndpointOptions", "pathSynonym": "directory", "pathIsText": false, "options": [ { "name": "AllowNullBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "AntExclude", "type": "string", "default": "", "sensitive": false }, { "name": "AntFilterCaseSensitive", "type": "bool", "default": "true", "sensitive": false }, { "name": "AntInclude", "type": "string", "default": "", "sensitive": false }, { "name": "AppendChars", "type": "string", "default": "", "sensitive": false }, { "name": "AutoCreate", "type": "bool", "default": "true", "sensitive": false }, { "name": "BackoffErrorThreshold", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffIdleThreshold", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffMultiplier", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffOnFailedExchanges", "type": "bool", "default": "false", "sensitive": false }, { "name": "Charset", "type": "string", "default": "utf-8", "sensitive": false }, { "name": "Delay", "type": "int", "default": "500", "sensitive": false }, { "name": "Delete", "type": "bool", "default": "false", "sensitive": false }, { "name": "DoneFileName", "type": "string", "default": "", "sensitive": false }, { "name": "EagerDeleteTargetFile", "type": "bool", "default": "true", "sensitive": false }, { "name": "Exclude", "type": "string", "default": "", "sensitive": false }, { "name": "FileExist", "type": "enum", "default": "Override", "sensitive": false, "enumValues": [ "Override", "Append", "Fail", "Ignore", "Move", "TryRename" ] }, { "name": "FileName", "type": "string", "sensitive": false }, { "name": "Filter", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.GenericFile.IGenericFileFilter, redb.Route.GenericFile" }, { "name": "FilterDirectory", "type": "string", "default": "", "sensitive": false }, { "name": "FilterFile", "type": "string", "default": "", "sensitive": false }, { "name": "FilterInstance", "type": "string", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false }, { "name": "IdempotentKey", "type": "string", "default": "", "sensitive": false }, { "name": "Include", "type": "string", "default": "", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "0", "sensitive": false }, { "name": "JailStartingDirectory", "type": "bool", "default": "true", "sensitive": false }, { "name": "MaxDepth", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxMessagesPerPoll", "type": "int", "default": "0", "sensitive": false }, { "name": "MinAge", "type": "long", "default": "0", "sensitive": false }, { "name": "MinDepth", "type": "int", "default": "0", "sensitive": false }, { "name": "MoveExisting", "type": "enum", "default": "Override", "sensitive": false, "enumValues": [ "Override", "Append", "Fail", "Ignore", "Move", "TryRename" ] }, { "name": "MoveFailed", "type": "string", "default": "", "sensitive": false }, { "name": "MoveTo", "type": "string", "default": "", "sensitive": false }, { "name": "Noop", "type": "bool", "default": "false", "sensitive": false }, { "name": "PreMove", "type": "string", "default": "", "sensitive": false }, { "name": "ReadLock", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "MarkerFile", "Changed", "FileLock", "Rename" ] }, { "name": "ReadLockCheckInterval", "type": "int", "default": "1000", "sensitive": false }, { "name": "ReadLockMarkerFileExtension", "type": "string", "default": ".redbLock", "sensitive": false }, { "name": "ReadLockMinAge", "type": "long", "default": "1000", "sensitive": false }, { "name": "ReadLockTimeout", "type": "long", "default": "10000", "sensitive": false }, { "name": "Recursive", "type": "bool", "default": "false", "sensitive": false }, { "name": "SortBy", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Name", "NameDesc", "Modified", "ModifiedDesc", "Size", "SizeDesc" ] }, { "name": "StreamBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "TempFileName", "type": "string", "default": "", "sensitive": false }, { "name": "TempPrefix", "type": "string", "default": "", "sensitive": false } ], "lenient": false }, { "scheme": "fstore", "alternateSchemes": [], "package": "redb.Route.Firebase", "optionsType": "redb.Route.Firebase.FirestoreEndpointOptions", "pathIsText": false, "options": [ { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Firebase.IFirebaseCredentialProvider, redb.Route.Firebase" }, { "name": "CredentialPath", "type": "string", "sensitive": false }, { "name": "DatabaseId", "type": "string", "sensitive": false }, { "name": "Delay", "type": "int", "default": "5000", "sensitive": false }, { "name": "DocumentId", "type": "string", "sensitive": false }, { "name": "DocumentIdField", "type": "string", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "Limit", "type": "int", "sensitive": false }, { "name": "MaxConcurrency", "type": "int", "default": "16", "sensitive": false }, { "name": "Merge", "type": "bool", "default": "false", "sensitive": false }, { "name": "Offset", "type": "int", "sensitive": false }, { "name": "Operation", "type": "enum", "default": "Set", "sensitive": false, "enumValues": [ "Set", "Get", "Update", "Delete", "Query", "BatchWrite" ] }, { "name": "OrderBy", "type": "string", "sensitive": false }, { "name": "ProjectId", "type": "string", "sensitive": false }, { "name": "RawJson", "type": "bool", "default": "false", "sensitive": false }, { "name": "Realtime", "type": "bool", "default": "true", "sensitive": false }, { "name": "Where", "type": "string", "sensitive": false } ], "lenient": false }, { "scheme": "ftp", "alternateSchemes": [], "package": "redb.Route.Ftp", "optionsType": "redb.Route.Ftp.FtpEndpointOptions", "pathIsText": false, "options": [ { "name": "AllowNullBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "AntExclude", "type": "string", "default": "", "sensitive": false }, { "name": "AntFilterCaseSensitive", "type": "bool", "default": "true", "sensitive": false }, { "name": "AntInclude", "type": "string", "default": "", "sensitive": false }, { "name": "AppendChars", "type": "string", "default": "", "sensitive": false }, { "name": "AutoCreate", "type": "bool", "default": "true", "sensitive": false }, { "name": "BackoffErrorThreshold", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffIdleThreshold", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffMultiplier", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffOnFailedExchanges", "type": "bool", "default": "false", "sensitive": false }, { "name": "Charset", "type": "string", "default": "utf-8", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.GenericFile.RemoteFileConnectionFactory, redb.Route.GenericFile" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "Delay", "type": "int", "default": "60000", "sensitive": false }, { "name": "Delete", "type": "bool", "default": "false", "sensitive": false }, { "name": "Disconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "DoneFileName", "type": "string", "default": "", "sensitive": false }, { "name": "EagerDeleteTargetFile", "type": "bool", "default": "true", "sensitive": false }, { "name": "Exclude", "type": "string", "default": "", "sensitive": false }, { "name": "FileExist", "type": "enum", "default": "Override", "sensitive": false, "enumValues": [ "Override", "Append", "Fail", "Ignore", "Move", "TryRename" ] }, { "name": "FileName", "type": "string", "sensitive": false }, { "name": "Filter", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.GenericFile.IGenericFileFilter, redb.Route.GenericFile" }, { "name": "FilterDirectory", "type": "string", "default": "", "sensitive": false }, { "name": "FilterFile", "type": "string", "default": "", "sensitive": false }, { "name": "FilterInstance", "type": "string", "sensitive": false }, { "name": "Flatten", "type": "bool", "default": "false", "sensitive": false }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false }, { "name": "IdempotentKey", "type": "string", "default": "", "sensitive": false }, { "name": "IgnoreFileNotFoundOrPermissionError", "type": "bool", "default": "false", "sensitive": false }, { "name": "Include", "type": "string", "default": "", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "JailStartingDirectory", "type": "bool", "default": "true", "sensitive": false }, { "name": "MaxAge", "type": "long", "default": "0", "sensitive": false }, { "name": "MaxDepth", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxMessagesPerPoll", "type": "int", "default": "0", "sensitive": false }, { "name": "MaximumReconnectAttempts", "type": "int", "default": "3", "sensitive": false }, { "name": "MinAge", "type": "long", "default": "0", "sensitive": false }, { "name": "MinDepth", "type": "int", "default": "0", "sensitive": false }, { "name": "MoveExisting", "type": "enum", "default": "Override", "sensitive": false, "enumValues": [ "Override", "Append", "Fail", "Ignore", "Move", "TryRename" ] }, { "name": "MoveExistingFileStrategy", "type": "enum", "default": "Timestamp", "sensitive": false, "enumValues": [ "Backup", "Timestamp", "Guid" ] }, { "name": "MoveFailed", "type": "string", "default": "", "sensitive": false }, { "name": "MoveTo", "type": "string", "default": "", "sensitive": false }, { "name": "Noop", "type": "bool", "default": "false", "sensitive": false }, { "name": "OperationTimeout", "type": "int", "default": "60000", "sensitive": false }, { "name": "PassiveMode", "type": "bool", "default": "true", "sensitive": false }, { "name": "Password", "type": "string", "default": "", "sensitive": true }, { "name": "Port", "type": "int", "default": "21", "sensitive": false }, { "name": "PreMove", "type": "string", "default": "", "sensitive": false }, { "name": "ReconnectDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "Recursive", "type": "bool", "default": "false", "sensitive": false }, { "name": "SendEmptyMessageWhenIdle", "type": "bool", "default": "false", "sensitive": false }, { "name": "SortBy", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Name", "NameDesc", "Modified", "ModifiedDesc", "Size", "SizeDesc" ] }, { "name": "StartingDirectoryMustExist", "type": "bool", "default": "true", "sensitive": false }, { "name": "StreamBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "TempFileName", "type": "string", "default": "", "sensitive": false }, { "name": "TempPrefix", "type": "string", "default": "", "sensitive": false }, { "name": "TransferType", "type": "enum", "default": "Binary", "sensitive": false, "enumValues": [ "Binary", "Ascii" ] }, { "name": "UseFtps", "type": "bool", "default": "false", "sensitive": false }, { "name": "Username", "type": "string", "default": "", "sensitive": false }, { "name": "ValidateCertificate", "type": "bool", "default": "true", "sensitive": false } ], "lenient": false }, { "scheme": "grpc", "alternateSchemes": [], "package": "redb.Route.Grpc", "optionsType": "redb.Route.Grpc.GrpcEndpointOptions", "pathIsText": false, "options": [ { "name": "AllowClientReservedHeaders", "type": "bool", "default": "false", "sensitive": false }, { "name": "AllowedClientThumbprints", "type": "string", "sensitive": false }, { "name": "ClientCertPassword", "type": "string", "sensitive": true }, { "name": "ClientCertPath", "type": "string", "sensitive": false }, { "name": "ClientCertificateMode", "type": "enum", "default": "NoCertificate", "sensitive": false, "enumValues": [ "NoCertificate", "AllowCertificate", "RequireCertificate" ] }, { "name": "Compression", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Gzip" ] }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Grpc.GrpcConnectionFactory, redb.Route.Grpc" }, { "name": "Deadline", "type": "int", "default": "30000", "sensitive": false }, { "name": "DeadlineExpression", "type": "string", "sensitive": false }, { "name": "EmitHttpCompatHeaders", "type": "bool", "default": "false", "sensitive": false }, { "name": "Envelope", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "Auto", "Message", "Raw" ] }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Health", "type": "bool", "default": "false", "sensitive": false }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "InOut", "type": "bool", "default": "true", "sensitive": false }, { "name": "MaxConcurrentRequests", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxMessageSize", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxReceiveMessageSize", "type": "int", "default": "4194304", "sensitive": false }, { "name": "MaxRequestMessageSize", "type": "int", "default": "4194304", "sensitive": false }, { "name": "MaxSendMessageSize", "type": "int", "default": "4194304", "sensitive": false }, { "name": "Method", "type": "string", "sensitive": false }, { "name": "MethodPath", "type": "string", "default": "/redb.route.grpc.RedbService/Process", "sensitive": false }, { "name": "NegotiationType", "type": "string", "sensitive": false }, { "name": "Plaintext", "type": "bool", "default": "true", "sensitive": false }, { "name": "Port", "type": "int", "default": "50051", "sensitive": false }, { "name": "RejectStatusCode", "type": "int", "default": "429", "sensitive": false }, { "name": "RequestQueueLimit", "type": "int", "default": "0", "sensitive": false }, { "name": "RetryAfterSeconds", "type": "int", "default": "1", "sensitive": false }, { "name": "Service", "type": "string", "sensitive": false }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "Streaming", "type": "bool", "default": "false", "sensitive": false }, { "name": "SuppressStatusMapping", "type": "bool", "default": "false", "sensitive": false }, { "name": "ThrowOnError", "type": "bool", "default": "true", "sensitive": false } ], "lenient": false }, { "scheme": "http", "alternateSchemes": [], "package": "redb.Route.Http", "optionsType": "redb.Route.Http.HttpEndpointOptions", "pathIsText": false, "options": [ { "name": "AuthScheme", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Basic", "Bearer" ], "role": "producer" }, { "name": "AuthToken", "type": "string", "sensitive": true, "role": "producer" }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Http.HttpConnectionFactory, redb.Route.Http" }, { "name": "ContentType", "type": "string", "default": "application/json", "sensitive": false }, { "name": "Cors", "type": "bool", "default": "false", "sensitive": false }, { "name": "CorsCredentials", "type": "bool", "default": "false", "sensitive": false }, { "name": "CorsOrigins", "type": "string", "sensitive": false }, { "name": "CorsOriginsResolver", "type": "string", "sensitive": false }, { "name": "FollowRedirects", "type": "bool", "default": "true", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "InOut", "type": "bool", "default": "false", "sensitive": false }, { "name": "InboundAuth", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Basic", "Bearer" ], "role": "consumer" }, { "name": "InboundPassword", "type": "string", "sensitive": true, "role": "consumer" }, { "name": "InboundRealm", "type": "string", "default": "redb", "sensitive": false, "role": "consumer" }, { "name": "InboundUsername", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "MaxConcurrentRequests", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxRedirects", "type": "int", "default": "50", "sensitive": false }, { "name": "MaxRequestBodySize", "type": "long", "default": "10485760", "sensitive": false }, { "name": "Method", "type": "enum", "default": "GET", "sensitive": false, "enumValues": [ "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS" ] }, { "name": "Methods", "type": "string", "sensitive": false }, { "name": "Password", "type": "string", "sensitive": true, "role": "producer" }, { "name": "Port", "type": "int", "default": "8080", "sensitive": false }, { "name": "PreserveHostHeader", "type": "bool", "default": "false", "sensitive": false }, { "name": "Protocol", "type": "enum", "default": "Http1And2", "sensitive": false, "enumValues": [ "Http1", "Http2", "Http1And2", "Http3", "Http1And2And3" ] }, { "name": "RejectStatusCode", "type": "int", "default": "429", "sensitive": false }, { "name": "RequestQueueLimit", "type": "int", "default": "0", "sensitive": false }, { "name": "ResponseCode", "type": "int", "default": "200", "sensitive": false }, { "name": "RetryAfterSeconds", "type": "int", "default": "1", "sensitive": false }, { "name": "SkipControlHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "SkipRequestHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "SkipResponseHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "StreamRequest", "type": "bool", "default": "false", "sensitive": false }, { "name": "StreamResponse", "type": "bool", "default": "false", "sensitive": false }, { "name": "ThrowOnError", "type": "bool", "default": "true", "sensitive": false }, { "name": "Timeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "TokenValidator", "type": "string", "sensitive": false, "role": "consumer", "reference": "redb.Route.Http.IHttpTokenValidator, redb.Route.Http" }, { "name": "Username", "type": "string", "sensitive": false, "role": "producer" } ], "lenient": true }, { "scheme": "https", "alternateSchemes": [], "package": "redb.Route.Http", "optionsType": "redb.Route.Http.HttpEndpointOptions", "pathIsText": false, "options": [ { "name": "AuthScheme", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Basic", "Bearer" ], "role": "producer" }, { "name": "AuthToken", "type": "string", "sensitive": true, "role": "producer" }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Http.HttpConnectionFactory, redb.Route.Http" }, { "name": "ContentType", "type": "string", "default": "application/json", "sensitive": false }, { "name": "Cors", "type": "bool", "default": "false", "sensitive": false }, { "name": "CorsCredentials", "type": "bool", "default": "false", "sensitive": false }, { "name": "CorsOrigins", "type": "string", "sensitive": false }, { "name": "CorsOriginsResolver", "type": "string", "sensitive": false }, { "name": "FollowRedirects", "type": "bool", "default": "true", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "InOut", "type": "bool", "default": "false", "sensitive": false }, { "name": "InboundAuth", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Basic", "Bearer" ], "role": "consumer" }, { "name": "InboundPassword", "type": "string", "sensitive": true, "role": "consumer" }, { "name": "InboundRealm", "type": "string", "default": "redb", "sensitive": false, "role": "consumer" }, { "name": "InboundUsername", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "MaxConcurrentRequests", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxRedirects", "type": "int", "default": "50", "sensitive": false }, { "name": "MaxRequestBodySize", "type": "long", "default": "10485760", "sensitive": false }, { "name": "Method", "type": "enum", "default": "GET", "sensitive": false, "enumValues": [ "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS" ] }, { "name": "Methods", "type": "string", "sensitive": false }, { "name": "Password", "type": "string", "sensitive": true, "role": "producer" }, { "name": "Port", "type": "int", "default": "8080", "sensitive": false }, { "name": "PreserveHostHeader", "type": "bool", "default": "false", "sensitive": false }, { "name": "Protocol", "type": "enum", "default": "Http1And2", "sensitive": false, "enumValues": [ "Http1", "Http2", "Http1And2", "Http3", "Http1And2And3" ] }, { "name": "RejectStatusCode", "type": "int", "default": "429", "sensitive": false }, { "name": "RequestQueueLimit", "type": "int", "default": "0", "sensitive": false }, { "name": "ResponseCode", "type": "int", "default": "200", "sensitive": false }, { "name": "RetryAfterSeconds", "type": "int", "default": "1", "sensitive": false }, { "name": "SkipControlHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "SkipRequestHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "SkipResponseHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "StreamRequest", "type": "bool", "default": "false", "sensitive": false }, { "name": "StreamResponse", "type": "bool", "default": "false", "sensitive": false }, { "name": "ThrowOnError", "type": "bool", "default": "true", "sensitive": false }, { "name": "Timeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "TokenValidator", "type": "string", "sensitive": false, "role": "consumer", "reference": "redb.Route.Http.IHttpTokenValidator, redb.Route.Http" }, { "name": "Username", "type": "string", "sensitive": false, "role": "producer" } ], "lenient": true }, { "scheme": "imap", "alternateSchemes": [], "package": "redb.Route.Mail", "optionsType": "redb.Route.Mail.MailEndpointOptions", "pathIsText": false, "options": [ { "name": "AccessToken", "type": "string", "default": "", "sensitive": true }, { "name": "AdditionalFolders", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "AlternativeBody", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "Attachments", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "AuthMechanism", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "Auto", "Plain", "Login", "CramMd5", "XOAuth2", "OAuthBearer", "Ntlm" ] }, { "name": "Bcc", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "Cc", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "ClientCertPassword", "type": "string", "default": "", "sensitive": true }, { "name": "ClientCertPath", "type": "string", "default": "", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Mail.MailConnectionFactory, redb.Route.Mail" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "ContentType", "type": "string", "default": "text/plain", "sensitive": false, "role": "producer" }, { "name": "CopyTo", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Delay", "type": "int", "default": "60000", "sensitive": false, "role": "consumer" }, { "name": "Delete", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "Disconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "FetchAttachments", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "FetchBody", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "FetchFilter", "type": "enum", "default": "Unseen", "sensitive": false, "enumValues": [ "Unseen", "All", "Recent", "Flagged", "Answered", "Unanswered" ], "role": "consumer" }, { "name": "Folder", "type": "string", "default": "INBOX", "sensitive": false, "role": "consumer" }, { "name": "From", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "FromFilter", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "IdempotentRepository", "type": "string", "sensitive": false, "role": "consumer", "reference": "redb.Route.Abstractions.IIdempotentRepository, redb.Route" }, { "name": "IdempotentRepositoryRemoveOnCommit", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Idle", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "IdleTimeout", "type": "int", "default": "1740000", "sensitive": false, "role": "consumer" }, { "name": "InitialDelay", "type": "int", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "KeepRawMessage", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "MapMimeHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "MaxAge", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MaxAttachmentSize", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MaxMessages", "type": "int", "default": "50", "sensitive": false, "role": "consumer" }, { "name": "MinAge", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MoveTo", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Password", "type": "string", "default": "", "sensitive": true }, { "name": "Peek", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Port", "type": "int", "default": "0", "sensitive": false }, { "name": "PostProcess", "type": "enum", "default": "MarkRead", "sensitive": false, "enumValues": [ "None", "MarkRead", "Delete", "Move", "MarkReadAndMove", "Flag" ], "role": "consumer" }, { "name": "ReplyTo", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "SearchTerm", "type": "string", "sensitive": false, "role": "consumer", "reference": "MailKit.Search.SearchQuery, MailKit" }, { "name": "SearchTerm.Body", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.From", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.FromReceivedDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.FromSentDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.Subject", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.SubjectOrBody", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.To", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.ToReceivedDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.ToSentDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.Unseen", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Security", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "None", "Ssl", "StartTls", "Auto" ] }, { "name": "SortBy", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "DateAsc", "DateDesc", "SubjectAsc", "FromAsc", "SizeAsc", "SizeDesc" ], "role": "consumer" }, { "name": "Subject", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "SubjectFilter", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Timeout", "type": "int", "default": "60000", "sensitive": false }, { "name": "To", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false }, { "name": "Username", "type": "string", "default": "", "sensitive": false } ], "lenient": false, "role": "consumer" }, { "scheme": "kafka", "alternateSchemes": [], "package": "redb.Route.Kafka", "optionsType": "redb.Route.Kafka.KafkaEndpointOptions", "pathSynonym": "topic", "pathIsText": false, "options": [ { "name": "AckMode", "type": "enum", "default": "Manual", "sensitive": false, "enumValues": [ "Manual", "Auto" ] }, { "name": "Acks", "type": "string", "default": "All", "sensitive": false }, { "name": "AdditionalProperties", "type": "string", "sensitive": false }, { "name": "AutoOffsetReset", "type": "string", "default": "Latest", "sensitive": false }, { "name": "BatchSize", "type": "int", "sensitive": false }, { "name": "Batching", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchingIntervalMs", "type": "int", "sensitive": false }, { "name": "BreakOnFirstError", "type": "bool", "default": "false", "sensitive": false }, { "name": "Brokers", "type": "string", "default": "", "sensitive": false }, { "name": "CompressionType", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Kafka.KafkaConnectionFactory, redb.Route.Kafka" }, { "name": "EnableIdempotence", "type": "bool", "sensitive": false }, { "name": "GroupId", "type": "string", "sensitive": false }, { "name": "GroupInstanceId", "type": "string", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "HeartbeatIntervalMs", "type": "int", "sensitive": false }, { "name": "IsolationLevel", "type": "string", "sensitive": false }, { "name": "Key", "type": "string", "sensitive": false }, { "name": "LingerMs", "type": "int", "sensitive": false }, { "name": "MaxBatchMessages", "type": "int", "sensitive": false }, { "name": "MaxPollIntervalMs", "type": "int", "sensitive": false }, { "name": "MessageTimeoutMs", "type": "int", "sensitive": false }, { "name": "PartitionAssignmentStrategy", "type": "string", "sensitive": false }, { "name": "PartitionKey", "type": "int", "sensitive": false }, { "name": "PartitionNumber", "type": "int", "sensitive": false }, { "name": "PollTimeoutMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "RecordMetadata", "type": "bool", "default": "false", "sensitive": false }, { "name": "Retries", "type": "int", "default": "3", "sensitive": false }, { "name": "SaslMechanism", "type": "string", "sensitive": false }, { "name": "SaslPassword", "type": "string", "sensitive": true }, { "name": "SaslUsername", "type": "string", "sensitive": false }, { "name": "SecurityProtocol", "type": "string", "default": "Plaintext", "sensitive": false }, { "name": "SeekTo", "type": "string", "sensitive": false }, { "name": "SessionTimeoutMs", "type": "int", "sensitive": false }, { "name": "SslCaLocation", "type": "string", "sensitive": false }, { "name": "SslCertificateLocation", "type": "string", "sensitive": false }, { "name": "SslEndpointIdentificationAlgorithm", "type": "string", "sensitive": false }, { "name": "SslKeyLocation", "type": "string", "sensitive": false }, { "name": "SslKeyPassword", "type": "string", "sensitive": true }, { "name": "TopicIsPattern", "type": "bool", "default": "false", "sensitive": false }, { "name": "Transacted", "type": "bool", "sensitive": false }, { "name": "TransactionalIdPrefix", "type": "string", "sensitive": false } ], "lenient": false }, { "scheme": "knowledge", "alternateSchemes": [], "package": "redb.Route.Llm", "optionsType": "redb.Route.Llm.Knowledge.KnowledgeEndpointOptions", "pathIsText": false, "options": [ { "name": "ChunkChars", "type": "int", "default": "1000", "sensitive": false }, { "name": "Collection", "type": "string", "sensitive": false }, { "name": "DocId", "type": "string", "sensitive": false }, { "name": "Embed", "type": "bool", "default": "true", "sensitive": false }, { "name": "Overlap", "type": "int", "default": "0", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "ldap", "alternateSchemes": [], "package": "redb.Route.Ldap", "optionsType": "redb.Route.Ldap.LdapEndpointOptions", "pathIsText": false, "options": [ { "name": "Attributes", "type": "string", "sensitive": false }, { "name": "BindDn", "type": "string", "sensitive": false }, { "name": "BindPassword", "type": "string", "sensitive": true }, { "name": "ChangeTrackingMode", "type": "string", "default": "modifyTimestamp", "sensitive": false }, { "name": "ClientCertPassword", "type": "string", "sensitive": true }, { "name": "ClientCertPath", "type": "string", "sensitive": false }, { "name": "ConnectTimeout", "type": "int", "default": "5000", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Ldap.LdapConnectionFactory, redb.Route.Ldap" }, { "name": "DetectDeletions", "type": "bool", "default": "false", "sensitive": false }, { "name": "Filter", "type": "string", "sensitive": false }, { "name": "FollowReferrals", "type": "bool", "default": "true", "sensitive": false }, { "name": "FullSyncInterval", "type": "int", "default": "10", "sensitive": false }, { "name": "InitialLoad", "type": "bool", "default": "false", "sensitive": false }, { "name": "MaxConnections", "type": "int", "default": "10", "sensitive": false }, { "name": "OperationTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "PageSize", "type": "int", "default": "500", "sensitive": false }, { "name": "PollInterval", "type": "int", "default": "60000", "sensitive": false }, { "name": "Port", "type": "int", "default": "389", "sensitive": false }, { "name": "ProtocolVersion", "type": "int", "default": "3", "sensitive": false }, { "name": "Scope", "type": "string", "default": "subtree", "sensitive": false }, { "name": "Server", "type": "string", "default": "localhost", "sensitive": false }, { "name": "SizeLimit", "type": "int", "default": "0", "sensitive": false }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "StartTls", "type": "bool", "default": "false", "sensitive": false }, { "name": "TimeLimit", "type": "int", "default": "0", "sensitive": false }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "llm", "alternateSchemes": [], "package": "redb.Route.Llm", "optionsType": "redb.Route.Llm.LlmEndpointOptions", "pathIsText": false, "options": [ { "name": "Audit", "type": "string", "sensitive": false }, { "name": "BudgetCostUsd", "type": "double", "sensitive": false }, { "name": "BudgetInputTokens", "type": "int", "sensitive": false }, { "name": "BudgetOutputTokens", "type": "int", "sensitive": false }, { "name": "CacheSystemPrompt", "type": "bool", "default": "false", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Llm.LlmConnectionFactory, redb.Route.Llm" }, { "name": "Conversation", "type": "string", "default": "none", "sensitive": false }, { "name": "InitialBodyRef", "type": "string", "sensitive": false }, { "name": "MaxIterations", "type": "int", "default": "8", "sensitive": false }, { "name": "MaxTokens", "type": "int", "sensitive": false }, { "name": "PromptTemplateName", "type": "string", "sensitive": false }, { "name": "PromptTemplateVersion", "type": "string", "sensitive": false }, { "name": "PropagateToolHeaders", "type": "string", "sensitive": false }, { "name": "Redb", "type": "string", "sensitive": false }, { "name": "Schedule", "type": "string", "sensitive": false }, { "name": "Stream", "type": "enum", "default": "Off", "sensitive": false, "enumValues": [ "Off", "Calls", "Body" ] }, { "name": "SystemPromptRef", "type": "string", "sensitive": false }, { "name": "Temperature", "type": "double", "sensitive": false }, { "name": "Tools", "type": "string", "sensitive": false }, { "name": "TopP", "type": "double", "sensitive": false }, { "name": "User", "type": "string", "sensitive": false } ], "lenient": false }, { "scheme": "log", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.LogEndpointOptions", "pathIsText": false, "options": [ { "name": "Level", "type": "string", "default": "Information", "sensitive": false }, { "name": "ShowBody", "type": "bool", "default": "true", "sensitive": false }, { "name": "ShowHeaders", "type": "bool", "default": "true", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "mcp", "alternateSchemes": [], "package": "redb.Route.Llm.Mcp", "optionsType": "redb.Route.Llm.Mcp.McpEndpointOptions", "pathIsText": false, "options": [ { "name": "CallTimeoutMs", "type": "int", "default": "60000", "sensitive": false }, { "name": "ServerName", "type": "string", "default": "", "sensitive": false }, { "name": "ToolName", "type": "string", "default": "", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "mock", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.MockEndpointOptions", "pathIsText": false, "options": [ { "name": "ExpectedMessageCount", "type": "int", "default": "0", "sensitive": false } ], "lenient": false }, { "scheme": "mqtt", "alternateSchemes": [], "package": "redb.Route.MqttNet", "optionsType": "redb.Route.MqttNet.MqttEndpointOptions", "pathIsText": false, "options": [ { "name": "Broker", "type": "string", "sensitive": false }, { "name": "CleanSession", "type": "bool", "default": "true", "sensitive": false }, { "name": "ClientId", "type": "string", "sensitive": false }, { "name": "ConcurrentConsumers", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.MqttNet.MqttConnectionFactory, redb.Route.MqttNet" }, { "name": "ContentType", "type": "string", "sensitive": false }, { "name": "KeepAlive", "type": "int", "default": "60", "sensitive": false }, { "name": "MaxReconnectDelay", "type": "int", "default": "128000", "sensitive": false }, { "name": "MessageExpiryInterval", "type": "int", "default": "0", "sensitive": false }, { "name": "MessageExpiryIntervalExpression", "type": "string", "sensitive": false }, { "name": "Mode", "type": "enum", "default": "Subscribe", "sensitive": false, "enumValues": [ "Subscribe", "Publish" ] }, { "name": "Password", "type": "string", "sensitive": true }, { "name": "Port", "type": "int", "default": "0", "sensitive": false }, { "name": "Qos", "type": "int", "default": "0", "sensitive": false }, { "name": "QosExpression", "type": "string", "sensitive": false }, { "name": "ResponseTopic", "type": "string", "sensitive": false }, { "name": "Retain", "type": "bool", "default": "false", "sensitive": false }, { "name": "Server", "type": "string", "sensitive": false }, { "name": "SessionExpiryInterval", "type": "int", "default": "0", "sensitive": false }, { "name": "SharedSubscription", "type": "string", "sensitive": false }, { "name": "UseTls", "type": "bool", "default": "false", "sensitive": false }, { "name": "Username", "type": "string", "sensitive": false } ], "lenient": false }, { "scheme": "pop3", "alternateSchemes": [], "package": "redb.Route.Mail", "optionsType": "redb.Route.Mail.MailEndpointOptions", "pathIsText": false, "options": [ { "name": "AccessToken", "type": "string", "default": "", "sensitive": true }, { "name": "AdditionalFolders", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "AlternativeBody", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "Attachments", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "AuthMechanism", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "Auto", "Plain", "Login", "CramMd5", "XOAuth2", "OAuthBearer", "Ntlm" ] }, { "name": "Bcc", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "Cc", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "ClientCertPassword", "type": "string", "default": "", "sensitive": true }, { "name": "ClientCertPath", "type": "string", "default": "", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Mail.MailConnectionFactory, redb.Route.Mail" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "ContentType", "type": "string", "default": "text/plain", "sensitive": false, "role": "producer" }, { "name": "CopyTo", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Delay", "type": "int", "default": "60000", "sensitive": false, "role": "consumer" }, { "name": "Delete", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "Disconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "FetchAttachments", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "FetchBody", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "FetchFilter", "type": "enum", "default": "Unseen", "sensitive": false, "enumValues": [ "Unseen", "All", "Recent", "Flagged", "Answered", "Unanswered" ], "role": "consumer" }, { "name": "Folder", "type": "string", "default": "INBOX", "sensitive": false, "role": "consumer" }, { "name": "From", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "FromFilter", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "IdempotentRepository", "type": "string", "sensitive": false, "role": "consumer", "reference": "redb.Route.Abstractions.IIdempotentRepository, redb.Route" }, { "name": "IdempotentRepositoryRemoveOnCommit", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Idle", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "IdleTimeout", "type": "int", "default": "1740000", "sensitive": false, "role": "consumer" }, { "name": "InitialDelay", "type": "int", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "KeepRawMessage", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "MapMimeHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "MaxAge", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MaxAttachmentSize", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MaxMessages", "type": "int", "default": "50", "sensitive": false, "role": "consumer" }, { "name": "MinAge", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MoveTo", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Password", "type": "string", "default": "", "sensitive": true }, { "name": "Peek", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Port", "type": "int", "default": "0", "sensitive": false }, { "name": "PostProcess", "type": "enum", "default": "MarkRead", "sensitive": false, "enumValues": [ "None", "MarkRead", "Delete", "Move", "MarkReadAndMove", "Flag" ], "role": "consumer" }, { "name": "ReplyTo", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "SearchTerm", "type": "string", "sensitive": false, "role": "consumer", "reference": "MailKit.Search.SearchQuery, MailKit" }, { "name": "SearchTerm.Body", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.From", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.FromReceivedDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.FromSentDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.Subject", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.SubjectOrBody", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.To", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.ToReceivedDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.ToSentDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.Unseen", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Security", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "None", "Ssl", "StartTls", "Auto" ] }, { "name": "SortBy", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "DateAsc", "DateDesc", "SubjectAsc", "FromAsc", "SizeAsc", "SizeDesc" ], "role": "consumer" }, { "name": "Subject", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "SubjectFilter", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Timeout", "type": "int", "default": "60000", "sensitive": false }, { "name": "To", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false }, { "name": "Username", "type": "string", "default": "", "sensitive": false } ], "lenient": false, "role": "consumer" }, { "scheme": "qtimer", "alternateSchemes": [], "package": "redb.Route.Quartz", "optionsType": "redb.Route.Quartz.QuartzTimerEndpointOptions", "pathIsText": false, "options": [ { "name": "CustomCalendar", "type": "string", "sensitive": false, "reference": "Quartz.ICalendar, Quartz" }, { "name": "Delay", "type": "int", "default": "0", "sensitive": false }, { "name": "DeleteJob", "type": "bool", "default": "true", "sensitive": false }, { "name": "DurableJob", "type": "bool", "default": "false", "sensitive": false }, { "name": "EndAt", "type": "string", "sensitive": false }, { "name": "FixedRate", "type": "bool", "default": "false", "sensitive": false }, { "name": "GroupName", "type": "string", "default": "redb", "sensitive": false }, { "name": "JobName", "type": "string", "default": "", "sensitive": false }, { "name": "MisfireInstruction", "type": "enum", "default": "Default", "sensitive": false, "enumValues": [ "Default", "SimpleFireNow", "SimpleRescheduleNowWithExistingRepeatCount", "SimpleRescheduleNowWithRemainingRepeatCount", "SimpleRescheduleNextWithRemainingCount", "SimpleRescheduleNextWithExistingCount", "CronFireOnceNow", "CronDoNothing" ] }, { "name": "PauseJob", "type": "bool", "default": "false", "sensitive": false }, { "name": "Period", "type": "int", "default": "1000", "sensitive": false }, { "name": "PrefixJobNameWithEndpointId", "type": "bool", "default": "false", "sensitive": false }, { "name": "RecoverableJob", "type": "bool", "default": "false", "sensitive": false }, { "name": "RepeatCount", "type": "int", "default": "-1", "sensitive": false }, { "name": "StartAt", "type": "string", "sensitive": false }, { "name": "Stateful", "type": "bool", "default": "false", "sensitive": false }, { "name": "Threads", "type": "int", "default": "1", "sensitive": false } ], "lenient": false, "role": "consumer" }, { "scheme": "rabbitmq", "alternateSchemes": [], "package": "redb.Route.RabbitMQ", "optionsType": "redb.Route.RabbitMQ.RabbitMQEndpointOptions", "pathSynonym": "queue", "pathIsText": false, "options": [ { "name": "AckMode", "type": "enum", "default": "Manual", "sensitive": false, "enumValues": [ "Manual", "Auto" ] }, { "name": "AuthMechanism", "type": "enum", "default": "Plain", "sensitive": false, "enumValues": [ "Plain", "External" ], "connectionParameter": true }, { "name": "AutoDelete", "type": "bool", "default": "false", "sensitive": false }, { "name": "AutomaticRecovery", "type": "bool", "default": "true", "sensitive": false, "connectionParameter": true }, { "name": "Batching", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchingIntervalMs", "type": "int", "sensitive": false }, { "name": "ClientName", "type": "string", "default": "redb.Route", "sensitive": false, "connectionParameter": true }, { "name": "ConcurrentConsumers", "type": "string", "sensitive": false }, { "name": "ConfirmTimeout", "type": "int", "default": "5000", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "connectionFactoryReference": true, "reference": "redb.Route.RabbitMQ.RabbitMQConnectionFactory, redb.Route.RabbitMQ" }, { "name": "ConnectionTimeout", "type": "int", "default": "60", "sensitive": false, "connectionParameter": true }, { "name": "ConsumerDispatchConcurrency", "type": "string", "default": "1", "sensitive": false, "connectionParameter": true }, { "name": "ContentType", "type": "string", "default": "application/json", "sensitive": false }, { "name": "ContinuationTimeout", "type": "int", "default": "30", "sensitive": false, "connectionParameter": true }, { "name": "DeadLetterExchange", "type": "string", "sensitive": false }, { "name": "DeadLetterRoutingKey", "type": "string", "sensitive": false }, { "name": "Declare", "type": "bool", "default": "false", "sensitive": false }, { "name": "DisableReplyTo", "type": "bool", "default": "false", "sensitive": false }, { "name": "Durable", "type": "bool", "default": "true", "sensitive": false }, { "name": "Exchange", "type": "string", "default": "", "sensitive": false }, { "name": "ExchangeAutoDelete", "type": "bool", "default": "false", "sensitive": false }, { "name": "ExchangeDurable", "type": "bool", "default": "true", "sensitive": false }, { "name": "ExchangeType", "type": "string", "default": "direct", "sensitive": false }, { "name": "Exclusive", "type": "bool", "default": "false", "sensitive": false }, { "name": "Expires", "type": "int", "default": "0", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Heartbeat", "type": "int", "default": "60", "sensitive": false, "connectionParameter": true }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false, "connectionParameter": true }, { "name": "Mandatory", "type": "bool", "sensitive": false }, { "name": "MaxBatchMessages", "type": "int", "sensitive": false }, { "name": "MaxLength", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxLengthBytes", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxOutstandingConfirms", "type": "int", "default": "2048", "sensitive": false }, { "name": "MaxPriority", "type": "int", "default": "0", "sensitive": false }, { "name": "MaximumRetryAttempts", "type": "int", "default": "5", "sensitive": false }, { "name": "MessageTtl", "type": "int", "default": "0", "sensitive": false }, { "name": "Overflow", "type": "string", "sensitive": false }, { "name": "Password", "type": "string", "default": "guest", "sensitive": true, "connectionParameter": true }, { "name": "PollTimeoutMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "Port", "type": "int", "default": "5672", "sensitive": false, "connectionParameter": true }, { "name": "PrefetchCount", "type": "string", "default": "10", "sensitive": false }, { "name": "PreserveMessageQos", "type": "bool", "default": "false", "sensitive": false }, { "name": "PublisherConnection", "type": "bool", "default": "false", "sensitive": false }, { "name": "Queue", "type": "string", "default": "", "sensitive": false }, { "name": "QueueType", "type": "string", "sensitive": false }, { "name": "RecoveryInterval", "type": "int", "default": "5", "sensitive": false, "connectionParameter": true }, { "name": "RejectAndDontRequeue", "type": "bool", "default": "true", "sensitive": false }, { "name": "ReplyTo", "type": "bool", "default": "false", "sensitive": false }, { "name": "RetryDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "RevocationMode", "type": "enum", "default": "NoCheck", "sensitive": false, "enumValues": [ "NoCheck", "Online", "Offline" ], "connectionParameter": true }, { "name": "RevocationSoftFail", "type": "bool", "default": "false", "sensitive": false, "connectionParameter": true }, { "name": "RoutingKey", "type": "string", "default": "", "sensitive": false }, { "name": "SocketReadTimeout", "type": "int", "default": "30", "sensitive": false, "connectionParameter": true }, { "name": "SocketWriteTimeout", "type": "int", "default": "30", "sensitive": false, "connectionParameter": true }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false, "connectionParameter": true }, { "name": "SslCaCertPath", "type": "string", "sensitive": false, "connectionParameter": true }, { "name": "SslCertPassword", "type": "string", "sensitive": true, "connectionParameter": true }, { "name": "SslCertPath", "type": "string", "sensitive": false, "connectionParameter": true }, { "name": "SslProtocols", "type": "flags", "default": "None", "sensitive": false, "enumValues": [ "None", "Ssl2", "Ssl3", "Tls", "Default", "Tls11", "Tls12", "Tls13" ], "connectionParameter": true }, { "name": "SslServerName", "type": "string", "sensitive": false, "connectionParameter": true }, { "name": "Timeout", "type": "int", "default": "60", "sensitive": false }, { "name": "TopologyRecoveryEnabled", "type": "bool", "default": "true", "sensitive": false, "connectionParameter": true }, { "name": "Transacted", "type": "bool", "sensitive": false }, { "name": "Username", "type": "string", "default": "guest", "sensitive": false, "connectionParameter": true }, { "name": "VirtualHost", "type": "string", "default": "/", "sensitive": false, "connectionParameter": true } ], "lenient": false }, { "scheme": "redis", "alternateSchemes": [], "package": "redb.Route.Redis", "optionsType": "redb.Route.Redis.RedisEndpointOptions", "pathIsText": false, "options": [ { "name": "AckMode", "type": "enum", "default": "Manual", "sensitive": false, "enumValues": [ "Manual", "Auto" ] }, { "name": "Batching", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchingIntervalMs", "type": "int", "sensitive": false }, { "name": "Bit", "type": "bool", "sensitive": false }, { "name": "Channel", "type": "string", "sensitive": false }, { "name": "Command", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Redis.RedisConnectionFactory, redb.Route.Redis" }, { "name": "ConnectionString", "type": "string", "default": "localhost:6379", "sensitive": true }, { "name": "ConsumerGroup", "type": "string", "sensitive": false }, { "name": "ConsumerName", "type": "string", "sensitive": false }, { "name": "Database", "type": "int", "default": "0", "sensitive": false }, { "name": "Field", "type": "string", "sensitive": false }, { "name": "GeoUnit", "type": "string", "default": "m", "sensitive": false }, { "name": "Key", "type": "string", "sensitive": false }, { "name": "Latitude", "type": "double", "sensitive": false }, { "name": "Longitude", "type": "double", "sensitive": false }, { "name": "MaxBatchMessages", "type": "int", "sensitive": false }, { "name": "MaxScore", "type": "double", "sensitive": false }, { "name": "Member1", "type": "string", "sensitive": false }, { "name": "Member2", "type": "string", "sensitive": false }, { "name": "MinScore", "type": "double", "sensitive": false }, { "name": "Offset", "type": "long", "sensitive": false }, { "name": "Password", "type": "string", "sensitive": true }, { "name": "PollDelayMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "PollTimeoutMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "ProcessingList", "type": "string", "sensitive": false }, { "name": "Score", "type": "double", "sensitive": false }, { "name": "Start", "type": "long", "sensitive": false }, { "name": "Stop", "type": "long", "sensitive": false }, { "name": "StreamApproximate", "type": "bool", "default": "true", "sensitive": false }, { "name": "StreamBlockTimeMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "StreamClaimMinIdleMs", "type": "int", "sensitive": false }, { "name": "StreamMaxLength", "type": "int", "default": "0", "sensitive": false }, { "name": "StreamName", "type": "string", "sensitive": false }, { "name": "StreamReadCount", "type": "int", "default": "10", "sensitive": false }, { "name": "StreamStartPosition", "type": "string", "sensitive": false }, { "name": "Transacted", "type": "bool", "sensitive": false }, { "name": "Ttl", "type": "int", "default": "0", "sensitive": false }, { "name": "UsePattern", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "s3", "alternateSchemes": [], "package": "redb.Route.S3", "optionsType": "redb.Route.S3.S3EndpointOptions", "pathIsText": false, "options": [ { "name": "AccessKey", "type": "string", "default": "", "sensitive": true }, { "name": "AutoCreateBucket", "type": "bool", "default": "false", "sensitive": false }, { "name": "CacheControl", "type": "string", "default": "", "sensitive": false }, { "name": "CannedAcl", "type": "enum", "default": "Private", "sensitive": false, "enumValues": [ "Private", "PublicRead", "PublicReadWrite", "AuthenticatedRead", "BucketOwnerRead", "BucketOwnerFullControl" ] }, { "name": "ConditionalWrite", "type": "bool", "default": "false", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.S3.S3ConnectionFactory, redb.Route.S3" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "ContentDisposition", "type": "string", "default": "", "sensitive": false }, { "name": "ContentEncoding", "type": "string", "default": "", "sensitive": false }, { "name": "ContentType", "type": "string", "default": "", "sensitive": false }, { "name": "CustomerKeyId", "type": "string", "default": "", "sensitive": false }, { "name": "CustomerKeyMD5", "type": "string", "default": "", "sensitive": false }, { "name": "Delay", "type": "int", "default": "60000", "sensitive": false }, { "name": "DeleteAfterRead", "type": "bool", "default": "true", "sensitive": false }, { "name": "Delimiter", "type": "string", "default": "", "sensitive": false }, { "name": "DestinationBucket", "type": "string", "default": "", "sensitive": false }, { "name": "DestinationBucketPrefix", "type": "string", "default": "", "sensitive": false }, { "name": "DestinationBucketSuffix", "type": "string", "default": "", "sensitive": false }, { "name": "DoneFileName", "type": "string", "default": "", "sensitive": false }, { "name": "Exclude", "type": "string", "default": "", "sensitive": false }, { "name": "FileName", "type": "string", "default": "", "sensitive": false }, { "name": "ForcePathStyle", "type": "bool", "default": "false", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false }, { "name": "IdempotentRepository", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.Abstractions.IIdempotentRepository, redb.Route" }, { "name": "IgnoreBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "Include", "type": "string", "default": "", "sensitive": false }, { "name": "IncludeBody", "type": "bool", "default": "true", "sensitive": false }, { "name": "IncludeFolders", "type": "bool", "default": "false", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "KeyName", "type": "string", "sensitive": false }, { "name": "KmsKeyId", "type": "string", "default": "", "sensitive": false }, { "name": "MaxAge", "type": "long", "default": "0", "sensitive": false }, { "name": "MaxConnections", "type": "int", "default": "50", "sensitive": false }, { "name": "MaxMessagesPerPoll", "type": "int", "default": "10", "sensitive": false }, { "name": "Metadata", "type": "string", "default": "", "sensitive": false }, { "name": "MinAge", "type": "long", "default": "0", "sensitive": false }, { "name": "MoveAfterRead", "type": "bool", "default": "false", "sensitive": false }, { "name": "MultiPartUpload", "type": "bool", "default": "false", "sensitive": false }, { "name": "PartSize", "type": "long", "default": "26214400", "sensitive": false }, { "name": "Prefix", "type": "string", "default": "", "sensitive": false }, { "name": "PresignedUrlExpiration", "type": "long", "default": "3600000", "sensitive": false }, { "name": "ProfileName", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyHost", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyPort", "type": "int", "default": "0", "sensitive": false }, { "name": "Region", "type": "string", "default": "us-east-1", "sensitive": false }, { "name": "RemovePrefixOnMove", "type": "bool", "default": "false", "sensitive": false }, { "name": "RetryCount", "type": "int", "default": "3", "sensitive": false }, { "name": "RetryMode", "type": "string", "default": "standard", "sensitive": false }, { "name": "SecretKey", "type": "string", "default": "", "sensitive": true }, { "name": "SendEmptyMessageWhenIdle", "type": "bool", "default": "false", "sensitive": false }, { "name": "ServerSideEncryption", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Aes256", "AwsKms", "CustomerKey" ] }, { "name": "ServiceUrl", "type": "string", "default": "", "sensitive": false }, { "name": "SessionToken", "type": "string", "default": "", "sensitive": true }, { "name": "SocketTimeout", "type": "int", "default": "60000", "sensitive": false }, { "name": "SortBy", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Key", "KeyDesc", "LastModified", "LastModifiedDesc", "Size", "SizeDesc" ] }, { "name": "StorageClass", "type": "string", "default": "", "sensitive": false }, { "name": "StreamBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false }, { "name": "UseDefaultCredentialsProvider", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "seda", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.SedaEndpointOptions", "pathIsText": false, "options": [ { "name": "ConcurrentConsumers", "type": "string", "sensitive": false }, { "name": "Size", "type": "int", "default": "1000", "sensitive": false }, { "name": "Timeout", "type": "int", "default": "30000", "sensitive": false } ], "lenient": false }, { "scheme": "sftp", "alternateSchemes": [], "package": "redb.Route.Sftp", "optionsType": "redb.Route.Sftp.SftpEndpointOptions", "pathIsText": false, "options": [ { "name": "AllowNullBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "AntExclude", "type": "string", "default": "", "sensitive": false }, { "name": "AntFilterCaseSensitive", "type": "bool", "default": "true", "sensitive": false }, { "name": "AntInclude", "type": "string", "default": "", "sensitive": false }, { "name": "AppendChars", "type": "string", "default": "", "sensitive": false }, { "name": "AutoCreate", "type": "bool", "default": "true", "sensitive": false }, { "name": "BackoffErrorThreshold", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffIdleThreshold", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffMultiplier", "type": "int", "default": "0", "sensitive": false }, { "name": "BackoffOnFailedExchanges", "type": "bool", "default": "false", "sensitive": false }, { "name": "BufferSize", "type": "int", "default": "32768", "sensitive": false }, { "name": "Charset", "type": "string", "default": "utf-8", "sensitive": false }, { "name": "Chmod", "type": "string", "default": "", "sensitive": false }, { "name": "ChmodDirectory", "type": "string", "default": "", "sensitive": false }, { "name": "Compression", "type": "bool", "default": "false", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.GenericFile.RemoteFileConnectionFactory, redb.Route.GenericFile" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "Delay", "type": "int", "default": "60000", "sensitive": false }, { "name": "Delete", "type": "bool", "default": "false", "sensitive": false }, { "name": "DirectoryMustExist", "type": "bool", "default": "false", "sensitive": false }, { "name": "Disconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "DoneFileName", "type": "string", "default": "", "sensitive": false }, { "name": "EagerDeleteTargetFile", "type": "bool", "default": "true", "sensitive": false }, { "name": "Exclude", "type": "string", "default": "", "sensitive": false }, { "name": "FileExist", "type": "enum", "default": "Override", "sensitive": false, "enumValues": [ "Override", "Append", "Fail", "Ignore", "Move", "TryRename" ] }, { "name": "FileName", "type": "string", "sensitive": false }, { "name": "Filter", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.GenericFile.IGenericFileFilter, redb.Route.GenericFile" }, { "name": "FilterDirectory", "type": "string", "default": "", "sensitive": false }, { "name": "FilterFile", "type": "string", "default": "", "sensitive": false }, { "name": "FilterInstance", "type": "string", "sensitive": false }, { "name": "Flatten", "type": "bool", "default": "false", "sensitive": false }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false }, { "name": "IdempotentKey", "type": "string", "default": "", "sensitive": false }, { "name": "IgnoreFileNotFoundOrPermissionError", "type": "bool", "default": "false", "sensitive": false }, { "name": "Include", "type": "string", "default": "", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "JailStartingDirectory", "type": "bool", "default": "true", "sensitive": false }, { "name": "KeepAliveInterval", "type": "int", "default": "0", "sensitive": false }, { "name": "KeepLastModified", "type": "bool", "default": "false", "sensitive": false }, { "name": "KnownHostsFile", "type": "string", "default": "", "sensitive": false }, { "name": "MaxAge", "type": "long", "default": "0", "sensitive": false }, { "name": "MaxDepth", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxMessagesPerPoll", "type": "int", "default": "0", "sensitive": false }, { "name": "MaximumReconnectAttempts", "type": "int", "default": "3", "sensitive": false }, { "name": "MinAge", "type": "long", "default": "0", "sensitive": false }, { "name": "MinDepth", "type": "int", "default": "0", "sensitive": false }, { "name": "MoveExisting", "type": "enum", "default": "Override", "sensitive": false, "enumValues": [ "Override", "Append", "Fail", "Ignore", "Move", "TryRename" ] }, { "name": "MoveExistingFileStrategy", "type": "enum", "default": "Timestamp", "sensitive": false, "enumValues": [ "Backup", "Timestamp", "Guid" ] }, { "name": "MoveFailed", "type": "string", "default": "", "sensitive": false }, { "name": "MoveTo", "type": "string", "default": "", "sensitive": false }, { "name": "Noop", "type": "bool", "default": "false", "sensitive": false }, { "name": "OperationTimeout", "type": "int", "default": "60000", "sensitive": false }, { "name": "Password", "type": "string", "default": "", "sensitive": true }, { "name": "Port", "type": "int", "default": "22", "sensitive": false }, { "name": "PreMove", "type": "string", "default": "", "sensitive": false }, { "name": "PreferredAuthentications", "type": "string", "default": "", "sensitive": false }, { "name": "PrivateKeyPassphrase", "type": "string", "default": "", "sensitive": true }, { "name": "PrivateKeyPath", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyHost", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyPassword", "type": "string", "default": "", "sensitive": true }, { "name": "ProxyPort", "type": "int", "default": "1080", "sensitive": false }, { "name": "ProxyType", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Socks4", "Socks5", "Http" ] }, { "name": "ProxyUsername", "type": "string", "default": "", "sensitive": false }, { "name": "ReconnectDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "Recursive", "type": "bool", "default": "false", "sensitive": false }, { "name": "SendEmptyMessageWhenIdle", "type": "bool", "default": "false", "sensitive": false }, { "name": "Separator", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "Auto", "Unix" ] }, { "name": "ServerFingerprint", "type": "string", "default": "", "sensitive": false }, { "name": "SortBy", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "Name", "NameDesc", "Modified", "ModifiedDesc", "Size", "SizeDesc" ] }, { "name": "StartingDirectoryMustExist", "type": "bool", "default": "true", "sensitive": false }, { "name": "StreamBody", "type": "bool", "default": "false", "sensitive": false }, { "name": "StrictHostKeyChecking", "type": "bool", "default": "false", "sensitive": false }, { "name": "TempFileName", "type": "string", "default": "", "sensitive": false }, { "name": "TempPrefix", "type": "string", "default": "", "sensitive": false }, { "name": "UseKeyboardInteractive", "type": "bool", "default": "false", "sensitive": false }, { "name": "Username", "type": "string", "default": "", "sensitive": false } ], "lenient": false }, { "scheme": "signalr", "alternateSchemes": [], "package": "redb.Route.SignalR", "optionsType": "redb.Route.SignalR.SignalREndpointOptions", "pathIsText": false, "options": [ { "name": "AccessToken", "type": "string", "sensitive": true }, { "name": "Bridge", "type": "bool", "default": "true", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.SignalR.SignalRConnectionFactory, redb.Route.SignalR" }, { "name": "DefaultGroup", "type": "string", "sensitive": false }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "InOut", "type": "bool", "default": "false", "sensitive": false }, { "name": "MaxConnections", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxParallelInvocationsPerClient", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxReconnectAttempts", "type": "int", "default": "0", "sensitive": false }, { "name": "MessagePack", "type": "bool", "default": "false", "sensitive": false }, { "name": "Method", "type": "string", "sensitive": false }, { "name": "Mode", "type": "enum", "default": "Client", "sensitive": false, "enumValues": [ "Client", "Server" ] }, { "name": "Port", "type": "int", "default": "5000", "sensitive": false }, { "name": "Reconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "ReconnectInterval", "type": "int", "default": "5000", "sensitive": false }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "TargetGroup", "type": "string", "sensitive": false }, { "name": "TargetType", "type": "string", "default": "All", "sensitive": false }, { "name": "Transport", "type": "enum", "default": "WebSockets", "sensitive": false, "enumValues": [ "WebSockets", "ServerSentEvents", "LongPolling" ] }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "smtp", "alternateSchemes": [], "package": "redb.Route.Mail", "optionsType": "redb.Route.Mail.MailEndpointOptions", "pathIsText": false, "options": [ { "name": "AccessToken", "type": "string", "default": "", "sensitive": true }, { "name": "AdditionalFolders", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "AlternativeBody", "type": "bool", "default": "false", "sensitive": false, "role": "producer" }, { "name": "Attachments", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "AuthMechanism", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "Auto", "Plain", "Login", "CramMd5", "XOAuth2", "OAuthBearer", "Ntlm" ] }, { "name": "Bcc", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "Cc", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "ClientCertPassword", "type": "string", "default": "", "sensitive": true }, { "name": "ClientCertPath", "type": "string", "default": "", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Mail.MailConnectionFactory, redb.Route.Mail" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "ContentType", "type": "string", "default": "text/plain", "sensitive": false, "role": "producer" }, { "name": "CopyTo", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Delay", "type": "int", "default": "60000", "sensitive": false, "role": "consumer" }, { "name": "Delete", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "Disconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "FetchAttachments", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "FetchBody", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "FetchFilter", "type": "enum", "default": "Unseen", "sensitive": false, "enumValues": [ "Unseen", "All", "Recent", "Flagged", "Answered", "Unanswered" ], "role": "consumer" }, { "name": "Folder", "type": "string", "default": "INBOX", "sensitive": false, "role": "consumer" }, { "name": "From", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "FromFilter", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false }, { "name": "Idempotent", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "IdempotentRepository", "type": "string", "sensitive": false, "role": "consumer", "reference": "redb.Route.Abstractions.IIdempotentRepository, redb.Route" }, { "name": "IdempotentRepositoryRemoveOnCommit", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Idle", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "IdleTimeout", "type": "int", "default": "1740000", "sensitive": false, "role": "consumer" }, { "name": "InitialDelay", "type": "int", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "KeepRawMessage", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "MapMimeHeaders", "type": "bool", "default": "false", "sensitive": false, "role": "consumer" }, { "name": "MaxAge", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MaxAttachmentSize", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MaxMessages", "type": "int", "default": "50", "sensitive": false, "role": "consumer" }, { "name": "MinAge", "type": "long", "default": "0", "sensitive": false, "role": "consumer" }, { "name": "MoveTo", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Password", "type": "string", "default": "", "sensitive": true }, { "name": "Peek", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Port", "type": "int", "default": "0", "sensitive": false }, { "name": "PostProcess", "type": "enum", "default": "MarkRead", "sensitive": false, "enumValues": [ "None", "MarkRead", "Delete", "Move", "MarkReadAndMove", "Flag" ], "role": "consumer" }, { "name": "ReplyTo", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "SearchTerm", "type": "string", "sensitive": false, "role": "consumer", "reference": "MailKit.Search.SearchQuery, MailKit" }, { "name": "SearchTerm.Body", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.From", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.FromReceivedDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.FromSentDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.Subject", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.SubjectOrBody", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.To", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.ToReceivedDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.ToSentDate", "type": "string", "sensitive": false, "role": "consumer" }, { "name": "SearchTerm.Unseen", "type": "bool", "default": "true", "sensitive": false, "role": "consumer" }, { "name": "Security", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "None", "Ssl", "StartTls", "Auto" ] }, { "name": "SortBy", "type": "enum", "default": "None", "sensitive": false, "enumValues": [ "None", "DateAsc", "DateDesc", "SubjectAsc", "FromAsc", "SizeAsc", "SizeDesc" ], "role": "consumer" }, { "name": "Subject", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "SubjectFilter", "type": "string", "default": "", "sensitive": false, "role": "consumer" }, { "name": "Timeout", "type": "int", "default": "60000", "sensitive": false }, { "name": "To", "type": "string", "default": "", "sensitive": false, "role": "producer" }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false }, { "name": "Username", "type": "string", "default": "", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "sns", "alternateSchemes": [], "package": "redb.Route.Sqs", "optionsType": "redb.Route.Sqs.SnsEndpointOptions", "pathIsText": false, "options": [ { "name": "AccessKey", "type": "string", "default": "", "sensitive": true }, { "name": "AutoCreateTopic", "type": "bool", "default": "false", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.Sqs.AwsConnectionFactory, redb.Route.Sqs" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "MessageDeduplicationId", "type": "string", "sensitive": false }, { "name": "MessageGroupId", "type": "string", "sensitive": false }, { "name": "MessageStructure", "type": "string", "default": "", "sensitive": false }, { "name": "ProfileName", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyHost", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyPort", "type": "int", "default": "0", "sensitive": false }, { "name": "RawMessageDelivery", "type": "bool", "default": "false", "sensitive": false }, { "name": "Region", "type": "string", "default": "us-east-1", "sensitive": false }, { "name": "RetryCount", "type": "int", "default": "3", "sensitive": false }, { "name": "SecretKey", "type": "string", "default": "", "sensitive": true }, { "name": "ServiceUrl", "type": "string", "default": "", "sensitive": false }, { "name": "SessionToken", "type": "string", "default": "", "sensitive": true }, { "name": "Subject", "type": "string", "default": "", "sensitive": false }, { "name": "SubscribeQueueArn", "type": "string", "default": "", "sensitive": false }, { "name": "SubscribeSnsToSqs", "type": "bool", "default": "false", "sensitive": false }, { "name": "TopicArn", "type": "string", "default": "", "sensitive": false }, { "name": "Transacted", "type": "bool", "sensitive": false }, { "name": "UseDefaultCredentialsProvider", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "soap", "alternateSchemes": [ "soaps" ], "package": "redb.Route.Soap", "optionsType": "redb.Route.Soap.SoapEndpointOptions", "pathIsText": false, "options": [ { "name": "Action", "type": "string", "sensitive": false }, { "name": "AllowedClientThumbprints", "type": "string", "sensitive": false }, { "name": "ClientCertificateMode", "type": "enum", "default": "NoCertificate", "sensitive": false, "enumValues": [ "NoCertificate", "AllowCertificate", "RequireCertificate" ] }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Soap.SoapConnectionFactory, redb.Route.Soap" }, { "name": "EmitHttpCompatHeaders", "type": "bool", "default": "false", "sensitive": false }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "MaxConcurrentRequests", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxRequestBodySize", "type": "long", "default": "104857600", "sensitive": false }, { "name": "Operation", "type": "string", "sensitive": false }, { "name": "Path", "type": "string", "default": "", "sensitive": false }, { "name": "Port", "type": "int", "default": "0", "sensitive": false }, { "name": "RejectStatusCode", "type": "int", "default": "429", "sensitive": false }, { "name": "RequestQueueLimit", "type": "int", "default": "0", "sensitive": false }, { "name": "RetryAfterSeconds", "type": "int", "default": "1", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "ThrowOnFault", "type": "bool", "default": "true", "sensitive": false }, { "name": "UseTls", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "sql", "alternateSchemes": [], "package": "redb.Route.Sql", "optionsType": "redb.Route.Sql.SqlEndpointOptions", "pathIsText": true, "options": [ { "name": "AsFunction", "type": "bool", "default": "false", "sensitive": false }, { "name": "BackslashEscapes", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchSize", "type": "int", "default": "0", "sensitive": false }, { "name": "BreakBatchOnError", "type": "bool", "default": "true", "sensitive": false }, { "name": "CommandTimeout", "type": "int", "default": "30", "sensitive": false }, { "name": "ConnectionString", "type": "string", "sensitive": true }, { "name": "DataSource", "type": "string", "sensitive": false, "reference": "redb.Route.Sql.Connection.ISqlConnectionFactory, redb.Route.Sql" }, { "name": "Delay", "type": "int", "default": "500", "sensitive": false }, { "name": "FixedRate", "type": "bool", "default": "false", "sensitive": false }, { "name": "InitialDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "IsolationLevel", "type": "enum", "sensitive": false, "enumValues": [ "Chaos", "ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable", "Snapshot", "Unspecified" ] }, { "name": "MaxMessagesPerPoll", "type": "int", "default": "-1", "sensitive": false }, { "name": "Mode", "type": "enum", "default": "Execute", "sensitive": false, "enumValues": [ "Poll", "Execute", "Procedure" ] }, { "name": "Noop", "type": "bool", "default": "false", "sensitive": false }, { "name": "OnBatchComplete", "type": "string", "sensitive": false }, { "name": "OnFailure", "type": "string", "sensitive": false }, { "name": "OnFailureAfterRollback", "type": "bool", "default": "false", "sensitive": false }, { "name": "OnSuccess", "type": "string", "sensitive": false }, { "name": "OutputClass", "type": "string", "sensitive": false }, { "name": "OutputHeader", "type": "string", "sensitive": false }, { "name": "OutputType", "type": "enum", "default": "Auto", "sensitive": false, "enumValues": [ "Auto", "SelectList", "SelectOne", "StreamList", "Scalar", "None" ] }, { "name": "PlaceholderStyle", "type": "enum", "default": "At", "sensitive": false, "enumValues": [ "At", "Colon", "Question" ] }, { "name": "PollDelivery", "type": "enum", "default": "PerRow", "sensitive": false, "enumValues": [ "PerRow", "List" ] }, { "name": "ProcedureName", "type": "string", "sensitive": false }, { "name": "ProcedureParams", "type": "string", "sensitive": false }, { "name": "Provider", "type": "string", "sensitive": false }, { "name": "Query", "type": "string", "sensitive": false }, { "name": "ReadOnly", "type": "bool", "default": "false", "sensitive": false }, { "name": "RepeatCount", "type": "long", "default": "0", "sensitive": false }, { "name": "RouteEmptyResultSet", "type": "bool", "default": "false", "sensitive": false }, { "name": "SendEmptyMessageWhenIdle", "type": "bool", "default": "false", "sensitive": false }, { "name": "Transacted", "type": "bool", "default": "false", "sensitive": false } ], "lenient": true }, { "scheme": "sqs", "alternateSchemes": [], "package": "redb.Route.Sqs", "optionsType": "redb.Route.Sqs.SqsEndpointOptions", "pathIsText": false, "options": [ { "name": "AccessKey", "type": "string", "default": "", "sensitive": true }, { "name": "AckMode", "type": "enum", "default": "Manual", "sensitive": false, "enumValues": [ "Manual", "Auto" ] }, { "name": "AttributeNames", "type": "string", "default": "All", "sensitive": false }, { "name": "AutoCreateQueue", "type": "bool", "default": "false", "sensitive": false }, { "name": "Batching", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchingIntervalMs", "type": "int", "sensitive": false }, { "name": "ConcurrentConsumers", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "default": "", "sensitive": false, "reference": "redb.Route.Sqs.AwsConnectionFactory, redb.Route.Sqs" }, { "name": "ConnectionTimeout", "type": "int", "default": "30000", "sensitive": false }, { "name": "Delay", "type": "int", "default": "0", "sensitive": false }, { "name": "DelaySeconds", "type": "int", "default": "0", "sensitive": false }, { "name": "ExtendMessageVisibility", "type": "bool", "default": "false", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "InitialDelay", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxBatchMessages", "type": "int", "sensitive": false }, { "name": "MaxNumberOfMessages", "type": "int", "default": "10", "sensitive": false }, { "name": "MessageAttributeNames", "type": "string", "default": "All", "sensitive": false }, { "name": "MessageDeduplicationId", "type": "string", "sensitive": false }, { "name": "MessageGroupId", "type": "string", "sensitive": false }, { "name": "PollTimeoutMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "ProfileName", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyHost", "type": "string", "default": "", "sensitive": false }, { "name": "ProxyPort", "type": "int", "default": "0", "sensitive": false }, { "name": "QueueUrl", "type": "string", "default": "", "sensitive": false }, { "name": "Region", "type": "string", "default": "us-east-1", "sensitive": false }, { "name": "ResetVisibilityOnFailure", "type": "bool", "default": "false", "sensitive": false }, { "name": "RetryCount", "type": "int", "default": "3", "sensitive": false }, { "name": "SecretKey", "type": "string", "default": "", "sensitive": true }, { "name": "ServiceUrl", "type": "string", "default": "", "sensitive": false }, { "name": "SessionToken", "type": "string", "default": "", "sensitive": true }, { "name": "Transacted", "type": "bool", "sensitive": false }, { "name": "UseDefaultCredentialsProvider", "type": "bool", "default": "false", "sensitive": false }, { "name": "VisibilityTimeout", "type": "int", "default": "0", "sensitive": false }, { "name": "WaitTimeSeconds", "type": "int", "default": "20", "sensitive": false } ], "lenient": false }, { "scheme": "stt", "alternateSchemes": [], "package": "redb.Route.Llm", "optionsType": "redb.Route.Llm.Transcription.SttEndpointOptions", "pathIsText": false, "options": [ { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Llm.LlmConnectionFactory, redb.Route.Llm" }, { "name": "FileName", "type": "string", "sensitive": false }, { "name": "Language", "type": "string", "sensitive": false }, { "name": "Prompt", "type": "string", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "tcp", "alternateSchemes": [], "package": "redb.Route.Tcp", "optionsType": "redb.Route.Tcp.TcpEndpointOptions", "pathIsText": false, "options": [ { "name": "Backlog", "type": "int", "default": "128", "sensitive": false }, { "name": "ClientCertPassword", "type": "string", "sensitive": true }, { "name": "ClientCertPath", "type": "string", "sensitive": false }, { "name": "ConnectTimeout", "type": "int", "default": "10000", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Tcp.TcpConnectionFactory, redb.Route.Tcp" }, { "name": "Delimiter", "type": "string", "default": "\n", "sensitive": false }, { "name": "Encoding", "type": "string", "default": "utf-8", "sensitive": false }, { "name": "Framing", "type": "enum", "default": "Raw", "sensitive": false, "enumValues": [ "Raw", "TextLine", "LengthPrefixed" ] }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "InOut", "type": "bool", "default": "false", "sensitive": false }, { "name": "KeepAlive", "type": "bool", "default": "true", "sensitive": false }, { "name": "LengthPrefixed", "type": "bool", "default": "false", "sensitive": false }, { "name": "MaxConnections", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxReconnectAttempts", "type": "int", "default": "0", "sensitive": false }, { "name": "NoDelay", "type": "bool", "default": "true", "sensitive": false }, { "name": "Port", "type": "int", "default": "0", "sensitive": false }, { "name": "ReceiveBufferSize", "type": "int", "default": "0", "sensitive": false }, { "name": "Reconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "ReconnectInterval", "type": "int", "default": "5000", "sensitive": false }, { "name": "SendBufferSize", "type": "int", "default": "0", "sensitive": false }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "SslTargetHost", "type": "string", "sensitive": false }, { "name": "TextLine", "type": "bool", "default": "false", "sensitive": false }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "telegram", "alternateSchemes": [], "package": "redb.Route.Telegram", "optionsType": "redb.Route.Telegram.TelegramEndpointOptions", "pathIsText": false, "options": [ { "name": "BodyIsFileId", "type": "bool", "default": "false", "sensitive": false }, { "name": "Caption", "type": "string", "sensitive": false }, { "name": "ChatId", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.Telegram.TelegramConnectionFactory, redb.Route.Telegram" }, { "name": "DisableNotification", "type": "bool", "default": "false", "sensitive": false }, { "name": "FileId", "type": "string", "sensitive": false }, { "name": "FileName", "type": "string", "sensitive": false }, { "name": "MaxDownloadBytes", "type": "long", "default": "20971520", "sensitive": false }, { "name": "MessageId", "type": "string", "sensitive": false }, { "name": "ParseMode", "type": "string", "sensitive": false }, { "name": "ReplyToMessageId", "type": "string", "sensitive": false }, { "name": "SendTimeoutSeconds", "type": "int", "default": "120", "sensitive": false }, { "name": "ShowAlert", "type": "bool", "default": "false", "sensitive": false }, { "name": "Token", "type": "string", "default": "", "sensitive": true } ], "lenient": false }, { "scheme": "timer", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.TimerEndpointOptions", "pathIsText": false, "options": [ { "name": "Delay", "type": "int", "default": "0", "sensitive": false }, { "name": "Period", "type": "int", "default": "1000", "sensitive": false }, { "name": "RepeatCount", "type": "int", "default": "-1", "sensitive": false } ], "lenient": false, "role": "consumer" }, { "scheme": "validator", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Validation.ValidatorEndpointOptions", "pathIsText": false, "options": [ { "name": "Format", "type": "string", "sensitive": false }, { "name": "SchemaPath", "type": "string", "default": "", "sensitive": false }, { "name": "SchemaRoot", "type": "string", "sensitive": false }, { "name": "TargetNamespace", "type": "string", "sensitive": false }, { "name": "ThrowOnFailure", "type": "bool", "default": "true", "sensitive": false } ], "lenient": false, "role": "producer" }, { "scheme": "vm", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Components.VmEndpointOptions", "pathIsText": false, "options": [ { "name": "ConcurrentConsumers", "type": "string", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "role": "producer", "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Size", "type": "int", "default": "1000", "sensitive": false } ], "lenient": false }, { "scheme": "wmq", "alternateSchemes": [], "package": "redb.Route.IbmMq", "optionsType": "redb.Route.IbmMq.IbmMqEndpointOptions", "pathIsText": false, "options": [ { "name": "BackoutDelay", "type": "int", "default": "1000", "sensitive": false }, { "name": "BackoutQueue", "type": "string", "sensitive": false }, { "name": "BackoutThreshold", "type": "int", "default": "0", "sensitive": false }, { "name": "Batching", "type": "bool", "default": "false", "sensitive": false }, { "name": "BatchingIntervalMs", "type": "int", "sensitive": false }, { "name": "CCSID", "type": "int", "default": "1208", "sensitive": false }, { "name": "Channel", "type": "string", "default": "DEV.APP.SVRCONN", "sensitive": false }, { "name": "ClientId", "type": "string", "sensitive": false }, { "name": "ConcurrentConsumers", "type": "string", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.IbmMq.IbmMqConnectionFactory, redb.Route.IbmMq" }, { "name": "Convert", "type": "bool", "default": "true", "sensitive": false }, { "name": "CorrelationPattern", "type": "enum", "default": "MsgId", "sensitive": false, "enumValues": [ "MsgId", "CorrelId" ] }, { "name": "DestinationType", "type": "enum", "default": "Queue", "sensitive": false, "enumValues": [ "Queue", "Topic" ] }, { "name": "DisableReplyTo", "type": "bool", "default": "false", "sensitive": false }, { "name": "Expiry", "type": "int", "default": "-1", "sensitive": false }, { "name": "ExpiryExpression", "type": "string", "sensitive": false }, { "name": "HeaderFilterStrategy", "type": "string", "sensitive": false, "reference": "redb.Route.Abstractions.IHeaderFilterStrategy, redb.Route" }, { "name": "Host", "type": "string", "default": "localhost", "sensitive": false }, { "name": "MaxBatchMessages", "type": "int", "sensitive": false }, { "name": "MessageType", "type": "enum", "default": "Datagram", "sensitive": false, "enumValues": [ "Request", "Reply", "Report", "Datagram" ] }, { "name": "MessageTypeExpression", "type": "string", "sensitive": false }, { "name": "MqmdReadEnabled", "type": "bool", "default": "true", "sensitive": false }, { "name": "MqmdWriteEnabled", "type": "bool", "default": "false", "sensitive": false }, { "name": "Password", "type": "string", "sensitive": true }, { "name": "Persistence", "type": "enum", "default": "AsQDef", "sensitive": false, "enumValues": [ "NonPersistent", "Persistent", "AsQDef" ] }, { "name": "PersistenceExpression", "type": "string", "sensitive": false }, { "name": "PollTimeoutMs", "type": "int", "default": "1000", "sensitive": false }, { "name": "Port", "type": "int", "default": "1414", "sensitive": false }, { "name": "PreserveMessageQos", "type": "bool", "default": "false", "sensitive": false }, { "name": "Priority", "type": "int", "default": "-1", "sensitive": false }, { "name": "PriorityExpression", "type": "string", "sensitive": false }, { "name": "QueueManager", "type": "string", "default": "QM1", "sensitive": false }, { "name": "ReceiveMode", "type": "enum", "default": "Poll", "sensitive": false, "enumValues": [ "Poll", "Listener" ] }, { "name": "ReplyTo", "type": "bool", "default": "false", "sensitive": false }, { "name": "ReplyToQueue", "type": "string", "sensitive": false }, { "name": "ReplyToQueueManager", "type": "string", "sensitive": false }, { "name": "Selector", "type": "string", "sensitive": false }, { "name": "SslCertLabel", "type": "string", "sensitive": false }, { "name": "SslCipherSpec", "type": "string", "sensitive": false }, { "name": "SslKeyRepository", "type": "string", "sensitive": false }, { "name": "SslKeyResetCount", "type": "int", "default": "0", "sensitive": false }, { "name": "SslPeerName", "type": "string", "sensitive": false }, { "name": "TargetClient", "type": "enum", "default": "Jms", "sensitive": false, "enumValues": [ "Jms", "Mq" ] }, { "name": "TemporaryModel", "type": "string", "default": "SYSTEM.DEFAULT.MODEL.QUEUE", "sensitive": false }, { "name": "Timeout", "type": "int", "default": "30", "sensitive": false }, { "name": "Transacted", "type": "bool", "sensitive": false }, { "name": "User", "type": "string", "sensitive": false }, { "name": "WaitInterval", "type": "int", "default": "5000", "sensitive": false } ], "lenient": false }, { "scheme": "ws", "alternateSchemes": [], "package": "redb.Route.WebSocket", "optionsType": "redb.Route.WebSocket.WsEndpointOptions", "pathIsText": false, "options": [ { "name": "ConnectTimeout", "type": "int", "default": "10000", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.WebSocket.WsConnectionFactory, redb.Route.WebSocket" }, { "name": "Encoding", "type": "string", "default": "utf-8", "sensitive": false }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "InOut", "type": "bool", "default": "false", "sensitive": false }, { "name": "KeepAliveInterval", "type": "int", "default": "30000", "sensitive": false }, { "name": "MaxConnections", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxReconnectAttempts", "type": "int", "default": "0", "sensitive": false }, { "name": "MessageType", "type": "enum", "default": "Text", "sensitive": false, "enumValues": [ "Text", "Binary" ] }, { "name": "Mode", "type": "enum", "default": "Client", "sensitive": false, "enumValues": [ "Client", "Server" ] }, { "name": "Port", "type": "int", "default": "8080", "sensitive": false }, { "name": "ReceiveBufferSize", "type": "int", "default": "8192", "sensitive": false }, { "name": "Reconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "ReconnectInterval", "type": "int", "default": "5000", "sensitive": false }, { "name": "ReconnectTimeout", "type": "int", "default": "0", "sensitive": false }, { "name": "SendBufferSize", "type": "int", "default": "8192", "sensitive": false }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "SubProtocol", "type": "string", "sensitive": false }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "wss", "alternateSchemes": [], "package": "redb.Route.WebSocket", "optionsType": "redb.Route.WebSocket.WsEndpointOptions", "pathIsText": false, "options": [ { "name": "ConnectTimeout", "type": "int", "default": "10000", "sensitive": false }, { "name": "ConnectionFactory", "type": "string", "sensitive": false, "reference": "redb.Route.WebSocket.WsConnectionFactory, redb.Route.WebSocket" }, { "name": "Encoding", "type": "string", "default": "utf-8", "sensitive": false }, { "name": "Host", "type": "string", "default": "0.0.0.0", "sensitive": false }, { "name": "InOut", "type": "bool", "default": "false", "sensitive": false }, { "name": "KeepAliveInterval", "type": "int", "default": "30000", "sensitive": false }, { "name": "MaxConnections", "type": "int", "default": "0", "sensitive": false }, { "name": "MaxReconnectAttempts", "type": "int", "default": "0", "sensitive": false }, { "name": "MessageType", "type": "enum", "default": "Text", "sensitive": false, "enumValues": [ "Text", "Binary" ] }, { "name": "Mode", "type": "enum", "default": "Client", "sensitive": false, "enumValues": [ "Client", "Server" ] }, { "name": "Port", "type": "int", "default": "8080", "sensitive": false }, { "name": "ReceiveBufferSize", "type": "int", "default": "8192", "sensitive": false }, { "name": "Reconnect", "type": "bool", "default": "false", "sensitive": false }, { "name": "ReconnectInterval", "type": "int", "default": "5000", "sensitive": false }, { "name": "ReconnectTimeout", "type": "int", "default": "0", "sensitive": false }, { "name": "SendBufferSize", "type": "int", "default": "8192", "sensitive": false }, { "name": "Ssl", "type": "bool", "default": "false", "sensitive": false }, { "name": "SslCertPassword", "type": "string", "sensitive": true }, { "name": "SslCertPath", "type": "string", "sensitive": false }, { "name": "SubProtocol", "type": "string", "sensitive": false }, { "name": "TrustAllCertificates", "type": "bool", "default": "false", "sensitive": false } ], "lenient": false }, { "scheme": "xslt", "alternateSchemes": [], "package": "redb.Route", "optionsType": "redb.Route.Xslt.XsltEndpointOptions", "pathIsText": false, "options": [ { "name": "AllowTemplateFromHeader", "type": "bool", "default": "false", "sensitive": false }, { "name": "FailOnNullBody", "type": "bool", "default": "true", "sensitive": false }, { "name": "Output", "type": "enum", "default": "String", "sensitive": false, "enumValues": [ "String", "Bytes", "Dom" ] }, { "name": "StylesheetPath", "type": "string", "default": "", "sensitive": false } ], "lenient": false, "role": "producer" } ] Path: redb-route/vscode-redb-route/media/redb-route-dataformats.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/redb-route-dataformats.json ---- [ { "name": "avro", "type": "redb.Route.DataFormats.Avro.AvroDataFormat, redb.Route.DataFormats.Avro", "contentType": "application/avro", "mediaTypes": [ "application/avro", "avro/binary", "application/vnd.apache.avro\u002Bbinary" ], "attributes": [ { "name": "confluentWireFormat", "kind": "Bool", "default": "false", "description": "Frame the payload the Confluent Schema Registry way: magic byte 0, schema id as big-endian int32." }, { "name": "schema", "kind": "String", "description": "Explicit Avro schema (JSON)." }, { "name": "schemaId", "kind": "Int", "default": "0", "description": "Schema id written into the frame when ConfluentWireFormat is on." } ] }, { "name": "csv", "type": "redb.Route.DataFormats.Csv.CsvDataFormat, redb.Route.DataFormats.Csv", "contentType": "text/csv", "mediaTypes": [ "text/csv", "application/csv" ], "attributes": [ { "name": "delimiter", "kind": "String", "default": ",", "description": "Field delimiter." }, { "name": "hasHeaderRecord", "kind": "Bool", "default": "true", "description": "Whether the first record is a header (written on marshal, read on unmarshal)." }, { "name": "newLine", "kind": "String", "default": "\r\n", "description": "Record terminator written on marshal." }, { "name": "trimFields", "kind": "Bool", "default": "false", "description": "Trim whitespace around fields on read." } ] }, { "name": "mimeMultipart", "type": "redb.Route.DataFormats.Mime.MimeMultipartDataFormat, redb.Route.DataFormats.Mime", "contentType": "multipart/form-data", "mediaTypes": [ "multipart/form-data" ], "attributes": [ { "name": "maxFileNameLength", "kind": "Int", "default": "255", "description": "Longest file name of a part, in characters." }, { "name": "maxPartBytes", "kind": "Int", "default": "10485760", "description": "Largest decoded part, in bytes." }, { "name": "maxParts", "kind": "Int", "default": "1000", "description": "Most parts one body may have." }, { "name": "maxTotalBytes", "kind": "Int", "default": "33554432", "description": "Largest body, in bytes as it arrives." }, { "name": "multipartWithoutAttachment", "kind": "Bool", "default": "false", "description": "Marshal with the mixed subtype writes a multipart even when the message has no attachments (Camel\u0027s multipartWithoutAttachment); otherwise such a body is left as it is." }, { "name": "subType", "kind": "String", "default": "form-data", "description": "The subtype Marshal writes and the format registers under: form-data (the default: a FormBody body and file attachments) or mixed (the body as the first part, as Camel\u0027s mimeMultipart)." } ] }, { "name": "protobuf", "type": "redb.Route.DataFormats.Protobuf.ProtobufDataFormat, redb.Route.DataFormats.Protobuf", "contentType": "application/x-protobuf", "mediaTypes": [ "application/x-protobuf", "application/protobuf", "application/vnd.google.protobuf" ], "attributes": [ { "name": "confluentWireFormat", "kind": "Bool", "default": "false", "description": "Frame the payload the Confluent Schema Registry way: magic byte 0, schema id as big-endian int32, message-index list ([0], the first message of the schema)." }, { "name": "schemaId", "kind": "Int", "default": "0", "description": "Schema id written into the frame when ConfluentWireFormat is on." } ] }, { "name": "xmljson", "type": "redb.Route.DataFormats.XmlJson.XmlJsonDataFormat, redb.Route.DataFormats.XmlJson", "contentType": "application/x-xmljson", "mediaTypes": [ "application/x-xmljson" ], "attributes": [ { "name": "arrays", "kind": "String", "description": "The arrays paths, comma-separated: //Item,/Order/Tag (Arrays)." }, { "name": "attributePrefix", "kind": "String", "default": "@", "description": "The attribute prefix (AttributePrefix)." }, { "name": "indent", "kind": "Bool", "default": "false", "description": "Whether the output is indented (Indent)." }, { "name": "namespaces", "kind": "Enum", "enumValues": [ "Keep", "Drop" ], "default": "Keep", "description": "How names carry their namespaces (Namespaces)." }, { "name": "plural", "kind": "Bool", "default": "false", "description": "The plural-wrapper rule (Plural)." }, { "name": "prefixes", "kind": "String", "description": "Namespace prefixes, comma-separated prefix=uri pairs: o=urn:orders (Prefixes)." }, { "name": "root", "kind": "String", "description": "The root element of JSON to XML (Root)." }, { "name": "schema", "kind": "Path", "description": "The schema path (Schema)." }, { "name": "schemaRoot", "kind": "Path", "description": "The directory imports may read from, relative to the schema\u0027s directory (SchemaRoot)." }, { "name": "textKey", "kind": "String", "default": "#text", "description": "The text key (TextKey)." } ], "unmarshalTargets": [ "System.String", "System.Byte[]", "System.Xml.Linq.XDocument", "System.Xml.Linq.XElement", "System.Xml.XmlDocument", "System.Text.Json.Nodes.JsonNode, System.Text.Json" ] }, { "name": "yaml", "type": "redb.Route.DataFormats.Yaml.YamlDataFormat, redb.Route.DataFormats.Yaml", "contentType": "application/yaml", "mediaTypes": [ "application/yaml", "application/x-yaml", "text/yaml", "text/x-yaml" ], "attributes": [ { "name": "ignoreUnmatchedProperties", "kind": "Bool", "default": "true", "description": "Ignore document keys that have no matching property on unmarshal." } ] }, { "type": "redb.Route.Serialization.Base64MessageSerializer, redb.Route", "contentType": "application/base64", "mediaTypes": [ "application/base64" ], "attributes": [] }, { "type": "redb.Route.Serialization.FormUrlEncodedMessageSerializer, redb.Route", "contentType": "application/x-www-form-urlencoded", "mediaTypes": [ "application/x-www-form-urlencoded" ], "attributes": [] }, { "type": "redb.Route.Serialization.GZipMessageSerializer, redb.Route", "contentType": "application/gzip", "mediaTypes": [ "application/gzip", "application/x-gzip" ], "attributes": [] }, { "type": "redb.Route.Serialization.JsonMessageSerializer, redb.Route", "contentType": "application/json", "mediaTypes": [ "application/json" ], "attributes": [] }, { "type": "redb.Route.Serialization.XmlMessageSerializer, redb.Route", "contentType": "application/xml", "mediaTypes": [ "application/xml" ], "attributes": [] }, { "type": "redb.Route.Serialization.ZipMessageSerializer, redb.Route", "contentType": "application/zip", "mediaTypes": [ "application/zip", "application/x-zip-compressed" ], "attributes": [] } ] Path: redb-route/vscode-redb-route/media/redb-route-elements.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/media/redb-route-elements.json ---- [ { "name": "addAttachment", "kind": "Step", "attributes": [ { "name": "name", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false }, { "name": "fromBody", "type": "Bool", "required": false }, { "name": "file", "type": "String", "required": false }, { "name": "fileExpr", "type": "Expression", "required": false }, { "name": "fileName", "type": "String", "required": false }, { "name": "fileNameExpr", "type": "Expression", "required": false }, { "name": "contentType", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "aggregate", "kind": "Scope", "attributes": [ { "name": "correlation", "type": "Expression", "required": true }, { "name": "strategy", "type": "String", "required": true }, { "name": "completion", "type": "Expression", "required": false }, { "name": "completionSize", "type": "Int", "required": false }, { "name": "completionTimeout", "type": "Duration", "required": false }, { "name": "forceCompletionOnStop", "type": "Bool", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "bean", "kind": "Step", "attributes": [ { "name": "ref", "type": "Reference", "required": false }, { "name": "beanType", "type": "TypeName", "required": false }, { "name": "method", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "beginTransaction", "kind": "Step", "attributes": [ { "name": "policy", "type": "Enum", "required": false, "enumValues": [ "default", "requiresNew", "suppress", "mandatory" ] } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "cache", "kind": "Scope", "attributes": [ { "name": "key", "type": "Expression", "required": false }, { "name": "keyFromBody", "type": "Bool", "required": false }, { "name": "ttl", "type": "Duration", "required": false }, { "name": "sliding", "type": "Duration", "required": false }, { "name": "region", "type": "String", "required": false }, { "name": "cacheHeaders", "type": "Bool", "required": false }, { "name": "provider", "type": "Enum", "required": false, "enumValues": [ "memory", "distributed" ] } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "choice", "kind": "Branching", "attributes": [], "children": [ { "name": "when", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": false }, { "name": "predicate", "type": "Reference", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "otherwise", "kind": "ConfigChild", "attributes": [], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "circuitBreaker", "kind": "Scope", "attributes": [ { "name": "failureThreshold", "type": "Int", "required": false }, { "name": "resetTimeout", "type": "Duration", "required": false }, { "name": "halfOpenMaxCalls", "type": "Int", "required": false } ], "children": [ { "name": "fallback", "kind": "ConfigChild", "attributes": [], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "claimCheck", "kind": "Step", "attributes": [ { "name": "operation", "type": "Enum", "required": true, "enumValues": [ "Set", "Get", "GetAndRemove", "Push", "Pop" ] }, { "name": "key", "type": "Expression", "required": false }, { "name": "ttl", "type": "Duration", "required": false }, { "name": "repository", "type": "Reference", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "commitTransaction", "kind": "Step", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "controlBus", "kind": "Step", "attributes": [ { "name": "action", "type": "Enum", "required": true, "enumValues": [ "Start", "Stop", "Suspend", "Resume", "Restart", "Status", "Stats", "Fail" ] }, { "name": "routeId", "type": "String", "required": true }, { "name": "async", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "convertBody", "kind": "Step", "attributes": [ { "name": "type", "type": "TypeName", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "dataFormat", "kind": "ContextLevel", "attributes": [ { "name": "type", "type": "TypeName", "required": true }, { "name": "name", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "deadLetterChannel", "kind": "ContextLevel", "attributes": [ { "name": "uri", "type": "Uri", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "debounce", "kind": "Scope", "attributes": [ { "name": "key", "type": "Expression", "required": true }, { "name": "quietPeriod", "type": "Duration", "required": true } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "delay", "kind": "Step", "attributes": [ { "name": "duration", "type": "Duration", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "dynamicRouter", "kind": "Step", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "enrich", "kind": "Step", "attributes": [ { "name": "uri", "type": "Uri", "required": false }, { "name": "strategy", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": true }, { "name": "exceptionHandled", "kind": "Step", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "filter", "kind": "Scope", "attributes": [ { "name": "expr", "type": "Expression", "required": false }, { "name": "predicate", "type": "Reference", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "idempotentConsumer", "kind": "Scope", "attributes": [ { "name": "key", "type": "Expression", "required": true }, { "name": "repository", "type": "Reference", "required": true }, { "name": "skipDuplicate", "type": "Bool", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "intercept", "kind": "Scope", "attributes": [], "children": [ { "name": "when", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "interceptFrom", "kind": "Scope", "attributes": [ { "name": "uri", "type": "Uri", "required": false } ], "children": [ { "name": "when", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "interceptSendToEndpoint", "kind": "Scope", "attributes": [ { "name": "uri", "type": "Uri", "required": true }, { "name": "skipSendToOriginalEndpoint", "type": "Bool", "required": false } ], "children": [ { "name": "when", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "loadBalance", "kind": "Step", "attributes": [ { "name": "strategy", "type": "Enum", "required": true, "enumValues": [ "roundRobin", "random", "failover", "sticky", "weighted" ] }, { "name": "key", "type": "Expression", "required": false } ], "children": [ { "name": "endpoint", "kind": "ConfigChild", "attributes": [ { "name": "uri", "type": "Uri", "required": true }, { "name": "weight", "type": "Int", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "log", "kind": "Step", "attributes": [ { "name": "level", "type": "Enum", "required": false, "enumValues": [ "Trace", "Debug", "Information", "Warning", "Error", "Critical" ] }, { "name": "showRouteId", "type": "Bool", "required": false } ], "children": [ { "name": "message", "kind": "ConfigChild", "attributes": [], "children": [], "allowsSteps": false, "allowsText": true, "takesEndpoint": false }, { "name": "header", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "property", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": true, "takesEndpoint": false }, { "name": "loop", "kind": "Scope", "attributes": [ { "name": "count", "type": "Int", "required": false }, { "name": "expr", "type": "Expression", "required": false }, { "name": "while", "type": "Expression", "required": false }, { "name": "copy", "type": "Bool", "required": false }, { "name": "shareScope", "type": "Bool", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "marshal", "kind": "Step", "attributes": [ { "name": "format", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "messageHistory", "kind": "Step", "attributes": [ { "name": "value", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "metered", "kind": "Scope", "attributes": [ { "name": "name", "type": "String", "required": true } ], "children": [ { "name": "tag", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "fromHeader", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "multicast", "kind": "Scope", "attributes": [ { "name": "parallel", "type": "Bool", "required": false }, { "name": "maxParallelism", "type": "Int", "required": false }, { "name": "stopOnException", "type": "Bool", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "normalize", "kind": "Step", "attributes": [], "children": [ { "name": "when", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": true }, { "name": "transform", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "whenContentType", "kind": "ConfigChild", "attributes": [ { "name": "type", "type": "String", "required": true }, { "name": "transform", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "otherwise", "kind": "ConfigChild", "attributes": [ { "name": "transform", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "ofType", "kind": "Scope", "attributes": [ { "name": "type", "type": "TypeName", "required": true } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "onCompletion", "kind": "Scope", "attributes": [ { "name": "onCompleteOnly", "type": "Bool", "required": false }, { "name": "onFailureOnly", "type": "Bool", "required": false }, { "name": "modeBeforeConsumer", "type": "Bool", "required": false }, { "name": "parallelProcessing", "type": "Bool", "required": false }, { "name": "executorService", "type": "String", "required": false } ], "children": [ { "name": "when", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "onException", "kind": "Scope", "attributes": [ { "name": "exceptions", "type": "TypeNameList", "required": true }, { "name": "handled", "type": "Bool", "required": false }, { "name": "continued", "type": "Bool", "required": false }, { "name": "maximumRedeliveries", "type": "Int", "required": false }, { "name": "redeliveryDelay", "type": "Duration", "required": false }, { "name": "exponentialBackOff", "type": "Bool", "required": false }, { "name": "backOffMultiplier", "type": "Double", "required": false }, { "name": "useOriginalBody", "type": "Bool", "required": false }, { "name": "logStackTrace", "type": "Bool", "required": false }, { "name": "logExhausted", "type": "Bool", "required": false }, { "name": "logHandled", "type": "Bool", "required": false }, { "name": "logContinued", "type": "Bool", "required": false }, { "name": "retryAttemptedLogLevel", "type": "Enum", "required": false, "enumValues": [ "Trace", "Debug", "Information", "Warning", "Error", "Critical" ] }, { "name": "retriesExhaustedLogLevel", "type": "Enum", "required": false, "enumValues": [ "Trace", "Debug", "Information", "Warning", "Error", "Critical" ] }, { "name": "onExceptionOccurred", "type": "Reference", "required": false }, { "name": "onRedelivery", "type": "Reference", "required": false }, { "name": "onPrepareFailure", "type": "Reference", "required": false } ], "children": [ { "name": "when", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "retryWhile", "kind": "ConfigChild", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "payload", "kind": "Step", "attributes": [ { "name": "template", "type": "String", "required": false }, { "name": "mediaType", "type": "Enum", "required": true, "enumValues": [ "json", "xml", "text" ] }, { "name": "target", "type": "String", "required": false } ], "children": [ { "name": "arg", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "value", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": true, "takesEndpoint": false }, { "name": "pollEnrich", "kind": "Step", "attributes": [ { "name": "uri", "type": "Uri", "required": false }, { "name": "strategy", "type": "String", "required": false }, { "name": "timeout", "type": "Duration", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": true }, { "name": "recipientList", "kind": "Step", "attributes": [ { "name": "expr", "type": "Expression", "required": true }, { "name": "delimiter", "type": "String", "required": false }, { "name": "parallel", "type": "Bool", "required": false }, { "name": "stopOnException", "type": "Bool", "required": false }, { "name": "strategy", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "redb", "kind": "ContextLevel", "attributes": [ { "name": "storage", "type": "String", "required": false } ], "children": [ { "name": "syncScheme", "kind": "ConfigChild", "attributes": [ { "name": "type", "type": "TypeName", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "idempotentRepository", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "ttl", "type": "Duration", "required": false }, { "name": "processorName", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "redbDelete", "kind": "Step", "attributes": [ { "name": "id", "type": "Expression", "required": true }, { "name": "storage", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "redbGet", "kind": "Step", "attributes": [ { "name": "id", "type": "Expression", "required": true }, { "name": "type", "type": "TypeName", "required": false }, { "name": "depth", "type": "Int", "required": false }, { "name": "storage", "type": "String", "required": false }, { "name": "target", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "redbQuery", "kind": "Step", "attributes": [ { "name": "type", "type": "TypeName", "required": true }, { "name": "where", "type": "Expression", "required": false }, { "name": "orderBy", "type": "String", "required": false }, { "name": "descending", "type": "Bool", "required": false }, { "name": "take", "type": "Int", "required": false }, { "name": "skip", "type": "Int", "required": false }, { "name": "filter", "type": "Reference", "required": false }, { "name": "storage", "type": "String", "required": false }, { "name": "target", "type": "String", "required": false }, { "name": "whereRedb", "type": "Expression", "required": false }, { "name": "orderByRedb", "type": "String", "required": false }, { "name": "outputType", "type": "Enum", "required": false, "enumValues": [ "List", "First", "Count", "Any" ] } ], "children": [], "allowsSteps": false, "allowsText": true, "takesEndpoint": false }, { "name": "redbSave", "kind": "Step", "attributes": [ { "name": "type", "type": "TypeName", "required": false }, { "name": "byUnique", "type": "Bool", "required": false }, { "name": "storage", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "removeAttachment", "kind": "Step", "attributes": [ { "name": "name", "type": "String", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "removeAttachments", "kind": "Step", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "removeBody", "kind": "Step", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "removeHeader", "kind": "Step", "attributes": [ { "name": "name", "type": "String", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "removeHeaders", "kind": "Step", "attributes": [ { "name": "pattern", "type": "String", "required": true }, { "name": "except", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "removeProperties", "kind": "Step", "attributes": [ { "name": "pattern", "type": "String", "required": true }, { "name": "except", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "removeProperty", "kind": "Step", "attributes": [ { "name": "name", "type": "String", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "replayable", "kind": "Scope", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "exposed", "type": "Bool", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "resequence", "kind": "Scope", "attributes": [ { "name": "key", "type": "Expression", "required": true }, { "name": "batchSize", "type": "Int", "required": false }, { "name": "timeout", "type": "Duration", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "rest", "kind": "TopLevel", "attributes": [ { "name": "path", "type": "String", "required": true }, { "name": "host", "type": "String", "required": false }, { "name": "port", "type": "Int", "required": false }, { "name": "bindingMode", "type": "Enum", "required": false, "enumValues": [ "off", "json" ] }, { "name": "consumes", "type": "String", "required": false }, { "name": "produces", "type": "String", "required": false }, { "name": "openApi", "type": "Bool", "required": false }, { "name": "openApiPath", "type": "String", "required": false }, { "name": "title", "type": "String", "required": false }, { "name": "version", "type": "String", "required": false }, { "name": "clientRequestValidation", "type": "Bool", "required": false }, { "name": "errorHandler", "type": "String", "required": false }, { "name": "inboundAuth", "type": "Enum", "required": false, "enumValues": [ "none", "basic", "bearer" ] }, { "name": "inboundUsername", "type": "String", "required": false }, { "name": "inboundPassword", "type": "String", "required": false }, { "name": "inboundRealm", "type": "String", "required": false }, { "name": "tokenValidator", "type": "String", "required": false } ], "children": [ { "name": "get", "kind": "ConfigChild", "attributes": [ { "name": "path", "type": "String", "required": false }, { "name": "to", "type": "Uri", "required": false }, { "name": "consumes", "type": "String", "required": false }, { "name": "produces", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false }, { "name": "outType", "type": "TypeName", "required": false }, { "name": "bindingMode", "type": "Enum", "required": false, "enumValues": [ "off", "json" ] }, { "name": "clientRequestValidation", "type": "Bool", "required": false } ], "children": [ { "name": "param", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "type", "type": "Enum", "required": false, "enumValues": [ "path", "query", "header" ] }, { "name": "required", "type": "Bool", "required": false }, { "name": "dataType", "type": "Enum", "required": false, "enumValues": [ "string", "integer", "number", "boolean" ] }, { "name": "description", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "post", "kind": "ConfigChild", "attributes": [ { "name": "path", "type": "String", "required": false }, { "name": "to", "type": "Uri", "required": false }, { "name": "consumes", "type": "String", "required": false }, { "name": "produces", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false }, { "name": "outType", "type": "TypeName", "required": false }, { "name": "bindingMode", "type": "Enum", "required": false, "enumValues": [ "off", "json" ] }, { "name": "clientRequestValidation", "type": "Bool", "required": false } ], "children": [ { "name": "param", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "type", "type": "Enum", "required": false, "enumValues": [ "path", "query", "header" ] }, { "name": "required", "type": "Bool", "required": false }, { "name": "dataType", "type": "Enum", "required": false, "enumValues": [ "string", "integer", "number", "boolean" ] }, { "name": "description", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "put", "kind": "ConfigChild", "attributes": [ { "name": "path", "type": "String", "required": false }, { "name": "to", "type": "Uri", "required": false }, { "name": "consumes", "type": "String", "required": false }, { "name": "produces", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false }, { "name": "outType", "type": "TypeName", "required": false }, { "name": "bindingMode", "type": "Enum", "required": false, "enumValues": [ "off", "json" ] }, { "name": "clientRequestValidation", "type": "Bool", "required": false } ], "children": [ { "name": "param", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "type", "type": "Enum", "required": false, "enumValues": [ "path", "query", "header" ] }, { "name": "required", "type": "Bool", "required": false }, { "name": "dataType", "type": "Enum", "required": false, "enumValues": [ "string", "integer", "number", "boolean" ] }, { "name": "description", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "delete", "kind": "ConfigChild", "attributes": [ { "name": "path", "type": "String", "required": false }, { "name": "to", "type": "Uri", "required": false }, { "name": "consumes", "type": "String", "required": false }, { "name": "produces", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false }, { "name": "outType", "type": "TypeName", "required": false }, { "name": "bindingMode", "type": "Enum", "required": false, "enumValues": [ "off", "json" ] }, { "name": "clientRequestValidation", "type": "Bool", "required": false } ], "children": [ { "name": "param", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "type", "type": "Enum", "required": false, "enumValues": [ "path", "query", "header" ] }, { "name": "required", "type": "Bool", "required": false }, { "name": "dataType", "type": "Enum", "required": false, "enumValues": [ "string", "integer", "number", "boolean" ] }, { "name": "description", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "patch", "kind": "ConfigChild", "attributes": [ { "name": "path", "type": "String", "required": false }, { "name": "to", "type": "Uri", "required": false }, { "name": "consumes", "type": "String", "required": false }, { "name": "produces", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false }, { "name": "outType", "type": "TypeName", "required": false }, { "name": "bindingMode", "type": "Enum", "required": false, "enumValues": [ "off", "json" ] }, { "name": "clientRequestValidation", "type": "Bool", "required": false } ], "children": [ { "name": "param", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "type", "type": "Enum", "required": false, "enumValues": [ "path", "query", "header" ] }, { "name": "required", "type": "Bool", "required": false }, { "name": "dataType", "type": "Enum", "required": false, "enumValues": [ "string", "integer", "number", "boolean" ] }, { "name": "description", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "head", "kind": "ConfigChild", "attributes": [ { "name": "path", "type": "String", "required": false }, { "name": "to", "type": "Uri", "required": false }, { "name": "consumes", "type": "String", "required": false }, { "name": "produces", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false }, { "name": "outType", "type": "TypeName", "required": false }, { "name": "bindingMode", "type": "Enum", "required": false, "enumValues": [ "off", "json" ] }, { "name": "clientRequestValidation", "type": "Bool", "required": false } ], "children": [ { "name": "param", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "type", "type": "Enum", "required": false, "enumValues": [ "path", "query", "header" ] }, { "name": "required", "type": "Bool", "required": false }, { "name": "dataType", "type": "Enum", "required": false, "enumValues": [ "string", "integer", "number", "boolean" ] }, { "name": "description", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "rollbackAll", "kind": "Step", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "rollbackTransaction", "kind": "Step", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "routeBuilder", "kind": "ContextLevel", "attributes": [ { "name": "type", "type": "TypeName", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "routePolicy", "kind": "Step", "attributes": [ { "name": "ref", "type": "Reference", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "routingSlip", "kind": "Step", "attributes": [ { "name": "expr", "type": "Expression", "required": true }, { "name": "delimiter", "type": "String", "required": false }, { "name": "ignoreInvalidEndpoints", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "saga", "kind": "Step", "attributes": [], "children": [ { "name": "step", "kind": "ConfigChild", "attributes": [ { "name": "processor", "type": "Reference", "required": true }, { "name": "compensate", "type": "Reference", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "sample", "kind": "Step", "attributes": [ { "name": "messageFrequency", "type": "Long", "required": false }, { "name": "period", "type": "Duration", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "scatterGather", "kind": "Step", "attributes": [ { "name": "timeout", "type": "Duration", "required": false }, { "name": "parallel", "type": "Bool", "required": false }, { "name": "maxDop", "type": "Int", "required": false }, { "name": "stopOnException", "type": "Bool", "required": false }, { "name": "strategy", "type": "String", "required": false } ], "children": [ { "name": "recipient", "kind": "ConfigChild", "attributes": [ { "name": "uri", "type": "Uri", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "setBody", "kind": "Step", "attributes": [ { "name": "value", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "setHeader", "kind": "Step", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "value", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "setHeaders", "kind": "Step", "attributes": [], "children": [ { "name": "header", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "value", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "setProperties", "kind": "Step", "attributes": [], "children": [ { "name": "property", "kind": "ConfigChild", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "value", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "setProperty", "kind": "Step", "attributes": [ { "name": "name", "type": "String", "required": true }, { "name": "value", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "sort", "kind": "Step", "attributes": [ { "name": "expr", "type": "Expression", "required": true }, { "name": "by", "type": "Expression", "required": false }, { "name": "descending", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "spanTag", "kind": "Step", "attributes": [ { "name": "key", "type": "String", "required": true }, { "name": "value", "type": "String", "required": false }, { "name": "expr", "type": "Expression", "required": false }, { "name": "target", "type": "Enum", "required": false, "enumValues": [ "Enclosing", "Inbound" ] } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "split", "kind": "Scope", "attributes": [ { "name": "expr", "type": "Expression", "required": false }, { "name": "parallel", "type": "Bool", "required": false }, { "name": "maxParallelism", "type": "Int", "required": false }, { "name": "stopOnException", "type": "Bool", "required": false } ], "children": [ { "name": "tokenizeLines", "kind": "ConfigChild", "attributes": [ { "name": "separator", "type": "String", "required": false }, { "name": "skipEmpty", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "tokenizeXml", "kind": "ConfigChild", "attributes": [ { "name": "element", "type": "String", "required": true }, { "name": "inheritNamespaceFrom", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "tokenizeJsonArray", "kind": "ConfigChild", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "stop", "kind": "Step", "attributes": [], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "streamCaching", "kind": "Step", "attributes": [ { "name": "spoolThreshold", "type": "Long", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "threads", "kind": "Scope", "attributes": [ { "name": "poolSize", "type": "Int", "required": true }, { "name": "maxQueueSize", "type": "Int", "required": false }, { "name": "enqueueTimeout", "type": "Duration", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "throttle", "kind": "Scope", "attributes": [ { "name": "maxPerPeriod", "type": "Expression", "required": true }, { "name": "period", "type": "Duration", "required": false }, { "name": "key", "type": "Expression", "required": false }, { "name": "rejectOnOverflow", "type": "Bool", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "throwException", "kind": "Step", "attributes": [ { "name": "type", "type": "TypeName", "required": true }, { "name": "message", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "to", "kind": "Step", "attributes": [ { "name": "uri", "type": "Uri", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": true }, { "name": "toD", "kind": "Step", "attributes": [ { "name": "uri", "type": "Uri", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": true }, { "name": "traced", "kind": "Scope", "attributes": [ { "name": "name", "type": "String", "required": true } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "transaction", "kind": "Scope", "attributes": [ { "name": "policy", "type": "Enum", "required": false, "enumValues": [ "default", "requiresNew", "suppress", "mandatory" ] }, { "name": "deadLetterChannel", "type": "Uri", "required": false }, { "name": "retryAttempts", "type": "Int", "required": false }, { "name": "retryDelay", "type": "Duration", "required": false } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "transform", "kind": "Step", "attributes": [ { "name": "expr", "type": "Expression", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "transformJson", "kind": "Step", "attributes": [ { "name": "spec", "type": "String", "required": false }, { "name": "output", "type": "Enum", "required": false, "enumValues": [ "string", "node" ] } ], "children": [], "allowsSteps": false, "allowsText": true, "takesEndpoint": false }, { "name": "tryCatch", "kind": "Scope", "attributes": [], "children": [ { "name": "try", "kind": "ConfigChild", "attributes": [], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "catch", "kind": "ConfigChild", "attributes": [ { "name": "exceptions", "type": "TypeNameList", "required": true } ], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false }, { "name": "finally", "kind": "ConfigChild", "attributes": [], "children": [], "allowsSteps": true, "allowsText": false, "takesEndpoint": false } ], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "unmarshal", "kind": "Step", "attributes": [ { "name": "format", "type": "String", "required": false }, { "name": "type", "type": "TypeName", "required": false }, { "name": "target", "type": "TypeName", "required": true } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "validate", "kind": "Step", "attributes": [ { "name": "expr", "type": "Expression", "required": true }, { "name": "message", "type": "String", "required": false }, { "name": "throwOnFailure", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": false }, { "name": "validateJsonSchema", "kind": "Step", "attributes": [ { "name": "file", "type": "String", "required": false }, { "name": "throwOnFailure", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": true, "takesEndpoint": false }, { "name": "validateXsd", "kind": "Step", "attributes": [ { "name": "file", "type": "String", "required": false }, { "name": "targetNamespace", "type": "String", "required": false }, { "name": "schemaRoot", "type": "String", "required": false }, { "name": "throwOnFailure", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": true, "takesEndpoint": false }, { "name": "wireTap", "kind": "Step", "attributes": [ { "name": "uri", "type": "Uri", "required": false }, { "name": "executorService", "type": "String", "required": false } ], "children": [], "allowsSteps": false, "allowsText": false, "takesEndpoint": true }, { "name": "xslt", "kind": "Step", "attributes": [ { "name": "file", "type": "String", "required": false }, { "name": "output", "type": "Enum", "required": false, "enumValues": [ "String", "Bytes", "Dom" ] }, { "name": "failOnNullBody", "type": "Bool", "required": false }, { "name": "allowTemplateFromHeader", "type": "Bool", "required": false } ], "children": [], "allowsSteps": false, "allowsText": true, "takesEndpoint": false } ] Path: redb-route/vscode-redb-route/package.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/package.json ---- { "name": "redb-route-xml", "displayName": "redb Route XML", "description": "Completion and validation for redb.Route XML routes, a route tree, bean reference hints and a graph editor over the XML text.", "version": "0.2.31", "publisher": "redb", "license": "Apache-2.0", "icon": "media/icon.png", "galleryBanner": { "color": "#14121d", "theme": "dark" }, "repository": { "type": "git", "url": "https://github.com/redbase-app/redb-route.git" }, "homepage": "https://github.com/redbase-app/redb-route/tree/main/vscode-redb-route#readme", "bugs": { "url": "https://github.com/redbase-app/redb-route/issues" }, "engines": { "vscode": "^1.85.0" }, "categories": [ "Programming Languages", "Visualization" ], "keywords": [ "redb", "route", "esb", "eip", "xml", "integration", "camel", "graph" ], "extensionDependencies": [ "redhat.vscode-xml" ], "activationEvents": [ "workspaceContains:**/*.route.xml", "workspaceContains:**/*.redb-route.xml", "onLanguage:xml" ], "main": "./out/extension.js", "contributes": { "customEditors": [ { "viewType": "redbRoute.graph", "displayName": "redb Route Graph", "selector": [ { "filenamePattern": "*.route.xml" }, { "filenamePattern": "*.redb-route.xml" } ], "priority": "option" } ], "viewsContainers": { "activitybar": [ { "id": "redb", "title": "redb", "icon": "media/activity.svg" } ] }, "views": { "redb": [ { "id": "redbRoutes", "name": "Routes", "icon": "media/activity.svg" } ] }, "viewsWelcome": [ { "view": "redbRoutes", "contents": "No redb route files in this workspace.\n[New Project](command:redbRoute.newProject)\nRoute files are *.route.xml documents whose root declares the urn:redb:route:1.0 namespace. [Read about the format](https://github.com/redbase-app/redb-route/blob/main/redb.Route.Xml/README.md).", "when": "!redbRoute.hasRoutes" } ], "commands": [ { "command": "redbRoute.newProject", "title": "redb: New Project", "icon": "$(add)" }, { "command": "redbRoute.refreshTree", "title": "redb Route: Refresh Route Tree", "icon": "$(refresh)" }, { "command": "redbRoute.showMermaid", "title": "redb Route: Show Mermaid Diagram" }, { "command": "redbRoute.openGraph", "title": "redb Route: Open Route Graph", "icon": "$(type-hierarchy-sub)" } ], "menus": { "view/title": [ { "command": "redbRoute.newProject", "when": "view == redbRoutes", "group": "navigation@1" }, { "command": "redbRoute.refreshTree", "when": "view == redbRoutes", "group": "navigation" } ], "editor/title": [ { "command": "redbRoute.openGraph", "when": "resourceFilename =~ /\\.(redb-)?route\\.xml$/", "group": "navigation" } ], "commandPalette": [ { "command": "redbRoute.showMermaid", "when": "resourceExtname == .xml" }, { "command": "redbRoute.openGraph", "when": "resourceExtname == .xml" } ] } }, "scripts": { "compile": "tsc -p ./", "watch": "tsc -watch -p ./", "test": "node --test \"out/test/*.test.js\"", "refresh-schema": "dotnet run --project ../redb.Route.Xml.CodeGen -f net10.0 -- xsd --out media" }, "devDependencies": { "@types/node": "^20.0.0", "@types/vscode": "^1.85.0", "typescript": "^5.4.0" } } Path: redb-route/vscode-redb-route/src/beanref.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/beanref.ts ---- /** * Registry references (`#name`) in attribute values: where the cursor sits on one, and which * names the document and its module's `context.xml` declare with ``. The positions are * the ones the pack gate reads as references (RoutePackage.RegistryReferences): the whole value (`dataSource="#db"`), * the path right after the scheme (`bean:#x`) and a URI option value (`?headerFilterStrategy=#f`). * A '#' anywhere else is text, so the sql parameter `:#name` is left alone. */ import { sniff } from "./sniff"; import { ElementIndex } from "./graphmodel"; import { openElements } from "./skeletonscope"; import { tagEnd } from "./tagscan"; const NAME = /[A-Za-z0-9_.\-]*$/; /** Where a half-typed reference name starts, when the offset is inside one. */ export type ReferencePosition = | { ok: true; /** offset right after the `#`. */ replaceFrom: number } | { ok: false }; export function referencePosition(text: string, offset: number): ReferencePosition { const before = text.slice(0, offset); const commentStart = before.lastIndexOf("", commentStart) < 0) return { ok: false }; const cdataStart = before.lastIndexOf("= 0 && before.indexOf("]]>", cdataStart) < 0) return { ok: false }; // Inside a start tag, inside a quoted value: `name="` (or `'`) with no closing quote yet. const lastOpen = before.lastIndexOf("<"); if (lastOpen < 0 || tagEnd(before, lastOpen) >= 0) return { ok: false }; const value = openValue(before.slice(lastOpen)); if (value === null) return { ok: false }; const name = NAME.exec(value)![0]; const head = value.slice(0, value.length - name.length); if (!head.endsWith("#")) return { ok: false }; const lead = head.slice(0, -1); const query = lead.indexOf("?"); const atReference = lead === "" || (query < 0 && /^[A-Za-z][A-Za-z0-9+.\-]*:(\/\/)?$/.test(lead)) || (query >= 0 && /^[A-Za-z][A-Za-z0-9+.\-]*:/.test(lead) && /[?&][^=&]+=$/.test(lead)); return atReference ? { ok: true, replaceFrom: offset - name.length } : { ok: false }; } /** * A value of an attribute the element list types as a registry reference (`predicate=`, * `repository=`, `processor=` …), before any `#` is typed: the whole value so far is a bare name, * and completion replaces it with `#name`. The type comes from the generated list, so no attribute * name is known here; a child entry (`` of ``, `` of ``) is looked up * under its parent, as the skeleton scope does. */ export function typedReferencePosition(text: string, offset: number, index: ElementIndex): ReferencePosition { const open = openAttribute(text, offset); if (!open || !/^[A-Za-z0-9_.\-]*$/.test(open.value)) return { ok: false }; return attributeType(text, offset, open, index) === "Reference" ? { ok: true, replaceFrom: open.valueStart } : { ok: false }; } /** The element list's type of the open attribute, a child entry looked up under its parent first. */ function attributeType(text: string, offset: number, open: OpenAttribute, index: ElementIndex): string | undefined { const parents = openElements(text, text.lastIndexOf("<", offset - 1)); const parent = parents.length > 0 ? parents[parents.length - 1] : null; const info = (parent === null ? undefined : index.get(parent)?.children?.find(c => c.name === open.element)) ?? index.get(open.element); return info?.attributes.find(a => a.name === open.attribute)?.type; } /** * The expression namespaces that name a registry object, with the name as each reads it. `bean:` * calls a method, so the dot ends the name; `ref:` reads the object itself, so the name is the * whole run, dots included, and nothing follows it. */ const REGISTRY_NAMESPACES: readonly { prefix: string; name: RegExp }[] = [ { prefix: "bean:", name: /[A-Za-z0-9_-]*$/ }, { prefix: "ref:", name: /[A-Za-z0-9_.-]*$/ }, ]; /** * Where an expression names a registry object, when the offset is inside that name: a bean call * (`${bean:pricing.Gross(body)}`) or a registry read (`${ref:rates}`). Two spellings each: the * template hole `${bean:` / `${ref:` in any attribute value or element text, and the bare * `bean:` / `ref:` of a condition or value, which only an attribute the element list types as an * expression reads, at the start of the value or after an operator. After a bean's `.` the method * follows, which the editor does not know, so nothing is offered there. A namespace inside a quoted * literal of the expression is text. */ export function beanCallPosition(text: string, offset: number, index: ElementIndex): ReferencePosition { const before = text.slice(0, offset); const commentStart = before.lastIndexOf("", commentStart) < 0) return { ok: false }; let name = ""; let namespace: string | null = null; for (const candidate of REGISTRY_NAMESPACES) { const run = candidate.name.exec(before)![0]; if (before.slice(0, before.length - run.length).endsWith(candidate.prefix)) { name = run; namespace = candidate.prefix; break; } } if (namespace === null) return { ok: false }; const head = before.slice(0, before.length - name.length); // Text of a CDATA section is element text (a template body), not a tag. const cdataStart = before.lastIndexOf("= 0 && before.indexOf("]]>", cdataStart) < 0; const lastOpen = before.lastIndexOf("<"); const inTag = !inCdata && lastOpen >= 0 && tagEnd(before, lastOpen) < 0; const open = inTag ? openAttribute(text, offset) : null; if (inTag && !open) return { ok: false }; if (head.endsWith("${" + namespace)) return { ok: true, replaceFrom: offset - name.length }; if (!open || attributeType(text, offset, open, index) !== "Expression") return { ok: false }; const lead = open.value.slice(0, open.value.length - name.length - namespace.length); if (insideLiteral(lead)) return { ok: false }; return lead === "" || /[\s(,!=<>&|?:~]$/.test(lead) ? { ok: true, replaceFrom: offset - name.length } : { ok: false }; } /** Whether an expression prefix ends inside a quoted literal (backslash escapes the quote). */ function insideLiteral(expression: string): boolean { let quote: string | null = null; for (let i = 0; i < expression.length; i++) { const c = expression[i]; if (quote) { if (c === "\\") i++; else if (c === quote) quote = null; } else if (c === "'" || c === '"') { quote = c; } } return quote !== null; } /** * The start tag and attribute the offset sits in, with the value typed so far, or null outside an * open attribute value. The element is the tag being typed, its parent the innermost open element * before it (both local names); the caller asks the element list for the attribute's type. */ export interface OpenAttribute { element: string; attribute: string; /** Offset of the first character of the value. */ valueStart: number; value: string; } export function openAttribute(text: string, offset: number): OpenAttribute | null { const before = text.slice(0, offset); const commentStart = before.lastIndexOf("", commentStart) < 0) return null; const cdataStart = before.lastIndexOf("= 0 && before.indexOf("]]>", cdataStart) < 0) return null; const lastOpen = before.lastIndexOf("<"); if (lastOpen < 0 || tagEnd(before, lastOpen) >= 0) return null; const tag = before.slice(lastOpen); const value = openValue(tag); if (value === null) return null; const head = /<([\w.\-:]+)/.exec(tag); const attribute = /([\w.\-:]+)\s*=\s*["']$/.exec(tag.slice(0, tag.length - value.length)); if (!head || !attribute) return null; const local = (name: string) => name.slice(name.indexOf(":") + 1); return { element: local(head[1]), attribute: local(attribute[1]), valueStart: offset - value.length, value, }; } /** The text of the attribute value the tag fragment ends in, or null outside a value. */ function openValue(tag: string): string | null { let quote: string | null = null; let start = 0; for (let i = 0; i < tag.length; i++) { const c = tag[i]; if (quote) { if (c === quote) quote = null; } else if ((c === '"' || c === "'") && /=\s*$/.test(tag.slice(0, i))) { quote = c; start = i + 1; } } return quote ? tag.slice(start) : null; } /** * The names of the `` declarations under the root, in document order, without * duplicates; a step or endpoint `` inside a route declares nothing. * A scan rather than a parse: the document is half-typed while the user completes a reference. * Commented-out beans do not count. */ export function beanNames(text: string): string[] { const live = text.replace(/|$)/g, ""); const names: string[] = []; for (const match of live.matchAll(/<(?:[\w.\-]+:)?bean\b([^<>]*)/g)) { // A declaration sits under the root; a `` deeper down is a step or an endpoint. if (openElements(live, match.index!).length > 1) continue; const name = /\sname\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(match[1]); const value = name ? (name[1] ?? name[2]) : ""; if (value && !names.includes(value)) names.push(value); } return names; } /** A bean name `#` offers, and whether it comes from the module's `context.xml`. */ export interface BeanCandidate { name: string; fromContext: boolean; } /** * The names `#` offers in a document: its own `` first, then those of the module's * `context.xml`, each name once. The context text counts only when it is a redb context document * (root `` in the redb namespace); any other file at that path adds nothing. */ export function beanCandidates(documentText: string, contextText: string | null): BeanCandidate[] { const own = beanNames(documentText); const candidates: BeanCandidate[] = own.map(name => ({ name, fromContext: false })); if (contextText !== null && sniff(contextText)?.kind === "context") for (const name of beanNames(contextText)) if (!own.includes(name)) candidates.push({ name, fromContext: true }); return candidates; } Path: redb-route/vscode-redb-route/src/catalog.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/catalog.ts ---- import { openAttribute } from "./beanref"; import { startTagAt } from "./dataformats"; /** * The connector catalog (media/redb-route-catalog.json, generated by `redb-route-xml catalog`): one * component per scheme with its options. The graph's endpoint panel and the registry-reference hints * read it through the same scheme index. */ /** One option of a component. `reference` marks an option that names a registry object. */ export interface CatalogOption { name: string; type: string; default?: string | null; sensitive: boolean; enumValues?: string[]; /** The expected type ("Full.Name, Assembly"), or "object" when the code gives none. Absent: not a reference. */ reference?: string; } export interface CatalogComponent { scheme: string; alternateSchemes: string[]; pathSynonym?: string | null; /** The only side of a one-sided component; absent means both (a consumer and a producer). */ role?: "producer" | "consumer"; options: CatalogOption[]; } /** * The components by scheme, lower case: each scheme, its alternate schemes, and the everyday spellings * the catalog declares no alternate for (a `from uri="http://..."` is the https component's endpoint). */ export function catalogByScheme(components: readonly CatalogComponent[]): Map { const byScheme = new Map(); for (const component of components) { byScheme.set(component.scheme, component); for (const alternate of component.alternateSchemes ?? []) byScheme.set(alternate, component); } for (const [alias, canonical] of [["http", "https"], ["ws", "wss"]] as const) { const component = byScheme.get(canonical); if (component && !byScheme.has(alias)) byScheme.set(alias, component); } return byScheme; } /** The option of a component by name, case-insensitively, as the options bind. */ export function findOption(component: CatalogComponent, name: string): CatalogOption | undefined { const wanted = name.toLowerCase(); return component.options.find(o => o.name.toLowerCase() === wanted); } /** Where a value of a registry-reference option is being typed, and the option. */ export interface CatalogReferencePosition { /** The start of the name typed so far, after the `#` when one is typed. */ replaceFrom: number; /** Whether the `#` is already typed; otherwise completion inserts it with the name. */ hashTyped: boolean; option: CatalogOption; } /** A whole value that is a name so far, with or without its `#`. */ const NAME_VALUE = /^(#?)([A-Za-z0-9_.\-]*)$/; /** `scheme:path?a=1&key=value` with the offset at the end of `value`. */ const URI_QUERY_VALUE = /^([A-Za-z][A-Za-z0-9+.\-]*):[^?]*\?(?:[^&]*&)*([^=&]+)=(#?)([A-Za-z0-9_.\-]*)$/; /** * The value of a component option the catalog marks as a registry reference, empty or a name so far * (with or without its `#`): a query value of an endpoint URI (`uri="sql:select 1?dataSource=|"`) or an attribute of the * structured endpoint form (``). The scheme is matched with its alternates and the * option name case-insensitively. */ export function catalogReferencePosition( text: string, offset: number, byScheme: ReadonlyMap): CatalogReferencePosition | null { const open = openAttribute(text, offset); if (!open) return null; const query = URI_QUERY_VALUE.exec(open.value); if (query) { const option = referenceOption(byScheme, query[1], queryKey(query[2])); return option ? { replaceFrom: offset - query[4].length, hashTyped: query[3] === "#", option } : null; } const name = NAME_VALUE.exec(open.value); if (!name) return null; const option = referenceOption(byScheme, open.element, open.attribute); return option ? { replaceFrom: offset - name[2].length, hashTyped: name[1] === "#", option } : null; } /** * The hover of a registry-reference option: on an attribute name of the structured endpoint form, or * on a query key of an endpoint URI value. */ export function catalogReferenceHover( text: string, offset: number, byScheme: ReadonlyMap): string | null { const tag = startTagAt(text, offset); if (!tag) return null; for (const attribute of tag.attributes) { if (attribute.nameStart <= offset && offset < attribute.nameEnd) { const option = referenceOption(byScheme, tag.element, attribute.name); return option ? describeReference(option) : null; } if (attribute.valueStart >= 0 && attribute.valueStart <= offset && offset < attribute.valueEnd) { const scheme = /^([A-Za-z][A-Za-z0-9+.\-]*):/.exec(attribute.value)?.[1]; const query = attribute.value.indexOf("?"); const at = offset - attribute.valueStart; if (!scheme || query < 0 || at <= query) return null; const keyStart = Math.max(attribute.value.lastIndexOf("&", at - 1), query) + 1; const equals = attribute.value.indexOf("=", keyStart); if (equals < 0 || at >= equals) return null; const option = referenceOption(byScheme, scheme, queryKey(attribute.value.slice(keyStart, equals))); return option ? describeReference(option) : null; } } return null; } function referenceOption( byScheme: ReadonlyMap, scheme: string, name: string): CatalogOption | undefined { const component = byScheme.get(scheme.toLowerCase()); const option = component ? findOption(component, name) : undefined; return option?.reference !== undefined ? option : undefined; } /** What the item detail says about the expected type: nothing when the code gives none. */ export function expectedType(option: CatalogOption): string | null { return option.reference !== undefined && option.reference !== "object" ? option.reference : null; } function describeReference(option: CatalogOption): string { const expected = expectedType(option); return `**${option.name}** names a registry object: \`#name\` of a \`\`.` + (expected ? `\n\nExpects \`${expected}\`.` : ""); } /** A query key as written in XML, where the separator is spelled `&`. */ function queryKey(raw: string): string { return raw.startsWith("amp;") ? raw.slice(4) : raw; } Path: redb-route/vscode-redb-route/src/category.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/category.ts ---- /** * The §6 category of every format element — what the eye reads before the label: shape and * color come from the category, not the icon. The assignment is mechanical over the * generated element list (media/redb-route-elements.json); a unit test pins completeness, * so a new registry element without a category fails the build instead of rendering blank. */ export type Category = | "source" // from | "sendExternal" // to on a transport — filled, accent | "sendInternal" // to on direct/seda/vm — outlined, same accent | "transform" // the lightest, neutral | "flow" // accent color, larger than the rest | "errors" // warning color | "userCode" // bean: | "unknown"; // the opaque node (Р10) const FLOW = [ "choice", "filter", "split", "multicast", "loop", "tryCatch", "throttle", "aggregate", "resequence", "threads", "debounce", "idempotentConsumer", "ofType", "replayable", "loadBalance", "recipientList", "dynamicRouter", "routingSlip", "scatterGather", "sample", "delay", "stop", ]; const ERRORS = [ "onException", "onCompletion", "circuitBreaker", "validate", "validateJsonSchema", "validateXsd", "throwException", "exceptionHandled", "rollbackAll", "rollbackTransaction", "transaction", "beginTransaction", "commitTransaction", "saga", ]; const TRANSFORM = [ "setBody", "setHeader", "setHeaders", "setProperty", "setProperties", "removeBody", "removeHeader", "removeHeaders", "removeProperty", "removeProperties", "transform", "convertBody", "marshal", "unmarshal", "dataFormat", "normalize", "xslt", "sort", "claimCheck", "addAttachment", "removeAttachment", "removeAttachments", // neutral observability and infrastructure — the lightest weight on purpose "log", "metered", "traced", "spanTag", "streamCaching", "messageHistory", "controlBus", "routePolicy", "intercept", "interceptFrom", "interceptSendToEndpoint", // package elements (present when the palette was refreshed with --bin) "cache", "transformJson", "payload", "redbGet", "redbSave", "redbDelete", "redbQuery", ]; const BY_NAME = new Map([ ["bean", "userCode"], ...FLOW.map(n => [n, "flow"] as const), ...ERRORS.map(n => [n, "errors"] as const), ...TRANSFORM.map(n => [n, "transform"] as const), ]); /** Schemes that stay inside the process — outlined, not filled (§3.1). */ const INTERNAL_SCHEMES = new Set(["direct", "seda", "vm", "direct-vm"]); export function categoryOf(elementName: string): Category | null { return BY_NAME.get(elementName) ?? null; } /** The category of an endpoint-carrying node, decided by its URI. */ export function endpointCategory(uri: string): Category { const scheme = uri.split(":", 1)[0].toLowerCase(); if (scheme === "bean") return "userCode"; return INTERNAL_SCHEMES.has(scheme) ? "sendInternal" : "sendExternal"; } Path: redb-route/vscode-redb-route/src/dataformats.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/dataformats.ts ---- /** * Completion and hover data for the data formats of ``, `` and ``. * The format list is generated by `redb-route-xml elements` (media/redb-route-dataformats.json): each * format's registered name, its type name and the options it takes in attribute form. The XSD cannot * make attributes depend on the `type=` value, so these hints are served here, from that list. */ /** One option of a data format in attribute form. */ export interface FormatAttribute { name: string; kind: string; enumValues?: string[]; default?: string; description?: string; } /** One data format of the generated list. A format without a registered name has no `format=` value. */ export interface DataFormatInfo { name?: string; type: string; contentType?: string; mediaTypes?: string[]; attributes?: FormatAttribute[]; unmarshalTargets?: string[]; } /** The elements that name a data format, by local name. */ const FORMAT_ELEMENTS = new Set(["marshal", "unmarshal", "dataFormat"]); /** One attribute of a start tag, with its offsets in the document. */ export interface TagAttribute { name: string; nameStart: number; nameEnd: number; /** Offset of the first character of the value, or -1 when the attribute has no value yet. */ valueStart: number; /** Offset just past the value (before the closing quote, or the end of the scan when unclosed). */ valueEnd: number; value: string; } /** A start tag of the document, possibly unfinished while it is being typed. */ export interface StartTag { /** Local name of the element. */ element: string; open: number; attributes: TagAttribute[]; } /** * The start tag the offset sits in, or null outside one. The tag is read quote-aware up to its `>`; an * unfinished tag ends at the next `<` outside a value, so the following tags are not read as its * attributes. Comments, CDATA, declarations and end tags are not start tags. */ export function startTagAt(text: string, offset: number): StartTag | null { const before = text.slice(0, offset); const commentStart = before.lastIndexOf("", commentStart) < 0) return null; const cdataStart = before.lastIndexOf("= 0 && before.indexOf("]]>", cdataStart) < 0) return null; // The innermost '<' before the offset that is not inside a quoted value of an earlier tag. let open = before.lastIndexOf("<"); while (open >= 0 && insideQuotedValue(text, open)) open = before.lastIndexOf("<", open - 1); if (open < 0) return null; const nameMatch = /^<([A-Za-z_][\w.\-]*(?::[\w.\-]+)?)/.exec(text.slice(open, open + 200)); if (!nameMatch) return null; const attributes: TagAttribute[] = []; let i = open + nameMatch[0].length; let end = -1; while (i < text.length) { const c = text[i]; if (/\s/.test(c)) { i++; continue; } if (c === ">") { end = i; break; } if (c === "/" && text[i + 1] === ">") { end = i + 1; break; } if (c === "<") break; const name = /^[^\s=/>"'<]+/.exec(text.slice(i, i + 200)); if (!name) { i++; continue; } const attribute: TagAttribute = { name: localName(name[0]), nameStart: i, nameEnd: i + name[0].length, valueStart: -1, valueEnd: -1, value: "", }; i = attribute.nameEnd; while (i < text.length && /\s/.test(text[i])) i++; if (text[i] === "=") { i++; while (i < text.length && /\s/.test(text[i])) i++; const quote = text[i]; if (quote === '"' || quote === "'") { const close = text.indexOf(quote, i + 1); attribute.valueStart = i + 1; attribute.valueEnd = close < 0 ? text.length : close; attribute.value = text.slice(attribute.valueStart, attribute.valueEnd); i = close < 0 ? text.length : close + 1; } } attributes.push(attribute); } if (end >= 0 && end < offset) return null; return { element: localName(nameMatch[1]), open, attributes }; } /** Whether the offset of a '<' lies inside a quoted value of the tag before it. */ function insideQuotedValue(text: string, at: number): boolean { const previous = text.lastIndexOf("<", at - 1); if (previous < 0) return false; let quote: string | null = null; for (let i = previous + 1; i < at; i++) { const c = text[i]; if (quote) { if (c === quote) quote = null; } else if (c === '"' || c === "'") quote = c; else if (c === ">") return false; } return quote !== null; } function localName(name: string): string { return name.slice(name.indexOf(":") + 1); } /** Type names compare without whitespace and case: `A.B, Asm` and `a.b,asm` name the same format. */ function sameType(a: string, b: string): boolean { const norm = (s: string) => s.replace(/\s+/g, "").toLowerCase(); return norm(a) === norm(b); } /** The format a data-format tag names through `type=`, or through `format=` for the target list. */ function formatOf(tag: StartTag, formats: readonly DataFormatInfo[], byName: boolean): DataFormatInfo | undefined { const type = tag.attributes.find(a => a.name === "type" && a.valueStart >= 0); if (type) return formats.find(f => sameType(f.type, type.value)); if (!byName) return undefined; const format = tag.attributes.find(a => a.name === "format" && a.valueStart >= 0); return format ? formats.find(f => f.name !== undefined && f.name.toLowerCase() === format.value.toLowerCase()) : undefined; } /** A completion the provider turns into an item. */ export interface FormatCompletion { label: string; /** "value" replaces the value typed so far; "attribute" inserts `name=""` at the name typed so far. */ kind: "value" | "attribute"; replaceFrom: number; detail?: string; documentation?: string; } /** * What the offset of a data-format tag takes: * - in `format=` of ``/``: the registered format names; * - in `type=` of ``/``/``: the format type names; * - in `target=` of ``: the targets of the format its `type=` or `format=` names; * - at an attribute name, once `type=` names a format: its options not yet written; * - in the value of such an option: its enum values, or true/false for a Bool; * - in the value of a Path option: the files of the module's `resources/` (pathCompletions). */ export function formatCompletions( text: string, offset: number, formats: readonly DataFormatInfo[], resources: () => ResourceTree | null = () => null): FormatCompletion[] { const tag = startTagAt(text, offset); if (!tag || !FORMAT_ELEMENTS.has(tag.element)) return []; const inValue = tag.attributes.find(a => a.valueStart >= 0 && a.valueStart <= offset && offset <= a.valueEnd); if (inValue) { const replaceFrom = inValue.valueStart; if (inValue.name === "format" && tag.element !== "dataFormat") return formats.filter(f => f.name !== undefined).map(f => ({ label: f.name!, kind: "value", replaceFrom, detail: f.type, documentation: describeFormat(f), })); if (inValue.name === "type") return formats.map(f => ({ label: f.type, kind: "value", replaceFrom, detail: f.name ? `data format ${f.name}` : "data format", documentation: describeFormat(f), })); if (inValue.name === "target" && tag.element === "unmarshal") return (formatOf(tag, formats, true)?.unmarshalTargets ?? []).map(t => ({ label: t, kind: "value", replaceFrom, detail: "unmarshal target", })); const option = formatOf(tag, formats, false)?.attributes?.find(a => a.name === inValue.name); if (option?.kind === "Path") return pathCompletions(tag, option, replaceFrom, resources); const values = option?.kind === "Enum" ? option.enumValues ?? [] : option?.kind === "Bool" ? ["true", "false"] : []; return values.map(v => ({ label: v, kind: "value", replaceFrom, detail: option!.default === v ? "default" : undefined, })); } // An attribute name: the offset is after whitespace inside the tag, possibly in a name being typed. const typed = tag.attributes.find(a => a.nameStart <= offset && offset <= a.nameEnd && a.valueStart < 0); if (!typed && tag.attributes.some(a => a.nameStart < offset && offset < a.nameEnd)) return []; const replaceFrom = typed ? typed.nameStart : offset; if (!typed && !/\s/.test(text[offset - 1] ?? "")) return []; const format = formatOf(tag, formats, false); if (!format) return []; const written = new Set(tag.attributes.filter(a => a !== typed).map(a => a.name)); return (format.attributes ?? []).filter(a => !written.has(a.name)).map(a => ({ label: a.name, kind: "attribute", replaceFrom, detail: attributeDetail(a), documentation: a.description, })); } /** The hover text at the offset of a data-format tag: an option name, or the format of `type=`/`format=`. */ export function formatHover(text: string, offset: number, formats: readonly DataFormatInfo[]): string | null { const tag = startTagAt(text, offset); if (!tag || !FORMAT_ELEMENTS.has(tag.element)) return null; const attribute = tag.attributes.find(a => (a.nameStart <= offset && offset < a.nameEnd) || (a.valueStart >= 0 && a.valueStart <= offset && offset < a.valueEnd)); if (!attribute) return null; const onName = offset < attribute.nameEnd; if (attribute.name === "type" || (attribute.name === "format" && tag.element !== "dataFormat")) { if (onName) return null; const format = attribute.name === "type" ? formats.find(f => sameType(f.type, attribute.value)) : formats.find(f => f.name !== undefined && f.name.toLowerCase() === attribute.value.toLowerCase()); return format ? describeFormat(format) : null; } if (!onName) return null; const option = formatOf(tag, formats, false)?.attributes?.find(a => a.name === attribute.name); if (!option) return null; return `**${option.name}** (${attributeDetail(option)})` + (option.description ? `\n\n${option.description}` : ""); } function attributeDetail(attribute: FormatAttribute): string { const kind = attribute.kind === "Enum" && attribute.enumValues ? attribute.enumValues.join(" | ") : attribute.kind; return attribute.default !== undefined ? `${kind}, default ${attribute.default}` : kind; } function describeFormat(format: DataFormatInfo): string { const lines = [format.name ? `Data format **${format.name}**` : "Data format", "", `\`${format.type}\``]; if (format.contentType) lines.push("", `Content type: ${format.contentType}`); const options = format.attributes ?? []; if (options.length > 0) lines.push("", `Options with \`type=\`: ${options.map(a => a.name).join(", ")}`); return lines.join("\n"); } /** * The module's `resources/` folder, the only part of the project folder `redb-route-xml pack` ships * besides the routes, `context.xml` and the config stubs. Paths are relative to that folder, with * '/' separators; `dirs` holds the folder itself as "". */ export interface ResourceTree { files: string[]; dirs: string[]; } /** * The Path options that name a directory, each relative to the directory of the file another option * of the same tag names: `schemaRoot=` is read from the schema's directory. */ const DIRECTORY_RELATIVE_TO: Readonly> = { schemaRoot: "schema" }; /** The resources folder name, which a reference may also spell out (`resources/order.xsd`). */ const RESOURCES_PREFIX = "resources/"; /** * Values for a Path option. A file option offers the files under `resources/` in the short form the * runtime reads first (`order.xsd` for `resources/order.xsd`). A directory option offers the folders * under `resources/` relative to the directory of the file it is read from (`common`, `..`), and * nothing while that file is not named, not under `resources/` or still a placeholder. */ function pathCompletions( tag: StartTag, option: FormatAttribute, replaceFrom: number, resources: () => ResourceTree | null): FormatCompletion[] { const tree = resources(); if (!tree) return []; const base = DIRECTORY_RELATIVE_TO[option.name]; if (base === undefined) return tree.files.map(file => ({ label: file, kind: "value", replaceFrom, detail: "resources/" + file })); const named = tag.attributes.find(a => a.name === base && a.valueStart >= 0)?.value.trim().replace(/\\/g, "/"); if (!named || named.includes("{{") || named.includes("${")) return []; const file = named.startsWith(RESOURCES_PREFIX) ? named.slice(RESOURCES_PREFIX.length) : named; if (!tree.files.includes(file)) return []; const from = file.includes("/") ? file.slice(0, file.lastIndexOf("/")) : ""; return tree.dirs.filter(dir => dir !== from).map(dir => ({ label: relativeDir(from, dir), kind: "value", replaceFrom, detail: "resources/" + dir + (dir === "" ? "" : "/"), })); } /** The path from one folder of the tree to another, both relative to its root, with '/' and '..'. */ function relativeDir(from: string, to: string): string { const a = from === "" ? [] : from.split("/"); const b = to === "" ? [] : to.split("/"); let common = 0; while (common < a.length && common < b.length && a[common] === b[common]) common++; return [...a.slice(common).map(() => ".."), ...b.slice(common)].join("/"); } Path: redb-route/vscode-redb-route/src/dotnetenv.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/dotnetenv.ts ---- /** * What the New Project page needs on the machine: a .NET SDK and the redb template packages * installed into the `dotnet new` engine, preferably the latest stable ones from nuget.org. The * parsing and comparing is pure and tested; the process and HTTP calls at the bottom are thin. */ import { execFile } from "child_process"; import * as fs from "fs"; import * as os from "os"; import { findTemplatePackage, InstalledTemplatePackage, parseTemplateRegistry, templateRegistryPath } from "./templates"; export interface InstalledSdk { version: string; major: number; } /** Reads `dotnet --list-sdks`: one "10.0.100 [C:\Program Files\dotnet\sdk]" per line. */ export function parseSdkList(output: string): InstalledSdk[] { const sdks: InstalledSdk[] = []; for (const line of output.split(/\r?\n/)) { const match = /^\s*((\d+)\.\d+\.\d+\S*)\s+\[/.exec(line); if (match) sdks.push({ version: match[1], major: Number(match[2]) }); } return sdks; } /** * Orders NuGet versions: numeric parts first, then a release above any of its prereleases, * prerelease labels compared part by part (numbers numerically). Build metadata is ignored. */ export function compareVersions(a: string, b: string): number { const [coreA, preA] = splitVersion(a); const [coreB, preB] = splitVersion(b); const length = Math.max(coreA.length, coreB.length); for (let i = 0; i < length; i++) { const difference = (coreA[i] ?? 0) - (coreB[i] ?? 0); if (difference !== 0) return Math.sign(difference); } if (preA === null || preB === null) return preA === preB ? 0 : preA === null ? 1 : -1; const partsA = preA.split("."); const partsB = preB.split("."); for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) { const x = partsA[i]; const y = partsB[i]; if (x === undefined || y === undefined) return x === undefined ? -1 : 1; const numeric = /^\d+$/.test(x) && /^\d+$/.test(y); const difference = numeric ? Number(x) - Number(y) : x.toLowerCase().localeCompare(y.toLowerCase()); if (difference !== 0) return Math.sign(difference); } return 0; } function splitVersion(version: string): [number[], string | null] { const withoutMetadata = version.split("+")[0]; const dash = withoutMetadata.indexOf("-"); const core = dash < 0 ? withoutMetadata : withoutMetadata.slice(0, dash); return [core.split(".").map(part => Number(part) || 0), dash < 0 ? null : withoutMetadata.slice(dash + 1)]; } /** The highest stable version in a NuGet flat-container index (`{"versions":[...]}`). */ export function latestStableVersion(indexJson: string): string | null { const versions = (JSON.parse(indexJson) as { versions?: unknown }).versions; if (!Array.isArray(versions)) return null; const stable = versions.filter((v): v is string => typeof v === "string" && !v.includes("-")); return stable.sort(compareVersions).at(-1) ?? null; } export type TemplateState = | { kind: "missing"; latest: string | null } | { kind: "outdated"; installed: InstalledTemplatePackage; latest: string } | { kind: "current"; installed: InstalledTemplatePackage }; /** * Where the installed templates stand against nuget.org. A folder installed from disk has no * version and counts as current: it is someone developing the templates. Without an answer from * nuget.org (offline) the installed package counts as current too. */ export function templateState(installed: InstalledTemplatePackage | null, latest: string | null): TemplateState { if (!installed) return { kind: "missing", latest }; if (latest && installed.version && compareVersions(installed.version, latest) < 0) return { kind: "outdated", installed, latest }; return { kind: "current", installed }; } /** * The `dotnet new install` arguments for a template package, pinned to a version when one is known. * `sdkMajor` is the major version of the SDK that runs the command (the highest installed one): SDK 9 and later * take `package@version` and SDK 10 warns that `::` is deprecated, while SDK 8 refuses `@` and knows only `::`. * An unknown SDK gets `::`, which every SDK accepts. */ export function templateInstallArguments(packageId: string, version: string | null, sdkMajor: number | null): string[] { if (!version) return ["new", "install", packageId]; const separator = sdkMajor !== null && sdkMajor >= 9 ? "@" : "::"; return ["new", "install", `${packageId}${separator}${version}`]; } /** The NuGet flat-container index of a package, listing its versions. */ export function nugetIndexUrl(packageId: string): string { return `https://api.nuget.org/v3-flatcontainer/${packageId.toLowerCase()}/index.json`; } // ── the machine ────────────────────────────────────────────────────── /** The installed SDKs, or null when `dotnet` is not on the PATH. */ export function installedSdks(): Promise { return new Promise(resolve => { execFile("dotnet", ["--list-sdks"], { windowsHide: true, timeout: 30_000 }, (error, stdout) => { if (error && (error as NodeJS.ErrnoException).code === "ENOENT") resolve(null); else resolve(parseSdkList(stdout ?? "")); }); }); } /** An installed template package from the engine's registry, or null when it is not installed. */ export function installedTemplatePackage(packageId: string): InstalledTemplatePackage | null { const registry = templateRegistryPath(process.env, os.homedir()); if (!fs.existsSync(registry)) return null; return findTemplatePackage(parseTemplateRegistry(fs.readFileSync(registry, "utf8")), packageId); } /** The latest stable version of a package on nuget.org, or null when it cannot be reached. */ export async function latestTemplateVersion(packageId: string): Promise { try { const response = await fetch(nugetIndexUrl(packageId), { signal: AbortSignal.timeout(10_000) }); return response.ok ? latestStableVersion(await response.text()) : null; } catch { return null; } } Path: redb-route/vscode-redb-route/src/elementposition.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/elementposition.ts ---- /** * Decides whether the offset is a NEW-ELEMENT position — where inserting a `` * skeleton makes sense: element content, or a half-typed element name right after `<`. * Inside a start tag (attribute position), a comment or CDATA the answer is no — that is * exactly where declarative snippets used to inject garbage (live finding, 2026-09-04). */ import { tagEnd } from "./tagscan"; export type ElementPosition = | { ok: true; /** offset of the `<` when the name is half-typed, else the offset itself. */ replaceFrom: number } | { ok: false }; export function elementPosition(text: string, offset: number): ElementPosition { const before = text.slice(0, offset); const commentStart = before.lastIndexOf("", commentStart) < 0) return { ok: false }; const cdataStart = before.lastIndexOf("= 0 && before.indexOf("]]>", cdataStart) < 0) return { ok: false }; const lastOpen = before.lastIndexOf("<"); if (lastOpen < 0 || tagEnd(before, lastOpen) >= 0) return { ok: true, replaceFrom: offset }; // element content, nothing half-typed // After an unclosed `<`: a pure element-name fragment means the user is typing the // element — offer skeletons replacing from the `<`. Anything else (whitespace reached, // attributes, quotes) is the inside of a tag. const fragment = before.slice(lastOpen + 1); return /^[A-Za-z_][\w.-]*$|^$/.test(fragment) ? { ok: true, replaceFrom: lastOpen } : { ok: false }; } Path: redb-route/vscode-redb-route/src/endpointuri.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/endpointuri.ts ---- /** * Raw, order-preserving endpoint-URI surgery for the properties panel: the panel decomposes * `kafka://orders?groupId=svc&brokers=…` into catalog-typed fields, and an edit rebuilds the * SAME uri with one parameter touched — no decoding, no reordering, `{{placeholders}}` * opaque. The rebuilt uri then rides the ordinary one-line attribute edit. */ export interface EndpointParam { name: string; value: string; } export interface ParsedEndpointUri { /** Everything before the first ':' — the scheme. */ scheme: string; /** Between scheme separator and '?' — kept verbatim (may hold {{placeholders}}). */ path: string; /** Whether the uri used `scheme://` (true) or bare `scheme:` (bean:, cron:). */ doubleSlash: boolean; params: EndpointParam[]; } export function parseEndpointUri(uri: string): ParsedEndpointUri | null { const colon = uri.indexOf(":"); if (colon <= 0) return null; const scheme = uri.slice(0, colon); let rest = uri.slice(colon + 1); const doubleSlash = rest.startsWith("//"); if (doubleSlash) rest = rest.slice(2); const question = rest.indexOf("?"); const path = question < 0 ? rest : rest.slice(0, question); const query = question < 0 ? "" : rest.slice(question + 1); const params: EndpointParam[] = []; if (query.length > 0) { for (const piece of query.split("&")) { const eq = piece.indexOf("="); params.push(eq < 0 ? { name: piece, value: "" } : { name: piece.slice(0, eq), value: piece.slice(eq + 1) }); } } return { scheme, path, doubleSlash, params }; } export function buildEndpointUri(parsed: ParsedEndpointUri): string { const head = parsed.scheme + ":" + (parsed.doubleSlash ? "//" : "") + parsed.path; if (parsed.params.length === 0) return head; return head + "?" + parsed.params.map(p => `${p.name}=${p.value}`).join("&"); } /** * Sets, replaces or removes (value === null) one query parameter — the name matched * case-insensitively (the options bind that way), the FILE's spelling and position kept for * an existing parameter, a new one appended with the given name. */ export function setUriOption(uri: string, name: string, value: string | null): string | null { const parsed = parseEndpointUri(uri); if (!parsed) return null; const index = parsed.params.findIndex(p => p.name.toLowerCase() === name.toLowerCase()); if (value === null) { if (index < 0) return uri; parsed.params.splice(index, 1); } else if (index >= 0) { if (parsed.params[index].value === value) return uri; parsed.params[index] = { name: parsed.params[index].name, value }; } else { parsed.params.push({ name, value }); } return buildEndpointUri(parsed); } /** Replaces the path part, everything else verbatim. */ export function setUriPath(uri: string, newPath: string): string | null { const parsed = parseEndpointUri(uri); if (!parsed) return null; parsed.path = newPath; return buildEndpointUri(parsed); } /** camelCase of a catalog option name — the spelling for a NEWLY added parameter. */ export function parameterSpelling(optionName: string): string { return optionName.length === 0 ? optionName : optionName[0].toLowerCase() + optionName.slice(1); } Path: redb-route/vscode-redb-route/src/extension.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/extension.ts ---- import * as vscode from "vscode"; import * as fs from "fs"; import * as path from "path"; import { execFile } from "child_process"; import { sniff } from "./sniff"; import { scanRoutes, RouteEntry } from "./routescan"; import { elementPosition } from "./elementposition"; import { skeletonsFor } from "./skeletons"; import { skeletonPlace } from "./skeletonscope"; import { beanCallPosition, beanCandidates, referencePosition, ReferencePosition, typedReferencePosition, } from "./beanref"; import { catalogByScheme, CatalogComponent, catalogReferenceHover, catalogReferencePosition, expectedType, } from "./catalog"; import { moduleContextText, moduleResources } from "./moduledir"; import { NewProjectPanel } from "./newprojectpanel"; import { buildIndex, ElementInfo, ElementIndex } from "./graphmodel"; import { DataFormatInfo, formatCompletions, formatHover } from "./dataformats"; import { RouteGraphEditorProvider } from "./grapheditor"; const FILE_GLOBS = ["**/*.route.xml", "**/*.redb-route.xml"]; /** * Ф7, text mode. Completion, validation and enum hints come from redhat.vscode-xml reading * our shipped XSD; the binding is NAMESPACE-driven through an XML catalog, so only documents * whose root says urn:redb:route get the schema — a foreign route.xml is untouched (the * activation contract, owner decision 2026-09-04). This extension adds the catalog, the * route tree, snippets and the Mermaid command. No canvas, no webview, no parser of the * format. */ export async function activate(context: vscode.ExtensionContext): Promise { await wireSchemaCatalog(context); // The generated element list, the same one the graph reads: the skeleton completion asks it // which element holds steps (skeletonscope.ts), so the answer cannot drift from the schema. const elements: ElementInfo[] = JSON.parse(fs.readFileSync( context.asAbsolutePath(path.join("media", "redb-route-elements.json")), "utf8")); // The data formats of the same generator run: names, type names and the options of each. const formats: DataFormatInfo[] = JSON.parse(fs.readFileSync( context.asAbsolutePath(path.join("media", "redb-route-dataformats.json")), "utf8")); // The connector catalog: the options that name a registry object get the bean list (catalog.ts). const catalog = catalogByScheme(JSON.parse(fs.readFileSync( context.asAbsolutePath(path.join("media", "redb-route-catalog.json")), "utf8")) as CatalogComponent[]); const index = buildIndex(elements); const tree = new RouteTreeProvider(); const output = vscode.window.createOutputChannel("redb Route"); context.subscriptions.push( output, vscode.commands.registerCommand("redbRoute.newProject", () => NewProjectPanel.show(context, output)), vscode.window.registerTreeDataProvider("redbRoutes", tree), vscode.commands.registerCommand("redbRoute.refreshTree", () => tree.refresh()), vscode.commands.registerCommand("redbRoute.open", openAtLine), vscode.commands.registerCommand("redbRoute.showMermaid", showMermaid), vscode.languages.registerCompletionItemProvider( "xml", new SkeletonCompletionProvider(index), "<"), vscode.languages.registerCompletionItemProvider( "xml", new BeanReferenceCompletionProvider(index, catalog), "#", ":", "=", "\"", "'"), vscode.languages.registerCompletionItemProvider( "xml", new DataFormatCompletionProvider(formats), "\"", "'", " ", "/"), vscode.languages.registerHoverProvider("xml", new DataFormatHoverProvider(formats)), vscode.languages.registerHoverProvider("xml", new CatalogReferenceHoverProvider(catalog)), RouteGraphEditorProvider.register(context), vscode.commands.registerCommand("redbRoute.openGraph", async (uri?: vscode.Uri) => { const target = uri ?? vscode.window.activeTextEditor?.document.uri; if (target) await vscode.commands.executeCommand("vscode.openWith", target, RouteGraphEditorProvider.viewType); }), ); for (const glob of FILE_GLOBS) { const watcher = vscode.workspace.createFileSystemWatcher(glob); context.subscriptions.push(watcher, watcher.onDidChange(() => tree.refresh()), watcher.onDidCreate(() => tree.refresh()), watcher.onDidDelete(() => tree.refresh())); } await tree.refresh(); } /** * Registers the shipped XML catalog with redhat.vscode-xml — its extension API when present, * the user setting as the fallback. The catalog binds the NAMESPACE to the XSD (see * media/catalog.xml), which is the whole point: no file-pattern association anywhere. */ async function wireSchemaCatalog(context: vscode.ExtensionContext): Promise { const catalogPath = context.asAbsolutePath(path.join("media", "catalog.xml")); const xmlExtension = vscode.extensions.getExtension("redhat.vscode-xml"); if (xmlExtension) { const api = await xmlExtension.activate(); if (api && typeof api.addXMLCatalogs === "function") { api.addXMLCatalogs([catalogPath]); return; } } // Older vscode-xml without the API: merge into the user's xml.catalogs once. const configuration = vscode.workspace.getConfiguration("xml"); const catalogs = configuration.get("catalogs") ?? []; if (!catalogs.includes(catalogPath)) { await configuration.update("catalogs", [...catalogs, catalogPath], vscode.ConfigurationTarget.Global); } } // ── composite skeletons (our completion provider, not declarative snippets) ── /** * Declarative snippets appear in EVERY completion list — attribute positions included, any * XML file included (live finding, 2026-09-04). This provider serves the skeletons only in * OUR documents (the sniff) and only at a new-element position. */ class SkeletonCompletionProvider implements vscode.CompletionItemProvider { constructor(private readonly index: ElementIndex) {} provideCompletionItems( document: vscode.TextDocument, position: vscode.Position): vscode.CompletionItem[] { const text = document.getText(); if (sniff(text)?.kind !== "routes") return []; const where = elementPosition(text, document.offsetAt(position)); if (!where.ok) return []; // Only what the position takes: a `` beside the routes, a step skeleton inside an // element that holds steps. Offering the whole list here is how `` used to appear // under ``, where the loader refuses it (skeletonscope.ts). const place = skeletonPlace(text, where.replaceFrom, this.index); if (!place) return []; const range = new vscode.Range(document.positionAt(where.replaceFrom), position); return skeletonsFor(place).map(skeleton => { const item = new vscode.CompletionItem( skeleton.label, vscode.CompletionItemKind.Snippet); item.detail = skeleton.detail; item.insertText = new vscode.SnippetString(skeleton.body); item.range = range; return item; }); } } // ── registry references: `#` and the bean calls of expressions offer the declared beans ── /** * The `` values at a registry-reference position (beanref.ts): the document's own, then * those of its module's `context.xml` (moduledir.ts), where the templates declare them. An attribute * the element list types as a reference gets them before the `#` too, inserted with it; a bean call of * the expression language (`${bean:` in a template, a bare `bean:` in an expression) gets them as the * name before its `.`, a registry read (`${ref:`, bare `ref:`) as its whole name. No type * filter and no diagnostics: a wrong or missing bean is the pack gate's finding. */ class BeanReferenceCompletionProvider implements vscode.CompletionItemProvider { constructor( private readonly index: ElementIndex, private readonly catalog: ReadonlyMap) {} provideCompletionItems( document: vscode.TextDocument, position: vscode.Position): vscode.CompletionItem[] { const text = document.getText(); if (!sniff(text)) return []; const offset = document.offsetAt(position); let prefix = ""; let expected: string | null = null; let where: ReferencePosition = { ok: false }; // A component option the catalog marks as a reference: before or after its '#', with the // expected type in the detail. Everything else goes by the '#' rule and the element list. const option = catalogReferencePosition(text, offset, this.catalog); if (option) { where = { ok: true, replaceFrom: option.replaceFrom }; prefix = option.hashTyped ? "" : "#"; expected = expectedType(option.option); } if (!where.ok) where = referencePosition(text, offset); if (!where.ok) where = beanCallPosition(text, offset, this.index); if (!where.ok) { where = typedReferencePosition(text, offset, this.index); prefix = "#"; } if (!where.ok) return []; const contextText = document.uri.scheme === "file" ? moduleContextText(document.uri.fsPath, openDocumentText) : null; const range = new vscode.Range(document.positionAt(where.replaceFrom), position); return beanCandidates(text, contextText).map(candidate => { const item = new vscode.CompletionItem(prefix + candidate.name, vscode.CompletionItemKind.Reference); item.detail = (candidate.fromContext ? " of context.xml" : " of this document") + (expected ? `, expects ${expected}` : ""); item.filterText = candidate.name; item.range = range; return item; }); } } // ── data formats: names, type names and options of ``, ``, `` ── /** * The hints of dataformats.ts in redb documents: `format=` names, `type=` type names, `target=` of * ``, once `type=` names a format its options with their values, and for a Path option the * files and folders of the module's `resources/` (moduledir.ts). */ class DataFormatCompletionProvider implements vscode.CompletionItemProvider { constructor(private readonly formats: readonly DataFormatInfo[]) {} provideCompletionItems( document: vscode.TextDocument, position: vscode.Position): vscode.CompletionItem[] { const text = document.getText(); if (!sniff(text)) return []; const resources = () => document.uri.scheme === "file" ? moduleResources(document.uri.fsPath) : null; return formatCompletions(text, document.offsetAt(position), this.formats, resources).map(completion => { const item = new vscode.CompletionItem(completion.label, completion.kind === "attribute" ? vscode.CompletionItemKind.Property : vscode.CompletionItemKind.Value); item.detail = completion.detail; if (completion.documentation) item.documentation = new vscode.MarkdownString(completion.documentation); item.range = new vscode.Range(document.positionAt(completion.replaceFrom), position); if (completion.kind === "attribute") item.insertText = new vscode.SnippetString(`${completion.label}="$1"`); return item; }); } } class DataFormatHoverProvider implements vscode.HoverProvider { constructor(private readonly formats: readonly DataFormatInfo[]) {} provideHover(document: vscode.TextDocument, position: vscode.Position): vscode.Hover | null { const text = document.getText(); if (!sniff(text)) return null; const hover = formatHover(text, document.offsetAt(position), this.formats); return hover ? new vscode.Hover(new vscode.MarkdownString(hover)) : null; } } /** The hover of a component option the catalog marks as a registry reference, with its expected type. */ class CatalogReferenceHoverProvider implements vscode.HoverProvider { constructor(private readonly catalog: ReadonlyMap) {} provideHover(document: vscode.TextDocument, position: vscode.Position): vscode.Hover | null { const text = document.getText(); if (!sniff(text)) return null; const hover = catalogReferenceHover(text, document.offsetAt(position), this.catalog); return hover ? new vscode.Hover(new vscode.MarkdownString(hover)) : null; } } /** The text of a file open in an editor, unsaved edits included. */ function openDocumentText(file: string): string | undefined { const target = vscode.Uri.file(file).toString(); return vscode.workspace.textDocuments.find(d => d.uri.toString() === target)?.getText(); } // ── the route tree ─────────────────────────────────────────────────── type TreeNode = | { kind: "file"; uri: vscode.Uri; routes: RouteEntry[] } | { kind: "route"; uri: vscode.Uri; entry: RouteEntry }; class RouteTreeProvider implements vscode.TreeDataProvider { private readonly changed = new vscode.EventEmitter(); readonly onDidChangeTreeData = this.changed.event; private files: { uri: vscode.Uri; routes: RouteEntry[] }[] = []; async refresh(): Promise { const found = new Map(); for (const glob of FILE_GLOBS) for (const uri of await vscode.workspace.findFiles(glob, "**/{node_modules,bin,obj}/**")) found.set(uri.toString(), uri); const files: { uri: vscode.Uri; routes: RouteEntry[] }[] = []; for (const uri of found.values()) { const text = Buffer.from(await vscode.workspace.fs.readFile(uri)).toString("utf8"); // The negative half of the activation contract: a file that does not carry our // namespace — someone else's route.xml — never enters the tree. if (sniff(text)?.kind !== "routes") continue; files.push({ uri, routes: scanRoutes(text) }); } files.sort((a, b) => a.uri.fsPath.localeCompare(b.uri.fsPath)); this.files = files; await vscode.commands.executeCommand( "setContext", "redbRoute.hasRoutes", files.length > 0); this.changed.fire(); } getTreeItem(node: TreeNode): vscode.TreeItem { if (node.kind === "file") { const item = new vscode.TreeItem( path.basename(node.uri.fsPath), vscode.TreeItemCollapsibleState.Expanded); item.resourceUri = node.uri; item.description = vscode.workspace.asRelativePath(path.dirname(node.uri.fsPath)); item.iconPath = vscode.ThemeIcon.File; return item; } const item = new vscode.TreeItem( node.entry.id ?? "(no id)", vscode.TreeItemCollapsibleState.None); item.description = node.entry.from ?? ""; item.tooltip = node.entry.description ?? undefined; item.iconPath = new vscode.ThemeIcon("symbol-event"); item.command = { command: "redbRoute.open", title: "Open route", arguments: [node.uri, node.entry.line], }; return item; } getChildren(node?: TreeNode): TreeNode[] { if (!node) return this.files.map(f => ({ kind: "file", uri: f.uri, routes: f.routes })); if (node.kind === "file") return node.routes.map(entry => ({ kind: "route", uri: node.uri, entry })); return []; } } async function openAtLine(uri: vscode.Uri, line: number): Promise { const document = await vscode.workspace.openTextDocument(uri); const editor = await vscode.window.showTextDocument(document); const position = new vscode.Position(line, 0); editor.selection = new vscode.Selection(position, position); editor.revealRange(new vscode.Range(position, position), vscode.TextEditorRevealType.InCenter); } // ── Mermaid via the Ф6 generator, when the dotnet tool is around ───── async function showMermaid(): Promise { const editor = vscode.window.activeTextEditor; if (!editor || sniff(editor.document.getText())?.kind !== "routes") { void vscode.window.showInformationMessage( "redb Route: open a routes document (urn:redb:route) first."); return; } if (editor.document.isDirty) await editor.document.save(); // No shell on purpose: a dotnet global tool is a plain executable shim, and only a // shell-less spawn reports a missing tool as ENOENT (through a shell it is exit code 1 // plus a CP866 complaint on Windows — mojibake in the warning, live finding 2026-09-08). execFile("redb-route-xml", ["mermaid", editor.document.uri.fsPath], async (error, stdout, stderr) => { if (error) { const notFound = (error as NodeJS.ErrnoException).code === "ENOENT"; void vscode.window.showWarningMessage(notFound ? "redb Route: install the generator to render diagrams: dotnet tool install -g redb.Route.Xml.CodeGen" : `redb Route: the generator failed: ${stderr || error.message}`); return; } const document = await vscode.workspace.openTextDocument({ content: stdout, language: "markdown" }); await vscode.window.showTextDocument(document, { preview: true }); }); } export function deactivate(): void { /* nothing to release */ } Path: redb-route/vscode-redb-route/src/grapheditor.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/grapheditor.ts ---- import * as vscode from "vscode"; import * as fs from "fs"; import * as path from "path"; import { sniff } from "./sniff"; import { parseXml, XmlParseError, XmlElement, childElements, textContent } from "./xmlmodel"; import { buildFileGraph, buildIndex, ElementInfo, ElementIndex, redactUri } from "./graphmodel"; import { computeSetAttribute, computeSetTextContent, computeRemoveElement, computeInsertChild, computeRenameElement, computeInsertAt, computeMoveElement, computeRemoveBlock, resolveByPath, ElementPath, } from "./textedit"; import { buildPalette } from "./palette"; import { parseEndpointUri, setUriOption, setUriPath, parameterSpelling } from "./endpointuri"; import { ConfigMap, mergeContextLayer, moduleContextName, packageName, resolvePlaceholders, } from "./placeholders"; import { UriResolver } from "./graphmodel"; import { findModuleDir } from "./moduledir"; import { catalogByScheme, CatalogComponent } from "./catalog"; /** One row of the properties panel (§8). */ interface PropField { name: string; type: string; required: boolean; enumValues: string[] | null; /** Redacted when secret. */ value: string | null; /** A secret value is shown masked and not editable through the panel (§8). */ secret: boolean; /** Declared by the spec (false = present in the file but unknown to it). */ declared: boolean; } interface PropsPayload { path: ElementPath; type: string; span: { start: number; end: number }; fields: PropField[]; /** For uri-carrying nodes: the endpoint decomposed by the Ф4 catalog. */ endpoint: { scheme: string; path: string; /** The scheme's catalog options merged with the uri's actual parameters. */ options: PropField[]; } | null; /** Config children of a rich element (log message/header/property) — editable rows. */ content: ContentRow[]; /** Child element names the spec allows to ADD (log → message/header/property). */ addable: string[]; } interface ContentRow { path: ElementPath; type: string; /** The element's text content, when its spec allows text (message) — editable. */ text: string | null; /** The name attribute, when the child carries one (header/property) — editable. */ name: string | null; /** * The assigned value of a setter row (``): which attribute * carries it — a constant or an expression — and its text. Null for other children. */ value: { attr: "value" | "expr"; text: string } | null; /** Neither text nor name — shown as-is, edited in text. */ opaque: string | null; } /** * Ф8 §8.1: the text is the truth, the graph is a projection. A CustomTextEditorProvider over * the SAME text document — undo history and dirty state are the text editor's own; the * webview holds no document state. Такт 1 scope: render + cursor↔node sync; editing lands in * the following тактs as surgical text edits. */ export class RouteGraphEditorProvider implements vscode.CustomTextEditorProvider { static readonly viewType = "redbRoute.graph"; private readonly index: ElementIndex; private readonly catalog: Map; constructor(private readonly context: vscode.ExtensionContext) { const elements: ElementInfo[] = JSON.parse(fs.readFileSync( context.asAbsolutePath(path.join("media", "redb-route-elements.json")), "utf8")); this.index = buildIndex(elements); const components: CatalogComponent[] = JSON.parse(fs.readFileSync( context.asAbsolutePath(path.join("media", "redb-route-catalog.json")), "utf8")); this.catalog = catalogByScheme(components); } /** * §8: the placeholder is shown together with its resolved value, read the way the Tsak * runtime fills the context properties from a module's files. The module is the nearest * folder with a .csproj above the route document; its config/context.sample.json (deployed * as context.json) and over it its config/.config.json are each read by their * Contexts section for the module's context, or by their root keys without one. The host's appsettings and * environment are not visible here, so a key that only they provide shows unresolved. */ private loadConfig(documentPath: string): { config: ConfigMap; sources: string[] } { const config: ConfigMap = new Map(); const sources: string[] = []; const moduleDir = findModuleDir(path.dirname(documentPath)); if (!moduleDir) return { config, sources }; const readJson = (file: string): unknown => { if (!fs.existsSync(file)) return undefined; try { const json: unknown = JSON.parse(fs.readFileSync(file, "utf8")); sources.push(path.relative(moduleDir.dir, file)); return json; } catch { return undefined; // not JSON: the view just resolves less } }; const csprojText = fs.readFileSync(path.join(moduleDir.dir, moduleDir.csproj), "utf8"); const pkg = packageName(moduleDir.csproj, csprojText); const moduleConfig = readJson(path.join(moduleDir.dir, "config", `${pkg}.config.json`)); const contextFile = readJson(path.join(moduleDir.dir, "config", "context.sample.json")); const contextName = moduleContextName(moduleConfig, csprojText, pkg); mergeContextLayer(contextFile, contextName, config); mergeContextLayer(moduleConfig, contextName, config); return { config, sources }; } static register(context: vscode.ExtensionContext): vscode.Disposable { return vscode.window.registerCustomEditorProvider( RouteGraphEditorProvider.viewType, new RouteGraphEditorProvider(context), { webviewOptions: { retainContextWhenHidden: true } }); } resolveCustomTextEditor( document: vscode.TextDocument, panel: vscode.WebviewPanel): void { panel.webview.options = { enableScripts: true, localResourceRoots: [vscode.Uri.joinPath(this.context.extensionUri, "media")], }; panel.webview.html = this.shell(panel.webview); panel.webview.postMessage({ type: "palette", palette: buildPalette( [...this.index.values()], [...new Set(this.catalog.values())].map(c => ({ scheme: c.scheme, pathSynonym: c.pathSynonym, role: c.role }))), }); // §4: collapsed-ness belongs to the VIEWER, not the file (Р5) — the explicit toggles // live in workspaceState per document; the defaults (deep nodes fold) are computed in // the webview. const collapseKey = `redbRoute.collapse:${document.uri.toString()}`; const collapseState = (): string[] => this.context.workspaceState.get(collapseKey) ?? []; // The layout mode (the snake left to right, the columns top down) is the viewer's choice // per document, workspaceState like the collapse (Р5). const layoutKey = `redbRoute.layout:${document.uri.toString()}`; const layoutState = (): string => this.context.workspaceState.get(layoutKey) ?? "snake-mermaid"; // The zoom factor is the viewer's choice per document, same as the layout. const zoomKey = `redbRoute.zoom:${document.uri.toString()}`; const zoomState = (): number => this.context.workspaceState.get(zoomKey) ?? 1; // The tile look (glyph over or beside the caption) is one choice for all documents. const tileStyleKey = "redbRoute.tileStyle"; const tileStyleState = (): string => this.context.globalState.get(tileStyleKey) ?? "stacked"; // The properties panel width, dragged by its left edge — one choice for all documents. const panelWidthKey = "redbRoute.panelWidth"; const panelWidthState = (): number => this.context.globalState.get(panelWidthKey) ?? 380; // Config files change rarely; one read per couple of seconds, not per node. let cachedConfig: ConfigMap | null = null; let cachedAt = 0; const resolver: UriResolver = uri => { if (!cachedConfig || Date.now() - cachedAt > 2000) { cachedConfig = this.loadConfig(document.uri.fsPath).config; cachedAt = Date.now(); } const { resolved, fromConfig } = resolvePlaceholders(uri, cachedConfig); return { resolved, fromConfig }; }; const render = (): void => { const text = document.getText(); if (sniff(text)?.kind !== "routes") { panel.webview.postMessage({ type: "foreign" }); return; } try { const graph = buildFileGraph(parseXml(text).root, this.index, resolver); panel.webview.postMessage({ type: "graph", graph, toggled: collapseState(), layout: layoutState(), zoom: zoomState(), tileStyle: tileStyleState(), panelWidth: panelWidthState(), }); } catch (error) { if (error instanceof XmlParseError) { const position = document.positionAt(error.offset); panel.webview.postMessage({ type: "broken", message: error.message, line: position.line + 1, }); return; } throw error; } }; // §8.6: outside text changes redraw the projection; full redraw, no increments. let pending: NodeJS.Timeout | undefined; const changed = vscode.workspace.onDidChangeTextDocument(e => { if (e.document.uri.toString() !== document.uri.toString()) return; clearTimeout(pending); pending = setTimeout(render, 120); }); const postProps = (path: ElementPath): void => { const props = this.buildProps(document.getText(), path, resolver); if (props) panel.webview.postMessage({ type: "props", props }); }; const applyReplacementEdit = async (replacement: { start: number; end: number; newText: string } | null): Promise => { if (!replacement) return; const edit = new vscode.WorkspaceEdit(); edit.replace(document.uri, new vscode.Range( document.positionAt(replacement.start), document.positionAt(replacement.end)), replacement.newText); await vscode.workspace.applyEdit(edit); }; const messages = panel.webview.onDidReceiveMessage(async message => { if (message.type === "select") postProps(message.path); if (message.type === "setLayout") await this.context.workspaceState.update(layoutKey, message.layout); if (message.type === "setZoom") await this.context.workspaceState.update(zoomKey, message.zoom); if (message.type === "setPanelWidth" && typeof message.width === "number") await this.context.globalState.update(panelWidthKey, message.width); if (message.type === "setTileStyle") await this.context.globalState.update(tileStyleKey, message.tileStyle); if (message.type === "setCollapsed" && Array.isArray(message.keys)) await this.context.workspaceState.update(collapseKey, message.keys.filter((k: unknown) => typeof k === "string")); if (message.type === "toggleCollapse") { const current = new Set(collapseState()); if (current.has(message.key)) current.delete(message.key); else current.add(message.key); await this.context.workspaceState.update(collapseKey, [...current]); } if (message.type === "insertStep") { await applyReplacementEdit(computeInsertAt( document.getText(), message.parentPath, message.before, message.fragment)); } if (message.type === "removeStep") await applyReplacementEdit(computeRemoveBlock(document.getText(), message.path)); if (message.type === "renameElement" && typeof message.name === "string") { // A joined setter row switched between property and header: the element's tag. await applyReplacementEdit(computeRenameElement(document.getText(), message.path, message.name)); } if (message.type === "removeSteps" && Array.isArray(message.paths)) { // A run of siblings (a joined `set ×N` tile): removed bottom up, so the paths of // the rows still to remove keep pointing at their elements. const paths = [...(message.paths as ElementPath[])].sort((a, b) => b[b.length - 1] - a[a.length - 1]); for (const path of paths) await applyReplacementEdit(computeRemoveBlock(document.getText(), path)); } if (message.type === "moveStep") { const edits = computeMoveElement( document.getText(), message.fromPath, message.toParentPath, message.before); if (edits) { const edit = new vscode.WorkspaceEdit(); for (const replacement of edits) edit.replace(document.uri, new vscode.Range( document.positionAt(replacement.start), document.positionAt(replacement.end)), replacement.newText); await vscode.workspace.applyEdit(edit); } } if (message.type === "setChildText") { await applyReplacementEdit(computeSetTextContent( document.getText(), message.path, message.value ?? "")); postProps(message.path.slice(0, -1)); } if (message.type === "removeChild") { await applyReplacementEdit(computeRemoveElement(document.getText(), message.path)); postProps(message.path.slice(0, -1)); } if (message.type === "addChild") { const parent = resolveByPath(parseXml(document.getText()).root, message.path); const parentInfo = parent && parent.prefix === null ? this.index.get(parent.local) : undefined; await applyReplacementEdit(computeInsertChild( document.getText(), message.path, this.childFragment(parentInfo, message.childName))); postProps(message.path); } if (message.type === "setUriOption" || message.type === "setUriPath") { // Endpoint-option edit: rebuild the uri (order preserved, one parameter // touched) and ride the ordinary one-line attribute edit. const element = resolveByPath(parseXml(document.getText()).root, message.path); const uri = element?.attributes.find(a => a.name === "uri")?.value; if (element && uri !== undefined) { const rebuilt = message.type === "setUriPath" ? setUriPath(uri, message.value ?? "") : setUriOption(uri, message.existing ? message.name : parameterSpelling(message.name), message.value); if (rebuilt !== null && rebuilt !== uri) { const replacement = computeSetAttribute( document.getText(), message.path, "uri", rebuilt); if (replacement) { const edit = new vscode.WorkspaceEdit(); edit.replace(document.uri, new vscode.Range( document.positionAt(replacement.start), document.positionAt(replacement.end)), replacement.newText); await vscode.workspace.applyEdit(edit); } } } postProps(message.path); } if (message.type === "setAttr") { const replacement = computeSetAttribute( document.getText(), message.path, message.name, message.value); if (replacement) { const edit = new vscode.WorkspaceEdit(); edit.replace(document.uri, new vscode.Range( document.positionAt(replacement.start), document.positionAt(replacement.end)), replacement.newText); await vscode.workspace.applyEdit(edit); } // A setter row switched constant <-> expression: the other attribute goes, in // the same turn and on the text the first edit left. if (typeof message.removeAttr === "string") { const removal = computeSetAttribute(document.getText(), message.path, message.removeAttr, null); if (removal) { const edit = new vscode.WorkspaceEdit(); edit.replace(document.uri, new vscode.Range(document.positionAt(removal.start), document.positionAt(removal.end)), removal.newText); await vscode.workspace.applyEdit(edit); } } // refreshed values, same node — a content row edits a child but shows its parent; // a joined run's panel is rebuilt by the webview itself (refresh: false) if (message.refresh !== false) postProps(message.refresh ?? message.path); } if (message.type === "reveal") { // Node click → the exact spot in the text, side by side. const editor = await vscode.window.showTextDocument(document, { viewColumn: vscode.ViewColumn.Beside, preserveFocus: false, preview: true }); const start = document.positionAt(message.start); editor.selection = new vscode.Selection(start, start); editor.revealRange( new vscode.Range(start, document.positionAt(message.end)), vscode.TextEditorRevealType.InCenter); } if (message.type === "openAsText") await vscode.commands.executeCommand("workbench.action.reopenTextEditor", document.uri); }); panel.onDidDispose(() => { clearTimeout(pending); changed.dispose(); messages.dispose(); }); render(); } /** * The §8 panel content: id and description first, then the spec's attributes with types, * enums and required flags, then whatever else the file carries (unknown to the spec — * editable as plain strings). A secret-bearing value is masked and locked: the panel * never shows it and never rewrites it (edit those in text). */ private buildProps(text: string, path: ElementPath, resolver?: UriResolver): PropsPayload | null { let element: XmlElement | null; try { element = resolveByPath(parseXml(text).root, path); } catch { return null; // mid-edit broken document — the panel just waits } if (!element) return null; const info = element.prefix === null ? this.index.get(element.local) : undefined; const fields: PropField[] = []; const seen = new Set(); const push = (name: string, type: string, required: boolean, enumValues: string[] | null, declared: boolean): void => { if (seen.has(name)) return; seen.add(name); const raw = element!.attributes.find(a => a.name === name)?.value ?? null; const secret = raw !== null && redactUri(raw) !== raw; fields.push({ name, type, required, enumValues, value: raw === null ? null : (secret ? redactUri(raw) : raw), secret, declared, }); }; push("id", "String", false, null, true); push("description", "String", false, null, true); // `from` is parsed by the loader itself, not a registry contribution — its uri is // declared here so the consumer's endpoint reads as first-class, not italic. if (element.local === "from" && element.prefix === null) push("uri", "Uri", true, null, true); for (const spec of info?.attributes ?? []) push(spec.name, spec.type, spec.required ?? false, spec.enumValues ?? null, true); for (const present of element.attributes) push(present.name, "String", false, null, info !== undefined ? false : true); return { path, type: element.prefix === null ? element.local : element.name, span: { start: element.span.start, end: element.span.end }, fields, endpoint: this.buildEndpointFields(element, resolver), // The element's own configuration children only (header/property rows, a log's // message…). Steps nested in a branch or a container are steps of the graph, shown // and edited as tiles — never as blank text rows here. content: childElements(element).flatMap((child, i): ContentRow[] => { const declared = info?.children?.some(c => c.name === child.local) ?? false; const stepKind = this.index.get(child.local)?.kind; if (!declared && child.prefix === null && (stepKind === "Step" || stepKind === "Scope" || stepKind === "Branching")) return []; return [contentRowOf(child, i)]; }), addable: (info?.children ?? []).map(c => c.name), }; function contentRowOf(child: XmlElement, i: number): ContentRow { const childSpec = info?.children?.find(c => c.name === child.local); const childPath = [...path, i]; if (childSpec?.allowsText || (childSpec === undefined && child.attributes.length === 0)) { return { path: childPath, type: child.local, text: redactUri(textContent(child)), name: null, value: null, opaque: null }; } if (child.attributes.some(a => a.name === "name")) { const assigns = childSpec?.attributes.some(a => a.name === "value") && childSpec.attributes.some(a => a.name === "expr"); const expr = child.attributes.find(a => a.name === "expr"); return { path: childPath, type: child.local, text: null, name: child.attributes.find(a => a.name === "name")!.value, value: assigns ? expr ? { attr: "expr", text: expr.value } : { attr: "value", text: child.attributes.find(a => a.name === "value")?.value ?? "" } : null, opaque: null, }; } const bits = child.attributes.map(a => `${a.name}="${redactUri(a.value)}"`).join(" "); return { path: childPath, type: child.local, text: null, name: null, value: null, opaque: `<${child.name}${bits ? " " + bits : ""}>` }; } } /** The insertable fragment for one child kind: text-bearing gets a body, named gets name="". */ private childFragment(parentInfo: ElementInfo | undefined, childName: string): string { const spec = parentInfo?.children?.find(c => c.name === childName); if (spec?.allowsText) return `<${childName}>`; if (spec?.attributes?.some(a => a.name === "name")) return `<${childName} name=""/>`; return `<${childName}/>`; } /** The uri decomposed by the Ф4 catalog: scheme, path, typed options + actual parameters. */ private buildEndpointFields(element: XmlElement, resolver?: UriResolver): PropsPayload["endpoint"] { const uri = element.attributes.find(a => a.name === "uri")?.value; if (!uri) return null; let parsed = parseEndpointUri(uri); let viaConfig = false; if (!parsed && uri.includes("{{") && resolver) { // A pure-placeholder uri: decompose the RESOLVED value for the eye — read-only, // because what gets edited is the placeholder, never the value (Р18). const { resolved, fromConfig } = resolver(uri); if (fromConfig) { parsed = parseEndpointUri(resolved); viaConfig = true; } } if (!parsed) { return uri.includes("{{") ? { scheme: "{{config}}", path: redactUri(uri), options: [] } : null; } const component = this.catalog.get(parsed.scheme.toLowerCase()); const options: PropField[] = []; const seen = new Set(); for (const option of component?.options ?? []) { const actual = parsed.params.find(p => p.name.toLowerCase() === option.name.toLowerCase()); if (actual) seen.add(actual.name.toLowerCase()); const secret = option.sensitive || (actual !== undefined && redactUri(`x://x?${actual.name}=${actual.value}`).includes("***")); options.push({ name: option.name, type: option.type, required: false, // A flags option takes several members ("Tls12,Tls13"): a text field, not a pick-one list. enumValues: option.type === "flags" ? null : option.enumValues ?? (option.type === "bool" ? ["true", "false"] : null), value: actual === undefined ? null : (secret ? "***" : actual.value), secret, declared: true, }); } for (const param of parsed.params) { if (seen.has(param.name.toLowerCase())) continue; const secret = redactUri(`x://x?${param.name}=${param.value}`).includes("***"); options.push({ name: param.name, type: "string", required: false, enumValues: null, value: secret ? "***" : param.value, secret, declared: false, }); } // The set options first — what the uri actually says is what the eye needs; the // catalog's remaining knobs follow alphabetically. options.sort((a, b) => (a.value === null ? 1 : 0) - (b.value === null ? 1 : 0) || a.name.localeCompare(b.name)); if (viaConfig) { // The whole decomposition came from config: show it, lock it (Р18 - edit the // placeholder in the uri field, or the config file itself). for (const option of options) option.secret = true; return { scheme: parsed.scheme + " · via {{config}}", path: parsed.path, options: options.filter(o => o.value !== null), }; } return { scheme: parsed.scheme, path: parsed.path, options }; } private shell(webview: vscode.Webview): string { const css = webview.asWebviewUri( vscode.Uri.joinPath(this.context.extensionUri, "media", "graph.css")); const js = webview.asWebviewUri( vscode.Uri.joinPath(this.context.extensionUri, "media", "graph.js")); const nonce = Math.random().toString(36).slice(2); return `
`; } } Path: redb-route/vscode-redb-route/src/graphmodel.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/graphmodel.ts ---- /** * XML tree → the render tree of 09-UX §3: a horizontal main line, branches only where the * flow really branches, scopes as brackets over their stretch, the unknown as an opaque node * that survives byte-for-byte. Pure projection — nothing here mutates the document. */ import { XmlElement, attr, childElements, textContent, Span } from "./xmlmodel"; import { Category, categoryOf, endpointCategory } from "./category"; export interface ElementInfo { name: string; kind: "Step" | "Scope" | "Branching" | "TopLevel" | "ContextLevel"; attributes: { name: string; type: string; required?: boolean; enumValues?: string[] }[]; children?: ElementInfo[]; allowsText?: boolean; /** Whether the element may hold steps — what the skeleton completion reads (skeletonscope.ts). */ allowsSteps?: boolean; takesEndpoint?: boolean; } /** The generated element list (media/redb-route-elements.json), indexed by name. */ export type ElementIndex = Map; export function buildIndex(elements: ElementInfo[]): ElementIndex { return new Map(elements.map(e => [e.name, e])); } // ── the render tree ────────────────────────────────────────────────── export type StepView = LeafView | ScopeView | BranchingView | UnknownView; export interface LeafView { kind: "leaf"; path: number[]; type: string; category: Category; /** ≤ ~14 chars, secrets redacted. */ label: string; /** Full text for the tooltip — secrets redacted the same way. */ tooltip: string; /** * The transport of an endpoint step (`from`, `to`, `wireTap`, `enrich`…): the URI scheme * (`bean`, `http`, `kafka`) or the structural child (`` → `sql`). The tile shows it * instead of the element name. Null for every other step. */ scheme: string | null; /** * A single assignment (`setProperty` / `setHeader`): its name and value, so the graph can * show a run of them as one tile with rows. Null for every other step. */ assign: { name: string; attr: "value" | "expr"; text: string } | null; /** The attributes as written, secrets redacted — what a conditional path reads (throwOnFailure…). */ attrs: Record; id: string | null; span: Span; } export interface ScopeView { kind: "scope"; path: number[]; type: string; category: Category; /** The bracket's header: condition or main parameter. */ label: string; tooltip: string; /** §3.5: split repeats its one body per element. */ repeats: boolean; parallel: boolean; /** The attributes as written, secrets redacted — what a conditional path reads (skipDuplicate…). */ attrs: Record; id: string | null; steps: StepView[]; span: Span; } export interface BranchView { path: number[]; /** `when ${…}` / `otherwise` / `catch X` / `finally` / plain index for multicast. */ label: string; /** The same text uncapped: the label is cut to keep a stack of branches readable, the tooltip is not. */ tooltip: string; warn: boolean; steps: StepView[]; span: Span; } export interface BranchingView { kind: "branching"; path: number[]; type: string; category: Category; id: string | null; branches: BranchView[]; span: Span; } export interface UnknownView { kind: "unknown"; path: number[]; /** The raw tag name as written. */ type: string; category: "unknown"; label: string; tooltip: string; span: Span; } export interface RouteView { path: number[]; id: string | null; description: string | null; from: LeafView | null; steps: StepView[]; /** onException/onCompletion/intercept* of this route — the strip above (§3.9). */ strips: ScopeView[]; span: Span; } export interface BeanDeclaration { name: string; type: string; span: Span; } export interface FileGraph { routes: RouteView[]; /** Container-level handlers — the strip above the whole file. */ strips: ScopeView[]; /** `` declarations — a muted registry row, not steps. */ beans: BeanDeclaration[]; /** Top-level nodes the graph does not interpret (rest, unknown). */ others: UnknownView[]; } // ── labels (§5) ────────────────────────────────────────────────────── const SECRET_QUERY = /((?:password|pwd|secret|token|apikey|accesskey|sharedaccesskey|clientsecret)[^=&\s]*=)[^&"'\s]+/gi; const SECRET_USERINFO = /(\/\/[^/:@\s]+:)[^@/\s]+@/g; /** URI with every secret masked — labels and tooltips both go through this. */ export function redactUri(uri: string): string { return uri.replace(SECRET_USERINFO, "$1***@").replace(SECRET_QUERY, "$1***"); } export function trimLabel(label: string, max = 22): string { return label.length <= max ? label : label.slice(0, max - 1) + "…"; } /** scheme + last path segment of the RESOLVED uri, marked when it came from config. */ export function endpointLabelResolved(uri: string, resolver: UriResolver): string { const { resolved, fromConfig } = resolver(uri); const label = endpointLabel(resolved); return fromConfig ? label + " ⚙" : label; } /** raw → resolved in the tooltip when config took part; secrets redacted in both. */ export function endpointTooltip(uri: string, resolver: UriResolver): string { const { resolved, fromConfig } = resolver(uri); return fromConfig ? redactUri(uri) + " → " + redactUri(resolved) : redactUri(uri); } /** scheme + last path segment: `kafka orders-vip`, `direct orders` (§5). */ export function endpointLabel(uri: string): string { const redacted = redactUri(uri); const scheme = redacted.split(":", 1)[0]; const rest = redacted.slice(scheme.length + 1).replace(/^\/\//, ""); const path = rest.split("?", 1)[0]; const last = path.split("/").filter(s => s.length > 0).pop() ?? ""; return last.length > 0 ? `${scheme} ${last}` : scheme; } /** * The node's main parameter. A name-carrying step reads as `name = value` (§3.2: * `setHeader priority = high`); otherwise the first Expression attribute, then inline text, * then the first attribute. */ function mainParameter(element: XmlElement, info: ElementInfo | undefined): string | null { const name = attr(element, "name")?.value ?? attr(element, "key")?.value ?? null; let expression: string | null = null; if (info) { for (const spec of info.attributes) { if (spec.type !== "Expression") continue; const found = attr(element, spec.name); if (found) { expression = found.value; break; } } } if (name !== null) return expression !== null ? `${name} = ${expression}` : name; if (expression !== null) return expression; const inline = textContent(element).trim(); if (inline.length > 0) return inline; const first = element.attributes.find(a => a.name !== "id" && a.name !== "description"); return first ? first.value : null; } // ── building the views ─────────────────────────────────────────────── const STRIP_ELEMENTS = new Set(["onException", "onCompletion", "intercept", "interceptFrom", "interceptSendToEndpoint"]); const ENDPOINT_LEAFS = new Set(["to", "toD", "wireTap", "enrich", "pollEnrich"]); /** Steps that carry several assignments as `` rows. */ const ROW_SETTERS = new Set(["setHeaders", "setProperties"]); export type UriResolver = (uri: string) => { resolved: string; fromConfig: boolean }; const IDENTITY_RESOLVER: UriResolver = uri => ({ resolved: uri, fromConfig: false }); export function buildFileGraph(root: XmlElement, index: ElementIndex, resolve?: UriResolver): FileGraph { const resolver = resolve ?? IDENTITY_RESOLVER; const routes: RouteView[] = []; const strips: ScopeView[] = []; const beans: BeanDeclaration[] = []; const others: UnknownView[] = []; childElements(root).forEach((child, i) => { if (child.local === "route") routes.push(buildRoute(child, index, [i], resolver)); else if (STRIP_ELEMENTS.has(child.local)) strips.push(buildScope(child, index, [i], resolver)); else if (child.local === "bean" && child.prefix === null) beans.push({ name: attr(child, "name")?.value ?? "(anonymous)", type: attr(child, "type")?.value ?? "", span: child.span, }); else others.push(unknownView(child, [i])); }); return { routes, strips, beans, others }; } export function buildRoute(route: XmlElement, index: ElementIndex, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): RouteView { let from: LeafView | null = null; const steps: StepView[] = []; const strips: ScopeView[] = []; childElements(route).forEach((child, i) => { const childPath = [...path, i]; if (child.local === "from") { from = { kind: "leaf", path: childPath, type: "from", category: "source", label: trimLabel(endpointLabelResolved(attr(child, "uri")?.value ?? "", resolver)), tooltip: endpointTooltip(attr(child, "uri")?.value ?? "", resolver), scheme: schemeOf(resolver(attr(child, "uri")?.value ?? "").resolved), assign: null, attrs: attrsOf(child), id: attr(child, "id")?.value ?? null, span: child.span, }; return; } if (STRIP_ELEMENTS.has(child.local)) { strips.push(buildScope(child, index, childPath, resolver)); return; } steps.push(buildStep(child, index, childPath, resolver)); }); return { path, id: attr(route, "id")?.value ?? null, description: attr(route, "description")?.value ?? null, from, steps, strips, span: route.span, }; } export function buildStep(element: XmlElement, index: ElementIndex, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): StepView { // A `` in step position calls user code; only under the root is it a declaration. if (element.local === "bean" && element.prefix === null) return buildBeanStep(element, path); const info = index.get(element.local); if (!info || element.prefix !== null) return unknownView(element, path); if (element.local === "choice") return buildChoice(element, index, path, resolver); if (element.local === "tryCatch") return buildTryCatch(element, index, path, resolver); if (element.local === "multicast") return buildMulticast(element, index, path, resolver); if (info.kind === "Scope") return buildScope(element, index, path, resolver); return buildLeaf(element, info, path, resolver); } function buildLeaf(element: XmlElement, info: ElementInfo, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): LeafView { const description = attr(element, "description")?.value ?? null; let category = categoryOf(element.local) ?? "transform"; let label: string; let tooltip: string; let scheme: string | null = null; const uri = attr(element, "uri")?.value; const structural = ENDPOINT_LEAFS.has(element.local) && !uri ? childElements(element)[0] ?? null : null; if (ENDPOINT_LEAFS.has(element.local) && uri) { category = endpointCategory(resolver(uri).resolved); label = description ?? endpointLabelResolved(uri, resolver); tooltip = endpointTooltip(uri, resolver); scheme = schemeOf(resolver(uri).resolved); } else if (structural) { // The structural endpoint form (`SELECT …`): the // child names the transport; its attributes and text are what the reader wants to see. scheme = structural.local; category = endpointCategory(structural.local + ":"); label = description ?? structural.local; const options = structural.attributes.map(a => `${a.name}=${a.value}`).join(" "); const body = textContent(structural).trim().replace(/\s+/g, " "); tooltip = redactUri(`${element.local} ${structural.local}${options ? " " + options : ""}` + (body ? "\n" + (body.length > 600 ? body.slice(0, 599) + "…" : body) : "")); } else if (ROW_SETTERS.has(element.local)) { // One tile for several assignments (the Talend way): the label counts the rows, the // tooltip lists them `name = value` one per line. const rows = childElements(element); label = description ?? `×${rows.length}`; tooltip = redactUri([element.local, ...rows.map(row => { const name = attr(row, "name")?.value ?? "?"; const expr = attr(row, "expr")?.value; return expr !== undefined ? `${name} = ${expr}` : `${name} = "${attr(row, "value")?.value ?? ""}"`; })].join("\n")); } else if (element.local === "log" && childElements(element).length > 0) { // Rich log (§3.8): one node, the content summarized. const kids = childElements(element); const messages = kids.filter(k => k.local === "message").length; const headers = kids.filter(k => k.local === "header").length; const properties = kids.filter(k => k.local === "property").length; label = description ?? "log"; tooltip = `log: ${messages} message(s), ${headers} header(s), ${properties} propert(ies)`; } else { const parameter = mainParameter(element, info); label = description ?? parameter ?? element.local; tooltip = parameter === null ? element.local : `${element.local} ${redactUri(parameter)}`; } return { kind: "leaf", path, type: element.local, category, label: trimLabel(redactUri(label)), tooltip, scheme, assign: assignOf(element), attrs: attrsOf(element), id: attr(element, "id")?.value ?? null, span: element.span, }; } /** * The bean step (``, ``): the same * user-code tile as ``, labelled with the target and the method. */ function buildBeanStep(element: XmlElement, path: number[]): LeafView { const description = attr(element, "description")?.value ?? null; const target = attr(element, "ref")?.value ?? attr(element, "beanType")?.value ?? ""; const method = attr(element, "method")?.value; const call = method ? `${target}.${method}` : target; const options = element.attributes.map(a => `${a.name}=${a.value}`).join(" "); return { kind: "leaf", path, type: "bean", category: "userCode", label: trimLabel(redactUri(description ?? (call || "bean"))), tooltip: redactUri(options ? `bean ${options}` : "bean"), scheme: "bean", assign: null, attrs: attrsOf(element), id: attr(element, "id")?.value ?? null, span: element.span, }; } function buildScope(element: XmlElement, index: ElementIndex, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): ScopeView { const info = index.get(element.local); const parameter = mainParameter(element, info); const description = attr(element, "description")?.value ?? null; // Branch children of the scope's own spec (e.g. tryCatch handled elsewhere) are steps here. const steps = childElements(element).map((child, i) => buildStep(child, index, [...path, i], resolver)); return { kind: "scope", path, type: element.local, category: categoryOf(element.local) ?? "flow", label: trimLabel(redactUri(description ?? parameter ?? element.local), 40), tooltip: parameter ? `${element.local} ${redactUri(parameter)}` : element.local, repeats: element.local === "split", parallel: (attr(element, "parallel")?.value ?? attr(element, "parallelProcessing")?.value) === "true", attrs: attrsOf(element), id: attr(element, "id")?.value ?? null, steps, span: element.span, }; } function buildChoice(element: XmlElement, index: ElementIndex, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): BranchingView { const branches: BranchView[] = []; childElements(element).forEach((child, i) => { if (child.local === "when") { const condition = attr(child, "expr")?.value ?? attr(child, "predicate")?.value ?? ""; branches.push(branch(`when ${redactUri(condition)}`, false, child, index, [...path, i], resolver)); } else if (child.local === "otherwise") { branches.push(branch("otherwise", false, child, index, [...path, i], resolver)); } }); return branchingView(element, "choice", branches, path); } function buildTryCatch(element: XmlElement, index: ElementIndex, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): BranchingView { // The format has the explicit wrapper (spec children: try/catch/finally); loose // steps directly under are read as the body too. const body: BranchView = { path, label: "try", tooltip: "try", warn: false, steps: [], span: element.span }; const branches: BranchView[] = [body]; childElements(element).forEach((child, i) => { const childPath = [...path, i]; if (child.local === "try") { body.span = child.span; body.path = childPath; body.steps.push(...childElements(child).map((c, j) => buildStep(c, index, [...childPath, j], resolver))); } else if (child.local === "catch") branches.push(branch(`catch ${shortException(attr(child, "exception")?.value)}`, true, child, index, childPath, resolver)); else if (child.local === "finally") branches.push(branch("finally", true, child, index, childPath, resolver)); else body.steps.push(buildStep(child, index, childPath, resolver)); }); return branchingView(element, "tryCatch", branches, path); } function buildMulticast(element: XmlElement, index: ElementIndex, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): BranchingView { // §3.4: like choice, one row per destination, no conditions. const branches = childElements(element).map((child, i) => ({ path: [...path, i], label: String(i + 1), tooltip: String(i + 1), warn: false, steps: [buildStep(child, index, [...path, i], resolver)], span: child.span, })); return branchingView(element, "multicast", branches, path); } function branch(label: string, warn: boolean, element: XmlElement, index: ElementIndex, path: number[], resolver: UriResolver = IDENTITY_RESOLVER): BranchView { return { path, label: trimLabel(label, 40), tooltip: label, warn, steps: childElements(element).map((child, i) => buildStep(child, index, [...path, i], resolver)), span: element.span, }; } function branchingView(element: XmlElement, type: string, branches: BranchView[], path: number[]): BranchingView { return { kind: "branching", path, type, category: categoryOf(type) ?? "flow", id: attr(element, "id")?.value ?? null, branches, span: element.span, }; } function unknownView(element: XmlElement, path: number[]): UnknownView { return { kind: "unknown", path, type: element.name, category: "unknown", label: trimLabel(`<${element.name}>`, 20), tooltip: `<${element.name}> — kept verbatim`, span: element.span, }; } /** Every attribute of the element, secrets redacted. */ function attrsOf(element: XmlElement): Record { const out: Record = {}; for (const a of element.attributes) out[a.name] = redactUri(a.value); return out; } /** The assignment of a single `setProperty` / `setHeader`; secrets redacted like the tooltip. */ function assignOf(element: XmlElement): LeafView["assign"] { if (element.local !== "setProperty" && element.local !== "setHeader") return null; const name = attr(element, "name")?.value; if (name === undefined) return null; const expr = attr(element, "expr")?.value; return expr !== undefined ? { name, attr: "expr", text: redactUri(expr) } : { name, attr: "value", text: redactUri(attr(element, "value")?.value ?? "") }; } /** `bean:#omni-http?method=Fail` → `bean`; a URI without a scheme → null. */ function schemeOf(uri: string): string | null { const match = /^([A-Za-z][A-Za-z0-9+.-]*):/.exec(uri.trim()); return match ? match[1].toLowerCase() : null; } function shortException(full: string | undefined): string { if (!full) return ""; const last = full.split(",")[0].trim().split(".").pop() ?? full; return last; } Path: redb-route/vscode-redb-route/src/moduledir.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/moduledir.ts ---- import * as fs from "fs"; import * as path from "path"; /** * The module a route document belongs to: the nearest folder with a .csproj, at most three levels * above the document's folder. This is the project root `redb-route-xml pack` builds from, with * `context.xml` beside the .csproj and the routes under `routes/` (RoutePackage). */ export function findModuleDir(start: string): { dir: string; csproj: string } | null { let dir = start; for (let level = 0; level < 4; level++) { const csproj = readDir(dir).find(f => f.toLowerCase().endsWith(".csproj")); if (csproj) return { dir, csproj }; const parent = path.dirname(dir); if (parent === dir) break; dir = parent; } return null; } /** The context document's file name at the module root (RoutePackage.ContextFile). */ export const CONTEXT_FILE = "context.xml"; /** * The text of the module's `context.xml` for a document, or null when the document has no module, * the module has no context file, or the document is that file itself. `openText` returns the text * of a file open in an editor, so unsaved edits are seen before the file on disk. */ export function moduleContextText( documentPath: string, openText: (file: string) => string | undefined): string | null { const module = findModuleDir(path.dirname(documentPath)); if (!module) return null; const file = path.join(module.dir, CONTEXT_FILE); if (samePath(file, documentPath)) return null; const open = openText(file); if (open !== undefined) return open; try { return fs.readFileSync(file, "utf8"); } catch { return null; // no context file in this module } } /** The resources directory name at the module root (RoutePackage.ResourcesDir), shipped by `pack`. */ export const RESOURCES_DIR = "resources"; /** A walk stops here: a resources folder is a handful of schemas and stylesheets, not a tree to crawl. */ const RESOURCE_WALK_LIMIT = 2000; /** * The files and folders under the module's `resources/` for a document, relative to that folder with * '/' separators (the folder itself is the dir ""), or null when the document has no module or the * module has no resources folder. Sorted, at most RESOURCE_WALK_LIMIT entries. */ export function moduleResources(documentPath: string): { files: string[]; dirs: string[] } | null { const module = findModuleDir(path.dirname(documentPath)); if (!module) return null; const root = path.join(module.dir, RESOURCES_DIR); if (!isDirectory(root)) return null; const files: string[] = []; const dirs: string[] = [""]; const pending: string[] = [""]; while (pending.length > 0 && files.length + dirs.length < RESOURCE_WALK_LIMIT) { const relative = pending.shift()!; let entries: fs.Dirent[]; try { entries = fs.readdirSync(path.join(root, relative), { withFileTypes: true }); } catch { continue; } for (const entry of entries) { const name = relative === "" ? entry.name : `${relative}/${entry.name}`; if (entry.isDirectory()) { dirs.push(name); pending.push(name); } else if (entry.isFile()) { files.push(name); } } } return { files: files.sort(), dirs: dirs.sort() }; } function isDirectory(dir: string): boolean { try { return fs.statSync(dir).isDirectory(); } catch { return false; } } function readDir(dir: string): string[] { try { return fs.readdirSync(dir); } catch { return []; } } function samePath(a: string, b: string): boolean { const left = path.resolve(a); const right = path.resolve(b); return process.platform === "win32" ? left.toLowerCase() === right.toLowerCase() : left === right; } Path: redb-route/vscode-redb-route/src/newproject.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/newproject.ts ---- /** * The pure half of the New Project page: what the page shows for the machine and each template, * how the form is checked, and the `dotnet new` command line built from it. The VS Code half * (the webview, the processes) stays thin. */ import { TemplateState } from "./dotnetenv"; import { RedbTemplate, TEMPLATE_GROUPS, TemplateGroup, TemplateParameter, DEFAULT_TEMPLATE } from "./templates"; /** A project name `dotnet new -n` accepts and that is a usable folder and assembly name. */ export function projectNameError(name: string): string | null { if (!name.trim()) return "Enter a project name."; if (!/^[A-Za-z_][A-Za-z0-9_.-]*$/.test(name)) return "Use letters, digits, '.', '_' and '-', starting with a letter or '_'."; if (name.endsWith(".")) return "The name cannot end with '.'."; if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i.test(name)) return `'${name}' is a reserved device name on Windows.`; return null; } export interface PromptItem { label: string; description?: string; /** The value passed to the template. */ value: string; picked: boolean; } /** How one parameter is asked: a pick list for choice and bool, an input box for the rest. */ export type ParameterPrompt = | { kind: "pick"; parameter: TemplateParameter; title: string; placeholder: string; items: PromptItem[] } | { kind: "input"; parameter: TemplateParameter; title: string; placeholder: string; value: string }; export function parameterPrompt(parameter: TemplateParameter): ParameterPrompt { const title = parameter.displayName ?? parameter.name; const placeholder = parameter.description ?? title; if (parameter.kind === "choice") { const fallback = parameter.defaultValue ?? parameter.choices[0]?.value; return { kind: "pick", parameter, title, placeholder, items: parameter.choices.map(choice => ({ label: choice.value, description: choice.description ?? undefined, value: choice.value, picked: choice.value === fallback, })), }; } if (parameter.kind === "bool") { const current = (parameter.defaultValue ?? "false").toLowerCase() === "true"; return { kind: "pick", parameter, title, placeholder, items: [ { label: "Yes", value: "true", picked: current }, { label: "No", value: "false", picked: !current }, ], }; } // An empty default means the template computes the value itself (the agreed `context`): // the box stays empty and an untouched box passes nothing. return { kind: "input", parameter, title, placeholder: parameter.defaultValue ? placeholder : `${placeholder} (leave empty for the template's default)`, value: parameter.defaultValue ?? "", }; } /** * Marks target frameworks (`netX.Y`) the machine has no SDK for. The item stays selectable: * the project can be created and built elsewhere, but the user sees it before choosing. */ export function markMissingFrameworks(items: PromptItem[], sdkMajors: number[]): PromptItem[] { return items.map(item => { const match = /^net(\d+)\.\d+$/.exec(item.value); if (!match || sdkMajors.some(major => major >= Number(match[1]))) return item; const note = "no .NET SDK for it on this machine"; return { ...item, description: item.description ? `${item.description}, ${note}` : note }; }); } /** Problems with a typed value for a text parameter: required and numeric types. */ export function parameterValueError(parameter: TemplateParameter, value: string): string | null { if (!value) return parameter.isRequired ? `${parameter.displayName ?? parameter.name} is required.` : null; if ((parameter.datatype === "int" || parameter.datatype === "integer") && !/^-?\d+$/.test(value)) return "Enter a whole number."; if ((parameter.datatype === "float" || parameter.datatype === "double") && !/^-?\d+(\.\d+)?$/.test(value)) return "Enter a number."; return null; } export interface NewProjectRequest { shortName: string; name: string; /** The folder the project is created in (`-o`), the parent folder joined with the name. */ outputDirectory: string; parameters: TemplateParameter[]; /** The answers by parameter name; a missing or empty answer is not passed. */ values: Map; } /** * The arguments of `dotnet new`, for execFile (no shell, so a path with spaces is one argument). * A value equal to the template's default is left out: the command reads as what the user chose. */ export function dotnetNewArguments(request: NewProjectRequest): string[] { const args = ["new", request.shortName, "-n", request.name, "-o", request.outputDirectory]; for (const parameter of request.parameters) { const value = request.values.get(parameter.name); if (value === undefined || value === "") continue; if (parameter.defaultValue !== null && value === parameter.defaultValue && !parameter.isRequired) continue; args.push(`--${parameter.name}`, value); } return args; } /** * The command as the Output channel shows it, quoted where a shell would need it. Display only: the process is * started without a shell, with the arguments as an array. */ export function displayCommand(executable: string, args: string[]): string { return [executable, ...args].map(quoteArgument).join(" "); } /** * One argument as a command line reads it back (the Windows argv rules and a POSIX double-quoted word agree here): a * quote is escaped with a backslash, and the backslashes right before a quote or at the end are doubled, so a folder * like `C:\dir\` does not swallow the closing quote. Other backslashes, as in a Windows path, stay single. */ function quoteArgument(argument: string): string { if (argument !== "" && !/[\s"]/.test(argument)) return argument; const escaped = argument .replace(/(\\*)"/g, (_match, slashes: string) => `${slashes}${slashes}\\"`) .replace(/(\\+)$/, (_match, slashes: string) => `${slashes}${slashes}`); return `"${escaped}"`; } // ── the page ───────────────────────────────────────────────────────── /** One form field of a template on the page: a select for choice and bool, a text box for the rest. */ export interface PageField { name: string; title: string; description: string | null; kind: "select" | "text"; options: { value: string; label: string; description: string | null }[]; /** The preselected option or the text box's initial value. */ value: string; placeholder: string; } /** The glyphs the page draws on template cards (media/newproject.js holds their paths). */ export type TemplateIcon = | "route" | "stream" | "queue" | "database" | "api" | "envelope" | "split" | "fan" | "chat" | "shield" | "browser" | "server" | "check" | "cube" | "terminal" | "document"; /** Words of a template's short name (or classifications) and the glyph they call for; the first match wins. */ const ICON_WORDS: [RegExp, TemplateIcon][] = [ [/^as4$/, "envelope"], [/^kafka$/, "stream"], [/^(rabbitmq|amqp|mqtt|mq|sqs|asb)$/, "queue"], [/^(sql|db|database|outbox|batch)$/, "database"], [/^(rest|http|api|grpc|soap)$/, "api"], [/^(scatter|gather)$/, "fan"], [/^(eip|patterns|integration)$/, "split"], [/^(chat|llm|ai)$/, "chat"], [/^identity$/, "shield"], [/^(validator|validation|xslt)$/, "check"], [/^beans?$/, "cube"], [/^(blazor|razor|app|bff|web)$/, "browser"], [/^(worker|service)$/, "server"], [/^console$/, "terminal"], ]; /** * The glyph of a template card: from the words of its short name first ("redb-route-kafka" * gives kafka); an XML module without such a word gets the route glyph; other templates then * look at their classifications, and fall back to a server for a Tsak host and a document for * the rest. */ export function templateIcon(template: Pick): TemplateIcon { const words = template.shortName.toLowerCase().split(/[-_.]/).filter(w => w !== "redb" && w !== "route" && w !== "tsak"); const match = (source: string[]) => { for (const word of source) for (const [pattern, icon] of ICON_WORDS) if (pattern.test(word)) return icon; return null; }; return match(words) ?? (template.group === "route-xml" ? "route" : null) ?? match(template.classifications.map(c => c.toLowerCase())) ?? (template.group === "tsak" ? "server" : "document"); } export interface PageTemplate { icon: TemplateIcon; shortName: string; name: string; description: string | null; type: string; group: TemplateGroup; packageId: string; fields: PageField[]; } export interface PagePackage { packageId: string; kind: TemplateState["kind"]; installed: string | null; latest: string | null; } /** Everything the page renders, sent to the webview as one message. */ export interface PageState { /** The installed SDK majors; null when `dotnet` is not on the PATH. */ sdks: number[] | null; packages: PagePackage[]; groups: { group: TemplateGroup; title: string }[]; templates: PageTemplate[]; /** The template selected when the page opens. */ selected: string | null; folder: string; } export function pagePackage(packageId: string, state: TemplateState): PagePackage { return { packageId, kind: state.kind, installed: state.kind === "missing" ? null : state.installed.version, latest: state.kind === "current" ? null : state.latest, }; } export function pageField(parameter: TemplateParameter, sdkMajors: number[]): PageField { const prompt = parameterPrompt(parameter); if (prompt.kind === "pick") { const items = markMissingFrameworks(prompt.items, sdkMajors); return { name: parameter.name, title: prompt.title, description: parameter.description, kind: "select", options: items.map(i => ({ value: i.value, label: i.label, description: i.description ?? null })), value: items.find(i => i.picked)?.value ?? items[0]?.value ?? "", placeholder: "", }; } return { name: parameter.name, title: prompt.title, description: parameter.description, kind: "text", options: [], value: prompt.value, placeholder: prompt.placeholder, }; } /** The page state; the groups listed are only those that have templates. */ export function pageState(sdks: number[] | null, packages: PagePackage[], templates: RedbTemplate[], folder: string): PageState { const majors = sdks ?? []; const groups = TEMPLATE_GROUPS.filter(g => templates.some(t => t.group === g.group)); return { sdks, packages, groups, folder, templates: templates.map(t => ({ icon: templateIcon(t), shortName: t.shortName, name: t.name, description: t.description, type: t.type, group: t.group, packageId: t.packageId, fields: t.parameters.map(p => pageField(p, majors)), })), selected: templates.find(t => t.shortName === DEFAULT_TEMPLATE)?.shortName ?? templates[0]?.shortName ?? null, }; } /** What the page sends when Create is pressed. */ export interface CreateForm { template: string; name: string; folder: string; values: Record; } /** * The form's problems keyed by field ("template", "name", "folder" or a parameter name); empty * when the project can be created. `targetIsNonEmpty` tells whether / already * holds files. */ export function formErrors(form: CreateForm, template: RedbTemplate | undefined, targetIsNonEmpty: boolean): Record { const errors: Record = {}; if (!template) { errors.template = "Choose a template."; return errors; } const nameError = projectNameError(form.name); if (nameError) errors.name = nameError; if (!form.folder.trim()) errors.folder = "Choose the folder to create the project in."; else if (!nameError && targetIsNonEmpty) errors.folder = `${form.name} already exists in this folder and is not empty.`; for (const parameter of template.parameters) { const value = form.values[parameter.name] ?? ""; const error = parameter.kind === "choice" ? (value && !parameter.choices.some(c => c.value === value) ? "Choose one of the listed values." : null) : parameter.kind === "bool" ? (value && value !== "true" && value !== "false" ? "Choose yes or no." : null) : parameterValueError(parameter, value); if (error) errors[parameter.name] = error; } return errors; } Path: redb-route/vscode-redb-route/src/newprojectpanel.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/newprojectpanel.ts ---- /** * "redb: New Project": a page inside VS Code that creates a project from the redb templates * through `dotnet new`. It shows the SDKs and the template packages (with install and update * buttons), the templates as cards, a form for the chosen one, runs `dotnet new` and, when the * project carries a local tool manifest, `dotnet tool restore`, then offers to open the project. * Every decision is in the tested modules; this file wires the webview and the processes, and * every action of the page reaches it as a message. */ import * as vscode from "vscode"; import * as fs from "fs"; import * as os from "os"; import * as path from "path"; import { ChildProcess, spawn } from "child_process"; import { installedSdks, installedTemplatePackage, latestTemplateVersion, templateInstallArguments, templateState, } from "./dotnetenv"; import { CreateForm, displayCommand, dotnetNewArguments, formErrors, pagePackage, pageState } from "./newproject"; import { orderTemplates, readTemplateDefinitions, RedbTemplate, selectTemplates, TEMPLATE_PACKAGE_IDS, } from "./templates"; const DOTNET_DOWNLOAD = "https://dotnet.microsoft.com/download"; type PageMessage = | { type: "ready" | "refresh" | "cancel" | "showOutput" | "downloadDotnet" } | { type: "install"; packageId: string; version: string | null } | { type: "browse"; folder: string } | { type: "validate" | "create"; form: CreateForm } | { type: "open"; mode: "here" | "new" | "add" }; export class NewProjectPanel { private static current: NewProjectPanel | undefined; private templates: RedbTemplate[] = []; /** Major version of the highest installed SDK, the one that runs `dotnet new install`; null when unknown. */ private sdkMajor: number | null = null; private running: ChildProcess | undefined; private cancelled = false; private created: { folder: string; name: string } | undefined; static show(context: vscode.ExtensionContext, output: vscode.OutputChannel): void { if (NewProjectPanel.current) { NewProjectPanel.current.panel.reveal(); return; } const panel = vscode.window.createWebviewPanel("redbNewProject", "New redb Project", vscode.ViewColumn.Active, { enableScripts: true, localResourceRoots: [vscode.Uri.joinPath(context.extensionUri, "media")], retainContextWhenHidden: true, }); NewProjectPanel.current = new NewProjectPanel(panel, context, output); } private constructor( private readonly panel: vscode.WebviewPanel, context: vscode.ExtensionContext, private readonly output: vscode.OutputChannel, ) { panel.iconPath = vscode.Uri.joinPath(context.extensionUri, "media", "icon.png"); panel.webview.html = html(panel.webview, context.extensionUri); panel.webview.onDidReceiveMessage((message: PageMessage) => this.receive(message)); panel.onDidDispose(() => { this.running?.kill(); NewProjectPanel.current = undefined; }); } private post(message: unknown): void { void this.panel.webview.postMessage(message); } private async receive(message: PageMessage): Promise { switch (message.type) { case "ready": case "refresh": await this.sendState(); return; case "downloadDotnet": await vscode.env.openExternal(vscode.Uri.parse(DOTNET_DOWNLOAD)); return; case "showOutput": this.output.show(true); return; case "cancel": if (this.running) { this.cancelled = true; this.running.kill(); } return; case "install": if (!(TEMPLATE_PACKAGE_IDS as readonly string[]).includes(message.packageId)) return; await this.run(`Installing ${message.packageId}`, "dotnet", templateInstallArguments(message.packageId, message.version, this.sdkMajor)); await this.sendState(); return; case "browse": { const picked = await vscode.window.showOpenDialog({ canSelectFolders: true, canSelectFiles: false, canSelectMany: false, openLabel: "Create the project here", defaultUri: message.folder && fs.existsSync(message.folder) ? vscode.Uri.file(message.folder) : undefined, }); if (picked?.[0]) this.post({ type: "folder", folder: picked[0].fsPath }); return; } case "validate": this.post({ type: "errors", errors: this.errors(message.form) }); return; case "create": await this.create(message.form); return; case "open": await this.open(message.mode); return; } } private async sendState(): Promise { this.post({ type: "busy", text: "Checking the .NET SDK and the redb templates..." }); const [sdks, ...latest] = await Promise.all([ installedSdks(), ...TEMPLATE_PACKAGE_IDS.map(id => latestTemplateVersion(id)), ]); this.sdkMajor = sdks && sdks.length > 0 ? Math.max(...sdks.map(s => s.major)) : null; const packages = TEMPLATE_PACKAGE_IDS.map((id, i) => ({ id, state: templateState(installedTemplatePackage(id), latest[i]) })); const templates: RedbTemplate[] = []; for (const { id, state } of packages) { if (state.kind === "missing") continue; try { templates.push(...selectTemplates(readTemplateDefinitions(state.installed.mountPoint), id)); } catch (error) { this.output.appendLine(`Cannot read ${id} at ${state.installed.mountPoint}: ${(error as Error).message}`); } } this.templates = orderTemplates(templates); const folder = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? os.homedir(); this.post({ type: "state", state: pageState(sdks === null ? null : sdks.map(s => s.major), packages.map(p => pagePackage(p.id, p.state)), this.templates, folder), }); } private errors(form: CreateForm): Record { const target = path.join(form.folder, form.name); const nonEmpty = form.folder.trim() !== "" && form.name.trim() !== "" && fs.existsSync(target) && fs.readdirSync(target).length > 0; return formErrors(form, this.templates.find(t => t.shortName === form.template), nonEmpty); } private async create(form: CreateForm): Promise { const errors = this.errors(form); if (Object.keys(errors).length > 0) { this.post({ type: "errors", errors }); return; } const template = this.templates.find(t => t.shortName === form.template)!; const target = path.join(form.folder, form.name); const args = dotnetNewArguments({ shortName: template.shortName, name: form.name, outputDirectory: target, parameters: template.parameters, values: new Map(Object.entries(form.values)), }); this.created = undefined; const code = await this.run(`Creating ${form.name}`, "dotnet", args, form.folder); if (code !== 0) { this.post({ type: "done", ok: false, message: code === null ? "Cancelled." : `dotnet new failed (exit code ${code}).` }); return; } if (fs.existsSync(path.join(target, ".config", "dotnet-tools.json"))) { const restored = await this.run("Restoring the project's .NET tools", "dotnet", ["tool", "restore"], target); if (restored !== 0) this.log("The project was created, but 'dotnet tool restore' failed. Run it in the project folder."); } this.created = { folder: target, name: form.name }; this.post({ type: "done", ok: true, message: `Created ${target}.` }); } private async open(mode: "here" | "new" | "add"): Promise { if (!this.created) return; const uri = vscode.Uri.file(this.created.folder); if (mode === "add") vscode.workspace.updateWorkspaceFolders(vscode.workspace.workspaceFolders?.length ?? 0, 0, { uri, name: this.created.name }); else await vscode.commands.executeCommand("vscode.openFolder", uri, { forceNewWindow: mode === "new" }); } private log(text: string): void { this.output.append(text.endsWith("\n") ? text : text + "\n"); this.post({ type: "log", text }); } /** Runs one process, its output in the page and the Output channel; the exit code, or null when cancelled or not started. */ private run(title: string, executable: string, args: string[], cwd?: string): Promise { this.post({ type: "busy", text: `${title}...` }); this.log(`> ${displayCommand(executable, args)}`); this.cancelled = false; return new Promise(resolve => { const child = spawn(executable, args, { cwd, windowsHide: true }); this.running = child; child.stdout?.on("data", (chunk: Buffer) => this.log(chunk.toString())); child.stderr?.on("data", (chunk: Buffer) => this.log(chunk.toString())); child.on("error", error => { this.log(error.message); this.running = undefined; resolve(null); }); child.on("close", code => { this.log(`(exit code ${code ?? "none"})`); this.running = undefined; this.post({ type: "idle" }); resolve(this.cancelled ? null : code); }); }); } } function html(webview: vscode.Webview, extensionUri: vscode.Uri): string { const css = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, "media", "newproject.css")); const js = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, "media", "newproject.js")); const nonce = Array.from({ length: 4 }, () => Math.random().toString(36).slice(2)).join(""); return ` New redb Project
`; } Path: redb-route/vscode-redb-route/src/palette.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/palette.ts ---- /** * The insert palette (10-VSCODE §8.5), assembled MECHANICALLY: EIP steps from the generated * element list, endpoint senders from the Ф4 catalog. Templates carry the required * attributes plus the element's primary one (uri/expr) as empty stubs — the properties * panel fills them right after the insert. */ import { ElementInfo } from "./graphmodel"; import { Category, categoryOf } from "./category"; export interface PaletteItem { label: string; fragment: string; hint?: string; } export interface PaletteCategory { title: string; items: PaletteItem[]; } const SPECIAL_FRAGMENTS: Record = { choice: `\n \n \n \n \n`, tryCatch: `\n \n \n \n \n`, }; const CATEGORY_TITLES: [Category, string][] = [ ["flow", "Flow control"], ["transform", "Transform"], ["errors", "Errors & reliability"], ]; export function stepFragment(info: ElementInfo): string { const special = SPECIAL_FRAGMENTS[info.name]; if (special) return special; const stubs = info.attributes.filter(a => a.required).map(a => a.name); if (stubs.length === 0) { const primary = info.attributes.find(a => a.name === "uri") ?? info.attributes.find(a => a.type === "Expression"); if (primary) stubs.push(primary.name); } const attributes = stubs.map(name => ` ${name}=""`).join(""); return info.kind === "Scope" ? `<${info.name}${attributes}>\n` : `<${info.name}${attributes}/>`; } /** * The steps of the element list by category, then "Send to": a `` sender per component of the * catalog that has a producer side. A component whose `role` is "consumer" has none (imap, timer...) * and is left out; no role means both sides. */ export function buildPalette( elements: ElementInfo[], schemes: { scheme: string; pathSynonym?: string | null; role?: "producer" | "consumer" }[]): PaletteCategory[] { const byCategory = new Map(); for (const info of elements) { if (info.kind !== "Step" && info.kind !== "Scope" && info.kind !== "Branching") continue; const category = categoryOf(info.name) ?? "flow"; const bucket = byCategory.get(category) ?? []; bucket.push({ label: info.name, fragment: stepFragment(info) }); byCategory.set(category, bucket); } const categories: PaletteCategory[] = []; for (const [category, title] of CATEGORY_TITLES) { const items = (byCategory.get(category) ?? []).sort((a, b) => a.label.localeCompare(b.label)); if (items.length > 0) categories.push({ title, items }); } categories.push({ title: "Send to (endpoints)", items: schemes .filter(component => component.role !== "consumer") .sort((a, b) => a.scheme.localeCompare(b.scheme)) .map(component => ({ label: component.scheme, fragment: ``, hint: component.pathSynonym ? `path = ${component.pathSynonym}` : undefined, })), }); return categories; } Path: redb-route/vscode-redb-route/src/placeholders.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/placeholders.ts ---- /** * {{key}} / {{key:default}} resolution for the VIEW (§8: the placeholder is shown together * with its resolved value; what gets EDITED is always the placeholder — Р18). The resolver * only substitutes for display and scheme detection; it never writes. */ /** Placeholder values by key. Keys are stored lower-cased: the runtime's layer is case-insensitive. */ export type ConfigMap = Map; const PLACEHOLDER = /\{\{([^{}:]+)(?::([^{}]*))?\}\}/g; export interface ResolvedUri { /** The text with every placeholder substituted (value, else default, else kept as-is). */ resolved: string; /** True when at least one substitution happened — the view came from config. */ fromConfig: boolean; /** Keys that had neither a value nor a default. */ missing: string[]; } export function resolvePlaceholders(text: string, config: ConfigMap): ResolvedUri { let fromConfig = false; const missing: string[] = []; let resolved = text; // A config value may itself hold a placeholder ({{db.main.connection}} inside a sql // uri) — iterate to a fixed point, bounded against cycles. for (let pass = 0; pass < 3; pass++) { missing.length = 0; const next = resolved.replace(PLACEHOLDER, (whole, key: string, fallback: string | undefined) => { // As PropertyPlaceholderResolver: an empty value counts as none and the default applies. const configured = config.get(key.trim().toLowerCase()); const value = configured ? configured : fallback; if (value === undefined) { missing.push(key.trim()); return whole; } fromConfig = true; return value; }); if (next === resolved) break; resolved = next; } return { resolved, fromConfig, missing }; } /** * Merges one of a module's config files (config/context.sample.json, deployed as context.json, * and config/.config.json, which the packager puts into the package) the way the Tsak * runtime builds a context's layer from each (TsakCoordinator.ExtractLayerForContext): * with a "Contexts" section, the entries of Contexts.default and then of Contexts. * over them; without one, the entries at the root. Every top-level key of that section becomes * one context property, taken as written: {"hello.period": 5000} gives hello.period, while * {"hello": {"period": 5000}} gives nothing, because the runtime keeps a nested object as one * property holding a dictionary and a placeholder never reads into it. A key whose value is an * object, an array or null hides what an earlier layer set for it. */ export function mergeContextLayer(json: unknown, contextName: string | null, into: ConfigMap): void { const root = asObject(json); if (!root) return; const contexts = entry(root, "Contexts"); if (contexts === undefined) { mergeEntries(root, into); return; } const sections = asObject(contexts); if (!sections) return; const shared = asObject(entry(sections, "default")); if (shared) mergeEntries(shared, into); const own = contextName ? asObject(entry(sections, contextName)) : null; if (own) mergeEntries(own, into); } function mergeEntries(section: Record, into: ConfigMap): void { for (const [key, value] of Object.entries(section)) { const scalar = scalarText(value); if (scalar === null) into.delete(key.toLowerCase()); else into.set(key.toLowerCase(), scalar); } } /** A JSON scalar as Microsoft.Extensions.Configuration reads it (true becomes "True"); null for anything else. */ function scalarText(value: unknown): string | null { if (typeof value === "string") return value; if (typeof value === "number") return String(value); if (typeof value === "boolean") return value ? "True" : "False"; return null; } /** A property looked up case-insensitively, as configuration sections are. */ function entry(object: Record, name: string): unknown { const key = Object.keys(object).find(k => k.toLowerCase() === name.toLowerCase()); return key === undefined ? undefined : object[key]; } function asObject(value: unknown): Record | null { return value !== null && typeof value === "object" && !Array.isArray(value) ? value as Record : null; } /** The package name `redb-route-xml pack` uses: , else the csproj's file name. */ export function packageName(csprojFileName: string, csprojText: string): string { return msbuildProperty(csprojText, "RoutePackageName") ?? csprojFileName.replace(/\.csproj$/i, ""); } /** * The context a module runs in when the host's appsettings do not assign it: "ContextName" of * config/.config.json, which the packager puts into the package; without that file the * packager writes the csproj's ; without both the runtime opens a context * named after the module. */ export function moduleContextName(moduleConfig: unknown, csprojText: string, pkg: string): string { const root = asObject(moduleConfig); const configured = root ? entry(root, "ContextName") : undefined; if (typeof configured === "string" && configured.trim()) return configured.trim(); return msbuildProperty(csprojText, "RouteContextName") ?? pkg; } function msbuildProperty(csprojText: string, name: string): string | null { const match = new RegExp(`<${name}>\\s*([^<\\s]+)\\s*`).exec(csprojText); return match ? match[1] : null; } Path: redb-route/vscode-redb-route/src/routescan.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/routescan.ts ---- /** * The route-tree scan: every start-tag of a routes document with its position, id, * description and first endpoint. A tolerant structural walk for the sidebar — the * tree opens lines, it does not interpret the format (Ф7 ships no parser of the language). */ import { tagEnd } from "./tagscan"; export type RouteEntry = { /** The route's id attribute, when present. */ id: string | null; /** The route's description attribute, when present. */ description: string | null; /** The first inside the route, when present. */ from: string | null; /** 0-based line of the start-tag. */ line: number; }; function attribute(tag: string, name: string): string | null { const match = new RegExp(`(?:^|\\s)${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`).exec(tag); return match ? (match[1] ?? match[2]) : null; } /** Finds start-tags of one local element name, prefix-agnostic, comments and CDATA skipped. */ function* startTags(text: string, local: string): Generator<{ tag: string; index: number }> { const pattern = new RegExp(`<(?:[A-Za-z_][\\w.-]*:)?${local}(?=[\\s/>])`, "g"); for (;;) { const match = pattern.exec(text); if (!match) return; const commentStart = text.lastIndexOf("", commentStart) > match.index) continue; const cdataStart = text.lastIndexOf("= 0 && text.indexOf("]]>", cdataStart) > match.index) continue; const end = tagEnd(text, match.index); if (end < 0) return; yield { tag: text.slice(match.index, end), index: match.index }; } } function lineOf(lineStarts: number[], index: number): number { let low = 0; let high = lineStarts.length - 1; while (low < high) { const mid = (low + high + 1) >> 1; if (lineStarts[mid] <= index) low = mid; else high = mid - 1; } return low; } /** Scans a routes document. The caller has already sniffed it as ours. */ export function scanRoutes(text: string): RouteEntry[] { const lineStarts = [0]; for (let i = 0; i < text.length; i++) if (text[i] === "\n") lineStarts.push(i + 1); const routes = [...startTags(text, "route")]; const froms = [...startTags(text, "from")]; return routes.map((route, i) => { const routeEnd = i + 1 < routes.length ? routes[i + 1].index : text.length; const from = froms.find(f => f.index > route.index && f.index < routeEnd); return { id: attribute(route.tag, "id"), description: attribute(route.tag, "description"), from: from ? attribute(from.tag, "uri") : null, line: lineOf(lineStarts, route.index), }; }); } Path: redb-route/vscode-redb-route/src/skeletons.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/skeletons.ts ---- /** * The composite skeletons the schema cannot offer (a route with its consumer, both branches of a * choice, catch+finally). Single elements are NOT here on purpose: LemMinX builds those from the * XSD with required attributes and the closing tag. Served by our own completion provider — * declarative snippets cannot be scoped to the new-element position or to our documents only. * * Every skeleton says WHERE it may be inserted (see skeletonscope.ts). The provider used to offer * all of them at every element position, so `` and `` were suggested directly * under `` — the loader refuses those (" is not valid at the container level") and * the schema never offered them (owner finding 2026-10-08). */ /** Where a skeleton may be inserted: beside the routes, or as a step. */ export type SkeletonPlace = "document-root" | "step-content"; export type Skeleton = { label: string; detail: string; place: SkeletonPlace; /** VSCode snippet syntax; always starts with `<`. */ body: string; }; /** The skeletons of one place, in list order. */ export function skeletonsFor(place: SkeletonPlace): Skeleton[] { return SKELETONS.filter(skeleton => skeleton.place === place); } export const SKELETONS: Skeleton[] = [ { label: "", "\t", "\t$0", "", ].join("\n"), }, { label: "", "\t", "\t\t$0", "\t", "\t", "\t", "
", ].join("\n"), }, { label: "", "\t$0", "\t", "\t", "\t", "\t", "", ].join("\n"), }, ]; Path: redb-route/vscode-redb-route/src/skeletonscope.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/skeletonscope.ts ---- /** * The place a skeleton may take at an offset: the container level (a `` beside the other * routes) or a step position (inside an element that holds steps). The answer comes from the * generated element list (media/redb-route-elements.json) — the same list the palette and the * property panel read — so it cannot drift from the schema. * * Why this exists: the provider offered every skeleton at every element position, so `` and * `` appeared directly under ``, where the loader refuses them * (" is not valid at the container level", XmlRouteLoader.cs) and where the schema never * offered them (owner finding 2026-10-08). * * The open elements are read TEXTUALLY, not with the tree parser: a completion request arrives on a * half-typed document (`' expected") — exactly when * the answer is wanted. */ import { ElementIndex } from "./graphmodel"; import { SkeletonPlace } from "./skeletons"; import { tagEnd } from "./tagscan"; /** The local name of a tag (`r:route` → `route`). */ function localName(name: string): string { const colon = name.indexOf(":"); return colon < 0 ? name : name.slice(colon + 1); } /** * The open element names at the offset, outermost first. Comments, CDATA, processing instructions * and a doctype are skipped; a tag without its `>` before the offset is the element being typed and * is NOT open yet; an end tag pops the nearest element of that name, so an unbalanced document (the * normal state while editing) still reads. */ export function openElements(text: string, offset: number): string[] { const stack: string[] = []; for (let i = 0; ;) { const open = text.indexOf("<", i); if (open < 0 || open >= offset) break; const skip = (marker: string, closer: string): boolean => { const end = text.indexOf(closer, open + marker.length); if (end >= 0 && end < offset) { i = end + closer.length; return true; } return false; }; if (text.startsWith("")) continue; if (text.startsWith("")) continue; if (text.startsWith("")) continue; if (text.startsWith("")) continue; const close = tagEnd(text, open, offset); if (close < 0) break; const tag = text.slice(open + 1, close); i = close + 1; if (tag.startsWith("/")) { const at = stack.lastIndexOf(localName(tag.slice(1).trim())); if (at >= 0) stack.length = at; continue; } const name = localName(tag.split(/[\s/]/, 1)[0]); if (name.length > 0 && !/\/\s*$/.test(tag)) stack.push(name); } return stack; } /** Whether an element holds steps: its own entry, or the entry it has as a child of its parent. */ function allowsSteps(name: string, parent: string | null, index: ElementIndex): boolean { const own = index.get(name); if (own) return own.allowsSteps === true; const child = parent === null ? undefined : index.get(parent)?.children?.find(c => c.name === name); return child?.allowsSteps === true; } /** * The place a skeleton may take at the offset, or null when the position takes none. Null is the * honest answer for everything the list does not know: a foreign element, a handler's condition * `` (which holds no steps), the inside of a start tag, a position outside the root. */ export function skeletonPlace(text: string, offset: number, index: ElementIndex): SkeletonPlace | null { const open = openElements(text, offset); const element = open[open.length - 1]; if (element === undefined) return null; const parent = open.length > 1 ? open[open.length - 2] : null; if (parent === null) return element === "routes" ? "document-root" : null; if (allowsSteps(element, parent, index)) return "step-content"; // `route` and `bean` are the loader's own skeleton, not registry contributions, so the element // list carries no entry for them: a route holds steps, a bean holds property rows. if (parent === "routes" && !index.has(element)) return element === "bean" ? null : "step-content"; return null; } Path: redb-route/vscode-redb-route/src/sniff.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/sniff.ts ---- /** * The Ф7 activation contract (owner decision 2026-09-04): features light up because of what * the DOCUMENT says, never because of its file name. A file is ours when its root element is * or in the urn:redb:route namespace of the supported major. A foreign * route.xml stays untouched. * * This is a structural sniff of the root start-tag only — not a parser of the format (the * format's one parser lives in redb.Route.Xml; Ф7 ships none). */ import { tagEnd } from "./tagscan"; /** The namespace prefix every 1.x document carries; minor versions differ after it (§3.2). */ export const NAMESPACE_MAJOR_PREFIX = "urn:redb:route:1."; export type SniffResult = { kind: "routes" | "context"; namespace: string; }; /** Skips the XML declaration, processing instructions, comments and whitespace. */ function skipProlog(text: string): number { let i = 0; for (;;) { while (i < text.length && /\s/.test(text[i])) i++; if (text.startsWith("", i); if (end < 0) return text.length; i = end + 2; continue; } if (text.startsWith("", i); if (end < 0) return text.length; i = end + 3; continue; } return i; } } /** * Sniffs the document text. Returns null for anything that is not ours — a different root, * a different namespace, a different major, or simply not XML. */ export function sniff(text: string): SniffResult | null { const start = skipProlog(text); if (text[start] !== "<") return null; const end = tagEnd(text, start); if (end < 0) return null; const tag = text.slice(start + 1, end); const nameMatch = /^([A-Za-z_][\w.-]*)(?::([A-Za-z_][\w.-]*))?[\s/>]?/.exec(tag + ">"); if (!nameMatch) return null; const prefix = nameMatch[2] ? nameMatch[1] : null; const local = nameMatch[2] ?? nameMatch[1]; if (local !== "routes" && local !== "context") return null; const declaration = prefix === null ? "xmlns" : `xmlns:${prefix}`; const nsMatch = new RegExp(`(?:^|\\s)${declaration}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`).exec(tag); if (!nsMatch) return null; const namespace = nsMatch[1] ?? nsMatch[2]; if (!namespace.startsWith(NAMESPACE_MAJOR_PREFIX)) return null; return { kind: local, namespace }; } Path: redb-route/vscode-redb-route/src/tagscan.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/tagscan.ts ---- /** * The end of a start tag read textually. A `>` inside a quoted attribute value does not close the * tag: the format writes conditions unescaped (`expr="header.amount>1000"`), and XML allows it. * A `<` cannot appear unescaped in a value, so the last `<` before an offset is still the tag the * offset may sit in; only its end needs the quotes. */ /** * The index of the `>` that closes the tag opened at `open`, searching below `limit`, or -1 when * the tag is still open there (an unclosed quote keeps it open). */ export function tagEnd(text: string, open: number, limit: number = text.length): number { let quote: string | null = null; for (let i = open + 1; i < limit; i++) { const c = text[i]; if (quote) { if (c === quote) quote = null; } else if (c === '"' || c === "'") { quote = c; } else if (c === ">") { return i; } } return -1; } Path: redb-route/vscode-redb-route/src/templates.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/templates.ts ---- /** * The redb project templates as the `dotnet new` template engine has them installed. The list * is not scraped from `dotnet new list` or `--help` tables: their layout is not a contract. It is * read from the engine's own registry (`.templateengine/packages.json`) and from the * `.template.config/template.json` files inside the installed packages, so the names, * descriptions and parameters are exactly what each template declares. * * Every project and solution template of the redb template packages is offered. The redb.Route * XML modules (agreed with redb.Templates: `classifications` holds "RouteXml") form their own * group and the basic `redb-route` module is the one preselected. */ import * as fs from "fs"; import * as path from "path"; import { readZipEntries } from "./zipreader"; /** The packages whose templates the New Project page offers, in the order it shows them. */ export const TEMPLATE_PACKAGE_IDS = ["redb.Templates", "redb.Tsak.Templates"] as const; export type TemplatePackageId = typeof TEMPLATE_PACKAGE_IDS[number]; /** The template the New Project page preselects. */ export const DEFAULT_TEMPLATE = "redb-route"; const ROUTE_CLASSIFICATION = "RouteXml"; const TSAK_CLASSIFICATION = "redb.Tsak"; /** One package the template engine has installed. */ export interface InstalledTemplatePackage { packageId: string; /** Absent for a template folder installed from disk. */ version: string | null; /** The installed .nupkg, or the folder installed from disk. */ mountPoint: string; } /** Where the template engine keeps its registry: DOTNET_CLI_HOME when set, else the user's home. */ export function templateRegistryPath(env: NodeJS.ProcessEnv, homeDirectory: string): string { const home = env.DOTNET_CLI_HOME && env.DOTNET_CLI_HOME.trim() ? env.DOTNET_CLI_HOME : homeDirectory; return path.join(home, ".templateengine", "packages.json"); } /** Reads `packages.json`. An entry without a package id or a mount point is skipped. */ export function parseTemplateRegistry(text: string): InstalledTemplatePackage[] { const root = JSON.parse(stripBom(text)) as { Packages?: unknown }; if (!Array.isArray(root.Packages)) return []; const result: InstalledTemplatePackage[] = []; for (const item of root.Packages as Record[]) { const details = (item?.Details ?? {}) as Record; const packageId = typeof details.PackageId === "string" ? details.PackageId : null; const mountPoint = typeof item?.MountPointUri === "string" ? item.MountPointUri : null; if (!packageId || !mountPoint) continue; result.push({ packageId, version: typeof details.Version === "string" ? details.Version : null, mountPoint, }); } return result; } /** An installed package by id, matched case-insensitively as NuGet ids are. */ export function findTemplatePackage(packages: InstalledTemplatePackage[], packageId: string): InstalledTemplatePackage | null { return packages.find(p => p.packageId.toLowerCase() === packageId.toLowerCase()) ?? null; } /** True for a path inside a package or a folder that is a template definition. */ export function isTemplateDefinition(entryPath: string): boolean { return /(^|\/)\.template\.config\/template\.json$/i.test(entryPath.replace(/\\/g, "/")); } /** * The template.json texts of an installed package: the entries of its .nupkg, or the files of a * template folder installed from disk (`dotnet new install `, used while developing * templates). */ export function readTemplateDefinitions(mountPoint: string): string[] { if (fs.statSync(mountPoint).isDirectory()) { const found: string[] = []; const walk = (dir: string): void => { for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { const full = path.join(dir, entry.name); if (entry.isDirectory()) { if (!["bin", "obj", "node_modules", ".git"].includes(entry.name)) walk(full); } else if (isTemplateDefinition(path.relative(mountPoint, full))) { found.push(fs.readFileSync(full, "utf8")); } } }; walk(mountPoint); return found; } return [...readZipEntries(fs.readFileSync(mountPoint), isTemplateDefinition).values()] .map(bytes => bytes.toString("utf8")); } export type ParameterKind ="choice" | "bool" | "text"; export interface TemplateChoice { value: string; description: string | null; } /** One parameter a template declares (`symbols` of type "parameter"). */ export interface TemplateParameter { /** The symbol name, passed as `--`. */ name: string; displayName: string | null; description: string | null; kind: ParameterKind; /** The template's own datatype, kept for text parameters (int, float, ...). */ datatype: string; defaultValue: string | null; isRequired: boolean; choices: TemplateChoice[]; } /** The groups of the New Project page, in the order it shows them. */ export type TemplateGroup = "route-xml" | "tsak" | "apps"; export const TEMPLATE_GROUPS: { group: TemplateGroup; title: string }[] = [ { group: "route-xml", title: "redb.Route XML modules" }, { group: "tsak", title: "redb.Tsak hosts" }, { group: "apps", title: "Applications" }, ]; export interface RedbTemplate { shortName: string; name: string; description: string | null; identity: string | null; /** "project" or "solution", as the template declares it. */ type: string; group: TemplateGroup; classifications: string[]; /** The package the template came from. */ packageId: string; parameters: TemplateParameter[]; } /** * The project and solution templates among one package's template.json texts. A definition that * is not JSON, an item template or one without a short name is skipped. */ export function selectTemplates(definitions: string[], packageId: string): RedbTemplate[] { const templates: RedbTemplate[] = []; for (const text of definitions) { let json: Record; try { json = JSON.parse(stripJsonComments(stripBom(text))) as Record; } catch { continue; } const template = toTemplate(json, packageId); if (template) templates.push(template); } return templates; } /** Templates of every package in page order: by group, the default first, then by name. */ export function orderTemplates(templates: RedbTemplate[]): RedbTemplate[] { const groupIndex = (t: RedbTemplate) => TEMPLATE_GROUPS.findIndex(g => g.group === t.group); return [...templates].sort((a, b) => groupIndex(a) - groupIndex(b) || (a.shortName === DEFAULT_TEMPLATE ? -1 : b.shortName === DEFAULT_TEMPLATE ? 1 : 0) || a.name.localeCompare(b.name)); } function toTemplate(json: Record, packageId: string): RedbTemplate | null { const shortName = firstShortName(json.shortName); const tags = (json.tags ?? {}) as Record; if (!shortName || (tags.type !== "project" && tags.type !== "solution")) return null; const classifications = (Array.isArray(json.classifications) ? json.classifications : []) .filter((c): c is string => typeof c === "string"); return { shortName, name: typeof json.name === "string" && json.name ? json.name : shortName, description: typeof json.description === "string" && json.description ? json.description : null, identity: typeof json.identity === "string" ? json.identity : null, type: tags.type, group: classifications.includes(ROUTE_CLASSIFICATION) ? "route-xml" : classifications.includes(TSAK_CLASSIFICATION) ? "tsak" : "apps", classifications, packageId, parameters: parameters(json.symbols), }; } /** The short name is a string or a list of aliases; `dotnet new` takes the first. */ function firstShortName(value: unknown): string | null { const names = typeof value === "string" ? [value] : Array.isArray(value) ? value : []; const first = names[0]; return typeof first === "string" && first ? first : null; } function parameters(symbols: unknown): TemplateParameter[] { if (!symbols || typeof symbols !== "object") return []; const result: TemplateParameter[] = []; for (const [name, raw] of Object.entries(symbols as Record>)) { if (!raw || raw.type !== "parameter") continue; const datatype = typeof raw.datatype === "string" ? raw.datatype.toLowerCase() : "text"; const kind: ParameterKind = datatype === "choice" ? "choice" : datatype === "bool" || datatype === "boolean" ? "bool" : "text"; result.push({ name, displayName: text(raw.displayName), description: text(raw.description), kind, datatype, defaultValue: raw.defaultValue === undefined || raw.defaultValue === null ? null : String(raw.defaultValue), isRequired: raw.isRequired === true || raw.isRequired === "true", choices: kind === "choice" && Array.isArray(raw.choices) ? (raw.choices as Record[]) .filter(c => typeof c?.choice === "string") .map(c => ({ value: c.choice as string, description: text(c.description) })) : [], }); } return result; } function text(value: unknown): string | null { return typeof value === "string" && value ? value : null; } function stripBom(text: string): string { return text.charCodeAt(0) === 0xfeff ? text.slice(1) : text; } /** Removes // and block comments outside strings: the template engine reads template.json leniently. */ export function stripJsonComments(text: string): string { let result = ""; let inString = false; for (let i = 0; i < text.length; i++) { const c = text[i]; if (inString) { result += c; if (c === "\\" && i + 1 < text.length) result += text[++i]; else if (c === '"') inString = false; } else if (c === '"') { inString = true; result += c; } else if (c === "/" && text[i + 1] === "/") { while (i < text.length && text[i] !== "\n") i++; result += "\n"; } else if (c === "/" && text[i + 1] === "*") { const end = text.indexOf("*/", i + 2); i = end < 0 ? text.length : end + 1; } else { result += c; } } return result; } Path: redb-route/vscode-redb-route/src/test/beanref.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/beanref.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import * as fs from "node:fs"; import * as path from "node:path"; import { beanCallPosition, beanNames, referencePosition, typedReferencePosition } from "../beanref"; import { buildIndex, ElementInfo } from "../graphmodel"; import { withCursor } from "./cursor"; const INDEX = buildIndex(JSON.parse(fs.readFileSync( path.join(__dirname, "..", "..", "media", "redb-route-elements.json"), "utf8")) as ElementInfo[]); function typedAt(textWithCursor: string) { const { text, offset } = withCursor(textWithCursor); return typedReferencePosition(text, offset, INDEX); } function at(textWithCursor: string) { const { text, offset } = withCursor(textWithCursor); return referencePosition(text, offset); } describe("referencePosition — where `#` offers bean names", () => { it("takes a URI option value", () => { const text = ``; assert.deepEqual(at(text), { ok: true, replaceFrom: text.indexOf("|") }); }); it("takes a later option and replaces the half-typed name", () => { const text = ``; assert.deepEqual(at(text), { ok: true, replaceFrom: text.indexOf("fil|") }); }); it("takes the whole value of a structured option", () => { assert.equal(at(``).ok, true); }); it("takes the path right after the scheme", () => { assert.equal(at(``).ok, true); assert.equal(at(``).ok, true); }); it("refuses a `#` inside text of a value — the sql parameter", () => { assert.equal(at(``).ok, false); }); it("refuses a `#` in the middle of an option value", () => { assert.equal(at(``).ok, false); }); it("refuses a `#` after a path that is not the scheme's", () => { assert.equal(at(``).ok, false); }); it("refuses element content, a closed value and comments", () => { assert.equal(at(`#|`).ok, false); assert.equal(at(` { assert.equal(at(` "#|`).ok, false); }); it("takes a reference after an attribute whose value holds a >", () => { assert.equal(at(` { it("takes an empty or half-typed value of an attribute the element list types as a reference", () => { const text = ``; assert.deepEqual(typedAt(text), { ok: true, replaceFrom: text.indexOf("is|") }); assert.equal(typedAt(` { assert.equal(typedAt(` { assert.equal(typedAt(` { assert.equal(typedAt(``; assert.deepEqual(beanNames(text), ["yes"]); }); }); function callAt(textWithCursor: string) { const { text, offset } = withCursor(textWithCursor); return beanCallPosition(text, offset, INDEX); } describe("beanCallPosition — the bean name of an expression's bean call", () => { it("takes the template hole in any attribute value, element text and CDATA", () => { const text = ``; assert.deepEqual(callAt(text), { ok: true, replaceFrom: text.indexOf("pri|") }); assert.equal(callAt(`sum \${bean:|`).ok, true); assert.equal(callAt(` { const text = ` { assert.equal(callAt(` { assert.equal(callAt(` { assert.equal(callAt(` { assert.equal(callAt(`bean:|`).ok, false, "a bare call in element text is text"); }); it("refuses a comment and an attribute-name position", () => { assert.equal(callAt(``).ok, false); }); it("refuses inside CDATA", () => { assert.equal(at(``).ok, false); }); it("allows content right after a closed tag", () => { assert.equal(at(`|`).ok, true); }); }); Path: redb-route/vscode-redb-route/src/test/endpointuri.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/endpointuri.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { parseEndpointUri, buildEndpointUri, setUriOption, setUriPath, parameterSpelling } from "../endpointuri"; describe("endpoint-uri surgery — raw, order-preserving", () => { it("parse/build is the identity on untouched uris", () => { for (const uri of [ "kafka://orders?groupId=svc&brokers={{kafka.brokers}}", "direct://in", "bean:#stamps?method=go", "https://api.example.com/v1/orders?method=POST", "cron://close?pattern=0 3 * * *", ]) assert.equal(buildEndpointUri(parseEndpointUri(uri)!), uri); }); it("replaces one parameter in place, order kept, spelling kept", () => { assert.equal( setUriOption("kafka://t?groupId=a&brokers=b", "GroupId", "svc-2"), "kafka://t?groupId=svc-2&brokers=b", "the catalog name GroupId matches the file's groupId case-insensitively"); }); it("appends a new parameter at the end in camelCase", () => { assert.equal(parameterSpelling("MaxPollIntervalMs"), "maxPollIntervalMs"); assert.equal( setUriOption("kafka://t?groupId=a", parameterSpelling("Acks"), "All"), "kafka://t?groupId=a&acks=All"); }); it("removes a parameter cleanly", () => { assert.equal( setUriOption("kafka://t?groupId=a&acks=All&brokers=b", "acks", null), "kafka://t?groupId=a&brokers=b"); assert.equal( setUriOption("kafka://t?groupId=a", "acks", null), "kafka://t?groupId=a", "removing the absent is a no-op"); }); it("placeholders stay opaque bytes", () => { assert.equal( setUriOption("amqp://{{demo.amqp.consumer}}?durable=true", "durable", "false"), "amqp://{{demo.amqp.consumer}}?durable=false"); }); it("path replacement keeps the query and the slash style", () => { assert.equal(setUriPath("kafka://old?groupId=a", "new-topic"), "kafka://new-topic?groupId=a"); assert.equal(setUriPath("bean:#old?method=go", "#new"), "bean:#new?method=go"); }); }); Path: redb-route/vscode-redb-route/src/test/entities.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/entities.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import * as fs from "node:fs"; import * as path from "node:path"; import { attr, childElements, decodeXmlEntities, parseXml, textContent, XmlElement } from "../xmlmodel"; import { applyReplacement, computeSetAttribute, computeSetTextContent, escapeAttributeValue } from "../textedit"; import { setUriOption } from "../endpointuri"; import { buildFileGraph, buildIndex, ElementInfo, LeafView } from "../graphmodel"; const ELEMENTS: ElementInfo[] = JSON.parse(fs.readFileSync( path.join(__dirname, "..", "..", "media", "redb-route-elements.json"), "utf8")); const INDEX = buildIndex(ELEMENTS); /** The innermost first element: routes > route > the step (> its first child). */ function deepest(root: XmlElement): XmlElement { let current = root; for (;;) { const next = childElements(current)[0]; if (!next) return current; current = next; } } const SAMPLE = "header.a > 1 && header.b == "x""; const filterDoc = (attribute: string): string => `\n \n \n \n\n`; const exprOf = (text: string) => attr(deepest(parseXml(text).root), "expr")!; describe("entities: the panel shows decoded values and writes them back escaped once", () => { it("decodes the five named entities and character references, leaves the rest as written", () => { assert.equal(decodeXmlEntities(SAMPLE), `header.a > 1 && header.b == "x"`); assert.equal(decodeXmlEntities("<>&"'"), `<>&"'`); assert.equal(decodeXmlEntities("<<&"), "<<&"); // XML spells the hex form with a lower-case x only. assert.equal(decodeXmlEntities("<"), "<"); assert.equal(decodeXmlEntities("  & &unknown; &#xZZ;"), "  & &unknown; &#xZZ;"); }); it("parses an attribute to its decoded value, keeping the raw text and the delimiter", () => { const expr = exprOf(filterDoc(`expr="${SAMPLE}"`)); assert.equal(expr.value, `header.a > 1 && header.b == "x"`); assert.equal(expr.raw, SAMPLE); assert.equal(expr.quote, '"'); }); it("round trip of the sample with an edit: one escape, not two", () => { const text = filterDoc(`expr="${SAMPLE}"`); const shown = exprOf(text).value; const after = applyReplacement(text, computeSetAttribute(text, [0, 0], "expr", shown.replace("1", "2"))!); assert.match(after, /expr="header\.a > 2 && header\.b == "x""/); assert.equal(exprOf(after).value, `header.a > 2 && header.b == "x"`); }); it("round trip of the sample without an edit: no edit at all", () => { const text = filterDoc(`expr="${SAMPLE}"`); assert.equal(computeSetAttribute(text, [0, 0], "expr", exprOf(text).value), null); }); it("an unchanged value keeps the file's own spelling (<, >)", () => { assert.equal(computeSetAttribute(filterDoc(`expr="a < b > c"`), [0, 0], "expr", "a < b > c"), null); }); it("a value with each of & < > \" ' in a double-quoted attribute", () => { const text = filterDoc(`expr="old"`); const value = `a & b < c > d "q" 'p'`; const after = applyReplacement(text, computeSetAttribute(text, [0, 0], "expr", value)!); assert.match(after, /expr="a & b < c > d "q" 'p'"/); assert.equal(exprOf(after).value, value); }); it("a value with each of & < > \" ' in a single-quoted attribute keeps the author's quotes", () => { const text = filterDoc(`expr='a == "x"'`); assert.equal(exprOf(text).quote, "'"); const value = `a & b < c > d "q" 'p'`; const after = applyReplacement(text, computeSetAttribute(text, [0, 0], "expr", value)!); assert.match(after, /expr='a & b < c > d "q" 'p''/); assert.equal(exprOf(after).value, value); }); it("escapes by the delimiter only", () => { assert.equal(escapeAttributeValue(`"a" & 'b' <`), `"a" & 'b' <`); assert.equal(escapeAttributeValue(`"a" & 'b' <`, "'"), `"a" & 'b' <`); }); }); describe("entities: text content (log message and the other text rows)", () => { const logDoc = (message: string): string => `\n \n \n ${message}\n \n \n\n`; it("reads decoded, writes escaped once, and an unchanged value is no edit", () => { const text = logDoc("a < b && c"); assert.equal(textContent(deepest(parseXml(text).root)), "a < b && c"); assert.equal(computeSetTextContent(text, [0, 0, 0], "a < b && c"), null); const after = applyReplacement(text, computeSetTextContent(text, [0, 0, 0], "a < b && d")!); assert.match(after, /a < b && d<\/message>/); }); it("text kept in CDATA stays in CDATA, a ]]> inside is split", () => { const text = logDoc(""); assert.equal(computeSetTextContent(text, [0, 0, 0], "a < b"), null); const after = applyReplacement(text, computeSetTextContent(text, [0, 0, 0], "x < y ]]> z")!); assert.ok(after.includes(" z]]>")); assert.equal(textContent(deepest(parseXml(after).root)), "x < y ]]> z"); }); }); describe("entities: the endpoint uri, where & separates the query parameters", () => { it("decodes & before splitting and writes one parameter back escaped once", () => { const text = `\n \n \n \n\n`; const uri = attr(deepest(parseXml(text).root), "uri")!.value; assert.equal(uri, "sql:select 1?outputType=SelectOne&dataSource=#db"); const rebuilt = setUriOption(uri, "dataSource", "#main")!; const after = applyReplacement(text, computeSetAttribute(text, [0, 0], "uri", rebuilt)!); assert.ok(after.includes(`uri="sql:select 1?outputType=SelectOne&dataSource=#main"`)); }); }); describe("entities: graph labels and the grouped setters panel see decoded values", () => { const graph = buildFileGraph(parseXml(`
`).root, INDEX); const steps = graph.routes[0].steps as LeafView[]; it("the assignments a joined run's panel edits are decoded", () => { const assigns = steps.flatMap(s => s.assign ? [s.assign] : []); assert.deepEqual(assigns.map(a => a.text), ["header.n > 10 && header.ok", `"Tom & Jerry"`]); }); it("the setter rows tooltip is decoded", () => { const rows = steps.find(s => s.type === "setHeaders")!; assert.equal(rows.tooltip, "setHeaders\nlt = header.n < 5"); }); }); Path: redb-route/vscode-redb-route/src/test/graphmodel.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/graphmodel.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import * as fs from "node:fs"; import * as path from "node:path"; import { parseXml } from "../xmlmodel"; import { categoryOf } from "../category"; import { buildFileGraph, buildIndex, endpointLabel, redactUri, trimLabel, ElementInfo, BranchingView, ScopeView, LeafView, FileGraph, } from "../graphmodel"; const ELEMENTS: ElementInfo[] = JSON.parse(fs.readFileSync( path.join(__dirname, "..", "..", "media", "redb-route-elements.json"), "utf8")); const INDEX = buildIndex(ELEMENTS); function graphOf(xml: string): FileGraph { return buildFileGraph(parseXml(xml).root, INDEX); } describe("category — mechanical completeness over the generated list", () => { it("EVERY registry element has a category (drift fails the build)", () => { const missing = ELEMENTS .filter(e => e.kind === "Step" || e.kind === "Scope" || e.kind === "Branching") .filter(e => !["to", "toD", "wireTap", "enrich", "pollEnrich"].includes(e.name)) .filter(e => categoryOf(e.name) === null) .map(e => e.name); assert.deepEqual(missing, []); }); }); describe("labels (§5)", () => { it("endpoint label is scheme + last path segment", () => { assert.equal(endpointLabel("kafka://orders-vip?brokers=x"), "kafka orders-vip"); assert.equal(endpointLabel("direct://orders"), "direct orders"); assert.equal(endpointLabel("https://api.example.com/v1/orders?method=POST"), "https orders"); }); it("secrets never reach a label or a tooltip", () => { assert.equal( redactUri("amqp://admin:hunter2@broker:5672/vh?password=p%40ss&heartbeat=30"), "amqp://admin:***@broker:5672/vh?password=***&heartbeat=30"); assert.equal( redactUri("sql://orders?connection=Server=x;AccessKey=abc&timeout=5"), "sql://orders?connection=Server=x;AccessKey=***&timeout=5", "a secret-looking key is masked even nested inside a connection string — over-redaction is the safe direction"); assert.equal(redactUri("kafka://t?sharedAccessKeyName=k&sharedAccessKey=s3cr3t"), "kafka://t?sharedAccessKeyName=***&sharedAccessKey=***"); }); it("labels trim with an ellipsis", () => { assert.equal(trimLabel("short"), "short"); assert.equal(trimLabel("a-very-long-endpoint-name-indeed"), "a-very-long-endpoint-…"); }); it("a name-carrying step reads as name = value (§3.2)", () => { const graph = graphOf(` `); const set = graph.routes[0].steps[0] as LeafView; assert.equal(set.label, "priority = 'high'"); const remove = graph.routes[0].steps[1] as LeafView; assert.equal(remove.label, "x-internal"); }); }); describe("the render tree (§3)", () => { const graph = graphOf(` boom t f `); const route = graph.routes[0]; it("file strip carries the container onException", () => { assert.equal(graph.strips.length, 1); assert.equal(graph.strips[0].type, "onException"); assert.equal(graph.strips[0].category, "errors"); }); it("from is the source with an endpoint label", () => { assert.equal(route.from!.category, "source"); assert.equal(route.from!.label, "kafka orders"); }); it("leaf, scope, branching, unknown all come out", () => { const kinds = route.steps.map(s => s.kind); assert.deepEqual(kinds, ["leaf", "scope", "branching", "branching", "scope", "unknown"]); }); it("filter is a bracket with its condition on the schema (§3.3, principle 3)", () => { const filter = route.steps[1] as ScopeView; assert.equal(filter.type, "filter"); assert.equal(filter.label.includes("header.ok"), true); assert.equal((filter.steps[0] as LeafView).category, "sendInternal"); }); it("a long branch condition is capped in the label and whole in the tooltip", () => { // The box caps the text so a stack of branches stays readable; the tooltip is what the // reader opens to read the condition, so it must not repeat the cut (owner, 2026-09-20). const condition = "header.serials.decision == 'Rejected' && header.serials.partner == 'globex'"; const long = graphOf(` `).routes[0]; const branch = (long.steps[0] as BranchingView).branches[0]; assert.equal(branch.label.endsWith("…"), true, "the label is capped"); assert.equal(branch.tooltip, `when ${condition}`, "the tooltip carries the whole condition"); }); it("choice branches carry when-conditions and otherwise (§3.4)", () => { const choice = route.steps[2] as BranchingView; assert.equal(choice.branches.length, 2); assert.equal(choice.branches[0].label.startsWith("when "), true); assert.equal(choice.branches[1].label, "otherwise"); }); it("tryCatch: body branch plus warn-marked catch/finally (§3.6)", () => { const tc = route.steps[3] as BranchingView; assert.deepEqual(tc.branches.map(b => b.label), ["try", "catch TimeoutException", "finally"]); assert.deepEqual(tc.branches.map(b => b.warn), [false, true, true]); assert.equal(tc.branches[0].steps.length, 1, "the try body is the element's own steps"); }); it("split is a repeating bracket; bean target is user code (§3.5, §3.10)", () => { const split = route.steps[4] as ScopeView; assert.equal(split.repeats, true); assert.equal((split.steps[0] as LeafView).category, "userCode"); }); it("the unknown node keeps its raw name and the span (Р10)", () => { const unknown = route.steps[5]; assert.equal(unknown.kind, "unknown"); assert.equal(unknown.type, "acme:custom"); }); }); describe("special renders", () => { it("the structured bean endpoint is a user-code step, the root a registry row", () => { const graph = graphOf(` `); const step = graph.routes[0].steps[0] as LeafView; assert.equal(step.kind, "leaf"); assert.equal(step.scheme, "bean"); assert.equal(step.category, "userCode"); assert.deepEqual(graph.beans.map(b => b.name), ["stamps"]); }); it("the bean step is the same user-code tile in a route and in a scope", () => { const graph = graphOf(` `); const step = graph.routes[0].steps[0] as LeafView; assert.deepEqual([step.kind, step.type, step.scheme, step.category], ["leaf", "bean", "bean", "userCode"]); assert.equal(step.label, "#stamps.Stamp"); const inner = (graph.routes[0].steps[1] as ScopeView).steps[0] as LeafView; assert.deepEqual([inner.kind, inner.category], ["leaf", "userCode"]); assert.deepEqual(graph.beans.map(b => b.name), ["stamps"], "only the root is a registry row"); }); it("tryCatch with the EXPLICIT wrapper (the format's own shape)", () => { const graph = graphOf(` ok e `); const tc = graph.routes[0].steps[0] as BranchingView; assert.deepEqual(tc.branches.map(b => b.label), ["try", "catch Exception"]); assert.equal(tc.branches[0].steps.length, 2, "the wrapper's children are the body"); assert.equal(tc.branches[0].steps.every(s => s.kind === "leaf"), true, "no unknown node"); }); it("top-level bean declarations are a registry row, not unknown nodes", () => { const graph = graphOf(` `); assert.equal(graph.beans.length, 1); assert.equal(graph.beans[0].name, "stamps"); assert.equal(graph.others.length, 0); }); it("rich log is ONE node with a summary (§3.8)", () => { const graph = graphOf(` ab
`); const log = graph.routes[0].steps[0] as LeafView; assert.equal(log.kind, "leaf"); assert.equal(log.tooltip, "log: 2 message(s), 1 header(s), 1 propert(ies)"); }); it("multicast is unconditioned branches (§3.4)", () => { const graph = graphOf(` `); const multicast = graph.routes[0].steps[0] as BranchingView; assert.equal(multicast.kind, "branching"); assert.equal(multicast.branches.length, 2); }); it("a secret in a to-uri is redacted in both label and tooltip", () => { const graph = graphOf(` `); const to = graph.routes[0].steps[0] as LeafView; assert.equal(to.tooltip.includes("hunter2"), false); assert.equal(to.tooltip.includes("zzz"), false); assert.equal(to.label.includes("hunter2"), false); }); }); describe("endpoint scheme — what the tile shows instead of the element name", () => { const graph = graphOf(` `); const route = graph.routes[0]; it("a uri endpoint carries its scheme", () => { assert.equal(route.from?.scheme, "http"); assert.equal((route.steps[0] as LeafView).scheme, "bean"); }); it("the structural carries the child as its scheme and the SQL in the tooltip", () => { const sql = route.steps[1] as LeafView; assert.equal(sql.scheme, "sql"); assert.equal(sql.label, "sql"); assert.equal(sql.category, "sendExternal"); assert.ok(sql.tooltip.includes("dataSource=#honest-pg"), sql.tooltip); assert.ok(sql.tooltip.includes("SELECT status FROM wait WHERE id = :#id"), sql.tooltip); }); it("a step that is not an endpoint has no scheme", () => { assert.equal((route.steps[2] as LeafView).scheme, null); }); }); describe("setter rows — one tile for several assignments", () => { const graph = graphOf(` `); const step = graph.routes[0].steps[0] as LeafView; it("counts the rows in the label", () => { assert.equal(step.type, "setProperties"); assert.equal(step.label, "×2"); }); it("lists the rows in order, a constant quoted and an expression bare", () => { assert.equal(step.tooltip, 'setProperties\nomni.fail.status = "409"\nomni.fail.message = ${property.omni.SelectionError}'); }); }); Path: redb-route/vscode-redb-route/src/test/moduledir.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/moduledir.test.ts ---- import { describe, it, before, after } from "node:test"; import * as assert from "node:assert/strict"; import * as fs from "fs"; import * as os from "os"; import * as path from "path"; import { findModuleDir, moduleContextText, moduleResources } from "../moduledir"; import { beanCandidates } from "../beanref"; const CONTEXT = ` `; const ROUTES = ` `; const NO_FILE_OPEN = (): string | undefined => undefined; describe("module context.xml for # bean hints", () => { let root: string; let module: string; let route: string; before(() => { root = fs.mkdtempSync(path.join(os.tmpdir(), "redb-moduledir-")); module = path.join(root, "OrdersModule"); fs.mkdirSync(path.join(module, "routes"), { recursive: true }); fs.writeFileSync(path.join(module, "OrdersModule.csproj"), ""); fs.writeFileSync(path.join(module, "context.xml"), CONTEXT); route = path.join(module, "routes", "orders.route.xml"); fs.writeFileSync(route, ROUTES); }); after(() => fs.rmSync(root, { recursive: true, force: true })); it("finds the module root above routes/ by its .csproj", () => { assert.deepEqual(findModuleDir(path.dirname(route)), { dir: module, csproj: "OrdersModule.csproj" }); }); it("offers the route file's own beans first, then the beans of context.xml", () => { const candidates = beanCandidates(ROUTES, moduleContextText(route, NO_FILE_OPEN)); assert.deepEqual(candidates, [ { name: "local", fromContext: false }, { name: "orders", fromContext: true }, { name: "audit", fromContext: true }, ]); }); it("skips a commented-out bean of context.xml", () => { const names = beanCandidates(ROUTES, moduleContextText(route, NO_FILE_OPEN)).map(c => c.name); assert.equal(names.includes("retired"), false); }); it("lists a name declared in both files once, as the document's own", () => { const routes = ROUTES.replace(`name="local"`, `name="orders"`); const candidates = beanCandidates(routes, moduleContextText(route, NO_FILE_OPEN)); assert.deepEqual(candidates, [ { name: "orders", fromContext: false }, { name: "audit", fromContext: true }, ]); }); it("reads the unsaved text of an open context.xml before the file on disk", () => { const contextFile = path.join(module, "context.xml"); const edited = CONTEXT.replace(`name="audit"`, `name="auditTrail"`); const openText = (file: string) => (path.resolve(file) === path.resolve(contextFile) ? edited : undefined); const names = beanCandidates(ROUTES, moduleContextText(route, openText)).map(c => c.name); assert.deepEqual(names, ["local", "orders", "auditTrail"]); }); it("ignores a context.xml that is not a redb context document", () => { const foreign = ``; const names = beanCandidates(ROUTES, foreign).map(c => c.name); assert.deepEqual(names, ["local"]); }); it("gives no context beans to a file outside any module", () => { const loose = path.join(root, "loose", "a", "b", "c", "d", "loose.route.xml"); fs.mkdirSync(path.dirname(loose), { recursive: true }); fs.writeFileSync(loose, ROUTES); assert.equal(moduleContextText(loose, NO_FILE_OPEN), null); }); it("gives no context beans when the module has no context.xml", () => { const bare = path.join(root, "BareModule"); fs.mkdirSync(path.join(bare, "routes"), { recursive: true }); fs.writeFileSync(path.join(bare, "BareModule.csproj"), ""); assert.equal(moduleContextText(path.join(bare, "routes", "x.route.xml"), NO_FILE_OPEN), null); }); it("offers context.xml its own beans and does not read itself a second time", () => { const contextFile = path.join(module, "context.xml"); assert.equal(moduleContextText(contextFile, NO_FILE_OPEN), null); assert.deepEqual(beanCandidates(CONTEXT, null).map(c => c.name), ["orders", "audit"]); }); }); describe("module resources/ for path hints", () => { let root: string; let route: string; before(() => { root = fs.mkdtempSync(path.join(os.tmpdir(), "redb-resources-")); const module = path.join(root, "Orders"); fs.mkdirSync(path.join(module, "routes"), { recursive: true }); fs.mkdirSync(path.join(module, "resources", "xsd", "common"), { recursive: true }); fs.writeFileSync(path.join(module, "Orders.csproj"), ""); fs.writeFileSync(path.join(module, "loose.xsd"), ""); fs.writeFileSync(path.join(module, "resources", "map.xslt"), ""); fs.writeFileSync(path.join(module, "resources", "xsd", "order.xsd"), ""); fs.writeFileSync(path.join(module, "resources", "xsd", "common", "types.xsd"), ""); route = path.join(module, "routes", "orders.route.xml"); fs.writeFileSync(route, ""); }); after(() => fs.rmSync(root, { recursive: true, force: true })); it("lists the files and folders under resources/ relative to it, not the project root's files", () => { assert.deepEqual(moduleResources(route), { files: ["map.xslt", "xsd/common/types.xsd", "xsd/order.xsd"], dirs: ["", "xsd", "xsd/common"], }); }); it("gives nothing for a module without a resources folder", () => { const bare = path.join(root, "Bare"); fs.mkdirSync(bare); fs.writeFileSync(path.join(bare, "Bare.csproj"), ""); assert.equal(moduleResources(path.join(bare, "a.route.xml")), null); }); }); Path: redb-route/vscode-redb-route/src/test/newproject.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/newproject.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { displayCommand, dotnetNewArguments, formErrors, markMissingFrameworks, pagePackage, pageState, parameterPrompt, templateIcon, parameterValueError, projectNameError, } from "../newproject"; import { RedbTemplate, TemplateParameter } from "../templates"; function parameter(patch: Partial & { name: string }): TemplateParameter { return { displayName: null, description: null, kind: "text", datatype: "string", defaultValue: null, isRequired: false, choices: [], ...patch, }; } const FRAMEWORK = parameter({ name: "framework", displayName: "Framework", description: "Target framework", kind: "choice", datatype: "choice", defaultValue: "net10.0", choices: [ { value: "net8.0", description: ".NET 8" }, { value: "net9.0", description: null }, { value: "net10.0", description: ".NET 10" }, ], }); const CONTEXT = parameter({ name: "context", displayName: "Context", description: "Route context name", defaultValue: "" }); const DB = parameter({ name: "db", kind: "choice", datatype: "choice", defaultValue: "sqlite", choices: [{ value: "sqlite", description: null }, { value: "postgres", description: null }], }); const PRO = parameter({ name: "pro", kind: "bool", datatype: "bool", defaultValue: "true" }); describe("newproject — the project name", () => { it("accepts names dotnet new and the file system take", () => { for (const name of ["Orders", "orders.intake", "Orders_Intake-2", "_tmp"]) assert.equal(projectNameError(name), null, name); }); it("refuses empty, spaced, odd and reserved names", () => { for (const name of ["", " ", "my module", "1orders", "orders.", "a/b", "CON", "lpt1.route"]) assert.notEqual(projectNameError(name), null, JSON.stringify(name)); }); }); describe("newproject — asking for a parameter", () => { it("asks a choice as a pick list with the default picked", () => { const prompt = parameterPrompt(FRAMEWORK); assert.equal(prompt.kind, "pick"); if (prompt.kind !== "pick") return; assert.equal(prompt.title, "Framework"); assert.equal(prompt.placeholder, "Target framework"); assert.deepEqual(prompt.items.filter(i => i.picked).map(i => i.value), ["net10.0"]); assert.equal(prompt.items[0].description, ".NET 8"); assert.equal(prompt.items[1].description, undefined); }); it("picks the first choice when a choice has no default", () => { const prompt = parameterPrompt({ ...DB, defaultValue: null }); assert.equal(prompt.kind === "pick" && prompt.items[0].picked, true); }); it("asks a bool as yes or no", () => { const prompt = parameterPrompt(PRO); assert.equal(prompt.kind, "pick"); if (prompt.kind !== "pick") return; assert.deepEqual(prompt.items.map(i => [i.label, i.value, i.picked]), [["Yes", "true", true], ["No", "false", false]]); }); it("asks text in an input box, telling that an empty box keeps the template's default", () => { const prompt = parameterPrompt(CONTEXT); assert.equal(prompt.kind, "input"); if (prompt.kind !== "input") return; assert.equal(prompt.value, ""); assert.match(prompt.placeholder, /leave empty for the template's default/); const named = parameterPrompt(parameter({ name: "port", defaultValue: "8080" })); assert.equal(named.kind === "input" && named.value, "8080"); assert.equal(named.title, "port"); }); it("marks frameworks without an SDK and leaves the rest", () => { const prompt = parameterPrompt(FRAMEWORK); if (prompt.kind !== "pick") return assert.fail(); const marked = markMissingFrameworks(prompt.items, [8, 9]); assert.deepEqual(marked.map(i => i.description), [".NET 8", undefined, ".NET 10, no .NET SDK for it on this machine"]); assert.deepEqual(markMissingFrameworks(prompt.items, [10]).map(i => i.description), [".NET 8", undefined, ".NET 10"]); const odd = [{ label: "netstandard2.0", value: "netstandard2.0", picked: false }]; assert.deepEqual(markMissingFrameworks(odd, []), odd); }); it("checks required and numeric text values", () => { assert.equal(parameterValueError(CONTEXT, ""), null); assert.match(parameterValueError({ ...CONTEXT, isRequired: true }, "")!, /Context is required/); const port = parameter({ name: "port", datatype: "int" }); assert.equal(parameterValueError(port, "8080"), null); assert.equal(parameterValueError(port, "80a"), "Enter a whole number."); }); }); describe("newproject — the dotnet new command", () => { const base = { shortName: "redb-route-sql", name: "Orders", outputDirectory: "C:\\My Projects\\Orders", parameters: [CONTEXT, FRAMEWORK, DB, PRO], }; it("passes only what differs from the template's defaults", () => { const args = dotnetNewArguments({ ...base, values: new Map([ ["context", ""], ["framework", "net9.0"], ["db", "sqlite"], ["pro", "false"], ]) }); assert.deepEqual(args, ["new", "redb-route-sql", "-n", "Orders", "-o", "C:\\My Projects\\Orders", "--framework", "net9.0", "--pro", "false"]); }); it("passes a typed context and keeps the path with spaces as one argument", () => { const args = dotnetNewArguments({ ...base, values: new Map([["context", "orders-ctx"]]) }); assert.deepEqual(args.slice(4), ["-o", "C:\\My Projects\\Orders", "--context", "orders-ctx"]); }); it("passes a required value even when it equals the default", () => { const required = parameter({ name: "region", defaultValue: "eu", isRequired: true }); const args = dotnetNewArguments({ ...base, parameters: [required], values: new Map([["region", "eu"]]) }); assert.deepEqual(args.slice(6), ["--region", "eu"]); }); it("shows the command quoted where a shell would need it", () => { assert.equal(displayCommand("dotnet", ["new", "redb-route", "-o", "C:\\My Projects\\x"]), "dotnet new redb-route -o \"C:\\My Projects\\x\""); }); it("shows an argument the way a command line reads it back: quotes and trailing backslashes escaped", () => { // A folder ending in a backslash: doubled, or it would escape the closing quote. assert.equal(displayCommand("dotnet", ["-o", "C:\\My Projects\\"]), "dotnet -o \"C:\\My Projects\\\\\""); // A quote inside, with and without backslashes before it. assert.equal(displayCommand("dotnet", [`say "hi"`]), String.raw`dotnet "say \"hi\""`); assert.equal(displayCommand("dotnet", [String.raw`a\"b`]), String.raw`dotnet "a\\\"b"`); // A path without spaces stays as it is; an empty argument stays visible. assert.equal(displayCommand("dotnet", [String.raw`C:\dir\x`]), String.raw`dotnet C:\dir\x`); assert.equal(displayCommand("dotnet", ["new", ""]), `dotnet new ""`); }); }); function redbTemplate(patch: Partial & { shortName: string }): RedbTemplate { return { name: patch.shortName, description: null, identity: null, type: "project", group: "apps", classifications: [], packageId: "redb.Templates", parameters: [], ...patch, }; } describe("newproject — the page", () => { const route = redbTemplate({ shortName: "redb-route", name: "redb.Route XML module", group: "route-xml", parameters: [CONTEXT, FRAMEWORK] }); const consoleApp = redbTemplate({ shortName: "redb", name: "RedBase Console Application", parameters: [DB, PRO] }); it("describes the packages as installed, outdated or missing", () => { const installed = { packageId: "redb.Templates", version: "4.4.2", mountPoint: "x" }; assert.deepEqual(pagePackage("redb.Templates", { kind: "outdated", installed, latest: "4.4.3" }), { packageId: "redb.Templates", kind: "outdated", installed: "4.4.2", latest: "4.4.3" }); assert.deepEqual(pagePackage("redb.Tsak.Templates", { kind: "missing", latest: null }), { packageId: "redb.Tsak.Templates", kind: "missing", installed: null, latest: null }); assert.deepEqual(pagePackage("redb.Templates", { kind: "current", installed }), { packageId: "redb.Templates", kind: "current", installed: "4.4.2", latest: null }); }); it("turns parameters into form fields and preselects redb-route", () => { const state = pageState([8, 9], [], [consoleApp, route], "C:\work"); assert.equal(state.selected, "redb-route"); assert.deepEqual(state.groups.map(g => g.group), ["route-xml", "apps"]); const fields = state.templates[1].fields; assert.deepEqual(fields.map(f => [f.name, f.kind, f.value]), [["context", "text", ""], ["framework", "select", "net10.0"]]); assert.match(fields[1].options[2].description!, /no \.NET SDK/); const pro = state.templates[0].fields[1]; assert.deepEqual(pro.options.map(o => [o.label, o.value]), [["Yes", "true"], ["No", "false"]]); assert.equal(pro.value, "true"); }); it("preselects the first template without redb-route, and nothing without templates", () => { assert.equal(pageState([10], [], [consoleApp], "/w").selected, "redb"); const empty = pageState(null, [], [], "/w"); assert.equal(empty.selected, null); assert.deepEqual(empty.groups, []); assert.equal(empty.sdks, null); }); it("checks the form field by field", () => { const ok = { template: "redb", name: "Orders", folder: "C:\work", values: { db: "postgres", pro: "false" } }; assert.deepEqual(formErrors(ok, consoleApp, false), {}); assert.deepEqual(Object.keys(formErrors({ ...ok, name: "my app", folder: " " }, consoleApp, false)).sort(), ["folder", "name"]); assert.match(formErrors(ok, consoleApp, true).folder, /already exists/); assert.deepEqual(Object.keys(formErrors({ ...ok, values: { db: "oracle", pro: "maybe" } }, consoleApp, false)).sort(), ["db", "pro"]); assert.deepEqual(formErrors(ok, undefined, false), { template: "Choose a template." }); }); }); describe("newproject — the card glyphs", () => { const icon = (shortName: string, group: RedbTemplate["group"], classifications: string[] = []) => templateIcon({ shortName, group, classifications }); const XML = ["Integration", "XML", "Tsak", "RedBase", "RouteXml"]; it("reads the scenario from the short name of an XML module", () => { assert.deepEqual([ "redb-route-as4", "redb-route-eip", "redb-route-kafka", "redb-route-rabbitmq", "redb-route-rest", "redb-route-scatter-gather", "redb-route-sql-batch", "redb-route-sql", "redb-route-beans", "redb-route-validator-xslt", ].map(n => icon(n, "route-xml", XML)), [ "envelope", "split", "stream", "queue", "api", "fan", "database", "database", "cube", "check", ]); }); it("gives the basic module the route glyph, not one from its classifications", () => { assert.equal(icon("redb-route", "route-xml", XML), "route"); }); it("reads applications and hosts by name, then classifications, then group", () => { assert.equal(icon("tsak-worker", "tsak", ["Worker", "Service", "redb.Tsak"]), "server"); assert.equal(icon("redb-identity-app", "apps", ["Web"]), "shield"); assert.equal(icon("redb-bff", "apps"), "browser"); assert.equal(icon("redb-chat", "apps"), "chat"); assert.equal(icon("redb", "apps", ["Console", "Database", "RedBase"]), "terminal"); assert.equal(icon("redb-worker", "apps", ["Worker", "Integration"]), "server"); assert.equal(icon("something-new", "apps", ["RedBase"]), "document"); assert.equal(icon("tsak-something", "tsak", ["redb.Tsak"]), "server"); }); }); Path: redb-route/vscode-redb-route/src/test/palette.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/palette.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { buildPalette } from "../palette"; describe("buildPalette — Send to", () => { const sendTo = (schemes: Parameters[1]) => buildPalette([], schemes).find(c => c.title === "Send to (endpoints)")?.items.map(i => i.label) ?? []; it("offers every component with a producer side and skips a consumer-only one", () => { assert.deepEqual(sendTo([ { scheme: "smtp", role: "producer" }, { scheme: "imap", role: "consumer" }, { scheme: "kafka" }, { scheme: "cron", role: "consumer" }, ]), ["kafka", "smtp"]); }); it("reads no role as both sides", () => { assert.deepEqual(sendTo([{ scheme: "sql" }, { scheme: "direct", pathSynonym: "name" }]), ["direct", "sql"]); }); it("keeps the sender fragment and the path hint", () => { const item = buildPalette([], [{ scheme: "direct", pathSynonym: "name" }]) .find(c => c.title === "Send to (endpoints)")?.items[0]; assert.deepEqual(item, { label: "direct", fragment: ``, hint: "path = name" }); }); }); Path: redb-route/vscode-redb-route/src/test/placeholders.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/placeholders.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { resolvePlaceholders, mergeContextLayer, moduleContextName, packageName, ConfigMap, } from "../placeholders"; describe("placeholder resolution (§8, Р18 — display only)", () => { const config: ConfigMap = new Map([["demo.rabbit.producer", "rabbitmq://demo-out?durable=true"]]); it("substitutes a full-uri placeholder", () => { const r = resolvePlaceholders("{{demo.rabbit.producer}}", config); assert.equal(r.resolved, "rabbitmq://demo-out?durable=true"); assert.equal(r.fromConfig, true); }); it("uses the inline default when the key is missing", () => { const r = resolvePlaceholders("http:{{demo.http.listen:0.0.0.0:5088}}/api", new Map()); assert.equal(r.resolved, "http:0.0.0.0:5088/api"); assert.equal(r.fromConfig, true); }); it("keeps an unresolvable placeholder as-is and reports it", () => { const r = resolvePlaceholders("kafka://{{topic}}", new Map()); assert.equal(r.resolved, "kafka://{{topic}}"); assert.deepEqual(r.missing, ["topic"]); assert.equal(r.fromConfig, false); }); it("resolves a placeholder nested inside a config value", () => { const nested: ConfigMap = new Map([ ["demo.sql.insert", "sql://INSERT?connection={{db.main.connection}}"], ["db.main.connection", "Host=x;Database=demo"], ]); const r = resolvePlaceholders("{{demo.sql.insert}}", nested); assert.equal(r.resolved, "sql://INSERT?connection=Host=x;Database=demo"); }); it("looks keys up case-insensitively, as the runtime's context properties are", () => { const r = resolvePlaceholders("{{Demo.Rabbit.Producer}}", config); assert.equal(r.resolved, "rabbitmq://demo-out?durable=true"); }); it("treats an empty value as none: the default applies, else the key is missing", () => { const empty: ConfigMap = new Map([["port", ""]]); assert.equal(resolvePlaceholders("{{port:8080}}", empty).resolved, "8080"); assert.deepEqual(resolvePlaceholders("{{port}}", empty).missing, ["port"]); }); }); describe("config layers as the Tsak runtime reads them", () => { const resolve = (text: string, map: ConfigMap) => resolvePlaceholders(text, map).resolved; it("takes Contexts.default and the module's own context over it", () => { const map: ConfigMap = new Map(); mergeContextLayer({ Contexts: { default: { "hello.period": "1000", "db.main": "Host=shared" }, orders: { "hello.period": "5000" }, other: { "db.main": "Host=other" }, }, }, "orders", map); assert.equal(resolve("{{hello.period}}", map), "5000"); assert.equal(resolve("{{db.main}}", map), "Host=shared"); }); it("does not read into nested objects: the runtime keeps them as one dictionary property", () => { const map: ConfigMap = new Map(); mergeContextLayer({ Contexts: { orders: { hello: { period: "5000" } } } }, "orders", map); const r = resolvePlaceholders("timer://t?period={{hello.period}}", map); assert.deepEqual(r.missing, ["hello.period"]); assert.equal(resolve("{{hello.period:250}}", map), "250"); }); it("reads root keys when there is no Contexts section, nested objects still not flattened", () => { const map: ConfigMap = new Map(); mergeContextLayer({ "a.b": 5, on: true, demo: { tag: "x" } }, "orders", map); assert.equal(map.get("a.b"), "5"); assert.equal(map.get("on"), "True"); assert.equal(map.has("demo.tag"), false); assert.equal(map.has("demo"), false); }); it("matches the section and context names case-insensitively", () => { const map: ConfigMap = new Map(); mergeContextLayer({ contexts: { DEFAULT: { a: "1" }, Orders: { b: "2" } } }, "orders", map); assert.equal(map.get("a"), "1"); assert.equal(map.get("b"), "2"); }); it("takes only Contexts.default when the context is not known", () => { const map: ConfigMap = new Map(); mergeContextLayer({ Contexts: { default: { a: "1" }, orders: { b: "2" } } }, null, map); assert.deepEqual([...map.keys()], ["a"]); }); it("lets the context's object or null hide the shared value, as DeepMerge leaves no string there", () => { const map: ConfigMap = new Map(); mergeContextLayer({ Contexts: { default: { a: "1", b: "2" }, orders: { a: { x: "y" }, b: null } } }, "orders", map); assert.equal(map.size, 0); }); it("reads the module's own config by the same rule, over the context file", () => { const map: ConfigMap = new Map(); mergeContextLayer({ Contexts: { orders: { "hello.period": "5000", "db.main": "Host=a" } } }, "orders", map); mergeContextLayer({ ContextName: "orders", Contexts: { default: { "db.main": "Host=b" }, orders: { "hello.period": 7000 }, other: { "hello.period": 1 }, } }, "orders", map); assert.equal(map.get("hello.period"), "7000"); assert.equal(map.get("db.main"), "Host=b"); assert.equal(map.has("contexts"), false); assert.equal(map.has("contextname"), false); const flat: ConfigMap = new Map(); mergeContextLayer({ ContextName: "orders", "hello.period": 7000 }, "orders", flat); assert.equal(flat.get("hello.period"), "7000"); assert.equal(flat.get("contextname"), "orders"); }); }); describe("the module's package and context names", () => { it("takes the package name from RoutePackageName, else the csproj's file name", () => { assert.equal(packageName("Orders.csproj", " orders "), "orders"); assert.equal(packageName("Orders.Module.csproj", ""), "Orders.Module"); }); it("takes ContextName from the module config, else RouteContextName, else the package", () => { const csproj = "from-csproj"; assert.equal(moduleContextName({ ContextName: "from-config" }, csproj, "pkg"), "from-config"); assert.equal(moduleContextName({ contextname: " spaced " }, csproj, "pkg"), "spaced"); assert.equal(moduleContextName(undefined, csproj, "pkg"), "from-csproj"); assert.equal(moduleContextName({ ContextName: "" }, "", "pkg"), "pkg"); }); }); Path: redb-route/vscode-redb-route/src/test/routescan.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/routescan.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { scanRoutes } from "../routescan"; const SAMPLE = ` ') ]]> `; describe("scanRoutes — a '>' in a quoted value", () => { it("keeps the attributes after a description holding '>'", () => { const routes = scanRoutes(` `); assert.equal(routes.length, 1); assert.equal(routes[0].id, "big"); assert.equal(routes[0].description, "amount>1000"); assert.equal(routes[0].from, "direct://big"); }); }); describe("scanRoutes — the sidebar tree", () => { it("finds every route with id, description, from and the LINE", () => { const routes = scanRoutes(SAMPLE); assert.equal(routes.length, 3); assert.deepEqual(routes[0], { id: "orders-intake", description: "Kafka to redb", from: "kafka://orders?groupId=svc", line: 3, }); assert.equal(routes[1].id, null, "a route without id still shows"); assert.equal(routes[1].from, "direct://anonymous"); assert.equal(routes[1].line, 7); }); it("skips commented-out and CDATA-buried route tags", () => { const ids = scanRoutes(SAMPLE).map(r => r.id); assert.ok(!ids.includes("commented-out")); assert.ok(!ids.includes("fake")); }); it("reads attributes split across lines", () => { const multi = scanRoutes(SAMPLE)[2]; assert.equal(multi.id, "multi"); assert.equal(multi.line, 10); }); it("returns nothing for a document without routes", () => { assert.deepEqual(scanRoutes(``), []); }); }); Path: redb-route/vscode-redb-route/src/test/skeletonscope.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/skeletonscope.test.ts ---- import { strict as assert } from "node:assert"; import { describe, it } from "node:test"; import * as fs from "node:fs"; import * as path from "node:path"; import { buildIndex, ElementInfo } from "../graphmodel"; import { skeletonPlace } from "../skeletonscope"; /** * Which skeletons a position gets: the container level takes a ``, a place that holds steps * takes the composite skeletons (``, ``), everything else takes none. The provider * used to offer the whole list at every element position, so `` was suggested directly under * `` — where the loader refuses it (" is not valid at the container level") and the * schema never offered it (owner finding 2026-10-08). * * The element list here is the generated one the extension ships, so the answers are pinned against * what the schema says, not against a copy. */ describe("the skeleton place", () => { const media = path.join(__dirname, "..", "..", "media"); const index = buildIndex(JSON.parse( fs.readFileSync(path.join(media, "redb-route-elements.json"), "utf8")) as ElementInfo[]); /** The place at the `|` marker. */ const placeOf = (document: string): string | null => skeletonPlace(document, document.indexOf("|"), index); const document = (inner: string): string => `\n\n${inner}\n`; it("takes a route beside the other routes, not a step", () => { assert.equal(placeOf(document(" |")), "document-root"); }); it("takes steps inside a route", () => { assert.equal(placeOf(document(` \n |\n `)), "step-content"); }); it("takes steps inside an onException — a handler is a route of its own", () => { assert.equal( placeOf(document(` \n |\n `)), "step-content"); }); it("takes steps inside a choice branch and a tryCatch handler", () => { assert.equal( placeOf(document(` \n \n \n |\n \n \n `)), "step-content"); assert.equal( placeOf(document(` \n \n \n |\n \n \n `)), "step-content"); }); it("takes nothing in a handler's condition — the of an onException holds no steps", () => { assert.equal( placeOf(document(` \n \n |\n \n `)), null); }); it("takes nothing inside a bean, a step or a foreign element", () => { assert.equal(placeOf(document(` \n |\n `)), null); assert.equal(placeOf(document(` \n \n |\n \n `)), null, "the bean step is a leaf: its settings are attributes, not steps"); assert.equal(placeOf(document(` \n \n |\n \n `)), null); assert.equal(placeOf(document(` \n \n |\n \n `)), null); }); it("reads an element whose attribute value holds '>' as one open element", () => { assert.equal( placeOf(document(` \n \n |\n \n `)), "step-content"); }); it("reads a half-typed document — the tree parser refuses it by design ('>' expected)", () => { const text = document(` \n skeletonPlace(text, text.lastIndexOf(" { const text = document(" "); assert.equal(skeletonPlace(text, text.length + 5, index), null); }); }); Path: redb-route/vscode-redb-route/src/test/sniff.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/sniff.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { sniff } from "../sniff"; describe("sniff — the activation contract", () => { it("recognizes a routes document", () => { const result = sniff(`\n\n`); assert.deepEqual(result, { kind: "routes", namespace: "urn:redb:route:1.0" }); }); it("recognizes a context document behind comments and whitespace", () => { const result = sniff(`\n\n\n`); assert.equal(result?.kind, "context"); }); it("reads the namespace after an attribute whose value holds '>'", () => { assert.equal(sniff(``)?.kind, "routes"); }); it("accepts a newer MINOR of the same major (§3.2)", () => { assert.equal(sniff(``)?.kind, "routes"); }); it("rejects another MAJOR", () => { assert.equal(sniff(``), null); }); it("recognizes a prefixed root", () => { const result = sniff(``); assert.equal(result?.kind, "routes"); }); it("REJECTS a foreign route.xml — the negative half of the contract", () => { assert.equal(sniff(``), null); assert.equal(sniff(`\n \n`), null, "no namespace at all"); assert.equal(sniff(``), null, "wrong root name"); }); it("rejects things that are not XML", () => { assert.equal(sniff(""), null); assert.equal(sniff("just text"), null); assert.equal(sniff("{\"routes\": []}"), null); }); it("does not confuse a prefixed root with a default namespace", () => { assert.equal(sniff(``), null, "the prefix r has no declaration — the default namespace is not its"); }); }); Path: redb-route/vscode-redb-route/src/test/tagscan.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/tagscan.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { tagEnd } from "../tagscan"; describe("tagEnd — a '>' in a quoted value does not close the tag", () => { it("finds the closing '>' of a plain tag", () => { const text = ``; assert.equal(tagEnd(text, 0), text.length - 1); }); it("skips a '>' inside double and single quotes", () => { const text = ``; assert.equal(tagEnd(text, 0), text.length - 1); }); it("keeps the tag open while a quote is open or the '>' lies beyond the limit", () => { assert.equal(tagEnd(``; assert.equal(tagEnd(text, 0, 5), -1); }); }); Path: redb-route/vscode-redb-route/src/test/templates.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/templates.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import * as fs from "fs"; import * as os from "os"; import * as path from "path"; import { findTemplatePackage, isTemplateDefinition, parseTemplateRegistry, readTemplateDefinitions, orderTemplates, selectTemplates, stripJsonComments, templateRegistryPath, } from "../templates"; import { buildZip } from "./zipfixture"; /** A template.json in the agreed shape; `patch` overrides top-level fields. */ function definition(patch: Record = {}): string { return JSON.stringify({ identity: "RedBase.Route.Xml.Base", name: "redb.Route XML module: Base", description: "An empty Tsak module with one small XML route.", shortName: "redb-route", classifications: ["Integration", "XML", "Tsak", "RedBase", "RouteXml"], tags: { type: "project" }, sourceName: "RouteModule", symbols: { context: { type: "parameter", datatype: "string", defaultValue: "", displayName: "Context", description: "Route context name" }, framework: { type: "parameter", datatype: "choice", defaultValue: "net10.0", displayName: "Framework", description: "Target framework", choices: [ { choice: "net8.0", description: ".NET 8" }, { choice: "net9.0", description: ".NET 9" }, { choice: "net10.0", description: ".NET 10" }, ], }, UseSqlite: { type: "computed", value: "(db == \"sqlite\")" }, }, ...patch, }); } const REGISTRY = "\uFEFF" + JSON.stringify({ Packages: [ { Details: { PackageId: "redb.Tsak.Templates", Version: "4.4.2" }, MountPointUri: "C:\\Users\\u\\.templateengine\\packages\\redb.Tsak.Templates.4.4.2.nupkg" }, { Details: { PackageId: "redb.Templates", Version: "4.4.3" }, MountPointUri: "C:\\Users\\u\\.templateengine\\packages\\redb.Templates.4.4.3.nupkg" }, { Details: { PackageId: "broken" } }, { MountPointUri: "D:\\templates\\dev" }, ], }); describe("templates — the engine's registry", () => { it("reads packages.json with its BOM and skips incomplete entries", () => { const packages = parseTemplateRegistry(REGISTRY); assert.deepEqual(packages.map(p => p.packageId), ["redb.Tsak.Templates", "redb.Templates"]); assert.equal(packages[1].version, "4.4.3"); }); it("finds a package by id whatever the case", () => { const packages = parseTemplateRegistry(REGISTRY.replace("\"redb.Templates\"", "\"Redb.templates\"")); assert.equal(findTemplatePackage(packages, "redb.Templates")?.version, "4.4.3"); assert.equal(findTemplatePackage(packages, "redb.tsak.templates")?.version, "4.4.2"); assert.equal(findTemplatePackage([], "redb.Templates"), null); }); it("reads an empty or foreign registry as no packages", () => { assert.deepEqual(parseTemplateRegistry("{}"), []); }); it("keeps the registry under DOTNET_CLI_HOME when it is set", () => { assert.equal(templateRegistryPath({}, "/home/u"), path.join("/home/u", ".templateengine", "packages.json")); assert.equal(templateRegistryPath({ DOTNET_CLI_HOME: "/cli" }, "/home/u"), path.join("/cli", ".templateengine", "packages.json")); assert.equal(templateRegistryPath({ DOTNET_CLI_HOME: " " }, "/home/u"), path.join("/home/u", ".templateengine", "packages.json")); }); it("recognises template definitions inside a package", () => { assert.equal(isTemplateDefinition("content/redb-route/.template.config/template.json"), true); assert.equal(isTemplateDefinition("content\\redb-route\\.template.config\\template.json"), true); assert.equal(isTemplateDefinition("content/redb-route/template.json"), false); assert.equal(isTemplateDefinition("content/redb-route/.template.config/dotnetcli.host.json"), false); }); }); describe("templates — which templates the page offers", () => { const select = (definitions: string[]) => selectTemplates(definitions, "redb.Templates"); it("takes project and solution templates and groups them", () => { const templates = select([ definition(), definition({ shortName: "redb-app", name: "RedBase Blazor WebAssembly App", classifications: ["Web", "RedBase"], tags: { language: "C#", type: "solution" } }), definition({ shortName: "tsak-worker", name: "redb.Tsak Worker Host", classifications: ["Worker", "redb.Tsak"] }), ]); assert.deepEqual(templates.map(t => [t.shortName, t.type, t.group, t.packageId]), [ ["redb-route", "project", "route-xml", "redb.Templates"], ["redb-app", "solution", "apps", "redb.Templates"], ["tsak-worker", "project", "tsak", "redb.Templates"], ]); }); it("orders by group, the default first, then by name", () => { const ordered = orderTemplates([ ...select([definition({ shortName: "redb", name: "RedBase Console Application", classifications: ["Console"] })]), ...select([definition({ shortName: "redb-route-kafka", name: "redb.Route XML module: Kafka" })]), ...selectTemplates([definition({ shortName: "tsak-worker", classifications: ["redb.Tsak"] })], "redb.Tsak.Templates"), ...select([definition()]), ...select([definition({ shortName: "redb-route-beans", name: "redb.Route XML module: Beans" })]), ]); assert.deepEqual(ordered.map(t => t.shortName), ["redb-route", "redb-route-beans", "redb-route-kafka", "tsak-worker", "redb"]); }); it("skips item templates, unnamed ones and broken definitions", () => { const templates = select([ definition({ tags: { type: "item" } }), definition({ tags: {} }), definition({ shortName: [] }), "not json", ]); assert.deepEqual(templates, []); }); it("calls a template by the first of its short names", () => { const [template] = select([definition({ shortName: ["redb-route-sql", "xml-sql"] })]); assert.equal(template.shortName, "redb-route-sql"); }); it("reads the parameters, not the computed symbols", () => { const [template] = select([definition()]); assert.deepEqual(template.parameters.map(p => [p.name, p.kind]), [["context", "text"], ["framework", "choice"]]); const framework = template.parameters[1]; assert.equal(framework.defaultValue, "net10.0"); assert.equal(framework.displayName, "Framework"); assert.deepEqual(framework.choices.map(c => c.value), ["net8.0", "net9.0", "net10.0"]); assert.equal(framework.choices[2].description, ".NET 10"); assert.equal(template.parameters[0].defaultValue, ""); }); it("maps bool, required and typed text parameters", () => { const [template] = select([definition({ symbols: { pro: { type: "parameter", datatype: "bool", defaultValue: true }, port: { type: "parameter", datatype: "int", isRequired: "true" }, }, })]); assert.deepEqual(template.parameters.map(p => [p.name, p.kind, p.datatype, p.defaultValue, p.isRequired]), [ ["pro", "bool", "bool", "true", false], ["port", "text", "int", null, true], ]); }); it("falls back to the short name when a template has no name", () => { const [template] = select([definition({ name: undefined, description: "" })]); assert.equal(template.name, "redb-route"); assert.equal(template.description, null); }); it("reads template.json with comments, keeping // inside strings", () => { const text = `{ // the base template "shortName": "redb-route", /* block */ "description": "See https://redbase.app // not a comment", "classifications": ["RouteXml"], "tags": { "type": "project" } }`; assert.equal(JSON.parse(stripJsonComments(text)).description, "See https://redbase.app // not a comment"); assert.equal(selectTemplates([text], "redb.Templates").length, 1); }); }); describe("templates — reading an installed package", () => { it("reads the definitions of a .nupkg", () => { const dir = fs.mkdtempSync(path.join(os.tmpdir(), "redb-templates-")); try { const nupkg = path.join(dir, "redb.Templates.4.4.3.nupkg"); fs.writeFileSync(nupkg, buildZip([ { name: "redb.Templates.nuspec", content: "" }, { name: "content/redb-route/.template.config/template.json", content: definition() }, { name: "content/redb-route/routes/main.route.xml", content: "" }, { name: "content/redb-app/.template.config/template.json", content: definition({ shortName: "redb-app", classifications: ["Web"] }) }, ])); const definitions = readTemplateDefinitions(nupkg); assert.equal(definitions.length, 2); assert.deepEqual(selectTemplates(definitions, "redb.Templates").map(t => t.shortName), ["redb-route", "redb-app"]); } finally { fs.rmSync(dir, { recursive: true, force: true }); } }); it("reads the definitions of a template folder installed from disk", () => { const dir = fs.mkdtempSync(path.join(os.tmpdir(), "redb-templates-")); try { const config = path.join(dir, "templates", "redb-route", ".template.config"); fs.mkdirSync(config, { recursive: true }); fs.writeFileSync(path.join(config, "template.json"), definition()); const stale = path.join(dir, "templates", "redb-route", "bin", ".template.config"); fs.mkdirSync(stale, { recursive: true }); fs.writeFileSync(path.join(stale, "template.json"), definition({ shortName: "redb-route-stale" })); assert.deepEqual(selectTemplates(readTemplateDefinitions(dir), "redb.Templates").map(t => t.shortName), ["redb-route"]); } finally { fs.rmSync(dir, { recursive: true, force: true }); } }); }); Path: redb-route/vscode-redb-route/src/test/textedit.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/textedit.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { computeSetAttribute, computeSetTextContent, computeRemoveElement, computeInsertChild, computeInsertAt, computeMoveElement, computeRenameElement, blockSpan, applyReplacement, escapeAttributeValue, resolveByPath, TextReplacement, } from "../textedit"; import { parseXml } from "../xmlmodel"; const DOC = ` `; /** The §8.3 contract: exactly ONE line differs. */ function assertOneLineDiff(before: string, after: string): void { const beforeLines = before.split("\n"); const afterLines = after.split("\n"); assert.equal(afterLines.length, beforeLines.length, "no lines added or removed"); const changed = beforeLines.filter((line, i) => line !== afterLines[i]); assert.equal(changed.length, 1, "exactly one line changed"); } describe("computeSetAttribute — the one-line surgical diff (§8.3)", () => { it("replaces an existing value inside its quotes", () => { const edit = computeSetAttribute(DOC, [0, 1], "name", "priority")!; const after = applyReplacement(DOC, edit); assertOneLineDiff(DOC, after); assert.match(after, / { const edit = computeSetAttribute(DOC, [0, 2], "id", "guard")!; const after = applyReplacement(DOC, edit); assertOneLineDiff(DOC, after); assert.match(after, //); }); it("adds onto a self-closing tag before the />", () => { const edit = computeSetAttribute(DOC, [0, 0], "id", "src")!; const after = applyReplacement(DOC, edit); assertOneLineDiff(DOC, after); assert.match(after, //); }); it("removes an attribute together with its leading space", () => { const edit = computeSetAttribute(DOC, [0], "description", null)!; const after = applyReplacement(DOC, edit); assertOneLineDiff(DOC, after); assert.match(after, //); }); it("escapes XML metacharacters in the new value", () => { assert.equal(escapeAttributeValue(`a < b & c == "x"`), "a < b & c == "x""); const edit = computeSetAttribute(DOC, [0, 2], "expr", `total < 100 & ok`)!; const after = applyReplacement(DOC, edit); assertOneLineDiff(DOC, after); assert.match(after, /expr="total < 100 & ok"/); // and the edited document still parses parseXml(after); }); it("returns null when nothing changes", () => { assert.equal(computeSetAttribute(DOC, [0], "id", "main"), null); assert.equal(computeSetAttribute(DOC, [0], "nonexistent", null), null); }); it("COMMENTS and everything else stay byte-identical outside the one line", () => { const edit = computeSetAttribute(DOC, [0, 1], "expr", "${header.b}")!; const after = applyReplacement(DOC, edit); assert.equal(after.includes(""), true); assertOneLineDiff(DOC, after); }); it("resolveByPath addresses nested elements by child-element indices", () => { const root = parseXml(DOC).root; assert.equal(resolveByPath(root, [0])!.local, "route"); assert.equal(resolveByPath(root, [0, 2, 0])!.local, "to"); assert.equal(resolveByPath(root, [0, 9]), null); }); }); const RICH = ` hello
`; describe("rich-content surgery (§3.8 panel editing)", () => { it("replaces a message's text", () => { const edit = computeSetTextContent(RICH, [0, 1, 0], "goodbye")!; const after = applyReplacement(RICH, edit); assert.match(after, /goodbye<\/message>/); assert.equal(after.split("\n").length, RICH.split("\n").length); }); it("escapes text content and keeps the document parseable", () => { const after = applyReplacement(RICH, computeSetTextContent(RICH, [0, 1, 0], "a < b & c")!); assert.match(after, /a < b & c<\/message>/); parseXml(after); }); it("grows a body on a self-closing element", () => { const doc = RICH.replace("hello", ""); const after = applyReplacement(doc, computeSetTextContent(doc, [0, 1, 0], "hi")!); assert.match(after, /hi<\/message>/); }); it("removes a child together with its whole line", () => { const after = applyReplacement(RICH, computeRemoveElement(RICH, [0, 1, 1])); assert.equal(after.includes("header"), false); assert.equal(after.split("\n").length, RICH.split("\n").length - 1, "the line is gone entirely"); parseXml(after); }); it("inserts a child on its own line, indented like the siblings", () => { const after = applyReplacement(RICH, computeInsertChild(RICH, [0, 1], ``)); assert.match(after, /
\n \n <\/log>/); parseXml(after); }); it("opens a body when the parent closes inline", () => { const doc = `\n \n text\n \n`; const after = applyReplacement(doc, computeInsertChild(doc, [0, 0], ``)); assert.match(after, /text\n <\/message>\n <\/log>/); parseXml(after); }); it("expands a self-closing parent into a body", () => { const doc = `\n \n \n \n`; const after = applyReplacement(doc, computeInsertChild(doc, [0, 0], ``)); assert.match(after, /\n <\/message>\n <\/log>/); parseXml(after); }); it("resolveByPath addresses nested elements by child-element indices (dup guard)", () => { const root = parseXml(DOC).root; assert.equal(resolveByPath(root, [0])!.local, "route"); assert.equal(resolveByPath(root, [0, 2, 0])!.local, "to"); assert.equal(resolveByPath(root, [0, 9]), null); }); }); const MOVABLE = ` step one `; function applyAll(text: string, replacements: TextReplacement[]): string { let out = text; for (const r of [...replacements].sort((a, b) => b.start - a.start)) out = applyReplacement(out, r); return out; } describe("step operations (такт 3, слой A)", () => { it("blockSpan takes the contiguous comments above; a blank line breaks the chain", () => { const model = parseXml(MOVABLE); const log = resolveByPath(model.root, [0, 1])!; const block = MOVABLE.slice(blockSpan(model, log).start, blockSpan(model, log).end); assert.equal(block.includes("why the log is here"), true); assert.equal(block.includes("second line"), true); assert.equal(block.includes("from uri"), false); const gapped = MOVABLE.replace(" ", " \n"); const gappedModel = parseXml(gapped); const gappedLog = resolveByPath(gappedModel.root, [0, 1])!; const gappedBlock = gapped.slice(blockSpan(gappedModel, gappedLog).start, blockSpan(gappedModel, gappedLog).end); assert.equal(gappedBlock.includes("second line"), true); assert.equal(gappedBlock.includes("why the log is here"), false, "the blank line detached the first comment"); }); it("insertAt puts the fragment before the indexed child, sibling indentation", () => { const after = applyReplacement(MOVABLE, computeInsertAt(MOVABLE, [0], 1, ``)); assert.match(after, /from uri="direct:\/\/in"\/>\n \n \n \n step one<\/log>\n /, "comments moved with the step, everything re-indented to the scope's depth"); assert.equal(after.split("why the log is here").length, 2, "no duplicate"); parseXml(after); }); it("MOVE out of a scope re-indents back", () => { const edits = computeMoveElement(MOVABLE, [0, 3, 0], [0], 1)!; const after = applyAll(MOVABLE, edits); assert.match(after, /from uri="direct:\/\/in"\/>\n \n hello `; describe("parseXml — the position-exact tree", () => { const doc = parseXml(SAMPLE); it("EVERY span reproduces its source verbatim — the byte-preservation foundation", () => { const walk = (nodes: readonly { span: { start: number; end: number } }[]): void => { for (const node of nodes) { assert.equal( SAMPLE.slice(node.span.start, node.span.end).length, node.span.end - node.span.start); if ("children" in node) walk((node as { children: { span: { start: number; end: number } }[] }).children); } }; walk(doc.prolog); const route = childElements(doc.root)[0]; assert.equal(SAMPLE.slice(route.span.start, route.span.end).startsWith(""), true); }); it("attribute spans point at the exact value", () => { const route = childElements(doc.root)[0]; const id = attr(route, "id")!; assert.equal(SAMPLE.slice(id.valueSpan.start, id.valueSpan.end), "a"); assert.equal(SAMPLE.slice(id.span.start, id.span.end), `id="a"`); }); it("a '>' inside a quoted attribute does not end the tag", () => { const route = childElements(doc.root)[0]; const custom = childElements(route)[3]; assert.equal(custom.name, "acme:custom"); assert.equal(custom.local, "custom"); assert.equal(custom.prefix, "acme"); assert.equal(attr(custom, "weird")!.value, ">quoted>"); assert.equal(custom.selfClosing, true); }); it("comments and CDATA are nodes with exact spans", () => { const route = childElements(doc.root)[0]; const comment = route.children.find(c => c.kind === "comment")!; assert.equal((comment as { text: string }).text, " step comment "); const query = childElements(route)[2]; assert.equal(textContent(query), " a < b "); }); it("open/close tag spans split the element correctly", () => { const route = childElements(doc.root)[0]; const log = childElements(route)[1]; assert.equal(SAMPLE.slice(log.openTag.start, log.openTag.end), ``); assert.equal(SAMPLE.slice(log.closeTag!.start, log.closeTag!.end), ""); assert.equal(SAMPLE.slice(log.content!.start, log.content!.end), "hello"); }); it("elementAt finds the deepest node under the cursor", () => { const offset = SAMPLE.indexOf("level="); const found = elementAt(doc.root, offset)!; assert.equal(found.local, "log"); assert.equal(elementAt(doc.root, 0), null, "the prolog is outside the root"); }); it("parent links go up to the root", () => { const route = childElements(doc.root)[0]; const log = childElements(route)[1]; assert.equal(log.parent, route); assert.equal(route.parent, doc.root); assert.equal(doc.root.parent, null); }); it("mismatched closing tag fails with the offset", () => { assert.throws( () => parseXml(""), (e: unknown) => e instanceof XmlParseError && e.offset === 6); }); it("unclosed element names the element", () => { assert.throws( () => parseXml(""), (e: unknown) => e instanceof XmlParseError && /route/.test((e as Error).message)); }); }); Path: redb-route/vscode-redb-route/src/test/zipfixture.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/zipfixture.ts ---- import { deflateRawSync } from "zlib"; export interface FixtureEntry { name: string; content: string; /** Store without compression instead of deflating. */ stored?: boolean; /** Override the general purpose flags (bit 0 marks an encrypted entry). */ flags?: number; /** Override the compression method written to the headers. */ method?: number; } /** Builds a minimal zip archive in memory for the reader's tests. CRCs are not checked by the reader and left zero. */ export function buildZip(entries: FixtureEntry[], comment = ""): Buffer { const locals: Buffer[] = []; const centrals: Buffer[] = []; let offset = 0; for (const entry of entries) { const name = Buffer.from(entry.name, "utf8"); const raw = Buffer.from(entry.content, "utf8"); const data = entry.stored ? raw : deflateRawSync(raw); const method = entry.method ?? (entry.stored ? 0 : 8); const flags = entry.flags ?? 0; const local = Buffer.alloc(30); local.writeUInt32LE(0x04034b50, 0); local.writeUInt16LE(20, 4); local.writeUInt16LE(flags, 6); local.writeUInt16LE(method, 8); local.writeUInt32LE(data.length, 18); local.writeUInt32LE(raw.length, 22); local.writeUInt16LE(name.length, 26); locals.push(local, name, data); const central = Buffer.alloc(46); central.writeUInt32LE(0x02014b50, 0); central.writeUInt16LE(20, 4); central.writeUInt16LE(20, 6); central.writeUInt16LE(flags, 8); central.writeUInt16LE(method, 10); central.writeUInt32LE(data.length, 20); central.writeUInt32LE(raw.length, 24); central.writeUInt16LE(name.length, 28); central.writeUInt32LE(offset, 42); centrals.push(central, name); offset += local.length + name.length + data.length; } const directory = Buffer.concat(centrals); const commentBytes = Buffer.from(comment, "utf8"); const end = Buffer.alloc(22); end.writeUInt32LE(0x06054b50, 0); end.writeUInt16LE(entries.length, 8); end.writeUInt16LE(entries.length, 10); end.writeUInt32LE(directory.length, 12); end.writeUInt32LE(offset, 16); end.writeUInt16LE(commentBytes.length, 20); return Buffer.concat([...locals, directory, end, commentBytes]); } Path: redb-route/vscode-redb-route/src/test/zipreader.test.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/test/zipreader.test.ts ---- import { describe, it } from "node:test"; import * as assert from "node:assert/strict"; import { readZipEntries, zipEntries, ZipFormatError } from "../zipreader"; import { buildZip } from "./zipfixture"; describe("zipreader — entries of a .nupkg", () => { it("reads deflated and stored entries", () => { const archive = buildZip([ { name: "a/deflated.json", content: '{"x":1}'.repeat(50) }, { name: "b/stored.txt", content: "plain", stored: true }, ]); const read = readZipEntries(archive, () => true); assert.equal(read.get("a/deflated.json")!.toString("utf8"), '{"x":1}'.repeat(50)); assert.equal(read.get("b/stored.txt")!.toString("utf8"), "plain"); }); it("reads only what the predicate accepts and skips folder entries", () => { const archive = buildZip([ { name: "templates/", content: "", stored: true }, { name: "templates/x/.template.config/template.json", content: "{}" }, { name: "templates/x/Program.cs", content: "class P {}" }, ]); const read = readZipEntries(archive, name => name.endsWith(".json") || name.endsWith("/")); assert.deepEqual([...read.keys()], ["templates/x/.template.config/template.json"]); }); it("finds the directory behind an archive comment", () => { const archive = buildZip([{ name: "f.txt", content: "ok" }], "a comment at the end"); assert.equal(zipEntries(archive)[0].name, "f.txt"); }); it("refuses what is not a zip archive", () => { assert.throws(() => zipEntries(Buffer.from("not a zip archive at all, but long enough")), ZipFormatError); assert.throws(() => zipEntries(Buffer.from("short")), ZipFormatError); }); it("refuses encrypted entries and unknown compression", () => { const encrypted = buildZip([{ name: "secret", content: "x", flags: 1 }]); assert.throws(() => readZipEntries(encrypted, () => true), /encrypted/); const bzip = buildZip([{ name: "packed", content: "x", stored: true, method: 12 }]); assert.throws(() => readZipEntries(bzip, () => true), /compression method 12/); }); }); Path: redb-route/vscode-redb-route/src/textedit.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/textedit.ts ---- /** * Surgical text edits over the position-exact tree (10-VSCODE §8.3): an attribute edit * touches ONLY its own spot — replace inside the quotes, insert one ` name="value"` before * the tag's end, or remove the attribute with its leading whitespace. The file is never * reserialized; the diff of an attribute change is one line, pinned by tests. */ import { parseXml, XmlElement, childElements, attr, XmlDocumentModel, textContent } from "./xmlmodel"; /** One replacement: [start, end) → newText. */ export interface TextReplacement { start: number; end: number; newText: string; } /** Index chain among child ELEMENTS from the document root (the webview's node address). */ export type ElementPath = number[]; export function resolveByPath(root: XmlElement, path: ElementPath): XmlElement | null { let current = root; for (const index of path) { const children = childElements(current); if (index < 0 || index >= children.length) return null; current = children[index]; } return current; } /** * A decoded value ready to stand between the given quotes: `&` and `<` always, and only the delimiting quote, so * an expression keeps its other quote readable (`expr='a == "x"'`, `expr="a == 'x'"`). */ export function escapeAttributeValue(value: string, quote: '"' | "'" = '"'): string { const out = value.replace(/&/g, "&").replace(/ 0 && (text[start - 1] === " " || text[start - 1] === "\t")) start--; return { start, end: existing.span.end, newText: "" }; } if (existing) { // Compared decoded: an unchanged value keeps the file's own spelling (`<`, `>`) untouched. if (existing.value === value) return null; return { start: existing.valueSpan.start, end: existing.valueSpan.end, newText: escapeAttributeValue(value, existing.quote), }; } const escaped = escapeAttributeValue(value); // Insert before the tag's closer: `/>` for self-closing, `>` otherwise. const insertAt = element.openTag.end - (element.selfClosing ? 2 : 1); return { start: insertAt, end: insertAt, newText: ` ${name}="${escaped}"` }; } /** * Renames the element at the path (`` → ``): the open tag and, * when there is one, the close tag; attributes and content stay byte-identical. */ export function computeRenameElement(text: string, path: ElementPath, newName: string): TextReplacement | null { const element = resolveByPath(parseXml(text).root, path); if (!element) throw new Error(`no element at path [${path.join(",")}] — the document changed under the panel`); if (element.name === newName) return null; const body = text.slice(element.span.start, element.span.end); const openName = "<" + element.name; if (!body.startsWith(openName)) throw new Error(`the element at [${path.join(",")}] does not start with ${openName}`); let renamed = "<" + newName + body.slice(openName.length); if (!element.selfClosing) { const closeTag = new RegExp("$"); if (!closeTag.test(renamed)) throw new Error(`the element at [${path.join(",")}] does not end with `); renamed = renamed.replace(closeTag, ""); } return { start: element.span.start, end: element.span.end, newText: renamed }; } /** Applies a replacement — test helper and the non-VSCode half of the apply path. */ export function applyReplacement(text: string, replacement: TextReplacement): string { return text.slice(0, replacement.start) + replacement.newText + text.slice(replacement.end); } /** A decoded value as element text: `&` and `<`, and the `>` of a `]]>`, which text may not contain. */ export function escapeTextContent(value: string): string { return value.replace(/&/g, "&").replace(//g, "]]>"); } /** A value as one CDATA section; a `]]>` inside is split across two sections. */ export function cdataSection(value: string): string { return "/g, "]]]]>") + "]]>"; } /** * Replaces the element's TEXT content (`old` → new). A self-closing * element grows a close tag: `` → `new`. */ export function computeSetTextContent( text: string, path: ElementPath, value: string): TextReplacement | null { const element = resolveByPath(parseXml(text).root, path); if (!element) throw new Error(`no element at path [${path.join(",")}]`); // An element whose text the file keeps in CDATA stays in CDATA; otherwise the text is escaped. const asCData = element.children.some(c => c.kind === "cdata"); const escaped = asCData ? cdataSection(value) : escapeTextContent(value); if (element.selfClosing) { const openTag = text.slice(element.openTag.start, element.openTag.end); const withoutCloser = openTag.slice(0, -2).trimEnd(); return { start: element.openTag.start, end: element.openTag.end, newText: `${withoutCloser}>${escaped}`, }; } if (element.content === null) return null; // Compared decoded: an unchanged value leaves the file's spelling and layout untouched. if (textContent(element) === value) return null; return { start: element.content.start, end: element.content.end, newText: escaped }; } /** * Removes the element together with its own line when the line holds nothing else — the * whitespace before it and the line break go too, neighbouring lines stay byte-identical. */ export function computeRemoveElement(text: string, path: ElementPath): TextReplacement { const element = resolveByPath(parseXml(text).root, path); if (!element) throw new Error(`no element at path [${path.join(",")}]`); let start = element.span.start; while (start > 0 && (text[start - 1] === " " || text[start - 1] === "\t")) start--; let end = element.span.end; const lineStartsClean = start === 0 || text[start - 1] === "\n"; if (lineStartsClean) { // The element owned its line: consume the trailing line break as well. if (text[end] === "\r") end++; if (text[end] === "\n") end++; } return { start, end, newText: "" }; } /** * Inserts a child fragment on its own line before the parent's close tag, indented like the * existing children (or the parent's indent plus two spaces). A self-closing parent grows a * body first. */ export function computeInsertChild( text: string, parentPath: ElementPath, fragment: string): TextReplacement { const parent = resolveByPath(parseXml(text).root, parentPath); if (!parent) throw new Error(`no element at path [${parentPath.join(",")}]`); const lineIndentAt = (offset: number): string => { let lineStart = text.lastIndexOf("\n", offset - 1) + 1; let indent = ""; while (lineStart < text.length && (text[lineStart] === " " || text[lineStart] === "\t")) { indent += text[lineStart]; lineStart++; } return indent; }; const parentIndent = lineIndentAt(parent.span.start); if (parent.selfClosing) { const openTag = text.slice(parent.openTag.start, parent.openTag.end); const withoutCloser = openTag.slice(0, -2).trimEnd(); return { start: parent.openTag.start, end: parent.openTag.end, newText: `${withoutCloser}>\n${parentIndent} ${fragment}\n${parentIndent}`, }; } const children = childElements(parent); const childIndent = children.length > 0 ? lineIndentAt(children[children.length - 1].span.start) : parentIndent + " "; const closeStart = parent.closeTag!.start; const closeLineStart = text.lastIndexOf("\n", closeStart - 1) + 1; const closeOnOwnLine = /^[ \t]*$/.test(text.slice(closeLineStart, closeStart)); return closeOnOwnLine // Insert a whole line above the close tag's line — that line stays untouched. ? { start: closeLineStart, end: closeLineStart, newText: indentFragment(fragment, childIndent) } // Inline close tag (text): open a body around the fragment. : { start: closeStart, end: closeStart, newText: `\n${indentFragment(fragment, childIndent).slice(0, -1)}\n${parentIndent}` }; } /** Every line of a (possibly multi-line) fragment indented, with a trailing line break. */ function indentFragment(fragment: string, indent: string): string { return fragment.split("\n").map(line => indent + line).join("\n") + "\n"; } /** Removes the element's whole BLOCK — the step and the comments glued to it (§8.4 Delete). */ export function computeRemoveBlock(text: string, path: ElementPath): TextReplacement { const model = parseXml(text); const element = resolveByPath(model.root, path); if (!element) throw new Error(`no element at path [${path.join(",")}]`); const block = blockSpan(model, element); return { start: block.start, end: block.end, newText: "" }; } function lineIndent(text: string, offset: number): string { let lineStart = text.lastIndexOf("\n", offset - 1) + 1; let indent = ""; while (lineStart < text.length && (text[lineStart] === " " || text[lineStart] === "\t")) { indent += text[lineStart]; lineStart++; } return indent; } /** * The element's BLOCK: its own span widened to whole lines, plus the contiguous comment * lines directly above it (§8.3: «перестановка переносит блоки целиком, включая комментарии * над ними»). A blank line breaks the comment chain. */ export function blockSpan(model: XmlDocumentModel, element: XmlElement): { start: number; end: number } { const text = model.text; let start = element.span.start; // Widen to the line start when the element owns its line. let lineStart = text.lastIndexOf("\n", start - 1) + 1; if (/^[ \t]*$/.test(text.slice(lineStart, start))) start = lineStart; // Walk preceding siblings: comments (and the whitespace between) attach to the block. if (element.parent) { const siblings = element.parent.children; let i = siblings.indexOf(element) - 1; while (i >= 0) { const sibling = siblings[i]; if (sibling.kind === "text" && /^[ \t\r\n]*$/.test(sibling.text)) { // Whitespace: a blank line (two line breaks) breaks the chain. const breaks = sibling.text.split("\n").length - 1; if (breaks > 1) break; i--; continue; } if (sibling.kind !== "comment") break; let commentStart = sibling.span.start; const commentLine = text.lastIndexOf("\n", commentStart - 1) + 1; if (/^[ \t]*$/.test(text.slice(commentLine, commentStart))) commentStart = commentLine; start = commentStart; i--; } } let end = element.span.end; if (text[end] === "\r") end++; if (text[end] === "\n") end++; return { start, end }; } /** * Inserts a step fragment among the parent's children at the given child index (0 = * first, children.length = append). Own line, sibling indentation. */ export function computeInsertAt( text: string, parentPath: ElementPath, index: number, fragment: string): TextReplacement { const model = parseXml(text); const parent = resolveByPath(model.root, parentPath); if (!parent) throw new Error(`no element at path [${parentPath.join(",")}]`); const children = childElements(parent); if (parent.selfClosing || children.length === 0 || index >= children.length) return computeInsertChild(text, parentPath, fragment); // Before the anchor's whole BLOCK: a step's comments stay glued to their step (§8.3). const anchor = children[Math.max(0, index)]; const anchorStart = blockSpan(model, anchor).start; const indent = lineIndent(text, anchor.span.start); return { start: anchorStart, end: anchorStart, newText: indentFragment(fragment, indent) }; } /** * Moves the element's whole BLOCK (comments included) to another position: remove here, * insert there — two ranges of ONE workspace edit, both computed against the same original * text. Returns null for a no-op (dropping onto itself). */ export function computeMoveElement( text: string, fromPath: ElementPath, toParentPath: ElementPath, toIndex: number): TextReplacement[] | null { const model = parseXml(text); const element = resolveByPath(model.root, fromPath); const target = resolveByPath(model.root, toParentPath); if (!element || !target) throw new Error("the document changed under the drag"); // Into itself or its own subtree — refuse quietly. for (let e: XmlElement | null = target; e !== null; e = e.parent) if (e === element) return null; const block = blockSpan(model, element); const blockText = text.slice(block.start, block.end); // The insertion point in ORIGINAL coordinates. const targetChildren = childElements(target); let insertAt: number; let indent: string; if (target.selfClosing) { // Let computeInsertChild handle body expansion; a moved block into a self-closing // parent is rare — do it as remove + expanded insert of the bare element text. const expanded = computeInsertChild(text, toParentPath, blockText.trim()); return dedupeRanges([{ start: block.start, end: block.end, newText: "" }, expanded]); } else if (targetChildren.length === 0 || toIndex >= targetChildren.length) { const closeStart = target.closeTag!.start; const closeLineStart = text.lastIndexOf("\n", closeStart - 1) + 1; insertAt = /^[ \t]*$/.test(text.slice(closeLineStart, closeStart)) ? closeLineStart : closeStart; indent = targetChildren.length > 0 ? lineIndent(text, targetChildren[targetChildren.length - 1].span.start) : lineIndent(text, target.span.start) + " "; } else { // Before the anchor's whole block — never between a step and its comments. const anchor = targetChildren[Math.max(0, toIndex)]; insertAt = blockSpan(model, anchor).start; indent = lineIndent(text, anchor.span.start); } if (insertAt >= block.start && insertAt <= block.end) return null; // same spot // Re-indent the block to the target's depth: strip the block's own leading indent from // every line, prepend the target indent. const oldIndent = lineIndent(text, element.span.start); const reindented = blockText .split("\n") .map(line => line.startsWith(oldIndent) ? indent + line.slice(oldIndent.length) : line) .join("\n"); const insertion = reindented.endsWith("\n") ? reindented : reindented + "\n"; return dedupeRanges([ { start: block.start, end: block.end, newText: "" }, { start: insertAt, end: insertAt, newText: insertion }, ]); } function dedupeRanges(ranges: TextReplacement[]): TextReplacement[] { return ranges.filter(r => r.start !== r.end || r.newText !== ""); } Path: redb-route/vscode-redb-route/src/xmlmodel.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/xmlmodel.ts ---- /** * A position-exact XML tree — the foundation of the Ф8 graph editor. The editor edits THIS * tree's source spans surgically (10-VSCODE §8.2: the truth is the text; the graph is a * projection): an unknown element stays a node with exact bytes, an attribute edit knows the * one span to replace, a block move carries the block verbatim. Nothing here interprets the * route format — this is the XML layer under it. * * Offsets are UTF-16 code units (JavaScript string indexing == VSCode document offsets). * Spans are [start, end). */ export interface Span { start: number; end: number; } export interface XmlAttribute { /** Attribute name as written (may carry a prefix). */ name: string; /** * The DECODED value: the entities of the raw text resolved (`<` → `<`, `&` → `&`), what the * route loader reads. Shown and compared in this form; written back through escapeAttributeValue. */ value: string; /** The raw text between the quotes, entities untouched. */ raw: string; /** The delimiter the file uses for this attribute. */ quote: '"' | "'"; /** The name token. */ nameSpan: Span; /** Inside the quotes — the span to replace when editing the value. */ valueSpan: Span; /** name="value" including both quotes — the span to remove with the attribute. */ span: Span; } export type XmlNode = XmlElement | XmlText | XmlComment | XmlCData | XmlMisc; export interface XmlElement { kind: "element"; /** Qualified name as written. */ name: string; prefix: string | null; local: string; attributes: XmlAttribute[]; selfClosing: boolean; /** The whole element, open tag through close tag. */ span: Span; /** `` including both angle brackets. */ openTag: Span; /** `` or null when self-closing. */ closeTag: Span | null; /** Between the tags; null when self-closing. */ content: Span | null; children: XmlNode[]; parent: XmlElement | null; } export interface XmlText { kind: "text"; span: Span; /** Raw text, entities untouched. */ text: string; } export interface XmlComment { kind: "comment"; span: Span; /** Between ``. */ text: string; } export interface XmlCData { kind: "cdata"; span: Span; /** Between ``. */ text: string; } /** Prolog, PI, DOCTYPE — kept opaque, byte-preserved like everything else. */ export interface XmlMisc { kind: "misc"; span: Span; } export class XmlParseError extends Error { constructor(message: string, readonly offset: number) { super(message); } } /** The parsed document: the root element plus everything around it. */ export interface XmlDocumentModel { root: XmlElement; /** Every top-level node in order (prolog, comments, the root, trailing bits). */ prolog: XmlNode[]; text: string; } const NAME_START = /[A-Za-z_:]/; const NAME_CHAR = /[\w.:-]/; export function parseXml(text: string): XmlDocumentModel { let position = 0; let root: XmlElement | null = null; const prolog: XmlNode[] = []; const fail = (message: string, at: number): never => { throw new XmlParseError(message, at); }; const parseAttributes = (owner: { attributes: XmlAttribute[] }): void => { for (;;) { while (position < text.length && /\s/.test(text[position])) position++; const ch = text[position]; if (ch === ">" || ch === "/" || ch === "?" || position >= text.length) return; if (!NAME_START.test(ch)) fail(`unexpected '${ch}' in a tag`, position); const nameStart = position; while (position < text.length && NAME_CHAR.test(text[position])) position++; const name = text.slice(nameStart, position); const nameSpan = { start: nameStart, end: position }; while (position < text.length && /\s/.test(text[position])) position++; if (text[position] !== "=") fail(`attribute '${name}' has no value`, position); position++; while (position < text.length && /\s/.test(text[position])) position++; const quote = text[position]; if (quote !== '"' && quote !== "'") fail(`attribute '${name}' value is not quoted`, position); position++; const valueStart = position; const valueEnd = text.indexOf(quote, position); if (valueEnd < 0) fail(`attribute '${name}' value never closes`, valueStart); position = valueEnd + 1; const raw = text.slice(valueStart, valueEnd); owner.attributes.push({ name, value: decodeXmlEntities(raw), raw, quote: quote as '"' | "'", nameSpan, valueSpan: { start: valueStart, end: valueEnd }, span: { start: nameStart, end: position }, }); } }; const parseElement = (parent: XmlElement | null): XmlElement => { const openStart = position; position++; // consumed '<' by caller's check const nameStart = position; if (!NAME_START.test(text[position] ?? "")) fail("element name expected after '<'", position); while (position < text.length && NAME_CHAR.test(text[position])) position++; const name = text.slice(nameStart, position); const colon = name.indexOf(":"); const element: XmlElement = { kind: "element", name, prefix: colon < 0 ? null : name.slice(0, colon), local: colon < 0 ? name : name.slice(colon + 1), attributes: [], selfClosing: false, span: { start: openStart, end: -1 }, openTag: { start: openStart, end: -1 }, closeTag: null, content: null, children: [], parent, }; parseAttributes(element); if (text[position] === "/") { if (text[position + 1] !== ">") fail(`'>' expected in <${name}>`, position); position += 2; element.selfClosing = true; element.openTag.end = element.span.end = position; return element; } if (text[position] !== ">") fail(`'>' expected in <${name}>`, position); position++; element.openTag.end = position; const contentStart = position; for (;;) { if (position >= text.length) fail(`<${name}> is never closed`, openStart); if (text[position] !== "<") { const textStart = position; while (position < text.length && text[position] !== "<") position++; element.children.push({ kind: "text", span: { start: textStart, end: position }, text: text.slice(textStart, position), }); continue; } if (text.startsWith("", position); if (closeEnd < 0) fail(` never closes`, position); const closing = text.slice(closeStart + 2, closeEnd).trim(); if (closing !== name) fail(` closes <${name}>`, closeStart); position = closeEnd + 1; element.closeTag = { start: closeStart, end: position }; element.content = { start: contentStart, end: closeStart }; element.span.end = position; return element; } element.children.push(parseNodeAt(element)); } }; const parseNodeAt = (parent: XmlElement | null): XmlNode => { // The caller guarantees text[position] === "<". if (text.startsWith("", position + 4); if (end < 0) fail("comment never closes", position); const span = { start: position, end: end + 3 }; const value = text.slice(position + 4, end); position = span.end; return { kind: "comment", span, text: value }; } if (text.startsWith("", position + 9); if (end < 0) fail("CDATA never closes", position); const span = { start: position, end: end + 3 }; const value = text.slice(position + 9, end); position = span.end; return { kind: "cdata", span, text: value }; } if (text.startsWith("", position + 2); if (end < 0) fail("processing instruction never closes", position); const span = { start: position, end: end + 2 }; position = span.end; return { kind: "misc", span }; } if (text.startsWith("", position + 2); if (end < 0) fail("declaration never closes", position); const span = { start: position, end: end + 1 }; position = span.end; return { kind: "misc", span }; } return parseElement(parent); }; while (position < text.length) { if (text[position] !== "<") { const start = position; while (position < text.length && text[position] !== "<") position++; prolog.push({ kind: "text", span: { start, end: position }, text: text.slice(start, position) }); continue; } const node = parseNodeAt(null); prolog.push(node); if (node.kind === "element") { if (root !== null) fail("more than one root element", node.span.start); root = node; } } if (root === null) fail("no root element", 0); return { root: root!, prolog, text }; } /** Child ELEMENTS only, in order. */ export function childElements(element: XmlElement): XmlElement[] { return element.children.filter((c): c is XmlElement => c.kind === "element"); } /** The attribute by name, or null. */ export function attr(element: XmlElement, name: string): XmlAttribute | null { return element.attributes.find(a => a.name === name) ?? null; } /** * The concatenated text+cdata content of an element (for inline conditions etc.), DECODED: the entities of the text * parts resolved, CDATA verbatim, as the route loader reads it. */ export function textContent(element: XmlElement): string { return element.children .filter((c): c is XmlText | XmlCData => c.kind === "text" || c.kind === "cdata") .map(c => c.kind === "text" ? decodeXmlEntities(c.text) : c.text) .join(""); } const NAMED_ENTITIES: Record = { lt: "<", gt: ">", amp: "&", quot: '"', apos: "'" }; /** * Resolves the five predefined entities and character references (`<`, `<`). Anything else that starts * with `&` stays as written: a DTD entity the editor does not know, or a stray ampersand. */ export function decodeXmlEntities(raw: string): string { if (!raw.includes("&")) return raw; return raw.replace(/&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z]+);/g, (whole, body: string) => { if (body[0] === "#") { const code = body[1] === "x" ? parseInt(body.slice(2), 16) : parseInt(body.slice(1), 10); return Number.isFinite(code) && code >= 0 && code <= 0x10FFFF ? String.fromCodePoint(code) : whole; } return NAMED_ENTITIES[body] ?? whole; }); } /** The deepest element whose span contains the offset (for cursor→node sync). */ export function elementAt(root: XmlElement, offset: number): XmlElement | null { if (offset < root.span.start || offset >= root.span.end) return null; for (;;) { const child = childElements(root).find( c => offset >= c.span.start && offset < c.span.end); if (!child) return root; root = child; } } Path: redb-route/vscode-redb-route/src/zipreader.ts Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/src/zipreader.ts ---- /** * Reads entries out of a zip archive (a .nupkg is one) with Node's zlib, so the extension * ships without a zip dependency. Enough for template packages: stored and deflated entries * found through the central directory. ZIP64 archives and encrypted entries are refused. */ import { inflateRawSync } from "zlib"; const END_OF_CENTRAL_DIRECTORY = 0x06054b50; const CENTRAL_DIRECTORY_ENTRY = 0x02014b50; const LOCAL_FILE_HEADER = 0x04034b50; const STORED = 0; const DEFLATED = 8; export class ZipFormatError extends Error { constructor(message: string) { super(message); this.name = "ZipFormatError"; } } /** One entry of the central directory. */ export interface ZipEntry { /** The path inside the archive, with forward slashes. */ name: string; method: number; compressedSize: number; uncompressedSize: number; localHeaderOffset: number; flags: number; } /** Lists the archive's entries in central directory order. */ export function zipEntries(archive: Buffer): ZipEntry[] { const end = findEndOfCentralDirectory(archive); const count = archive.readUInt16LE(end + 10); const size = archive.readUInt32LE(end + 12); const start = archive.readUInt32LE(end + 16); if (count === 0xffff || size === 0xffffffff || start === 0xffffffff) throw new ZipFormatError("ZIP64 archives are not supported"); if (start + size > end) throw new ZipFormatError("the central directory lies outside the archive"); const entries: ZipEntry[] = []; let offset = start; for (let i = 0; i < count; i++) { if (offset + 46 > archive.length || archive.readUInt32LE(offset) !== CENTRAL_DIRECTORY_ENTRY) throw new ZipFormatError(`central directory entry ${i} is damaged`); const nameLength = archive.readUInt16LE(offset + 28); const extraLength = archive.readUInt16LE(offset + 30); const commentLength = archive.readUInt16LE(offset + 32); entries.push({ flags: archive.readUInt16LE(offset + 8), method: archive.readUInt16LE(offset + 10), compressedSize: archive.readUInt32LE(offset + 20), uncompressedSize: archive.readUInt32LE(offset + 24), localHeaderOffset: archive.readUInt32LE(offset + 42), name: archive.toString("utf8", offset + 46, offset + 46 + nameLength).replace(/\\/g, "/"), }); offset += 46 + nameLength + extraLength + commentLength; } return entries; } /** The uncompressed bytes of one entry. */ export function readZipEntry(archive: Buffer, entry: ZipEntry): Buffer { if (entry.flags & 0x1) throw new ZipFormatError(`'${entry.name}' is encrypted`); const header = entry.localHeaderOffset; if (header + 30 > archive.length || archive.readUInt32LE(header) !== LOCAL_FILE_HEADER) throw new ZipFormatError(`the local header of '${entry.name}' is damaged`); // The local header carries its own name and extra lengths, which may differ from the // central directory's; the sizes are taken from the central directory, which is always set. const dataStart = header + 30 + archive.readUInt16LE(header + 26) + archive.readUInt16LE(header + 28); const data = archive.subarray(dataStart, dataStart + entry.compressedSize); if (data.length !== entry.compressedSize) throw new ZipFormatError(`'${entry.name}' is truncated`); if (entry.method === STORED) return Buffer.from(data); if (entry.method === DEFLATED) return inflateRawSync(data); throw new ZipFormatError(`'${entry.name}' uses unsupported compression method ${entry.method}`); } /** Reads every entry whose name the predicate accepts, keyed by name. */ export function readZipEntries(archive: Buffer, accept: (name: string) => boolean): Map { const result = new Map(); for (const entry of zipEntries(archive)) if (!entry.name.endsWith("/") && accept(entry.name)) result.set(entry.name, readZipEntry(archive, entry)); return result; } /** The end-of-central-directory record sits in the last 22 bytes plus an archive comment of up to 64 KiB. */ function findEndOfCentralDirectory(archive: Buffer): number { if (archive.length < 22) throw new ZipFormatError("not a zip archive: too short"); const lowest = Math.max(0, archive.length - 22 - 0xffff); for (let offset = archive.length - 22; offset >= lowest; offset--) if (archive.readUInt32LE(offset) === END_OF_CENTRAL_DIRECTORY) return offset; throw new ZipFormatError("not a zip archive: no end of central directory record"); } Path: redb-route/vscode-redb-route/tsconfig.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/vscode-redb-route/tsconfig.json ---- { "compilerOptions": { "module": "commonjs", "target": "ES2022", "lib": ["ES2022"], "outDir": "out", "rootDir": "src", "strict": true, "sourceMap": true, "skipLibCheck": true }, "include": ["src"] }