@cohesivesystems/presentation-core 0.1.0-alpha.1
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 +55 -0
- package/dist/api-scope-request.d.ts +43 -0
- package/dist/api-scope-request.d.ts.map +1 -0
- package/dist/api-scope-request.js +96 -0
- package/dist/api-scope-request.js.map +1 -0
- package/dist/collection-chrome-icons.d.ts +18 -0
- package/dist/collection-chrome-icons.d.ts.map +1 -0
- package/dist/collection-chrome-icons.js +57 -0
- package/dist/collection-chrome-icons.js.map +1 -0
- package/dist/collection-chrome-runtime.d.ts +25 -0
- package/dist/collection-chrome-runtime.d.ts.map +1 -0
- package/dist/collection-chrome-runtime.js +72 -0
- package/dist/collection-chrome-runtime.js.map +1 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts +110 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/collection-chrome-slot-renderer-registry.js +136 -0
- package/dist/collection-chrome-slot-renderer-registry.js.map +1 -0
- package/dist/collection-selection-state.d.ts +18 -0
- package/dist/collection-selection-state.d.ts.map +1 -0
- package/dist/collection-selection-state.js +2 -0
- package/dist/collection-selection-state.js.map +1 -0
- package/dist/data-source-projection.d.ts +475 -0
- package/dist/data-source-projection.d.ts.map +1 -0
- package/dist/data-source-projection.js +880 -0
- package/dist/data-source-projection.js.map +1 -0
- package/dist/data-source-query-lowering.d.ts +35 -0
- package/dist/data-source-query-lowering.d.ts.map +1 -0
- package/dist/data-source-query-lowering.js +104 -0
- package/dist/data-source-query-lowering.js.map +1 -0
- package/dist/date-time-filter-model.d.ts +20 -0
- package/dist/date-time-filter-model.d.ts.map +1 -0
- package/dist/date-time-filter-model.js +115 -0
- package/dist/date-time-filter-model.js.map +1 -0
- package/dist/document-badge-icons.d.ts +4 -0
- package/dist/document-badge-icons.d.ts.map +1 -0
- package/dist/document-badge-icons.js +4 -0
- package/dist/document-badge-icons.js.map +1 -0
- package/dist/document-module.d.ts +268 -0
- package/dist/document-module.d.ts.map +1 -0
- package/dist/document-module.js +347 -0
- package/dist/document-module.js.map +1 -0
- package/dist/document-summary-model.d.ts +2 -0
- package/dist/document-summary-model.d.ts.map +1 -0
- package/dist/document-summary-model.js +2 -0
- package/dist/document-summary-model.js.map +1 -0
- package/dist/document-workspace-chrome-projection.d.ts +18 -0
- package/dist/document-workspace-chrome-projection.d.ts.map +1 -0
- package/dist/document-workspace-chrome-projection.js +35 -0
- package/dist/document-workspace-chrome-projection.js.map +1 -0
- package/dist/document-workspace-surface-slots.d.ts +75 -0
- package/dist/document-workspace-surface-slots.d.ts.map +1 -0
- package/dist/document-workspace-surface-slots.js +268 -0
- package/dist/document-workspace-surface-slots.js.map +1 -0
- package/dist/endpoint-executor.d.ts +62 -0
- package/dist/endpoint-executor.d.ts.map +1 -0
- package/dist/endpoint-executor.js +35 -0
- package/dist/endpoint-executor.js.map +1 -0
- package/dist/field-display-resolution.d.ts +5 -0
- package/dist/field-display-resolution.d.ts.map +1 -0
- package/dist/field-display-resolution.js +50 -0
- package/dist/field-display-resolution.js.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +48 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +108 -0
- package/dist/module.js.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts +12 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.js +29 -0
- package/dist/navigation-shell-frame-renderer-registry.js.map +1 -0
- package/dist/navigation-shell-layout-runtime.d.ts +29 -0
- package/dist/navigation-shell-layout-runtime.d.ts.map +1 -0
- package/dist/navigation-shell-layout-runtime.js +50 -0
- package/dist/navigation-shell-layout-runtime.js.map +1 -0
- package/dist/navigation-shell-region-component-registry.d.ts +96 -0
- package/dist/navigation-shell-region-component-registry.d.ts.map +1 -0
- package/dist/navigation-shell-region-component-registry.js +108 -0
- package/dist/navigation-shell-region-component-registry.js.map +1 -0
- package/dist/navigation-shell-runtime.d.ts +48 -0
- package/dist/navigation-shell-runtime.d.ts.map +1 -0
- package/dist/navigation-shell-runtime.js +457 -0
- package/dist/navigation-shell-runtime.js.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts +15 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.js +48 -0
- package/dist/navigation-shell-slot-renderer-registry.js.map +1 -0
- package/dist/navigation.d.ts +84 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +167 -0
- package/dist/navigation.js.map +1 -0
- package/dist/object-path.d.ts +23 -0
- package/dist/object-path.d.ts.map +1 -0
- package/dist/object-path.js +63 -0
- package/dist/object-path.js.map +1 -0
- package/dist/page-host-renderer-registry.d.ts +119 -0
- package/dist/page-host-renderer-registry.d.ts.map +1 -0
- package/dist/page-host-renderer-registry.js +305 -0
- package/dist/page-host-renderer-registry.js.map +1 -0
- package/dist/presentation-action-endpoint-request-projection.d.ts +23 -0
- package/dist/presentation-action-endpoint-request-projection.d.ts.map +1 -0
- package/dist/presentation-action-endpoint-request-projection.js +117 -0
- package/dist/presentation-action-endpoint-request-projection.js.map +1 -0
- package/dist/presentation-action-endpoint.d.ts +24 -0
- package/dist/presentation-action-endpoint.d.ts.map +1 -0
- package/dist/presentation-action-endpoint.js +56 -0
- package/dist/presentation-action-endpoint.js.map +1 -0
- package/dist/presentation-action-icons.d.ts +4 -0
- package/dist/presentation-action-icons.d.ts.map +1 -0
- package/dist/presentation-action-icons.js +4 -0
- package/dist/presentation-action-icons.js.map +1 -0
- package/dist/presentation-action-result-state.d.ts +48 -0
- package/dist/presentation-action-result-state.d.ts.map +1 -0
- package/dist/presentation-action-result-state.js +109 -0
- package/dist/presentation-action-result-state.js.map +1 -0
- package/dist/presentation-action-runtime-binding.d.ts +48 -0
- package/dist/presentation-action-runtime-binding.d.ts.map +1 -0
- package/dist/presentation-action-runtime-binding.js +52 -0
- package/dist/presentation-action-runtime-binding.js.map +1 -0
- package/dist/presentation-action-runtime-diagnostics.d.ts +18 -0
- package/dist/presentation-action-runtime-diagnostics.d.ts.map +1 -0
- package/dist/presentation-action-runtime-diagnostics.js +69 -0
- package/dist/presentation-action-runtime-diagnostics.js.map +1 -0
- package/dist/presentation-action-runtime-labels.d.ts +15 -0
- package/dist/presentation-action-runtime-labels.d.ts.map +1 -0
- package/dist/presentation-action-runtime-labels.js +28 -0
- package/dist/presentation-action-runtime-labels.js.map +1 -0
- package/dist/presentation-action-runtime-projection.d.ts +17 -0
- package/dist/presentation-action-runtime-projection.d.ts.map +1 -0
- package/dist/presentation-action-runtime-projection.js +31 -0
- package/dist/presentation-action-runtime-projection.js.map +1 -0
- package/dist/presentation-badge-resolution.d.ts +8 -0
- package/dist/presentation-badge-resolution.d.ts.map +1 -0
- package/dist/presentation-badge-resolution.js +73 -0
- package/dist/presentation-badge-resolution.js.map +1 -0
- package/dist/presentation-collection-pagination.d.ts +32 -0
- package/dist/presentation-collection-pagination.d.ts.map +1 -0
- package/dist/presentation-collection-pagination.js +275 -0
- package/dist/presentation-collection-pagination.js.map +1 -0
- package/dist/presentation-content-diagnostics.d.ts +17 -0
- package/dist/presentation-content-diagnostics.d.ts.map +1 -0
- package/dist/presentation-content-diagnostics.js +61 -0
- package/dist/presentation-content-diagnostics.js.map +1 -0
- package/dist/presentation-content-resolution.d.ts +9 -0
- package/dist/presentation-content-resolution.d.ts.map +1 -0
- package/dist/presentation-content-resolution.js +19 -0
- package/dist/presentation-content-resolution.js.map +1 -0
- package/dist/presentation-data-source-binding-model.d.ts +81 -0
- package/dist/presentation-data-source-binding-model.d.ts.map +1 -0
- package/dist/presentation-data-source-binding-model.js +56 -0
- package/dist/presentation-data-source-binding-model.js.map +1 -0
- package/dist/presentation-data-source-runtime.d.ts +62 -0
- package/dist/presentation-data-source-runtime.d.ts.map +1 -0
- package/dist/presentation-data-source-runtime.js +80 -0
- package/dist/presentation-data-source-runtime.js.map +1 -0
- package/dist/presentation-design-intent-diagnostics.d.ts +25 -0
- package/dist/presentation-design-intent-diagnostics.d.ts.map +1 -0
- package/dist/presentation-design-intent-diagnostics.js +55 -0
- package/dist/presentation-design-intent-diagnostics.js.map +1 -0
- package/dist/presentation-icon-diagnostics.d.ts +45 -0
- package/dist/presentation-icon-diagnostics.d.ts.map +1 -0
- package/dist/presentation-icon-diagnostics.js +235 -0
- package/dist/presentation-icon-diagnostics.js.map +1 -0
- package/dist/presentation-icon-registry.d.ts +36 -0
- package/dist/presentation-icon-registry.d.ts.map +1 -0
- package/dist/presentation-icon-registry.js +81 -0
- package/dist/presentation-icon-registry.js.map +1 -0
- package/dist/presentation-navigation-action-runtime-bindings.d.ts +13 -0
- package/dist/presentation-navigation-action-runtime-bindings.d.ts.map +1 -0
- package/dist/presentation-navigation-action-runtime-bindings.js +29 -0
- package/dist/presentation-navigation-action-runtime-bindings.js.map +1 -0
- package/dist/presentation-pagination.d.ts +98 -0
- package/dist/presentation-pagination.d.ts.map +1 -0
- package/dist/presentation-pagination.js +427 -0
- package/dist/presentation-pagination.js.map +1 -0
- package/dist/presentation-projection-coverage.d.ts +38 -0
- package/dist/presentation-projection-coverage.d.ts.map +1 -0
- package/dist/presentation-projection-coverage.js +2429 -0
- package/dist/presentation-projection-coverage.js.map +1 -0
- package/dist/presentation-projection-diagnostics.d.ts +33 -0
- package/dist/presentation-projection-diagnostics.d.ts.map +1 -0
- package/dist/presentation-projection-diagnostics.js +17 -0
- package/dist/presentation-projection-diagnostics.js.map +1 -0
- package/dist/presentation-projection-trace.d.ts +97 -0
- package/dist/presentation-projection-trace.d.ts.map +1 -0
- package/dist/presentation-projection-trace.js +110 -0
- package/dist/presentation-projection-trace.js.map +1 -0
- package/dist/presentation-query-form-state.d.ts +15 -0
- package/dist/presentation-query-form-state.d.ts.map +1 -0
- package/dist/presentation-query-form-state.js +20 -0
- package/dist/presentation-query-form-state.js.map +1 -0
- package/dist/presentation-renderer-registry.d.ts +86 -0
- package/dist/presentation-renderer-registry.d.ts.map +1 -0
- package/dist/presentation-renderer-registry.js +108 -0
- package/dist/presentation-renderer-registry.js.map +1 -0
- package/dist/presentation-semantics.d.ts +288 -0
- package/dist/presentation-semantics.d.ts.map +1 -0
- package/dist/presentation-semantics.js +560 -0
- package/dist/presentation-semantics.js.map +1 -0
- package/dist/presentation-standards.d.ts +8 -0
- package/dist/presentation-standards.d.ts.map +1 -0
- package/dist/presentation-standards.js +9 -0
- package/dist/presentation-standards.js.map +1 -0
- package/dist/presentation-test-selectors.d.ts +146 -0
- package/dist/presentation-test-selectors.d.ts.map +1 -0
- package/dist/presentation-test-selectors.js +113 -0
- package/dist/presentation-test-selectors.js.map +1 -0
- package/dist/presentation-value-formatting.d.ts +12 -0
- package/dist/presentation-value-formatting.d.ts.map +1 -0
- package/dist/presentation-value-formatting.js +33 -0
- package/dist/presentation-value-formatting.js.map +1 -0
- package/dist/presentation-value-resolution.d.ts +7 -0
- package/dist/presentation-value-resolution.d.ts.map +1 -0
- package/dist/presentation-value-resolution.js +69 -0
- package/dist/presentation-value-resolution.js.map +1 -0
- package/dist/presentation-view-tree.d.ts +6 -0
- package/dist/presentation-view-tree.d.ts.map +1 -0
- package/dist/presentation-view-tree.js +15 -0
- package/dist/presentation-view-tree.js.map +1 -0
- package/dist/process-task-model.d.ts +80 -0
- package/dist/process-task-model.d.ts.map +1 -0
- package/dist/process-task-model.js +52 -0
- package/dist/process-task-model.js.map +1 -0
- package/dist/process-task-projection.d.ts +46 -0
- package/dist/process-task-projection.d.ts.map +1 -0
- package/dist/process-task-projection.js +233 -0
- package/dist/process-task-projection.js.map +1 -0
- package/dist/projected-action-status-projection.d.ts +18 -0
- package/dist/projected-action-status-projection.d.ts.map +1 -0
- package/dist/projected-action-status-projection.js +19 -0
- package/dist/projected-action-status-projection.js.map +1 -0
- package/dist/projected-activity-state-model.d.ts +22 -0
- package/dist/projected-activity-state-model.d.ts.map +1 -0
- package/dist/projected-activity-state-model.js +87 -0
- package/dist/projected-activity-state-model.js.map +1 -0
- package/dist/projected-collection-action-runtime-bindings.d.ts +12 -0
- package/dist/projected-collection-action-runtime-bindings.d.ts.map +1 -0
- package/dist/projected-collection-action-runtime-bindings.js +37 -0
- package/dist/projected-collection-action-runtime-bindings.js.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts +23 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.js +168 -0
- package/dist/projected-collection-action-runtime-diagnostics.js.map +1 -0
- package/dist/projected-collection-runtime.d.ts +475 -0
- package/dist/projected-collection-runtime.d.ts.map +1 -0
- package/dist/projected-collection-runtime.js +832 -0
- package/dist/projected-collection-runtime.js.map +1 -0
- package/dist/projected-document-action-diagnostics.d.ts +16 -0
- package/dist/projected-document-action-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-diagnostics.js +113 -0
- package/dist/projected-document-action-diagnostics.js.map +1 -0
- package/dist/projected-document-action-enablements.d.ts +25 -0
- package/dist/projected-document-action-enablements.d.ts.map +1 -0
- package/dist/projected-document-action-enablements.js +38 -0
- package/dist/projected-document-action-enablements.js.map +1 -0
- package/dist/projected-document-action-projection.d.ts +45 -0
- package/dist/projected-document-action-projection.d.ts.map +1 -0
- package/dist/projected-document-action-projection.js +201 -0
- package/dist/projected-document-action-projection.js.map +1 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.d.ts +16 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.js +168 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.js.map +1 -0
- package/dist/projected-document-action-runtime-profile.d.ts +64 -0
- package/dist/projected-document-action-runtime-profile.d.ts.map +1 -0
- package/dist/projected-document-action-runtime-profile.js +33 -0
- package/dist/projected-document-action-runtime-profile.js.map +1 -0
- package/dist/projected-document-action-status-notice-diagnostics.d.ts +10 -0
- package/dist/projected-document-action-status-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-status-notice-diagnostics.js +64 -0
- package/dist/projected-document-action-status-notice-diagnostics.js.map +1 -0
- package/dist/projected-document-badge-formatting.d.ts +2 -0
- package/dist/projected-document-badge-formatting.d.ts.map +1 -0
- package/dist/projected-document-badge-formatting.js +7 -0
- package/dist/projected-document-badge-formatting.js.map +1 -0
- package/dist/projected-document-editor-model.d.ts +4 -0
- package/dist/projected-document-editor-model.d.ts.map +1 -0
- package/dist/projected-document-editor-model.js +2 -0
- package/dist/projected-document-editor-model.js.map +1 -0
- package/dist/projected-document-field-navigation.d.ts +72 -0
- package/dist/projected-document-field-navigation.d.ts.map +1 -0
- package/dist/projected-document-field-navigation.js +143 -0
- package/dist/projected-document-field-navigation.js.map +1 -0
- package/dist/projected-document-field-semantics.d.ts +5 -0
- package/dist/projected-document-field-semantics.d.ts.map +1 -0
- package/dist/projected-document-field-semantics.js +16 -0
- package/dist/projected-document-field-semantics.js.map +1 -0
- package/dist/projected-document-workspace-data-source-bindings.d.ts +69 -0
- package/dist/projected-document-workspace-data-source-bindings.d.ts.map +1 -0
- package/dist/projected-document-workspace-data-source-bindings.js +81 -0
- package/dist/projected-document-workspace-data-source-bindings.js.map +1 -0
- package/dist/projected-document-workspace-notice-diagnostics.d.ts +12 -0
- package/dist/projected-document-workspace-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-workspace-notice-diagnostics.js +13 -0
- package/dist/projected-document-workspace-notice-diagnostics.js.map +1 -0
- package/dist/projected-input-form-runtime.d.ts +62 -0
- package/dist/projected-input-form-runtime.d.ts.map +1 -0
- package/dist/projected-input-form-runtime.js +2 -0
- package/dist/projected-input-form-runtime.js.map +1 -0
- package/dist/projected-process-task-notice-diagnostics.d.ts +13 -0
- package/dist/projected-process-task-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-process-task-notice-diagnostics.js +170 -0
- package/dist/projected-process-task-notice-diagnostics.js.map +1 -0
- package/dist/projected-query-form-runtime.d.ts +46 -0
- package/dist/projected-query-form-runtime.d.ts.map +1 -0
- package/dist/projected-query-form-runtime.js +2 -0
- package/dist/projected-query-form-runtime.js.map +1 -0
- package/dist/prompt-document-preview-projection.d.ts +46 -0
- package/dist/prompt-document-preview-projection.d.ts.map +1 -0
- package/dist/prompt-document-preview-projection.js +173 -0
- package/dist/prompt-document-preview-projection.js.map +1 -0
- package/dist/prompt-icons.d.ts +4 -0
- package/dist/prompt-icons.d.ts.map +1 -0
- package/dist/prompt-icons.js +4 -0
- package/dist/prompt-icons.js.map +1 -0
- package/dist/prompt-status-message-resolution.d.ts +18 -0
- package/dist/prompt-status-message-resolution.d.ts.map +1 -0
- package/dist/prompt-status-message-resolution.js +83 -0
- package/dist/prompt-status-message-resolution.js.map +1 -0
- package/dist/query-form-lowering.d.ts +16 -0
- package/dist/query-form-lowering.d.ts.map +1 -0
- package/dist/query-form-lowering.js +38 -0
- package/dist/query-form-lowering.js.map +1 -0
- package/dist/query-form-url-state.d.ts +44 -0
- package/dist/query-form-url-state.d.ts.map +1 -0
- package/dist/query-form-url-state.js +197 -0
- package/dist/query-form-url-state.js.map +1 -0
- package/dist/query-offset-page.d.ts +13 -0
- package/dist/query-offset-page.d.ts.map +1 -0
- package/dist/query-offset-page.js +24 -0
- package/dist/query-offset-page.js.map +1 -0
- package/dist/relation-query-input-form-target.d.ts +10 -0
- package/dist/relation-query-input-form-target.d.ts.map +1 -0
- package/dist/relation-query-input-form-target.js +30 -0
- package/dist/relation-query-input-form-target.js.map +1 -0
- package/dist/scope-selection.d.ts +94 -0
- package/dist/scope-selection.d.ts.map +1 -0
- package/dist/scope-selection.js +95 -0
- package/dist/scope-selection.js.map +1 -0
- package/dist/target-bindings.d.ts +39 -0
- package/dist/target-bindings.d.ts.map +1 -0
- package/dist/target-bindings.js +40 -0
- package/dist/target-bindings.js.map +1 -0
- package/dist/view-chrome-content-diagnostics.d.ts +8 -0
- package/dist/view-chrome-content-diagnostics.d.ts.map +1 -0
- package/dist/view-chrome-content-diagnostics.js +84 -0
- package/dist/view-chrome-content-diagnostics.js.map +1 -0
- package/dist/view-chrome-icons.d.ts +12 -0
- package/dist/view-chrome-icons.d.ts.map +1 -0
- package/dist/view-chrome-icons.js +50 -0
- package/dist/view-chrome-icons.js.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts +19 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.js +62 -0
- package/dist/view-chrome-slot-renderer-registry.js.map +1 -0
- package/package.json +53 -0
- package/src/api-scope-request.ts +186 -0
- package/src/collection-chrome-icons.ts +89 -0
- package/src/collection-chrome-runtime.ts +151 -0
- package/src/collection-chrome-slot-renderer-registry.ts +227 -0
- package/src/collection-selection-state.ts +32 -0
- package/src/data-source-projection.ts +2149 -0
- package/src/data-source-query-lowering.ts +217 -0
- package/src/date-time-filter-model.ts +156 -0
- package/src/document-badge-icons.ts +3 -0
- package/src/document-module.ts +741 -0
- package/src/document-summary-model.ts +1 -0
- package/src/document-workspace-chrome-projection.ts +62 -0
- package/src/document-workspace-surface-slots.ts +458 -0
- package/src/endpoint-executor.ts +122 -0
- package/src/field-display-resolution.ts +99 -0
- package/src/index.ts +104 -0
- package/src/module.ts +281 -0
- package/src/navigation-shell-frame-renderer-registry.ts +65 -0
- package/src/navigation-shell-layout-runtime.ts +124 -0
- package/src/navigation-shell-region-component-registry.ts +242 -0
- package/src/navigation-shell-runtime.ts +579 -0
- package/src/navigation-shell-slot-renderer-registry.ts +94 -0
- package/src/navigation.ts +364 -0
- package/src/object-path.ts +99 -0
- package/src/page-host-renderer-registry.ts +615 -0
- package/src/presentation-action-endpoint-request-projection.ts +223 -0
- package/src/presentation-action-endpoint.ts +130 -0
- package/src/presentation-action-icons.ts +3 -0
- package/src/presentation-action-result-state.ts +189 -0
- package/src/presentation-action-runtime-binding.ts +177 -0
- package/src/presentation-action-runtime-diagnostics.ts +120 -0
- package/src/presentation-action-runtime-labels.ts +57 -0
- package/src/presentation-action-runtime-projection.ts +67 -0
- package/src/presentation-badge-resolution.ts +138 -0
- package/src/presentation-collection-pagination.ts +436 -0
- package/src/presentation-content-diagnostics.ts +121 -0
- package/src/presentation-content-resolution.ts +46 -0
- package/src/presentation-data-source-binding-model.ts +140 -0
- package/src/presentation-data-source-runtime.ts +190 -0
- package/src/presentation-design-intent-diagnostics.ts +104 -0
- package/src/presentation-icon-diagnostics.ts +368 -0
- package/src/presentation-icon-registry.ts +181 -0
- package/src/presentation-navigation-action-runtime-bindings.ts +54 -0
- package/src/presentation-pagination.ts +694 -0
- package/src/presentation-projection-coverage.ts +3257 -0
- package/src/presentation-projection-diagnostics.ts +71 -0
- package/src/presentation-projection-trace.ts +293 -0
- package/src/presentation-query-form-state.ts +54 -0
- package/src/presentation-renderer-registry.ts +269 -0
- package/src/presentation-semantics.ts +1028 -0
- package/src/presentation-standards.ts +14 -0
- package/src/presentation-test-selectors.ts +312 -0
- package/src/presentation-value-formatting.ts +65 -0
- package/src/presentation-value-resolution.ts +100 -0
- package/src/presentation-view-tree.ts +33 -0
- package/src/process-task-model.ts +158 -0
- package/src/process-task-projection.ts +398 -0
- package/src/projected-action-status-projection.ts +43 -0
- package/src/projected-activity-state-model.ts +123 -0
- package/src/projected-collection-action-runtime-bindings.ts +76 -0
- package/src/projected-collection-action-runtime-diagnostics.ts +289 -0
- package/src/projected-collection-runtime.ts +1772 -0
- package/src/projected-document-action-diagnostics.ts +196 -0
- package/src/projected-document-action-enablements.ts +99 -0
- package/src/projected-document-action-projection.ts +464 -0
- package/src/projected-document-action-runtime-profile-diagnostics.ts +250 -0
- package/src/projected-document-action-runtime-profile.ts +133 -0
- package/src/projected-document-action-status-notice-diagnostics.ts +116 -0
- package/src/projected-document-badge-formatting.ts +7 -0
- package/src/projected-document-editor-model.ts +7 -0
- package/src/projected-document-field-navigation.ts +300 -0
- package/src/projected-document-field-semantics.ts +27 -0
- package/src/projected-document-workspace-data-source-bindings.ts +182 -0
- package/src/projected-document-workspace-notice-diagnostics.ts +41 -0
- package/src/projected-input-form-runtime.ts +86 -0
- package/src/projected-process-task-notice-diagnostics.ts +283 -0
- package/src/projected-query-form-runtime.ts +62 -0
- package/src/prompt-document-preview-projection.ts +345 -0
- package/src/prompt-icons.ts +3 -0
- package/src/prompt-status-message-resolution.ts +158 -0
- package/src/query-form-lowering.ts +77 -0
- package/src/query-form-url-state.ts +346 -0
- package/src/query-offset-page.ts +50 -0
- package/src/relation-query-input-form-target.ts +61 -0
- package/src/scope-selection.ts +201 -0
- package/src/target-bindings.ts +123 -0
- package/src/view-chrome-content-diagnostics.ts +139 -0
- package/src/view-chrome-icons.ts +81 -0
- package/src/view-chrome-slot-renderer-registry.ts +128 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InputFormDefinition,
|
|
3
|
+
QueryFormDefinition,
|
|
4
|
+
QueryFormUrlPolicyDefinition,
|
|
5
|
+
} from './module'
|
|
6
|
+
import {
|
|
7
|
+
readObjectPath,
|
|
8
|
+
writeObjectPath,
|
|
9
|
+
} from './object-path'
|
|
10
|
+
|
|
11
|
+
export interface QueryFormUrlFieldBinding {
|
|
12
|
+
readonly fieldId: string
|
|
13
|
+
readonly valuePath: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface QueryFormUrlFieldCodec<TValue extends object> {
|
|
17
|
+
readonly deleteParams?: (context: QueryFormUrlFieldDeleteContext<TValue>) => void
|
|
18
|
+
readonly read?: (context: QueryFormUrlFieldReadContext<TValue>) => unknown
|
|
19
|
+
readonly write?: (context: QueryFormUrlFieldWriteContext<TValue>) => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type QueryFormUrlFieldCodecs<TValue extends object> = Readonly<
|
|
23
|
+
Record<string, QueryFormUrlFieldCodec<TValue> | undefined>
|
|
24
|
+
>
|
|
25
|
+
|
|
26
|
+
export interface QueryFormUrlFieldDeleteContext<TValue extends object> {
|
|
27
|
+
readonly defaultValue: TValue
|
|
28
|
+
readonly field: QueryFormUrlFieldBinding
|
|
29
|
+
readonly key: string
|
|
30
|
+
readonly params: URLSearchParams
|
|
31
|
+
readonly queryForm: QueryFormDefinition | null
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface QueryFormUrlFieldReadContext<TValue extends object>
|
|
35
|
+
extends QueryFormUrlFieldDeleteContext<TValue> {
|
|
36
|
+
readonly defaultFieldValue: unknown
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface QueryFormUrlFieldWriteContext<TValue extends object>
|
|
40
|
+
extends QueryFormUrlFieldReadContext<TValue> {
|
|
41
|
+
readonly allValues: readonly string[]
|
|
42
|
+
readonly fieldValue: unknown
|
|
43
|
+
readonly value: TValue
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface QueryFormUrlValueOptions<TValue extends object> {
|
|
47
|
+
readonly defaultValue: TValue
|
|
48
|
+
readonly fieldCodecs?: QueryFormUrlFieldCodecs<TValue>
|
|
49
|
+
readonly fields: readonly QueryFormUrlFieldBinding[]
|
|
50
|
+
readonly policy?: QueryFormUrlPolicyDefinition | null
|
|
51
|
+
readonly queryForm?: QueryFormDefinition | null
|
|
52
|
+
readonly search: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface CreateQueryFormUrlSearchOptions<TValue extends object>
|
|
56
|
+
extends QueryFormUrlValueOptions<TValue> {
|
|
57
|
+
readonly allValuesByFieldId?: Readonly<Record<string, readonly string[] | undefined>>
|
|
58
|
+
readonly value: TValue
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function createQueryFormUrlFields(
|
|
62
|
+
inputForm: InputFormDefinition | null,
|
|
63
|
+
queryForm: QueryFormDefinition | null,
|
|
64
|
+
): readonly QueryFormUrlFieldBinding[] {
|
|
65
|
+
if (!inputForm) {
|
|
66
|
+
return []
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const targetFieldIds = new Set([
|
|
70
|
+
...(queryForm?.Target.Predicates.map((predicate) => predicate.FieldId) ?? []),
|
|
71
|
+
...(queryForm?.Target.Result.RequestBindings.map((binding) => binding.FieldId) ?? []),
|
|
72
|
+
])
|
|
73
|
+
const includeAllFields = targetFieldIds.size === 0
|
|
74
|
+
|
|
75
|
+
return inputForm.Fields
|
|
76
|
+
.filter((field) =>
|
|
77
|
+
field.ValuePath &&
|
|
78
|
+
(includeAllFields || targetFieldIds.has(field.Id) || targetFieldIds.has(field.FieldId))
|
|
79
|
+
)
|
|
80
|
+
.map((field) => ({
|
|
81
|
+
fieldId: field.Id,
|
|
82
|
+
valuePath: field.ValuePath,
|
|
83
|
+
}))
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function readQueryFormUrlValue<TValue extends object>({
|
|
87
|
+
defaultValue,
|
|
88
|
+
fieldCodecs = {},
|
|
89
|
+
fields,
|
|
90
|
+
policy,
|
|
91
|
+
queryForm = null,
|
|
92
|
+
search,
|
|
93
|
+
}: QueryFormUrlValueOptions<TValue>): TValue {
|
|
94
|
+
const urlPolicy = resolveQueryFormUrlPolicy(queryForm, policy)
|
|
95
|
+
if (!urlPolicy) {
|
|
96
|
+
return clonePlainValue(defaultValue)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const params = new URLSearchParams(search)
|
|
100
|
+
const result = clonePlainValue(defaultValue)
|
|
101
|
+
|
|
102
|
+
for (const field of fields) {
|
|
103
|
+
const key = createQueryFormUrlFieldParamKey(queryForm, urlPolicy, field.fieldId)
|
|
104
|
+
const defaultFieldValue = readObjectPath(defaultValue, field.valuePath)
|
|
105
|
+
const codec = fieldCodecs[field.fieldId]
|
|
106
|
+
const nextValue = codec?.read
|
|
107
|
+
? codec.read({
|
|
108
|
+
defaultFieldValue,
|
|
109
|
+
defaultValue,
|
|
110
|
+
field,
|
|
111
|
+
key,
|
|
112
|
+
params,
|
|
113
|
+
queryForm,
|
|
114
|
+
})
|
|
115
|
+
: readDefaultQueryFormUrlFieldValue(params, key, defaultFieldValue)
|
|
116
|
+
|
|
117
|
+
if (nextValue !== undefined) {
|
|
118
|
+
writeObjectPath(result as Record<string, unknown>, field.valuePath, nextValue)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return result
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function createQueryFormUrlSearch<TValue extends object>({
|
|
126
|
+
allValuesByFieldId = {},
|
|
127
|
+
defaultValue,
|
|
128
|
+
fieldCodecs = {},
|
|
129
|
+
fields,
|
|
130
|
+
policy,
|
|
131
|
+
queryForm = null,
|
|
132
|
+
search,
|
|
133
|
+
value,
|
|
134
|
+
}: CreateQueryFormUrlSearchOptions<TValue>) {
|
|
135
|
+
const urlPolicy = resolveQueryFormUrlPolicy(queryForm, policy)
|
|
136
|
+
if (!urlPolicy) {
|
|
137
|
+
return normalizeSearch(search)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const params = new URLSearchParams(search)
|
|
141
|
+
|
|
142
|
+
for (const field of fields) {
|
|
143
|
+
const key = createQueryFormUrlFieldParamKey(queryForm, urlPolicy, field.fieldId)
|
|
144
|
+
const codec = fieldCodecs[field.fieldId]
|
|
145
|
+
if (codec?.deleteParams) {
|
|
146
|
+
codec.deleteParams({ defaultValue, field, key, params, queryForm })
|
|
147
|
+
} else {
|
|
148
|
+
params.delete(key)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
for (const field of fields) {
|
|
153
|
+
const key = createQueryFormUrlFieldParamKey(queryForm, urlPolicy, field.fieldId)
|
|
154
|
+
const defaultFieldValue = readObjectPath(defaultValue, field.valuePath)
|
|
155
|
+
const fieldValue = readObjectPath(value, field.valuePath)
|
|
156
|
+
const codec = fieldCodecs[field.fieldId]
|
|
157
|
+
|
|
158
|
+
if (codec?.write) {
|
|
159
|
+
codec.write({
|
|
160
|
+
allValues: allValuesByFieldId[field.fieldId] ?? [],
|
|
161
|
+
defaultFieldValue,
|
|
162
|
+
defaultValue,
|
|
163
|
+
field,
|
|
164
|
+
fieldValue,
|
|
165
|
+
key,
|
|
166
|
+
params,
|
|
167
|
+
queryForm,
|
|
168
|
+
value,
|
|
169
|
+
})
|
|
170
|
+
} else {
|
|
171
|
+
writeDefaultQueryFormUrlFieldValue(
|
|
172
|
+
params,
|
|
173
|
+
key,
|
|
174
|
+
fieldValue,
|
|
175
|
+
defaultFieldValue,
|
|
176
|
+
allValuesByFieldId[field.fieldId] ?? [],
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const nextSearch = params.toString()
|
|
182
|
+
return nextSearch.length > 0 ? `?${nextSearch}` : ''
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function createQueryFormUrlSearchKey<TValue extends object>(
|
|
186
|
+
options: QueryFormUrlValueOptions<TValue> &
|
|
187
|
+
Pick<CreateQueryFormUrlSearchOptions<TValue>, 'allValuesByFieldId'>,
|
|
188
|
+
) {
|
|
189
|
+
const value = readQueryFormUrlValue(options)
|
|
190
|
+
return createQueryFormUrlSearch({
|
|
191
|
+
...options,
|
|
192
|
+
search: '',
|
|
193
|
+
value,
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function createQueryFormUrlFieldParamKey(
|
|
198
|
+
queryForm: QueryFormDefinition | null,
|
|
199
|
+
policy: QueryFormUrlPolicyDefinition,
|
|
200
|
+
fieldId: string,
|
|
201
|
+
) {
|
|
202
|
+
const prefix = toQueryParamSegment(
|
|
203
|
+
policy.ParameterPrefix?.trim() || queryForm?.Id || 'query',
|
|
204
|
+
)
|
|
205
|
+
return `${prefix}_${toQueryParamSegment(fieldId)}`
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function resolveQueryFormUrlPolicy(
|
|
209
|
+
queryForm: QueryFormDefinition | null,
|
|
210
|
+
policy: QueryFormUrlPolicyDefinition | null | undefined,
|
|
211
|
+
) {
|
|
212
|
+
const resolvedPolicy = policy ?? queryForm?.Target.State.Url ?? null
|
|
213
|
+
return resolvedPolicy?.IsEnabled && resolvedPolicy.IncludeAppliedFilters
|
|
214
|
+
? resolvedPolicy
|
|
215
|
+
: null
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function readDefaultQueryFormUrlFieldValue(
|
|
219
|
+
params: URLSearchParams,
|
|
220
|
+
key: string,
|
|
221
|
+
defaultValue: unknown,
|
|
222
|
+
) {
|
|
223
|
+
const values = params.getAll(key).map((value) => value.trim()).filter(Boolean)
|
|
224
|
+
if (values.length === 0) {
|
|
225
|
+
return defaultValue
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (Array.isArray(defaultValue)) {
|
|
229
|
+
return normalizeStringSet(values)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (typeof defaultValue === 'boolean') {
|
|
233
|
+
const value = values[0]?.toLocaleLowerCase()
|
|
234
|
+
if (value === 'true') {
|
|
235
|
+
return true
|
|
236
|
+
}
|
|
237
|
+
if (value === 'false') {
|
|
238
|
+
return false
|
|
239
|
+
}
|
|
240
|
+
return defaultValue
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (typeof defaultValue === 'number') {
|
|
244
|
+
const parsed = Number.parseFloat(values[0] ?? '')
|
|
245
|
+
return Number.isFinite(parsed) ? parsed : defaultValue
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return values[0] ?? defaultValue
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function writeDefaultQueryFormUrlFieldValue(
|
|
252
|
+
params: URLSearchParams,
|
|
253
|
+
key: string,
|
|
254
|
+
value: unknown,
|
|
255
|
+
defaultValue: unknown,
|
|
256
|
+
allValues: readonly string[],
|
|
257
|
+
) {
|
|
258
|
+
if (Array.isArray(value)) {
|
|
259
|
+
const selectedValues = normalizeStringSet(value)
|
|
260
|
+
if (
|
|
261
|
+
selectedValues.length === 0 ||
|
|
262
|
+
areStringSetsEqual(selectedValues, normalizeStringSet(allValues)) ||
|
|
263
|
+
areStringSetsEqual(selectedValues, normalizeStringSet(asStringArray(defaultValue)))
|
|
264
|
+
) {
|
|
265
|
+
return
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
selectedValues.forEach((selectedValue) => params.append(key, selectedValue))
|
|
269
|
+
return
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (typeof value === 'string') {
|
|
273
|
+
const nextValue = value.trim()
|
|
274
|
+
const defaultText = typeof defaultValue === 'string' ? defaultValue.trim() : ''
|
|
275
|
+
if (nextValue && nextValue !== defaultText) {
|
|
276
|
+
params.set(key, nextValue)
|
|
277
|
+
}
|
|
278
|
+
return
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (typeof value === 'boolean') {
|
|
282
|
+
if (value !== defaultValue) {
|
|
283
|
+
params.set(key, String(value))
|
|
284
|
+
}
|
|
285
|
+
return
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
289
|
+
if (value !== defaultValue) {
|
|
290
|
+
params.set(key, String(value))
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function clonePlainValue<TValue>(value: TValue): TValue {
|
|
296
|
+
if (Array.isArray(value)) {
|
|
297
|
+
return value.map(clonePlainValue) as TValue
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (value && typeof value === 'object') {
|
|
301
|
+
return Object.fromEntries(
|
|
302
|
+
Object.entries(value).map(([key, entryValue]) => [key, clonePlainValue(entryValue)]),
|
|
303
|
+
) as TValue
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return value
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function normalizeSearch(search: string) {
|
|
310
|
+
if (!search) {
|
|
311
|
+
return ''
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return search.startsWith('?') ? search : `?${search}`
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function toQueryParamSegment(value: string) {
|
|
318
|
+
return value
|
|
319
|
+
.trim()
|
|
320
|
+
.replace(/[^a-zA-Z0-9]+/g, '_')
|
|
321
|
+
.replace(/^_+|_+$/g, '')
|
|
322
|
+
.toLocaleLowerCase()
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function asStringArray(value: unknown) {
|
|
326
|
+
return Array.isArray(value) ? value : []
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function normalizeStringSet(values: readonly unknown[]) {
|
|
330
|
+
return Array.from(
|
|
331
|
+
new Set(
|
|
332
|
+
values
|
|
333
|
+
.map((value) => String(value).trim())
|
|
334
|
+
.filter((value) => value.length > 0),
|
|
335
|
+
),
|
|
336
|
+
)
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function areStringSetsEqual(left: readonly string[], right: readonly string[]) {
|
|
340
|
+
if (left.length === 0 || right.length === 0 || left.length !== right.length) {
|
|
341
|
+
return false
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const rightValues = new Set(right)
|
|
345
|
+
return left.every((value) => rightValues.has(value))
|
|
346
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface QueryOffsetPageResult<TItem> {
|
|
2
|
+
readonly Items: TItem[]
|
|
3
|
+
readonly Limit: number
|
|
4
|
+
readonly Offset: number
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type QueryOffsetPageInput =
|
|
8
|
+
| URLSearchParams
|
|
9
|
+
| {
|
|
10
|
+
readonly Limit?: unknown
|
|
11
|
+
readonly Offset?: unknown
|
|
12
|
+
readonly limit?: unknown
|
|
13
|
+
readonly offset?: unknown
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function queryOffsetPage<TItem>(
|
|
17
|
+
items: readonly TItem[],
|
|
18
|
+
query: QueryOffsetPageInput,
|
|
19
|
+
): QueryOffsetPageResult<TItem> {
|
|
20
|
+
const limit = readQueryInteger(query, 'limit', 'Limit', 10)
|
|
21
|
+
const offset = readQueryInteger(query, 'offset', 'Offset', 0)
|
|
22
|
+
return {
|
|
23
|
+
Items: items.slice(offset, offset + limit),
|
|
24
|
+
Limit: limit,
|
|
25
|
+
Offset: offset,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function readQueryInteger(
|
|
30
|
+
query: QueryOffsetPageInput,
|
|
31
|
+
lowerName: 'limit' | 'offset',
|
|
32
|
+
upperName: 'Limit' | 'Offset',
|
|
33
|
+
fallback: number,
|
|
34
|
+
) {
|
|
35
|
+
if (query instanceof URLSearchParams) {
|
|
36
|
+
return readInteger(query.get(lowerName) ?? query.get(upperName), fallback)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return readInteger(query[lowerName] ?? query[upperName], fallback)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function readInteger(value: unknown, fallback: number) {
|
|
43
|
+
if (value === null || value === undefined || value === '') {
|
|
44
|
+
return fallback
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const text = Array.isArray(value) ? value[0] : value
|
|
48
|
+
const parsed = Number.parseInt(String(text), 10)
|
|
49
|
+
return Number.isFinite(parsed) ? parsed : fallback
|
|
50
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DataSourceQueryDefinition,
|
|
3
|
+
InputFormDefinition,
|
|
4
|
+
QueryFormDefinition,
|
|
5
|
+
ViewDefinition,
|
|
6
|
+
} from './module'
|
|
7
|
+
import type { PresentationDataSourceResolver } from './presentation-data-source-runtime'
|
|
8
|
+
import { resolvePresentationViewDataSourceIds } from './presentation-data-source-runtime'
|
|
9
|
+
import type { ProjectedInputFormTargetContext } from './projected-input-form-runtime'
|
|
10
|
+
|
|
11
|
+
export function createRelationQueryInputFormTarget({
|
|
12
|
+
dataSourceResolver,
|
|
13
|
+
inputForm,
|
|
14
|
+
queryForm,
|
|
15
|
+
view,
|
|
16
|
+
}: {
|
|
17
|
+
readonly dataSourceResolver: PresentationDataSourceResolver
|
|
18
|
+
readonly inputForm: InputFormDefinition
|
|
19
|
+
readonly queryForm: QueryFormDefinition
|
|
20
|
+
readonly view: ViewDefinition
|
|
21
|
+
}): ProjectedInputFormTargetContext {
|
|
22
|
+
return {
|
|
23
|
+
queryDefinition: resolveProjectedQueryDefinition({
|
|
24
|
+
dataSourceResolver,
|
|
25
|
+
inputForm,
|
|
26
|
+
queryForm,
|
|
27
|
+
view,
|
|
28
|
+
}),
|
|
29
|
+
queryForm,
|
|
30
|
+
stateId: inputForm.SharedStateId ?? queryForm.Target.State.StateId,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function resolveProjectedQueryDefinition({
|
|
35
|
+
dataSourceResolver,
|
|
36
|
+
inputForm,
|
|
37
|
+
queryForm,
|
|
38
|
+
view,
|
|
39
|
+
}: {
|
|
40
|
+
readonly dataSourceResolver: PresentationDataSourceResolver
|
|
41
|
+
readonly inputForm: InputFormDefinition
|
|
42
|
+
readonly queryForm: QueryFormDefinition
|
|
43
|
+
readonly view: ViewDefinition
|
|
44
|
+
}): DataSourceQueryDefinition | null {
|
|
45
|
+
const candidateDataSourceIds = [
|
|
46
|
+
inputForm.StateDataSourceId,
|
|
47
|
+
queryForm.Target.State.DraftDataSourceId,
|
|
48
|
+
queryForm.Target.Result.DataSourceId,
|
|
49
|
+
queryForm.Target.State.ResultDataSourceId,
|
|
50
|
+
...resolvePresentationViewDataSourceIds(view),
|
|
51
|
+
].filter((dataSourceId): dataSourceId is string => Boolean(dataSourceId))
|
|
52
|
+
|
|
53
|
+
for (const dataSourceId of Array.from(new Set(candidateDataSourceIds))) {
|
|
54
|
+
const query = dataSourceResolver.resolve(dataSourceId)?.definition?.Query
|
|
55
|
+
if (query) {
|
|
56
|
+
return query
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return null
|
|
61
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request-selected authorization scope for API calls made by a presentation host.
|
|
3
|
+
*/
|
|
4
|
+
export type PresentationScopeRequestSelection =
|
|
5
|
+
| { readonly mode: 'default' }
|
|
6
|
+
| { readonly mode: 'single'; readonly scopeId: string | null }
|
|
7
|
+
| { readonly mode: 'multiple'; readonly scopeIds: readonly string[] }
|
|
8
|
+
| { readonly mode: 'all' }
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Scope visible to an authenticated principal.
|
|
12
|
+
*/
|
|
13
|
+
export interface PresentationScopeAccess<TMetadata = unknown> {
|
|
14
|
+
/** Stable scope id. */
|
|
15
|
+
readonly id: string
|
|
16
|
+
|
|
17
|
+
/** Human-facing scope label. */
|
|
18
|
+
readonly label: string
|
|
19
|
+
|
|
20
|
+
/** Optional semantic scope kind, for example tenant, workspace, or organization. */
|
|
21
|
+
readonly kind?: string | null
|
|
22
|
+
|
|
23
|
+
/** Capability ids granted inside this scope. */
|
|
24
|
+
readonly capabilities?: readonly string[]
|
|
25
|
+
|
|
26
|
+
/** Whether this scope is the principal's default scope. */
|
|
27
|
+
readonly isDefault?: boolean
|
|
28
|
+
|
|
29
|
+
/** Host-specific source object for adapters that need to preserve more detail. */
|
|
30
|
+
readonly metadata?: TMetadata
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Header names and formatting used to project selected scopes into API requests.
|
|
35
|
+
*/
|
|
36
|
+
export interface PresentationScopeRequestHeaderOptions {
|
|
37
|
+
/** Header carrying one selected scope id. */
|
|
38
|
+
readonly singleScopeHeaderName: string
|
|
39
|
+
|
|
40
|
+
/** Header carrying comma-separated selected scope ids. */
|
|
41
|
+
readonly multipleScopesHeaderName: string
|
|
42
|
+
|
|
43
|
+
/** Header carrying the requested selection mode. */
|
|
44
|
+
readonly scopeModeHeaderName: string
|
|
45
|
+
|
|
46
|
+
/** Header value used for multi-scope requests. */
|
|
47
|
+
readonly multipleModeHeaderValue?: string
|
|
48
|
+
|
|
49
|
+
/** Header value used for all-accessible-scope requests. */
|
|
50
|
+
readonly allModeHeaderValue?: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Label options for stable query/cache suffixes.
|
|
55
|
+
*/
|
|
56
|
+
export interface PresentationScopeSelectionQuerySuffixOptions {
|
|
57
|
+
/** Label used for single-scope suffixes. */
|
|
58
|
+
readonly singleScopeLabel?: string
|
|
59
|
+
|
|
60
|
+
/** Label used for multi-scope suffixes. */
|
|
61
|
+
readonly multipleScopesLabel?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Mutable request-scope store used by host HTTP clients.
|
|
66
|
+
*/
|
|
67
|
+
export interface PresentationScopeRequestStore {
|
|
68
|
+
/** Stores the current request-scope selection. */
|
|
69
|
+
readonly setSelection: (selection: PresentationScopeRequestSelection) => void
|
|
70
|
+
|
|
71
|
+
/** Reads the current normalized request-scope selection. */
|
|
72
|
+
readonly getSelection: () => PresentationScopeRequestSelection
|
|
73
|
+
|
|
74
|
+
/** Returns request headers for the current selection. */
|
|
75
|
+
readonly getHeaders: () => Readonly<Record<string, string>> | undefined
|
|
76
|
+
|
|
77
|
+
/** Returns a stable query/cache suffix for a selection. */
|
|
78
|
+
readonly formatQuerySuffix: (selection: PresentationScopeRequestSelection) => string
|
|
79
|
+
|
|
80
|
+
/** Returns a normalized copy of a selection. */
|
|
81
|
+
readonly normalizeSelection: (selection: PresentationScopeRequestSelection) => PresentationScopeRequestSelection
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Creates a host request-scope store that can project selected scopes into headers.
|
|
86
|
+
*/
|
|
87
|
+
export function createPresentationScopeRequestStore({
|
|
88
|
+
headerOptions,
|
|
89
|
+
querySuffixOptions,
|
|
90
|
+
}: {
|
|
91
|
+
readonly headerOptions: PresentationScopeRequestHeaderOptions
|
|
92
|
+
readonly querySuffixOptions?: PresentationScopeSelectionQuerySuffixOptions
|
|
93
|
+
}): PresentationScopeRequestStore {
|
|
94
|
+
let currentSelection: PresentationScopeRequestSelection = { mode: 'default' }
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
setSelection(selection) {
|
|
98
|
+
currentSelection = normalizePresentationScopeRequestSelection(selection)
|
|
99
|
+
},
|
|
100
|
+
getSelection() {
|
|
101
|
+
return currentSelection
|
|
102
|
+
},
|
|
103
|
+
getHeaders() {
|
|
104
|
+
return createPresentationScopeRequestHeaders(currentSelection, headerOptions)
|
|
105
|
+
},
|
|
106
|
+
formatQuerySuffix(selection) {
|
|
107
|
+
return formatPresentationScopeSelectionQuerySuffix(selection, querySuffixOptions)
|
|
108
|
+
},
|
|
109
|
+
normalizeSelection: normalizePresentationScopeRequestSelection,
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Returns a normalized copy of a request-scope selection.
|
|
115
|
+
*/
|
|
116
|
+
export function normalizePresentationScopeRequestSelection(
|
|
117
|
+
selection: PresentationScopeRequestSelection,
|
|
118
|
+
): PresentationScopeRequestSelection {
|
|
119
|
+
switch (selection.mode) {
|
|
120
|
+
case 'single':
|
|
121
|
+
return {
|
|
122
|
+
mode: 'single',
|
|
123
|
+
scopeId: normalizeScopeId(selection.scopeId),
|
|
124
|
+
}
|
|
125
|
+
case 'multiple':
|
|
126
|
+
return {
|
|
127
|
+
mode: 'multiple',
|
|
128
|
+
scopeIds: normalizeScopeIds(selection.scopeIds),
|
|
129
|
+
}
|
|
130
|
+
case 'all':
|
|
131
|
+
case 'default':
|
|
132
|
+
return selection
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Returns request headers for a selection.
|
|
138
|
+
*/
|
|
139
|
+
export function createPresentationScopeRequestHeaders(
|
|
140
|
+
selection: PresentationScopeRequestSelection,
|
|
141
|
+
options: PresentationScopeRequestHeaderOptions,
|
|
142
|
+
): Readonly<Record<string, string>> | undefined {
|
|
143
|
+
const normalized = normalizePresentationScopeRequestSelection(selection)
|
|
144
|
+
switch (normalized.mode) {
|
|
145
|
+
case 'single':
|
|
146
|
+
return normalized.scopeId
|
|
147
|
+
? { [options.singleScopeHeaderName]: normalized.scopeId }
|
|
148
|
+
: undefined
|
|
149
|
+
case 'multiple':
|
|
150
|
+
return normalized.scopeIds.length > 0
|
|
151
|
+
? {
|
|
152
|
+
[options.multipleScopesHeaderName]: normalized.scopeIds.join(','),
|
|
153
|
+
[options.scopeModeHeaderName]: options.multipleModeHeaderValue ?? 'multiple',
|
|
154
|
+
}
|
|
155
|
+
: undefined
|
|
156
|
+
case 'all':
|
|
157
|
+
return { [options.scopeModeHeaderName]: options.allModeHeaderValue ?? 'all' }
|
|
158
|
+
case 'default':
|
|
159
|
+
return undefined
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Returns a stable query/cache suffix for a selection.
|
|
165
|
+
*/
|
|
166
|
+
export function formatPresentationScopeSelectionQuerySuffix(
|
|
167
|
+
selection: PresentationScopeRequestSelection,
|
|
168
|
+
options: PresentationScopeSelectionQuerySuffixOptions = {},
|
|
169
|
+
) {
|
|
170
|
+
const singleScopeLabel = options.singleScopeLabel ?? 'scope'
|
|
171
|
+
const multipleScopesLabel = options.multipleScopesLabel ?? 'scopes'
|
|
172
|
+
const normalized = normalizePresentationScopeRequestSelection(selection)
|
|
173
|
+
switch (normalized.mode) {
|
|
174
|
+
case 'single':
|
|
175
|
+
return `${singleScopeLabel}:${normalized.scopeId ?? 'default'}`
|
|
176
|
+
case 'multiple':
|
|
177
|
+
return `${multipleScopesLabel}:${normalized.scopeIds.join(',') || 'none'}`
|
|
178
|
+
case 'all':
|
|
179
|
+
return `${multipleScopesLabel}:all`
|
|
180
|
+
case 'default':
|
|
181
|
+
return `${singleScopeLabel}:default`
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Returns normalized unique scope ids in stable order.
|
|
187
|
+
*/
|
|
188
|
+
export function normalizeScopeIds(scopeIds: readonly string[]) {
|
|
189
|
+
return Array.from(
|
|
190
|
+
new Set(
|
|
191
|
+
scopeIds
|
|
192
|
+
.map(normalizeScopeId)
|
|
193
|
+
.filter((scopeId): scopeId is string => scopeId !== null),
|
|
194
|
+
),
|
|
195
|
+
).sort((left, right) => left.localeCompare(right))
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function normalizeScopeId(scopeId: string | null | undefined) {
|
|
199
|
+
const trimmed = scopeId?.trim()
|
|
200
|
+
return trimmed && trimmed.length > 0 ? trimmed : null
|
|
201
|
+
}
|