openxiangda-devkit-core 2.5.0 → 2.6.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/compiler/application-model.d.ts +1 -0
- package/dist/compiler/application-model.d.ts.map +1 -1
- package/dist/compiler/application-model.js +2 -0
- package/dist/compiler/application-model.js.map +1 -1
- package/dist/compiler/bundle.d.ts.map +1 -1
- package/dist/compiler/bundle.js +3 -0
- 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 +12 -4
- package/dist/compiler/config.js.map +1 -1
- package/package.json +2 -2
package/dist/compiler/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { materializeApplicationModules } from './application-model.js';
|
|
2
2
|
import { nativeFieldRequiresCreateInputV2 } from 'openxiangda-contracts/native-compiler';
|
|
3
|
-
import { SCHEMA_VERSIONS, DATA_AUDIT_METADATA_FIELDS, DATA_FIELD_TYPES, PLATFORM_EVENT_TYPES_V2, nativePlatformCapabilityCatalog, validateDataResource, validateWorkflowInstanceCommandPolicies, WORKFLOW_SUMMARY_MAX_FIELDS, WORKFLOW_SUMMARY_TEXT_LONG_MAX_BYTES, isWorkflowSummaryFieldType, } from 'openxiangda-contracts';
|
|
3
|
+
import { SCHEMA_VERSIONS, DATA_AUDIT_METADATA_FIELDS, isDataAuditMetadataField, DATA_FIELD_TYPES, PLATFORM_EVENT_TYPES_V2, nativePlatformCapabilityCatalog, validateDataResource, validateWorkflowInstanceCommandPolicies, WORKFLOW_SUMMARY_MAX_FIELDS, WORKFLOW_SUMMARY_TEXT_LONG_MAX_BYTES, isWorkflowSummaryFieldType, } from 'openxiangda-contracts';
|
|
4
4
|
import { Ajv2020 } from 'ajv/dist/2020.js';
|
|
5
5
|
import { CronExpressionParser } from 'cron-parser';
|
|
6
6
|
import { fieldNullable, supportsGeneratedMutation, } from './field-codec.js';
|
|
@@ -3427,12 +3427,13 @@ function validateCapabilityClosure(appCode, config, declarations, diagnostics) {
|
|
|
3427
3427
|
catalog.add(string(object(raw).code));
|
|
3428
3428
|
const data = object(config.data);
|
|
3429
3429
|
const catalogOwners = new Map();
|
|
3430
|
+
const references = [];
|
|
3430
3431
|
for (const raw of declarations) {
|
|
3431
3432
|
const code = string(object(raw).code);
|
|
3432
3433
|
if (code)
|
|
3433
3434
|
catalogOwners.set(code, 'authz.capabilities');
|
|
3434
3435
|
}
|
|
3435
|
-
for (const rawResource of Array.isArray(data.resources) ? data.resources : []) {
|
|
3436
|
+
for (const [resourceIndex, rawResource] of (Array.isArray(data.resources) ? data.resources : []).entries()) {
|
|
3436
3437
|
const resource = object(rawResource);
|
|
3437
3438
|
const resourceOwner = `data.resources.${string(resource.code)}`;
|
|
3438
3439
|
Object.values(object(resource.capabilities)).forEach(value => {
|
|
@@ -3440,18 +3441,24 @@ function validateCapabilityClosure(appCode, config, declarations, diagnostics) {
|
|
|
3440
3441
|
registerCapabilityOwner(code, resourceOwner, catalogOwners, diagnostics);
|
|
3441
3442
|
catalog.add(code);
|
|
3442
3443
|
});
|
|
3443
|
-
Object.
|
|
3444
|
+
Object.entries(object(resource.fieldPolicies)).forEach(([fieldCode, rawPolicy]) => {
|
|
3444
3445
|
const policy = object(rawPolicy);
|
|
3445
3446
|
for (const key of ['read', 'create', 'update']) {
|
|
3446
3447
|
for (const value of Array.isArray(policy[key]) ? policy[key] : []) {
|
|
3447
3448
|
const code = string(value);
|
|
3449
|
+
if (isDataAuditMetadataField(fieldCode)) {
|
|
3450
|
+
references.push({
|
|
3451
|
+
capability: code,
|
|
3452
|
+
path: `data.resources[${resourceIndex}].fieldPolicies.${fieldCode}.${key}`,
|
|
3453
|
+
});
|
|
3454
|
+
continue;
|
|
3455
|
+
}
|
|
3448
3456
|
registerCapabilityOwner(code, resourceOwner, catalogOwners, diagnostics);
|
|
3449
3457
|
catalog.add(code);
|
|
3450
3458
|
}
|
|
3451
3459
|
}
|
|
3452
3460
|
});
|
|
3453
3461
|
}
|
|
3454
|
-
const references = [];
|
|
3455
3462
|
const authz = object(config.authz);
|
|
3456
3463
|
(Array.isArray(authz.roles) ? authz.roles : []).forEach((rawRole, index) => {
|
|
3457
3464
|
const role = object(rawRole);
|
|
@@ -3731,6 +3738,7 @@ export function materializeDataResource(appCode, declaration) {
|
|
|
3731
3738
|
])),
|
|
3732
3739
|
list: {
|
|
3733
3740
|
fieldOrder: visible.map(field => field.code),
|
|
3741
|
+
...(declaration.list?.actions !== undefined ? { actions: declaration.list.actions } : {}),
|
|
3734
3742
|
defaultPageSize: declaration.list?.defaultPageSize || 20,
|
|
3735
3743
|
...(searchableFields.length ? { searchableFields } : {}),
|
|
3736
3744
|
...(filterFields.length ? { filterFields } : {}),
|