@flanksource/clicky-ui 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comments/CommentAuthor.cjs +58 -0
- package/dist/comments/CommentAuthor.cjs.map +1 -0
- package/dist/comments/CommentAuthor.d.ts +17 -0
- package/dist/comments/CommentAuthor.d.ts.map +1 -0
- package/dist/comments/CommentAuthor.js +58 -0
- package/dist/comments/CommentAuthor.js.map +1 -0
- package/dist/comments/CommentCard.cjs +343 -0
- package/dist/comments/CommentCard.cjs.map +1 -0
- package/dist/comments/CommentCard.d.ts +27 -0
- package/dist/comments/CommentCard.d.ts.map +1 -0
- package/dist/comments/CommentCard.js +343 -0
- package/dist/comments/CommentCard.js.map +1 -0
- package/dist/comments/CommentComposer.cjs +207 -0
- package/dist/comments/CommentComposer.cjs.map +1 -0
- package/dist/comments/CommentComposer.d.ts +23 -0
- package/dist/comments/CommentComposer.d.ts.map +1 -0
- package/dist/comments/CommentComposer.js +207 -0
- package/dist/comments/CommentComposer.js.map +1 -0
- package/dist/comments/CommentFilterBar.cjs +145 -0
- package/dist/comments/CommentFilterBar.cjs.map +1 -0
- package/dist/comments/CommentFilterBar.d.ts +15 -0
- package/dist/comments/CommentFilterBar.d.ts.map +1 -0
- package/dist/comments/CommentFilterBar.js +145 -0
- package/dist/comments/CommentFilterBar.js.map +1 -0
- package/dist/comments/CommentMarkdown.cjs +156 -0
- package/dist/comments/CommentMarkdown.cjs.map +1 -0
- package/dist/comments/CommentMarkdown.d.ts +13 -0
- package/dist/comments/CommentMarkdown.d.ts.map +1 -0
- package/dist/comments/CommentMarkdown.js +156 -0
- package/dist/comments/CommentMarkdown.js.map +1 -0
- package/dist/comments/CommentProgress.cjs +86 -0
- package/dist/comments/CommentProgress.cjs.map +1 -0
- package/dist/comments/CommentProgress.d.ts +16 -0
- package/dist/comments/CommentProgress.d.ts.map +1 -0
- package/dist/comments/CommentProgress.js +86 -0
- package/dist/comments/CommentProgress.js.map +1 -0
- package/dist/comments/CommentProvider.cjs +99 -0
- package/dist/comments/CommentProvider.cjs.map +1 -0
- package/dist/comments/CommentProvider.d.ts +19 -0
- package/dist/comments/CommentProvider.d.ts.map +1 -0
- package/dist/comments/CommentProvider.js +99 -0
- package/dist/comments/CommentProvider.js.map +1 -0
- package/dist/comments/CommentSidePanel.cjs +219 -0
- package/dist/comments/CommentSidePanel.cjs.map +1 -0
- package/dist/comments/CommentSidePanel.d.ts +16 -0
- package/dist/comments/CommentSidePanel.d.ts.map +1 -0
- package/dist/comments/CommentSidePanel.js +219 -0
- package/dist/comments/CommentSidePanel.js.map +1 -0
- package/dist/comments/CommentThread.cjs +57 -0
- package/dist/comments/CommentThread.cjs.map +1 -0
- package/dist/comments/CommentThread.d.ts +24 -0
- package/dist/comments/CommentThread.d.ts.map +1 -0
- package/dist/comments/CommentThread.js +57 -0
- package/dist/comments/CommentThread.js.map +1 -0
- package/dist/comments/CommentThreadList.cjs +124 -0
- package/dist/comments/CommentThreadList.cjs.map +1 -0
- package/dist/comments/CommentThreadList.d.ts +25 -0
- package/dist/comments/CommentThreadList.d.ts.map +1 -0
- package/dist/comments/CommentThreadList.js +124 -0
- package/dist/comments/CommentThreadList.js.map +1 -0
- package/dist/comments/GroupedComments.cjs +74 -0
- package/dist/comments/GroupedComments.cjs.map +1 -0
- package/dist/comments/GroupedComments.d.ts +18 -0
- package/dist/comments/GroupedComments.d.ts.map +1 -0
- package/dist/comments/GroupedComments.js +74 -0
- package/dist/comments/GroupedComments.js.map +1 -0
- package/dist/comments/MentionTextarea.cjs +253 -0
- package/dist/comments/MentionTextarea.cjs.map +1 -0
- package/dist/comments/MentionTextarea.d.ts +28 -0
- package/dist/comments/MentionTextarea.d.ts.map +1 -0
- package/dist/comments/MentionTextarea.js +253 -0
- package/dist/comments/MentionTextarea.js.map +1 -0
- package/dist/comments/comment-context.cjs +33 -0
- package/dist/comments/comment-context.cjs.map +1 -0
- package/dist/comments/comment-context.d.ts +32 -0
- package/dist/comments/comment-context.d.ts.map +1 -0
- package/dist/comments/comment-context.js +33 -0
- package/dist/comments/comment-context.js.map +1 -0
- package/dist/comments/comment-fixtures.d.ts +11 -0
- package/dist/comments/comment-fixtures.d.ts.map +1 -0
- package/dist/comments/comment-types.cjs +19 -0
- package/dist/comments/comment-types.cjs.map +1 -0
- package/dist/comments/comment-types.d.ts +170 -0
- package/dist/comments/comment-types.d.ts.map +1 -0
- package/dist/comments/comment-types.js +19 -0
- package/dist/comments/comment-types.js.map +1 -0
- package/dist/comments/comment-utils.cjs +216 -0
- package/dist/comments/comment-utils.cjs.map +1 -0
- package/dist/comments/comment-utils.d.ts +59 -0
- package/dist/comments/comment-utils.d.ts.map +1 -0
- package/dist/comments/comment-utils.js +216 -0
- package/dist/comments/comment-utils.js.map +1 -0
- package/dist/comments.cjs +57 -0
- package/dist/comments.cjs.map +1 -0
- package/dist/comments.d.ts +16 -0
- package/dist/comments.d.ts.map +1 -0
- package/dist/comments.js +57 -0
- package/dist/comments.js.map +1 -0
- package/dist/components/FilterBar.cjs +13 -3
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.js +13 -3
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/JsonSchemaForm.cjs +20 -6
- package/dist/components/JsonSchemaForm.cjs.map +1 -1
- package/dist/components/JsonSchemaForm.d.ts +1 -1
- package/dist/components/JsonSchemaForm.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm.js +22 -8
- package/dist/components/JsonSchemaForm.js.map +1 -1
- package/dist/components/NamespacePicker.cjs +52 -0
- package/dist/components/NamespacePicker.cjs.map +1 -0
- package/dist/components/NamespacePicker.d.ts +17 -0
- package/dist/components/NamespacePicker.d.ts.map +1 -0
- package/dist/components/NamespacePicker.js +52 -0
- package/dist/components/NamespacePicker.js.map +1 -0
- package/dist/components/form-lookup-context.cjs +36 -0
- package/dist/components/form-lookup-context.cjs.map +1 -0
- package/dist/components/form-lookup-context.d.ts +9 -0
- package/dist/components/form-lookup-context.d.ts.map +1 -0
- package/dist/components/form-lookup-context.js +36 -0
- package/dist/components/form-lookup-context.js.map +1 -0
- package/dist/components/json-schema-form-discriminator.cjs +67 -0
- package/dist/components/json-schema-form-discriminator.cjs.map +1 -0
- package/dist/components/json-schema-form-discriminator.d.ts +10 -0
- package/dist/components/json-schema-form-discriminator.d.ts.map +1 -0
- package/dist/components/json-schema-form-discriminator.js +67 -0
- package/dist/components/json-schema-form-discriminator.js.map +1 -0
- package/dist/components/json-schema-form-fields.cjs +66 -1
- package/dist/components/json-schema-form-fields.cjs.map +1 -1
- package/dist/components/json-schema-form-fields.d.ts +7 -0
- package/dist/components/json-schema-form-fields.d.ts.map +1 -1
- package/dist/components/json-schema-form-fields.js +66 -1
- package/dist/components/json-schema-form-fields.js.map +1 -1
- package/dist/components/json-schema-form-grid.cjs +92 -0
- package/dist/components/json-schema-form-grid.cjs.map +1 -0
- package/dist/components/json-schema-form-grid.d.ts +9 -0
- package/dist/components/json-schema-form-grid.d.ts.map +1 -0
- package/dist/components/json-schema-form-grid.js +92 -0
- package/dist/components/json-schema-form-grid.js.map +1 -0
- package/dist/components/json-schema-form-render.cjs +20 -3
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +22 -5
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +24 -2
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +24 -2
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-types.d.ts +37 -2
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.cjs +8 -0
- package/dist/components/json-schema-form-utils.cjs.map +1 -1
- package/dist/components/json-schema-form-utils.d.ts +1 -0
- package/dist/components/json-schema-form-utils.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.js +8 -0
- package/dist/components/json-schema-form-utils.js.map +1 -1
- package/dist/components/workload-picker-utils.cjs.map +1 -1
- package/dist/components/workload-picker-utils.d.ts +11 -1
- package/dist/components/workload-picker-utils.d.ts.map +1 -1
- package/dist/components/workload-picker-utils.js.map +1 -1
- package/dist/components.cjs +6 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +4 -2
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +6 -0
- package/dist/components.js.map +1 -1
- package/dist/data/Clicky.cjs +225 -60
- package/dist/data/Clicky.cjs.map +1 -1
- package/dist/data/Clicky.d.ts +7 -1
- package/dist/data/Clicky.d.ts.map +1 -1
- package/dist/data/Clicky.fixtures.d.ts +3 -1
- package/dist/data/Clicky.fixtures.d.ts.map +1 -1
- package/dist/data/Clicky.js +226 -61
- package/dist/data/Clicky.js.map +1 -1
- package/dist/data/ExecutionTree.cjs +68 -0
- package/dist/data/ExecutionTree.cjs.map +1 -0
- package/dist/data/ExecutionTree.d.ts +40 -0
- package/dist/data/ExecutionTree.d.ts.map +1 -0
- package/dist/data/ExecutionTree.js +68 -0
- package/dist/data/ExecutionTree.js.map +1 -0
- package/dist/data/GaugeHoverCard.cjs +35 -0
- package/dist/data/GaugeHoverCard.cjs.map +1 -0
- package/dist/data/GaugeHoverCard.d.ts +25 -0
- package/dist/data/GaugeHoverCard.d.ts.map +1 -0
- package/dist/data/GaugeHoverCard.js +35 -0
- package/dist/data/GaugeHoverCard.js.map +1 -0
- package/dist/data/MarkdownEditor.cjs +616 -0
- package/dist/data/MarkdownEditor.cjs.map +1 -0
- package/dist/data/MarkdownEditor.d.ts +61 -0
- package/dist/data/MarkdownEditor.d.ts.map +1 -0
- package/dist/data/MarkdownEditor.js +616 -0
- package/dist/data/MarkdownEditor.js.map +1 -0
- package/dist/data/MarkdownEditor.model.cjs +27 -0
- package/dist/data/MarkdownEditor.model.cjs.map +1 -0
- package/dist/data/MarkdownEditor.model.d.ts +38 -0
- package/dist/data/MarkdownEditor.model.d.ts.map +1 -0
- package/dist/data/MarkdownEditor.model.js +27 -0
- package/dist/data/MarkdownEditor.model.js.map +1 -0
- package/dist/data/ObjectGraph.cjs +44 -0
- package/dist/data/ObjectGraph.cjs.map +1 -0
- package/dist/data/ObjectGraph.d.ts +39 -0
- package/dist/data/ObjectGraph.d.ts.map +1 -0
- package/dist/data/ObjectGraph.js +44 -0
- package/dist/data/ObjectGraph.js.map +1 -0
- package/dist/data/SchemaViewer.cjs +152 -0
- package/dist/data/SchemaViewer.cjs.map +1 -0
- package/dist/data/SchemaViewer.d.ts +27 -0
- package/dist/data/SchemaViewer.d.ts.map +1 -0
- package/dist/data/SchemaViewer.js +152 -0
- package/dist/data/SchemaViewer.js.map +1 -0
- package/dist/data/TimeseriesCoreBars.cjs +51 -12
- package/dist/data/TimeseriesCoreBars.cjs.map +1 -1
- package/dist/data/TimeseriesCoreBars.d.ts +32 -5
- package/dist/data/TimeseriesCoreBars.d.ts.map +1 -1
- package/dist/data/TimeseriesCoreBars.js +51 -12
- package/dist/data/TimeseriesCoreBars.js.map +1 -1
- package/dist/data/TimeseriesCoreBars.model.cjs +5 -5
- package/dist/data/TimeseriesCoreBars.model.cjs.map +1 -1
- package/dist/data/TimeseriesCoreBars.model.d.ts +4 -4
- package/dist/data/TimeseriesCoreBars.model.d.ts.map +1 -1
- package/dist/data/TimeseriesCoreBars.model.js +5 -5
- package/dist/data/TimeseriesCoreBars.model.js.map +1 -1
- package/dist/data/TimeseriesGauge.cjs +103 -65
- package/dist/data/TimeseriesGauge.cjs.map +1 -1
- package/dist/data/TimeseriesGauge.d.ts +10 -1
- package/dist/data/TimeseriesGauge.d.ts.map +1 -1
- package/dist/data/TimeseriesGauge.js +104 -66
- package/dist/data/TimeseriesGauge.js.map +1 -1
- package/dist/data/WorkloadCard.cjs +4 -4
- package/dist/data/WorkloadCard.cjs.map +1 -1
- package/dist/data/WorkloadCard.d.ts +3 -2
- package/dist/data/WorkloadCard.d.ts.map +1 -1
- package/dist/data/WorkloadCard.js +4 -4
- package/dist/data/WorkloadCard.js.map +1 -1
- package/dist/data/ai/ChatWindow.cjs +11 -19
- package/dist/data/ai/ChatWindow.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.d.ts +1 -7
- package/dist/data/ai/ChatWindow.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.js +11 -19
- package/dist/data/ai/ChatWindow.js.map +1 -1
- package/dist/data/ai/ChatWindowRequestBody.cjs +20 -0
- package/dist/data/ai/ChatWindowRequestBody.cjs.map +1 -0
- package/dist/data/ai/ChatWindowRequestBody.d.ts +9 -0
- package/dist/data/ai/ChatWindowRequestBody.d.ts.map +1 -0
- package/dist/data/ai/ChatWindowRequestBody.js +20 -0
- package/dist/data/ai/ChatWindowRequestBody.js.map +1 -0
- package/dist/data/chat/Chat.cjs +12 -0
- package/dist/data/chat/Chat.cjs.map +1 -1
- package/dist/data/chat/Chat.d.ts +8 -1
- package/dist/data/chat/Chat.d.ts.map +1 -1
- package/dist/data/chat/Chat.js +12 -0
- package/dist/data/chat/Chat.js.map +1 -1
- package/dist/data/gauge-stats.cjs +19 -0
- package/dist/data/gauge-stats.cjs.map +1 -0
- package/dist/data/gauge-stats.d.ts +15 -0
- package/dist/data/gauge-stats.d.ts.map +1 -0
- package/dist/data/gauge-stats.js +19 -0
- package/dist/data/gauge-stats.js.map +1 -0
- package/dist/data/schema-viewer-model.cjs +436 -0
- package/dist/data/schema-viewer-model.cjs.map +1 -0
- package/dist/data/schema-viewer-model.d.ts +64 -0
- package/dist/data/schema-viewer-model.d.ts.map +1 -0
- package/dist/data/schema-viewer-model.js +436 -0
- package/dist/data/schema-viewer-model.js.map +1 -0
- package/dist/data/version-info.cjs +2 -2
- package/dist/data/version-info.js +2 -2
- package/dist/data.cjs +23 -0
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +11 -3
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +23 -0
- package/dist/data.js.map +1 -1
- package/dist/index.cjs +87 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +87 -2
- package/dist/index.js.map +1 -1
- package/dist/rpc/EntityExplorerApp.cjs +102 -143
- package/dist/rpc/EntityExplorerApp.cjs.map +1 -1
- package/dist/rpc/EntityExplorerApp.d.ts +34 -1
- package/dist/rpc/EntityExplorerApp.d.ts.map +1 -1
- package/dist/rpc/EntityExplorerApp.js +105 -146
- package/dist/rpc/EntityExplorerApp.js.map +1 -1
- package/dist/rpc/OperationActionBar.cjs +135 -0
- package/dist/rpc/OperationActionBar.cjs.map +1 -0
- package/dist/rpc/OperationActionBar.d.ts +20 -0
- package/dist/rpc/OperationActionBar.d.ts.map +1 -0
- package/dist/rpc/OperationActionBar.js +135 -0
- package/dist/rpc/OperationActionBar.js.map +1 -0
- package/dist/rpc/OperationCatalog.cjs +79 -116
- package/dist/rpc/OperationCatalog.cjs.map +1 -1
- package/dist/rpc/OperationCatalog.d.ts +8 -1
- package/dist/rpc/OperationCatalog.d.ts.map +1 -1
- package/dist/rpc/OperationCatalog.js +80 -117
- package/dist/rpc/OperationCatalog.js.map +1 -1
- package/dist/rpc/OperationCommandPage.cjs +134 -223
- package/dist/rpc/OperationCommandPage.cjs.map +1 -1
- package/dist/rpc/OperationCommandPage.d.ts +1 -1
- package/dist/rpc/OperationCommandPage.d.ts.map +1 -1
- package/dist/rpc/OperationCommandPage.js +135 -224
- package/dist/rpc/OperationCommandPage.js.map +1 -1
- package/dist/rpc/OperationEntityPage.cjs +49 -100
- package/dist/rpc/OperationEntityPage.cjs.map +1 -1
- package/dist/rpc/OperationEntityPage.d.ts +6 -1
- package/dist/rpc/OperationEntityPage.d.ts.map +1 -1
- package/dist/rpc/OperationEntityPage.js +50 -101
- package/dist/rpc/OperationEntityPage.js.map +1 -1
- package/dist/rpc/OperationResultView.cjs +43 -0
- package/dist/rpc/OperationResultView.cjs.map +1 -0
- package/dist/rpc/OperationResultView.d.ts +30 -0
- package/dist/rpc/OperationResultView.d.ts.map +1 -0
- package/dist/rpc/OperationResultView.js +43 -0
- package/dist/rpc/OperationResultView.js.map +1 -0
- package/dist/rpc/SchemaActionForm.cjs +102 -0
- package/dist/rpc/SchemaActionForm.cjs.map +1 -0
- package/dist/rpc/SchemaActionForm.d.ts +23 -0
- package/dist/rpc/SchemaActionForm.d.ts.map +1 -0
- package/dist/rpc/SchemaActionForm.js +102 -0
- package/dist/rpc/SchemaActionForm.js.map +1 -0
- package/dist/rpc/accept-options.cjs.map +1 -1
- package/dist/rpc/accept-options.d.ts +0 -1
- package/dist/rpc/accept-options.d.ts.map +1 -1
- package/dist/rpc/accept-options.js.map +1 -1
- package/dist/rpc/apiClient.cjs +34 -2
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.d.ts +4 -1
- package/dist/rpc/apiClient.d.ts.map +1 -1
- package/dist/rpc/apiClient.js +34 -2
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/rpc/clickyMetadata.cjs +4 -4
- package/dist/rpc/clickyMetadata.cjs.map +1 -1
- package/dist/rpc/clickyMetadata.d.ts +0 -1
- package/dist/rpc/clickyMetadata.d.ts.map +1 -1
- package/dist/rpc/clickyMetadata.js +4 -4
- package/dist/rpc/clickyMetadata.js.map +1 -1
- package/dist/rpc/formMetadata.cjs +1 -0
- package/dist/rpc/formMetadata.cjs.map +1 -1
- package/dist/rpc/formMetadata.d.ts +6 -1
- package/dist/rpc/formMetadata.d.ts.map +1 -1
- package/dist/rpc/formMetadata.js +1 -0
- package/dist/rpc/formMetadata.js.map +1 -1
- package/dist/rpc/rowNavigation.cjs +86 -0
- package/dist/rpc/rowNavigation.cjs.map +1 -0
- package/dist/rpc/rowNavigation.d.ts +14 -0
- package/dist/rpc/rowNavigation.d.ts.map +1 -0
- package/dist/rpc/rowNavigation.js +86 -0
- package/dist/rpc/rowNavigation.js.map +1 -0
- package/dist/rpc/schemaActionPath.cjs +22 -0
- package/dist/rpc/schemaActionPath.cjs.map +1 -0
- package/dist/rpc/schemaActionPath.d.ts +4 -0
- package/dist/rpc/schemaActionPath.d.ts.map +1 -0
- package/dist/rpc/schemaActionPath.js +22 -0
- package/dist/rpc/schemaActionPath.js.map +1 -0
- package/dist/rpc/surfaceIconMap.cjs +35 -0
- package/dist/rpc/surfaceIconMap.cjs.map +1 -0
- package/dist/rpc/surfaceIconMap.d.ts +3 -0
- package/dist/rpc/surfaceIconMap.d.ts.map +1 -0
- package/dist/rpc/surfaceIconMap.js +35 -0
- package/dist/rpc/surfaceIconMap.js.map +1 -0
- package/dist/rpc/types.cjs.map +1 -1
- package/dist/rpc/types.d.ts +2 -0
- package/dist/rpc/types.d.ts.map +1 -1
- package/dist/rpc/types.js.map +1 -1
- package/dist/rpc/useOperations.cjs.map +1 -1
- package/dist/rpc/useOperations.d.ts +4 -1
- package/dist/rpc/useOperations.d.ts.map +1 -1
- package/dist/rpc/useOperations.js.map +1 -1
- package/dist/rpc.cjs +4 -2
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.ts +7 -6
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +4 -2
- package/dist/rpc.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -1
- package/dist/rpc/AcceptPicker.cjs +0 -137
- package/dist/rpc/AcceptPicker.cjs.map +0 -1
- package/dist/rpc/AcceptPicker.d.ts +0 -12
- package/dist/rpc/AcceptPicker.d.ts.map +0 -1
- package/dist/rpc/AcceptPicker.js +0 -137
- package/dist/rpc/AcceptPicker.js.map +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo, useEffect, useRef
|
|
2
|
+
import { useState, useMemo, useEffect, useRef } from "react";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
import { FilterBar } from "../components/FilterBar.js";
|
|
5
4
|
import { MethodBadge } from "../data/MethodBadge.js";
|
|
6
|
-
import { AcceptPicker } from "./AcceptPicker.js";
|
|
7
5
|
import { CommandForm } from "./CommandForm.js";
|
|
8
|
-
import {
|
|
9
|
-
import { CommandOutput } from "./CommandOutput.js";
|
|
6
|
+
import { submitValue, pathParamNames } from "./command-form-utils.js";
|
|
10
7
|
import { buildInitialParameterValues, useDebouncedRecord, packParameterValues, parametersToFormConfig, dataTablePaginationFromForm, pruneParameterValues, titleCase } from "./formMetadata.js";
|
|
11
8
|
import { InlineError } from "./InlineError.js";
|
|
12
9
|
import { OperationActionDialog } from "./OperationActionDialog.js";
|
|
13
|
-
import {
|
|
10
|
+
import { OperationResultView } from "./OperationResultView.js";
|
|
11
|
+
import { hrefForOperation } from "./rowNavigation.js";
|
|
14
12
|
import { useOperationById } from "./useOperations.js";
|
|
13
|
+
const RESULT_ACCEPT = "application/clicky+json";
|
|
15
14
|
const EMPTY_PARAMETER_VALUES = {};
|
|
16
15
|
function OperationCommandPage({
|
|
17
16
|
client,
|
|
@@ -24,18 +23,19 @@ function OperationCommandPage({
|
|
|
24
23
|
backLabel = "Back",
|
|
25
24
|
renderLink,
|
|
26
25
|
onNavigate,
|
|
26
|
+
commandRuntime,
|
|
27
27
|
hideLockedPathFilters = Boolean(providedOperation),
|
|
28
28
|
className
|
|
29
29
|
}) {
|
|
30
|
-
const lookup = useOperationById(
|
|
30
|
+
const lookup = useOperationById(
|
|
31
|
+
client,
|
|
32
|
+
providedOperation ? void 0 : operationId
|
|
33
|
+
);
|
|
31
34
|
const operation = providedOperation ?? lookup.operation;
|
|
32
35
|
const isLoading = providedOperation ? false : lookup.isLoading;
|
|
33
|
-
const [accept, setAccept] = useState("application/clicky+json");
|
|
34
|
-
const [previewMode, setPreviewMode] = useState("hidden");
|
|
35
36
|
const [isExecuting, setIsExecuting] = useState(false);
|
|
36
37
|
const [result, setResult] = useState(null);
|
|
37
38
|
const [error, setError] = useState(null);
|
|
38
|
-
const [submitError, setSubmitError] = useState("");
|
|
39
39
|
const [hasAutoRun, setHasAutoRun] = useState(false);
|
|
40
40
|
const parameters = (operation == null ? void 0 : operation.operation.parameters) ?? [];
|
|
41
41
|
const isGet = ((operation == null ? void 0 : operation.method) ?? "").toUpperCase() === "GET";
|
|
@@ -57,7 +57,10 @@ function OperationCommandPage({
|
|
|
57
57
|
parameters,
|
|
58
58
|
operation.method,
|
|
59
59
|
{},
|
|
60
|
-
|
|
60
|
+
{
|
|
61
|
+
...readQueryParameterValuesFromUrl(parameters),
|
|
62
|
+
...stripRunnerParams(initialValues)
|
|
63
|
+
}
|
|
61
64
|
) : stripRunnerParams(initialValues),
|
|
62
65
|
[initialValues, operation == null ? void 0 : operation.method, parameterSignature]
|
|
63
66
|
);
|
|
@@ -83,11 +86,19 @@ function OperationCommandPage({
|
|
|
83
86
|
const [values, setValues] = useState(effectiveInitialValues);
|
|
84
87
|
useEffect(() => {
|
|
85
88
|
setValues(effectiveInitialValues);
|
|
86
|
-
setSubmitError("");
|
|
87
89
|
}, [effectiveInitialValues]);
|
|
88
90
|
const debouncedValues = useDebouncedRecord(values, 250);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (!isGet || !operation) return;
|
|
93
|
+
writeQueryParameterValuesToUrl(debouncedValues, parameters);
|
|
94
|
+
}, [isGet, operationKey, debouncedValues, parameterSignature]);
|
|
89
95
|
const lookupQuery = useQuery({
|
|
90
|
-
queryKey: [
|
|
96
|
+
queryKey: [
|
|
97
|
+
"operation-query-lookup",
|
|
98
|
+
operation == null ? void 0 : operation.method,
|
|
99
|
+
operation == null ? void 0 : operation.path,
|
|
100
|
+
debouncedValues
|
|
101
|
+
],
|
|
91
102
|
queryFn: async () => {
|
|
92
103
|
var _a;
|
|
93
104
|
if (!operation) return { filters: {} };
|
|
@@ -110,30 +121,19 @@ function OperationCommandPage({
|
|
|
110
121
|
lockedValues: lockedPathValues,
|
|
111
122
|
hideLocked: hideLockedPathFilters
|
|
112
123
|
});
|
|
113
|
-
}, [
|
|
124
|
+
}, [
|
|
125
|
+
isGet,
|
|
126
|
+
parameters,
|
|
127
|
+
values,
|
|
128
|
+
lookupQuery.data,
|
|
129
|
+
lockedPathValues,
|
|
130
|
+
hideLockedPathFilters
|
|
131
|
+
]);
|
|
114
132
|
const dataTablePagination = useMemo(
|
|
115
133
|
() => dataTablePaginationFromForm(formConfig.pagination, result),
|
|
116
134
|
[formConfig.pagination, result]
|
|
117
135
|
);
|
|
118
136
|
const lastSubmittedSignature = useRef("");
|
|
119
|
-
function handleManualSubmit() {
|
|
120
|
-
if (!operation) return;
|
|
121
|
-
const merged = { ...values, ...lockedPathValues };
|
|
122
|
-
const missingRequired = parameters.filter((param) => {
|
|
123
|
-
if (!param.required) return false;
|
|
124
|
-
return (merged[param.name] ?? "").trim() === "";
|
|
125
|
-
});
|
|
126
|
-
if (missingRequired.length > 0) {
|
|
127
|
-
setSubmitError(
|
|
128
|
-
`Missing required fields: ${missingRequired.map((param) => titleCase(param.name)).join(", ")}`
|
|
129
|
-
);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
setSubmitError("");
|
|
133
|
-
setHasAutoRun(true);
|
|
134
|
-
lastSubmittedSignature.current = JSON.stringify(pruneParameterValues(merged));
|
|
135
|
-
void executeOperation(merged);
|
|
136
|
-
}
|
|
137
137
|
async function executeOperation(values2) {
|
|
138
138
|
if (!operation) return;
|
|
139
139
|
setIsExecuting(true);
|
|
@@ -143,7 +143,7 @@ function OperationCommandPage({
|
|
|
143
143
|
operation.path,
|
|
144
144
|
operation.method,
|
|
145
145
|
packParameterValues(values2, operation.operation.parameters ?? []),
|
|
146
|
-
{ Accept:
|
|
146
|
+
{ Accept: RESULT_ACCEPT }
|
|
147
147
|
);
|
|
148
148
|
setResult(response);
|
|
149
149
|
} catch (err) {
|
|
@@ -167,10 +167,11 @@ function OperationCommandPage({
|
|
|
167
167
|
});
|
|
168
168
|
if (missingRequired.length > 0) return;
|
|
169
169
|
setHasAutoRun(true);
|
|
170
|
-
lastSubmittedSignature.current = JSON.stringify(
|
|
170
|
+
lastSubmittedSignature.current = JSON.stringify(
|
|
171
|
+
pruneParameterValues(effectiveInitialValues)
|
|
172
|
+
);
|
|
171
173
|
void executeOperation(effectiveInitialValues);
|
|
172
174
|
}, [
|
|
173
|
-
accept,
|
|
174
175
|
effectiveAutoRun,
|
|
175
176
|
effectiveInitialValues,
|
|
176
177
|
hasAutoRun,
|
|
@@ -189,28 +190,25 @@ function OperationCommandPage({
|
|
|
189
190
|
if (lastSubmittedSignature.current === signature) return;
|
|
190
191
|
lastSubmittedSignature.current = signature;
|
|
191
192
|
void executeOperation(merged);
|
|
192
|
-
}, [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
[detailOperation]
|
|
201
|
-
);
|
|
202
|
-
const handleTableRowClick = useCallback(
|
|
203
|
-
(row) => {
|
|
204
|
-
const href = getRowDetailHref(row);
|
|
205
|
-
if (href) onNavigate == null ? void 0 : onNavigate(href);
|
|
206
|
-
},
|
|
207
|
-
[getRowDetailHref, onNavigate]
|
|
208
|
-
);
|
|
193
|
+
}, [
|
|
194
|
+
isGet,
|
|
195
|
+
hasAutoRun,
|
|
196
|
+
debouncedValues,
|
|
197
|
+
lockedPathValues,
|
|
198
|
+
parameterSignature
|
|
199
|
+
]);
|
|
209
200
|
const backLink = backHref == null ? null : renderLink ? renderLink({
|
|
210
201
|
to: backHref,
|
|
211
202
|
className: "text-sm text-primary underline-offset-4 hover:underline",
|
|
212
203
|
children: backLabel
|
|
213
|
-
}) : /* @__PURE__ */ jsx(
|
|
204
|
+
}) : /* @__PURE__ */ jsx(
|
|
205
|
+
"a",
|
|
206
|
+
{
|
|
207
|
+
href: backHref,
|
|
208
|
+
className: "text-sm text-primary underline-offset-4 hover:underline",
|
|
209
|
+
children: backLabel
|
|
210
|
+
}
|
|
211
|
+
);
|
|
214
212
|
if (isLoading) {
|
|
215
213
|
return /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Loading operation..." });
|
|
216
214
|
}
|
|
@@ -224,7 +222,6 @@ function OperationCommandPage({
|
|
|
224
222
|
] });
|
|
225
223
|
}
|
|
226
224
|
const { path, method, operation: op } = operation;
|
|
227
|
-
const preview = buildOperationPreview(operation, effectiveInitialValues, accept, previewMode);
|
|
228
225
|
return /* @__PURE__ */ jsxs("div", { className: className ?? "min-w-0 flex-1 space-y-6 p-6", children: [
|
|
229
226
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
230
227
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -237,102 +234,64 @@ function OperationCommandPage({
|
|
|
237
234
|
op.operationId && op.summary && /* @__PURE__ */ jsx("p", { className: "mt-2 font-mono text-xs text-muted-foreground", children: op.operationId }),
|
|
238
235
|
op.description && op.description !== op.summary && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: op.description })
|
|
239
236
|
] }),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
)
|
|
252
|
-
] }),
|
|
253
|
-
relatedOperations.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap justify-end gap-2", children: relatedOperations.map(
|
|
254
|
-
(related) => related.href ? renderLink ? renderLink({
|
|
255
|
-
key: `${related.operation.method}:${related.operation.path}`,
|
|
256
|
-
to: related.href,
|
|
237
|
+
/* @__PURE__ */ jsx("div", { className: "flex shrink-0 flex-col items-end gap-3", children: relatedOperations.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap justify-end gap-2", children: relatedOperations.map(
|
|
238
|
+
(related) => related.href ? renderLink ? renderLink({
|
|
239
|
+
key: `${related.operation.method}:${related.operation.path}`,
|
|
240
|
+
to: related.href,
|
|
241
|
+
className: "inline-flex h-8 items-center justify-center gap-2 rounded-md border border-input bg-background px-3 text-xs font-medium hover:bg-accent hover:text-accent-foreground",
|
|
242
|
+
children: related.label
|
|
243
|
+
}) : /* @__PURE__ */ jsx(
|
|
244
|
+
"a",
|
|
245
|
+
{
|
|
246
|
+
href: related.href,
|
|
257
247
|
className: "inline-flex h-8 items-center justify-center gap-2 rounded-md border border-input bg-background px-3 text-xs font-medium hover:bg-accent hover:text-accent-foreground",
|
|
258
248
|
children: related.label
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
{
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
defaultAccept: accept,
|
|
275
|
-
...onNavigate ? { onNavigateAction: onNavigate } : {}
|
|
276
|
-
},
|
|
277
|
-
`${related.operation.method}:${related.operation.path}`
|
|
278
|
-
)
|
|
279
|
-
) })
|
|
280
|
-
] })
|
|
249
|
+
},
|
|
250
|
+
`${related.operation.method}:${related.operation.path}`
|
|
251
|
+
) : /* @__PURE__ */ jsx(
|
|
252
|
+
OperationActionDialog,
|
|
253
|
+
{
|
|
254
|
+
operation: related.operation,
|
|
255
|
+
client,
|
|
256
|
+
initialValues: lockedPathValues,
|
|
257
|
+
label: related.label,
|
|
258
|
+
defaultAccept: RESULT_ACCEPT,
|
|
259
|
+
...onNavigate ? { onNavigateAction: onNavigate } : {}
|
|
260
|
+
},
|
|
261
|
+
`${related.operation.method}:${related.operation.path}`
|
|
262
|
+
)
|
|
263
|
+
) }) })
|
|
281
264
|
] }),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
filters: formConfig.filters,
|
|
297
|
-
...!effectiveAutoRun ? { onApply: () => handleManualSubmit() } : {},
|
|
298
|
-
applyLabel: "Execute request",
|
|
299
|
-
isPending: isExecuting,
|
|
300
|
-
...formConfig.timeRange ? { timeRange: formConfig.timeRange } : {}
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
submitError && /* @__PURE__ */ jsx("div", { className: "rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive", children: submitError })
|
|
304
|
-
] }) : null
|
|
305
|
-
) : null : /* @__PURE__ */ jsx("div", { className: "rounded-lg border p-4", children: /* @__PURE__ */ jsx(
|
|
306
|
-
CommandForm,
|
|
307
|
-
{
|
|
308
|
-
parameters,
|
|
309
|
-
onExecute: (params) => executeOperation(params),
|
|
310
|
-
isPending: isExecuting,
|
|
311
|
-
method,
|
|
312
|
-
path,
|
|
313
|
-
accept,
|
|
314
|
-
initialValues: effectiveInitialValues
|
|
315
|
-
}
|
|
316
|
-
) }),
|
|
317
|
-
preview && /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs", children: preview })
|
|
318
|
-
] }),
|
|
319
|
-
error ? /* @__PURE__ */ jsx(InlineError, { title: `Failed to load ${path} as ${accept}`, error }) : isExecuting || result ? /* @__PURE__ */ jsx("div", { role: "region", "aria-label": "Response body", children: /* @__PURE__ */ jsx(
|
|
320
|
-
CommandOutput,
|
|
265
|
+
method.toUpperCase() !== "GET" && /* @__PURE__ */ jsx("section", { className: "space-y-3", children: /* @__PURE__ */ jsx("div", { className: "rounded-lg border p-4", children: /* @__PURE__ */ jsx(
|
|
266
|
+
CommandForm,
|
|
267
|
+
{
|
|
268
|
+
parameters,
|
|
269
|
+
onExecute: (params) => executeOperation(params),
|
|
270
|
+
isPending: isExecuting,
|
|
271
|
+
method,
|
|
272
|
+
path,
|
|
273
|
+
accept: RESULT_ACCEPT,
|
|
274
|
+
initialValues: effectiveInitialValues
|
|
275
|
+
}
|
|
276
|
+
) }) }),
|
|
277
|
+
error ? /* @__PURE__ */ jsx(InlineError, { title: `Failed to load ${path}`, error }) : isExecuting || result ? /* @__PURE__ */ jsx(
|
|
278
|
+
OperationResultView,
|
|
321
279
|
{
|
|
322
280
|
response: result,
|
|
323
281
|
loading: isExecuting,
|
|
324
282
|
loadingMessage: "Loading execution results…",
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
283
|
+
ariaLabel: "Response body",
|
|
284
|
+
detailOperation,
|
|
285
|
+
...commandRuntime ? { commandRuntime } : {},
|
|
286
|
+
...isGet && effectiveAutoRun ? {
|
|
287
|
+
filterConfig: {
|
|
288
|
+
filters: formConfig.filters,
|
|
289
|
+
...formConfig.timeRange ? { timeRange: formConfig.timeRange } : {}
|
|
290
|
+
}
|
|
330
291
|
} : {},
|
|
331
|
-
...isGet && effectiveAutoRun && formConfig.filters.length > 0 ? { externalFilters: formConfig.filters } : {},
|
|
332
|
-
...isGet && effectiveAutoRun && formConfig.timeRange ? { timeRange: formConfig.timeRange } : {},
|
|
333
292
|
...isGet && effectiveAutoRun && dataTablePagination ? { pagination: dataTablePagination } : {}
|
|
334
293
|
}
|
|
335
|
-
)
|
|
294
|
+
) : null
|
|
336
295
|
] });
|
|
337
296
|
}
|
|
338
297
|
function findRelatedOperations(current, operations, pathValues) {
|
|
@@ -353,7 +312,9 @@ function findRelatedOperations(current, operations, pathValues) {
|
|
|
353
312
|
label: operationLabel(related),
|
|
354
313
|
...href ? { href } : {}
|
|
355
314
|
};
|
|
356
|
-
}).filter(
|
|
315
|
+
}).filter(
|
|
316
|
+
(related) => related.operation.method.toUpperCase() !== "GET" || related.href
|
|
317
|
+
);
|
|
357
318
|
}
|
|
358
319
|
function findDetailOperation(current, operations) {
|
|
359
320
|
const method = current.method.toUpperCase();
|
|
@@ -367,28 +328,6 @@ function findDetailOperation(current, operations) {
|
|
|
367
328
|
}
|
|
368
329
|
);
|
|
369
330
|
}
|
|
370
|
-
function hrefForOperation(operation, args = [], flags = {}) {
|
|
371
|
-
let route = apiPathToRoutePath(operation.path);
|
|
372
|
-
const consumedFlags = /* @__PURE__ */ new Set();
|
|
373
|
-
pathParamNames(operation.path).forEach((name, index) => {
|
|
374
|
-
const value = flags[name] ?? args[index];
|
|
375
|
-
if (!value) return;
|
|
376
|
-
consumedFlags.add(name);
|
|
377
|
-
route = route.replace(`:${name}`, encodeURIComponent(value));
|
|
378
|
-
});
|
|
379
|
-
if (route.includes(":")) return void 0;
|
|
380
|
-
const search = new URLSearchParams();
|
|
381
|
-
for (const [key, value] of Object.entries(flags)) {
|
|
382
|
-
if (value && !consumedFlags.has(key)) search.set(key, value);
|
|
383
|
-
}
|
|
384
|
-
const query = search.toString();
|
|
385
|
-
return query ? `${route}?${query}` : route;
|
|
386
|
-
}
|
|
387
|
-
function apiPathToRoutePath(path) {
|
|
388
|
-
const cliPath = path.trim().replace(/^\/api\/v1\/?/, "").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
389
|
-
if (!cliPath) return "/";
|
|
390
|
-
return `/${cliPath.replace(/\{([^}]+)\}/g, ":$1")}`;
|
|
391
|
-
}
|
|
392
331
|
function pathTemplateSatisfied(path, values) {
|
|
393
332
|
return pathParamNames(path).every((name) => Boolean(values[name]));
|
|
394
333
|
}
|
|
@@ -397,52 +336,6 @@ function operationLabel(operation) {
|
|
|
397
336
|
const actionName = ((_a = operation.operation["x-clicky"]) == null ? void 0 : _a.actionName) || operation.path.split("/").filter(Boolean).at(-1) || operation.operation.operationId || operation.method;
|
|
398
337
|
return titleCase(actionName.replace(/[_-]+/g, " "));
|
|
399
338
|
}
|
|
400
|
-
function buildOperationPreview(operation, values, accept, mode) {
|
|
401
|
-
if (mode === "hidden") return "";
|
|
402
|
-
if (mode === "cli") return buildCliPreview(operation, values);
|
|
403
|
-
return buildCurlPreview(operation, values, accept);
|
|
404
|
-
}
|
|
405
|
-
function buildCurlPreview(operation, values, accept) {
|
|
406
|
-
const params = operation.operation.parameters ?? [];
|
|
407
|
-
const parts = [`curl -X ${operation.method.toUpperCase()}`];
|
|
408
|
-
if (accept !== "application/json") parts.push(`-H "Accept: ${accept}"`);
|
|
409
|
-
let url = operation.path;
|
|
410
|
-
const queryParts = [];
|
|
411
|
-
for (const param of params) {
|
|
412
|
-
const value = submitValue(param, values[param.name]);
|
|
413
|
-
if (!value) continue;
|
|
414
|
-
if (param.in === "path") {
|
|
415
|
-
url = url.replace(`{${param.name}}`, encodeURIComponent(value));
|
|
416
|
-
} else if (param.in === "query") {
|
|
417
|
-
queryParts.push(`${encodeURIComponent(param.name)}=${encodeURIComponent(value)}`);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
if (queryParts.length > 0) url += `?${queryParts.join("&")}`;
|
|
421
|
-
parts.push(`"${url}"`);
|
|
422
|
-
return parts.join(" ");
|
|
423
|
-
}
|
|
424
|
-
function buildCliPreview(operation, values) {
|
|
425
|
-
var _a;
|
|
426
|
-
const command = (_a = operation.operation["x-clicky"]) == null ? void 0 : _a.command;
|
|
427
|
-
if (!command) return buildCurlPreview(operation, values, "application/json");
|
|
428
|
-
const params = operation.operation.parameters ?? [];
|
|
429
|
-
const positionalNames = new Set(params.filter(isPositionalParam).map((param) => param.name));
|
|
430
|
-
const parts = [command.replaceAll("/", " ")];
|
|
431
|
-
for (const param of params) {
|
|
432
|
-
const value = submitValue(param, values[param.name]);
|
|
433
|
-
if (!value) continue;
|
|
434
|
-
if (param.in === "path" || positionalNames.has(param.name)) {
|
|
435
|
-
parts.push(shellQuote(value));
|
|
436
|
-
continue;
|
|
437
|
-
}
|
|
438
|
-
parts.push(`--${param.name}`, shellQuote(value));
|
|
439
|
-
}
|
|
440
|
-
return parts.join(" ");
|
|
441
|
-
}
|
|
442
|
-
function shellQuote(value) {
|
|
443
|
-
if (/^[a-zA-Z0-9_./:@-]+$/.test(value)) return value;
|
|
444
|
-
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
445
|
-
}
|
|
446
339
|
function stripRunnerParams(values) {
|
|
447
340
|
const next = {};
|
|
448
341
|
for (const [key, value] of Object.entries(values)) {
|
|
@@ -451,23 +344,41 @@ function stripRunnerParams(values) {
|
|
|
451
344
|
}
|
|
452
345
|
return next;
|
|
453
346
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
347
|
+
function readQueryParameterValuesFromUrl(parameters) {
|
|
348
|
+
if (typeof window === "undefined") return {};
|
|
349
|
+
const queryParamNames = new Set(
|
|
350
|
+
parameters.filter((param) => param.in === "query").map((p) => p.name)
|
|
351
|
+
);
|
|
352
|
+
if (queryParamNames.size === 0) return {};
|
|
353
|
+
const values = {};
|
|
354
|
+
const search = new URLSearchParams(window.location.search);
|
|
355
|
+
for (const name of queryParamNames) {
|
|
356
|
+
const value = search.get(name);
|
|
357
|
+
if (value != null && value !== "") {
|
|
358
|
+
values[name] = value;
|
|
359
|
+
}
|
|
459
360
|
}
|
|
460
|
-
return
|
|
361
|
+
return values;
|
|
461
362
|
}
|
|
462
|
-
function
|
|
463
|
-
if (
|
|
464
|
-
|
|
465
|
-
if (
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
363
|
+
function writeQueryParameterValuesToUrl(values, parameters) {
|
|
364
|
+
if (typeof window === "undefined") return;
|
|
365
|
+
const queryParameters = parameters.filter((param) => param.in === "query");
|
|
366
|
+
if (queryParameters.length === 0) return;
|
|
367
|
+
const search = new URLSearchParams(window.location.search);
|
|
368
|
+
for (const param of queryParameters) {
|
|
369
|
+
const value = submitValue(param, values[param.name]);
|
|
370
|
+
if (value == null) {
|
|
371
|
+
search.delete(param.name);
|
|
372
|
+
} else {
|
|
373
|
+
search.set(param.name, value);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const query = search.toString();
|
|
377
|
+
const next = `${window.location.pathname}${query ? `?${query}` : ""}${window.location.hash}`;
|
|
378
|
+
const current = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
379
|
+
if (next !== current) {
|
|
380
|
+
window.history.replaceState(window.history.state, "", next);
|
|
381
|
+
}
|
|
471
382
|
}
|
|
472
383
|
export {
|
|
473
384
|
OperationCommandPage
|