@yiyi_zhang/reactflow-ui 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AiWorkflowIDE.d.ts +28 -0
- package/dist/WorkflowIDE.d.ts +30 -0
- package/dist/actions/fromDefinitions.d.ts +70 -0
- package/dist/actions/registry.d.ts +1 -0
- package/dist/actions/types.d.ts +26 -0
- package/dist/ai.d.ts +25 -0
- package/dist/components/AiNative/AiCommandCenter.d.ts +4 -0
- package/dist/components/business/ActionPickerModal.d.ts +25 -0
- package/dist/components/business/DataPillInput.d.ts +2 -0
- package/dist/components/business/DecisionBranchCard.d.ts +2 -0
- package/dist/components/business/ForkJoinCard.d.ts +2 -0
- package/dist/components/business/LibraryVersionBadge.d.ts +29 -0
- package/dist/components/business/LoopDoWhileCard.d.ts +2 -0
- package/dist/components/business/NestedControlStep.d.ts +22 -0
- package/dist/components/business/StepFlowEditor.d.ts +15 -0
- package/dist/components/business/StepListEditor.d.ts +29 -0
- package/dist/components/import/ApiImportDialog.d.ts +27 -0
- package/dist/components/onboarding/ModalShell.d.ts +15 -0
- package/dist/components/onboarding/OnboardingController.d.ts +67 -0
- package/dist/components/onboarding/OnboardingGuideCard.d.ts +10 -0
- package/dist/components/onboarding/OnboardingWizard.d.ts +42 -0
- package/dist/components/onboarding/PromotionPanel.d.ts +20 -0
- package/dist/components/onboarding/WorkflowNameBuilder.d.ts +19 -0
- package/dist/components/onboarding/index.d.ts +8 -0
- package/dist/components/onboarding/styles.d.ts +11 -0
- package/dist/components/onboarding/useOnboardingData.d.ts +17 -0
- package/dist/components/template/TemplateGallery.d.ts +2 -0
- package/dist/components/template/TemplateSetupWizard.d.ts +2 -0
- package/dist/import/buildAction.d.ts +23 -0
- package/dist/import/common.d.ts +17 -0
- package/dist/import/curl.d.ts +12 -0
- package/dist/import/detect.d.ts +9 -0
- package/dist/import/index.d.ts +10 -0
- package/dist/import/insert.d.ts +16 -0
- package/dist/import/openapi.d.ts +9 -0
- package/dist/import/postman.d.ts +9 -0
- package/dist/import/schema.d.ts +15 -0
- package/dist/import/sensitive.d.ts +18 -0
- package/dist/import/types.d.ts +62 -0
- package/dist/import/util.d.ts +23 -0
- package/dist/index.d.ts +23 -1
- package/dist/library/catalog.d.ts +93 -0
- package/dist/library/conductorProvider.d.ts +41 -0
- package/dist/library/diff.d.ts +62 -0
- package/dist/library/index.d.ts +16 -0
- package/dist/library/level.d.ts +6 -0
- package/dist/library/naming.d.ts +28 -0
- package/dist/library/projections.d.ts +53 -0
- package/dist/library/types.d.ts +58 -0
- package/dist/library/useLibraryCatalog.d.ts +9 -0
- package/dist/library/version.d.ts +17 -0
- package/dist/library/versionStatus.d.ts +44 -0
- package/dist/onboarding/index.d.ts +6 -0
- package/dist/onboarding/naming.d.ts +41 -0
- package/dist/onboarding/poll.d.ts +39 -0
- package/dist/onboarding/wizardState.d.ts +44 -0
- package/dist/product-launch.html +3 -3
- package/dist/providers/WorkflowIdeProvider.d.ts +23 -0
- package/dist/providers/resolve.d.ts +20 -0
- package/dist/providers/types.d.ts +65 -0
- package/dist/reactflow-ui-ai.es.js +18748 -10262
- package/dist/reactflow-ui.css +1 -1
- package/dist/reactflow-ui.es.js +12741 -8916
- package/dist/reactflow-ui.umd.js +38 -23
- package/dist/sample-imports/cmdb-openapi3.json +334 -0
- package/dist/sample-imports/cmdb-postman.json +100 -0
- package/dist/sample-imports/ticket-swagger2.json +231 -0
- package/dist/sample-workflows/library-capabilities-demo.json +66 -0
- package/dist/services/ai/agentRunner.d.ts +11 -0
- package/dist/services/ai/schemaRegistry.d.ts +7 -1
- package/dist/services/ai/systemPrompt.d.ts +11 -0
- package/dist/services/ai/toolExecutor.d.ts +12 -0
- package/dist/services/ai/workflowSynthesizer.d.ts +28 -3
- package/dist/stepmodel/compile.d.ts +6 -0
- package/dist/stepmodel/decompile.d.ts +5 -0
- package/dist/stepmodel/factory.d.ts +8 -0
- package/dist/stepmodel/types.d.ts +3 -0
- package/dist/store/ideStoresContext.d.ts +3 -0
- package/dist/store/sandboxRunObserver.d.ts +19 -0
- package/dist/store/workflowStore.d.ts +1 -0
- package/dist/telemetry/buffer.d.ts +37 -0
- package/dist/telemetry/once.d.ts +11 -0
- package/dist/telemetry/track.d.ts +17 -0
- package/dist/telemetry/types.d.ts +24 -0
- package/dist/telemetry/useTelemetry.d.ts +22 -0
- package/dist/types/conductor.d.ts +13 -8
- package/dist/types/workflow.d.ts +9 -0
- package/dist/types/workflowLibrary.d.ts +2 -0
- package/dist/utils/taskTypeMeta.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/AiNative/BusinessCanvas.d.ts +0 -15
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProductInfo } from '../../providers/types';
|
|
2
|
+
import type { WorkflowNameParts } from '../../onboarding/naming';
|
|
3
|
+
export interface WorkflowNameBuilderProps {
|
|
4
|
+
/** 可选的所属产品(我的产品);业务域取自所选产品 */
|
|
5
|
+
products: ProductInfo[];
|
|
6
|
+
/** 允许的业务域列表;提供时参与校验 */
|
|
7
|
+
domains?: string[];
|
|
8
|
+
/** 试用环境:类型固定为 tmp;否则可选 custom / std */
|
|
9
|
+
trial: boolean;
|
|
10
|
+
value: WorkflowNameParts;
|
|
11
|
+
onChange: (next: WorkflowNameParts) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 五段式命名生成器:`类型-层级-业务域-产品-功能`。
|
|
16
|
+
* 受控组件:类型(试用固定 tmp)、层级、产品(下拉我的产品,业务域随产品带出)、功能(自由输入,推荐 snake_case),
|
|
17
|
+
* 实时预览完整名称并用 `validateWorkflowName` 校验。
|
|
18
|
+
*/
|
|
19
|
+
export declare function WorkflowNameBuilder({ products, domains, trial, value, onChange, disabled }: WorkflowNameBuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { WorkflowNameBuilder } from './WorkflowNameBuilder';
|
|
2
|
+
export type { WorkflowNameBuilderProps } from './WorkflowNameBuilder';
|
|
3
|
+
export { OnboardingWizard } from './OnboardingWizard';
|
|
4
|
+
export type { OnboardingWizardProps, OnboardingCreateResult } from './OnboardingWizard';
|
|
5
|
+
export { PromotionPanel } from './PromotionPanel';
|
|
6
|
+
export type { PromotionPanelProps } from './PromotionPanel';
|
|
7
|
+
export { OnboardingGuideCard } from './OnboardingGuideCard';
|
|
8
|
+
export type { OnboardingGuideCardProps } from './OnboardingGuideCard';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/** 自助接入组件共用的内联样式:只使用主题 CSS 变量,弹窗根节点另行设置 data-mode / data-brand */
|
|
3
|
+
export declare const labelStyle: CSSProperties;
|
|
4
|
+
export declare const inputStyle: CSSProperties;
|
|
5
|
+
export declare const hintStyle: CSSProperties;
|
|
6
|
+
export declare const errorStyle: CSSProperties;
|
|
7
|
+
export declare const buttonBase: CSSProperties;
|
|
8
|
+
export declare const primaryButton: CSSProperties;
|
|
9
|
+
export declare const ghostButton: CSSProperties;
|
|
10
|
+
export declare function disabledStyle(base: CSSProperties, disabled: boolean): CSSProperties;
|
|
11
|
+
export declare const noticeStyle: (kind: "error" | "warning" | "success") => CSSProperties;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OnboardingContext, OnboardingProvider, ProductInfo } from '../../providers/types';
|
|
2
|
+
export interface OnboardingData {
|
|
3
|
+
status: 'idle' | 'loading' | 'ready' | 'error';
|
|
4
|
+
context: OnboardingContext | null;
|
|
5
|
+
domains: string[];
|
|
6
|
+
products: ProductInfo[];
|
|
7
|
+
error: string | null;
|
|
8
|
+
/** 重新加载(失败后重试) */
|
|
9
|
+
reload: () => void;
|
|
10
|
+
/** 新登记产品后本地追加,避免再请求一次 */
|
|
11
|
+
addProduct: (p: ProductInfo) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 按 provider 实例加载一次:上下文、业务域、我的产品。
|
|
15
|
+
* provider 引用变化时重新加载;卸载或切换时中止进行中的请求。没有 provider 时保持 idle。
|
|
16
|
+
*/
|
|
17
|
+
export declare function useOnboardingData(provider: OnboardingProvider | undefined): OnboardingData;
|
|
@@ -6,5 +6,7 @@ export interface TemplateGalleryProps {
|
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
onSelectTemplate: (configuredDef: WorkflowDef) => void;
|
|
8
8
|
templateStore?: TemplateStore;
|
|
9
|
+
/** 试跑结束(快捷试跑或向导内试跑):参数为最终状态或 'error',用于接入埋点,不含数据 */
|
|
10
|
+
onSandboxRun?: (result: string) => void;
|
|
9
11
|
}
|
|
10
12
|
export declare const TemplateGallery: React.FC<TemplateGalleryProps>;
|
|
@@ -5,5 +5,7 @@ export interface TemplateSetupWizardProps {
|
|
|
5
5
|
template: WorkflowTemplate;
|
|
6
6
|
onApply: (configuredDef: WorkflowDef) => void;
|
|
7
7
|
onClose: () => void;
|
|
8
|
+
/** 向导内试跑结束:最终状态或 'error'(埋点用,不含数据) */
|
|
9
|
+
onSandboxRun?: (result: string) => void;
|
|
8
10
|
}
|
|
9
11
|
export declare const TemplateSetupWizard: React.FC<TemplateSetupWizardProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ImportedOperation → 业务动作(ActionDefinition)。
|
|
3
|
+
*
|
|
4
|
+
* - 字段:路径参数 / 查询参数 / 请求头参数 / 请求体属性,沿用 `buildFields` 规则(title → 标签、enum → 下拉、
|
|
5
|
+
* 类型 → 控件),全部支持插入数据胶囊;
|
|
6
|
+
* - 出参:2xx 响应 schema,沿用 `buildOutputs`,键为 Conductor HTTP 任务的真实输出路径
|
|
7
|
+
* `response.body.<字段>`,因此数据胶囊引用 `${ref.output.response.body.xxx}` 运行时可直接取到;
|
|
8
|
+
* - 编译:Conductor `HTTP` 任务,`inputParameters` 里保留 `_actionId` 与各字段值,
|
|
9
|
+
* 使步骤重新打开时能被 `decompile` 还原为同一动作(动作未注册时退回「专业步骤」卡片,定义无损)。
|
|
10
|
+
*/
|
|
11
|
+
import type { ActionDefinition } from '../actions/types';
|
|
12
|
+
import type { ImportedOperation } from './types';
|
|
13
|
+
export interface BuildHttpActionOptions {
|
|
14
|
+
/** 已存在的动作 id(完整 id,如 `import.get_tickets`):冲突时自动追加 `_2` 等后缀 */
|
|
15
|
+
existingIds?: Iterable<string>;
|
|
16
|
+
/** 动作 id 前缀,默认 `import` */
|
|
17
|
+
idPrefix?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 由导入的接口生成 HTTP 业务动作。
|
|
21
|
+
* 固定请求头会再做一次敏感值检查(解析器已处理时这里是空操作),保证动作定义里不会出现凭据。
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildHttpAction(op: ImportedOperation, opts?: BuildHttpActionOptions): ActionDefinition;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** 各格式解析器共用的收尾逻辑(纯函数)。 */
|
|
2
|
+
import type { ImportedOperation } from './types';
|
|
3
|
+
import type { ImportedParam } from './types';
|
|
4
|
+
/** 收尾:替换固定请求头里的敏感值,并把提示并入接口的 warnings */
|
|
5
|
+
export declare function finishOperation(op: ImportedOperation): ImportedOperation;
|
|
6
|
+
/** 接口的展示标识:`GET /tickets/{id}` */
|
|
7
|
+
export declare function operationLabel(op: Pick<ImportedOperation, 'method' | 'path'>): string;
|
|
8
|
+
/** 汇总所有接口的提示(带接口前缀,去重) */
|
|
9
|
+
export declare function collectWarnings(ops: ImportedOperation[], extra?: string[]): string[];
|
|
10
|
+
/** 把 JSON 示例的顶层属性作为默认值写入 schema;敏感字段名的默认值换成占位 */
|
|
11
|
+
export declare function schemaWithDefaults(example: unknown, warnings: string[]): Record<string, any>;
|
|
12
|
+
/** 把查询串解析为 query 参数(字面量作为默认值;敏感参数名的值替换为占位) */
|
|
13
|
+
export declare function queryParamsFromString(query: string, warnings: string[]): ImportedParam[];
|
|
14
|
+
/** Content-Type / Accept 由 body.contentType 与 accept 统一输出,不再作为固定头 */
|
|
15
|
+
export declare function dropContentHeaders(headers: Record<string, string>): Record<string, string>;
|
|
16
|
+
/** 不区分大小写取请求头的值 */
|
|
17
|
+
export declare function findHeader(headers: Record<string, string>, name: string): string | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* curl 命令 → ImportedOperation[](恒为 0 或 1 个接口)。
|
|
3
|
+
* 支持:-X、-H(多个)、-d / --data / --data-raw / --data-binary、-u、--url、-G、行尾 `\` 续行、
|
|
4
|
+
* 单引号 / 双引号 / `$'…'`(浏览器「复制为 cURL」)。不执行任何命令。
|
|
5
|
+
*/
|
|
6
|
+
import type { ParseResult } from './types';
|
|
7
|
+
/** 把命令行切成 token(兼容续行与常见引号写法) */
|
|
8
|
+
export declare function tokenizeCurl(input: string): string[];
|
|
9
|
+
/** 提示用的 curl 示例(对话框 placeholder 使用) */
|
|
10
|
+
export declare const CURL_SAMPLE = "curl -X POST 'https://api.example.com/v1/tickets' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer <token>' \\\n -d '{\"title\":\"\u78C1\u76D8\u544A\u8B66\",\"priority\":\"high\"}'";
|
|
11
|
+
/** 解析一条 curl 命令 */
|
|
12
|
+
export declare function parseCurl(command: string): ParseResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 输入格式识别与统一入口(纯函数,不抛异常)。 */
|
|
2
|
+
import type { DetectedFormat, ParseResult } from './types';
|
|
3
|
+
/** 识别输入文本的格式 */
|
|
4
|
+
export declare function detectFormat(text: string): DetectedFormat;
|
|
5
|
+
/**
|
|
6
|
+
* 识别并解析:返回 ParseResult,永不抛异常。
|
|
7
|
+
* YAML 不受支持,返回固定提示 {@link YAML_HINT}。
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseApiText(text: string): ParseResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { detectFormat, parseApiText } from './detect';
|
|
3
|
+
export { parseOpenApi3, parseSwagger2 } from './openapi';
|
|
4
|
+
export { parsePostman21 } from './postman';
|
|
5
|
+
export { parseCurl, tokenizeCurl, CURL_SAMPLE } from './curl';
|
|
6
|
+
export { buildHttpAction } from './buildAction';
|
|
7
|
+
export type { BuildHttpActionOptions } from './buildAction';
|
|
8
|
+
export { appendImportedActions, blankImportWorkflow, collectWorkflowInputRefs } from './insert';
|
|
9
|
+
export { resolveSchema } from './schema';
|
|
10
|
+
export { isSensitiveHeader, sanitizeHeaders, inputPlaceholder } from './sensitive';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 把导入生成的动作作为步骤追加到流程末尾(纯函数,业务模式与专业模式共用)。
|
|
3
|
+
* B2 向导的「从接口导入」也可直接复用。
|
|
4
|
+
*/
|
|
5
|
+
import type { ActionDefinition } from '../actions/types';
|
|
6
|
+
import type { TaskDef, WorkflowDef } from '../types/conductor';
|
|
7
|
+
/** 没有当前流程时使用的空白骨架 */
|
|
8
|
+
export declare function blankImportWorkflow(name?: string): WorkflowDef;
|
|
9
|
+
/** 取出任务里引用的 `${workflow.input.xxx}` 的顶层入参名 */
|
|
10
|
+
export declare function collectWorkflowInputRefs(tasks: TaskDef[]): string[];
|
|
11
|
+
/**
|
|
12
|
+
* 为每个动作按默认值生成一个步骤并追加到 `def.tasks` 末尾;
|
|
13
|
+
* 步骤引用的 `${workflow.input.xxx}`(敏感头占位、路径参数默认值等)会补进流程的入参声明。
|
|
14
|
+
* 不修改入参,返回新的定义。
|
|
15
|
+
*/
|
|
16
|
+
export declare function appendImportedActions(def: WorkflowDef | null | undefined, actions: ActionDefinition[]): WorkflowDef;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI 3.x / Swagger 2.0(JSON 文档对象)→ ImportedOperation[]。
|
|
3
|
+
* 只做解析,不发请求;解析失败返回 { ok: false },不抛异常。
|
|
4
|
+
*/
|
|
5
|
+
import type { ParseResult } from './types';
|
|
6
|
+
/** 解析 OpenAPI 3.x 文档对象 */
|
|
7
|
+
export declare function parseOpenApi3(doc: unknown): ParseResult;
|
|
8
|
+
/** 解析 Swagger 2.0 文档对象 */
|
|
9
|
+
export declare function parseSwagger2(doc: unknown): ParseResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Postman Collection v2.1(JSON 文档对象)→ ImportedOperation[]。
|
|
3
|
+
* Postman 变量 `{{var}}` 转为 `${workflow.input.var}`;认证配置只生成占位,不读取凭据值。
|
|
4
|
+
*/
|
|
5
|
+
import type { ParseResult } from './types';
|
|
6
|
+
/** `{{var}}` → `${workflow.input.var}`;记录用到的变量名 */
|
|
7
|
+
export declare function convertPostmanVars(text: string, used?: Set<string>): string;
|
|
8
|
+
/** 解析 Postman Collection v2.1 文档对象 */
|
|
9
|
+
export declare function parsePostman21(doc: unknown): ParseResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Schema 本地 `$ref` 解析(OpenAPI 3 `#/components/schemas/...`、Swagger 2 `#/definitions/...`)。
|
|
3
|
+
* 防循环引用,最大展开深度 6;不处理远程引用。
|
|
4
|
+
*/
|
|
5
|
+
import type { JsonSchema } from './types';
|
|
6
|
+
export declare const MAX_SCHEMA_DEPTH = 6;
|
|
7
|
+
/** 按 JSON Pointer(`#/a/b`)取值,找不到返回 undefined */
|
|
8
|
+
export declare function resolvePointer(root: unknown, ref: string): unknown;
|
|
9
|
+
/** 解开非 schema 对象(parameter / requestBody / response)上的 `$ref`,最多跳 10 次 */
|
|
10
|
+
export declare function derefObject<T = any>(node: unknown, root: unknown): T | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 解析 schema:展开本地 `$ref` 与 allOf,oneOf / anyOf 取第一个分支。
|
|
13
|
+
* 超过深度上限的节点只保留类型;循环引用处截断为 `{ type: 'object' }` 并在 warnings 中提示一次。
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveSchema(schema: unknown, root: unknown, warnings?: string[], maxDepth?: number): JsonSchema;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 敏感信息处理:请求头 / 查询参数 / 请求体字段里的凭据不落入流程定义,
|
|
3
|
+
* 一律替换为 `${workflow.input.xxx}` 占位,并给出提示。
|
|
4
|
+
*/
|
|
5
|
+
export declare function isSensitiveHeader(name: string): boolean;
|
|
6
|
+
/** 查询参数 / 请求体字段名是否敏感 */
|
|
7
|
+
export declare function isSensitiveName(name: string): boolean;
|
|
8
|
+
/** 占位表达式:`${workflow.input.<camelName>}` */
|
|
9
|
+
export declare function inputPlaceholder(name: string): string;
|
|
10
|
+
export declare function sensitiveHeaderWarning(name: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* 替换请求头中的敏感值。已是 `${...}` 表达式的值视为已处理,原样保留。
|
|
13
|
+
* 返回新对象,不修改入参。
|
|
14
|
+
*/
|
|
15
|
+
export declare function sanitizeHeaders(headers: Record<string, string>): {
|
|
16
|
+
headers: Record<string, string>;
|
|
17
|
+
warnings: string[];
|
|
18
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 接口导入:解析结果的公共类型(纯数据,无 React 依赖)。
|
|
3
|
+
* 设计见 docs/design/v1.3.0-自助接入设计.md 第 4 节。
|
|
4
|
+
*/
|
|
5
|
+
/** 可导入的来源格式 */
|
|
6
|
+
export type ImportFormat = 'openapi3' | 'swagger2' | 'postman21' | 'curl';
|
|
7
|
+
/** detectFormat 的结果:除可导入格式外,还可能是 YAML(不支持)或无法识别 */
|
|
8
|
+
export type DetectedFormat = ImportFormat | 'yaml' | 'unknown';
|
|
9
|
+
/** JSON Schema 片段(已解析本地 $ref,保持宽松类型) */
|
|
10
|
+
export type JsonSchema = Record<string, any>;
|
|
11
|
+
export type ParamLocation = 'path' | 'query' | 'header';
|
|
12
|
+
export interface ImportedParam {
|
|
13
|
+
name: string;
|
|
14
|
+
in: ParamLocation;
|
|
15
|
+
required: boolean;
|
|
16
|
+
schema: JsonSchema;
|
|
17
|
+
description?: string;
|
|
18
|
+
/** 导入时带入的默认值(curl / Postman 中的字面量;敏感名称已替换为占位) */
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ImportedBody {
|
|
22
|
+
/** 例如 application/json */
|
|
23
|
+
contentType: string;
|
|
24
|
+
/** object 且含 properties 时拆成多个字段;否则整体作为单个 `body` 字段 */
|
|
25
|
+
schema: JsonSchema;
|
|
26
|
+
}
|
|
27
|
+
export interface ImportedOperation {
|
|
28
|
+
/** 同一次解析内唯一,形如 `get_tickets_id`,用于动作 id(`import.<id>`) */
|
|
29
|
+
id: string;
|
|
30
|
+
/** 大写 HTTP 方法 */
|
|
31
|
+
method: string;
|
|
32
|
+
/** 服务地址(不含路径),可能为空或含 `${workflow.input.xxx}` */
|
|
33
|
+
baseUrl: string;
|
|
34
|
+
/** 路径模板,路径参数写作 `{id}` */
|
|
35
|
+
path: string;
|
|
36
|
+
summary?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
operationId?: string;
|
|
39
|
+
tags: string[];
|
|
40
|
+
params: ImportedParam[];
|
|
41
|
+
/** 固定请求头(敏感头的值已替换为 `${workflow.input.xxx}` 占位) */
|
|
42
|
+
headers: Record<string, string>;
|
|
43
|
+
body?: ImportedBody;
|
|
44
|
+
/** 2xx 响应的 JSON Schema */
|
|
45
|
+
responseSchema?: JsonSchema;
|
|
46
|
+
/** 与该接口相关的提示(敏感头替换、不支持的部分等) */
|
|
47
|
+
warnings: string[];
|
|
48
|
+
}
|
|
49
|
+
export type ParseResult = {
|
|
50
|
+
ok: true;
|
|
51
|
+
format: ImportFormat;
|
|
52
|
+
operations: ImportedOperation[];
|
|
53
|
+
/** 汇总提示(含各接口的提示,已带接口前缀) */
|
|
54
|
+
warnings: string[];
|
|
55
|
+
} | {
|
|
56
|
+
ok: false;
|
|
57
|
+
format?: DetectedFormat;
|
|
58
|
+
/** 面向用户的中文错误信息 */
|
|
59
|
+
error: string;
|
|
60
|
+
};
|
|
61
|
+
/** 提示用户把 YAML 转成 JSON 的固定文案 */
|
|
62
|
+
export declare const YAML_HINT = "YAML \u8BF7\u5148\u8F6C\u4E3A JSON \u540E\u518D\u5BFC\u5165";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** 接口导入内部的小工具(纯函数)。 */
|
|
2
|
+
import type { JsonSchema } from './types';
|
|
3
|
+
export declare const HTTP_METHODS: readonly ["get", "post", "put", "delete", "patch", "head", "options"];
|
|
4
|
+
export declare function isPlainObject(v: unknown): v is Record<string, any>;
|
|
5
|
+
/** 去 BOM、首尾空白 */
|
|
6
|
+
export declare function normalizeText(text: string): string;
|
|
7
|
+
/** 把任意名称转为 snake_case 片段(只保留字母数字) */
|
|
8
|
+
export declare function slugify(raw: string, maxLen?: number): string;
|
|
9
|
+
/** 把名称转为 camelCase(用于 `${workflow.input.xxx}`) */
|
|
10
|
+
export declare function camelName(raw: string): string;
|
|
11
|
+
/** 在已有 id 集合内取唯一 id(冲突时追加 _2、_3…),并登记到集合 */
|
|
12
|
+
export declare function uniqueId(base: string, used: Set<string>): string;
|
|
13
|
+
/** 由一个 JSON 示例值推断简单 schema(不含 default) */
|
|
14
|
+
export declare function inferSchema(value: unknown, depth?: number): JsonSchema;
|
|
15
|
+
/** 取 schema 的主类型(忽略 null) */
|
|
16
|
+
export declare function schemaType(schema: JsonSchema | undefined): string;
|
|
17
|
+
/** 简单的 URL 拆分:baseUrl(协议+主机 或 `${...}` 变量)、路径、查询串 */
|
|
18
|
+
export declare function splitUrl(raw: string): {
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
path: string;
|
|
21
|
+
query: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function safeDecode(s: string): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { WorkflowIDE } from './WorkflowIDE';
|
|
2
2
|
export type { WorkflowIDEProps, WorkflowIDERef } from './WorkflowIDE';
|
|
3
|
-
export type { WorkflowDef, TaskDef, WorkflowInputParam, WorkflowInstance } from './types/conductor';
|
|
3
|
+
export type { WorkflowDef, TaskDef, WorkflowInputParam, WorkflowInstance, SchemaDef } from './types/conductor';
|
|
4
4
|
export { parseWorkflowInputParams } from './types/conductor';
|
|
5
5
|
export type { AIServiceConfig } from './services/aiService';
|
|
6
6
|
export type { ExecutionActions, RestartOptions, ViewMode, RunState, WorkflowExecutionInput } from './types/workflow';
|
|
@@ -12,6 +12,9 @@ export * from './actions/types';
|
|
|
12
12
|
export { ActionRegistry, defaultActionRegistry } from './actions/registry';
|
|
13
13
|
export { BUILTIN_ECS_ACTIONS } from './actions/builtin/ecs';
|
|
14
14
|
export { BUILTIN_COMMON_ACTIONS } from './actions/builtin/common';
|
|
15
|
+
export { buildActionFromWorkflowDef, buildActionFromTaskDef, buildActionsFromLibrary, buildActionsFromTaskDefs, } from './actions/fromDefinitions';
|
|
16
|
+
export type { ActionExtension, RegisteredTaskDef, LibraryWorkflowEntry, RegisteredTaskEntry, } from './actions/fromDefinitions';
|
|
17
|
+
export { createStepFromAction } from './stepmodel/factory';
|
|
15
18
|
export * from './stepmodel/types';
|
|
16
19
|
export { compileStepToTaskDef, compileStepModelToWorkflowDef, } from './stepmodel/compile';
|
|
17
20
|
export { decompileTaskDefToStep, decompileWorkflowDefToStepModel, } from './stepmodel/decompile';
|
|
@@ -37,3 +40,22 @@ export { FriendlyErrorCard } from './components/business/FriendlyErrorCard';
|
|
|
37
40
|
export type { FriendlyErrorCardProps } from './components/business/FriendlyErrorCard';
|
|
38
41
|
export { RunStoryTimeline } from './components/business/RunStoryTimeline';
|
|
39
42
|
export type { RunStoryTimelineProps } from './components/business/RunStoryTimeline';
|
|
43
|
+
export * from './library';
|
|
44
|
+
export type { WorkflowLevel, WorkflowLibraryItem } from './types/workflowLibrary';
|
|
45
|
+
export type { TaskSchema } from './services/ai/schemaRegistry';
|
|
46
|
+
export { WorkflowIdeProvider, useIdeProviders } from './providers/WorkflowIdeProvider';
|
|
47
|
+
export type { WorkflowIdeProviderProps } from './providers/WorkflowIdeProvider';
|
|
48
|
+
export { resolveProviders, stabilizeProviders } from './providers/resolve';
|
|
49
|
+
export type { ProviderSources } from './providers/resolve';
|
|
50
|
+
export type { IdeProviders, OnboardingProvider, OnboardingContext, ProductInfo, StartTrialResult, PromotionStatus, } from './providers/types';
|
|
51
|
+
export { WorkflowNameBuilder, OnboardingWizard, PromotionPanel, OnboardingGuideCard } from './components/onboarding';
|
|
52
|
+
export type { WorkflowNameBuilderProps, OnboardingWizardProps, OnboardingCreateResult, PromotionPanelProps, OnboardingGuideCardProps, } from './components/onboarding';
|
|
53
|
+
export { buildWorkflowName, validateNameParts, suggestFuncSlug, promotionTargetName, isPromotableName, buildSkeletonWorkflow, nextPollDelay, isTerminalPromotionState, buildPromotionTimeline, promotionStateLabel, pollPromotion, } from './onboarding';
|
|
54
|
+
export type { WorkflowNameParts, PromotionTargetType, SkeletonInput, TimelineItem, PromotionState, StartSource } from './onboarding';
|
|
55
|
+
export { createTelemetryBuffer } from './telemetry/buffer';
|
|
56
|
+
export type { TelemetryBuffer, TelemetryBufferOptions } from './telemetry/buffer';
|
|
57
|
+
export type { TelemetrySink, IdeEvent, IdeEventName } from './telemetry/types';
|
|
58
|
+
export { detectFormat, parseApiText, parseOpenApi3, parseSwagger2, parsePostman21, parseCurl, buildHttpAction, appendImportedActions, sanitizeHeaders, } from './import';
|
|
59
|
+
export type { ImportFormat, DetectedFormat, ImportedOperation, ImportedParam, ImportedBody, ParseResult, BuildHttpActionOptions, } from './import';
|
|
60
|
+
export { ApiImportDialog } from './components/import/ApiImportDialog';
|
|
61
|
+
export type { ApiImportDialogProps, ApiImportInsertInfo } from './components/import/ApiImportDialog';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { WorkflowLevel, WorkflowLibraryItem } from '../types/workflowLibrary';
|
|
2
|
+
import type { TaskSchema } from '../services/ai/schemaRegistry';
|
|
3
|
+
import type { LibraryLoadStatus, LibraryProvider, LibrarySearchOptions, LibraryTaskRecord, LibraryWorkflowRecord } from './types';
|
|
4
|
+
/** 规范化后的目录条目(每个 name 只有一个最新版本) */
|
|
5
|
+
export interface LibraryEntry {
|
|
6
|
+
name: string;
|
|
7
|
+
/** 统一为整数 */
|
|
8
|
+
version: number;
|
|
9
|
+
versionLabel?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
level?: WorkflowLevel;
|
|
12
|
+
/** 业务域展示名:优先取 extension.domain,缺省时从流程名称解析 */
|
|
13
|
+
domain?: string;
|
|
14
|
+
tags: string[];
|
|
15
|
+
deprecated: boolean;
|
|
16
|
+
record: LibraryWorkflowRecord;
|
|
17
|
+
/** 条目来源:Provider 提供,或静态 prop(workflowLibrary)。同名时 Provider 优先 */
|
|
18
|
+
source: 'provider' | 'static';
|
|
19
|
+
}
|
|
20
|
+
/** 目录状态快照(引用在每次变化时更新,供 useSyncExternalStore 使用) */
|
|
21
|
+
export interface LibraryCatalogSnapshot {
|
|
22
|
+
status: LibraryLoadStatus;
|
|
23
|
+
error?: Error;
|
|
24
|
+
/** 每次数据 / 状态变化递增,便于作为 useMemo 依赖 */
|
|
25
|
+
revision: number;
|
|
26
|
+
}
|
|
27
|
+
export interface LibraryCatalogOptions {
|
|
28
|
+
/** 兼容旧 `workflowLibrary` prop 的静态条目 */
|
|
29
|
+
staticItems?: WorkflowLibraryItem[];
|
|
30
|
+
/** 兼容旧 `taskSchemas` prop 的静态 Schema */
|
|
31
|
+
staticTaskSchemas?: TaskSchema[];
|
|
32
|
+
}
|
|
33
|
+
/** 把一条记录规范化为目录条目 */
|
|
34
|
+
export declare function entryFromRecord(record: LibraryWorkflowRecord, source: LibraryEntry['source'], onLossy?: (name: string, label: string) => void): LibraryEntry;
|
|
35
|
+
/**
|
|
36
|
+
* 流程库目录:把 Provider 与静态 prop 规范化成一份数据。
|
|
37
|
+
* 每个实例独立(不是全局单例);通过 subscribe / getSnapshot 接入 React。
|
|
38
|
+
*/
|
|
39
|
+
export declare class LibraryCatalog {
|
|
40
|
+
private provider?;
|
|
41
|
+
private staticItems;
|
|
42
|
+
private staticSchemas;
|
|
43
|
+
private providerEntries;
|
|
44
|
+
private providerTasks;
|
|
45
|
+
private merged;
|
|
46
|
+
private versionCache;
|
|
47
|
+
private warned;
|
|
48
|
+
private listeners;
|
|
49
|
+
/** 每次 load / setProvider 递增,用于丢弃过期的异步结果 */
|
|
50
|
+
private generation;
|
|
51
|
+
private controller;
|
|
52
|
+
private snapshot;
|
|
53
|
+
constructor(provider?: LibraryProvider, options?: LibraryCatalogOptions);
|
|
54
|
+
/** 更换数据源:丢弃旧数据与缓存,状态回到 idle(需再调用 load) */
|
|
55
|
+
setProvider(provider?: LibraryProvider): void;
|
|
56
|
+
/** 更新静态条目 / Schema(对应旧 prop 变化) */
|
|
57
|
+
setStatic(options: LibraryCatalogOptions): void;
|
|
58
|
+
hasProvider(): boolean;
|
|
59
|
+
/** Provider 是否支持服务端检索 */
|
|
60
|
+
hasServerSearch(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 拉取目录:同名多版本去重取最大 version。
|
|
63
|
+
* 同一时刻只保留最新一次加载:新的 load / reload / setProvider / abort 会取消上一次(abort 其请求并丢弃其结果);
|
|
64
|
+
* 传入的 signal 被 abort 时同样取消。网络错误记为 error 状态,不抛出。
|
|
65
|
+
*/
|
|
66
|
+
load(signal?: AbortSignal): Promise<void>;
|
|
67
|
+
/** 重新加载(供 UI「点击重试」使用) */
|
|
68
|
+
reload(): Promise<void>;
|
|
69
|
+
/** 取消进行中的加载(组件卸载时调用);已加载的数据保留 */
|
|
70
|
+
abort(): void;
|
|
71
|
+
latest(name: string): LibraryEntry | undefined;
|
|
72
|
+
entries(): LibraryEntry[];
|
|
73
|
+
/** Provider 提供的原子任务定义 */
|
|
74
|
+
tasks(): LibraryTaskRecord[];
|
|
75
|
+
/** 静态 Schema(Provider 未覆盖的部分由 projections 合并) */
|
|
76
|
+
staticTaskSchemas(): TaskSchema[];
|
|
77
|
+
/**
|
|
78
|
+
* 取指定版本的完整定义(历史版本按需获取并缓存)。
|
|
79
|
+
* 找不到返回 null;网络错误向上抛出,由调用方决定如何提示。
|
|
80
|
+
*/
|
|
81
|
+
getVersion(name: string, version: number, signal?: AbortSignal): Promise<LibraryWorkflowRecord | null>;
|
|
82
|
+
/**
|
|
83
|
+
* 服务端检索。Provider 未实现 search 时返回 null,调用方应退回本地匹配。
|
|
84
|
+
* 结果不并入目录(只是一次查询的命中)。
|
|
85
|
+
*/
|
|
86
|
+
search(query: string, opts?: LibrarySearchOptions, signal?: AbortSignal): Promise<LibraryEntry[] | null>;
|
|
87
|
+
getSnapshot: () => LibraryCatalogSnapshot;
|
|
88
|
+
subscribe: (listener: () => void) => (() => void);
|
|
89
|
+
private warnLossy;
|
|
90
|
+
/** Provider 条目优先,静态条目补充同名之外的部分 */
|
|
91
|
+
private rebuild;
|
|
92
|
+
private setState;
|
|
93
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { WorkflowDef } from '../types/conductor';
|
|
2
|
+
import type { RegisteredTaskDef } from '../actions/fromDefinitions';
|
|
3
|
+
import type { LibraryExtension, LibraryProvider } from './types';
|
|
4
|
+
export interface ConductorLibraryProviderOptions {
|
|
5
|
+
/** Conductor API 根地址,如 `https://conductor.example.com/api`(尾部斜杠可有可无) */
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
/**
|
|
8
|
+
* 认证头等,由宿主在每次请求前注入(组件库不保存任何凭据)。
|
|
9
|
+
* 可返回 Promise,便于异步刷新 token。
|
|
10
|
+
*/
|
|
11
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
12
|
+
/** 自定义 fetch(测试 / 网关封装);缺省使用全局 fetch */
|
|
13
|
+
fetch?: typeof fetch;
|
|
14
|
+
/** 是否同时拉取已注册的原子任务定义(`/metadata/taskdefs`),默认 false */
|
|
15
|
+
includeTaskDefs?: boolean;
|
|
16
|
+
/** 只暴露「流程库」内的工作流(如按名前缀 / ownerEmail);对列表与单个获取都生效 */
|
|
17
|
+
filter?: (def: WorkflowDef) => boolean;
|
|
18
|
+
/** 补充字段(层级、分类、图标、是否下线等)的来源由宿主决定 */
|
|
19
|
+
resolveExtension?: (def: WorkflowDef) => LibraryExtension | undefined;
|
|
20
|
+
/** 原子任务的补充字段来源(仅 includeTaskDefs 时使用) */
|
|
21
|
+
resolveTaskExtension?: (def: RegisteredTaskDef) => LibraryExtension | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* 网关路径不同可覆盖(相对 baseUrl)。
|
|
24
|
+
* `workflow` 为单个工作流的路径:含 `{name}` 时按模板替换,否则在其后追加 `/{name}`。
|
|
25
|
+
*/
|
|
26
|
+
paths?: {
|
|
27
|
+
workflows?: string;
|
|
28
|
+
workflow?: string;
|
|
29
|
+
taskDefs?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Conductor OSS 默认的流程库数据源:
|
|
34
|
+
* - `GET {baseUrl}/metadata/workflow` 列出工作流(同名多版本时客户端取最大 version)
|
|
35
|
+
* - `GET {baseUrl}/metadata/workflow/{name}?version={v}` 取指定版本,404 返回 null
|
|
36
|
+
* - `GET {baseUrl}/metadata/taskdefs` 已注册任务(includeTaskDefs 时)
|
|
37
|
+
*
|
|
38
|
+
* 不内置 `search`(Conductor OSS 元数据接口没有检索能力);需要服务端检索请自行实现 LibraryProvider。
|
|
39
|
+
* 网络错误 / 非 404 的 HTTP 错误会抛出,由目录层捕获为 `error` 状态。
|
|
40
|
+
*/
|
|
41
|
+
export declare function createConductorLibraryProvider(options: ConductorLibraryProviderOptions): LibraryProvider;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { WorkflowDef } from '../types/conductor';
|
|
2
|
+
import type { ActionField } from '../actions/types';
|
|
3
|
+
/**
|
|
4
|
+
* 流程库能力升级差异(纯函数):对比旧、新两个版本的入参 / 出参,
|
|
5
|
+
* 让用户在确认升级前看清「哪些已填内容会受影响」。
|
|
6
|
+
*/
|
|
7
|
+
export interface InputChange {
|
|
8
|
+
key: string;
|
|
9
|
+
/** 旧版本的类型描述,如「数字,必填」「可选值 a|b」 */
|
|
10
|
+
from: string;
|
|
11
|
+
/** 新版本的类型描述 */
|
|
12
|
+
to: string;
|
|
13
|
+
/** 该入参是否已填写过值(类型变化后已填值可能不再有效) */
|
|
14
|
+
valueFilled: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkflowVersionDiff {
|
|
17
|
+
/** 新增入参(field.required 标出必填) */
|
|
18
|
+
addedInputs: ActionField[];
|
|
19
|
+
/** 删除的入参 */
|
|
20
|
+
removedInputs: ActionField[];
|
|
21
|
+
/** 类型 / 枚举 / 必填变化 */
|
|
22
|
+
changedInputs: InputChange[];
|
|
23
|
+
addedOutputs: string[];
|
|
24
|
+
removedOutputs: string[];
|
|
25
|
+
/** removedInputs 中已填值的 key:升级后这些值将丢失 */
|
|
26
|
+
lostValueKeys: string[];
|
|
27
|
+
/** removedOutputs 中被其它步骤引用的 key:升级后下游引用将失效 */
|
|
28
|
+
brokenOutputRefs: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface DiffOptions {
|
|
31
|
+
/** 其它步骤中引用了本步骤哪些出参 key(见 collectReferencedOutputKeys);缺省视为没有引用 */
|
|
32
|
+
referencedOutputs?: Iterable<string>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @param oldDef 步骤当前固定版本的定义
|
|
36
|
+
* @param newDef 目录最新版本的定义
|
|
37
|
+
* @param filledValues 步骤上已填写的入参值
|
|
38
|
+
*/
|
|
39
|
+
export declare function diffWorkflowVersions(oldDef: WorkflowDef, newDef: WorkflowDef, filledValues?: Record<string, unknown>, options?: DiffOptions): WorkflowVersionDiff;
|
|
40
|
+
/** 没有任何入参 / 出参变化 */
|
|
41
|
+
export declare function isDiffEmpty(diff: WorkflowVersionDiff): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* 在若干结构(其它步骤的入参值等)中查找对 `${ref.output.<key>...}` 的引用,返回被引用的出参 key。
|
|
44
|
+
* 用于判断升级删除某个出参后,下游引用是否会失效。
|
|
45
|
+
*/
|
|
46
|
+
export declare function collectReferencedOutputKeys(taskReferenceName: string, parts: unknown[]): Set<string>;
|
|
47
|
+
export interface DiffSummary {
|
|
48
|
+
/** 会影响已填内容的条目(置顶显示) */
|
|
49
|
+
impacts: string[];
|
|
50
|
+
/** 其它变化 */
|
|
51
|
+
changes: string[];
|
|
52
|
+
}
|
|
53
|
+
/** 把差异整理为面向用户的文字条目:会影响已填内容的置顶 */
|
|
54
|
+
export declare function summarizeDiff(diff: WorkflowVersionDiff): DiffSummary;
|
|
55
|
+
/** 升级确认框文案(含升级差异)。无差异时提示「入参出参未变化」。 */
|
|
56
|
+
export declare function buildUpgradeConfirmMessage(name: string, pinned: number | undefined, latest: number, diff: WorkflowVersionDiff): string;
|
|
57
|
+
/**
|
|
58
|
+
* 升级后调整步骤已填的入参值:
|
|
59
|
+
* - 删除的入参:移除其值(与差异中「值将丢失」一致)
|
|
60
|
+
* - 新增且有默认值的入参:补上默认值(用户已填的不覆盖)
|
|
61
|
+
*/
|
|
62
|
+
export declare function applyUpgradeToValues(values: Record<string, any>, diff: WorkflowVersionDiff): Record<string, any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { normalizeVersion } from './version';
|
|
3
|
+
export type { NormalizedVersion } from './version';
|
|
4
|
+
export { canCallLevel } from './level';
|
|
5
|
+
export { parseWorkflowName, validateWorkflowName, WORKFLOW_NAME_TYPES } from './naming';
|
|
6
|
+
export type { ParsedWorkflowName, WorkflowNameType } from './naming';
|
|
7
|
+
export { LibraryCatalog, entryFromRecord } from './catalog';
|
|
8
|
+
export type { LibraryEntry, LibraryCatalogSnapshot, LibraryCatalogOptions } from './catalog';
|
|
9
|
+
export { toActions, toActionExtension, toTaskSchemas, toLibraryItems, entriesToLibraryItems, filterPickableActions, libraryDomainOf, collectLibraryDomains, OTHER_DOMAIN, schemaToTypeStrings, } from './projections';
|
|
10
|
+
export { useLibraryCatalogSnapshot, useLibraryCatalogLoader } from './useLibraryCatalog';
|
|
11
|
+
export { createConductorLibraryProvider } from './conductorProvider';
|
|
12
|
+
export type { ConductorLibraryProviderOptions } from './conductorProvider';
|
|
13
|
+
export { diffWorkflowVersions, isDiffEmpty, summarizeDiff, buildUpgradeConfirmMessage, applyUpgradeToValues, collectReferencedOutputKeys, } from './diff';
|
|
14
|
+
export type { WorkflowVersionDiff, InputChange, DiffOptions, DiffSummary } from './diff';
|
|
15
|
+
export { resolveLibraryBadgeState, describeUnavailable } from './versionStatus';
|
|
16
|
+
export type { LibraryBadgeState, LibraryBadgeInputs } from './versionStatus';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WorkflowLevel } from '../types/workflowLibrary';
|
|
2
|
+
/**
|
|
3
|
+
* 分层调用规则:高层可调用低层及同层,禁止反向跨层。
|
|
4
|
+
* L3 -> L3/L2/L1;L2 -> L2/L1;L1 -> L1。任一方层级未知时视为允许(不做限制)。
|
|
5
|
+
*/
|
|
6
|
+
export declare function canCallLevel(caller: WorkflowLevel | undefined, callee: WorkflowLevel | undefined): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WorkflowLevel } from '../types/workflowLibrary';
|
|
2
|
+
/**
|
|
3
|
+
* 治理平台的流程命名规范:`类型-层级-业务域-产品-功能`,以 `-` 分隔。
|
|
4
|
+
* - 类型:std(通用)/ proxy(代理)/ tmp(临时,自动清理)/ custom(自定义)
|
|
5
|
+
* - 层级:L1 / L2 / L3
|
|
6
|
+
* - 业务域:来自全局可调整的列表(由服务端提供,这里不写死,只当字符串处理)
|
|
7
|
+
* - 产品:自由名称(内部不含 `-`)
|
|
8
|
+
* - 功能:第 4 个 `-` 之后的全部内容(自身可含 `-`)
|
|
9
|
+
*/
|
|
10
|
+
export type WorkflowNameType = 'std' | 'proxy' | 'tmp' | 'custom';
|
|
11
|
+
export interface ParsedWorkflowName {
|
|
12
|
+
type: WorkflowNameType;
|
|
13
|
+
level: WorkflowLevel;
|
|
14
|
+
domain: string;
|
|
15
|
+
product: string;
|
|
16
|
+
func: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const WORKFLOW_NAME_TYPES: readonly WorkflowNameType[];
|
|
19
|
+
/**
|
|
20
|
+
* 解析流程名称。段数不足 5、类型或层级不合法时返回 null(不抛错)。
|
|
21
|
+
* 业务域 / 产品 / 功能只做切分,不在此校验是否为空或是否在白名单内(见 validateWorkflowName)。
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseWorkflowName(name: string): ParsedWorkflowName | null;
|
|
24
|
+
/**
|
|
25
|
+
* 校验流程名称,返回中文错误列表(空数组 = 合法)。
|
|
26
|
+
* 仅当提供 allowedDomains 时才校验业务域是否在列表内。
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateWorkflowName(name: string, allowedDomains?: string[]): string[];
|