treege 3.0.0-beta.60 → 3.0.0-beta.62
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 +46 -46
- package/dist/DefaultInputs-DamDWb5R.js +1988 -0
- package/dist/{ThemeContext-Ddk_Y-Dz.js → ThemeContext-cGSTk24y.js} +121 -126
- package/dist/editor/context/TreegeEditorRuntimeProvider.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +3 -3
- package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +3 -3
- package/dist/editor/features/TreegeEditor/forms/OptionsMappingFields.d.ts +3 -3
- package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +4 -4
- package/dist/editor/hooks/useKeyValueRows.d.ts +15 -0
- package/dist/editor/types/editor.d.ts +4 -10
- package/dist/editor/utils/sensitiveHeaders.d.ts +8 -3
- package/dist/{editor-D2pBjE7E.js → editor-K1jjfc5n.js} +1350 -1324
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/renderer/context/TreegeRenderRuntimeProvider.d.ts +3 -3
- package/dist/renderer/features/TreegeRenderer/native/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/hooks/useSubmitHandler.d.ts +2 -2
- package/dist/renderer/types/renderer.d.ts +5 -2
- package/dist/renderer/utils/http.d.ts +14 -5
- package/dist/renderer/utils/submit.d.ts +2 -2
- package/dist/renderer-native.js +1114 -1080
- package/dist/renderer.js +3 -3
- package/dist/shared/components/ui/item.d.ts +23 -0
- package/dist/shared/components/ui/popover.d.ts +7 -1
- package/dist/shared/context/PortalContainerContext.d.ts +5 -0
- package/dist/shared/types/node.d.ts +26 -26
- package/dist/shared/utils/httpRecord.d.ts +20 -0
- package/package.json +1 -1
- package/dist/DefaultInputs-nRQc9BHG.js +0 -1881
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KeyValueEntry } from '../../../../shared/utils/httpRecord';
|
|
2
2
|
interface SensitiveHeaderWarningProps {
|
|
3
|
-
headers?:
|
|
3
|
+
headers?: KeyValueEntry[];
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Inline alert shown when a field-level header carries credentials (e.g. an
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ExtraMenuItem } from '../../../types/editor';
|
|
2
|
-
import { Flow,
|
|
2
|
+
import { Flow, HttpHeaders } from '../../../../shared/types/node';
|
|
3
3
|
export interface ActionsPanelProps {
|
|
4
4
|
onExportJson?: (data: Flow) => void;
|
|
5
5
|
onSave?: (data: Flow) => void;
|
|
6
6
|
extraMenuItems?: ExtraMenuItem[];
|
|
7
|
-
onAuthorize?: (headers:
|
|
8
|
-
headers?:
|
|
9
|
-
onHeadersChange?: (headers:
|
|
7
|
+
onAuthorize?: (headers: HttpHeaders) => void;
|
|
8
|
+
headers?: HttpHeaders;
|
|
9
|
+
onHeadersChange?: (headers: HttpHeaders) => void;
|
|
10
10
|
}
|
|
11
11
|
declare const ActionsPanel: ({ onExportJson, onSave, extraMenuItems, onAuthorize, headers, onHeadersChange }: ActionsPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default ActionsPanel;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { KeyValueEntry } from '../../shared/utils/httpRecord';
|
|
2
|
+
/**
|
|
3
|
+
* Bridges an editable list of key/value rows with a persisted
|
|
4
|
+
* `Record<string, string>` (headers, query params…).
|
|
5
|
+
*
|
|
6
|
+
* Records can't hold a half-typed row (an empty key, or two rows mid-edit), so
|
|
7
|
+
* the rows are the local source of truth while editing. Every mutation is
|
|
8
|
+
* serialized back to a record — empty keys dropped, last wins on duplicates —
|
|
9
|
+
* and pushed up via `onChange`. The rows reseed from `record` only when it
|
|
10
|
+
* changes from the outside (a different node, a static↔api toggle), never in
|
|
11
|
+
* response to our own emit, so adding a blank row doesn't immediately vanish.
|
|
12
|
+
* The reseed happens during render (React's recommended pattern) rather than in
|
|
13
|
+
* an effect, so there's no extra commit/flash.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useKeyValueRows: (record: Record<string, string> | undefined, onChange: (record: Record<string, string>) => void) => readonly [KeyValueEntry[], (rows: KeyValueEntry[]) => void];
|
|
@@ -2,7 +2,7 @@ import { Edge, Node } from '@xyflow/react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { AIConfig } from './ai';
|
|
4
4
|
import { OpenApiDocument } from './openapi';
|
|
5
|
-
import { Flow,
|
|
5
|
+
import { Flow, HttpHeaders } from '../../shared/types/node';
|
|
6
6
|
export interface ExtraMenuItem {
|
|
7
7
|
/**
|
|
8
8
|
* Label displayed in the menu item.
|
|
@@ -99,26 +99,20 @@ export interface TreegeEditorProps {
|
|
|
99
99
|
* route resolution; otherwise this value is the base.
|
|
100
100
|
*/
|
|
101
101
|
baseUrl?: string;
|
|
102
|
-
/**
|
|
103
|
-
* @deprecated Use `baseUrl` instead — it now covers OpenAPI route resolution
|
|
104
|
-
* and the general runtime base. Kept as an alias for backward compatibility;
|
|
105
|
-
* `baseUrl` wins when both are set.
|
|
106
|
-
*/
|
|
107
|
-
openApiBaseUrl?: string;
|
|
108
102
|
/**
|
|
109
103
|
* Global HTTP headers applied to in-editor requests (e.g. the "Detect
|
|
110
104
|
* fields" button in `OptionsSourceForm`). Pass the same value you give to
|
|
111
105
|
* `TreegeRenderer` so editor-time previews use the same auth and headers
|
|
112
106
|
* that the runtime form will use.
|
|
113
107
|
*/
|
|
114
|
-
headers?:
|
|
108
|
+
headers?: HttpHeaders;
|
|
115
109
|
/**
|
|
116
110
|
* Called when the user submits the Authorize dialog. Receives the resulting
|
|
117
111
|
* HTTP headers (`Authorization`, API key headers…). The consumer is expected
|
|
118
112
|
* to forward those headers to `TreegeRenderer` (or `TreegeRendererProvider`)
|
|
119
113
|
* via its `headers` prop so every request issued by the form is authenticated.
|
|
120
114
|
*/
|
|
121
|
-
onAuthorize?: (headers:
|
|
115
|
+
onAuthorize?: (headers: HttpHeaders) => void;
|
|
122
116
|
/**
|
|
123
117
|
* Called whenever the user edits the global headers via the editor's
|
|
124
118
|
* built-in "Global headers" dialog. The component is controlled — the
|
|
@@ -126,5 +120,5 @@ export interface TreegeEditorProps {
|
|
|
126
120
|
* the new list back via the `headers` prop, so every editor-time and
|
|
127
121
|
* runtime request reflects the change.
|
|
128
122
|
*/
|
|
129
|
-
onHeadersChange?: (headers:
|
|
123
|
+
onHeadersChange?: (headers: HttpHeaders) => void;
|
|
130
124
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { Flow
|
|
1
|
+
import { Flow } from '../../shared/types/node';
|
|
2
|
+
import { KeyValueEntry } from '../../shared/utils/httpRecord';
|
|
2
3
|
/** True when a header key is known to carry credentials/secrets. */
|
|
3
4
|
export declare const isSensitiveHeaderKey: (key: string) => boolean;
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* True when the editor rows contain a sensitive header with a non-empty value.
|
|
7
|
+
* Operates on the form's working rows (which may still hold empty keys) rather
|
|
8
|
+
* than the serialized record, so the warning shows as soon as the user types.
|
|
9
|
+
*/
|
|
10
|
+
export declare const hasSensitiveHeader: (headers?: KeyValueEntry[]) => boolean;
|
|
6
11
|
/**
|
|
7
12
|
* Returns a copy of the flow with all credential-bearing field-level headers
|
|
8
13
|
* removed from every node's httpConfig/optionsSource/submitConfig, plus the
|