openxiangda-devkit-core 2.58.0 → 2.60.1
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/application-services.d.ts +43 -0
- package/dist/application-services.d.ts.map +1 -1
- package/dist/application-services.js +36 -0
- package/dist/application-services.js.map +1 -1
- package/dist/application-template-catalog.d.ts +101 -0
- package/dist/application-template-catalog.d.ts.map +1 -0
- package/dist/application-template-catalog.js +52 -0
- package/dist/application-template-catalog.js.map +1 -0
- package/dist/command-registry.d.ts +20 -0
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +2 -0
- package/dist/command-registry.js.map +1 -1
- package/dist/compiler/ai-catalog.d.ts.map +1 -1
- package/dist/compiler/ai-catalog.js +12 -0
- package/dist/compiler/ai-catalog.js.map +1 -1
- package/dist/compiler/bundle.d.ts.map +1 -1
- package/dist/compiler/bundle.js +11 -3
- package/dist/compiler/bundle.js.map +1 -1
- package/dist/compiler/config.d.ts +1 -0
- package/dist/compiler/config.d.ts.map +1 -1
- package/dist/compiler/config.js +42 -2
- package/dist/compiler/config.js.map +1 -1
- package/dist/compiler/permission-review.d.ts.map +1 -1
- package/dist/control-plane-client.d.ts +15 -0
- package/dist/control-plane-client.d.ts.map +1 -1
- package/dist/control-plane-client.js +12 -0
- package/dist/control-plane-client.js.map +1 -1
- package/dist/documentation.d.ts +7 -3
- package/dist/documentation.d.ts.map +1 -1
- package/dist/documentation.js +1 -0
- package/dist/documentation.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/workflow.d.ts +7 -1
- package/dist/internal/workflow.d.ts.map +1 -1
- package/dist/internal/workflow.js +27 -18
- package/dist/internal/workflow.js.map +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/workflow-source-sync.d.ts +59 -0
- package/dist/workflow-source-sync.d.ts.map +1 -0
- package/dist/workflow-source-sync.js +254 -0
- package/dist/workflow-source-sync.js.map +1 -0
- package/package.json +2 -2
package/dist/compiler/config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeDataMutationGrants } from 'openxiangda-contracts';
|
|
1
2
|
import { parseNativeParentReadPolicy, validateNativeParentReadPolicies, NativeParentReadPolicyError, NativeDataPolicyExpressionV2Error } from 'openxiangda-contracts/native-compiler';
|
|
2
3
|
import { assertWorkflowNativeStagePolicy } from 'openxiangda-contracts';
|
|
3
4
|
import { WORKFLOW_LAUNCH_MAX_INPUTS } from 'openxiangda-contracts';
|
|
@@ -1043,6 +1044,12 @@ export function validateAppConfig(value) {
|
|
|
1043
1044
|
}
|
|
1044
1045
|
});
|
|
1045
1046
|
}
|
|
1047
|
+
(Array.isArray(source.filterWhere) ? source.filterWhere : []).forEach((rawFilter, filterIndex) => {
|
|
1048
|
+
const filterField = string(object(rawFilter).field);
|
|
1049
|
+
if (!targetFieldList.some(candidate => string(object(candidate).code) === filterField)) {
|
|
1050
|
+
diagnostics.push(diagnostic('APP_CONFIG_DATA_RESOURCE_SOURCE_FILTER_FIELD_NOT_FOUND', `动态来源筛选字段 ${filterField} 未在 ${targetCode} 声明`, `${sourcePath}.filterWhere[${filterIndex}].field`));
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1046
1053
|
const sourceFilters = Array.isArray(source.filters) ? source.filters : [];
|
|
1047
1054
|
sourceFilters.forEach((rawFilter, filterIndex) => {
|
|
1048
1055
|
const filter = object(rawFilter);
|
|
@@ -1937,6 +1944,14 @@ export function validateAppConfig(value) {
|
|
|
1937
1944
|
copiesInvalid = true;
|
|
1938
1945
|
copyKeys.add(key);
|
|
1939
1946
|
}
|
|
1947
|
+
if (access.dataMutations !== undefined) {
|
|
1948
|
+
try {
|
|
1949
|
+
access.dataMutations = normalizeDataMutationGrants(access.dataMutations, eventResourceFields);
|
|
1950
|
+
}
|
|
1951
|
+
catch {
|
|
1952
|
+
copiesInvalid = true;
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1940
1955
|
let decimalInvalid = false;
|
|
1941
1956
|
if (access.decimalReservation !== undefined) {
|
|
1942
1957
|
try {
|
|
@@ -1947,11 +1962,11 @@ export function validateAppConfig(value) {
|
|
|
1947
1962
|
}
|
|
1948
1963
|
}
|
|
1949
1964
|
if (decimalInvalid ||
|
|
1950
|
-
Object.keys(access).some(key => !['notification', 'managedFileCopies', 'decimalReservation'].includes(key)) ||
|
|
1965
|
+
Object.keys(access).some(key => !['notification', 'managedFileCopies', 'decimalReservation', 'dataMutations'].includes(key)) ||
|
|
1951
1966
|
(access.notification !== undefined &&
|
|
1952
1967
|
(notification.mode !== 'business-standard' ||
|
|
1953
1968
|
Object.keys(notification).some(key => key !== 'mode'))) ||
|
|
1954
|
-
(access.notification === undefined && access.managedFileCopies === undefined && access.decimalReservation === undefined) ||
|
|
1969
|
+
(access.notification === undefined && access.managedFileCopies === undefined && access.decimalReservation === undefined && access.dataMutations === undefined) ||
|
|
1955
1970
|
copiesInvalid) {
|
|
1956
1971
|
diagnostics.push(diagnostic('APP_CONFIG_EVENT_PLATFORM_ACCESS_INVALID', '事件订阅 platformAccess 必须显式声明标准通知、托管文件复制或与审批/额度资源匹配的受管终态', `${path}.platformAccess`));
|
|
1957
1972
|
}
|
|
@@ -2517,6 +2532,7 @@ export function validateAppConfig(value) {
|
|
|
2517
2532
|
'definitionVersion',
|
|
2518
2533
|
'bindingVersion',
|
|
2519
2534
|
'acceptedCommandDeactivationPolicy',
|
|
2535
|
+
'sourceBase',
|
|
2520
2536
|
].includes(key))) {
|
|
2521
2537
|
diagnostics.push(diagnostic('APP_CONFIG_WORKFLOW_ACTIVATION_INVALID', 'Workflow activation 只能声明固定版本与停用策略', path));
|
|
2522
2538
|
}
|
|
@@ -2528,6 +2544,11 @@ export function validateAppConfig(value) {
|
|
|
2528
2544
|
if ('environmentKey' in activation) {
|
|
2529
2545
|
diagnostics.push(diagnostic('APP_CONFIG_ENVIRONMENT_OVERRIDE_FORBIDDEN', 'Workflow activation 属于环境中立 AppVersion,不能声明 environmentKey', `${path}.environmentKey`));
|
|
2530
2546
|
}
|
|
2547
|
+
if (activation.sourceBase !== undefined) {
|
|
2548
|
+
const base = object(activation.sourceBase);
|
|
2549
|
+
if (Object.keys(base).length !== 2 || !['definitionDigest', 'bindingDigest'].every(key => /^(sha256:)?[a-f0-9]{64}$/.test(String(base[key] || ''))))
|
|
2550
|
+
diagnostics.push(diagnostic('APP_CONFIG_WORKFLOW_SOURCE_BASE_INVALID', '源码基线只能包含 definitionDigest 和 bindingDigest', `${path}.sourceBase`));
|
|
2551
|
+
}
|
|
2531
2552
|
const definitionVersion = Number(activation.definitionVersion);
|
|
2532
2553
|
const bindingVersion = Number(activation.bindingVersion);
|
|
2533
2554
|
const definition = definitionByKey.get(`${workflowCode}:${definitionVersion}`);
|
|
@@ -2857,10 +2878,19 @@ function validateBackendOperations(rawOperations, declaredResources, declaredRes
|
|
|
2857
2878
|
'workflowStage',
|
|
2858
2879
|
'recordEdit',
|
|
2859
2880
|
'ownedSubject',
|
|
2881
|
+
'dataMutations',
|
|
2860
2882
|
]);
|
|
2861
2883
|
let invalid = !isRecord(operation.platformAccess) ||
|
|
2862
2884
|
Object.keys(access).length === 0 ||
|
|
2863
2885
|
Object.keys(access).some(key => !allowedAccessKeys.has(key));
|
|
2886
|
+
if (access.dataMutations !== undefined) {
|
|
2887
|
+
try {
|
|
2888
|
+
access.dataMutations = normalizeDataMutationGrants(access.dataMutations, declaredResourceFields);
|
|
2889
|
+
}
|
|
2890
|
+
catch {
|
|
2891
|
+
invalid = true;
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2864
2894
|
if (access.ownedSubject !== undefined) {
|
|
2865
2895
|
try {
|
|
2866
2896
|
assertWorkflowOwnedSubjectCreate(access.ownedSubject);
|
|
@@ -3211,6 +3241,15 @@ function validateBackendOperations(rawOperations, declaredResources, declaredRes
|
|
|
3211
3241
|
? ai.sideEffects
|
|
3212
3242
|
: [];
|
|
3213
3243
|
const risk = string(ai.risk);
|
|
3244
|
+
if (risk === 'external' && ai.reconcile === undefined) {
|
|
3245
|
+
diagnostics.push({
|
|
3246
|
+
...diagnostic('AI_EXTERNAL_RECONCILIATION_MISSING', '外部 AI 操作未声明业务结果核对能力,执行结果不确定时只能保留未知并人工核实', `${path}.ai.reconcile`),
|
|
3247
|
+
severity: 'warning',
|
|
3248
|
+
});
|
|
3249
|
+
}
|
|
3250
|
+
if (object(ai.reconcile).kind === 'platform-transaction') {
|
|
3251
|
+
diagnostics.push({ ...diagnostic('AI_APP_TRANSACTION_RECONCILIATION_UNSUPPORTED', '应用业务操作的 completing 平台事务核对尚未提供;请声明只读状态操作,否则保留结果未知', `${path}.ai.reconcile`), severity: 'warning' });
|
|
3252
|
+
}
|
|
3214
3253
|
const aiKeys = Object.keys(ai);
|
|
3215
3254
|
const allowedAiKeys = new Set([
|
|
3216
3255
|
'name',
|
|
@@ -3219,6 +3258,7 @@ function validateBackendOperations(rawOperations, declaredResources, declaredRes
|
|
|
3219
3258
|
'confirmation',
|
|
3220
3259
|
'resources',
|
|
3221
3260
|
'sideEffects',
|
|
3261
|
+
'reconcile',
|
|
3222
3262
|
'concurrency',
|
|
3223
3263
|
'timeoutMs',
|
|
3224
3264
|
'agent',
|