feat(platform,datalink,bill): add workflow job drilldown, safe record batch-edit, audit, and spec linkage diagnostics (v0.8.11)

This commit is contained in:
gitea committed 2026-09-29 20:00:55 +08:00
1 parent 2ec08033e0
commit a0ec7f95a7
37 files changed
+3958 -674

No files matched your search

+30
View File
@@ -4,9 +4,11 @@ import {
RawBillSearchResponseSchema,
RawBillBatchGetResponseSchema,
EntityListResponseSchema,
FormSpecificationSchema,
type RawBillSearchResponse,
type RawBillItem,
type EntityMeta,
type FormSpecification,
} from "./types.js";
function quoted(value: string): string {
@@ -472,3 +474,31 @@ export async function getDatalinkCard(
return undefined;
}
}
// ── 单据模板规格定义 API(GET api/form/v2/specifications/[{specificationId}])──
export async function getFormSpecification(
client: KyInstance,
corpId: string,
specificationId: string
): Promise<FormSpecification | undefined> {
const cleanId = specificationId.replace(/^\[|\]$/g, "").trim();
if (!cleanId) return undefined;
const response = await client.get(
`api/form/v2/specifications/[${encodeURIComponent(cleanId)}]`,
{
searchParams: { corpId },
}
);
const json = (await response.json()) as {
items?: unknown[];
value?: unknown;
id?: string;
};
const raw = Array.isArray(json.items)
? json.items[0]
: json.value ?? (typeof json.id === "string" ? json : undefined);
if (!raw || typeof raw !== "object") return undefined;
return FormSpecificationSchema.parse(raw);
}