@shwfed/config 2.7.6 → 2.7.8

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.
Files changed (111) hide show
  1. package/dist/mcp.mjs +165 -52
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/badge-KAEXz3VO.js +1 -0
  4. package/dist/preview/assets/{config-C947O8za.js → config-BXx5syNf.js} +1 -1
  5. package/dist/preview/assets/{config-DhAntnE5.js → config-Bb9Yeh33.js} +1 -1
  6. package/dist/preview/assets/config-C-QRPeN1.js +1 -0
  7. package/dist/preview/assets/config-CkKx7sVR.js +1 -0
  8. package/dist/preview/assets/config-CtbYlZCL.js +1 -0
  9. package/dist/preview/assets/{config-Bl8L6943.js → config-DPlbFBRi.js} +1 -1
  10. package/dist/preview/assets/config-DbfJWa8K.js +1 -0
  11. package/dist/preview/assets/{config-DppExb4h.js → config-DbirfZyy.js} +1 -1
  12. package/dist/preview/assets/{config-B7hXY5FF.js → config-ZczGik30.js} +1 -1
  13. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-CQ6MUPKO.js +1 -0
  14. package/dist/preview/assets/{index-DiC1rvCq.js → index-Bv_aA34a.js} +1 -1
  15. package/dist/preview/assets/{index-B0PL01fm.css → index-C9P-6gZd.css} +1 -1
  16. package/dist/preview/assets/index-CJFU9znN.js +1 -0
  17. package/dist/preview/assets/index-DUOkekYu.js +680 -0
  18. package/dist/preview/assets/item-SC0WQMVu.js +1 -0
  19. package/dist/preview/assets/{runtime-DmV_M4B_.js → runtime-BPOf7Yqz.js} +1 -1
  20. package/dist/preview/assets/runtime-CC2caFS9.js +1 -0
  21. package/dist/preview/assets/runtime-CLaRFZzt.js +1 -0
  22. package/dist/preview/assets/runtime-Ckuz5Kxm.js +1 -0
  23. package/dist/preview/assets/{runtime-BQnHKogz.js → runtime-CnKlH0mi.js} +1 -1
  24. package/dist/preview/assets/runtime-DO0anKbw.js +1 -0
  25. package/dist/preview/assets/{runtime-kLWO8JbC.js → runtime-DcStOiOi.js} +1 -1
  26. package/dist/preview/assets/runtime-EVgYW6_7.js +1 -0
  27. package/dist/preview/assets/runtime-i32sR7d3.js +1 -0
  28. package/dist/preview/index.html +2 -2
  29. package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue +16 -2
  30. package/dist/runtime/components/block-layout-editor/index.vue +1 -4
  31. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/config.vue +5 -0
  32. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/runtime.vue +2 -2
  33. package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/item.vue +2 -2
  34. package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.js +2 -2
  35. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/badge.vue +3 -2
  36. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +2 -2
  37. package/dist/runtime/components/form/config.vue +24 -16
  38. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +6 -5
  39. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +2 -2
  40. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +3 -4
  41. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +3 -4
  42. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +3 -4
  43. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +6 -5
  44. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +2 -2
  45. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +6 -5
  46. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +2 -2
  47. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +3 -4
  48. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +3 -4
  49. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +3 -4
  50. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +3 -4
  51. package/dist/runtime/components/form/schema.d.ts +1 -1
  52. package/dist/runtime/components/form/schema.js +8 -3
  53. package/dist/runtime/components/form/utils/initial.d.ts +5 -4
  54. package/dist/runtime/components/form/utils/initial.js +2 -2
  55. package/dist/runtime/components/form/utils/schema-meta.d.ts +2 -0
  56. package/dist/runtime/components/form/utils/schema-meta.js +24 -0
  57. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue +7 -6
  58. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.js +2 -2
  59. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +7 -6
  60. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.js +2 -2
  61. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +7 -6
  62. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +2 -2
  63. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +7 -6
  64. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.js +2 -2
  65. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue +7 -6
  66. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.js +2 -2
  67. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +7 -6
  68. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.js +2 -2
  69. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.vue +3 -4
  70. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -2
  71. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.vue +3 -4
  72. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.js +2 -2
  73. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +7 -6
  74. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +2 -2
  75. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +7 -6
  76. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +2 -2
  77. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +3 -4
  78. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -2
  79. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +3 -4
  80. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +2 -2
  81. package/dist/runtime/components/table/config.vue +0 -36
  82. package/dist/runtime/components/table/index.vue +3 -4
  83. package/dist/runtime/components/table/schema.js +3 -3
  84. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +4 -3
  85. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +135 -111
  86. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +4 -3
  87. package/dist/runtime/share/expression.d.ts +36 -0
  88. package/dist/runtime/share/expression.js +38 -17
  89. package/dist/runtime/share/request.d.ts +29 -0
  90. package/dist/runtime/share/request.js +11 -0
  91. package/dist/runtime/vendor/cel-js/CLAUDE.md +3 -3
  92. package/dist/runtime/vendor/cel-js/PROMPT.md +44 -3
  93. package/dist/runtime/vendor/cel-js/lib/functions.js +2 -2
  94. package/dist/runtime/vendor/cel-js/lib/macros.js +66 -14
  95. package/dist/runtime/vendor/cel-js/lib/optional.js +52 -1
  96. package/package.json +1 -1
  97. package/dist/preview/assets/badge-C-IvPZBx.js +0 -1
  98. package/dist/preview/assets/config-DXlCQMVi.js +0 -1
  99. package/dist/preview/assets/config-Dj0rEZRq.js +0 -1
  100. package/dist/preview/assets/config-_aVQvlhc.js +0 -1
  101. package/dist/preview/assets/config-l01zamcS.js +0 -1
  102. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-BbuC0qEM.js +0 -1
  103. package/dist/preview/assets/index-BNaI1T0H.js +0 -680
  104. package/dist/preview/assets/index-BwoBmSxu.js +0 -1
  105. package/dist/preview/assets/item-GFiAkFW6.js +0 -1
  106. package/dist/preview/assets/runtime-5h5U6Ozr.js +0 -1
  107. package/dist/preview/assets/runtime-B6dXW6zW.js +0 -1
  108. package/dist/preview/assets/runtime-BEOIc4zU.js +0 -1
  109. package/dist/preview/assets/runtime-Bx7G-5dR.js +0 -1
  110. package/dist/preview/assets/runtime-TNDFpOlo.js +0 -1
  111. package/dist/preview/assets/runtime-g9hb36Vh.js +0 -1
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -108,11 +109,9 @@ async function fetchTree() {
108
109
  const effect = Effect.gen(function* () {
109
110
  let jsonOpt = Option.none();
110
111
  if (dataSource.request) {
111
- const builder = yield* $cel(dataSource.request, {
112
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
112
113
  form: state.value ?? {}
113
- });
114
- const response = yield* builder.json();
115
- jsonOpt = Option.some(response);
114
+ }));
116
115
  }
117
116
  const dataRaw = yield* $cel(dataSource.data, {
118
117
  form: state.value ?? {},
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -104,11 +105,9 @@ async function fetchTree() {
104
105
  const effect = Effect.gen(function* () {
105
106
  let jsonOpt = Option.none();
106
107
  if (dataSource.request) {
107
- const builder = yield* $cel(dataSource.request, {
108
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
108
109
  form: state.value ?? {}
109
- });
110
- const response = yield* builder.json();
111
- jsonOpt = Option.some(response);
110
+ }));
112
111
  }
113
112
  const dataRaw = yield* $cel(dataSource.data, {
114
113
  form: state.value ?? {},
@@ -4,7 +4,7 @@ import type { InitialSource } from './utils/initial.js';
4
4
  import { registerFormVariablesIfAbsent } from './utils/form-vars.js';
5
5
  import { type LayoutSetValue } from '../../share/layout.js';
6
6
  export { commonFieldFields } from './utils/common.js';
7
- export { getStructFieldTitle, getStructFieldDescription } from './utils/schema-meta.js';
7
+ export { getStructFieldTitle, getStructFieldDescription, getNestedStructFieldTitle, getNestedStructFieldDescription, } from './utils/schema-meta.js';
8
8
  export { Align, DEFAULT_GAP, LayoutSet, validatePlacements } from '../../share/layout.js';
9
9
  declare const KIND = "shwfed.component.form";
10
10
  export declare const metadata: {
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { Expression } from "../../share/expression.js";
2
+ import { Expression, HttpRequestResult } from "../../share/expression.js";
3
3
  import { allFieldSchemas } from "./utils/resolve.js";
4
4
  import { registerFormVariablesIfAbsent } from "./utils/form-vars.js";
5
5
  import { md } from "../../share/markdown.js";
@@ -8,7 +8,12 @@ import {
8
8
  validatePlacements
9
9
  } from "../../share/layout.js";
10
10
  export { commonFieldFields } from "./utils/common.js";
11
- export { getStructFieldTitle, getStructFieldDescription } from "./utils/schema-meta.js";
11
+ export {
12
+ getStructFieldTitle,
13
+ getStructFieldDescription,
14
+ getNestedStructFieldTitle,
15
+ getNestedStructFieldDescription
16
+ } from "./utils/schema-meta.js";
12
17
  export { Align, DEFAULT_GAP, LayoutSet, validatePlacements } from "../../share/layout.js";
13
18
  const KIND = "shwfed.component.form";
14
19
  export const metadata = {
@@ -53,7 +58,7 @@ export function FormConfig(configure) {
53
58
  registerFormVariablesIfAbsent(env);
54
59
  configure(env);
55
60
  };
56
- const CelInitialRequest = Expression({ configure: formConfigure, resultType: "HttpRequest" });
61
+ const CelInitialRequest = Expression({ configure: formConfigure, resultType: HttpRequestResult });
57
62
  const CelInitialData = Expression({
58
63
  configure: (env) => {
59
64
  formConfigure(env);
@@ -18,9 +18,10 @@ export type InitialSource = Readonly<{
18
18
  export type CelEvaluator = <T>(expression: string, context?: Record<string, unknown>) => Effect.Effect<T, unknown, never>;
19
19
  /**
20
20
  * Resolve an `InitialSource` to the seed value. When `request` is set it is
21
- * built by CEL, then issued here as `.json()` — the host owns the IO, CEL only
22
- * describes it. The response is exposed to `data` as the `json` variable (an
23
- * `Option`, so a missing response is `None`, never a crash). The returned
24
- * Effect needs a `Fetch` layer.
21
+ * built by CEL, then issued here as `.json()` — issued only when the expression
22
+ * produces a request (it may opt out, yielding `None`). The host owns the IO,
23
+ * CEL only describes it. The response is exposed to `data` as the `json`
24
+ * variable (an `Option`, so a missing response is `None`, never a crash). The
25
+ * returned Effect needs a `Fetch` layer.
25
26
  */
26
27
  export declare function evaluateInitial(initial: InitialSource, cel: CelEvaluator, context: Record<string, unknown>): Effect.Effect<unknown, unknown, Fetch.Fetch>;
@@ -1,10 +1,10 @@
1
1
  import { Effect, Option } from "effect";
2
+ import { fetchJsonOption } from "../../../share/request.js";
2
3
  export function evaluateInitial(initial, cel, context) {
3
4
  return Effect.gen(function* () {
4
5
  let json = Option.none();
5
6
  if (initial.request) {
6
- const builder = yield* cel(initial.request, context);
7
- json = Option.some(yield* builder.json());
7
+ json = yield* fetchJsonOption(yield* cel(initial.request, context));
8
8
  }
9
9
  return yield* cel(initial.data, { ...context, json });
10
10
  });
@@ -2,6 +2,8 @@ import { type Schema } from 'effect';
2
2
  type AnySchema = Schema.Schema<any, any, any>;
3
3
  export declare function getStructFieldTitle(schema: AnySchema, fieldName: string): string | undefined;
4
4
  export declare function getStructFieldDescription(schema: AnySchema, fieldName: string): string | undefined;
5
+ export declare function getNestedStructFieldTitle(schema: AnySchema, parentField: string, childField: string): string | undefined;
6
+ export declare function getNestedStructFieldDescription(schema: AnySchema, parentField: string, childField: string): string | undefined;
5
7
  export type StructFieldInfo = {
6
8
  name: string;
7
9
  title?: string;
@@ -46,6 +46,30 @@ export function getStructFieldTitle(schema, fieldName) {
46
46
  export function getStructFieldDescription(schema, fieldName) {
47
47
  return getFieldAnnotation(schema, fieldName, SchemaAST.getDescriptionAnnotation);
48
48
  }
49
+ function getNestedFieldAnnotation(schema, parentField, childField, getter) {
50
+ const parentPs = findPropertySignature(schema, parentField);
51
+ if (!parentPs) return void 0;
52
+ const tl = getTypeLiteral(resolveFieldType(parentPs));
53
+ if (!tl) return void 0;
54
+ const ps = tl.propertySignatures.find((p) => p.name === childField);
55
+ if (!ps) return void 0;
56
+ const fromPS = getter(ps);
57
+ if (Option.isSome(fromPS)) return fromPS.value;
58
+ const resolved = resolveFieldType(ps);
59
+ const fromResolved = getter(resolved);
60
+ if (Option.isSome(fromResolved)) return fromResolved.value;
61
+ if (resolved !== ps.type) {
62
+ const fromType = getter(ps.type);
63
+ if (Option.isSome(fromType)) return fromType.value;
64
+ }
65
+ return void 0;
66
+ }
67
+ export function getNestedStructFieldTitle(schema, parentField, childField) {
68
+ return getNestedFieldAnnotation(schema, parentField, childField, SchemaAST.getTitleAnnotation);
69
+ }
70
+ export function getNestedStructFieldDescription(schema, parentField, childField) {
71
+ return getNestedFieldAnnotation(schema, parentField, childField, SchemaAST.getDescriptionAnnotation);
72
+ }
49
73
  export function listStructFields(schema) {
50
74
  const tl = getTypeLiteral(schema.ast);
51
75
  if (!tl) return [];
@@ -1,11 +1,12 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
- import { Effect } from "effect";
4
+ import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
6
  import { toast } from "vue-sonner";
7
7
  import { computed, nextTick, ref, watch } from "vue";
8
8
  import { useI18n } from "vue-i18n";
9
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
10
  import { cel as _rawCel } from "../../../../../utils/cel";
10
11
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
12
  import { getLocalizedText } from "../../../../../share/locale";
@@ -80,10 +81,10 @@ const requestSignature = computed(() => {
80
81
  const expr = props.column.request;
81
82
  if (!expr) return null;
82
83
  try {
83
- const builder = Effect.runSync(
84
+ const req = asRequest(Effect.runSync(
84
85
  $cel(expr, { row: row.value, index: rowIndex.value })
85
- );
86
- return JSON.stringify(builder.describe());
86
+ ));
87
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
87
88
  } catch {
88
89
  return null;
89
90
  }
@@ -99,8 +100,8 @@ async function fetchOptions() {
99
100
  const expr = props.column.request;
100
101
  isLoading.value = true;
101
102
  const program = Effect.gen(function* () {
102
- const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
103
- return yield* builder.json();
103
+ const json2 = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
104
+ return Option.getOrNull(json2);
104
105
  });
105
106
  try {
106
107
  const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
4
  import { Triggers } from "../../../../../share/event-bus.js";
5
5
  import {
@@ -32,7 +32,7 @@ export function schema(configure) {
32
32
  configure(env);
33
33
  registerRowVariablesIfAbsent(env);
34
34
  },
35
- resultType: "HttpRequest"
35
+ resultType: HttpRequestResult
36
36
  });
37
37
  const CelOptions = Expression({
38
38
  configure: (env) => {
@@ -1,11 +1,12 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
- import { Effect } from "effect";
4
+ import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
6
  import { toast } from "vue-sonner";
7
7
  import { computed, ref, watch } from "vue";
8
8
  import { useI18n } from "vue-i18n";
9
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
10
  import { cel as _rawCel } from "../../../../../utils/cel";
10
11
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
12
  import { getLocalizedText } from "../../../../../share/locale";
@@ -80,10 +81,10 @@ const requestSignature = computed(() => {
80
81
  const expr = props.column.request;
81
82
  if (!expr) return null;
82
83
  try {
83
- const builder = Effect.runSync(
84
+ const req = asRequest(Effect.runSync(
84
85
  $cel(expr, { row: row.value, index: rowIndex.value })
85
- );
86
- return JSON.stringify(builder.describe());
86
+ ));
87
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
87
88
  } catch {
88
89
  return null;
89
90
  }
@@ -99,8 +100,8 @@ async function fetchOptions() {
99
100
  const expr = props.column.request;
100
101
  isLoading.value = true;
101
102
  const program = Effect.gen(function* () {
102
- const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
103
- return yield* builder.json();
103
+ const json2 = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
104
+ return Option.getOrNull(json2);
104
105
  });
105
106
  try {
106
107
  const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
4
  import { Triggers } from "../../../../../share/event-bus.js";
5
5
  import {
@@ -32,7 +32,7 @@ export function schema(configure) {
32
32
  configure(env);
33
33
  registerRowVariablesIfAbsent(env);
34
34
  },
35
- resultType: "HttpRequest"
35
+ resultType: HttpRequestResult
36
36
  });
37
37
  const CelOptions = Expression({
38
38
  configure: (env) => {
@@ -1,9 +1,10 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
- import { Effect } from "effect";
3
+ import { Effect, Option } from "effect";
4
4
  import { watchDebounced } from "@vueuse/core";
5
5
  import { computed, ref, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -102,10 +103,10 @@ const requestSignature = computed(() => {
102
103
  const expr = props.column.options.request;
103
104
  if (!expr) return null;
104
105
  try {
105
- const builder = Effect.runSync(
106
+ const req = asRequest(Effect.runSync(
106
107
  $cel(expr, { row: row.value, index: rowIndex.value })
107
- );
108
- return JSON.stringify(builder.describe());
108
+ ));
109
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
109
110
  } catch {
110
111
  return null;
111
112
  }
@@ -120,8 +121,8 @@ async function fetchOptions() {
120
121
  const expr = props.column.options.request;
121
122
  remoteLoading.value = true;
122
123
  const program = Effect.gen(function* () {
123
- const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
124
- return yield* builder.json();
124
+ const json = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
125
+ return Option.getOrNull(json);
125
126
  });
126
127
  try {
127
128
  const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
@@ -1,7 +1,7 @@
1
1
  import { Effect, Schema } from "effect";
2
2
  import { getProperty } from "dot-prop";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
4
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
5
5
  import {
6
6
  CelRowAccess,
7
7
  derivedRowField,
@@ -52,7 +52,7 @@ export function remoteOptionsSchema(configure) {
52
52
  configure(env);
53
53
  registerRowVariablesIfAbsent(env);
54
54
  },
55
- resultType: "HttpRequest"
55
+ resultType: HttpRequestResult
56
56
  });
57
57
  const CelOptions = Expression({
58
58
  configure: (env) => {
@@ -1,11 +1,12 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
- import { Effect } from "effect";
3
+ import { Effect, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { watchDebounced } from "@vueuse/core";
6
6
  import { toast } from "vue-sonner";
7
7
  import { computed, ref } from "vue";
8
8
  import { useI18n } from "vue-i18n";
9
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
10
  import { cel as _rawCel } from "../../../../../utils/cel";
10
11
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
12
  import { getLocalizedText } from "../../../../../share/locale";
@@ -103,10 +104,10 @@ const requestSignature = computed(() => {
103
104
  const expr = props.column.options.request;
104
105
  if (!expr) return null;
105
106
  try {
106
- const builder = Effect.runSync(
107
+ const req = asRequest(Effect.runSync(
107
108
  $cel(expr, { row: row.value, index: rowIndex.value })
108
- );
109
- return JSON.stringify(builder.describe());
109
+ ));
110
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
110
111
  } catch {
111
112
  return null;
112
113
  }
@@ -121,8 +122,8 @@ async function fetchOptions() {
121
122
  const expr = props.column.options.request;
122
123
  remoteLoading.value = true;
123
124
  const program = Effect.gen(function* () {
124
- const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
125
- return yield* builder.json();
125
+ const json = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
126
+ return Option.getOrNull(json);
126
127
  });
127
128
  try {
128
129
  const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
4
  import { Triggers } from "../../../../../share/event-bus.js";
5
5
  import {
@@ -51,7 +51,7 @@ export function remoteOptionsSchema(configure) {
51
51
  configure(env);
52
52
  registerRowVariablesIfAbsent(env);
53
53
  },
54
- resultType: "HttpRequest"
54
+ resultType: HttpRequestResult
55
55
  });
56
56
  const CelOptions = Expression({
57
57
  configure: (env) => {
@@ -1,12 +1,13 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
- import { Effect } from "effect";
3
+ import { Effect, Option } from "effect";
4
4
  import { watchDebounced } from "@vueuse/core";
5
5
  import { computed, nextTick, ref, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
7
  import { cel as _rawCel } from "../../../../../utils/cel";
8
8
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
9
  import { getLocalizedText } from "../../../../../share/locale";
10
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
10
11
  import {
11
12
  Command,
12
13
  CommandEmpty,
@@ -102,10 +103,10 @@ const requestSignature = computed(() => {
102
103
  const expr = props.column.options.request;
103
104
  if (!expr) return null;
104
105
  try {
105
- const builder = Effect.runSync(
106
+ const req = asRequest(Effect.runSync(
106
107
  $cel(expr, { row: row.value, index: rowIndex.value })
107
- );
108
- return JSON.stringify(builder.describe());
108
+ ));
109
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
109
110
  } catch {
110
111
  return null;
111
112
  }
@@ -120,8 +121,8 @@ async function fetchOptions() {
120
121
  const expr = props.column.options.request;
121
122
  remoteLoading.value = true;
122
123
  const program = Effect.gen(function* () {
123
- const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
124
- return yield* builder.json();
124
+ const json = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
125
+ return Option.getOrNull(json);
125
126
  });
126
127
  try {
127
128
  const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
@@ -1,7 +1,7 @@
1
1
  import { Effect, Schema } from "effect";
2
2
  import { getProperty } from "dot-prop";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
4
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
5
5
  import {
6
6
  CelRowAccess,
7
7
  derivedRowField,
@@ -52,7 +52,7 @@ export function remoteOptionsSchema(configure) {
52
52
  configure(env);
53
53
  registerRowVariablesIfAbsent(env);
54
54
  },
55
- resultType: "HttpRequest"
55
+ resultType: HttpRequestResult
56
56
  });
57
57
  const CelOptions = Expression({
58
58
  configure: (env) => {
@@ -1,11 +1,12 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
- import { Effect } from "effect";
3
+ import { Effect, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { watchDebounced } from "@vueuse/core";
6
6
  import { toast } from "vue-sonner";
7
7
  import { computed, nextTick, ref, watch } from "vue";
8
8
  import { useI18n } from "vue-i18n";
9
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
10
  import { cel as _rawCel } from "../../../../../utils/cel";
10
11
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
12
  import { getLocalizedText } from "../../../../../share/locale";
@@ -103,10 +104,10 @@ const requestSignature = computed(() => {
103
104
  const expr = props.column.options.request;
104
105
  if (!expr) return null;
105
106
  try {
106
- const builder = Effect.runSync(
107
+ const req = asRequest(Effect.runSync(
107
108
  $cel(expr, { row: row.value, index: rowIndex.value })
108
- );
109
- return JSON.stringify(builder.describe());
109
+ ));
110
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
110
111
  } catch {
111
112
  return null;
112
113
  }
@@ -121,8 +122,8 @@ async function fetchOptions() {
121
122
  const expr = props.column.options.request;
122
123
  remoteLoading.value = true;
123
124
  const program = Effect.gen(function* () {
124
- const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
125
- return yield* builder.json();
125
+ const json = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
126
+ return Option.getOrNull(json);
126
127
  });
127
128
  try {
128
129
  const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
4
  import { Triggers } from "../../../../../share/event-bus.js";
5
5
  import {
@@ -51,7 +51,7 @@ export function remoteOptionsSchema(configure) {
51
51
  configure(env);
52
52
  registerRowVariablesIfAbsent(env);
53
53
  },
54
- resultType: "HttpRequest"
54
+ resultType: HttpRequestResult
55
55
  });
56
56
  const CelOptions = Expression({
57
57
  configure: (env) => {
@@ -6,6 +6,7 @@ import { useI18n } from "vue-i18n";
6
6
  import { cel as _rawCel } from "../../../../../utils/cel";
7
7
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
8
8
  import { getLocalizedText } from "../../../../../share/locale";
9
+ import { fetchJsonOption } from "../../../../../share/request";
9
10
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
10
11
  import { Markdown } from "../../../../ui/markdown";
11
12
  import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
@@ -143,12 +144,10 @@ async function fetchTree() {
143
144
  const effect = Effect.gen(function* () {
144
145
  let jsonOpt = Option.none();
145
146
  if (dataSource.request) {
146
- const builder = yield* $cel(dataSource.request, {
147
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
147
148
  row: row.value,
148
149
  index: rowIndex.value
149
- });
150
- const response = yield* builder.json();
151
- jsonOpt = Option.some(response);
150
+ }));
152
151
  }
153
152
  const dataRaw = yield* $cel(dataSource.data, {
154
153
  row: row.value,
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { getProperty } from "dot-prop";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
4
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
5
5
  import {
6
6
  CelRowAccess,
7
7
  derivedRowField,
@@ -36,7 +36,7 @@ export function schema(configure) {
36
36
  };
37
37
  const CelDataSourceRequest = Expression({
38
38
  configure: dataSourceConfigure,
39
- resultType: "HttpRequest"
39
+ resultType: HttpRequestResult
40
40
  });
41
41
  const CelDataSourceData = Expression({
42
42
  configure: (env) => {
@@ -6,6 +6,7 @@ import { useI18n } from "vue-i18n";
6
6
  import { cel as _rawCel } from "../../../../../utils/cel";
7
7
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
8
8
  import { getLocalizedText } from "../../../../../share/locale";
9
+ import { fetchJsonOption } from "../../../../../share/request";
9
10
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
10
11
  import { Markdown } from "../../../../ui/markdown";
11
12
  import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
@@ -146,12 +147,10 @@ async function fetchTree() {
146
147
  const effect = Effect.gen(function* () {
147
148
  let jsonOpt = Option.none();
148
149
  if (dataSource.request) {
149
- const builder = yield* $cel(dataSource.request, {
150
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
150
151
  row: row.value,
151
152
  index: rowIndex.value
152
- });
153
- const response = yield* builder.json();
154
- jsonOpt = Option.some(response);
153
+ }));
155
154
  }
156
155
  const dataRaw = yield* $cel(dataSource.data, {
157
156
  row: row.value,
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { getProperty } from "dot-prop";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
4
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
5
5
  import {
6
6
  CelRowAccess,
7
7
  derivedRowField,
@@ -36,7 +36,7 @@ export function schema(configure) {
36
36
  };
37
37
  const CelDataSourceRequest = Expression({
38
38
  configure: dataSourceConfigure,
39
- resultType: "HttpRequest"
39
+ resultType: HttpRequestResult
40
40
  });
41
41
  const CelDataSourceData = Expression({
42
42
  configure: (env) => {
@@ -1,11 +1,12 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
- import { Effect } from "effect";
3
+ import { Effect, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { watchDebounced } from "@vueuse/core";
6
6
  import { toast } from "vue-sonner";
7
7
  import { computed, ref } from "vue";
8
8
  import { useI18n } from "vue-i18n";
9
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
10
  import { cel as _rawCel } from "../../../../../utils/cel";
10
11
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
12
  import { getLocalizedText } from "../../../../../share/locale";
@@ -108,10 +109,10 @@ const requestSignature = computed(() => {
108
109
  const expr = props.column.options.request;
109
110
  if (!expr) return null;
110
111
  try {
111
- const builder = Effect.runSync(
112
+ const req = asRequest(Effect.runSync(
112
113
  $cel(expr, { row: row.value, index: rowIndex.value })
113
- );
114
- return JSON.stringify(builder.describe());
114
+ ));
115
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
115
116
  } catch {
116
117
  return null;
117
118
  }
@@ -126,8 +127,8 @@ async function fetchOptions() {
126
127
  const expr = props.column.options.request;
127
128
  remoteLoading.value = true;
128
129
  const program = Effect.gen(function* () {
129
- const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
130
- return yield* builder.json();
130
+ const json = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
131
+ return Option.getOrNull(json);
131
132
  });
132
133
  try {
133
134
  const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
@@ -1,6 +1,6 @@
1
1
  import { Effect, Schema } from "effect";
2
2
  import { getProperty } from "dot-prop";
3
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
3
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
4
4
  import { Locale } from "../../../../../share/locale.js";
5
5
  import { Triggers } from "../../../../../share/event-bus.js";
6
6
  import {
@@ -58,7 +58,7 @@ export function remoteOptionsSchema(configure) {
58
58
  configure(env);
59
59
  registerRowVariablesIfAbsent(env);
60
60
  },
61
- resultType: "HttpRequest"
61
+ resultType: HttpRequestResult
62
62
  });
63
63
  const CelOptions = Expression({
64
64
  configure: (env) => {