@chengxianglibra/dsh-data-analysis 0.1.1 → 0.2.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/README.md +139 -53
- package/cordis.patch.yml +1 -1
- package/lib/bin/environment.js +9 -7
- package/lib/bin/presentation-lint.js +21 -0
- package/lib/bridges.js +2 -2
- package/lib/client/credentials/changes.js +74 -0
- package/lib/client/credentials/create-datasource.js +171 -0
- package/lib/client/credentials/credential-draft.js +42 -0
- package/lib/client/credentials/defaults.js +11 -0
- package/lib/client/credentials/descriptions.js +46 -0
- package/lib/client/credentials/install.js +319 -0
- package/lib/client/credentials/model.js +766 -0
- package/lib/client/credentials/report-publishing.js +96 -0
- package/lib/client/credentials/styles.js +21 -0
- package/lib/client/i18n/context.js +22 -0
- package/lib/client/i18n/copy.js +57 -0
- package/lib/client/i18n/credentials.js +475 -0
- package/lib/client/i18n/host.js +27 -0
- package/lib/client/i18n/navigation.js +41 -0
- package/lib/client/i18n/presentation.js +577 -0
- package/lib/client/i18n/python.js +36 -0
- package/lib/client/i18n/semantic.js +441 -0
- package/lib/client/input-context.js +21 -0
- package/lib/client/python-tool/card.js +35 -0
- package/lib/client/python-tool/execution-error.js +35 -0
- package/lib/client/python-tool/install.js +9 -0
- package/lib/client/python-tool/model.js +101 -0
- package/lib/client/right-tabs/install.js +535 -0
- package/lib/client/right-tabs/live-delivery.js +58 -0
- package/lib/client/right-tabs/navigation.js +47 -0
- package/lib/client/right-tabs/page.js +178 -0
- package/lib/client/right-tabs/styles.js +11 -0
- package/lib/client/rpc.js +5 -0
- package/lib/client/semantic-reference.js +10 -0
- package/lib/client/workspace-header-action.js +24 -0
- package/lib/client/workspace-shortcuts.js +26 -0
- package/lib/client.js +1250 -730
- package/lib/compatibility.js +2 -2
- package/lib/datasource/authoring.js +109 -0
- package/lib/datasource/bridge-programs.js +42 -27
- package/lib/datasource/bridge.js +144 -9
- package/lib/datasource/changes-contract.js +41 -0
- package/lib/datasource/changes.js +49 -0
- package/lib/datasource/configure.js +39 -0
- package/lib/datasource/defaults.js +25 -0
- package/lib/datasource/index.js +4 -2
- package/lib/datasource/python-options.js +21 -0
- package/lib/datasource/python.js +206 -0
- package/lib/datasource/resolver-program.js +112 -0
- package/lib/datasource/rpc.js +150 -0
- package/lib/datasource/service.js +962 -0
- package/lib/datasource/shell-env.js +2 -333
- package/lib/datasource/test.js +25 -51
- package/lib/disclosure/activation.js +19 -7
- package/lib/disclosure/execution-guidance.js +52 -0
- package/lib/disclosure/help.js +4 -1
- package/lib/environment/binding.js +54 -9
- package/lib/environment/runtime.js +120 -108
- package/lib/environment/subprocess.js +6 -1
- package/lib/environment/summary.js +3 -3
- package/lib/environment/workspace.js +23 -1
- package/lib/index.js +1 -1
- package/lib/lifecycle.js +33 -0
- package/lib/plugin-agents.js +154 -0
- package/lib/plugin.js +172 -133
- package/lib/presentation/asset.js +34 -0
- package/lib/presentation/assets/portable.js +606 -0
- package/lib/presentation/assets/static.js +1216 -0
- package/lib/presentation/build/index.js +72 -0
- package/lib/presentation/commit.js +163 -0
- package/lib/presentation/contracts/asset-path.js +9 -0
- package/lib/presentation/contracts/catalog.js +62 -0
- package/lib/presentation/contracts/charts.js +453 -0
- package/lib/presentation/contracts/editing.js +58 -0
- package/lib/presentation/contracts/index.js +663 -0
- package/lib/presentation/contracts/interaction.js +62 -0
- package/lib/presentation/contracts/types.js +15 -0
- package/lib/presentation/contracts/values.js +28 -0
- package/lib/presentation/delivery.js +71 -0
- package/lib/presentation/export-html.js +214 -0
- package/lib/presentation/files.js +82 -0
- package/lib/presentation/index.js +6 -0
- package/lib/presentation/lint.js +46 -0
- package/lib/presentation/projection/files.js +85 -0
- package/lib/presentation/projection/index.js +196 -0
- package/lib/presentation/projection/program.js +137 -0
- package/lib/presentation/projection/sql-code.js +79 -0
- package/lib/presentation/receipt.js +34 -0
- package/lib/presentation/reports.js +219 -0
- package/lib/presentation/rpc.js +186 -0
- package/lib/presentation/tool.js +118 -0
- package/lib/python-execution-contracts.js +1 -0
- package/lib/python-execution.js +232 -0
- package/lib/report-publishing/adapters.js +111 -0
- package/lib/report-publishing/config.js +69 -0
- package/lib/report-publishing/service.js +180 -0
- package/lib/rpc.js +49 -0
- package/lib/semantic-browser/contracts.js +97 -0
- package/lib/semantic-browser/definition.js +64 -0
- package/lib/semantic-browser/program.js +129 -0
- package/lib/semantic-browser/service.js +106 -0
- package/lib/semantic-reference/bridge.js +127 -0
- package/lib/semantic-reference/contracts.js +127 -0
- package/lib/semantic-reference/environment.js +56 -0
- package/lib/semantic-reference/index.js +3 -0
- package/lib/semantic-reference/labels.js +16 -0
- package/lib/semantic-reference/rpc.js +143 -0
- package/lib/semantic-reference/search.js +95 -0
- package/lib/semantic-reference/usage.js +152 -0
- package/lib/tool-lifecycle.js +22 -0
- package/lib/types/bridges.d.ts +2 -2
- package/lib/types/client/credentials/changes.d.ts +9 -0
- package/lib/types/client/credentials/create-datasource.d.ts +7 -0
- package/lib/types/client/credentials/credential-draft.d.ts +14 -0
- package/lib/types/client/credentials/defaults.d.ts +2 -0
- package/lib/types/client/credentials/descriptions.d.ts +1 -0
- package/lib/types/client/credentials/install.d.ts +19 -0
- package/lib/types/client/credentials/model.d.ts +79 -0
- package/lib/types/client/credentials/report-publishing.d.ts +5 -0
- package/lib/types/client/credentials/styles.d.ts +1 -0
- package/lib/types/client/i18n/context.d.ts +17 -0
- package/lib/types/client/i18n/copy.d.ts +806 -0
- package/lib/types/client/i18n/credentials.d.ts +475 -0
- package/lib/types/client/i18n/host.d.ts +16 -0
- package/lib/types/client/i18n/navigation.d.ts +41 -0
- package/lib/types/client/i18n/presentation.d.ts +577 -0
- package/lib/types/client/i18n/python.d.ts +19 -0
- package/lib/types/client/i18n/semantic.d.ts +441 -0
- package/lib/types/client/input-context.d.ts +19 -0
- package/lib/types/client/presentation/ask-dsh.d.ts +5 -0
- package/lib/types/client/presentation/catalog-model.d.ts +24 -0
- package/lib/types/client/presentation/catalog.d.ts +20 -0
- package/lib/types/client/presentation/chart-explorer.d.ts +12 -0
- package/lib/types/client/presentation/chart-geometry.d.ts +30 -0
- package/lib/types/client/presentation/chart-renderer.d.ts +10 -0
- package/lib/types/client/presentation/chart-specials.d.ts +10 -0
- package/lib/types/client/presentation/chart-styles.d.ts +1 -0
- package/lib/types/client/presentation/chart-tooltip.d.ts +13 -0
- package/lib/types/client/presentation/chart-view.d.ts +23 -0
- package/lib/types/client/presentation/context-reference.d.ts +12 -0
- package/lib/types/client/presentation/copy-context.d.ts +5 -0
- package/lib/types/client/presentation/delivery-model.d.ts +75 -0
- package/lib/types/client/presentation/delivery.d.ts +78 -0
- package/lib/types/client/presentation/download.d.ts +2 -0
- package/lib/types/client/presentation/editor-controls.d.ts +12 -0
- package/lib/types/client/presentation/export-menu.d.ts +26 -0
- package/lib/types/client/presentation/export-view.d.ts +63 -0
- package/lib/types/client/presentation/global-filters.d.ts +6 -0
- package/lib/types/client/presentation/host-entry.d.ts +18 -0
- package/lib/types/client/presentation/icons.d.ts +4 -0
- package/lib/types/client/presentation/markdown.d.ts +5 -0
- package/lib/types/client/presentation/model.d.ts +61 -0
- package/lib/types/client/presentation/reader.d.ts +24 -0
- package/lib/types/client/presentation/reference-source.d.ts +9 -0
- package/lib/types/client/presentation/source-code-model.d.ts +17 -0
- package/lib/types/client/presentation/source-code.d.ts +6 -0
- package/lib/types/client/presentation/source-dialog.d.ts +12 -0
- package/lib/types/client/presentation/source-facts.d.ts +20 -0
- package/lib/types/client/presentation/source-format.d.ts +5 -0
- package/lib/types/client/presentation/source-highlight.d.ts +7 -0
- package/lib/types/client/presentation/sources.d.ts +13 -0
- package/lib/types/client/presentation/styles.d.ts +1 -0
- package/lib/types/client/presentation/table.d.ts +16 -0
- package/lib/types/client/presentation/use-element-width.d.ts +5 -0
- package/lib/types/client/python-tool/card.d.ts +2 -0
- package/lib/types/client/python-tool/execution-error.d.ts +3 -0
- package/lib/types/client/python-tool/install.d.ts +2 -0
- package/lib/types/client/python-tool/model.d.ts +20 -0
- package/lib/types/client/right-tabs/install.d.ts +18 -0
- package/lib/types/client/right-tabs/live-delivery.d.ts +8 -0
- package/lib/types/client/right-tabs/navigation.d.ts +17 -0
- package/lib/types/client/right-tabs/page.d.ts +36 -0
- package/lib/types/client/right-tabs/styles.d.ts +2 -0
- package/lib/types/client/rpc.d.ts +3 -0
- package/lib/types/client/semantic-reference.d.ts +4 -0
- package/lib/types/client/workspace-header-action.d.ts +7 -0
- package/lib/types/client/workspace-shortcuts.d.ts +15 -0
- package/lib/types/client.d.ts +9 -124
- package/lib/types/compatibility.d.ts +3 -3
- package/lib/types/datasource/authoring.d.ts +35 -0
- package/lib/types/datasource/bridge.d.ts +43 -4
- package/lib/types/datasource/changes-contract.d.ts +18 -0
- package/lib/types/datasource/changes.d.ts +15 -0
- package/lib/types/datasource/configure.d.ts +7 -0
- package/lib/types/datasource/defaults.d.ts +7 -0
- package/lib/types/datasource/index.d.ts +8 -5
- package/lib/types/datasource/python-options.d.ts +9 -0
- package/lib/types/datasource/python.d.ts +19 -0
- package/lib/types/datasource/resolver-program.d.ts +6 -0
- package/lib/types/datasource/rpc.d.ts +5 -0
- package/lib/types/datasource/service.d.ts +155 -0
- package/lib/types/datasource/shell-env.d.ts +0 -29
- package/lib/types/datasource/test.d.ts +6 -29
- package/lib/types/disclosure/activation.d.ts +2 -1
- package/lib/types/disclosure/execution-guidance.d.ts +6 -0
- package/lib/types/disclosure/help.d.ts +1 -1
- package/lib/types/environment/binding.d.ts +5 -1
- package/lib/types/environment/errors.d.ts +1 -1
- package/lib/types/environment/runtime.d.ts +5 -5
- package/lib/types/environment/types.d.ts +15 -3
- package/lib/types/environment/workspace.d.ts +1 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/lifecycle.d.ts +8 -0
- package/lib/types/plugin-agents.d.ts +27 -0
- package/lib/types/plugin.d.ts +14 -24
- package/lib/types/presentation/asset.d.ts +6 -0
- package/lib/types/presentation/build/index.d.ts +16 -0
- package/lib/types/presentation/commit.d.ts +4 -0
- package/lib/types/presentation/contracts/asset-path.d.ts +2 -0
- package/lib/types/presentation/contracts/catalog.d.ts +27 -0
- package/lib/types/presentation/contracts/charts.d.ts +11 -0
- package/lib/types/presentation/contracts/editing.d.ts +8 -0
- package/lib/types/presentation/contracts/index.d.ts +11 -0
- package/lib/types/presentation/contracts/interaction.d.ts +8 -0
- package/lib/types/presentation/contracts/types.d.ts +255 -0
- package/lib/types/presentation/contracts/values.d.ts +9 -0
- package/lib/types/presentation/delivery.d.ts +3 -0
- package/lib/types/presentation/export-html.d.ts +13 -0
- package/lib/types/presentation/files.d.ts +7 -0
- package/lib/types/presentation/index.d.ts +6 -0
- package/lib/types/presentation/lint.d.ts +13 -0
- package/lib/types/presentation/projection/files.d.ts +2 -0
- package/lib/types/presentation/projection/index.d.ts +20 -0
- package/lib/types/presentation/projection/program.d.ts +2 -0
- package/lib/types/presentation/projection/sql-code.d.ts +2 -0
- package/lib/types/presentation/receipt.d.ts +14 -0
- package/lib/types/presentation/reports.d.ts +10 -0
- package/lib/types/presentation/rpc.d.ts +25 -0
- package/lib/types/presentation/tool.d.ts +12 -0
- package/lib/types/python-execution-contracts.d.ts +10 -0
- package/lib/types/python-execution.d.ts +10 -0
- package/lib/types/report-publishing/adapters.d.ts +6 -0
- package/lib/types/report-publishing/config.d.ts +22 -0
- package/lib/types/report-publishing/service.d.ts +68 -0
- package/lib/types/rpc.d.ts +3 -0
- package/lib/types/semantic-browser/contracts.d.ts +47 -0
- package/lib/types/semantic-browser/definition.d.ts +20 -0
- package/lib/types/semantic-browser/program.d.ts +2 -0
- package/lib/types/semantic-browser/service.d.ts +26 -0
- package/lib/types/semantic-reference/bridge.d.ts +12 -0
- package/lib/types/semantic-reference/contracts.d.ts +54 -0
- package/lib/types/semantic-reference/environment.d.ts +22 -0
- package/lib/types/semantic-reference/index.d.ts +3 -0
- package/lib/types/semantic-reference/labels.d.ts +16 -0
- package/lib/types/semantic-reference/rpc.d.ts +15 -0
- package/lib/types/semantic-reference/search.d.ts +10 -0
- package/lib/types/semantic-reference/usage.d.ts +43 -0
- package/lib/types/tool-lifecycle.d.ts +4 -0
- package/lib/types/workspace-identity.d.ts +6 -0
- package/lib/workspace-identity.js +9 -0
- package/package.json +99 -53
- package/python/presentation-kit/dist/dsh_data_analysis_presentation_kit-1.1.0-py3-none-any.whl +0 -0
- package/skills/dsh-data-analysis-files/SKILL.md +32 -0
- package/skills/dsh-data-analysis-files/references/examples.md +93 -0
- package/skills/dsh-data-analysis-presentation/SKILL.md +28 -0
- package/skills/dsh-data-analysis-presentation/references/chart-examples.md +18 -0
- package/skills/dsh-data-analysis-presentation/references/charts.md +55 -0
- package/skills/dsh-data-analysis-presentation/references/examples/artifact.draft.json +36 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-bins.dataset.json +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-boxes.dataset.json +45 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-composition.dataset.json +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-funnel.dataset.json +27 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-precision.dataset.json +21 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-series.dataset.json +58 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-shares.dataset.json +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-waterfall.dataset.json +44 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts.draft.json +393 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison-selected.dataset.json +24 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison-summary.dataset.json +22 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison.dataset.json +18 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison.draft.json +80 -0
- package/skills/dsh-data-analysis-presentation/references/examples/computed-sources.draft.json +42 -0
- package/skills/dsh-data-analysis-presentation/references/examples/computed.dataset.json +12 -0
- package/skills/dsh-data-analysis-presentation/references/examples/computed.draft.json +58 -0
- package/skills/dsh-data-analysis-presentation/references/examples/interaction-detail.dataset.json +30 -0
- package/skills/dsh-data-analysis-presentation/references/examples/interaction-summary.dataset.json +22 -0
- package/skills/dsh-data-analysis-presentation/references/examples/interaction.draft.json +279 -0
- package/skills/dsh-data-analysis-presentation/references/examples/source-only.draft.json +27 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-charts.py +73 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-comparison.py +42 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-computed.py +21 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-interaction.py +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples.md +44 -0
- package/skills/dsh-data-analysis-presentation/references/export-html.md +7 -0
- package/skills/dsh-data-analysis-presentation/references/interaction.md +56 -0
- package/skills/dsh-data-analysis-presentation/references/narrative.md +37 -0
- package/skills/dsh-data-analysis-presentation/references/publishing.md +3 -0
- package/skills/dsh-data-analysis-presentation/references/schema.md +162 -0
- package/lib/datasource/access.js +0 -60
- package/lib/datasource/credentials.js +0 -24
- package/lib/evidence/bridge-program.js +0 -153
- package/lib/evidence/bridge.js +0 -166
- package/lib/evidence/index.js +0 -2
- package/lib/evidence/sources.js +0 -263
- package/lib/types/datasource/access.d.ts +0 -27
- package/lib/types/evidence/bridge.d.ts +0 -40
- package/lib/types/evidence/index.d.ts +0 -4
- package/lib/types/evidence/sources.d.ts +0 -57
- package/python/report-kit/dist/dsh_data_analysis_report_kit-3.0.0-py3-none-any.whl +0 -0
- package/skills/dsh-data-analysis-report/SKILL.md +0 -57
- package/skills/dsh-data-analysis-report/assets/marivo-artifact.js +0 -113
- package/skills/dsh-data-analysis-report/assets/marivo-session-dag.js +0 -1201
- package/skills/dsh-data-analysis-report/assets/report-data.js +0 -449
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useCopy } from "./../i18n/context.js";
|
|
4
|
+
const labels = {
|
|
5
|
+
accessKeyId: 'Access Key ID',
|
|
6
|
+
secretAccessKey: 'Secret Access Key',
|
|
7
|
+
sessionToken: 'Session Token',
|
|
8
|
+
};
|
|
9
|
+
export function ReportPublishingCredentials({ model, workspaceId, }) {
|
|
10
|
+
const t = useCopy();
|
|
11
|
+
const [view, setView] = useState();
|
|
12
|
+
const [editing, setEditing] = useState({});
|
|
13
|
+
const [deleting, setDeleting] = useState();
|
|
14
|
+
const [draft, setDraft] = useState({});
|
|
15
|
+
const [busy, setBusy] = useState(false);
|
|
16
|
+
const [message, setMessage] = useState('');
|
|
17
|
+
const [lifetime] = useState(() => new AbortController());
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const abort = new AbortController();
|
|
20
|
+
void model
|
|
21
|
+
.publishingCredentials('describe', workspaceId, {}, abort.signal)
|
|
22
|
+
.then((next) => {
|
|
23
|
+
if (!abort.signal.aborted)
|
|
24
|
+
setView(next);
|
|
25
|
+
})
|
|
26
|
+
.catch(() => {
|
|
27
|
+
if (!abort.signal.aborted)
|
|
28
|
+
setMessage('marivo.credentials.cannot-read-report-publishing-credential-status-reopen-the-page');
|
|
29
|
+
});
|
|
30
|
+
return () => abort.abort();
|
|
31
|
+
}, [model, workspaceId]);
|
|
32
|
+
useEffect(() => () => lifetime.abort(), [lifetime]);
|
|
33
|
+
async function change(field, remove) {
|
|
34
|
+
setBusy(true);
|
|
35
|
+
setMessage('');
|
|
36
|
+
try {
|
|
37
|
+
const next = await model.publishingCredentials(remove ? 'unset' : 'set', workspaceId, {
|
|
38
|
+
field,
|
|
39
|
+
configId: view?.configId,
|
|
40
|
+
...(remove ? {} : { value: draft[field] }),
|
|
41
|
+
}, lifetime.signal);
|
|
42
|
+
if (lifetime.signal.aborted)
|
|
43
|
+
return;
|
|
44
|
+
setView(next);
|
|
45
|
+
setEditing((previous) => ({ ...previous, [field]: false }));
|
|
46
|
+
setDeleting(undefined);
|
|
47
|
+
setDraft((previous) => ({ ...previous, [field]: '' }));
|
|
48
|
+
setMessage(remove
|
|
49
|
+
? 'marivo.credentials.saved-value-deleted-status-refreshed'
|
|
50
|
+
: 'marivo.credentials.saved-the-next-publication-will-use-the-new-credential');
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (!lifetime.signal.aborted)
|
|
54
|
+
setMessage(error instanceof Error && error.message === 'report-publishing-config-changed'
|
|
55
|
+
? 'marivo.credentials.publishing-configuration-changed-refresh-credential-status-and-enter-values'
|
|
56
|
+
: 'marivo.credentials.credential-operation-unconfirmed-refresh-status-before-retrying-credentials-from');
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
if (!lifetime.signal.aborted)
|
|
60
|
+
setBusy(false);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!view?.enabled)
|
|
64
|
+
return message ? _jsx("p", { role: "status", children: t(message) }) : null;
|
|
65
|
+
return (_jsxs("section", { className: "mc-publishing", "aria-label": t('marivo.credentials.report-publishing-credentials'), children: [_jsxs("h3", { className: "mc-section-heading", children: [t('marivo.credentials.report-publishing-credentials-228'), view.name] }), _jsxs("p", { className: "mc-note", children: ["Bucket\uFF1A", view.bucket, t('marivo.credentials.credentials-are-shared-by-the-current-harness-across-all')] }), _jsx("div", { className: "mc-fields", children: view.fields.map((item) => (_jsxs("fieldset", { className: "mc-field", disabled: busy, "aria-label": item.reference, children: [_jsxs("div", { className: "mc-field-header", children: [_jsxs("div", { className: "mc-field-title", children: [_jsx("h4", { children: item.reference }), _jsxs("p", { children: [t('marivo.credentials.field'), labels[item.field], item.required ? t('marivo.credentials.required') : '', ' ', t('marivo.credentials.source'), item.source ?? t('marivo.credentials.none'), !item.writable && t('marivo.credentials.read-only-source')] })] }), _jsxs("div", { className: "mc-field-actions", children: [_jsx("span", { className: "mc-badge", "data-ready": item.configured, children: item.configured
|
|
66
|
+
? t('marivo.credentials.configured')
|
|
67
|
+
: t('marivo.credentials.not-configured') }), item.writable && item.configured && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => {
|
|
68
|
+
setEditing({ ...editing, [item.field]: !editing[item.field] });
|
|
69
|
+
setDraft({ ...draft, [item.field]: '' });
|
|
70
|
+
}, children: editing[item.field]
|
|
71
|
+
? t('marivo.credentials.cancel-replacement')
|
|
72
|
+
: t('marivo.credentials.replace') }), _jsx("button", { type: "button", className: "mc-danger", onClick: () => setDeleting(item.field), children: t('marivo.credentials.delete-saved-value') })] }))] })] }), item.writable && (!item.configured || editing[item.field]) && (_jsxs("label", { className: "mc-secret-input", children: [t('marivo.credentials.new-value'), _jsx("input", { id: `report-publishing-${item.field}`, type: "password", autoComplete: "new-password", maxLength: 65536, value: draft[item.field] ?? '', placeholder: t('marivo.credentials.enter-credential-value-127'), onChange: (event) => setDraft({ ...draft, [item.field]: event.target.value }) }), _jsx("button", { type: "button", className: "mc-primary", disabled: !draft[item.field], onClick: () => void change(item.field, false), children: item.configured
|
|
73
|
+
? t('marivo.credentials.confirm-replacement')
|
|
74
|
+
: t('marivo.credentials.add-credential') })] })), deleting === item.field && (_jsxs("div", { className: "mc-confirm", children: [_jsxs("p", { children: [t('marivo.credentials.confirm-deletion-of'), item.reference, " ", t('marivo.credentials.the-saved-value')] }), _jsx("button", { type: "button", className: "mc-danger", onClick: () => void change(item.field, true), children: t('marivo.credentials.confirm-saved-value-deletion') }), _jsx("button", { type: "button", onClick: () => setDeleting(undefined), children: t('marivo.credentials.keep') })] }))] }, item.field))) }), _jsx("button", { type: "button", disabled: busy, onClick: () => {
|
|
75
|
+
setBusy(true);
|
|
76
|
+
void model
|
|
77
|
+
.publishingCredentials('describe', workspaceId, {}, lifetime.signal)
|
|
78
|
+
.then((next) => {
|
|
79
|
+
if (!lifetime.signal.aborted) {
|
|
80
|
+
setView(next);
|
|
81
|
+
setDraft({});
|
|
82
|
+
setEditing({});
|
|
83
|
+
setDeleting(undefined);
|
|
84
|
+
setMessage('marivo.credentials.status-refreshed');
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
.catch(() => {
|
|
88
|
+
if (!lifetime.signal.aborted)
|
|
89
|
+
setMessage('marivo.credentials.refresh-failed-please-retry');
|
|
90
|
+
})
|
|
91
|
+
.finally(() => {
|
|
92
|
+
if (!lifetime.signal.aborted)
|
|
93
|
+
setBusy(false);
|
|
94
|
+
});
|
|
95
|
+
}, children: t('marivo.credentials.refresh-credential-status') }), message && _jsx("p", { role: "status", children: t(message) })] }));
|
|
96
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const credentialStyles = `
|
|
2
|
+
.mc-panel,.rt-page[data-rt-kind=datasources]{--mc-accent:#2563eb;--mc-tint:#eff6ff}
|
|
3
|
+
.rt-page[data-rt-kind=datasources] :focus-visible{outline-color:var(--mc-accent)}
|
|
4
|
+
.mc-input-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px;min-width:0}.mc-input-name{font-weight:500;color:var(--mc-text);overflow-wrap:anywhere}.mc-input-description{flex:1 1 200px;min-width:0;font-size:11px;line-height:1.6;color:var(--mc-muted);overflow-wrap:anywhere}
|
|
5
|
+
.mc-panel{--mc-bg:var(--dsw-alias-surface-primary,#fff);--mc-soft:var(--dsw-alias-interactive-bg-hover,#f5f7f9);--mc-text:var(--dsw-alias-label-primary,#182a33);--mc-muted:var(--dsw-alias-label-secondary,#627580);--mc-border:var(--dsw-alias-border-l2,#dce4e8);--mc-danger:#b04436;--mc-warning:#886217;color:var(--mc-text);background:var(--mc-bg);min-width:0;width:100%;font:14px/1.55 system-ui,sans-serif}
|
|
6
|
+
|
|
7
|
+
.mc-panel *{box-sizing:border-box}.mc-shell{display:flex;flex-direction:column}.mc-panel button,.mc-panel input,.mc-panel select{font:inherit;color:inherit}.mc-panel button{cursor:pointer;border:1px solid var(--mc-border);border-radius:8px;padding:7px 12px;background:var(--mc-bg);line-height:1.5}.mc-panel button:hover{background:var(--mc-soft)}.mc-panel button:disabled{cursor:default;opacity:.5}.mc-panel :focus-visible{outline:2px solid var(--mc-accent);outline-offset:3px}.mc-panel select,.mc-panel input{border:1px solid var(--mc-border);border-radius:8px;background:var(--mc-bg);padding:9px 10px;max-width:100%;min-width:0}.mc-panel select{width:100%}.mc-panel button.mc-primary{color:#fff;background:var(--mc-accent);border-color:var(--mc-accent)}.mc-panel button.mc-primary:hover{filter:brightness(.93)}.mc-panel button.mc-danger{color:var(--mc-danger);background:#fef2f2;border-color:#fecaca}.mc-panel button.mc-danger:hover:not(:disabled){background:#fee2e2}.mc-panel button.mc-quiet{border-color:transparent;background:transparent;color:var(--mc-muted)}.mc-panel button.mc-quiet:hover{background:var(--mc-soft)}
|
|
8
|
+
.mc-columns{display:flex;flex-direction:column;min-width:0}.mc-nav{padding:0 0 16px;border-bottom:1px solid var(--mc-border);min-width:0}.mc-nav>button{margin-bottom:12px}.mc-nav-heading{font-size:12px;color:var(--mc-muted);margin-bottom:8px}.mc-nav-heading h3{font:inherit;margin:0}.mc-datasources{list-style:none;padding:0;margin:0;display:flex;overflow-x:auto;gap:6px;padding:3px}.mc-datasources li{flex:0 0 200px;max-width:240px}.mc-panel .mc-datasource{display:flex;align-items:start;gap:10px;width:100%;padding:12px 10px;border:1px solid transparent;background:transparent;text-align:left}.mc-panel .mc-datasource[aria-pressed=true]{border-color:var(--mc-border);background:var(--mc-bg);box-shadow:0 2px 5px #102a3a05}.mc-datasource>svg{margin-top:2px;flex:none;color:var(--mc-muted)}.mc-datasource[aria-pressed=true]>svg{color:var(--mc-accent)}.mc-datasource-copy{min-width:0;display:grid;gap:4px}.mc-datasource-name{font-size:13px;font-weight:600;overflow-wrap:anywhere}.mc-datasource-status{font-size:11px;color:var(--mc-muted);display:flex;align-items:center;gap:5px}.mc-dot{width:6px;height:6px;background:var(--mc-muted);border-radius:50%;flex:none}.mc-dot[data-ready=true]{background:var(--mc-accent)}.mc-dot[data-ready=false]{background:#c58a26}
|
|
9
|
+
.mc-main{min-width:0;overflow:auto;display:flex;flex-direction:column}.mc-form{display:flex;flex-direction:column;flex:1;min-width:0}.mc-form-body{padding:26px 30px;flex:1}.mc-detail-heading{display:flex;align-items:start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:22px}.mc-eyebrow{font-size:11px;color:var(--mc-muted);margin:0 0 5px}.mc-detail-heading h3{font-size:22px;font-weight:650;line-height:1.4;margin:0;overflow-wrap:anywhere}.mc-badge{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--mc-border);border-radius:6px;padding:3px 7px;font-size:11px;white-space:nowrap;color:var(--mc-muted)}.mc-badge[data-ready=true]{color:var(--mc-accent);background:var(--mc-tint);border-color:transparent}.mc-badge[data-ready=false]{color:var(--mc-warning)}
|
|
10
|
+
.mc-section-heading{font-size:13px;font-weight:600;margin:0 0 12px}.mc-properties{margin:0 0 24px;min-width:0}.mc-property-list{margin:0;border:1px solid var(--mc-border);border-radius:12px;overflow:hidden}.mc-property{display:grid;grid-template-columns:minmax(0,140px) minmax(0,1fr);gap:16px;padding:12px 18px;align-items:start}.mc-property+.mc-property{border-top:1px solid var(--mc-border)}.mc-property dt{font-size:12px;color:var(--mc-muted);overflow-wrap:anywhere}.mc-property dd{margin:0;min-width:0;font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}.mc-property pre{font:12px/1.6 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.mc-property-json{max-height:240px;overflow:auto}
|
|
11
|
+
.mc-publishing{margin-top:28px;padding-top:24px;border-top:1px solid var(--mc-border)}
|
|
12
|
+
.mc-fields{border:1px solid var(--mc-border);border-radius:12px;overflow:hidden;margin:0 0 14px}.mc-field{min-width:0;border:0;padding:18px;margin:0}.mc-field+.mc-field{border-top:1px solid var(--mc-border)}.mc-field-header{display:flex;align-items:start;gap:12px;justify-content:space-between}.mc-field-title{min-width:0}.mc-field-title h4{font-size:13px;margin:0 0 4px;font-weight:600;overflow-wrap:anywhere}.mc-field-title p{margin:0;font-size:11px;color:var(--mc-muted);overflow-wrap:anywhere}.mc-field-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;flex:none}.mc-panel .mc-field-actions button{font-size:12px;padding:5px 9px}.mc-secret-input{display:grid;gap:7px;margin-top:14px;font-size:12px;color:var(--mc-muted)}.mc-secret-input input{width:100%;color:var(--mc-text)}.mc-field-note{font-size:11px;color:var(--mc-muted);margin:10px 0 0;overflow-wrap:anywhere}.mc-confirm{margin-top:12px;padding:12px;border:1px solid var(--mc-border);border-radius:8px;background:var(--mc-soft);display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:12px}.mc-confirm p{flex-basis:100%;margin:0}.mc-note{font-size:12px;color:var(--mc-muted);margin:12px 0;overflow-wrap:anywhere}
|
|
13
|
+
.mc-test{margin-top:24px;padding-top:20px;border-top:1px solid var(--mc-border)}.mc-test-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.mc-test-heading h4{margin:0;font-size:13px}.mc-test-heading time{font-size:11px;color:var(--mc-muted)}.mc-result{border-radius:9px;padding:12px 14px;background:var(--mc-tint);color:var(--mc-accent);font-size:12px}.mc-result[data-tone=error]{background:var(--mc-soft);color:var(--mc-danger)}.mc-result[data-tone=stale]{background:var(--mc-soft);color:var(--mc-muted)}.mc-result-title{display:flex;align-items:center;gap:7px;font-weight:600;font-size:13px}.mc-result p{margin:6px 0 0}.mc-result details{margin-top:9px}.mc-result summary{cursor:pointer}.mc-result pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:180px;overflow:auto;font:12px/1.6 ui-monospace,monospace}.mc-empty-test{font-size:12px;color:var(--mc-muted);margin:0}
|
|
14
|
+
.mc-form-footer{padding:16px 30px;border-top:1px solid var(--mc-border);background:var(--mc-bg);position:sticky;bottom:0;display:flex;align-items:center;flex-wrap:wrap;gap:8px}.mc-form-footer button{font-size:13px}.mc-form-footer .mc-cancel{margin-left:auto}.mc-alert{margin:16px 30px 0;padding:12px 14px;border-radius:8px;font-size:12px;background:var(--mc-soft);color:var(--mc-danger);white-space:pre-wrap;overflow-wrap:anywhere}.mc-request-status{margin:0 0 18px;padding:12px 14px;border-radius:9px;background:var(--mc-soft);font-size:12px}.mc-request-status p{margin:4px 0 0;color:var(--mc-muted)}.mc-requests{padding:12px 20px;border-bottom:1px solid var(--mc-border);display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px}.mc-requests button{font-size:12px}.mc-pending-entry{font:inherit;font-size:12px;cursor:pointer;border:1px solid currentColor;border-radius:7px;padding:5px 9px;background:transparent;color:inherit}
|
|
15
|
+
.mc-activity{padding:14px 30px;background:var(--mc-soft);border-top:1px solid var(--mc-border)}.mc-activity-heading{font-size:12px;color:var(--mc-muted);margin:0 0 8px}.mc-activity-list{display:flex;gap:6px;flex-wrap:wrap}.mc-activity-list button{font-size:12px}.mc-activity-list button[aria-pressed=true]{border-color:var(--mc-accent);color:var(--mc-accent)}.mc-progress{font-size:12px;margin-top:10px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.mc-progress p{margin:0}.mc-progress button{font-size:12px;margin-left:auto}.mc-operation-note{font-size:12px;margin-top:12px;color:var(--mc-muted)}.mc-operation-note p{margin:6px 0}.mc-operation-note[data-error=true]{color:var(--mc-danger)}.mc-empty{padding:64px 28px;text-align:center;color:var(--mc-muted);margin:auto}.mc-empty>svg{margin-bottom:10px;opacity:.65}.mc-empty h3{font-size:15px;color:var(--mc-text);margin:0 0 8px}.mc-empty p{font-size:12px;margin:0}.mc-loading{padding:18px 30px;font-size:12px;color:var(--mc-muted)}
|
|
16
|
+
.mc-request-status{padding:18px;margin:0 0 8px;border:1px solid var(--mc-border);background:var(--mc-bg)}.mc-request-heading{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.mc-request-heading h3{margin:0;font-size:14px;font-weight:600}.mc-request-heading>button{margin-left:auto;font-size:12px}.mc-request-reason{margin-top:14px;color:var(--mc-muted)}.mc-request-reason summary{cursor:pointer;line-height:1.6}.mc-request-reason p{margin:10px 0 0;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}.mc-request-choice{border:0;padding:0;min-width:0;display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:16px;border-top:1px solid var(--mc-border)}.mc-request-choice button[aria-pressed=true]{color:var(--mc-accent);border-color:var(--mc-accent);background:var(--mc-tint)}.mc-existing-source{margin-top:14px}.mc-inline-credentials{margin-top:28px;padding-top:20px;border-top:1px solid var(--mc-border)}.mc-inline-credentials h4{font-size:14px;margin:0}.mc-credential-entry{margin:16px 0 20px}.mc-reference-options{margin-top:10px;font-size:12px;color:var(--mc-muted)}.mc-reference-options summary{cursor:pointer}.mc-reference-options[open]{padding:12px;border:1px solid var(--mc-border);border-radius:8px}.mc-reference-options .mc-note{line-height:1.7}.mc-credential-group>button{font-size:12px}
|
|
17
|
+
.mc-panel .mc-icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:6px;flex:none;border-color:transparent;background:transparent}.mc-heading-actions{display:flex;align-items:center;gap:8px;min-width:0}.mc-panel .mc-datasource-heading{display:block}.mc-name-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.mc-name-row h3{min-width:0}.mc-test-heading>.mc-heading-actions{margin-left:auto}.mc-heading-actions time{text-align:right}
|
|
18
|
+
@media(prefers-color-scheme:dark){.mc-panel,.rt-page[data-rt-kind=datasources]{--mc-accent:#60a5fa;--mc-tint:#172b4d}.mc-panel{--mc-bg:var(--dsw-alias-surface-primary,#182127);--mc-soft:var(--dsw-alias-interactive-bg-hover,#202d34);--mc-text:var(--dsw-alias-label-primary,#e4edf1);--mc-muted:var(--dsw-alias-label-secondary,#9baeb9);--mc-border:var(--dsw-alias-border-l2,#35464f);--mc-danger:#ef998b;--mc-warning:#d6b778}.mc-panel button.mc-primary{color:#10213b}.mc-panel button.mc-danger{background:#40272b;border-color:#704047}.mc-panel button.mc-danger:hover:not(:disabled){background:#513037}}
|
|
19
|
+
@container(max-width:650px){.mc-property{grid-template-columns:minmax(0,1fr);gap:5px;padding:12px 14px}.mc-field-header{flex-wrap:wrap}.mc-field-actions{margin-left:auto}.mc-test-heading{flex-wrap:wrap}}
|
|
20
|
+
.mc-panel .mc-form-body{padding:22px 0}.mc-panel .mc-form-footer{padding:14px 0;position:static}.mc-panel .mc-alert{margin:16px 0 0}.mc-panel .mc-activity{padding:14px}.mc-panel .mc-main{overflow:visible}.mc-panel .mc-requests{padding:12px 0;margin-bottom:16px}.mc-panel .mc-detail-heading h3{font-size:20px}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
import { translator } from "./copy.js";
|
|
4
|
+
// The standalone reader supplies its document language. Host roots supply the DSH service.
|
|
5
|
+
const CopyContext = createContext(translator('en-US'));
|
|
6
|
+
const ActionsContext = createContext(undefined);
|
|
7
|
+
export function CopyProvider({ t, children }) {
|
|
8
|
+
return _jsx(CopyContext.Provider, { value: t, children: children });
|
|
9
|
+
}
|
|
10
|
+
export function HostCopyProvider({ t, children }) {
|
|
11
|
+
return (_jsx(ActionsContext.Provider, { value: t, children: _jsx(CopyProvider, { t: t, children: children }) }));
|
|
12
|
+
}
|
|
13
|
+
export function ReportCopyProvider({ locale, children, }) {
|
|
14
|
+
return _jsx(CopyProvider, { t: translator(locale), children: children });
|
|
15
|
+
}
|
|
16
|
+
export function useCopy() {
|
|
17
|
+
return useContext(CopyContext);
|
|
18
|
+
}
|
|
19
|
+
export function useActionCopy() {
|
|
20
|
+
const report = useCopy();
|
|
21
|
+
return useContext(ActionsContext) ?? report;
|
|
22
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as credentials from "./credentials.js";
|
|
2
|
+
import * as navigation from "./navigation.js";
|
|
3
|
+
import * as presentation from "./presentation.js";
|
|
4
|
+
import * as python from "./python.js";
|
|
5
|
+
import * as semantic from "./semantic.js";
|
|
6
|
+
export const dictionaries = { credentials, navigation, presentation, semantic, python };
|
|
7
|
+
export const zh = {
|
|
8
|
+
...credentials.zh,
|
|
9
|
+
...navigation.zh,
|
|
10
|
+
...presentation.zh,
|
|
11
|
+
...semantic.zh,
|
|
12
|
+
...python.zh,
|
|
13
|
+
};
|
|
14
|
+
export const en = {
|
|
15
|
+
...credentials.en,
|
|
16
|
+
...navigation.en,
|
|
17
|
+
...presentation.en,
|
|
18
|
+
...semantic.en,
|
|
19
|
+
...python.en,
|
|
20
|
+
};
|
|
21
|
+
export function message(key, params = {}) {
|
|
22
|
+
return { key, params };
|
|
23
|
+
}
|
|
24
|
+
export class CopyError extends Error {
|
|
25
|
+
copy;
|
|
26
|
+
constructor(copy) {
|
|
27
|
+
super(typeof copy === 'string' ? copy : copy.key);
|
|
28
|
+
this.copy = copy;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function errorMessage(error) {
|
|
32
|
+
return error instanceof CopyError
|
|
33
|
+
? error.copy
|
|
34
|
+
: error instanceof Error
|
|
35
|
+
? error.message
|
|
36
|
+
: String(error);
|
|
37
|
+
}
|
|
38
|
+
export function translator(locale, lookup) {
|
|
39
|
+
const translate = (value, params) => {
|
|
40
|
+
if (value === undefined)
|
|
41
|
+
return '';
|
|
42
|
+
const key = typeof value === 'string' ? value : value.key;
|
|
43
|
+
const values = params ?? (typeof value === 'string' ? {} : value.params);
|
|
44
|
+
const template = Object.hasOwn(zh, key)
|
|
45
|
+
? (lookup?.(key) ?? (locale === 'zh-CN' ? zh : en)[key])
|
|
46
|
+
: key;
|
|
47
|
+
return template.replace(/\{(\w+)\}/g, (match, name) => {
|
|
48
|
+
const entry = values[name];
|
|
49
|
+
return entry === undefined
|
|
50
|
+
? match
|
|
51
|
+
: typeof entry === 'number'
|
|
52
|
+
? String(entry)
|
|
53
|
+
: translate(entry);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return Object.assign(translate, { locale });
|
|
57
|
+
}
|