openxiangda-contracts 2.0.0-alpha.91 → 2.0.0-alpha.92
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/native-compiler/compiler.d.ts.map +1 -1
- package/dist/native-compiler/compiler.js +13 -7
- package/dist/native-compiler/compiler.js.map +1 -1
- package/dist/native-compiler/data-field.d.ts +5 -0
- package/dist/native-compiler/data-field.d.ts.map +1 -1
- package/dist/native-compiler/data-field.js +7 -0
- package/dist/native-compiler/data-field.js.map +1 -1
- package/dist/native-compiler/data-surface.js +2 -5
- package/dist/native-compiler/data-surface.js.map +1 -1
- package/dist/native-compiler/index.cjs +3 -3
- package/dist/native-compiler/index.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/native-compiler/compiler.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,kCAAkC,IAAI,uCAAuC,EACnF,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/native-compiler/compiler.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,kCAAkC,IAAI,uCAAuC,EACnF,MAAM,aAAa,CAAC;AAwBrB,QAAA,MAAM,iBAAiB,mDAAmD,CAAC;AAC3E,QAAA,MAAM,yBAAyB,YAA2C,CAAC;AAgF3E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;EAc7B,CAAC;AACZ,eAAO,MAAM,mBAAmB,6HAItB,CAAC;AACX,eAAO,MAAM,uBAAuB,u/CAkC1B,CAAC;AAGX,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEtC,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IAC1C,aAAa,EAAE,MAAM,GA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Q3C;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,KAAK,EAAE;IACtD,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,aAAa,EAAE,UAAU,EAAE,CAAC;CAC7B,GAAG,wBAAwB,EAAE,CAyI7B"}
|
|
@@ -2,7 +2,7 @@ import { projectNativeDataResourceViewV2 } from './data-surface.js';
|
|
|
2
2
|
import * as crypto from 'crypto';
|
|
3
3
|
import { OPENXIANGDA_COMPILER_CONTRACT_VERSION as OPENXIANGDA_V2_COMPILER_CONTRACT_VERSION, PLATFORM_CAPABILITY_CONTRACT_VERSIONS as OPENXIANGDA_V2_PLATFORM_CAPABILITY_CONTRACT_VERSIONS, } from '../native-version.js';
|
|
4
4
|
import { canonicalJson, sha256Digest as sha256Canonical } from '../canonical.js';
|
|
5
|
-
import { NativeDataFieldContractV2Error, parseNativeDataFieldsV2, parseNativeDataResourceInvariantsV2, validateNativeDataResourceReferencesV2, } from './data-field.js';
|
|
5
|
+
import { NativeDataFieldContractV2Error, nativeFieldRequiresCreateInputV2, parseNativeDataFieldsV2, parseNativeDataResourceInvariantsV2, validateNativeDataResourceReferencesV2, } from './data-field.js';
|
|
6
6
|
import { validateNativeDataResourceSurfaceV2 } from './data-surface.js';
|
|
7
7
|
import { nativeScopeSourceGrantPathSupportedV2, nativeScopeSourceSubjectPathSupportedV2, resolveNativeScopeSourceFieldPathV2, } from './scope-source-field-path.js';
|
|
8
8
|
import { NativeDataPolicyExpressionV2Error, nativeDataPolicyExpressionLeavesV2, nativeDataPolicyExpressionToCnfV2, } from './data-policy-expression.js';
|
|
@@ -1646,15 +1646,21 @@ function validateAnonymousPublicAccess(value, config, pointer) {
|
|
|
1646
1646
|
const nativeCreate = String(resourceSurface.mutationOwner || 'native') === 'native' &&
|
|
1647
1647
|
resourceSurface.generated?.create !== false;
|
|
1648
1648
|
const requiredCreateFields = resource.schema.fields
|
|
1649
|
-
.filter((field) => field.
|
|
1650
|
-
String(field.type || '') !== 'serial-number' &&
|
|
1651
|
-
resourceSurfaceFields[field.code]?.system !== true)
|
|
1649
|
+
.filter((field) => nativeFieldRequiresCreateInputV2(field, resourceSurfaceFields[field.code]))
|
|
1652
1650
|
.map((field) => String(field.code));
|
|
1653
|
-
if (operations.includes('create') &&
|
|
1654
|
-
(!nativeCreate ||
|
|
1655
|
-
requiredCreateFields.some((field) => !fields.includes(field) || !requiredFields.includes(field)))) {
|
|
1651
|
+
if (operations.includes('create') && !nativeCreate) {
|
|
1656
1652
|
fail('NATIVE_PUBLIC_CREATE_FIELDS_INCOMPLETE', `${policyPointer}/fields`);
|
|
1657
1653
|
}
|
|
1654
|
+
if (operations.includes('create')) {
|
|
1655
|
+
for (const fieldCode of requiredCreateFields) {
|
|
1656
|
+
const missingSet = !fields.includes(fieldCode)
|
|
1657
|
+
? 'fields'
|
|
1658
|
+
: !requiredFields.includes(fieldCode) ? 'requiredFields' : null;
|
|
1659
|
+
if (missingSet) {
|
|
1660
|
+
fail('NATIVE_PUBLIC_CREATE_FIELDS_INCOMPLETE', `${policyPointer}/${missingSet}`, { resourceCode, fieldCode });
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1658
1664
|
if (Object.prototype.hasOwnProperty.call(policy, 'draft')) {
|
|
1659
1665
|
const draft = object(policy.draft, `${policyPointer}/draft`);
|
|
1660
1666
|
exactKeys(draft, ['enabled', 'inactivityTtlSeconds', 'maxBytes'], `${policyPointer}/draft`);
|