@shwfed/config 2.9.8 → 2.9.10
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/mcp.mjs +8 -0
- package/dist/module.json +1 -1
- package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-ByKzTJkK.js → FieldGroup.vue_vue_type_script_setup_true_lang-B_lv0Qb4.js} +1 -1
- package/dist/preview/assets/badge-DkCzSREV.js +1 -0
- package/dist/preview/assets/config-9Ny1em1E.js +1 -0
- package/dist/preview/assets/config-BO6oZNCA.js +1 -0
- package/dist/preview/assets/config-BQZZzdBi.js +1 -0
- package/dist/preview/assets/config-BzUZdTRZ.js +1 -0
- package/dist/preview/assets/config-CJYUWHSt.js +1 -0
- package/dist/preview/assets/config-CLszlI7X.js +1 -0
- package/dist/preview/assets/config-CfTdhIiz.js +1 -0
- package/dist/preview/assets/config-DG9kUyIX.js +1 -0
- package/dist/preview/assets/{config-DyqhZSFe.js → config-DcOjw4Ib.js} +1 -1
- package/dist/preview/assets/config-DnxWfe-p.js +1 -0
- package/dist/preview/assets/config-IAY_3DyY.js +1 -0
- package/dist/preview/assets/{config-B8qH4_4x.js → config-y0whCdxg.js} +1 -1
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-D6Dl1HG7.js +1 -0
- package/dist/preview/assets/{index-CWJ_W3Gk.js → index-BxEz7F0S.js} +1 -1
- package/dist/preview/assets/{index-C1wWjgLL.js → index-CEpio2Ai.js} +206 -189
- package/dist/preview/assets/index-DEk1Sey_.css +1 -0
- package/dist/preview/assets/index-eXjRNljQ.js +1 -0
- package/dist/preview/assets/item-BgY4KzDy.js +1 -0
- package/dist/preview/assets/runtime--G6ZYJWm.js +1 -0
- package/dist/preview/assets/runtime-74HxxB_6.js +1 -0
- package/dist/preview/assets/runtime-B0yAZrhv.js +1 -0
- package/dist/preview/assets/runtime-B1vIYtF_.js +1 -0
- package/dist/preview/assets/runtime-BrfrrA2a.js +1 -0
- package/dist/preview/assets/runtime-BweDVL2G.js +1 -0
- package/dist/preview/assets/runtime-C9L73GlB.js +1 -0
- package/dist/preview/assets/runtime-DIHeE12q.js +1 -0
- package/dist/preview/assets/runtime-DNCNcjrA.js +1 -0
- package/dist/preview/assets/runtime-ObPbN32X.js +1 -0
- package/dist/preview/assets/schema-meta-dmADcmVf.js +1 -0
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +10 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +10 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.d.ts +5 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +10 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +10 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +5 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.d.vue.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.vue.d.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +1 -0
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.d.vue.ts +8 -0
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue.d.ts +8 -0
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +4 -0
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.d.vue.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue.d.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.d.ts +1 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.d.vue.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.vue.d.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.d.ts +1 -0
- package/dist/runtime/components/actions/components/trigger-row-scope.d.vue.ts +17 -0
- package/dist/runtime/components/actions/components/trigger-row-scope.vue +15 -0
- package/dist/runtime/components/actions/components/trigger-row-scope.vue.d.ts +17 -0
- package/dist/runtime/components/actions/components/triggers-field.d.vue.ts +2 -0
- package/dist/runtime/components/actions/components/triggers-field.vue +29 -7
- package/dist/runtime/components/actions/components/triggers-field.vue.d.ts +2 -0
- package/dist/runtime/components/config/index.vue +5 -1
- package/dist/runtime/components/config/schema.d.ts +5 -0
- package/dist/runtime/components/config/schema.js +10 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +8 -8
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +8 -8
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +8 -8
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +8 -8
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/config.d.vue.ts +33 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/config.vue +130 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/config.vue.d.ts +33 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/runtime.d.ts +2 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/runtime.js +55 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.d.ts +23 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js +79 -0
- package/dist/runtime/components/operations/utils/resolve.d.ts +16 -1
- package/dist/runtime/components/operations/utils/resolve.js +1 -1
- package/dist/runtime/components/operations/utils/step-vars.d.ts +22 -0
- package/dist/runtime/components/operations/utils/step-vars.js +12 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +2 -0
- package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.d.vue.ts +2 -0
- package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue +9 -1
- package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue.d.ts +2 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +2 -2
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +33 -4
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +2 -2
- package/dist/runtime/components/ui/expression-editor/picker-entries.d.ts +3 -2
- package/dist/runtime/components/ui/expression-editor/picker-entries.js +13 -2
- package/dist/runtime/components/ui/expression-editor/step-chip-extension.d.ts +5 -0
- package/dist/runtime/components/ui/expression-editor/step-chip-extension.js +132 -0
- package/dist/runtime/components/ui/expression-editor/step-refs.d.ts +17 -0
- package/dist/runtime/components/ui/expression-editor/step-refs.js +29 -0
- package/dist/runtime/share/event-bus.d.ts +34 -1
- package/dist/runtime/share/event-bus.js +28 -11
- package/dist/runtime/utils/cel-context.d.ts +35 -0
- package/dist/runtime/utils/cel-context.js +8 -0
- package/package.json +1 -1
- package/dist/preview/assets/badge-Dq4c6LC9.js +0 -1
- package/dist/preview/assets/config-BBGDw3Em.js +0 -1
- package/dist/preview/assets/config-C32gE_z0.js +0 -1
- package/dist/preview/assets/config-COfUny1G.js +0 -1
- package/dist/preview/assets/config-CVPTjqGi.js +0 -1
- package/dist/preview/assets/config-CgdFXkLJ.js +0 -1
- package/dist/preview/assets/config-DNr8rSLw.js +0 -1
- package/dist/preview/assets/config-DVEOLj6d.js +0 -1
- package/dist/preview/assets/config-DpRJqJ1d.js +0 -1
- package/dist/preview/assets/config-Dvqs3X3R.js +0 -1
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-B0MHEyHj.js +0 -1
- package/dist/preview/assets/index-Br3FtCu2.js +0 -1
- package/dist/preview/assets/index-C1h9lV52.css +0 -1
- package/dist/preview/assets/item-Bp81qizC.js +0 -1
- package/dist/preview/assets/runtime-AHwg8SCY.js +0 -1
- package/dist/preview/assets/runtime-BHWdj0nM.js +0 -1
- package/dist/preview/assets/runtime-Be6zYys6.js +0 -1
- package/dist/preview/assets/runtime-CKj3_07G.js +0 -1
- package/dist/preview/assets/runtime-CVIZYrHD.js +0 -1
- package/dist/preview/assets/runtime-C_F9tcxh.js +0 -1
- package/dist/preview/assets/runtime-DNHuKamx.js +0 -1
- package/dist/preview/assets/runtime-DambLtyb.js +0 -1
- package/dist/preview/assets/runtime-DqkDOQp2.js +0 -1
- package/dist/preview/assets/runtime-UVi5ssie.js +0 -1
|
@@ -22,6 +22,11 @@ export declare const metadata: {
|
|
|
22
22
|
readonly compatibilityDate: "2026-06-09";
|
|
23
23
|
readonly name: "确认弹窗";
|
|
24
24
|
readonly icon: "fluent:chat-warning-20-regular";
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "com.shwfed.operation.http.request.json";
|
|
27
|
+
readonly compatibilityDate: "2026-06-11";
|
|
28
|
+
readonly name: "发送请求";
|
|
29
|
+
readonly icon: "fluent:cloud-arrow-up-20-regular";
|
|
25
30
|
}];
|
|
26
31
|
};
|
|
27
32
|
export declare function PageConfig(configure: (env: Environment) => void): Schema.Struct<{
|
|
@@ -2,6 +2,7 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { Expression, Slot, defaultSlot } from "../../share/layout.js";
|
|
3
3
|
import { Locale } from "../../share/locale.js";
|
|
4
4
|
import * as alertOperation from "../operations/2026-06-09/com.shwfed.operation.alert/schema.js";
|
|
5
|
+
import * as httpRequestOperation from "../operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js";
|
|
5
6
|
import { blockRef } from "./utils/resolve.js";
|
|
6
7
|
export { getStructFieldDescription, getStructFieldTitle } from "../table/utils/schema-meta.js";
|
|
7
8
|
const KIND = "shwfed.component.page";
|
|
@@ -19,6 +20,15 @@ export const metadata = {
|
|
|
19
20
|
compatibilityDate: alertOperation.compatibilityDate,
|
|
20
21
|
name: alertOperation.metadata.name,
|
|
21
22
|
icon: alertOperation.metadata.icon
|
|
23
|
+
},
|
|
24
|
+
// Ambient HTTP request — one step of a trigger chain, so a button can
|
|
25
|
+
// sequence several requests (each failure halts the rest). The page hosts
|
|
26
|
+
// it because the request acts on nothing instance-specific.
|
|
27
|
+
{
|
|
28
|
+
id: httpRequestOperation.type,
|
|
29
|
+
compatibilityDate: httpRequestOperation.compatibilityDate,
|
|
30
|
+
name: httpRequestOperation.metadata.name,
|
|
31
|
+
icon: httpRequestOperation.metadata.icon
|
|
22
32
|
}
|
|
23
33
|
]
|
|
24
34
|
};
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
27
|
readonly max?: string | undefined;
|
|
28
28
|
readonly compatibilityDate: "2026-04-28";
|
|
29
|
+
readonly step?: number | undefined;
|
|
29
30
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
30
31
|
readonly placeholder?: readonly [{
|
|
31
32
|
readonly locale: "zh";
|
|
@@ -35,13 +36,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
35
36
|
readonly message: string;
|
|
36
37
|
}[]] | undefined;
|
|
37
38
|
readonly min?: string | undefined;
|
|
38
|
-
readonly step?: number | undefined;
|
|
39
39
|
readonly readonly?: string | undefined;
|
|
40
40
|
readonly binding?: string | undefined;
|
|
41
41
|
readonly derived?: {
|
|
42
42
|
readonly mode: "formula" | "prefill";
|
|
43
43
|
readonly expression: string;
|
|
44
44
|
} | undefined;
|
|
45
|
+
readonly precision?: number | undefined;
|
|
46
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
47
|
+
readonly valueAsString?: boolean | undefined;
|
|
45
48
|
readonly validations?: readonly {
|
|
46
49
|
readonly message: readonly [{
|
|
47
50
|
readonly locale: "zh";
|
|
@@ -53,9 +56,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
56
|
readonly warning?: boolean | undefined;
|
|
54
57
|
readonly when: string;
|
|
55
58
|
}[] | undefined;
|
|
56
|
-
readonly precision?: number | undefined;
|
|
57
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
58
|
-
readonly valueAsString?: boolean | undefined;
|
|
59
59
|
}) => any;
|
|
60
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
61
61
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -81,6 +81,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
81
81
|
readonly displayName?: string | undefined;
|
|
82
82
|
readonly max?: string | undefined;
|
|
83
83
|
readonly compatibilityDate: "2026-04-28";
|
|
84
|
+
readonly step?: number | undefined;
|
|
84
85
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
85
86
|
readonly placeholder?: readonly [{
|
|
86
87
|
readonly locale: "zh";
|
|
@@ -90,13 +91,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
90
91
|
readonly message: string;
|
|
91
92
|
}[]] | undefined;
|
|
92
93
|
readonly min?: string | undefined;
|
|
93
|
-
readonly step?: number | undefined;
|
|
94
94
|
readonly readonly?: string | undefined;
|
|
95
95
|
readonly binding?: string | undefined;
|
|
96
96
|
readonly derived?: {
|
|
97
97
|
readonly mode: "formula" | "prefill";
|
|
98
98
|
readonly expression: string;
|
|
99
99
|
} | undefined;
|
|
100
|
+
readonly precision?: number | undefined;
|
|
101
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
102
|
+
readonly valueAsString?: boolean | undefined;
|
|
100
103
|
readonly validations?: readonly {
|
|
101
104
|
readonly message: readonly [{
|
|
102
105
|
readonly locale: "zh";
|
|
@@ -108,9 +111,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
111
|
readonly warning?: boolean | undefined;
|
|
109
112
|
readonly when: string;
|
|
110
113
|
}[] | undefined;
|
|
111
|
-
readonly precision?: number | undefined;
|
|
112
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
113
|
-
readonly valueAsString?: boolean | undefined;
|
|
114
114
|
}) => any) | undefined;
|
|
115
115
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
116
116
|
declare const _default: typeof __VLS_export;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
27
|
readonly max?: string | undefined;
|
|
28
28
|
readonly compatibilityDate: "2026-04-28";
|
|
29
|
+
readonly step?: number | undefined;
|
|
29
30
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
30
31
|
readonly placeholder?: readonly [{
|
|
31
32
|
readonly locale: "zh";
|
|
@@ -35,13 +36,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
35
36
|
readonly message: string;
|
|
36
37
|
}[]] | undefined;
|
|
37
38
|
readonly min?: string | undefined;
|
|
38
|
-
readonly step?: number | undefined;
|
|
39
39
|
readonly readonly?: string | undefined;
|
|
40
40
|
readonly binding?: string | undefined;
|
|
41
41
|
readonly derived?: {
|
|
42
42
|
readonly mode: "formula" | "prefill";
|
|
43
43
|
readonly expression: string;
|
|
44
44
|
} | undefined;
|
|
45
|
+
readonly precision?: number | undefined;
|
|
46
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
47
|
+
readonly valueAsString?: boolean | undefined;
|
|
45
48
|
readonly validations?: readonly {
|
|
46
49
|
readonly message: readonly [{
|
|
47
50
|
readonly locale: "zh";
|
|
@@ -53,9 +56,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
56
|
readonly warning?: boolean | undefined;
|
|
54
57
|
readonly when: string;
|
|
55
58
|
}[] | undefined;
|
|
56
|
-
readonly precision?: number | undefined;
|
|
57
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
58
|
-
readonly valueAsString?: boolean | undefined;
|
|
59
59
|
}) => any;
|
|
60
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
61
61
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -81,6 +81,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
81
81
|
readonly displayName?: string | undefined;
|
|
82
82
|
readonly max?: string | undefined;
|
|
83
83
|
readonly compatibilityDate: "2026-04-28";
|
|
84
|
+
readonly step?: number | undefined;
|
|
84
85
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
85
86
|
readonly placeholder?: readonly [{
|
|
86
87
|
readonly locale: "zh";
|
|
@@ -90,13 +91,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
90
91
|
readonly message: string;
|
|
91
92
|
}[]] | undefined;
|
|
92
93
|
readonly min?: string | undefined;
|
|
93
|
-
readonly step?: number | undefined;
|
|
94
94
|
readonly readonly?: string | undefined;
|
|
95
95
|
readonly binding?: string | undefined;
|
|
96
96
|
readonly derived?: {
|
|
97
97
|
readonly mode: "formula" | "prefill";
|
|
98
98
|
readonly expression: string;
|
|
99
99
|
} | undefined;
|
|
100
|
+
readonly precision?: number | undefined;
|
|
101
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
102
|
+
readonly valueAsString?: boolean | undefined;
|
|
100
103
|
readonly validations?: readonly {
|
|
101
104
|
readonly message: readonly [{
|
|
102
105
|
readonly locale: "zh";
|
|
@@ -108,9 +111,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
111
|
readonly warning?: boolean | undefined;
|
|
109
112
|
readonly when: string;
|
|
110
113
|
}[] | undefined;
|
|
111
|
-
readonly precision?: number | undefined;
|
|
112
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
113
|
-
readonly valueAsString?: boolean | undefined;
|
|
114
114
|
}) => any) | undefined;
|
|
115
115
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
116
116
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
27
|
readonly max?: string | undefined;
|
|
28
28
|
readonly compatibilityDate: "2026-04-28";
|
|
29
|
+
readonly step?: number | undefined;
|
|
29
30
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
30
31
|
readonly min?: string | undefined;
|
|
31
|
-
readonly step?: number | undefined;
|
|
32
32
|
readonly readonly?: string | undefined;
|
|
33
33
|
readonly binding?: string | readonly [string, string] | undefined;
|
|
34
34
|
readonly derived?: {
|
|
@@ -50,6 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
50
|
readonly locale: "en" | "ja" | "ko";
|
|
51
51
|
readonly message: string;
|
|
52
52
|
}[]] | undefined;
|
|
53
|
+
readonly precision?: number | undefined;
|
|
54
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
55
|
+
readonly valueAsString?: boolean | undefined;
|
|
53
56
|
readonly validations?: readonly {
|
|
54
57
|
readonly message: readonly [{
|
|
55
58
|
readonly locale: "zh";
|
|
@@ -61,9 +64,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
61
64
|
readonly warning?: boolean | undefined;
|
|
62
65
|
readonly when: string;
|
|
63
66
|
}[] | undefined;
|
|
64
|
-
readonly precision?: number | undefined;
|
|
65
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
66
|
-
readonly valueAsString?: boolean | undefined;
|
|
67
67
|
}) => any;
|
|
68
68
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
69
69
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -89,9 +89,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
89
|
readonly displayName?: string | undefined;
|
|
90
90
|
readonly max?: string | undefined;
|
|
91
91
|
readonly compatibilityDate: "2026-04-28";
|
|
92
|
+
readonly step?: number | undefined;
|
|
92
93
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
93
94
|
readonly min?: string | undefined;
|
|
94
|
-
readonly step?: number | undefined;
|
|
95
95
|
readonly readonly?: string | undefined;
|
|
96
96
|
readonly binding?: string | readonly [string, string] | undefined;
|
|
97
97
|
readonly derived?: {
|
|
@@ -113,6 +113,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
113
113
|
readonly locale: "en" | "ja" | "ko";
|
|
114
114
|
readonly message: string;
|
|
115
115
|
}[]] | undefined;
|
|
116
|
+
readonly precision?: number | undefined;
|
|
117
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
118
|
+
readonly valueAsString?: boolean | undefined;
|
|
116
119
|
readonly validations?: readonly {
|
|
117
120
|
readonly message: readonly [{
|
|
118
121
|
readonly locale: "zh";
|
|
@@ -124,9 +127,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
124
127
|
readonly warning?: boolean | undefined;
|
|
125
128
|
readonly when: string;
|
|
126
129
|
}[] | undefined;
|
|
127
|
-
readonly precision?: number | undefined;
|
|
128
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
129
|
-
readonly valueAsString?: boolean | undefined;
|
|
130
130
|
}) => any) | undefined;
|
|
131
131
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
132
132
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
27
|
readonly max?: string | undefined;
|
|
28
28
|
readonly compatibilityDate: "2026-04-28";
|
|
29
|
+
readonly step?: number | undefined;
|
|
29
30
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
30
31
|
readonly min?: string | undefined;
|
|
31
|
-
readonly step?: number | undefined;
|
|
32
32
|
readonly readonly?: string | undefined;
|
|
33
33
|
readonly binding?: string | readonly [string, string] | undefined;
|
|
34
34
|
readonly derived?: {
|
|
@@ -50,6 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
50
|
readonly locale: "en" | "ja" | "ko";
|
|
51
51
|
readonly message: string;
|
|
52
52
|
}[]] | undefined;
|
|
53
|
+
readonly precision?: number | undefined;
|
|
54
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
55
|
+
readonly valueAsString?: boolean | undefined;
|
|
53
56
|
readonly validations?: readonly {
|
|
54
57
|
readonly message: readonly [{
|
|
55
58
|
readonly locale: "zh";
|
|
@@ -61,9 +64,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
61
64
|
readonly warning?: boolean | undefined;
|
|
62
65
|
readonly when: string;
|
|
63
66
|
}[] | undefined;
|
|
64
|
-
readonly precision?: number | undefined;
|
|
65
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
66
|
-
readonly valueAsString?: boolean | undefined;
|
|
67
67
|
}) => any;
|
|
68
68
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
69
69
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -89,9 +89,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
89
|
readonly displayName?: string | undefined;
|
|
90
90
|
readonly max?: string | undefined;
|
|
91
91
|
readonly compatibilityDate: "2026-04-28";
|
|
92
|
+
readonly step?: number | undefined;
|
|
92
93
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
93
94
|
readonly min?: string | undefined;
|
|
94
|
-
readonly step?: number | undefined;
|
|
95
95
|
readonly readonly?: string | undefined;
|
|
96
96
|
readonly binding?: string | readonly [string, string] | undefined;
|
|
97
97
|
readonly derived?: {
|
|
@@ -113,6 +113,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
113
113
|
readonly locale: "en" | "ja" | "ko";
|
|
114
114
|
readonly message: string;
|
|
115
115
|
}[]] | undefined;
|
|
116
|
+
readonly precision?: number | undefined;
|
|
117
|
+
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
118
|
+
readonly valueAsString?: boolean | undefined;
|
|
116
119
|
readonly validations?: readonly {
|
|
117
120
|
readonly message: readonly [{
|
|
118
121
|
readonly locale: "zh";
|
|
@@ -124,9 +127,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
124
127
|
readonly warning?: boolean | undefined;
|
|
125
128
|
readonly when: string;
|
|
126
129
|
}[] | undefined;
|
|
127
|
-
readonly precision?: number | undefined;
|
|
128
|
-
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
129
|
-
readonly valueAsString?: boolean | undefined;
|
|
130
130
|
}) => any) | undefined;
|
|
131
131
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
132
132
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly description?: readonly [{
|
|
8
|
+
readonly locale: "zh";
|
|
9
|
+
readonly message: string;
|
|
10
|
+
}, ...{
|
|
11
|
+
readonly locale: "en" | "ja" | "ko";
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}[]] | undefined;
|
|
14
|
+
readonly resultExpression?: string | undefined;
|
|
15
|
+
readonly expression: string;
|
|
16
|
+
readonly titleExpression?: string | undefined;
|
|
17
|
+
}) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: {
|
|
20
|
+
readonly description?: readonly [{
|
|
21
|
+
readonly locale: "zh";
|
|
22
|
+
readonly message: string;
|
|
23
|
+
}, ...{
|
|
24
|
+
readonly locale: "en" | "ja" | "ko";
|
|
25
|
+
readonly message: string;
|
|
26
|
+
}[]] | undefined;
|
|
27
|
+
readonly resultExpression?: string | undefined;
|
|
28
|
+
readonly expression: string;
|
|
29
|
+
readonly titleExpression?: string | undefined;
|
|
30
|
+
}) => any) | undefined;
|
|
31
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ExpressionEditor } from "../../../ui/expression-editor";
|
|
3
|
+
import { Field, FieldGroup, FieldLabel } from "../../../ui/field";
|
|
4
|
+
import { Locale as LocaleField } from "../../../ui/locale";
|
|
5
|
+
import { Markdown } from "../../../ui/markdown";
|
|
6
|
+
import { getStructFieldDescription, getStructFieldTitle } from "../../../../share/schema-meta";
|
|
7
|
+
import { schema } from "./schema";
|
|
8
|
+
defineOptions({ name: "ShwfedHttpRequestOperationConfig" });
|
|
9
|
+
const value = defineModel({ type: null, ...{ required: true } });
|
|
10
|
+
const opSchema = schema(() => {
|
|
11
|
+
});
|
|
12
|
+
const fieldTitle = (f) => getStructFieldTitle(opSchema, f) ?? f;
|
|
13
|
+
const fieldDescription = (f) => getStructFieldDescription(opSchema, f);
|
|
14
|
+
const JSON_VAR = { json: { type: "dyn", label: "HTTP \u54CD\u5E94" } };
|
|
15
|
+
const OUTCOME_VARS = {
|
|
16
|
+
json: { type: "dyn", label: "HTTP \u54CD\u5E94" },
|
|
17
|
+
result: { type: "string", label: "\u6267\u884C\u7ED3\u679C" }
|
|
18
|
+
};
|
|
19
|
+
function patch(patchValue) {
|
|
20
|
+
const next = { ...value.value, ...patchValue };
|
|
21
|
+
for (const [k, v] of Object.entries(patchValue)) {
|
|
22
|
+
if (v === void 0) Reflect.deleteProperty(next, k);
|
|
23
|
+
}
|
|
24
|
+
value.value = next;
|
|
25
|
+
}
|
|
26
|
+
function patchOptionalExpression(key, v) {
|
|
27
|
+
patch({ [key]: v.length === 0 ? void 0 : v });
|
|
28
|
+
}
|
|
29
|
+
function patchDescription(v) {
|
|
30
|
+
const blank = v.every((entry) => entry.message.trim().length === 0);
|
|
31
|
+
patch({ description: blank ? void 0 : v });
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<FieldGroup>
|
|
37
|
+
<Field orientation="vertical">
|
|
38
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
39
|
+
<template
|
|
40
|
+
v-if="fieldDescription('expression')"
|
|
41
|
+
#tooltip
|
|
42
|
+
>
|
|
43
|
+
<Markdown
|
|
44
|
+
:source="fieldDescription('expression')"
|
|
45
|
+
block
|
|
46
|
+
class="prose prose-sm prose-zinc"
|
|
47
|
+
/>
|
|
48
|
+
</template>
|
|
49
|
+
{{ fieldTitle("expression") }}
|
|
50
|
+
</FieldLabel>
|
|
51
|
+
<ExpressionEditor
|
|
52
|
+
:model-value="value.expression"
|
|
53
|
+
multiline
|
|
54
|
+
placeholder="例:http.post('/api/foo').body({ id: row.id })"
|
|
55
|
+
result-type="HttpRequest"
|
|
56
|
+
class="min-h-16"
|
|
57
|
+
@update:model-value="(v) => patch({ expression: v })"
|
|
58
|
+
/>
|
|
59
|
+
</Field>
|
|
60
|
+
|
|
61
|
+
<div class="grid grid-cols-2 gap-4">
|
|
62
|
+
<Field orientation="vertical">
|
|
63
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
64
|
+
<template
|
|
65
|
+
v-if="fieldDescription('resultExpression')"
|
|
66
|
+
#tooltip
|
|
67
|
+
>
|
|
68
|
+
<Markdown
|
|
69
|
+
:source="fieldDescription('resultExpression')"
|
|
70
|
+
block
|
|
71
|
+
class="prose prose-sm prose-zinc"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
{{ fieldTitle("resultExpression") }}
|
|
75
|
+
</FieldLabel>
|
|
76
|
+
<ExpressionEditor
|
|
77
|
+
:model-value="value.resultExpression ?? ''"
|
|
78
|
+
placeholder="例:json.code == 0 ? 'success' : 'error'"
|
|
79
|
+
result-type="string"
|
|
80
|
+
:extra-vars="JSON_VAR"
|
|
81
|
+
@update:model-value="(v) => patchOptionalExpression('resultExpression', v)"
|
|
82
|
+
/>
|
|
83
|
+
</Field>
|
|
84
|
+
|
|
85
|
+
<Field orientation="vertical">
|
|
86
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
87
|
+
<template
|
|
88
|
+
v-if="fieldDescription('titleExpression')"
|
|
89
|
+
#tooltip
|
|
90
|
+
>
|
|
91
|
+
<Markdown
|
|
92
|
+
:source="fieldDescription('titleExpression')"
|
|
93
|
+
block
|
|
94
|
+
class="prose prose-sm prose-zinc"
|
|
95
|
+
/>
|
|
96
|
+
</template>
|
|
97
|
+
{{ fieldTitle("titleExpression") }}
|
|
98
|
+
</FieldLabel>
|
|
99
|
+
<ExpressionEditor
|
|
100
|
+
:model-value="value.titleExpression ?? ''"
|
|
101
|
+
placeholder="例:result == 'error' ? '保存失败' : '保存成功'"
|
|
102
|
+
result-type="string"
|
|
103
|
+
:extra-vars="OUTCOME_VARS"
|
|
104
|
+
@update:model-value="(v) => patchOptionalExpression('titleExpression', v)"
|
|
105
|
+
/>
|
|
106
|
+
</Field>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<Field orientation="vertical">
|
|
110
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
111
|
+
<template
|
|
112
|
+
v-if="fieldDescription('description')"
|
|
113
|
+
#tooltip
|
|
114
|
+
>
|
|
115
|
+
<Markdown
|
|
116
|
+
:source="fieldDescription('description')"
|
|
117
|
+
block
|
|
118
|
+
class="prose prose-sm prose-zinc"
|
|
119
|
+
/>
|
|
120
|
+
</template>
|
|
121
|
+
{{ fieldTitle("description") }}
|
|
122
|
+
</FieldLabel>
|
|
123
|
+
<LocaleField
|
|
124
|
+
markdown
|
|
125
|
+
:model-value="value.description"
|
|
126
|
+
@update:model-value="(v) => patchDescription(v)"
|
|
127
|
+
/>
|
|
128
|
+
</Field>
|
|
129
|
+
</FieldGroup>
|
|
130
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly description?: readonly [{
|
|
8
|
+
readonly locale: "zh";
|
|
9
|
+
readonly message: string;
|
|
10
|
+
}, ...{
|
|
11
|
+
readonly locale: "en" | "ja" | "ko";
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}[]] | undefined;
|
|
14
|
+
readonly resultExpression?: string | undefined;
|
|
15
|
+
readonly expression: string;
|
|
16
|
+
readonly titleExpression?: string | undefined;
|
|
17
|
+
}) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: {
|
|
20
|
+
readonly description?: readonly [{
|
|
21
|
+
readonly locale: "zh";
|
|
22
|
+
readonly message: string;
|
|
23
|
+
}, ...{
|
|
24
|
+
readonly locale: "en" | "ja" | "ko";
|
|
25
|
+
readonly message: string;
|
|
26
|
+
}[]] | undefined;
|
|
27
|
+
readonly resultExpression?: string | undefined;
|
|
28
|
+
readonly expression: string;
|
|
29
|
+
readonly titleExpression?: string | undefined;
|
|
30
|
+
}) => any) | undefined;
|
|
31
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Effect, Either, Option } from "effect";
|
|
2
|
+
import { Fetch } from "fx-fetch";
|
|
3
|
+
import { toast } from "vue-sonner";
|
|
4
|
+
import { asRequest } from "../../../../share/request.js";
|
|
5
|
+
import { getLocalizedText } from "../../../../share/locale.js";
|
|
6
|
+
import { interpolateMarkdown } from "../../../../share/interpolate.js";
|
|
7
|
+
class HttpRequestHalted {
|
|
8
|
+
constructor(reason) {
|
|
9
|
+
this.reason = reason;
|
|
10
|
+
}
|
|
11
|
+
_tag = "HttpRequestHalted";
|
|
12
|
+
}
|
|
13
|
+
const TOAST_STYLES = /* @__PURE__ */ new Set(["success", "error", "warning", "info"]);
|
|
14
|
+
export const handler = (params, ctx) => {
|
|
15
|
+
const { expression, resultExpression, titleExpression, description } = params ?? {};
|
|
16
|
+
if (!expression || expression.trim().length === 0) return Effect.void;
|
|
17
|
+
const program = Effect.gen(function* () {
|
|
18
|
+
const steps = ctx.step?.outputs() ?? {};
|
|
19
|
+
const evaluated = yield* ctx.cel(expression, { steps });
|
|
20
|
+
const request = asRequest(evaluated);
|
|
21
|
+
if (Option.isNone(request)) return;
|
|
22
|
+
const outcome = yield* Effect.either(request.value.json());
|
|
23
|
+
const json = Either.isRight(outcome) ? outcome.right : null;
|
|
24
|
+
if (Either.isRight(outcome)) ctx.step?.publish(json);
|
|
25
|
+
const result = Either.isLeft(outcome) ? "error" : resultExpression === void 0 ? "success" : yield* ctx.cel(resultExpression, { json, steps });
|
|
26
|
+
const kind = TOAST_STYLES.has(result) ? result : "success";
|
|
27
|
+
if (titleExpression !== void 0) {
|
|
28
|
+
const title = yield* ctx.cel(titleExpression, { json, result, steps });
|
|
29
|
+
const raw = getLocalizedText(description, ctx.locale()) ?? "";
|
|
30
|
+
const body = raw.length === 0 ? void 0 : interpolateMarkdown(raw, ctx.cel, { json, result, steps });
|
|
31
|
+
toast[kind](title, body === void 0 ? void 0 : { description: body });
|
|
32
|
+
}
|
|
33
|
+
if (Either.isLeft(outcome)) {
|
|
34
|
+
if (import.meta.dev) console.warn("[shwfed-operations] http request failed", outcome.left);
|
|
35
|
+
return yield* Effect.die(new HttpRequestHalted(outcome.left));
|
|
36
|
+
}
|
|
37
|
+
if (kind === "error") return yield* Effect.die(new HttpRequestHalted("error result"));
|
|
38
|
+
});
|
|
39
|
+
return program.pipe(
|
|
40
|
+
// The bus's handler contract has no requirements channel, so the host
|
|
41
|
+
// can't thread a Fetch layer through — the op provides its own, same layer
|
|
42
|
+
// the button runner uses.
|
|
43
|
+
Effect.provide(Fetch.layer),
|
|
44
|
+
// What remains on the error channel is CEL evaluation failure (request /
|
|
45
|
+
// result / title expression) — a config bug, not a runtime outcome. Mirror
|
|
46
|
+
// the button runner: silent in prod, console in dev; the chain still
|
|
47
|
+
// halts so later requests don't fire off a broken step.
|
|
48
|
+
Effect.catchAll((error) => Effect.zipRight(
|
|
49
|
+
Effect.sync(() => {
|
|
50
|
+
if (import.meta.dev) console.warn("[shwfed-operations] http request op failed", error);
|
|
51
|
+
}),
|
|
52
|
+
Effect.die(new HttpRequestHalted(error))
|
|
53
|
+
))
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Environment } from '../../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
export declare const type: "com.shwfed.operation.http.request.json";
|
|
4
|
+
export declare const compatibilityDate: "2026-06-11";
|
|
5
|
+
export declare const metadata: {
|
|
6
|
+
readonly name: "发送请求";
|
|
7
|
+
readonly icon: "fluent:cloud-arrow-up-20-regular";
|
|
8
|
+
readonly output: "HTTP 响应(解析后的 JSON)";
|
|
9
|
+
};
|
|
10
|
+
export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
|
|
11
|
+
expression: Schema.Schema<string, string, never>;
|
|
12
|
+
resultExpression: Schema.optional<Schema.Schema<string, string, never>>;
|
|
13
|
+
titleExpression: Schema.optional<Schema.Schema<string, string, never>>;
|
|
14
|
+
description: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
15
|
+
locale: Schema.Literal<["zh"]>;
|
|
16
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
17
|
+
}>], [Schema.Struct<{
|
|
18
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
19
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
20
|
+
}>]>>;
|
|
21
|
+
}>;
|
|
22
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
23
|
+
export declare function defaults(): Partial<Value>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Expression } from "../../../../share/expression.js";
|
|
3
|
+
import { Locale } from "../../../../share/locale.js";
|
|
4
|
+
import { md } from "../../../../share/markdown.js";
|
|
5
|
+
import { registerStepsVariableIfAbsent } from "../../utils/step-vars.js";
|
|
6
|
+
export const type = "com.shwfed.operation.http.request.json";
|
|
7
|
+
export const compatibilityDate = "2026-06-11";
|
|
8
|
+
export const metadata = {
|
|
9
|
+
name: "\u53D1\u9001\u8BF7\u6C42",
|
|
10
|
+
icon: "fluent:cloud-arrow-up-20-regular",
|
|
11
|
+
// This op publishes its parsed response as a chain-step output, so later
|
|
12
|
+
// trigger rows can reference it via `steps["<row-id>"]`.
|
|
13
|
+
output: "HTTP \u54CD\u5E94\uFF08\u89E3\u6790\u540E\u7684 JSON\uFF09"
|
|
14
|
+
};
|
|
15
|
+
export function schema(configure) {
|
|
16
|
+
const withSteps = (env) => {
|
|
17
|
+
configure(env);
|
|
18
|
+
registerStepsVariableIfAbsent(env);
|
|
19
|
+
};
|
|
20
|
+
const CelHttpRequest = Expression({ configure: withSteps, resultType: "HttpRequest" });
|
|
21
|
+
const withJson = (env) => {
|
|
22
|
+
withSteps(env);
|
|
23
|
+
env.registerVariable("json", "dyn", {
|
|
24
|
+
description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09"
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const CelResultString = Expression({ configure: withJson, resultType: "string" });
|
|
28
|
+
const withOutcome = (env) => {
|
|
29
|
+
withSteps(env);
|
|
30
|
+
env.registerVariable("json", "dyn", {
|
|
31
|
+
description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF1B\u8BF7\u6C42\u5931\u8D25\u65F6\u4E3A null\uFF09"
|
|
32
|
+
});
|
|
33
|
+
env.registerVariable("result", "string", {
|
|
34
|
+
description: "\u300C\u6267\u884C\u7ED3\u679C\u300D\u8868\u8FBE\u5F0F\u7684\u503C\uFF08\u8BF7\u6C42\u5931\u8D25\u65F6\u4E3A error\uFF09"
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const CelToastString = Expression({ configure: withOutcome, resultType: "string" });
|
|
38
|
+
return Schema.Struct({
|
|
39
|
+
expression: CelHttpRequest.annotations({
|
|
40
|
+
title: "\u8BF7\u6C42",
|
|
41
|
+
description: md`
|
|
42
|
+
构造一个请求,服务器须返回 JSON 响应。
|
|
43
|
+
`
|
|
44
|
+
}),
|
|
45
|
+
resultExpression: Schema.optional(CelResultString.annotations({
|
|
46
|
+
title: "\u6267\u884C\u7ED3\u679C",
|
|
47
|
+
description: md`
|
|
48
|
+
需返回 \`'success' | 'warning' | 'error' | 'info'\` 中的**一个**。
|
|
49
|
+
|
|
50
|
+
网络错误等情况下,按 \`error\` 处理。
|
|
51
|
+
`
|
|
52
|
+
})),
|
|
53
|
+
titleExpression: Schema.optional(CelToastString.annotations({
|
|
54
|
+
title: "\u63D0\u793A\u6807\u9898",
|
|
55
|
+
description: md`
|
|
56
|
+
配置后,作为提示的标题向用户展示。
|
|
57
|
+
`
|
|
58
|
+
})),
|
|
59
|
+
description: Schema.optional(Locale.annotations({
|
|
60
|
+
title: "\u63D0\u793A\u5185\u5BB9",
|
|
61
|
+
description: md`
|
|
62
|
+
配置后,作为提示的内容向用户展示。
|
|
63
|
+
`
|
|
64
|
+
}))
|
|
65
|
+
}).annotations({
|
|
66
|
+
title: "HttpRequestOperation",
|
|
67
|
+
description: md`
|
|
68
|
+
发起一次 HTTP 请求(响应解析为 JSON)。请求失败(网络错误 / 非 2xx / 响应不可解析)
|
|
69
|
+
或「执行结果」为 \`error\` 时中止本次触发链。在触发列表中串联多个本操作即可按顺序
|
|
70
|
+
调用多个接口——前一个失败后,后续操作不再执行。后面的步骤可经 \`steps["<步骤标识>"]\`
|
|
71
|
+
引用前面步骤的响应。
|
|
72
|
+
|
|
73
|
+
toast 完全由「提示标题」「提示内容」决定(含失败场景);不配置标题则静默。
|
|
74
|
+
`
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export function defaults() {
|
|
78
|
+
return { expression: "" };
|
|
79
|
+
}
|