@flowgram-vue/test-run-plugin 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +22 -0
  2. package/dist/index.cjs +765 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.ts +408 -0
  5. package/dist/index.js +759 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +63 -0
  8. package/src/create-test-run-plugin.ts +39 -0
  9. package/src/env.d.ts +10 -0
  10. package/src/form-engine/contexts.ts +16 -0
  11. package/src/form-engine/fields/create-field.ts +41 -0
  12. package/src/form-engine/fields/general-field.ts +42 -0
  13. package/src/form-engine/fields/index.ts +9 -0
  14. package/src/form-engine/fields/object-field.ts +25 -0
  15. package/src/form-engine/fields/reactive-field.ts +55 -0
  16. package/src/form-engine/fields/recursion-field.ts +28 -0
  17. package/src/form-engine/fields/schema-field.ts +29 -0
  18. package/src/form-engine/form/form.ts +57 -0
  19. package/src/form-engine/form/index.ts +6 -0
  20. package/src/form-engine/hooks/index.ts +8 -0
  21. package/src/form-engine/hooks/use-create-form.ts +63 -0
  22. package/src/form-engine/hooks/use-field.ts +19 -0
  23. package/src/form-engine/hooks/use-form.ts +19 -0
  24. package/src/form-engine/index.ts +19 -0
  25. package/src/form-engine/model/index.ts +89 -0
  26. package/src/form-engine/types.ts +56 -0
  27. package/src/form-engine/utils.ts +69 -0
  28. package/src/index.ts +23 -0
  29. package/src/reactive/hooks/index.ts +7 -0
  30. package/src/reactive/hooks/use-create-form.ts +101 -0
  31. package/src/reactive/hooks/use-test-run-service.ts +10 -0
  32. package/src/reactive/index.ts +6 -0
  33. package/src/services/config.ts +42 -0
  34. package/src/services/form/factory.ts +9 -0
  35. package/src/services/form/form.ts +77 -0
  36. package/src/services/form/index.ts +8 -0
  37. package/src/services/form/manager.ts +43 -0
  38. package/src/services/index.ts +14 -0
  39. package/src/services/pipeline/factory.ts +9 -0
  40. package/src/services/pipeline/index.ts +12 -0
  41. package/src/services/pipeline/pipeline.ts +155 -0
  42. package/src/services/pipeline/plugin.ts +13 -0
  43. package/src/services/pipeline/tap.ts +34 -0
  44. package/src/services/store.ts +27 -0
  45. package/src/services/test-run.ts +108 -0
  46. package/src/types.ts +29 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/services/config.ts","../src/form-engine/utils.ts","../src/form-engine/model/index.ts","../src/form-engine/hooks/use-create-form.ts","../src/form-engine/contexts.ts","../src/form-engine/hooks/use-field.ts","../src/form-engine/hooks/use-form.ts","../src/form-engine/fields/reactive-field.ts","../src/form-engine/fields/object-field.ts","../src/form-engine/fields/general-field.ts","../src/form-engine/fields/recursion-field.ts","../src/form-engine/fields/schema-field.ts","../src/form-engine/fields/create-field.ts","../src/form-engine/form/form.ts","../src/services/form/form.ts","../src/services/form/factory.ts","../src/services/form/manager.ts","../src/services/pipeline/factory.ts","../src/services/test-run.ts","../src/services/pipeline/tap.ts","../src/services/store.ts","../src/services/pipeline/pipeline.ts","../src/create-test-run-plugin.ts","../src/reactive/hooks/use-test-run-service.ts","../src/reactive/hooks/use-create-form.ts"],"names":["defineComponent","h","ReactiveState","form","createForm","ValidateTrigger","onBeforeUnmount","inject","useObserve","provide","Field","SchemaField","Form","nanoid","Emitter","injectable","DisposableCollection","createStore","unmanaged","TestRunPipelineEntity","definePluginCreator","useService","useCreateForm","ref","shallowRef","computed","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BO,IAAM,aAAA,0BAAuB,eAAe,CAAA;AAC5C,IAAM,YAAA,GAAe,CAAC,MAAA,KAAmC;AAC9D,EAAA,MAAM,aAAA,GAA+B;AAAA,IACnC,YAAY,EAAC;AAAA,IACb,OAAO,EAAC;AAAA,IACR,SAAS;AAAC,GACZ;AACA,EAAA,OAAO;AAAA,IACL,GAAG,aAAA;AAAA,IACH,GAAG;AAAA,GACL;AACF,CAAA;AC/BO,IAAM,kBAAA,GAAqB,CAAA,GAAI,IAAA,K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A,EAAAA,SAAA;AAAA,IACE,IAAA;AAAA,IACA,CAAC,IAAA,EAAM,KAAA,EAAO,SAAA,KAAc;AAC1B,MAAA,IAAI,CAAC,IAAA,EAAM;AACT,QAAA;AAAA,MACF;AACA,MAAA,MAAM,aAAa,IAAIV,0BAAAA;AAAA,QACrB,IAAA,CAAK,aAAA,CAAc,CAAC,IAAA,KAAS;AAC3B,UAAA,SAAA,GAAY,IAAI,CAAA;AAAA,QAClB,CAAC,CAAA;AAAA,QACD,IAAA,CAAK,gBAAgB,MAAM;AACzB,UAAA,WAAA,IAAc;AAAA,QAChB,CAAC;AAAA,OACH;AACA,MAAA,SAAA,CAAU,MAAM,UAAA,CAAW,OAAA,EAAS,CAAA;AAAA,IACtC;AAAA,GACF;AAEA,EAAAV,oBAAgB,MAAM;AACpB,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAA;AAAA,EACf,CAAC,CAAA;AAED,EAAA,OAAO;AAAA,IACL,QAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF;AACF","file":"index.cjs","sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { FlowNodeType, FlowNodeEntity } from '@flowgram-vue/document';\n\nimport type { MaybePromise } from '../types';\nimport type { FormSchema, FormComponents } from '../form-engine';\nimport type { TestRunPipelinePlugin } from './pipeline';\n\ntype PropertiesFunctionParams = {\n node: FlowNodeEntity;\n};\nexport type NodeMap = Record<FlowNodeType, NodeTestConfig>;\nexport interface NodeTestConfig {\n /** Enable node TestRun */\n enabled?: boolean;\n /** Input schema properties */\n properties?:\n | Record<string, FormSchema>\n | ((params: PropertiesFunctionParams) => MaybePromise<Record<string, FormSchema>>);\n}\n\nexport interface TestRunConfig {\n components: FormComponents;\n nodes: NodeMap;\n plugins: (new () => TestRunPipelinePlugin)[];\n}\n\nexport const TestRunConfig = Symbol('TestRunConfig');\nexport const defineConfig = (config: Partial<TestRunConfig>) => {\n const defaultConfig: TestRunConfig = {\n components: {},\n nodes: {},\n plugins: [],\n };\n return {\n ...defaultConfig,\n ...config,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, type Component } from 'vue';\n\nimport type { FormSchema, FormSchemaValidate, FormComponentProps } from './types';\n\n/** Splice form item unique name */\nexport const getUniqueFieldName = (...args: (string | undefined)[]) =>\n args.filter((path) => path).join('.');\n\nexport const mergeFieldPath = (path?: string[], name?: string) =>\n [...(path || []), name].filter((i): i is string => Boolean(i));\n\n/** Create validation rules */\nexport const createValidate = (schema: FormSchema) => {\n const rules: Record<string, FormSchemaValidate> = {};\n\n visit(schema);\n\n return rules;\n\n function visit(current: FormSchema, name?: string) {\n if (name && current['x-validator']) {\n rules[name] = current['x-validator'];\n }\n if (current.type === 'object' && current.properties) {\n Object.entries(current.properties).forEach(([key, value]) => {\n visit(value, getUniqueFieldName(name, key));\n });\n }\n }\n};\n\nexport const connect = <T = any>(\n Comp: Component,\n mapProps: (p: FormComponentProps) => T\n) => {\n const Connected = defineComponent({\n name: 'ConnectedFormComponent',\n setup(props: FormComponentProps, { slots }) {\n return () => {\n const mappedProps = mapProps(props);\n return h(Comp, mappedProps as any, () => slots.default?.() ?? (mappedProps as any).children);\n };\n },\n });\n\n return Connected;\n};\n\nexport const isFormEmpty = (schema: FormSchema) => {\n /** is not general field and not has children */\n const isEmpty = (s: FormSchema): boolean => {\n if (!s.type || s.type === 'object' || !s.name) {\n return Object.entries(schema.properties || {})\n .map(([key, value]) => ({\n name: key,\n ...value,\n }))\n .every(isFormEmpty);\n }\n return false;\n };\n\n return isEmpty(schema);\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ReactiveState } from '@flowgram-vue/reactive';\n\nimport { getUniqueFieldName, mergeFieldPath } from '../utils';\nimport { FormSchema, FormSchemaType, FormSchemaModelState } from '../types';\n\nexport class FormSchemaModel implements FormSchema {\n name?: string;\n\n type?: FormSchemaType;\n\n defaultValue?: any;\n\n properties?: Record<string, FormSchema>;\n\n ['x-index']?: number;\n\n ['x-component']?: string;\n\n ['x-component-props']?: Record<string, unknown>;\n\n ['x-decorator']?: string;\n\n ['x-decorator-props']?: Record<string, unknown>;\n\n [key: string]: any;\n\n path: string[] = [];\n\n state = new ReactiveState<FormSchemaModelState>({ disabled: false });\n\n get componentType() {\n return this['x-component'];\n }\n\n get componentProps() {\n return this['x-component-props'];\n }\n\n get decoratorType() {\n return this['x-decorator'];\n }\n\n get decoratorProps() {\n return this['x-decorator-props'];\n }\n\n get uniqueName() {\n return getUniqueFieldName(...this.path);\n }\n\n constructor(json: FormSchema, path: string[] = []) {\n this.fromJSON(json);\n this.path = path;\n }\n\n private fromJSON(json: FormSchema) {\n Object.entries(json).forEach(([key, value]) => {\n this[key] = value;\n });\n }\n\n getPropertyList() {\n const orderProperties: FormSchemaModel[] = [];\n const unOrderProperties: FormSchemaModel[] = [];\n Object.entries(this.properties || {}).forEach(([key, item]) => {\n const index = item['x-index'];\n const defaultValues = this.defaultValue;\n /**\n * The upper layer's default value has a higher priority than its own default value,\n * because the upper layer's default value ultimately comes from the outside world.\n */\n if (typeof defaultValues === 'object' && defaultValues !== null && key in defaultValues) {\n item.defaultValue = defaultValues[key];\n }\n const current = new FormSchemaModel(item, mergeFieldPath(this.path, key));\n if (index !== undefined && !isNaN(index)) {\n orderProperties[index] = current;\n } else {\n unOrderProperties.push(current);\n }\n });\n return orderProperties.concat(unOrderProperties).filter((item) => !!item);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { onBeforeUnmount } from 'vue';\n\nimport type { OnFormValuesChangePayload } from '@flowgram-vue/form-core';\nimport { createForm, ValidateTrigger, type IForm } from '@flowgram-vue/form';\n\nimport { createValidate } from '../utils';\nimport { FormSchema, FormSchemaValidate } from '../types';\nimport { FormSchemaModel } from '../model';\n\nexport interface FormInstance {\n model: FormSchemaModel;\n form: IForm;\n}\nexport interface UseCreateFormOptions {\n defaultValues?: any;\n validate?: Record<string, FormSchemaValidate>;\n validateTrigger?: ValidateTrigger;\n onMounted?: (form: FormInstance) => void;\n onFormValuesChange?: (payload: OnFormValuesChangePayload) => void;\n onUnmounted?: () => void;\n}\n\nexport const useCreateForm = (schema: FormSchema, options: UseCreateFormOptions = {}) => {\n const { form, control } = createForm({\n validate: {\n ...createValidate(schema),\n ...options.validate,\n },\n validateTrigger: options.validateTrigger ?? ValidateTrigger.onBlur,\n });\n\n const model = new FormSchemaModel({\n type: 'object',\n ...schema,\n defaultValue: options.defaultValues,\n });\n\n if (options.onMounted) {\n options.onMounted({ model, form });\n }\n const disposable = control._formModel.onFormValuesChange((payload) => {\n if (options.onFormValuesChange) {\n options.onFormValuesChange(payload);\n }\n });\n onBeforeUnmount(() => {\n disposable.dispose();\n if (options.onUnmounted) {\n options.onUnmounted();\n }\n });\n\n return {\n form,\n control,\n model,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { InjectionKey } from 'vue';\n\nimport type { FormComponents } from './types';\nimport type { FormSchemaModel } from './model';\n\n/** Model context for each form item */\nexport const FieldModelKey: InjectionKey<FormSchemaModel> = Symbol('FieldModelContext');\n/** The form's model context */\nexport const FormModelKey: InjectionKey<FormSchemaModel> = Symbol('FormModelContext');\n/** Context of material component map */\nexport const ComponentsKey: InjectionKey<FormComponents> = Symbol('ComponentsContext');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject } from 'vue';\n\nimport { useObserve } from '@flowgram-vue/reactive';\n\nimport { FieldModelKey } from '../contexts';\n\nexport const useFieldModel = () => {\n const model = inject(FieldModelKey);\n if (!model) {\n throw new Error('useFieldModel must be used within FieldModelKey provider');\n }\n return model;\n};\nexport const useFieldState = () => useObserve(useFieldModel().state.value);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject } from 'vue';\n\nimport { useObserve } from '@flowgram-vue/reactive';\n\nimport { FormModelKey } from '../contexts';\n\nexport const useFormModel = () => {\n const model = inject(FormModelKey);\n if (!model) {\n throw new Error('useFormModel must be used within FormModelKey provider');\n }\n return model;\n};\nexport const useFormState = () => useObserve(useFormModel().state.value);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, inject, type PropType } from 'vue';\n\nimport { useFormState } from '../hooks/use-form';\nimport { useFieldModel, useFieldState } from '../hooks/use-field';\nimport { ComponentsKey } from '../contexts';\n\nexport const ReactiveField = defineComponent({\n name: 'ReactiveField',\n props: {\n componentProps: { type: Object as PropType<Record<string, unknown>>, default: undefined },\n decoratorProps: { type: Object as PropType<Record<string, unknown>>, default: undefined },\n },\n setup(props, { slots }) {\n const formState = useFormState();\n const model = useFieldModel();\n const modelState = useFieldState();\n const components = inject(ComponentsKey, {});\n\n return () => {\n const disabled = modelState.disabled || formState.disabled;\n let children = slots.default?.();\n if (model.componentType && components[model.componentType]) {\n children = [\n h(\n components[model.componentType],\n {\n disabled,\n ...model.componentProps,\n ...props.componentProps,\n },\n () => slots.default?.()\n ),\n ];\n }\n if (!model.decoratorType || !components[model.decoratorType]) {\n return children;\n }\n return h(\n components[model.decoratorType],\n {\n type: model.type,\n required: model.required,\n ...model.decoratorProps,\n ...props.decoratorProps,\n },\n () => children\n );\n };\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, provide, type PropType } from 'vue';\n\nimport type { FormSchemaModel } from '../model';\nimport { FieldModelKey } from '../contexts';\nimport { ReactiveField } from './reactive-field';\n\nexport interface ObjectFieldProps {\n model: FormSchemaModel;\n}\n\nexport const ObjectField = defineComponent({\n name: 'ObjectField',\n props: {\n model: { type: Object as PropType<FormSchemaModel>, required: true },\n },\n setup(props, { slots }) {\n provide(FieldModelKey, props.model);\n return () => h(ReactiveField, null, () => slots.default?.());\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, provide, type PropType } from 'vue';\n\nimport { Field, type FieldRenderProps } from '@flowgram-vue/form';\n\nimport { ReactiveField } from './reactive-field';\nimport type { FormSchemaModel } from '../model';\nimport { FieldModelKey } from '../contexts';\n\nexport interface GeneralFieldProps {\n model: FormSchemaModel;\n}\n\nexport const GeneralField = defineComponent({\n name: 'GeneralField',\n props: {\n model: { type: Object as PropType<FormSchemaModel>, required: true },\n },\n setup(props) {\n provide(FieldModelKey, props.model);\n return () =>\n h(Field, {\n name: props.model.uniqueName,\n defaultValue: props.model.defaultValue,\n render: ({ field, fieldState }: FieldRenderProps<any>) =>\n h(ReactiveField, {\n componentProps: {\n value: field.value,\n onChange: field.onChange,\n onFocus: field.onFocus,\n onBlur: field.onBlur,\n ...fieldState,\n },\n decoratorProps: fieldState,\n }),\n });\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, type PropType, type VNode } from 'vue';\n\nimport { FormSchemaModel } from '../model';\nimport { ObjectField } from './object-field';\nimport { GeneralField } from './general-field';\n\nexport const RecursionField = defineComponent({\n name: 'RecursionField',\n props: {\n model: { type: Object as PropType<FormSchemaModel>, required: true },\n },\n setup(props): () => VNode {\n return () => {\n const properties = props.model.getPropertyList();\n if (props.model.type !== 'object') {\n return h(GeneralField, { model: props.model });\n }\n return h(ObjectField, { model: props.model }, () =>\n properties.map((item) => h(RecursionField, { key: item.uniqueName, model: item }))\n );\n };\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, provide, type PropType } from 'vue';\n\nimport type { FormComponents } from '../types';\nimport { FormSchemaModel } from '../model';\nimport { ComponentsKey, FormModelKey } from '../contexts';\nimport { RecursionField } from './recursion-field';\n\nexport interface SchemaFieldProps {\n model: FormSchemaModel;\n components?: FormComponents;\n}\n\nexport const SchemaField = defineComponent({\n name: 'SchemaField',\n props: {\n model: { type: Object as PropType<FormSchemaModel>, required: true },\n components: { type: Object as PropType<FormComponents>, default: () => ({}) },\n },\n setup(props, { slots }) {\n provide(ComponentsKey, props.components || {});\n provide(FormModelKey, props.model);\n return () => [h(RecursionField, { model: props.model }), slots.default?.()];\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, type PropType } from 'vue';\n\nimport { SchemaField, type SchemaFieldProps } from './schema-field';\nimport { FormComponents } from '../types';\n\ntype InnerSchemaFieldProps = Omit<SchemaFieldProps, 'components'> &\n Pick<Partial<SchemaFieldProps>, 'components'>;\n\nexport interface CreateSchemaFieldOptions {\n components?: FormComponents;\n}\nexport const createSchemaField = (options: CreateSchemaFieldOptions) => {\n const InnerSchemaField = defineComponent({\n name: 'InnerSchemaField',\n props: {\n model: { type: Object as PropType<InnerSchemaFieldProps['model']>, required: true },\n components: { type: Object as PropType<FormComponents>, default: undefined },\n },\n setup(props, { slots }) {\n return () =>\n h(\n SchemaField,\n {\n model: props.model,\n components: {\n ...options.components,\n ...props.components,\n },\n },\n () => slots.default?.()\n );\n },\n });\n\n return InnerSchemaField;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, type PropType, type VNode } from 'vue';\n\nimport { Form } from '@flowgram-vue/form';\n\nimport { FormSchema, FormComponents } from '../types';\nimport { useCreateForm, type UseCreateFormOptions } from '../hooks';\nimport { createSchemaField } from '../fields';\n\nconst SchemaField = createSchemaField({});\n\nexport type FormEngineProps = {\n /** Form schema */\n schema: FormSchema;\n /** form material map */\n components?: FormComponents;\n children?: VNode | VNode[] | null;\n} & UseCreateFormOptions;\n\nexport const FormEngine = defineComponent({\n name: 'FormEngine',\n props: {\n schema: { type: Object as PropType<FormSchema>, required: true },\n components: { type: Object as PropType<FormComponents>, default: undefined },\n defaultValues: { default: undefined },\n validate: { type: Object, default: undefined },\n validateTrigger: { default: undefined },\n onMounted: { type: Function as PropType<UseCreateFormOptions['onMounted']>, default: undefined },\n onFormValuesChange: {\n type: Function as PropType<UseCreateFormOptions['onFormValuesChange']>,\n default: undefined,\n },\n onUnmounted: {\n type: Function as PropType<UseCreateFormOptions['onUnmounted']>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const { model, control } = useCreateForm(props.schema, {\n defaultValues: props.defaultValues,\n validate: props.validate as UseCreateFormOptions['validate'],\n validateTrigger: props.validateTrigger as UseCreateFormOptions['validateTrigger'],\n onMounted: props.onMounted,\n onFormValuesChange: props.onFormValuesChange,\n onUnmounted: props.onUnmounted,\n });\n\n return () =>\n h(Form, { control }, () =>\n h(SchemaField, { model, components: props.components }, () => slots.default?.())\n );\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { h, type Component, type VNode } from 'vue';\nimport { nanoid } from 'nanoid';\nimport { injectable, inject } from 'inversify';\nimport { Emitter } from '@flowgram-vue/utils';\n\nimport { TestRunConfig } from '../config';\nimport { FormSchema, FormEngine, type FormInstance, type FormEngineProps } from '../../form-engine';\n\nexport type FormRenderProps = Omit<\n FormEngineProps,\n 'schema' | 'components' | 'onMounted' | 'onUnmounted'\n>;\n\n@injectable()\nexport class TestRunFormEntity {\n @inject(TestRunConfig) private readonly config: TestRunConfig;\n\n private _schema: FormSchema;\n\n private initialized = false;\n\n id = nanoid();\n\n form: FormInstance | null = null;\n\n onFormMountedEmitter = new Emitter<FormInstance>();\n\n onFormMounted = this.onFormMountedEmitter.event;\n\n onFormUnmountedEmitter = new Emitter<void>();\n\n onFormUnmounted = this.onFormUnmountedEmitter.event;\n\n get schema() {\n return this._schema;\n }\n\n init(options: { schema: FormSchema }) {\n if (this.initialized) return;\n\n this._schema = options.schema;\n this.initialized = true;\n }\n\n render(props?: FormRenderProps): VNode | null {\n if (!this.initialized) {\n return null;\n }\n const { children, ...restProps } = props || {};\n return h(\n FormEngine as Component,\n {\n schema: this.schema,\n components: this.config.components,\n onMounted: (instance: FormInstance) => {\n this.form = instance;\n this.onFormMountedEmitter.fire(instance);\n },\n onUnmounted: this.onFormUnmountedEmitter.fire.bind(this.onFormUnmountedEmitter),\n ...restProps,\n },\n () => children as any\n );\n }\n\n dispose() {\n this._schema = {};\n this.form = null;\n this.onFormMountedEmitter.dispose();\n this.onFormUnmountedEmitter.dispose();\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { TestRunFormEntity } from './form';\n\nexport const TestRunFormFactory = Symbol('TestRunFormFactory');\nexport type TestRunFormFactory = () => TestRunFormEntity;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\n\nimport type { TestRunFormEntity } from './form';\nimport { TestRunFormFactory } from './factory';\n\n@injectable()\nexport class TestRunFormManager {\n @inject(TestRunFormFactory) private readonly factory: TestRunFormFactory;\n\n private entities = new Map<string, TestRunFormEntity>();\n\n createForm() {\n return this.factory();\n }\n\n getForm(id: string) {\n return this.entities.get(id);\n }\n\n getAllForm() {\n return Array.from(this.entities);\n }\n\n disposeForm(id: string) {\n const form = this.entities.get(id);\n if (!form) {\n return;\n }\n form.dispose();\n this.entities.delete(id);\n }\n\n disposeAllForm() {\n for (const id of this.entities.keys()) {\n this.disposeForm(id);\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { TestRunPipelineEntity } from './pipeline';\n\nexport const TestRunPipelineFactory = Symbol('TestRunPipelineFactory');\nexport type TestRunPipelineFactory = () => TestRunPipelineEntity;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\nimport { Disposable, DisposableCollection, Emitter } from '@flowgram-vue/utils';\nimport type { FlowNodeEntity, FlowNodeType } from '@flowgram-vue/document';\n\nimport { TestRunPipelineFactory } from './pipeline/factory';\nimport { TestRunFormManager } from './form';\nimport { FormSchema } from '../form-engine';\nimport { TestRunPipelineEntity, type TestRunPipelineEntityOptions } from './pipeline';\nimport { TestRunConfig } from './config';\n\n@injectable()\nexport class TestRunService {\n @inject(TestRunConfig) private readonly config: TestRunConfig;\n\n @inject(TestRunPipelineFactory) private readonly pipelineFactory: TestRunPipelineFactory;\n\n @inject(TestRunFormManager) readonly formManager: TestRunFormManager;\n\n pipelineEntities = new Map<string, TestRunPipelineEntity>();\n\n pipelineBindings = new Map<string, Disposable>();\n\n onPipelineProgressEmitter = new Emitter();\n\n onPipelineProgress = this.onPipelineProgressEmitter.event;\n\n onPipelineFinishedEmitter = new Emitter();\n\n onPipelineFinished = this.onPipelineFinishedEmitter.event;\n\n public isEnabled(nodeType: FlowNodeType) {\n const config = this.config.nodes[nodeType];\n return config && config?.enabled !== false;\n }\n\n async toSchema(node: FlowNodeEntity) {\n const nodeType = node.flowNodeType;\n const config = this.config.nodes[nodeType];\n if (!this.isEnabled(nodeType)) {\n return {};\n }\n const properties =\n typeof config.properties === 'function'\n ? await config.properties({ node })\n : config.properties;\n\n return {\n type: 'object',\n properties,\n };\n }\n\n createFormWithSchema(schema: FormSchema) {\n const form = this.formManager.createForm();\n form.init({ schema });\n return form;\n }\n\n async createForm(node: FlowNodeEntity) {\n const schema = await this.toSchema(node);\n return this.createFormWithSchema(schema);\n }\n\n createPipeline(options: TestRunPipelineEntityOptions) {\n const pipeline = this.pipelineFactory();\n this.pipelineEntities.set(pipeline.id, pipeline);\n pipeline.init(options);\n return pipeline;\n }\n\n disposePipeline(id: string) {\n const pipeline = this.pipelineEntities.get(id);\n if (pipeline) {\n this.pipelineEntities.delete(id);\n pipeline.dispose();\n }\n }\n\n connectPipeline(pipeline: TestRunPipelineEntity) {\n if (this.pipelineBindings.get(pipeline.id)) {\n return;\n }\n const disposable = new DisposableCollection(\n pipeline.onProgress(this.onPipelineProgressEmitter.fire.bind(this.onPipelineProgressEmitter)),\n pipeline.onFinished(this.onPipelineFinishedEmitter.fire.bind(this.onPipelineFinishedEmitter))\n );\n this.pipelineBindings.set(pipeline.id, disposable);\n }\n\n disconnectPipeline(id: string) {\n if (this.pipelineBindings.has(id)) {\n const disposable = this.pipelineBindings.get(id);\n disposable?.dispose();\n this.pipelineBindings.delete(id);\n }\n }\n\n disconnectAllPipeline() {\n for (const id of this.pipelineBindings.keys()) {\n this.disconnectPipeline(id);\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { MaybePromise } from '../../types';\n\ninterface TapValue<T> {\n name: string;\n fn: (arg: T) => MaybePromise<void>;\n}\n\nexport class Tap<T> {\n private taps: TapValue<T>[] = [];\n\n private frozen = false;\n\n tap(name: string, fn: TapValue<T>['fn']) {\n this.taps.push({ name, fn });\n }\n\n async call(ctx: T) {\n for (const tap of this.taps) {\n if (this.frozen) {\n return;\n }\n await tap.fn(ctx);\n }\n }\n\n freeze() {\n this.frozen = true;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createStore } from 'zustand/vanilla';\nimport type { StoreApi, StateCreator } from 'zustand';\nimport { injectable, unmanaged } from 'inversify';\n/**\n * 包含 Store 的 Service\n */\n@injectable()\nexport class StoreService<State> {\n store: StoreApi<State>;\n\n get getState() {\n return this.store.getState.bind(this.store);\n }\n\n get setState() {\n return this.store.setState.bind(this.store);\n }\n\n constructor(@unmanaged() stateCreator: StateCreator<State>) {\n this.store = createStore(stateCreator);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { StoreApi } from 'zustand';\nimport { nanoid } from 'nanoid';\nimport { injectable, interfaces } from 'inversify';\nimport { Emitter } from '@flowgram-vue/utils';\n\nimport { Tap } from './tap';\nimport type { TestRunPipelinePlugin } from './plugin';\nimport { StoreService } from '../store';\nexport interface TestRunPipelineEntityOptions {\n plugins: (new () => TestRunPipelinePlugin)[];\n}\n\ninterface TestRunPipelineEntityState<T = any> {\n status: 'idle' | 'preparing' | 'executing' | 'canceled' | 'finished' | 'disposed';\n data?: T;\n result?: any;\n getData: () => T;\n setData: (next: any) => void;\n}\n\nexport interface TestRunPipelineEntityCtx<T = any> {\n id: string;\n store: StoreApi<TestRunPipelineEntityState<T>>;\n operate: {\n update: (data: any) => void;\n cancel: () => void;\n };\n}\n\nconst initialState: Omit<TestRunPipelineEntityState, 'getData' | 'setData'> = {\n status: 'idle',\n data: {},\n};\n\n@injectable()\nexport class TestRunPipelineEntity extends StoreService<TestRunPipelineEntityState> {\n container: interfaces.Container | undefined;\n\n id = nanoid();\n\n plugins: TestRunPipelinePlugin[] = [];\n\n prepare = new Tap<TestRunPipelineEntityCtx>();\n\n private execute?: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void;\n\n private progress?: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void;\n\n get status() {\n return this.getState().status;\n }\n\n set status(next: TestRunPipelineEntityState['status']) {\n this.setState({ status: next });\n }\n\n onProgressEmitter = new Emitter<any>();\n\n onProgress = this.onProgressEmitter.event;\n\n onFinishedEmitter = new Emitter();\n\n onFinished = this.onFinishedEmitter.event;\n\n constructor() {\n super((set, get) => ({\n ...initialState,\n getData: () => get().data || {},\n setData: (next: any) => set((state) => ({ ...state, data: { ...state.data, ...next } })),\n }));\n }\n\n public init(options: TestRunPipelineEntityOptions) {\n if (!this.container) {\n return;\n }\n const { plugins } = options;\n for (const PluginClass of plugins) {\n const plugin = this.container.resolve<TestRunPipelinePlugin>(PluginClass);\n plugin.apply(this);\n this.plugins.push(plugin);\n }\n }\n\n public registerExecute(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void) {\n this.execute = fn;\n }\n\n public registerProgress(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void) {\n this.progress = fn;\n }\n\n async start<T>(options?: { data: T }) {\n const { data } = options || {};\n if (this.status !== 'idle') {\n return;\n }\n /** initialization data */\n this.setState({ data });\n const ctx: TestRunPipelineEntityCtx = {\n id: this.id,\n store: this.store,\n operate: {\n update: this.update.bind(this),\n cancel: this.cancel.bind(this),\n },\n };\n\n this.status = 'preparing';\n await this.prepare.call(ctx);\n if (this.status !== 'preparing') {\n return;\n }\n\n this.status = 'executing';\n if (this.execute) {\n await this.execute(ctx);\n }\n if (this.progress) {\n await this.progress(ctx);\n }\n if (this.status === 'executing') {\n this.status = 'finished';\n this.onFinishedEmitter.fire(this.getState().result);\n }\n }\n\n update(result: any) {\n this.setState({ result });\n this.onProgressEmitter.fire(result);\n }\n\n cancel() {\n if ((this.status = 'preparing')) {\n this.prepare.freeze();\n }\n this.status = 'canceled';\n }\n\n dispose() {\n this.status = 'disposed';\n this.plugins.forEach((p) => {\n if (p.dispose) {\n p.dispose();\n }\n });\n this.onProgressEmitter.dispose();\n this.onFinishedEmitter.dispose();\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram-vue/core';\n\nimport { TestRunFormEntity, TestRunFormFactory, TestRunFormManager } from './services/form';\nimport {\n TestRunService,\n TestRunPipelineEntity,\n TestRunPipelineFactory,\n TestRunConfig,\n defineConfig,\n} from './services';\n\nexport const createTestRunPlugin = definePluginCreator<Partial<TestRunConfig>>({\n onBind: ({ bind }, opt) => {\n /** service */\n bind(TestRunService).toSelf().inSingletonScope();\n /** config */\n bind(TestRunConfig).toConstantValue(defineConfig(opt));\n /** form manager */\n bind(TestRunFormManager).toSelf().inSingletonScope();\n /** form entity */\n bind<TestRunFormFactory>(TestRunFormFactory).toFactory<TestRunFormEntity>((context) => () => {\n const e = context.container.resolve(TestRunFormEntity);\n return e;\n });\n /** pipeline entity */\n bind<TestRunPipelineFactory>(TestRunPipelineFactory).toFactory<TestRunPipelineEntity>(\n (context) => () => {\n const e = context.container.resolve(TestRunPipelineEntity);\n e.container = context.container.createChild();\n return e;\n }\n );\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram-vue/core';\n\nimport { TestRunService } from '../../services/test-run';\n\nexport const useTestRunService = () => useService<TestRunService>(TestRunService);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { computed, onBeforeUnmount, ref, shallowRef, watch, type VNode } from 'vue';\n\nimport { DisposableCollection } from '@flowgram-vue/utils';\nimport type { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { TestRunFormEntity } from '../../services/form/form';\nimport { FormEngineProps, isFormEmpty } from '../../form-engine';\nimport { useTestRunService } from './use-test-run-service';\n\ninterface UseFormOptions {\n node?: FlowNodeEntity;\n /** form loading */\n loadingRenderer?: VNode | null;\n /** form empty */\n emptyRenderer?: VNode | null;\n defaultValues?: FormEngineProps['defaultValues'];\n onMounted?: FormEngineProps['onMounted'];\n onUnmounted?: FormEngineProps['onUnmounted'];\n onFormValuesChange?: FormEngineProps['onFormValuesChange'];\n}\n\nexport const useCreateForm = ({\n node,\n loadingRenderer,\n emptyRenderer,\n defaultValues,\n onMounted,\n onUnmounted,\n onFormValuesChange,\n}: UseFormOptions) => {\n const testRun = useTestRunService();\n const loading = ref(false);\n const form = shallowRef<TestRunFormEntity | null>(null);\n const renderer = computed(() => {\n if (loading.value || !form.value) {\n return loadingRenderer;\n }\n\n const isEmpty = isFormEmpty(form.value.schema);\n\n return form.value.render({\n defaultValues,\n onFormValuesChange,\n children: isEmpty ? emptyRenderer : null,\n });\n });\n\n const compute = async () => {\n if (!node) {\n return;\n }\n try {\n loading.value = true;\n const formEntity = await testRun.createForm(node);\n form.value = formEntity;\n } finally {\n loading.value = false;\n }\n };\n\n watch(\n () => node,\n () => {\n void compute();\n },\n { immediate: true }\n );\n\n watch(\n form,\n (next, _prev, onCleanup) => {\n if (!next) {\n return;\n }\n const disposable = new DisposableCollection(\n next.onFormMounted((data) => {\n onMounted?.(data);\n }),\n next.onFormUnmounted(() => {\n onUnmounted?.();\n })\n );\n onCleanup(() => disposable.dispose());\n }\n );\n\n onBeforeUnmount(() => {\n form.value = null;\n });\n\n return {\n renderer,\n loading,\n form,\n };\n};\n"]}
@@ -0,0 +1,408 @@
1
+ import * as _flowgram_vue_core from '@flowgram-vue/core';
2
+ import { FlowNodeType, FlowNodeEntity } from '@flowgram-vue/document';
3
+ import * as vue from 'vue';
4
+ import { VNode, Component, PropType } from 'vue';
5
+ import * as _flowgram_vue_form from '@flowgram-vue/form';
6
+ import { Validate, FieldState, ValidateTrigger, IForm } from '@flowgram-vue/form';
7
+ import * as _flowgram_vue_utils from '@flowgram-vue/utils';
8
+ import { Emitter, Disposable } from '@flowgram-vue/utils';
9
+ import { StoreApi, StateCreator } from 'zustand';
10
+ import { interfaces } from 'inversify';
11
+ import * as _flowgram_vue_form_core from '@flowgram-vue/form-core';
12
+ import { OnFormValuesChangePayload } from '@flowgram-vue/form-core';
13
+ import { ReactiveState } from '@flowgram-vue/reactive';
14
+
15
+ /**
16
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
17
+ * SPDX-License-Identifier: MIT
18
+ */
19
+
20
+ /** field type */
21
+ type FormSchemaType = 'string' | 'number' | 'boolean' | 'object' | string;
22
+ type FormSchemaValidate = Validate;
23
+ interface FormSchema {
24
+ /** core */
25
+ name?: string;
26
+ type?: FormSchemaType;
27
+ defaultValue?: any;
28
+ /** children */
29
+ properties?: Record<string, FormSchema>;
30
+ /** ui */
31
+ title?: string | VNode;
32
+ description?: string | VNode;
33
+ ['x-index']?: number;
34
+ ['x-visible']?: boolean;
35
+ ['x-hidden']?: boolean;
36
+ ['x-component']?: string;
37
+ ['x-component-props']?: Record<string, unknown>;
38
+ ['x-decorator']?: string;
39
+ ['x-decorator-props']?: Record<string, unknown>;
40
+ /** rule */
41
+ required?: boolean;
42
+ ['x-validator']?: FormSchemaValidate;
43
+ /** custom */
44
+ [key: string]: any;
45
+ }
46
+ type FormComponentProps = {
47
+ type?: FormSchemaType;
48
+ disabled?: boolean;
49
+ [key: string]: any;
50
+ } & FormSchema['x-component-props'] & FormSchema['x-decorator-props'] & Partial<FieldState>;
51
+ type FormComponent = Component;
52
+ type FormComponents = Record<string, FormComponent>;
53
+ /** ui state */
54
+ interface FormSchemaModelState {
55
+ disabled: boolean;
56
+ }
57
+
58
+ /**
59
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
60
+ * SPDX-License-Identifier: MIT
61
+ */
62
+
63
+ declare class FormSchemaModel implements FormSchema {
64
+ name?: string;
65
+ type?: FormSchemaType;
66
+ defaultValue?: any;
67
+ properties?: Record<string, FormSchema>;
68
+ ['x-index']?: number;
69
+ ['x-component']?: string;
70
+ ['x-component-props']?: Record<string, unknown>;
71
+ ['x-decorator']?: string;
72
+ ['x-decorator-props']?: Record<string, unknown>;
73
+ [key: string]: any;
74
+ path: string[];
75
+ state: ReactiveState<FormSchemaModelState>;
76
+ get componentType(): string | undefined;
77
+ get componentProps(): Record<string, unknown> | undefined;
78
+ get decoratorType(): string | undefined;
79
+ get decoratorProps(): Record<string, unknown> | undefined;
80
+ get uniqueName(): string;
81
+ constructor(json: FormSchema, path?: string[]);
82
+ private fromJSON;
83
+ getPropertyList(): FormSchemaModel[];
84
+ }
85
+
86
+ interface FormInstance {
87
+ model: FormSchemaModel;
88
+ form: IForm;
89
+ }
90
+ interface UseCreateFormOptions {
91
+ defaultValues?: any;
92
+ validate?: Record<string, FormSchemaValidate>;
93
+ validateTrigger?: ValidateTrigger;
94
+ onMounted?: (form: FormInstance) => void;
95
+ onFormValuesChange?: (payload: OnFormValuesChangePayload) => void;
96
+ onUnmounted?: () => void;
97
+ }
98
+
99
+ type FormEngineProps = {
100
+ /** Form schema */
101
+ schema: FormSchema;
102
+ /** form material map */
103
+ components?: FormComponents;
104
+ children?: VNode | VNode[] | null;
105
+ } & UseCreateFormOptions;
106
+ declare const FormEngine: vue.DefineComponent<vue.ExtractPropTypes<{
107
+ schema: {
108
+ type: PropType<FormSchema>;
109
+ required: true;
110
+ };
111
+ components: {
112
+ type: PropType<FormComponents>;
113
+ default: undefined;
114
+ };
115
+ defaultValues: {
116
+ default: undefined;
117
+ };
118
+ validate: {
119
+ type: ObjectConstructor;
120
+ default: undefined;
121
+ };
122
+ validateTrigger: {
123
+ default: undefined;
124
+ };
125
+ onMounted: {
126
+ type: PropType<UseCreateFormOptions["onMounted"]>;
127
+ default: undefined;
128
+ };
129
+ onFormValuesChange: {
130
+ type: PropType<UseCreateFormOptions["onFormValuesChange"]>;
131
+ default: undefined;
132
+ };
133
+ onUnmounted: {
134
+ type: PropType<UseCreateFormOptions["onUnmounted"]>;
135
+ default: undefined;
136
+ };
137
+ }>, () => VNode<vue.RendererNode, vue.RendererElement, {
138
+ [key: string]: any;
139
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
140
+ schema: {
141
+ type: PropType<FormSchema>;
142
+ required: true;
143
+ };
144
+ components: {
145
+ type: PropType<FormComponents>;
146
+ default: undefined;
147
+ };
148
+ defaultValues: {
149
+ default: undefined;
150
+ };
151
+ validate: {
152
+ type: ObjectConstructor;
153
+ default: undefined;
154
+ };
155
+ validateTrigger: {
156
+ default: undefined;
157
+ };
158
+ onMounted: {
159
+ type: PropType<UseCreateFormOptions["onMounted"]>;
160
+ default: undefined;
161
+ };
162
+ onFormValuesChange: {
163
+ type: PropType<UseCreateFormOptions["onFormValuesChange"]>;
164
+ default: undefined;
165
+ };
166
+ onUnmounted: {
167
+ type: PropType<UseCreateFormOptions["onUnmounted"]>;
168
+ default: undefined;
169
+ };
170
+ }>> & Readonly<{}>, {
171
+ components: FormComponents;
172
+ validateTrigger: undefined;
173
+ validate: Record<string, any>;
174
+ onMounted: ((form: FormInstance) => void) | undefined;
175
+ onFormValuesChange: ((payload: _flowgram_vue_form_core.OnFormValuesChangePayload) => void) | undefined;
176
+ onUnmounted: (() => void) | undefined;
177
+ defaultValues: undefined;
178
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
179
+
180
+ declare const connect: <T = any>(Comp: Component, mapProps: (p: FormComponentProps) => T) => vue.DefineComponent<{
181
+ [x: string]: /*elided*/ any;
182
+ type?: FormSchemaType | undefined;
183
+ disabled?: boolean | undefined;
184
+ invalid?: boolean | undefined;
185
+ isTouched?: boolean | undefined;
186
+ isDirty?: boolean | undefined;
187
+ isValidating?: boolean | undefined;
188
+ errors?: _flowgram_vue_form.FieldError[] | undefined;
189
+ warnings?: _flowgram_vue_form.FieldWarning[] | undefined;
190
+ }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
191
+ [key: string]: any;
192
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{
193
+ [x: string]: /*elided*/ any;
194
+ type?: FormSchemaType | undefined;
195
+ disabled?: boolean | undefined;
196
+ invalid?: boolean | undefined;
197
+ isTouched?: boolean | undefined;
198
+ isDirty?: boolean | undefined;
199
+ isValidating?: boolean | undefined;
200
+ errors?: _flowgram_vue_form.FieldError[] | undefined;
201
+ warnings?: _flowgram_vue_form.FieldWarning[] | undefined;
202
+ }> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
203
+
204
+ type FormRenderProps = Omit<FormEngineProps, 'schema' | 'components' | 'onMounted' | 'onUnmounted'>;
205
+ declare class TestRunFormEntity {
206
+ private readonly config;
207
+ private _schema;
208
+ private initialized;
209
+ id: string;
210
+ form: FormInstance | null;
211
+ onFormMountedEmitter: Emitter<FormInstance>;
212
+ onFormMounted: _flowgram_vue_utils.Event<FormInstance>;
213
+ onFormUnmountedEmitter: Emitter<void>;
214
+ onFormUnmounted: _flowgram_vue_utils.Event<void>;
215
+ get schema(): FormSchema;
216
+ init(options: {
217
+ schema: FormSchema;
218
+ }): void;
219
+ render(props?: FormRenderProps): VNode | null;
220
+ dispose(): void;
221
+ }
222
+
223
+ /**
224
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
225
+ * SPDX-License-Identifier: MIT
226
+ */
227
+
228
+ declare class TestRunFormManager {
229
+ private readonly factory;
230
+ private entities;
231
+ createForm(): TestRunFormEntity;
232
+ getForm(id: string): TestRunFormEntity | undefined;
233
+ getAllForm(): [string, TestRunFormEntity][];
234
+ disposeForm(id: string): void;
235
+ disposeAllForm(): void;
236
+ }
237
+
238
+ /**
239
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
240
+ * SPDX-License-Identifier: MIT
241
+ */
242
+
243
+ type MaybePromise<T> = T | Promise<T>;
244
+
245
+ /**
246
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
247
+ * SPDX-License-Identifier: MIT
248
+ */
249
+
250
+ interface TapValue<T> {
251
+ name: string;
252
+ fn: (arg: T) => MaybePromise<void>;
253
+ }
254
+ declare class Tap<T> {
255
+ private taps;
256
+ private frozen;
257
+ tap(name: string, fn: TapValue<T>['fn']): void;
258
+ call(ctx: T): Promise<void>;
259
+ freeze(): void;
260
+ }
261
+
262
+ /**
263
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
264
+ * SPDX-License-Identifier: MIT
265
+ */
266
+
267
+ interface TestRunPipelinePlugin {
268
+ name: string;
269
+ apply(pipeline: TestRunPipelineEntity): void;
270
+ dispose?: () => void;
271
+ }
272
+
273
+ /**
274
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
275
+ * SPDX-License-Identifier: MIT
276
+ */
277
+
278
+ /**
279
+ * 包含 Store 的 Service
280
+ */
281
+ declare class StoreService<State> {
282
+ store: StoreApi<State>;
283
+ get getState(): () => State;
284
+ get setState(): (partial: State | Partial<State> | ((state: State) => State | Partial<State>), replace?: boolean | undefined) => void;
285
+ constructor(stateCreator: StateCreator<State>);
286
+ }
287
+
288
+ interface TestRunPipelineEntityOptions {
289
+ plugins: (new () => TestRunPipelinePlugin)[];
290
+ }
291
+ interface TestRunPipelineEntityState<T = any> {
292
+ status: 'idle' | 'preparing' | 'executing' | 'canceled' | 'finished' | 'disposed';
293
+ data?: T;
294
+ result?: any;
295
+ getData: () => T;
296
+ setData: (next: any) => void;
297
+ }
298
+ interface TestRunPipelineEntityCtx<T = any> {
299
+ id: string;
300
+ store: StoreApi<TestRunPipelineEntityState<T>>;
301
+ operate: {
302
+ update: (data: any) => void;
303
+ cancel: () => void;
304
+ };
305
+ }
306
+ declare class TestRunPipelineEntity extends StoreService<TestRunPipelineEntityState> {
307
+ container: interfaces.Container | undefined;
308
+ id: string;
309
+ plugins: TestRunPipelinePlugin[];
310
+ prepare: Tap<TestRunPipelineEntityCtx<any>>;
311
+ private execute?;
312
+ private progress?;
313
+ get status(): TestRunPipelineEntityState["status"];
314
+ set status(next: TestRunPipelineEntityState['status']);
315
+ onProgressEmitter: Emitter<any>;
316
+ onProgress: _flowgram_vue_utils.Event<any>;
317
+ onFinishedEmitter: Emitter<any>;
318
+ onFinished: _flowgram_vue_utils.Event<any>;
319
+ constructor();
320
+ init(options: TestRunPipelineEntityOptions): void;
321
+ registerExecute(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void): void;
322
+ registerProgress(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void): void;
323
+ start<T>(options?: {
324
+ data: T;
325
+ }): Promise<void>;
326
+ update(result: any): void;
327
+ cancel(): void;
328
+ dispose(): void;
329
+ }
330
+
331
+ declare class TestRunService {
332
+ private readonly config;
333
+ private readonly pipelineFactory;
334
+ readonly formManager: TestRunFormManager;
335
+ pipelineEntities: Map<string, TestRunPipelineEntity>;
336
+ pipelineBindings: Map<string, Disposable>;
337
+ onPipelineProgressEmitter: Emitter<any>;
338
+ onPipelineProgress: _flowgram_vue_utils.Event<any>;
339
+ onPipelineFinishedEmitter: Emitter<any>;
340
+ onPipelineFinished: _flowgram_vue_utils.Event<any>;
341
+ isEnabled(nodeType: FlowNodeType): boolean;
342
+ toSchema(node: FlowNodeEntity): Promise<{
343
+ type?: undefined;
344
+ properties?: undefined;
345
+ } | {
346
+ type: string;
347
+ properties: Record<string, FormSchema> | undefined;
348
+ }>;
349
+ createFormWithSchema(schema: FormSchema): TestRunFormEntity;
350
+ createForm(node: FlowNodeEntity): Promise<TestRunFormEntity>;
351
+ createPipeline(options: TestRunPipelineEntityOptions): TestRunPipelineEntity;
352
+ disposePipeline(id: string): void;
353
+ connectPipeline(pipeline: TestRunPipelineEntity): void;
354
+ disconnectPipeline(id: string): void;
355
+ disconnectAllPipeline(): void;
356
+ }
357
+
358
+ /**
359
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
360
+ * SPDX-License-Identifier: MIT
361
+ */
362
+
363
+ type PropertiesFunctionParams = {
364
+ node: FlowNodeEntity;
365
+ };
366
+ type NodeMap = Record<FlowNodeType, NodeTestConfig>;
367
+ interface NodeTestConfig {
368
+ /** Enable node TestRun */
369
+ enabled?: boolean;
370
+ /** Input schema properties */
371
+ properties?: Record<string, FormSchema> | ((params: PropertiesFunctionParams) => MaybePromise<Record<string, FormSchema>>);
372
+ }
373
+ interface TestRunConfig {
374
+ components: FormComponents;
375
+ nodes: NodeMap;
376
+ plugins: (new () => TestRunPipelinePlugin)[];
377
+ }
378
+ declare const TestRunConfig: unique symbol;
379
+
380
+ declare const createTestRunPlugin: _flowgram_vue_core.PluginCreator<Partial<TestRunConfig>>;
381
+
382
+ interface UseFormOptions {
383
+ node?: FlowNodeEntity;
384
+ /** form loading */
385
+ loadingRenderer?: VNode | null;
386
+ /** form empty */
387
+ emptyRenderer?: VNode | null;
388
+ defaultValues?: FormEngineProps['defaultValues'];
389
+ onMounted?: FormEngineProps['onMounted'];
390
+ onUnmounted?: FormEngineProps['onUnmounted'];
391
+ onFormValuesChange?: FormEngineProps['onFormValuesChange'];
392
+ }
393
+ declare const useCreateForm: ({ node, loadingRenderer, emptyRenderer, defaultValues, onMounted, onUnmounted, onFormValuesChange, }: UseFormOptions) => {
394
+ renderer: vue.ComputedRef<VNode<vue.RendererNode, vue.RendererElement, {
395
+ [key: string]: any;
396
+ }> | null | undefined>;
397
+ loading: vue.Ref<boolean, boolean>;
398
+ form: vue.ShallowRef<TestRunFormEntity | null, TestRunFormEntity | null>;
399
+ };
400
+
401
+ /**
402
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
403
+ * SPDX-License-Identifier: MIT
404
+ */
405
+
406
+ declare const useTestRunService: () => TestRunService;
407
+
408
+ export { type FormComponentProps, FormEngine, type FormEngineProps, type FormInstance, type FormSchema, TestRunConfig, TestRunPipelineEntity, type TestRunPipelineEntityCtx, type TestRunPipelinePlugin, connect, createTestRunPlugin, useCreateForm, useTestRunService };