@chobantonov/jsonforms-extended-spec 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +126 -2
- package/conformance/authoring.json +2680 -0
- package/conformance/behavior.json +1602 -0
- package/conformance/config-consumption.json +1542 -0
- package/conformance/expected-invalid.json +20 -0
- package/docs/audit.md +150 -0
- package/docs/conditional-fields.md +122 -0
- package/docs/draft-07-visual-support.md +43 -0
- package/docs/external-resources-proposal.md +536 -0
- package/docs/implementation-guide.md +233 -0
- package/docs/implementation-pitfalls.md +968 -0
- package/docs/implementation-web-typescript.md +41 -0
- package/docs/renderer-and-demo.md +1347 -0
- package/docs/renderer-selection.md +99 -0
- package/docs/spec.md +8470 -0
- package/docs/todo.md +166 -0
- package/examples/README.md +127 -0
- package/examples/additional-errors/README.md +176 -0
- package/examples/additional-errors/config.json +3 -0
- package/examples/additional-errors/data.json +11 -0
- package/examples/additional-errors/schema.json +56 -0
- package/examples/additional-errors/translations.json +64 -0
- package/examples/additional-errors/uischema.json +158 -0
- package/examples/additional-items-pagination/README.md +8 -0
- package/examples/additional-items-pagination/config.json +10 -0
- package/examples/additional-items-pagination/data.json +22 -0
- package/examples/additional-items-pagination/schema.json +30 -0
- package/examples/additional-items-pagination/translations.json +16 -0
- package/examples/additional-items-pagination/uischema.json +39 -0
- package/examples/additional-properties/README.md +203 -0
- package/examples/additional-properties/config.json +5 -0
- package/examples/additional-properties/data.json +31 -0
- package/examples/additional-properties/schema.json +78 -0
- package/examples/additional-properties/translations.json +80 -0
- package/examples/additional-properties/uischema.json +104 -0
- package/examples/ag-grid/README.md +62 -0
- package/examples/ag-grid/config.json +14 -0
- package/examples/ag-grid/data.json +124 -0
- package/examples/ag-grid/schema.json +48 -0
- package/examples/ag-grid/translations.json +58 -0
- package/examples/ag-grid/uischema.json +671 -0
- package/examples/array-choices/README.md +150 -0
- package/examples/array-choices/config.json +4 -0
- package/examples/array-choices/data.json +10 -0
- package/examples/array-choices/schema.json +68 -0
- package/examples/array-choices/translations.json +64 -0
- package/examples/array-choices/uischema.json +97 -0
- package/examples/array-controls/README.md +237 -0
- package/examples/array-controls/config.json +4 -0
- package/examples/array-controls/data.json +147 -0
- package/examples/array-controls/schema.json +374 -0
- package/examples/array-controls/translations.json +186 -0
- package/examples/array-controls/uischema.json +685 -0
- package/examples/array-detail-modes/README.md +11 -0
- package/examples/array-detail-modes/data.json +38 -0
- package/examples/array-detail-modes/schema.json +89 -0
- package/examples/array-detail-modes/translations.json +36 -0
- package/examples/array-detail-modes/uischema.json +73 -0
- package/examples/array-detail-modes/uischemas.d.mts +2 -0
- package/examples/array-detail-modes/uischemas.json +15 -0
- package/examples/boolean-controls/README.md +109 -0
- package/examples/boolean-controls/config.json +3 -0
- package/examples/boolean-controls/data.json +27 -0
- package/examples/boolean-controls/schema.json +98 -0
- package/examples/boolean-controls/translations.json +94 -0
- package/examples/boolean-controls/uischema.json +126 -0
- package/examples/button-actions/README.md +259 -0
- package/examples/button-actions/config.json +7 -0
- package/examples/button-actions/data.json +5 -0
- package/examples/button-actions/host.mjs +14 -0
- package/examples/button-actions/schema.json +20 -0
- package/examples/button-actions/translations.json +60 -0
- package/examples/button-actions/uischema.json +179 -0
- package/examples/catalog.json +634 -0
- package/examples/categorization/README.md +132 -0
- package/examples/categorization/config.json +7 -0
- package/examples/categorization/data.json +8 -0
- package/examples/categorization/schema.json +29 -0
- package/examples/categorization/translations.json +72 -0
- package/examples/categorization/uischema.json +288 -0
- package/examples/choice-controls/README.md +136 -0
- package/examples/choice-controls/config.json +10 -0
- package/examples/choice-controls/data.json +61 -0
- package/examples/choice-controls/schema.json +406 -0
- package/examples/choice-controls/translations.json +154 -0
- package/examples/choice-controls/uischema.json +575 -0
- package/examples/choice-controls/uischemas.d.mts +2 -0
- package/examples/choice-controls/uischemas.json +16 -0
- package/examples/code-editor/README.md +74 -0
- package/examples/code-editor/data.json +8 -0
- package/examples/code-editor/schema.json +28 -0
- package/examples/code-editor/translations.json +20 -0
- package/examples/code-editor/uischema.json +77 -0
- package/examples/collection-pagination/README.md +5 -0
- package/examples/collection-pagination/config.json +1 -0
- package/examples/collection-pagination/data.json +64 -0
- package/examples/collection-pagination/schema.json +23 -0
- package/examples/collection-pagination/translations.json +14 -0
- package/examples/collection-pagination/uischema.json +14 -0
- package/examples/color-control/README.md +154 -0
- package/examples/color-control/config.json +7 -0
- package/examples/color-control/data.json +11 -0
- package/examples/color-control/schema.json +61 -0
- package/examples/color-control/translations.json +76 -0
- package/examples/color-control/uischema.json +106 -0
- package/examples/combinators/README.md +223 -0
- package/examples/combinators/config.json +9 -0
- package/examples/combinators/data.json +23 -0
- package/examples/combinators/schema.json +232 -0
- package/examples/combinators/translations.json +178 -0
- package/examples/combinators/uischema.json +158 -0
- package/examples/conditional-fields/README.md +27 -0
- package/examples/conditional-fields/config.json +5 -0
- package/examples/conditional-fields/data.json +7 -0
- package/examples/conditional-fields/schema.json +59 -0
- package/examples/conditional-fields/translations.json +32 -0
- package/examples/conditional-fields/uischema.json +131 -0
- package/examples/container-validation-indicator/README.md +187 -0
- package/examples/container-validation-indicator/config.json +9 -0
- package/examples/container-validation-indicator/data.json +68 -0
- package/examples/container-validation-indicator/schema.json +222 -0
- package/examples/container-validation-indicator/translations.json +120 -0
- package/examples/container-validation-indicator/uischema.json +98 -0
- package/examples/cron-control/README.md +155 -0
- package/examples/cron-control/data.json +15 -0
- package/examples/cron-control/schema.json +72 -0
- package/examples/cron-control/translations.json +80 -0
- package/examples/cron-control/uischema.json +91 -0
- package/examples/destructive-confirmation/README.md +210 -0
- package/examples/destructive-confirmation/config.json +17 -0
- package/examples/destructive-confirmation/data.json +86 -0
- package/examples/destructive-confirmation/schema.json +204 -0
- package/examples/destructive-confirmation/translations.json +112 -0
- package/examples/destructive-confirmation/uischema.json +105 -0
- package/examples/draft-07-metaschema/README.md +11 -0
- package/examples/draft-07-metaschema/config.json +3 -0
- package/examples/draft-07-metaschema/data.json +25 -0
- package/examples/draft-07-metaschema/schema.json +172 -0
- package/examples/draft-07-metaschema/translations.json +10 -0
- package/examples/draft-07-metaschema/uischema.json +14 -0
- package/examples/dynamic-playground/README.md +95 -0
- package/examples/dynamic-playground/config.json +8 -0
- package/examples/dynamic-playground/configuration.json +152 -0
- package/examples/dynamic-playground/data.json +15 -0
- package/examples/dynamic-playground/dynamic-uischema.json +379 -0
- package/examples/dynamic-playground/host.mjs +37 -0
- package/examples/dynamic-playground/schema.json +48 -0
- package/examples/dynamic-playground/translations.json +76 -0
- package/examples/dynamic-playground/uischema.json +36 -0
- package/examples/editor-details/README.md +10 -0
- package/examples/editor-details/data.json +18 -0
- package/examples/editor-details/schema.json +49 -0
- package/examples/editor-details/translations.json +28 -0
- package/examples/editor-details/uischema.json +53 -0
- package/examples/editor-details/uischemas.d.mts +2 -0
- package/examples/editor-details/uischemas.json +14 -0
- package/examples/file-control/README.md +108 -0
- package/examples/file-control/data.json +28 -0
- package/examples/file-control/schema.json +89 -0
- package/examples/file-control/translations.json +46 -0
- package/examples/file-control/uischema.json +152 -0
- package/examples/group-layout/README.md +149 -0
- package/examples/group-layout/config.json +10 -0
- package/examples/group-layout/data.json +9 -0
- package/examples/group-layout/schema.json +51 -0
- package/examples/group-layout/translations.json +62 -0
- package/examples/group-layout/uischema.json +249 -0
- package/examples/index.d.ts +17 -0
- package/examples/index.js +69 -0
- package/examples/input-adornments/README.md +68 -0
- package/examples/input-adornments/data.json +41 -0
- package/examples/input-adornments/schema.json +207 -0
- package/examples/input-adornments/translations.json +106 -0
- package/examples/input-adornments/uischema.json +695 -0
- package/examples/job-application/README.md +23 -0
- package/examples/job-application/config.json +10 -0
- package/examples/job-application/data.json +68 -0
- package/examples/job-application/schema.json +196 -0
- package/examples/job-application/translations.json +388 -0
- package/examples/job-application/uischema.json +218 -0
- package/examples/job-application/uischemas.json +153 -0
- package/examples/json-editor/README.md +28 -0
- package/examples/json-editor/schema.json +1 -0
- package/examples/json-editor/translations.json +10 -0
- package/examples/json-editor/uischema.json +16 -0
- package/examples/json-inference/README.md +33 -0
- package/examples/json-inference/translations.json +10 -0
- package/examples/json-inference/uischema.json +16 -0
- package/examples/kitchen-sink/README.md +86 -0
- package/examples/kitchen-sink/config.json +14 -0
- package/examples/kitchen-sink/data.json +263 -0
- package/examples/kitchen-sink/invalid-data.json +263 -0
- package/examples/kitchen-sink/schema.json +515 -0
- package/examples/kitchen-sink/translations.json +270 -0
- package/examples/kitchen-sink/uischema.json +722 -0
- package/examples/label-interpolation/README.md +241 -0
- package/examples/label-interpolation/config.json +14 -0
- package/examples/label-interpolation/data.json +13 -0
- package/examples/label-interpolation/schema.json +64 -0
- package/examples/label-interpolation/translations.json +94 -0
- package/examples/label-interpolation/uischema.json +379 -0
- package/examples/layout-sizing/README.md +162 -0
- package/examples/layout-sizing/config.json +10 -0
- package/examples/layout-sizing/data.json +14 -0
- package/examples/layout-sizing/schema.json +58 -0
- package/examples/layout-sizing/translations.json +42 -0
- package/examples/layout-sizing/uischema.json +558 -0
- package/examples/markup-label/README.md +109 -0
- package/examples/markup-label/config.json +16 -0
- package/examples/markup-label/data.json +5 -0
- package/examples/markup-label/schema.json +24 -0
- package/examples/markup-label/translations.json +40 -0
- package/examples/markup-label/uischema.json +149 -0
- package/examples/mixed-control/README.md +164 -0
- package/examples/mixed-control/config.json +11 -0
- package/examples/mixed-control/data.json +70 -0
- package/examples/mixed-control/schema.json +221 -0
- package/examples/mixed-control/translations.json +158 -0
- package/examples/mixed-control/uischema.json +211 -0
- package/examples/null-control/README.md +111 -0
- package/examples/null-control/config.json +4 -0
- package/examples/null-control/data.json +6 -0
- package/examples/null-control/schema.json +36 -0
- package/examples/null-control/translations.json +42 -0
- package/examples/null-control/uischema.json +56 -0
- package/examples/numeric-controls/README.md +94 -0
- package/examples/numeric-controls/config.json +4 -0
- package/examples/numeric-controls/data.json +8 -0
- package/examples/numeric-controls/schema.json +52 -0
- package/examples/numeric-controls/translations.json +56 -0
- package/examples/numeric-controls/uischema.json +77 -0
- package/examples/object-control/README.md +220 -0
- package/examples/object-control/config.json +4 -0
- package/examples/object-control/data.json +62 -0
- package/examples/object-control/schema.json +252 -0
- package/examples/object-control/translations.json +160 -0
- package/examples/object-control/uischema.json +275 -0
- package/examples/object-control/uischemas.d.mts +2 -0
- package/examples/object-control/uischemas.json +59 -0
- package/examples/password-control/README.md +119 -0
- package/examples/password-control/config.json +3 -0
- package/examples/password-control/data.json +18 -0
- package/examples/password-control/schema.json +65 -0
- package/examples/password-control/translations.json +64 -0
- package/examples/password-control/uischema.json +94 -0
- package/examples/pre-touch-errors/README.md +176 -0
- package/examples/pre-touch-errors/config.json +4 -0
- package/examples/pre-touch-errors/data.json +5 -0
- package/examples/pre-touch-errors/schema.json +56 -0
- package/examples/pre-touch-errors/translations.json +68 -0
- package/examples/pre-touch-errors/uischema.json +85 -0
- package/examples/presentation/README.md +148 -0
- package/examples/presentation/config.json +9 -0
- package/examples/presentation/data.json +6 -0
- package/examples/presentation/schema.json +21 -0
- package/examples/presentation/translations.json +64 -0
- package/examples/presentation/uischema.json +210 -0
- package/examples/property-pagination/README.md +5 -0
- package/examples/property-pagination/config.json +1 -0
- package/examples/property-pagination/data.json +17 -0
- package/examples/property-pagination/schema.json +14 -0
- package/examples/property-pagination/translations.json +10 -0
- package/examples/property-pagination/uischema.json +24 -0
- package/examples/recursive-tree/README.md +49 -0
- package/examples/recursive-tree/config.json +1 -0
- package/examples/recursive-tree/data.json +40 -0
- package/examples/recursive-tree/schema.json +89 -0
- package/examples/recursive-tree/translations.json +42 -0
- package/examples/recursive-tree/uischema.json +84 -0
- package/examples/recursive-tree/uischemas.d.mts +2 -0
- package/examples/recursive-tree/uischemas.json +51 -0
- package/examples/split-layout/README.md +123 -0
- package/examples/split-layout/config.json +3 -0
- package/examples/split-layout/data.json +13 -0
- package/examples/split-layout/schema.json +50 -0
- package/examples/split-layout/translations.json +50 -0
- package/examples/split-layout/uischema.json +204 -0
- package/examples/string-controls/README.md +159 -0
- package/examples/string-controls/config.json +5 -0
- package/examples/string-controls/data.json +13 -0
- package/examples/string-controls/schema.json +70 -0
- package/examples/string-controls/translations.json +76 -0
- package/examples/string-controls/uischema.json +148 -0
- package/examples/table-row-details/README.md +69 -0
- package/examples/table-row-details/config.json +7 -0
- package/examples/table-row-details/data.json +280 -0
- package/examples/table-row-details/schema.json +61 -0
- package/examples/table-row-details/translations.json +56 -0
- package/examples/table-row-details/uischema.json +1303 -0
- package/examples/template-layout/README.md +250 -0
- package/examples/template-layout/config.json +9 -0
- package/examples/template-layout/data.json +20 -0
- package/examples/template-layout/host.mjs +13 -0
- package/examples/template-layout/schema.json +48 -0
- package/examples/template-layout/translations.json +70 -0
- package/examples/template-layout/uischema.json +177 -0
- package/examples/template-slots/README.md +19 -0
- package/examples/template-slots/data.json +4 -0
- package/examples/template-slots/schema.json +11 -0
- package/examples/template-slots/translations.json +26 -0
- package/examples/template-slots/uischema.json +47 -0
- package/examples/template-slots/uischemas.d.mts +2 -0
- package/examples/template-slots/uischemas.json +56 -0
- package/examples/temporal-controls/README.md +325 -0
- package/examples/temporal-controls/data.json +44 -0
- package/examples/temporal-controls/schema.json +208 -0
- package/examples/temporal-controls/translations.json +156 -0
- package/examples/temporal-controls/uischema.json +297 -0
- package/examples/tree-max-depth/README.md +5 -0
- package/examples/tree-max-depth/config.json +3 -0
- package/examples/tree-max-depth/data.json +31 -0
- package/examples/tree-max-depth/schema.json +258 -0
- package/examples/tree-max-depth/translations.json +42 -0
- package/examples/tree-max-depth/uischema.json +16 -0
- package/examples/tree-max-depth/uischemas.d.mts +2 -0
- package/examples/tree-max-depth/uischemas.json +50 -0
- package/examples/tuple-control/README.md +335 -0
- package/examples/tuple-control/config.json +4 -0
- package/examples/tuple-control/data.json +61 -0
- package/examples/tuple-control/schema.json +218 -0
- package/examples/tuple-control/translations.json +142 -0
- package/examples/tuple-control/uischema.json +128 -0
- package/examples/tuple-control/uischemas.d.mts +2 -0
- package/examples/tuple-control/uischemas.json +125 -0
- package/examples/validator-profile/README.md +197 -0
- package/examples/validator-profile/config.json +9 -0
- package/examples/validator-profile/data.json +16 -0
- package/examples/validator-profile/schema.json +139 -0
- package/examples/validator-profile/translations.json +34 -0
- package/examples/validator-profile/uischema.json +59 -0
- package/package.json +83 -3
- package/provenance.json +140 -0
- package/schemas/README.md +82 -0
- package/schemas/example.schema.json +37 -0
- package/schemas/jsonforms-config.schema.json +427 -0
- package/schemas/jsonforms-dynamic-uischema.schema.json +220 -0
- package/schemas/jsonforms-extended-config.schema.json +332 -0
- package/schemas/jsonforms-extended-uischema.schema.json +1932 -0
- package/schemas/jsonforms-rule.schema.json +104 -0
- package/schemas/jsonforms-uischema.schema.json +1434 -0
- package/typescript/README.md +546 -0
- package/typescript/lib/authoring/cssLength.d.ts +33 -0
- package/typescript/lib/authoring/cssLength.js +25 -0
- package/typescript/lib/authoring/dynamic.d.ts +73 -0
- package/typescript/lib/authoring/dynamic.js +8 -0
- package/typescript/lib/authoring/forSchema.d.ts +385 -0
- package/typescript/lib/authoring/forSchema.js +84 -0
- package/typescript/lib/authoring/schemaTypes.d.ts +111 -0
- package/typescript/lib/authoring/schemaTypes.js +15 -0
- package/typescript/lib/index.d.ts +4 -0
- package/typescript/lib/index.js +20 -0
- package/typescript/package.json +1 -0
- package/typescript/src/authoring/cssLength.ts +79 -0
- package/typescript/src/authoring/dynamic.ts +96 -0
- package/typescript/src/authoring/forSchema.ts +428 -0
- package/typescript/src/authoring/schemaTypes.ts +143 -0
- package/typescript/src/index.ts +4 -0
- package/typescript/test/schemaContract.test.ts +638 -0
- package/typescript/test/tsconfig.json +10 -0
- package/typescript/test/typedAuthoring.test.ts +151 -0
- package/typescript/test/typedAuthoringCoverage.test.ts +178 -0
- package/typescript/test/typedAuthoringCssLength.test.ts +81 -0
- package/typescript/test/typedAuthoringNames.test.ts +90 -0
- package/typescript/test/typedDynamic.test.ts +88 -0
- package/typescript/tsconfig.json +15 -0
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
# JSON Forms Extended — External Resources and Reactive Data Binding
|
|
2
|
+
|
|
3
|
+
**Status:** Proposed design for specification review
|
|
4
|
+
**Scope:** Portable UI schema contract, host-provided resource resolution, runtime integration, security, and optional interaction capabilities
|
|
5
|
+
**Target runtimes:** React, Vue, Svelte, Kotlin/Android, and other JSON Forms-compatible implementations
|
|
6
|
+
|
|
7
|
+
## 1. Executive decision
|
|
8
|
+
|
|
9
|
+
Introduce a **small, portable external-resource binding contract** rather than a REST-aware renderer or a full application orchestration framework.
|
|
10
|
+
|
|
11
|
+
1. A UI schema may **reference a virtual resource name**, optionally passing declarative parameters.
|
|
12
|
+
2. A **host-controlled resource resolver** implements retrieval, authentication, authorization, URL selection, request headers, CSRF protection, caching, and platform-specific networking.
|
|
13
|
+
3. The runtime publishes a **standard resource snapshot** (data, status, error) to the existing `$dynamic` evaluation context.
|
|
14
|
+
4. `$dynamic` maps resource values into **arbitrary existing UI schema paths** (for example `options.items`, `options.loading`, `options.error`). It does not prescribe an item shape or know the renderer.
|
|
15
|
+
5. Optional **portable semantic interactions** can change resource parameters or request more data. The basic design works without this extension; search and infinite scrolling require an event-capable renderer/adapter.
|
|
16
|
+
6. The **core spec does not define HTTP syntax, pagination algorithms, authentication headers, JS callbacks, or a general workflow engine**. These belong to host adapters or explicitly versioned optional profiles.
|
|
17
|
+
|
|
18
|
+
**Recommendation:** Standardize resource references, snapshots, context visibility, and binding semantics first. Build a generic HTTP adapter as a separate library, not as a mandatory part of the spec.
|
|
19
|
+
|
|
20
|
+
## 2. Problem and goals
|
|
21
|
+
|
|
22
|
+
### 2.1 Motivating example
|
|
23
|
+
|
|
24
|
+
A Camunda task form needs to select an assignee. The host may retrieve users from Camunda 7 REST, Camunda 8 identity-related services, a custom identity proxy, or an enterprise directory. Endpoints, credentials, response shapes, filtering and pagination vary. A custom dropdown might accept `options.items` where each item has `{ id, label, description }`; another renderer might expect `{ key, title, subtitle }`.
|
|
25
|
+
|
|
26
|
+
**None of these differences should cause creation of another renderer.** A renderer is justified for a new visual/interaction pattern, not for a different endpoint or response format.
|
|
27
|
+
|
|
28
|
+
### 2.2 Requirements
|
|
29
|
+
|
|
30
|
+
- Keep `$dynamic` the existing, pure mechanism for deriving UI schema properties.
|
|
31
|
+
- Do not mutate original JSON Schema or treat resource choices as JSON Schema `enum` automatically.
|
|
32
|
+
- Allow **arbitrary JSON** data, including arrays, objects, scalar values and `null`.
|
|
33
|
+
- Bind to **unknown third-party renderers** by documented UI schema paths, without hardcoding option names.
|
|
34
|
+
- Support initial loading and errors in a platform-neutral way; optional refresh, search, lazy loading, pagination and selected-value hydration.
|
|
35
|
+
- Make host security policy authoritative; no embedded credentials or arbitrary remote execution from untrusted UI schema.
|
|
36
|
+
- Define portable behavior for web and non-web runtimes without requiring JavaScript, React hooks, TanStack Query, `fetch`, DOM events or browser-only APIs.
|
|
37
|
+
- Preserve control identity and input focus when asynchronous values change.
|
|
38
|
+
- Avoid turning UI schema into a general-purpose application orchestration or state management language.
|
|
39
|
+
|
|
40
|
+
### 2.3 Explicit non-goals
|
|
41
|
+
|
|
42
|
+
- A standard renderer for every remote data type.
|
|
43
|
+
- A universal dropdown item schema.
|
|
44
|
+
- Arbitrary network access declared by the form author.
|
|
45
|
+
- Executing arbitrary JavaScript expressions or untrusted callbacks.
|
|
46
|
+
- Mandating one HTTP, caching, pagination, or identity implementation.
|
|
47
|
+
- Automatic writes to form data from resource responses.
|
|
48
|
+
|
|
49
|
+
## 3. Conceptual architecture
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
Extended UI Schema
|
|
53
|
+
├── Control / Layout / custom renderer options
|
|
54
|
+
├── $resource references (virtual names + parameters)
|
|
55
|
+
└── $dynamic bindings (arbitrary target paths)
|
|
56
|
+
│
|
|
57
|
+
▼
|
|
58
|
+
Portable Resource Binding Runtime
|
|
59
|
+
├── resolve names within lexical UI scope
|
|
60
|
+
├── evaluate permitted declarative parameters
|
|
61
|
+
├── observe snapshots and notify $dynamic
|
|
62
|
+
└── optional dispatch of semantic resource actions
|
|
63
|
+
│
|
|
64
|
+
▼
|
|
65
|
+
Host Resource Resolver / Provider Registry
|
|
66
|
+
├── allowlist and resource authorization
|
|
67
|
+
├── transport and endpoint selection
|
|
68
|
+
├── JWT / session / CSRF handling
|
|
69
|
+
├── response parsing, normalization, search, paging
|
|
70
|
+
├── caching, retry, cancellation and isolation
|
|
71
|
+
└── errors sanitized for UI consumption
|
|
72
|
+
│
|
|
73
|
+
▼
|
|
74
|
+
Existing $dynamic resolver
|
|
75
|
+
│
|
|
76
|
+
▼
|
|
77
|
+
Resolved ordinary UI Schema -> existing or third-party renderer
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The **host** owns privileged operations. The **UI schema** is declarative and untrusted until authorized. The **renderer** sees resolved options, not the resource manager.
|
|
81
|
+
|
|
82
|
+
## 4. Minimal portable schema contract
|
|
83
|
+
|
|
84
|
+
### 4.1 Naming and placement
|
|
85
|
+
|
|
86
|
+
Use **`$resources`** on a UI element as a map of **local aliases** to resource references. Each alias exposes one snapshot to that element and its descendants. The host may also inject resource aliases at the form root without modifying the UI schema.
|
|
87
|
+
|
|
88
|
+
Proposed minimal shape:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"$resources": {
|
|
93
|
+
"assignees": {
|
|
94
|
+
"source": "identity.users",
|
|
95
|
+
"params": {
|
|
96
|
+
"groupId": { "bind": "data.groupId" }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- `source`: required virtual identifier; **not** a URL. Exact resolution is host-defined and authorization-checked.
|
|
104
|
+
- `params`: optional named JSON values or descriptors evaluated with the existing safe `$dynamic` machinery. Values are *data*, not code or raw HTTP headers. Reuse `bind`, `expression`, `template`, and `literal`; use `literal` when a parameter value itself has a descriptor-shaped object.
|
|
105
|
+
- Other fields are optional future extensions and must be explicitly versioned.
|
|
106
|
+
- No `url`, `headers`, `token`, `credentials`, `script`, or arbitrary HTTP method in the portable core.
|
|
107
|
+
- A host may expose a named `http` resource provider, but its URL and authentication configuration live outside the UI schema by default.
|
|
108
|
+
|
|
109
|
+
**Why local aliases?** The same virtual source may be used with different parameters or in different UI subtrees. Aliases also make `$dynamic` expressions short and stable.
|
|
110
|
+
|
|
111
|
+
### 4.2 Scope and collision rules
|
|
112
|
+
|
|
113
|
+
- A `$resources` declaration is visible on its declaring element and descendants.
|
|
114
|
+
- Child aliases may shadow parent aliases only if the spec explicitly permits it. **Recommended v1:** reject alias collisions in nested scopes to reduce ambiguity; a future extension may introduce qualified names.
|
|
115
|
+
- Host-injected root aliases are visible throughout the form, unless explicitly restricted by host policy.
|
|
116
|
+
- Resource lifetime is scoped to the owning UI element; the host can retain cache entries independently.
|
|
117
|
+
- A resource alias is a logical binding, not an instruction to immediately fetch. The host may implement eager or lazy resolution.
|
|
118
|
+
|
|
119
|
+
### 4.3 Runtime snapshot contract
|
|
120
|
+
|
|
121
|
+
Each alias resolves to a snapshot with these stable fields:
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
// Illustrative structural contract only; not normative TypeScript.
|
|
125
|
+
type ResourceSnapshot<T> = {
|
|
126
|
+
status: 'idle' | 'pending' | 'success' | 'error';
|
|
127
|
+
data: T | null;
|
|
128
|
+
error: { code?: string; message: string } | null;
|
|
129
|
+
isFetching: boolean;
|
|
130
|
+
};
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Normative semantics:
|
|
134
|
+
|
|
135
|
+
| Field | Meaning |
|
|
136
|
+
|---|---|
|
|
137
|
+
| `status` | `idle` not yet requested; `pending` initial load; `success` usable response; `error` most recent load failed without a usable current result |
|
|
138
|
+
| `data` | Host-published JSON result, **not** a prescribed dropdown shape. `null` may be valid success data; use `status` to distinguish from unavailable data. |
|
|
139
|
+
| `error` | Sanitized, user-safe error information only; never raw headers, tokens, internal URLs, stack traces or sensitive response bodies. |
|
|
140
|
+
| `isFetching` | A request is active, including background refresh when previous data is retained. |
|
|
141
|
+
|
|
142
|
+
**Recommended refinement:** expose `hasData` (boolean) so a valid `null` payload is unambiguous, and retain `status: 'success'` during background refresh even while `isFetching` is true. A refresh failure with retained data should preserve usable data and report a sanitized nonfatal refresh error via an optional field rather than discard the last success.
|
|
143
|
+
|
|
144
|
+
Snapshot publication must be **atomic**. An obsolete request must never overwrite a newer parameter set. A failed or cancelled request must not accidentally clear form values.
|
|
145
|
+
|
|
146
|
+
### 4.4 `$dynamic` integration
|
|
147
|
+
|
|
148
|
+
The existing `$dynamic` resolver receives a new read-only `resources` context namespace. It evaluates resource expressions with the same portable, sandboxed expression engine already selected for `$dynamic`.
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"type": "Control",
|
|
153
|
+
"scope": "#/properties/assignee",
|
|
154
|
+
"options": {
|
|
155
|
+
"renderer": "UserDropdown",
|
|
156
|
+
"items": [],
|
|
157
|
+
"loading": false,
|
|
158
|
+
"error": null
|
|
159
|
+
},
|
|
160
|
+
"$resources": {
|
|
161
|
+
"assignees": {
|
|
162
|
+
"source": "identity.users"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"$dynamic": {
|
|
166
|
+
"options": {
|
|
167
|
+
"items": {
|
|
168
|
+
"expression": "resources.assignees.status == 'success' && resources.assignees.data != null ? resources.assignees.data : []"
|
|
169
|
+
},
|
|
170
|
+
"loading": {
|
|
171
|
+
"bind": "resources.assignees.isFetching"
|
|
172
|
+
},
|
|
173
|
+
"error": {
|
|
174
|
+
"expression": "resources.assignees.error != null ? resources.assignees.error.message : null"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Compatibility note:** The nested overlay and descriptor syntax matches the existing experimental `$dynamic` profile. The proposed `resources` environment root is not yet part of that profile, so these are design examples, not executable fixtures. The final specification must reuse the existing overlay semantics and must not introduce a separate expression language for resources.
|
|
182
|
+
|
|
183
|
+
The resolver must handle unavailable data safely. Prefer existing static fallback values (`items: []`, `loading: false`, `error: null`) and defined null/error semantics. If a conditional `$dynamic` overlay is inapplicable, the original static property remains. A transient error should not leave a stale overlay from an earlier evaluation.
|
|
184
|
+
|
|
185
|
+
### 4.5 Arbitrary renderer-specific shape
|
|
186
|
+
|
|
187
|
+
A third-party renderer may expect:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"options": {
|
|
192
|
+
"items": [
|
|
193
|
+
{ "id": "jsmith", "label": "John Smith", "description": "john@example.com" }
|
|
194
|
+
],
|
|
195
|
+
"loading": false
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Another may expect `options.entries` with `{ key, title, subtitle }`. **The resource layer does not know either contract.** The host can return already-normalized data for the first renderer, or the `$dynamic` expression layer can project the result to the target shape using *portable, explicitly supported* collection operations.
|
|
201
|
+
|
|
202
|
+
**Recommended v1 default:** normalize at the **host resource boundary**, avoiding a new collection-mapping DSL in the UI spec. If existing `$dynamic` already supports safe collection projection, using it for renderer-specific mappings is valid. Do not assume JavaScript `.map()` works in CEL or other portable evaluators.
|
|
203
|
+
|
|
204
|
+
## 5. Host resource resolver contract
|
|
205
|
+
|
|
206
|
+
Define behavior, not implementation-language interfaces. A conforming runtime provides:
|
|
207
|
+
|
|
208
|
+
- **Resolve**: `source` + evaluated `params` + trusted host context -> a resource instance/snapshot stream.
|
|
209
|
+
- **Observe**: publish atomic snapshots when resource state changes.
|
|
210
|
+
- **Dispose**: release subscriptions and cancel work where appropriate.
|
|
211
|
+
- **Optional command**: accept semantic actions such as `refresh`, `setParams`, or `loadMore` when the provider declares support.
|
|
212
|
+
|
|
213
|
+
Illustrative adapter signatures (not normative):
|
|
214
|
+
|
|
215
|
+
```text
|
|
216
|
+
resolve(sourceId, params, trustedHostContext) -> ResourceHandle
|
|
217
|
+
ResourceHandle.snapshot() -> ResourceSnapshot
|
|
218
|
+
ResourceHandle.subscribe(listener) -> Unsubscribe
|
|
219
|
+
ResourceHandle.dispose()
|
|
220
|
+
ResourceHandle.command(name, payload) -> Result [optional]
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Host-provided context may include an authenticated HTTP client, service registry, session information, tenant identity, policy, locale and cancellation. **None of those privileged values are automatically available to `$dynamic` or to the renderer.** The UI schema receives only the sanitized snapshot.
|
|
224
|
+
|
|
225
|
+
### 5.1 Deployment mapping example
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
# Trusted host configuration, NOT UI schema
|
|
229
|
+
resources:
|
|
230
|
+
identity.users:
|
|
231
|
+
implementation: camundaUserDirectory
|
|
232
|
+
allowedParams: [query, groupId]
|
|
233
|
+
capabilities: [refresh, search, loadMore]
|
|
234
|
+
auth: hostSession
|
|
235
|
+
resultProjection: userDropdownItems
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The host can choose a different implementation in another deployment while keeping the UI schema unchanged. The same virtual name should have a documented semantic contract (for example, users searchable by query), not a fixed wire protocol.
|
|
239
|
+
|
|
240
|
+
### 5.2 Host-owned data mapping
|
|
241
|
+
|
|
242
|
+
A provider may return raw service JSON or a projected, domain-level response. Recommended policy:
|
|
243
|
+
|
|
244
|
+
- **Reusable domain resources** return stable domain records, independent of any particular renderer.
|
|
245
|
+
- **UI-specific adapters** may return a renderer-oriented structure where necessary; name and document that contract explicitly.
|
|
246
|
+
- `$dynamic` performs the final binding to arbitrary UI paths.
|
|
247
|
+
- Avoid making every renderer consume `{ value, label }`; no universal choice format is imposed.
|
|
248
|
+
|
|
249
|
+
## 6. Camunda assignee end-to-end example
|
|
250
|
+
|
|
251
|
+
### 6.1 Form data schema
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"type": "object",
|
|
256
|
+
"properties": {
|
|
257
|
+
"assignee": { "type": "string", "title": "Assignee" }
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### 6.2 UI schema
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"type": "Control",
|
|
267
|
+
"scope": "#/properties/assignee",
|
|
268
|
+
"options": {
|
|
269
|
+
"renderer": "UserDropdown",
|
|
270
|
+
"items": [],
|
|
271
|
+
"loading": false,
|
|
272
|
+
"error": null
|
|
273
|
+
},
|
|
274
|
+
"$resources": {
|
|
275
|
+
"users": {
|
|
276
|
+
"source": "workflow.assignees"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"$dynamic": {
|
|
280
|
+
"options": {
|
|
281
|
+
"items": {
|
|
282
|
+
"expression": "resources.users.status == 'success' && resources.users.data != null ? resources.users.data : []"
|
|
283
|
+
},
|
|
284
|
+
"loading": {
|
|
285
|
+
"bind": "resources.users.isFetching"
|
|
286
|
+
},
|
|
287
|
+
"error": {
|
|
288
|
+
"expression": "resources.users.error != null ? resources.users.error.message : null"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The host's `workflow.assignees` provider can publish:
|
|
296
|
+
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"status": "success",
|
|
300
|
+
"data": [
|
|
301
|
+
{ "id": "jsmith", "label": "John Smith", "description": "john@example.com" },
|
|
302
|
+
{ "id": "mjohnson", "label": "Mary Johnson", "description": "mary@example.com" }
|
|
303
|
+
],
|
|
304
|
+
"error": null,
|
|
305
|
+
"isFetching": false
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
The existing renderer consumes the resolved `options.items`. Selecting John writes `{ "assignee": "jsmith" }` to **ordinary JSON Forms data**, not to the resource snapshot. Actual task assignment authorization is enforced again by the backend at submission time.
|
|
310
|
+
|
|
311
|
+
### 6.3 Camunda deployment differences
|
|
312
|
+
|
|
313
|
+
Do not hardcode assumptions that all Camunda installations share the same endpoint, identity model, authentication or CSRF mechanism. Camunda 7 embedded/Cockpit applications, Camunda 7 REST deployments, and Camunda 8 services may differ substantially. The host adapter must determine the actual API and security requirements for the deployment.
|
|
314
|
+
|
|
315
|
+
The resource reference `workflow.assignees` remains the same across deployments when the host promises the same semantic result contract.
|
|
316
|
+
|
|
317
|
+
## 7. Search, lazy loading and pagination: optional capabilities, not core complexity
|
|
318
|
+
|
|
319
|
+
### 7.1 Core rule
|
|
320
|
+
|
|
321
|
+
**The resource core exposes data and state.** It does not require `page`, `offset`, `cursor`, `hasMore`, `loadMore`, scrolling, or caching configuration. A host may implement these without exposing the mechanics to UI schema.
|
|
322
|
+
|
|
323
|
+
### 7.2 Portable interaction bridge (optional profile)
|
|
324
|
+
|
|
325
|
+
For controls that can emit portable semantic events, define an optional **interaction-to-resource-command binding**. Proposed event names are semantic, not DOM-specific: `open`, `searchChange`, `endReached`, `refreshRequested`.
|
|
326
|
+
|
|
327
|
+
Illustrative optional syntax:
|
|
328
|
+
|
|
329
|
+
```json
|
|
330
|
+
{
|
|
331
|
+
"$resourceActions": {
|
|
332
|
+
"searchChange": {
|
|
333
|
+
"resource": "users",
|
|
334
|
+
"command": "setParams",
|
|
335
|
+
"args": { "query": { "bind": "event.query" } }
|
|
336
|
+
},
|
|
337
|
+
"endReached": {
|
|
338
|
+
"resource": "users",
|
|
339
|
+
"command": "loadMore"
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
This is **not mandatory for the initial core**. The `event` root exists only while evaluating an optional action's arguments; it is not added to ordinary `$dynamic` evaluation. The event bridge must only accept allowlisted command names, target resources visible in scope, and validated argument shapes. No arbitrary method invocation or user-defined scripts.
|
|
346
|
+
|
|
347
|
+
A third-party renderer can participate only if it emits the agreed semantic event through an adapter, or if its host application externally drives resource parameters. A renderer that merely accepts `options.items` can display fetched data, but cannot magically support server-side search or infinite scrolling without an interaction channel.
|
|
348
|
+
|
|
349
|
+
### 7.3 Search behavior
|
|
350
|
+
|
|
351
|
+
- A search-capable renderer emits a query change; host adapter debounces and issues the request.
|
|
352
|
+
- Parameter changes create a new logical query identity.
|
|
353
|
+
- Old requests are cancelled when possible and otherwise ignored when stale.
|
|
354
|
+
- Host decides whether to retain previous data while fetching.
|
|
355
|
+
- User-provided query text is data, not a URL template, executable expression, or unrestricted search filter.
|
|
356
|
+
|
|
357
|
+
### 7.4 Pagination behavior
|
|
358
|
+
|
|
359
|
+
The host provider implements offset, page number, cursor or continuation links as needed. It may expose **optional** `hasMore`, `isLoadingMore`, `total` fields and a `loadMore` command. A UI schema can bind these fields if the renderer supports them. Unsupported optional fields must have documented fallbacks.
|
|
360
|
+
|
|
361
|
+
For infinite scrolling, the host controls page accumulation, deduplication, stale-query isolation, and termination. A UI renderer only displays items and emits `endReached`. For numbered pagination, the host may publish the current page instead of accumulated results; the provider contract must document which.
|
|
362
|
+
|
|
363
|
+
### 7.5 Lazy loading
|
|
364
|
+
|
|
365
|
+
A host may defer fetching until a control becomes active, visible or opened. The optional `open` event is a portable trigger. Do not make browser `IntersectionObserver` or component `onMount` a normative requirement. On native Kotlin UI, the equivalent semantic event is emitted by its adapter.
|
|
366
|
+
|
|
367
|
+
### 7.6 Selected-value hydration
|
|
368
|
+
|
|
369
|
+
A paginated user list may not include the currently selected assignee. The host should support a separate virtual lookup such as `workflow.userById` with `params.userId` derived from `data.assignee`, or provide an equivalent selected-item resolution facility. The renderer's own contract determines how the resolved selected record is supplied. Avoid automatically clearing an existing value because it is absent from the first page.
|
|
370
|
+
|
|
371
|
+
## 8. Security and trust model
|
|
372
|
+
|
|
373
|
+
### 8.1 Trust boundaries
|
|
374
|
+
|
|
375
|
+
Treat UI schemas and form data as **untrusted inputs** unless explicitly trusted by the host. Even a signed or centrally stored UI schema should not automatically gain unrestricted network permissions.
|
|
376
|
+
|
|
377
|
+
| Boundary | Trust rule |
|
|
378
|
+
|---|---|
|
|
379
|
+
| UI schema -> resource registry | Only host-allowlisted virtual names and validated parameters are accepted. |
|
|
380
|
+
| Resource provider -> network | Host chooses destination, method, headers, authentication and redirects. |
|
|
381
|
+
| Network response -> resource snapshot | Validate size, type and shape; sanitize errors; prevent executable content. |
|
|
382
|
+
| Snapshot -> `$dynamic` | Read-only, sandboxed expression evaluation. |
|
|
383
|
+
| `$dynamic` -> renderer | Only supported target paths and types; enforce existing reserved/denylisted-property protections. |
|
|
384
|
+
| Form submission -> backend | Server independently authorizes selected user and requested assignment. |
|
|
385
|
+
|
|
386
|
+
### 8.2 URLs: virtual names by default
|
|
387
|
+
|
|
388
|
+
**Default policy:** No raw URLs in portable UI schema. Use virtual names (`workflow.assignees`, `identity.users`). The host maps them to trusted services.
|
|
389
|
+
|
|
390
|
+
An **optional trusted-inline-HTTP profile** may allow URLs only when the host explicitly enables it for trusted forms and enforces scheme, hostname, path, port, redirect, and request-method allowlists. Do not allow a UI schema to bypass policy using a computed URL, DNS rebinding, redirects to private IP ranges, or arbitrary proxies. Server-side resolvers must defend against SSRF; browser-side clients must honor origin/CORS restrictions.
|
|
391
|
+
|
|
392
|
+
### 8.3 JWT and session credentials
|
|
393
|
+
|
|
394
|
+
- JWTs, refresh tokens, cookies, API keys and authorization headers are **host secrets**, never literal values in the UI schema, `$dynamic` context, resource snapshots, errors, logs, or persisted form data.
|
|
395
|
+
- The host injects `Authorization: Bearer ...` or uses a session-aware client **only** for approved resource destinations.
|
|
396
|
+
- Do not forward authorization headers to arbitrary origins or across unapproved redirects.
|
|
397
|
+
- Refresh tokens and credential renewal remain host responsibilities.
|
|
398
|
+
- Cache entries containing sensitive data are partitioned by user, tenant, authorization context and other relevant security scope; invalidate them on logout or identity changes.
|
|
399
|
+
- Prefer a same-origin backend-for-frontend/proxy for browser-based deployments when direct service access would expose credentials or complicate CORS and authorization.
|
|
400
|
+
|
|
401
|
+
### 8.4 CSRF / Camunda Cockpit
|
|
402
|
+
|
|
403
|
+
Camunda Cockpit and related deployments may require anti-CSRF tokens or other session-specific headers for certain requests. **The UI schema must not specify the CSRF token or its header value.** The host's authenticated request client obtains and attaches the appropriate token/header/cookie combination according to the actual deployment.
|
|
404
|
+
|
|
405
|
+
Important distinctions:
|
|
406
|
+
|
|
407
|
+
- CSRF tokens and JWTs solve different problems; one does not automatically replace the other.
|
|
408
|
+
- Exact CSRF header names, token sources and cookie behavior are **deployment- and version-specific**; do not hardcode a purported universal Camunda header in the portable spec.
|
|
409
|
+
- Browser cookies may require correct same-site and credential settings; CORS is not an authorization mechanism.
|
|
410
|
+
- If a resource command performs a mutation, require an explicit host capability and backend authorization. A read-only user lookup should not silently become a write operation.
|
|
411
|
+
|
|
412
|
+
### 8.5 Parameter and expression safety
|
|
413
|
+
|
|
414
|
+
- Validate parameter names, types, size and permitted ranges against the host resource contract.
|
|
415
|
+
- Limit query length, page size, response size, concurrency, retries and request rate.
|
|
416
|
+
- Never interpolate user input into SQL, path templates, command strings or unrestricted remote filter expressions without provider-specific safe encoding/validation.
|
|
417
|
+
- Evaluate `$dynamic` and resource parameter expressions in a deterministic sandbox with no network, filesystem, reflection, dynamic code evaluation or privileged host object access.
|
|
418
|
+
- Prevent cycles: a resource parameter may depend on form data or approved context, but not create uncontrolled feedback loops between resources and UI updates.
|
|
419
|
+
|
|
420
|
+
### 8.6 Privacy and observability
|
|
421
|
+
|
|
422
|
+
Expose only fields the form needs. User directories can contain personal information; avoid unnecessary fields, long-lived persistent caches, and verbose telemetry. Log resource IDs, safe correlation IDs, timings and sanitized error codes—not tokens, raw request bodies, sensitive query strings, or full user records. Apply appropriate retention and access controls.
|
|
423
|
+
|
|
424
|
+
## 9. Cross-language conformance
|
|
425
|
+
|
|
426
|
+
The normative contract must be specified as **JSON structures, state semantics and observable behavior**, not TypeScript interfaces or React APIs.
|
|
427
|
+
|
|
428
|
+
| Concern | Web implementation | Kotlin/native implementation | Portable requirement |
|
|
429
|
+
|---|---|---|---|
|
|
430
|
+
| Resolve virtual source | JS provider registry | Kotlin service registry | Same name/parameter semantics |
|
|
431
|
+
| Network | fetch/HTTP client | OkHttp/Ktor/other | Host-owned transport |
|
|
432
|
+
| Observe changes | reactive store/hooks | Flow/StateFlow/observable | Snapshot updates |
|
|
433
|
+
| Evaluate expressions | approved CEL-compatible evaluator | compatible CEL evaluator | Same supported expression subset and null semantics |
|
|
434
|
+
| Render | React/Vue/Svelte renderer | native renderer | Consumes resolved UI schema properties |
|
|
435
|
+
| Search event | component adapter | native widget adapter | Same semantic payload |
|
|
436
|
+
| Cancellation | AbortController | coroutine/job cancellation | Stale results cannot overwrite newer ones |
|
|
437
|
+
|
|
438
|
+
**Expression portability:** Select and document a strict common subset of the expression language (for example CEL), including collection projection only if available in all supported runtimes. Avoid arbitrary JS functions, JS-specific optional chaining unless explicitly supported, and platform-specific date/object behavior. Provide conformance fixtures for identical inputs/outputs.
|
|
439
|
+
|
|
440
|
+
**Renderer portability:** A renderer is not required to implement resource APIs. It receives the same resolved UI schema it already expects. A renderer's documented option/event contract determines which capabilities can be bound. Unsupported fields are not magically implemented.
|
|
441
|
+
|
|
442
|
+
## 10. Relationship to existing `$dynamic`
|
|
443
|
+
|
|
444
|
+
The resource feature should **extend the evaluation context**, not replace or reimplement `$dynamic`.
|
|
445
|
+
|
|
446
|
+
- `$dynamic` stays at the UI element root, consistent with the existing extended spec.
|
|
447
|
+
- Resource aliases become a read-only `resources` namespace in the evaluation context.
|
|
448
|
+
- `$dynamic` continues to apply overlays before renderer selection/testing if that is the established runtime design, but resource snapshot changes must not unnecessarily remount controls.
|
|
449
|
+
- Respect existing `$dynamic` enabled/disabled policy, reserved keys, denylist and diagnostic behavior.
|
|
450
|
+
- If resource access is disabled, the static UI schema remains valid and the resource is not fetched.
|
|
451
|
+
- Resource resolution failures are visible as sanitized snapshot errors; they must not crash the entire form.
|
|
452
|
+
- Resources must not implicitly modify JSON Schema, AJV validation rules, or JSON Forms form data.
|
|
453
|
+
|
|
454
|
+
## 11. Versioning and capability negotiation
|
|
455
|
+
|
|
456
|
+
Keep the core small and add explicit optional profiles:
|
|
457
|
+
|
|
458
|
+
| Profile | Scope | Priority |
|
|
459
|
+
|---|---|---|
|
|
460
|
+
| **Core resource binding** | Virtual source, params, snapshot, `$dynamic` visibility | V1 mandatory |
|
|
461
|
+
| **Resource interactions** | Semantic event -> allowlisted command | V1 optional or V2 |
|
|
462
|
+
| **Pagination metadata** | `hasMore`, `isLoadingMore`, `total`, `loadMore` | Optional |
|
|
463
|
+
| **Inline HTTP** | Trusted host-allowlisted URL declarations | Optional, disabled by default |
|
|
464
|
+
| **Advanced caching** | Staleness, prefetch, persistence | Host concern, not core |
|
|
465
|
+
| **Mutation actions** | Explicit writes/workflows | Separate future design |
|
|
466
|
+
|
|
467
|
+
A host should expose which resource sources and commands are supported, and a renderer capability catalog may describe supported UI options and semantic events. Capability metadata assists authoring and validation, but is not required for simple data binding. Missing required capabilities should produce diagnostics rather than silent, misleading behavior.
|
|
468
|
+
|
|
469
|
+
## 12. Implementation plan
|
|
470
|
+
|
|
471
|
+
### Phase 1 — Minimal proof of concept
|
|
472
|
+
|
|
473
|
+
1. Add `$resources` local aliases and `source`/`params` schema validation.
|
|
474
|
+
2. Add a host resource resolver interface and subscription lifecycle.
|
|
475
|
+
3. Enforce source authorization, parameter bounds, cache isolation, and sanitized snapshots before exposing any resource data.
|
|
476
|
+
4. Inject `resources` snapshots into the existing `$dynamic` context.
|
|
477
|
+
5. Bind a Camunda user-directory resource to an **existing** custom dropdown's `options.items`, `options.loading`, and `options.error`.
|
|
478
|
+
6. Verify no new renderer is needed and no credentials or endpoint URLs appear in the UI schema.
|
|
479
|
+
|
|
480
|
+
### Phase 2 — Practical interaction profile
|
|
481
|
+
|
|
482
|
+
7. Define portable `open`, `searchChange`, `endReached` semantic events only for renderers that can emit them.
|
|
483
|
+
8. Add allowlisted `refresh`, `setParams`, `loadMore` resource commands.
|
|
484
|
+
9. Implement debouncing, pagination, cancellation, stale-query isolation and selected-value lookup in the **host provider**.
|
|
485
|
+
10. Add native Kotlin and web conformance tests using identical JSON fixtures.
|
|
486
|
+
|
|
487
|
+
### Phase 3 — Operational hardening
|
|
488
|
+
|
|
489
|
+
11. Add operational rate limiting, retry policy, observability and deployment-specific auth/CSRF adapters without weakening the Phase 1 trust boundary.
|
|
490
|
+
12. Add diagnostics for missing resource names, invalid params, unsupported events, malformed snapshots, and binding target mismatches.
|
|
491
|
+
13. Publish a capability catalog and examples for AntD, Shadcn, Vue/Svelte and a native renderer.
|
|
492
|
+
|
|
493
|
+
## 13. Conformance and acceptance tests
|
|
494
|
+
|
|
495
|
+
A portable implementation should pass at least these cases:
|
|
496
|
+
|
|
497
|
+
1. **Static fallback:** no resource support -> original UI options remain valid; diagnostics are clear.
|
|
498
|
+
2. **Initial load:** `idle -> pending -> success`, with atomic snapshot and `$dynamic` reevaluation.
|
|
499
|
+
3. **Failure:** sanitized `error`, no leaked credentials, renderer receives mapped error if supported.
|
|
500
|
+
4. **Arbitrary shape:** two different third-party renderers consume the same logical resource through different `$dynamic` mappings.
|
|
501
|
+
5. **Reactive dependency:** changing `data.groupId` changes params and prevents stale responses from overwriting new data.
|
|
502
|
+
6. **Pagination:** provider loads successive pages; no duplicates, cross-query mixing or unnecessary renderer remounts.
|
|
503
|
+
7. **Selected value:** a saved assignee ID resolves even if absent from the first result page.
|
|
504
|
+
8. **Security:** unknown source rejected; unauthorized params rejected; inline URL blocked by default; no JWT/CSRF values enter schema/context/logs.
|
|
505
|
+
9. **Isolation:** user A's cached directory data is not visible to user B or another tenant.
|
|
506
|
+
10. **Cross-runtime:** identical schema, resource snapshots and expressions yield equivalent resolved UI properties in TypeScript and Kotlin implementations.
|
|
507
|
+
11. **Form integrity:** resource updates do not change form data or JSON Schema; selection updates only the intended form path.
|
|
508
|
+
12. **Lifecycle:** dispose/unsubscribe prevents updates after the owning UI scope is gone.
|
|
509
|
+
13. **Null and refresh:** a successful `null` response remains distinguishable from unavailable data under the chosen `hasData` policy; background refresh retains usable data and a nonfatal refresh failure does not erase it.
|
|
510
|
+
14. **Disabled and collision:** disabled resource access issues no request and retains static UI fallback; duplicate nested aliases follow the chosen collision policy with a diagnostic.
|
|
511
|
+
|
|
512
|
+
## 14. Decisions to lock before coding
|
|
513
|
+
|
|
514
|
+
1. **Naming:** retain `$resources` for local aliases, or reuse an existing extension naming convention. Avoid introducing both `$resource` and `$resources` unless distinct semantics are justified.
|
|
515
|
+
2. **Expression syntax:** reuse the exact existing `$dynamic` expression and overlay syntax; standardize a portable subset.
|
|
516
|
+
3. **Snapshot null semantics:** define `hasData` and whether `data` may be `null` on success.
|
|
517
|
+
4. **Scope collision policy:** recommended reject duplicate aliases in nested scopes for V1.
|
|
518
|
+
5. **Transformation placement:** default to host normalization; optional `$dynamic` projection only where already portable.
|
|
519
|
+
6. **Capability metadata:** decide whether to publish semantic event and option schemas in the existing renderer capability catalog.
|
|
520
|
+
7. **Interaction profile:** define only when an actual searchable Camunda selector demonstrates the need.
|
|
521
|
+
|
|
522
|
+
## 15. Final recommendation
|
|
523
|
+
|
|
524
|
+
**Adopt a virtual-resource binding extension, not a remote-data renderer framework.**
|
|
525
|
+
|
|
526
|
+
The portable specification should require only:
|
|
527
|
+
|
|
528
|
+
```text
|
|
529
|
+
UI schema resource alias -> host-resolved virtual source
|
|
530
|
+
host publishes safe resource snapshot -> $dynamic context
|
|
531
|
+
$dynamic maps snapshot -> arbitrary existing renderer options
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
Everything else—HTTP transport, JWT, Camunda Cockpit CSRF headers, search algorithms, pagination cursors, cache policy, retries and API-specific transformation—belongs to the host resource adapter unless an optional portable capability demonstrably needs a declarative contract.
|
|
535
|
+
|
|
536
|
+
This gives Camunda forms the flexibility to consume remote identity services without proliferating renderers, keeps the extended spec coherent with `$dynamic`, and remains implementable in TypeScript, Kotlin, and other runtimes.
|