openxiangda-contracts 2.24.0 → 2.25.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/native-compiler/compiler.d.ts.map +1 -1
- package/dist/native-compiler/compiler.js +21 -2
- package/dist/native-compiler/compiler.js.map +1 -1
- package/dist/native-compiler/decimal-lifecycle.d.ts +12 -0
- package/dist/native-compiler/decimal-lifecycle.d.ts.map +1 -0
- package/dist/native-compiler/decimal-lifecycle.js +83 -0
- package/dist/native-compiler/decimal-lifecycle.js.map +1 -0
- package/dist/native-compiler/index.cjs +2 -2
- package/dist/native-compiler/index.d.ts +1 -0
- package/dist/native-compiler/index.d.ts.map +1 -1
- package/dist/native-compiler/index.js +2 -2
- package/dist/native-version.d.ts +1 -0
- package/dist/native-version.d.ts.map +1 -1
- package/dist/native-version.js +1 -0
- package/dist/native-version.js.map +1 -1
- package/dist/schemas.d.ts +64 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +18 -0
- package/dist/schemas.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +9 -0
- package/dist/validation.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/native-compiler/compiler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/native-compiler/compiler.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,kCAAkC,IAAI,uCAAuC,EACnF,MAAM,aAAa,CAAC;AAyBrB,QAAA,MAAM,iBAAiB,mDAAmD,CAAC;AAC3E,QAAA,MAAM,yBAAyB,YAA2C,CAAC;AAgF3E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAe7B,CAAC;AACZ,eAAO,MAAM,mBAAm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;gBAG3C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAY5C;AAED,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,gCAAgC,GACtC,iCAAiC,CAkJnC;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,UAAU,GACjB,uCAAuC,EAAE,CAiT3C;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;IACf,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;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;IAC5B,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC;CAChC,GAAG,wBAAwB,EAAE,CA4J7B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeDecimalReservationEventDeclaration, decimalReservationEventContext } from './decimal-reservation.js';
|
|
2
|
+
import { NativeDecimalLifecycleContractError, parseDecimalReservationLifecycle, validateDecimalReservationLifecycles } from './decimal-lifecycle.js';
|
|
2
3
|
import { compileNativeEventAction } from './event-action.js';
|
|
3
4
|
import { projectNativeDataResourceViewV2 } from './data-surface.js';
|
|
4
5
|
import { hasDataAuditReadPolicy, isDataAuditMetadataField } from './data-audit-access.js';
|
|
@@ -321,6 +322,11 @@ export function compileRequiredPlatformCapabilitiesV3(config) {
|
|
|
321
322
|
},
|
|
322
323
|
};
|
|
323
324
|
const usages = [
|
|
325
|
+
...(resources.some(resource => resource.decimalReservationLifecycle)
|
|
326
|
+
? [{ code: 'data.decimal-reservation-lifecycle',
|
|
327
|
+
declaration: resources.filter(resource => resource.decimalReservationLifecycle)
|
|
328
|
+
.map(resource => ({ code: resource.code, decimalReservationLifecycle: resource.decimalReservationLifecycle })) }]
|
|
329
|
+
: []),
|
|
324
330
|
...(operations.some(operation => operation.platformAccess?.decimalReservation) ||
|
|
325
331
|
config.events.subscriptions.some((subscription) => subscription.platformAccess?.decimalReservation)
|
|
326
332
|
? [{
|
|
@@ -942,6 +948,15 @@ function compileExpectedContract(config, configDigest, generatorVersion) {
|
|
|
942
948
|
validateAdminNavigationReferences(config);
|
|
943
949
|
const adminPages = compileAdminPages(config);
|
|
944
950
|
const subjectReadSurfaces = compileSubjectReadSurfaces(config, capabilities);
|
|
951
|
+
const operations = compileOperations(config);
|
|
952
|
+
try {
|
|
953
|
+
validateDecimalReservationLifecycles(config.data.resources, operations);
|
|
954
|
+
}
|
|
955
|
+
catch (error) {
|
|
956
|
+
if (error instanceof NativeDecimalLifecycleContractError)
|
|
957
|
+
fail(error.code, error.pointer, { reason: error.reason });
|
|
958
|
+
throw error;
|
|
959
|
+
}
|
|
945
960
|
return {
|
|
946
961
|
schemaVersion: CONTRACT_SCHEMA,
|
|
947
962
|
compilerContractVersion: COMPILER_CONTRACT_VERSION,
|
|
@@ -952,7 +967,7 @@ function compileExpectedContract(config, configDigest, generatorVersion) {
|
|
|
952
967
|
resources: compileResources(config),
|
|
953
968
|
...(subjectReadSurfaces.length ? { subjectReadSurfaces } : {}),
|
|
954
969
|
capabilities: sorted(capabilities, item => item.code),
|
|
955
|
-
operations
|
|
970
|
+
operations,
|
|
956
971
|
eventConsumers,
|
|
957
972
|
eventProducers,
|
|
958
973
|
eventSchemas,
|
|
@@ -4683,6 +4698,7 @@ function validateResource(raw, pointer, appCode) {
|
|
|
4683
4698
|
'schema',
|
|
4684
4699
|
'surface',
|
|
4685
4700
|
'invariants',
|
|
4701
|
+
'decimalReservationLifecycle',
|
|
4686
4702
|
'capabilities',
|
|
4687
4703
|
'dataPolicyCode',
|
|
4688
4704
|
'fieldPolicies',
|
|
@@ -4695,13 +4711,15 @@ function validateResource(raw, pointer, appCode) {
|
|
|
4695
4711
|
exactKeys(schema, ['fields'], `${pointer}/schema`);
|
|
4696
4712
|
let fields;
|
|
4697
4713
|
let invariants;
|
|
4714
|
+
let decimalReservationLifecycle;
|
|
4698
4715
|
try {
|
|
4716
|
+
decimalReservationLifecycle = parseDecimalReservationLifecycle(resource.decimalReservationLifecycle, `${pointer}/decimalReservationLifecycle`);
|
|
4699
4717
|
fields = parseNativeDataFieldsV2(schema.fields, `${pointer}/schema/fields`);
|
|
4700
4718
|
invariants = parseNativeDataResourceInvariantsV2(resource.invariants, fields, `${pointer}/invariants`);
|
|
4701
4719
|
validateNativeDataResourceSurfaceV2(resource.surface, fields, `${pointer}/surface`);
|
|
4702
4720
|
}
|
|
4703
4721
|
catch (error) {
|
|
4704
|
-
if (error instanceof NativeDataFieldContractV2Error) {
|
|
4722
|
+
if (error instanceof NativeDataFieldContractV2Error || error instanceof NativeDecimalLifecycleContractError) {
|
|
4705
4723
|
fail(error.code, error.pointer);
|
|
4706
4724
|
}
|
|
4707
4725
|
throw error;
|
|
@@ -4735,6 +4753,7 @@ function validateResource(raw, pointer, appCode) {
|
|
|
4735
4753
|
name,
|
|
4736
4754
|
schema: { fields },
|
|
4737
4755
|
...(resource.invariants === undefined ? {} : { invariants }),
|
|
4756
|
+
...(decimalReservationLifecycle ? { decimalReservationLifecycle } : {}),
|
|
4738
4757
|
capabilities,
|
|
4739
4758
|
fieldPolicies,
|
|
4740
4759
|
};
|