openxiangda-devkit-core 2.22.0 → 2.24.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 (39) hide show
  1. package/dist/application-services.d.ts +1 -1
  2. package/dist/application-services.d.ts.map +1 -1
  3. package/dist/application-services.js +23 -26
  4. package/dist/application-services.js.map +1 -1
  5. package/dist/compiler/bundle.d.ts.map +1 -1
  6. package/dist/compiler/bundle.js +27 -0
  7. package/dist/compiler/bundle.js.map +1 -1
  8. package/dist/compiler/config.d.ts.map +1 -1
  9. package/dist/compiler/config.js +62 -1
  10. package/dist/compiler/config.js.map +1 -1
  11. package/dist/compiler/package-compiler.d.ts.map +1 -1
  12. package/dist/compiler/package-compiler.js +11 -0
  13. package/dist/compiler/package-compiler.js.map +1 -1
  14. package/dist/compiler/permission-review.d.ts +1 -1
  15. package/dist/compiler/permission-review.d.ts.map +1 -1
  16. package/dist/compiler/schema-composition.js +2 -2
  17. package/dist/compiler/schema-composition.js.map +1 -1
  18. package/dist/control-plane-client.d.ts +2 -0
  19. package/dist/control-plane-client.d.ts.map +1 -1
  20. package/dist/control-plane-client.js +5 -0
  21. package/dist/control-plane-client.js.map +1 -1
  22. package/dist/dependency-install-diagnostic.d.ts +11 -0
  23. package/dist/dependency-install-diagnostic.d.ts.map +1 -0
  24. package/dist/dependency-install-diagnostic.js +33 -0
  25. package/dist/dependency-install-diagnostic.js.map +1 -0
  26. package/dist/documentation.d.ts +1 -1
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/optional-backend.d.ts.map +1 -1
  32. package/dist/optional-backend.js +2 -1
  33. package/dist/optional-backend.js.map +1 -1
  34. package/dist/session.d.ts +1 -1
  35. package/dist/target-readiness.d.ts +22 -0
  36. package/dist/target-readiness.d.ts.map +1 -0
  37. package/dist/target-readiness.js +51 -0
  38. package/dist/target-readiness.js.map +1 -0
  39. package/package.json +2 -2
@@ -2696,6 +2696,7 @@ function validateBackendOperations(rawOperations, declaredResources, declaredRes
2696
2696
  }
2697
2697
  const codes = new Set();
2698
2698
  const routes = new Set();
2699
+ const decimalReservationMappings = new Map();
2699
2700
  (Array.isArray(rawOperations) ? rawOperations : []).forEach((raw, index) => {
2700
2701
  const operation = object(raw);
2701
2702
  const code = string(operation.code);
@@ -2726,6 +2727,7 @@ function validateBackendOperations(rawOperations, declaredResources, declaredRes
2726
2727
  'notification',
2727
2728
  'workflow',
2728
2729
  'roleAssertions',
2730
+ 'decimalReservation',
2729
2731
  ]);
2730
2732
  let invalid = !isRecord(operation.platformAccess) ||
2731
2733
  Object.keys(access).length === 0 ||
@@ -2848,8 +2850,67 @@ function validateBackendOperations(rawOperations, declaredResources, declaredRes
2848
2850
  workflowCodes.some(code => !declaredWorkflowCodes.has(code)) ||
2849
2851
  Object.keys(workflow).some(key => key !== 'codes');
2850
2852
  }
2853
+ if (access.decimalReservation !== undefined) {
2854
+ const reservation = object(access.decimalReservation);
2855
+ const resourceCode = string(reservation.resourceCode);
2856
+ const mappingKeys = [
2857
+ 'amountFieldCode', 'currencyFieldCode', 'relationFieldCode',
2858
+ 'parentFieldCode', 'rootFieldCode', 'statusFieldCode',
2859
+ 'parentRelationValue', 'childRelationValue',
2860
+ ];
2861
+ const mapping = JSON.stringify(mappingKeys.map(key => string(reservation[key])));
2862
+ const priorMapping = decimalReservationMappings.get(resourceCode);
2863
+ if (priorMapping && priorMapping !== mapping) {
2864
+ invalid = true;
2865
+ }
2866
+ else if (resourceCode) {
2867
+ decimalReservationMappings.set(resourceCode, mapping);
2868
+ }
2869
+ const fields = declaredResourceFields.get(resourceCode);
2870
+ const field = (key) => object(fields?.get(string(reservation[key])));
2871
+ const optionValues = (key) => new Set((Array.isArray(field(key).options) ? field(key).options : [])
2872
+ .map((option) => string(object(option).value)));
2873
+ const parentStatuses = Array.isArray(reservation.eligibleParentStatuses)
2874
+ ? reservation.eligibleParentStatuses.map(string)
2875
+ : [];
2876
+ const childStatuses = Array.isArray(reservation.eligibleChildStatuses)
2877
+ ? reservation.eligibleChildStatuses.map(string)
2878
+ : [];
2879
+ const relationValues = optionValues('relationFieldCode');
2880
+ const statusValues = optionValues('statusFieldCode');
2881
+ const validStatuses = (values) => values.length >= 1 && values.length <= 16 &&
2882
+ new Set(values).size === values.length &&
2883
+ values.every(value => OPERATION_CODE_PATTERN.test(value) && statusValues.has(value));
2884
+ invalid ||=
2885
+ !isRecord(access.decimalReservation) ||
2886
+ Object.keys(reservation).some(key => ![
2887
+ 'mode', 'resourceCode', 'amountFieldCode', 'currencyFieldCode',
2888
+ 'relationFieldCode', 'parentFieldCode', 'rootFieldCode',
2889
+ 'statusFieldCode', 'parentRelationValue', 'childRelationValue',
2890
+ 'eligibleParentStatuses', 'eligibleChildStatuses',
2891
+ ].includes(key)) ||
2892
+ !['reserve', 'commit', 'release'].includes(string(reservation.mode)) ||
2893
+ !fields ||
2894
+ field('amountFieldCode').type !== 'number.decimal' ||
2895
+ field('amountFieldCode').exactDecimal !== true ||
2896
+ field('amountFieldCode').precision !== 18 ||
2897
+ field('amountFieldCode').scale !== 2 ||
2898
+ field('currencyFieldCode').type !== 'option.single' ||
2899
+ field('relationFieldCode').type !== 'option.single' ||
2900
+ field('parentFieldCode').type !== 'resource-ref.single' ||
2901
+ object(field('parentFieldCode').source).resourceCode !== resourceCode ||
2902
+ field('rootFieldCode').type !== 'uuid' ||
2903
+ field('statusFieldCode').type !== 'option.single' ||
2904
+ !OPERATION_CODE_PATTERN.test(string(reservation.parentRelationValue)) ||
2905
+ !OPERATION_CODE_PATTERN.test(string(reservation.childRelationValue)) ||
2906
+ reservation.parentRelationValue === reservation.childRelationValue ||
2907
+ !relationValues.has(string(reservation.parentRelationValue)) ||
2908
+ !relationValues.has(string(reservation.childRelationValue)) ||
2909
+ !validStatuses(parentStatuses) ||
2910
+ !validStatuses(childStatuses);
2911
+ }
2851
2912
  if (invalid) {
2852
- diagnostics.push(diagnostic('APP_CONFIG_BACKEND_OPERATION_PLATFORM_ACCESS_INVALID', 'operation.platformAccess 必须只声明有界的发起人目录、托管文件、托管文件复制、标准通知、现有工作流或已声明角色条件依赖', `${path}.platformAccess`));
2913
+ diagnostics.push(diagnostic('APP_CONFIG_BACKEND_OPERATION_PLATFORM_ACCESS_INVALID', 'operation.platformAccess 必须只声明有界且与已声明资源字段相符的平台依赖', `${path}.platformAccess`));
2853
2914
  }
2854
2915
  }
2855
2916
  if (operation.browser !== undefined) {