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.
- package/dist/application-services.d.ts +1 -1
- package/dist/application-services.d.ts.map +1 -1
- package/dist/application-services.js +23 -26
- package/dist/application-services.js.map +1 -1
- package/dist/compiler/bundle.d.ts.map +1 -1
- package/dist/compiler/bundle.js +27 -0
- package/dist/compiler/bundle.js.map +1 -1
- package/dist/compiler/config.d.ts.map +1 -1
- package/dist/compiler/config.js +62 -1
- package/dist/compiler/config.js.map +1 -1
- package/dist/compiler/package-compiler.d.ts.map +1 -1
- package/dist/compiler/package-compiler.js +11 -0
- package/dist/compiler/package-compiler.js.map +1 -1
- package/dist/compiler/permission-review.d.ts +1 -1
- package/dist/compiler/permission-review.d.ts.map +1 -1
- package/dist/compiler/schema-composition.js +2 -2
- package/dist/compiler/schema-composition.js.map +1 -1
- package/dist/control-plane-client.d.ts +2 -0
- package/dist/control-plane-client.d.ts.map +1 -1
- package/dist/control-plane-client.js +5 -0
- package/dist/control-plane-client.js.map +1 -1
- package/dist/dependency-install-diagnostic.d.ts +11 -0
- package/dist/dependency-install-diagnostic.d.ts.map +1 -0
- package/dist/dependency-install-diagnostic.js +33 -0
- package/dist/dependency-install-diagnostic.js.map +1 -0
- package/dist/documentation.d.ts +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/optional-backend.d.ts.map +1 -1
- package/dist/optional-backend.js +2 -1
- package/dist/optional-backend.js.map +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/target-readiness.d.ts +22 -0
- package/dist/target-readiness.d.ts.map +1 -0
- package/dist/target-readiness.js +51 -0
- package/dist/target-readiness.js.map +1 -0
- package/package.json +2 -2
package/dist/compiler/config.js
CHANGED
|
@@ -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
|
|
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) {
|