openxiangda-devkit-core 2.57.1 → 2.59.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.
@@ -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';
@@ -1937,6 +1938,14 @@ export function validateAppConfig(value) {
1937
1938
  copiesInvalid = true;
1938
1939
  copyKeys.add(key);
1939
1940
  }
1941
+ if (access.dataMutations !== undefined) {
1942
+ try {
1943
+ access.dataMutations = normalizeDataMutationGrants(access.dataMutations, eventResourceFields);
1944
+ }
1945
+ catch {
1946
+ copiesInvalid = true;
1947
+ }
1948
+ }
1940
1949
  let decimalInvalid = false;
1941
1950
  if (access.decimalReservation !== undefined) {
1942
1951
  try {
@@ -1947,11 +1956,11 @@ export function validateAppConfig(value) {
1947
1956
  }
1948
1957
  }
1949
1958
  if (decimalInvalid ||
1950
- Object.keys(access).some(key => !['notification', 'managedFileCopies', 'decimalReservation'].includes(key)) ||
1959
+ Object.keys(access).some(key => !['notification', 'managedFileCopies', 'decimalReservation', 'dataMutations'].includes(key)) ||
1951
1960
  (access.notification !== undefined &&
1952
1961
  (notification.mode !== 'business-standard' ||
1953
1962
  Object.keys(notification).some(key => key !== 'mode'))) ||
1954
- (access.notification === undefined && access.managedFileCopies === undefined && access.decimalReservation === undefined) ||
1963
+ (access.notification === undefined && access.managedFileCopies === undefined && access.decimalReservation === undefined && access.dataMutations === undefined) ||
1955
1964
  copiesInvalid) {
1956
1965
  diagnostics.push(diagnostic('APP_CONFIG_EVENT_PLATFORM_ACCESS_INVALID', '事件订阅 platformAccess 必须显式声明标准通知、托管文件复制或与审批/额度资源匹配的受管终态', `${path}.platformAccess`));
1957
1966
  }
@@ -2857,10 +2866,19 @@ function validateBackendOperations(rawOperations, declaredResources, declaredRes
2857
2866
  'workflowStage',
2858
2867
  'recordEdit',
2859
2868
  'ownedSubject',
2869
+ 'dataMutations',
2860
2870
  ]);
2861
2871
  let invalid = !isRecord(operation.platformAccess) ||
2862
2872
  Object.keys(access).length === 0 ||
2863
2873
  Object.keys(access).some(key => !allowedAccessKeys.has(key));
2874
+ if (access.dataMutations !== undefined) {
2875
+ try {
2876
+ access.dataMutations = normalizeDataMutationGrants(access.dataMutations, declaredResourceFields);
2877
+ }
2878
+ catch {
2879
+ invalid = true;
2880
+ }
2881
+ }
2864
2882
  if (access.ownedSubject !== undefined) {
2865
2883
  try {
2866
2884
  assertWorkflowOwnedSubjectCreate(access.ownedSubject);