@osdk/maker 0.15.0 → 0.16.0-beta.10
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/CHANGELOG.md +89 -126
- package/README.md +18 -1
- package/build/browser/api/cloneDefinition.js +36 -0
- package/build/browser/api/cloneDefinition.js.map +1 -0
- package/build/browser/api/code-snippets/createCodeSnippets.js +1 -1
- package/build/browser/api/code-snippets/createCodeSnippets.js.map +1 -1
- package/build/browser/api/defineAction.js +9 -1
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js +3 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineCreateObjectAction.js +3 -1
- package/build/browser/api/defineCreateObjectAction.js.map +1 -1
- package/build/browser/api/defineCreateOrModifyObjectAction.js +3 -1
- package/build/browser/api/defineCreateOrModifyObjectAction.js.map +1 -1
- package/build/browser/api/defineDeleteInterfaceObjectAction.js +3 -1
- package/build/browser/api/defineDeleteInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineDeleteObjectAction.js +3 -1
- package/build/browser/api/defineDeleteObjectAction.js.map +1 -1
- package/build/browser/api/defineFunction.js +61 -0
- package/build/browser/api/defineFunction.js.map +1 -0
- package/build/browser/api/defineInterface.js +3 -1
- package/build/browser/api/defineInterface.js.map +1 -1
- package/build/browser/api/defineInterfaceLinkConstraint.js +6 -2
- package/build/browser/api/defineInterfaceLinkConstraint.js.map +1 -1
- package/build/browser/api/defineLink.js +3 -1
- package/build/browser/api/defineLink.js.map +1 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js +3 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineModifyObjectAction.js +3 -1
- package/build/browser/api/defineModifyObjectAction.js.map +1 -1
- package/build/browser/api/defineObject.js +29 -10
- package/build/browser/api/defineObject.js.map +1 -1
- package/build/browser/api/defineOntology.js +29 -0
- package/build/browser/api/defineOntology.js.map +1 -1
- package/build/browser/api/defineSpt.js +3 -1
- package/build/browser/api/defineSpt.js.map +1 -1
- package/build/browser/api/defineValueType.js +3 -1
- package/build/browser/api/defineValueType.js.map +1 -1
- package/build/browser/api/interface/InterfaceType.js.map +1 -1
- package/build/browser/api/object/ObjectPropertyType.js.map +1 -1
- package/build/browser/api/object/ObjectTypeDatasourceDefinition.js.map +1 -1
- package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
- package/build/browser/api/properties/ReducerType.js +2 -0
- package/build/browser/api/properties/ReducerType.js.map +1 -0
- package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
- package/build/browser/cli/main.js +1 -1
- package/build/browser/cli/main.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js +17 -6
- package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertInterface.js +2 -1
- package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertMainValue.js +36 -0
- package/build/browser/conversion/toMarketplace/convertMainValue.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +4 -3
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertReducers.js +53 -0
- package/build/browser/conversion/toMarketplace/convertReducers.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertSpt.js +5 -3
- package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -2
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/browser/index.js +5 -2
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +267 -105
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +214 -164
- package/build/esm/api/cloneDefinition.js +36 -0
- package/build/esm/api/cloneDefinition.js.map +1 -0
- package/build/esm/api/code-snippets/createCodeSnippets.js +1 -1
- package/build/esm/api/code-snippets/createCodeSnippets.js.map +1 -1
- package/build/esm/api/defineAction.js +9 -1
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js +3 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineCreateObjectAction.js +3 -1
- package/build/esm/api/defineCreateObjectAction.js.map +1 -1
- package/build/esm/api/defineCreateOrModifyObjectAction.js +3 -1
- package/build/esm/api/defineCreateOrModifyObjectAction.js.map +1 -1
- package/build/esm/api/defineDeleteInterfaceObjectAction.js +3 -1
- package/build/esm/api/defineDeleteInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineDeleteObjectAction.js +3 -1
- package/build/esm/api/defineDeleteObjectAction.js.map +1 -1
- package/build/esm/api/defineFunction.js +61 -0
- package/build/esm/api/defineFunction.js.map +1 -0
- package/build/esm/api/defineInterface.js +3 -1
- package/build/esm/api/defineInterface.js.map +1 -1
- package/build/esm/api/defineInterfaceLinkConstraint.js +6 -2
- package/build/esm/api/defineInterfaceLinkConstraint.js.map +1 -1
- package/build/esm/api/defineLink.js +3 -1
- package/build/esm/api/defineLink.js.map +1 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js +3 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineModifyObjectAction.js +3 -1
- package/build/esm/api/defineModifyObjectAction.js.map +1 -1
- package/build/esm/api/defineObject.js +29 -10
- package/build/esm/api/defineObject.js.map +1 -1
- package/build/esm/api/defineOntology.js +29 -0
- package/build/esm/api/defineOntology.js.map +1 -1
- package/build/esm/api/defineSpt.js +3 -1
- package/build/esm/api/defineSpt.js.map +1 -1
- package/build/esm/api/defineValueType.js +3 -1
- package/build/esm/api/defineValueType.js.map +1 -1
- package/build/esm/api/interface/InterfaceType.js.map +1 -1
- package/build/esm/api/object/ObjectPropertyType.js.map +1 -1
- package/build/esm/api/object/ObjectTypeDatasourceDefinition.js.map +1 -1
- package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
- package/build/esm/api/properties/ReducerType.js +2 -0
- package/build/esm/api/properties/ReducerType.js.map +1 -0
- package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/esm/cli/main.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js +17 -6
- package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertInterface.js +2 -1
- package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertMainValue.js +36 -0
- package/build/esm/conversion/toMarketplace/convertMainValue.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +4 -3
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertReducers.js +53 -0
- package/build/esm/conversion/toMarketplace/convertReducers.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertSpt.js +5 -3
- package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -2
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/esm/index.js +5 -2
- package/build/esm/index.js.map +1 -1
- package/build/types/api/cloneDefinition.d.ts +9 -0
- package/build/types/api/cloneDefinition.d.ts.map +1 -0
- package/build/types/api/defineAction.d.ts +1 -1
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineCreateObjectAction.d.ts +1 -1
- package/build/types/api/defineCreateObjectAction.d.ts.map +1 -1
- package/build/types/api/defineCreateOrModifyObjectAction.d.ts +1 -1
- package/build/types/api/defineCreateOrModifyObjectAction.d.ts.map +1 -1
- package/build/types/api/defineDeleteInterfaceObjectAction.d.ts +1 -1
- package/build/types/api/defineDeleteInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineDeleteObjectAction.d.ts +1 -1
- package/build/types/api/defineDeleteObjectAction.d.ts.map +1 -1
- package/build/types/api/defineFunction.d.ts +19 -0
- package/build/types/api/defineFunction.d.ts.map +1 -0
- package/build/types/api/defineInterface.d.ts +1 -1
- package/build/types/api/defineInterface.d.ts.map +1 -1
- package/build/types/api/defineInterfaceLinkConstraint.d.ts +1 -1
- package/build/types/api/defineInterfaceLinkConstraint.d.ts.map +1 -1
- package/build/types/api/defineLink.d.ts +1 -1
- package/build/types/api/defineLink.d.ts.map +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineModifyObjectAction.d.ts +1 -1
- package/build/types/api/defineModifyObjectAction.d.ts.map +1 -1
- package/build/types/api/defineObject.d.ts +1 -1
- package/build/types/api/defineObject.d.ts.map +1 -1
- package/build/types/api/defineOntology.d.ts +5 -0
- package/build/types/api/defineOntology.d.ts.map +1 -1
- package/build/types/api/defineSpt.d.ts +3 -1
- package/build/types/api/defineSpt.d.ts.map +1 -1
- package/build/types/api/defineValueType.d.ts +1 -1
- package/build/types/api/defineValueType.d.ts.map +1 -1
- package/build/types/api/interface/InterfaceType.d.ts +1 -1
- package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
- package/build/types/api/object/ObjectPropertyType.d.ts +2 -0
- package/build/types/api/object/ObjectPropertyType.d.ts.map +1 -1
- package/build/types/api/object/ObjectTypeDatasourceDefinition.d.ts +10 -3
- package/build/types/api/object/ObjectTypeDatasourceDefinition.d.ts.map +1 -1
- package/build/types/api/properties/PropertyTypeType.d.ts +4 -0
- package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
- package/build/types/api/properties/ReducerType.d.ts +4 -0
- package/build/types/api/properties/ReducerType.d.ts.map +1 -0
- package/build/types/api/properties/SharedPropertyType.d.ts +2 -0
- package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertDatasourceDefinition.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertMainValue.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertMainValue.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertObjectPropertyType.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertReducers.d.ts +6 -0
- package/build/types/conversion/toMarketplace/convertReducers.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
- package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts +2 -1
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts.map +1 -1
- package/build/types/index.d.ts +14 -6
- package/build/types/index.d.ts.map +1 -1
- package/package.json +6 -5
- package/build/browser/api/test/actions.test.js +0 -14397
- package/build/browser/api/test/actions.test.js.map +0 -1
- package/build/browser/api/test/interfaces.test.js +0 -1189
- package/build/browser/api/test/interfaces.test.js.map +0 -1
- package/build/browser/api/test/links.test.js +0 -2019
- package/build/browser/api/test/links.test.js.map +0 -1
- package/build/browser/api/test/markingconstraint.test.js +0 -134
- package/build/browser/api/test/markingconstraint.test.js.map +0 -1
- package/build/browser/api/test/misc.test.js +0 -1315
- package/build/browser/api/test/misc.test.js.map +0 -1
- package/build/browser/api/test/objectStatus.test.js +0 -160
- package/build/browser/api/test/objectStatus.test.js.map +0 -1
- package/build/browser/api/test/objects.test.js +0 -3856
- package/build/browser/api/test/objects.test.js.map +0 -1
- package/build/browser/api/test/spt.test.js +0 -722
- package/build/browser/api/test/spt.test.js.map +0 -1
- package/build/browser/api/test/valueTypes.test.js +0 -307
- package/build/browser/api/test/valueTypes.test.js.map +0 -1
- package/build/esm/api/test/actions.test.js +0 -14397
- package/build/esm/api/test/actions.test.js.map +0 -1
- package/build/esm/api/test/interfaces.test.js +0 -1189
- package/build/esm/api/test/interfaces.test.js.map +0 -1
- package/build/esm/api/test/links.test.js +0 -2019
- package/build/esm/api/test/links.test.js.map +0 -1
- package/build/esm/api/test/markingconstraint.test.js +0 -134
- package/build/esm/api/test/markingconstraint.test.js.map +0 -1
- package/build/esm/api/test/misc.test.js +0 -1315
- package/build/esm/api/test/misc.test.js.map +0 -1
- package/build/esm/api/test/objectStatus.test.js +0 -160
- package/build/esm/api/test/objectStatus.test.js.map +0 -1
- package/build/esm/api/test/objects.test.js +0 -3856
- package/build/esm/api/test/objects.test.js.map +0 -1
- package/build/esm/api/test/spt.test.js +0 -722
- package/build/esm/api/test/spt.test.js.map +0 -1
- package/build/esm/api/test/valueTypes.test.js +0 -307
- package/build/esm/api/test/valueTypes.test.js.map +0 -1
- package/build/types/api/test/actions.test.d.ts +0 -1
- package/build/types/api/test/actions.test.d.ts.map +0 -1
- package/build/types/api/test/interfaces.test.d.ts +0 -1
- package/build/types/api/test/interfaces.test.d.ts.map +0 -1
- package/build/types/api/test/links.test.d.ts +0 -1
- package/build/types/api/test/links.test.d.ts.map +0 -1
- package/build/types/api/test/markingconstraint.test.d.ts +0 -1
- package/build/types/api/test/markingconstraint.test.d.ts.map +0 -1
- package/build/types/api/test/misc.test.d.ts +0 -1
- package/build/types/api/test/misc.test.d.ts.map +0 -1
- package/build/types/api/test/objectStatus.test.d.ts +0 -1
- package/build/types/api/test/objectStatus.test.d.ts.map +0 -1
- package/build/types/api/test/objects.test.d.ts +0 -1
- package/build/types/api/test/objects.test.d.ts.map +0 -1
- package/build/types/api/test/spt.test.d.ts +0 -1
- package/build/types/api/test/spt.test.d.ts.map +0 -1
- package/build/types/api/test/valueTypes.test.d.ts +0 -1
- package/build/types/api/test/valueTypes.test.d.ts.map +0 -1
package/build/cjs/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var consola = require('consola');
|
|
6
6
|
var fs3 = require('fs/promises');
|
|
7
7
|
var path3 = require('path');
|
|
8
|
-
var
|
|
8
|
+
var invariant9 = require('tiny-invariant');
|
|
9
9
|
var yargs = require('yargs');
|
|
10
10
|
var helpers = require('yargs/helpers');
|
|
11
11
|
var fs2 = require('fs');
|
|
@@ -35,7 +35,7 @@ function _interopNamespace(e) {
|
|
|
35
35
|
|
|
36
36
|
var fs3__namespace = /*#__PURE__*/_interopNamespace(fs3);
|
|
37
37
|
var path3__namespace = /*#__PURE__*/_interopNamespace(path3);
|
|
38
|
-
var
|
|
38
|
+
var invariant9__default = /*#__PURE__*/_interopDefault(invariant9);
|
|
39
39
|
var yargs__default = /*#__PURE__*/_interopDefault(yargs);
|
|
40
40
|
var fs2__namespace = /*#__PURE__*/_interopNamespace(fs2);
|
|
41
41
|
var Mustache__default = /*#__PURE__*/_interopDefault(Mustache);
|
|
@@ -217,10 +217,10 @@ function validateLink(linkDefinition) {
|
|
|
217
217
|
object: toManyObject
|
|
218
218
|
} = getObject(linkDefinition.toMany.object);
|
|
219
219
|
const foreignKey = toManyObject.properties?.find((p) => p.apiName === linkDefinition.manyForeignKeyProperty);
|
|
220
|
-
!(foreignKey !== void 0) ? process.env.NODE_ENV !== "production" ?
|
|
221
|
-
!/([a-z][a-z0-9\\-]*)/.test(linkDefinition.apiName) ? process.env.NODE_ENV !== "production" ?
|
|
220
|
+
!(foreignKey !== void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Foreign key ${linkDefinition.manyForeignKeyProperty} on link ${linkDefinition.apiName} does not exist on object ${toManyObjectApiName}`) : invariant9__default.default(false) : void 0;
|
|
221
|
+
!/([a-z][a-z0-9\\-]*)/.test(linkDefinition.apiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Top level link api names are expected to match the regex pattern ([a-z][a-z0-9\\-]*) ${linkDefinition.apiName} does not match`) : invariant9__default.default(false) : void 0;
|
|
222
222
|
const typesMatch = foreignKey.type === oneObject.properties?.find((p) => p.apiName === oneObject.primaryKeyPropertyApiName)?.type;
|
|
223
|
-
!typesMatch ? process.env.NODE_ENV !== "production" ?
|
|
223
|
+
!typesMatch ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Link ${linkDefinition.apiName} has type mismatch between the one side's primary key and the foreign key on the many side`) : invariant9__default.default(false) : void 0;
|
|
224
224
|
}
|
|
225
225
|
if ("intermediaryObjectType" in linkDefinition) {
|
|
226
226
|
const {
|
|
@@ -235,18 +235,18 @@ function validateLink(linkDefinition) {
|
|
|
235
235
|
apiName: manyIntermediaryOneObjectApiName} = getObject(linkDefinition.many.linkToIntermediary.one.object);
|
|
236
236
|
const {
|
|
237
237
|
apiName: manyIntermediaryToManyObjectApiName} = getObject(linkDefinition.many.linkToIntermediary.toMany.object);
|
|
238
|
-
!("one" in linkDefinition.many.linkToIntermediary && manyIntermediaryOneObjectApiName === manyObject.apiName && manyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== "production" ?
|
|
238
|
+
!("one" in linkDefinition.many.linkToIntermediary && manyIntermediaryOneObjectApiName === manyObject.apiName && manyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `LinkTypeA ${linkDefinition.many.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectA ${manyObjectApiName}`) : invariant9__default.default(false) : void 0;
|
|
239
239
|
const {
|
|
240
240
|
apiName: toManyIntermediaryOneObjectApiName} = getObject(linkDefinition.toMany.linkToIntermediary.one.object);
|
|
241
241
|
const {
|
|
242
242
|
apiName: toManyIntermediaryToManyObjectApiName} = getObject(linkDefinition.toMany.linkToIntermediary.toMany.object);
|
|
243
|
-
!("one" in linkDefinition.toMany.linkToIntermediary && toManyIntermediaryOneObjectApiName === toManyObjectApiName && toManyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== "production" ?
|
|
243
|
+
!("one" in linkDefinition.toMany.linkToIntermediary && toManyIntermediaryOneObjectApiName === toManyObjectApiName && toManyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `LinkTypeB ${linkDefinition.toMany.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectB ${toManyObjectApiName}`) : invariant9__default.default(false) : void 0;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
function getObject(object) {
|
|
247
247
|
const objectApiName = typeof object === "string" ? object : object.apiName;
|
|
248
248
|
const fullObject = ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName];
|
|
249
|
-
!(fullObject !== void 0) ? process.env.NODE_ENV !== "production" ?
|
|
249
|
+
!(fullObject !== void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Object ${objectApiName} is not defined`) : invariant9__default.default(false) : void 0;
|
|
250
250
|
return {
|
|
251
251
|
apiName: objectApiName,
|
|
252
252
|
object: fullObject
|
|
@@ -282,6 +282,19 @@ function convertLinkStatus(status) {
|
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
// src/api/cloneDefinition.ts
|
|
286
|
+
function cloneDefinition(input) {
|
|
287
|
+
const clone = {
|
|
288
|
+
...input
|
|
289
|
+
};
|
|
290
|
+
for (const key in clone) {
|
|
291
|
+
if (Object.prototype.hasOwnProperty.call(clone, key) && Array.isArray(clone[key])) {
|
|
292
|
+
clone[key] = [...clone[key]];
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return clone;
|
|
296
|
+
}
|
|
297
|
+
|
|
285
298
|
// src/api/interface/InterfacePropertyType.ts
|
|
286
299
|
function isInterfaceSharedPropertyType(interfacePropertyType) {
|
|
287
300
|
return "sharedPropertyType" in interfacePropertyType;
|
|
@@ -330,41 +343,47 @@ function isStruct(type) {
|
|
|
330
343
|
var ISO_8601_DURATION = /^P(?!$)(?:(?:((?:\d+Y)|(?:\d+(?:\.|,)\d+Y$))?((?:\d+M)|(?:\d+(?:\.|,)\d+M$))?((?:\d+D)|(?:\d+(?:\.|,)\d+D$))?(T((?:\d+H)|(?:\d+(?:\.|,)\d+H$))?((?:\d+M)|(?:\d+(?:\.|,)\d+M$))?((?:\d+S)|(?:\d+(?:\.|,)\d+S$))?)?)|(?:\d+(?:(?:\.|,)\d+)?W))$/;
|
|
331
344
|
var ISO_8601_DATETIME = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/;
|
|
332
345
|
var API_NAME_PATTERN = /^([a-zA-Z][a-zA-Z0-9\\-]*)$/;
|
|
333
|
-
function defineObject(
|
|
346
|
+
function defineObject(objectDefInput) {
|
|
347
|
+
const objectDef = cloneDefinition(objectDefInput);
|
|
334
348
|
const apiName = namespace + objectDef.apiName;
|
|
335
349
|
const propertyApiNames = objectDef.properties ? Object.keys(objectDef.properties) : [];
|
|
336
350
|
if (ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][apiName] !== void 0) {
|
|
337
351
|
throw new Error(`Object type with apiName ${objectDef.apiName} is already defined`);
|
|
338
352
|
}
|
|
339
|
-
!API_NAME_PATTERN.test(objectDef.apiName) ? process.env.NODE_ENV !== "production" ?
|
|
340
|
-
!propertyApiNames.includes(objectDef.titlePropertyApiName) ? process.env.NODE_ENV !== "production" ?
|
|
341
|
-
!propertyApiNames.includes(objectDef.primaryKeyPropertyApiName) ? process.env.NODE_ENV !== "production" ?
|
|
342
|
-
!!objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.editOnly ? process.env.NODE_ENV !== "production" ?
|
|
353
|
+
!API_NAME_PATTERN.test(objectDef.apiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Invalid API name ${objectDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`) : invariant9__default.default(false) : void 0;
|
|
354
|
+
!propertyApiNames.includes(objectDef.titlePropertyApiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Title property ${objectDef.titlePropertyApiName} is not defined on object ${objectDef.apiName}`) : invariant9__default.default(false) : void 0;
|
|
355
|
+
!propertyApiNames.includes(objectDef.primaryKeyPropertyApiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} does not exist on object ${objectDef.apiName}`) : invariant9__default.default(false) : void 0;
|
|
356
|
+
!!objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.editOnly ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} on object ${objectDef.apiName} cannot be edit-only`) : invariant9__default.default(false) : void 0;
|
|
343
357
|
const retentionPeriods = (objectDef.datasources ?? []).filter((ds) => ds.type === "stream").map((ds) => ds.retentionPeriod);
|
|
344
358
|
retentionPeriods.forEach((retentionPeriod) => {
|
|
345
|
-
!(retentionPeriod === void 0 || ISO_8601_DURATION.test(retentionPeriod)) ? process.env.NODE_ENV !== "production" ?
|
|
359
|
+
!(retentionPeriod === void 0 || ISO_8601_DURATION.test(retentionPeriod)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Retention period "${retentionPeriod}" on object "${objectDef.apiName}" is not a valid ISO 8601 duration string`) : invariant9__default.default(false) : void 0;
|
|
346
360
|
});
|
|
347
361
|
const baseDatasources = (objectDef.datasources ?? []).filter((ds) => ["dataset", "stream", "restrictedView"].includes(ds.type));
|
|
348
|
-
!(baseDatasources.length <= 1) ? process.env.NODE_ENV !== "production" ?
|
|
362
|
+
!(baseDatasources.length <= 1) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Object ${objectDef.apiName} has more than one base datasource (got: [${baseDatasources.map((ds) => ds.type).join(", ")}])`) : invariant9__default.default(false) : void 0;
|
|
349
363
|
const derivedDatasources = (objectDef.datasources ?? []).filter((ds) => ds.type === "derived");
|
|
350
364
|
if (derivedDatasources.length > 0) {
|
|
351
365
|
derivedDatasources.forEach((ds) => validateDerivedDatasource(objectDef, ds));
|
|
352
366
|
}
|
|
353
|
-
|
|
354
|
-
|
|
367
|
+
const objectStatusType = getStatusType(objectDef.status);
|
|
368
|
+
if (objectStatusType === "experimental" || objectStatusType === "deprecated" || objectStatusType === "example") {
|
|
369
|
+
const mismatchedProperties = [];
|
|
355
370
|
Object.entries(objectDef.properties ?? {}).forEach(([apiName2, property]) => {
|
|
356
|
-
if (property.status
|
|
357
|
-
|
|
371
|
+
if (property.status !== void 0) {
|
|
372
|
+
const propertyStatusType = getStatusType(property.status);
|
|
373
|
+
if (propertyStatusType !== objectStatusType) {
|
|
374
|
+
mismatchedProperties.push(apiName2);
|
|
375
|
+
}
|
|
358
376
|
}
|
|
359
377
|
});
|
|
360
|
-
!(
|
|
378
|
+
!(mismatchedProperties.length === 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Object "${objectDef.apiName}" has "${objectStatusType}" status, but the following properties have a different status: ${mismatchedProperties.join(", ")}`) : invariant9__default.default(false) : void 0;
|
|
361
379
|
}
|
|
362
380
|
if (objectDef.status && typeof objectDef.status === "object" && objectDef.status.type === "deprecated") {
|
|
363
381
|
const deadline = objectDef.status.deadline;
|
|
364
|
-
!(deadline !== void 0 && ISO_8601_DATETIME.test(deadline)) ? process.env.NODE_ENV !== "production" ?
|
|
382
|
+
!(deadline !== void 0 && ISO_8601_DATETIME.test(deadline)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Deprecated status deadline "${deadline}" on object "${objectDef.apiName}" is not a valid ISO 8601 datetime string`) : invariant9__default.default(false) : void 0;
|
|
365
383
|
}
|
|
366
|
-
|
|
367
|
-
|
|
384
|
+
const titleProp = objectDef.properties?.[objectDef.titlePropertyApiName]?.type;
|
|
385
|
+
!(!isExotic(titleProp) || isStruct(titleProp) && titleProp.mainValue && !isExotic(titleProp.mainValue.type)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Title property ${objectDef.titlePropertyApiName} must be a primitive type`) : invariant9__default.default(false) : void 0;
|
|
386
|
+
!!isExotic(objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.type) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} can only be primitive types`) : invariant9__default.default(false) : void 0;
|
|
368
387
|
objectDef.implementsInterfaces?.forEach((interfaceImpl) => {
|
|
369
388
|
const allInterfaceProperties = getFlattenedInterfaceProperties(interfaceImpl.implements);
|
|
370
389
|
const nonExistentInterfaceProperties = interfaceImpl.propertyMapping.map((val) => val.interfaceProperty).filter((interfaceProperty) => allInterfaceProperties[addNamespaceIfNone(interfaceProperty)] === void 0 && allInterfaceProperties[withoutNamespace(interfaceProperty)] === void 0).map((interfaceProp) => ({
|
|
@@ -384,7 +403,7 @@ function defineObject(objectDef) {
|
|
|
384
403
|
};
|
|
385
404
|
const validations = Object.entries(getFlattenedInterfaceProperties(interfaceImpl.implements)).map(validateProperty);
|
|
386
405
|
const allFailedValidations = validations.concat(nonExistentInterfaceProperties).filter((val) => val.type === "invalid");
|
|
387
|
-
!(allFailedValidations.length === 0) ? process.env.NODE_ENV !== "production" ?
|
|
406
|
+
!(allFailedValidations.length === 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "\n" + allFailedValidations.map(formatValidationErrors).join("\n")) : invariant9__default.default(false) : void 0;
|
|
388
407
|
});
|
|
389
408
|
const flattenedProperties = Object.entries(objectDef.properties ?? {}).map(([apiName2, property]) => convertUserObjectPropertyType(apiName2, property));
|
|
390
409
|
const finalObject = {
|
|
@@ -436,13 +455,13 @@ function convertUserObjectPropertyType(apiName, property) {
|
|
|
436
455
|
};
|
|
437
456
|
}
|
|
438
457
|
function validateDerivedDatasource(objectDef, datasource) {
|
|
439
|
-
!(datasource.linkDefinition.length > 0) ? process.env.NODE_ENV !== "production" ?
|
|
458
|
+
!(datasource.linkDefinition.length > 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Derived datasource for object '${objectDef.apiName}' must have at least one link.`) : invariant9__default.default(false) : void 0;
|
|
440
459
|
datasource.linkDefinition.forEach((link) => {
|
|
441
460
|
const linkApiName = link.linkType.apiName;
|
|
442
|
-
!(ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== void 0 || importedTypes[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== void 0) ? process.env.NODE_ENV !== "production" ?
|
|
461
|
+
!(ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== void 0 || importedTypes[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Link type '${linkApiName}' used in derived datasource for object '${objectDef.apiName}' is not defined.`) : invariant9__default.default(false) : void 0;
|
|
443
462
|
});
|
|
444
463
|
Object.keys(datasource.propertyMapping).forEach((prop) => {
|
|
445
|
-
!(objectDef.properties?.[prop] !== void 0) ? process.env.NODE_ENV !== "production" ?
|
|
464
|
+
!(objectDef.properties?.[prop] !== void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property '${prop}' used in derived datasource for object '${objectDef.apiName}' is not defined.`) : invariant9__default.default(false) : void 0;
|
|
446
465
|
});
|
|
447
466
|
const isLinkedProperties = typeof Object.values(datasource.propertyMapping)[0] === "string";
|
|
448
467
|
if (isLinkedProperties) {
|
|
@@ -477,7 +496,7 @@ function validateLinkedProperties(datasource, objectDef) {
|
|
|
477
496
|
hasProperty
|
|
478
497
|
} = getPropertiesForValidation(targetObject, objectDef);
|
|
479
498
|
foreignProperties.forEach((prop) => {
|
|
480
|
-
!hasProperty(prop) ? process.env.NODE_ENV !== "production" ?
|
|
499
|
+
!hasProperty(prop) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property '${prop}' on object '${apiName}' is not defined`) : invariant9__default.default(false) : void 0;
|
|
481
500
|
});
|
|
482
501
|
}
|
|
483
502
|
function validateAggregations(datasource, objectDef) {
|
|
@@ -487,18 +506,18 @@ function validateAggregations(datasource, objectDef) {
|
|
|
487
506
|
switch (agg.type) {
|
|
488
507
|
case "collectList":
|
|
489
508
|
case "collectSet":
|
|
490
|
-
!isCollectible(property) ? process.env.NODE_ENV !== "production" ?
|
|
491
|
-
!(agg.limit <= 100) ? process.env.NODE_ENV !== "production" ?
|
|
509
|
+
!isCollectible(property) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property '${propName}' on object '${objectDef.apiName}' is not collectible`) : invariant9__default.default(false) : void 0;
|
|
510
|
+
!(agg.limit <= 100) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `[Error] Limit for collection '${propName}' on object '${objectDef.apiName}' is greater than 100`) : invariant9__default.default(false) : void 0;
|
|
492
511
|
break;
|
|
493
512
|
case "avg":
|
|
494
513
|
case "sum":
|
|
495
|
-
!isNumeric(property.type) ? process.env.NODE_ENV !== "production" ?
|
|
514
|
+
!isNumeric(property.type) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property '${propName}' on object '${objectDef.apiName}' is not numeric`) : invariant9__default.default(false) : void 0;
|
|
496
515
|
break;
|
|
497
516
|
case "min":
|
|
498
517
|
case "max":
|
|
499
518
|
case "approximateCardinality":
|
|
500
519
|
case "exactCardinality":
|
|
501
|
-
!isPrimitive(property.type) ? process.env.NODE_ENV !== "production" ?
|
|
520
|
+
!isPrimitive(property.type) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property '${propName}' on object '${objectDef.apiName}' is not primitive`) : invariant9__default.default(false) : void 0;
|
|
502
521
|
break;
|
|
503
522
|
}
|
|
504
523
|
if (agg.type !== "count") {
|
|
@@ -508,7 +527,7 @@ function validateAggregations(datasource, objectDef) {
|
|
|
508
527
|
apiName,
|
|
509
528
|
hasProperty
|
|
510
529
|
} = getPropertiesForValidation(targetObject, objectDef);
|
|
511
|
-
!hasProperty(foreignProperty) ? process.env.NODE_ENV !== "production" ?
|
|
530
|
+
!hasProperty(foreignProperty) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property '${foreignProperty}' on object '${apiName}' is not defined`) : invariant9__default.default(false) : void 0;
|
|
512
531
|
}
|
|
513
532
|
});
|
|
514
533
|
}
|
|
@@ -527,6 +546,15 @@ function isPrimitive(type) {
|
|
|
527
546
|
const typeType = typeof type === "string" ? type : type.type;
|
|
528
547
|
return ["boolean", "byte", "date", "double", "float", "integer", "long", "short", "string", "timestamp"].includes(typeType);
|
|
529
548
|
}
|
|
549
|
+
function getStatusType(status) {
|
|
550
|
+
if (status === void 0) {
|
|
551
|
+
return "active";
|
|
552
|
+
}
|
|
553
|
+
if (typeof status === "string") {
|
|
554
|
+
return status;
|
|
555
|
+
}
|
|
556
|
+
return status.type;
|
|
557
|
+
}
|
|
530
558
|
|
|
531
559
|
// src/conversion/toMarketplace/convertActionSections.ts
|
|
532
560
|
function convertActionSections(action) {
|
|
@@ -608,7 +636,7 @@ function convertConditionDefinition(condition, actionParameters) {
|
|
|
608
636
|
}
|
|
609
637
|
};
|
|
610
638
|
case "parameter":
|
|
611
|
-
!actionParameters?.some((param) => param.id === condition.parameterId) ? process.env.NODE_ENV !== "production" ?
|
|
639
|
+
!actionParameters?.some((param) => param.id === condition.parameterId) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Action parameter condition references unknown parameter ${condition.parameterId}`) : invariant9__default.default(false) : void 0;
|
|
612
640
|
return {
|
|
613
641
|
type: "comparison",
|
|
614
642
|
comparison: {
|
|
@@ -833,7 +861,7 @@ function convertNullabilityToDataConstraint(prop) {
|
|
|
833
861
|
}
|
|
834
862
|
};
|
|
835
863
|
}
|
|
836
|
-
!prop.nullability?.noNulls ? process.env.NODE_ENV !== "production" ?
|
|
864
|
+
!prop.nullability?.noNulls ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "Marking property type has noNulls set to false, marking properties must not be nullable") : invariant9__default.default(false) : void 0;
|
|
837
865
|
return {
|
|
838
866
|
propertyTypeConstraints: [],
|
|
839
867
|
nullability: void 0,
|
|
@@ -846,6 +874,39 @@ function convertNullabilityToDataConstraint(prop) {
|
|
|
846
874
|
nullabilityV2: prop.nullability
|
|
847
875
|
};
|
|
848
876
|
}
|
|
877
|
+
function convertReducers(type, apiName, reducers, sharedPropertyType) {
|
|
878
|
+
reducers?.forEach((reducer) => {
|
|
879
|
+
if (reducer.structField) {
|
|
880
|
+
!(isStruct(type) && Object.keys(type.structDefinition).includes(reducer.structField)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Reducer structField ${reducer.structField} does not exist in struct definition`) : invariant9__default.default(false) : void 0;
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
if (sharedPropertyType) {
|
|
884
|
+
return mapReducers(sharedPropertyType.apiName, sharedPropertyType.reducers);
|
|
885
|
+
} else {
|
|
886
|
+
return mapReducers(apiName, reducers);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
function mapReducers(apiName, reducers) {
|
|
890
|
+
return reducers?.map((reducer) => {
|
|
891
|
+
switch (reducer.direction) {
|
|
892
|
+
case "ascending":
|
|
893
|
+
return {
|
|
894
|
+
direction: "ASCENDING_NULLS_LAST",
|
|
895
|
+
structApiName: reducer.structField ? apiName : void 0,
|
|
896
|
+
fieldApiName: reducer.structField
|
|
897
|
+
};
|
|
898
|
+
case "descending":
|
|
899
|
+
return {
|
|
900
|
+
direction: "DESCENDING_NULLS_LAST",
|
|
901
|
+
structApiName: reducer.structField ? apiName : void 0,
|
|
902
|
+
fieldApiName: reducer.structField
|
|
903
|
+
};
|
|
904
|
+
default: {
|
|
905
|
+
throw new Error(`Unsupported reducer direction: ${reducer.direction}`);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}) ?? [];
|
|
909
|
+
}
|
|
849
910
|
|
|
850
911
|
// src/conversion/toConjure/distributeTypeHelper.ts
|
|
851
912
|
function distributeTypeHelper(type) {
|
|
@@ -855,8 +916,27 @@ function distributeTypeHelper(type) {
|
|
|
855
916
|
};
|
|
856
917
|
}
|
|
857
918
|
|
|
919
|
+
// src/conversion/toMarketplace/convertMainValue.ts
|
|
920
|
+
function convertMainValue(type, apiName, sharedPropertyType) {
|
|
921
|
+
if (sharedPropertyType && isStruct(sharedPropertyType.type) && sharedPropertyType.type.mainValue) {
|
|
922
|
+
return {
|
|
923
|
+
fieldApiNames: Array.isArray(sharedPropertyType.type.mainValue.fields) ? sharedPropertyType.type.mainValue.fields : [sharedPropertyType.type.mainValue.fields],
|
|
924
|
+
structApiName: sharedPropertyType.apiName,
|
|
925
|
+
type: propertyTypeTypeToOntologyIrType(sharedPropertyType.type.mainValue.type)
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
if (isStruct(type) && type.mainValue) {
|
|
929
|
+
return {
|
|
930
|
+
fieldApiNames: Array.isArray(type.mainValue.fields) ? type.mainValue.fields : [type.mainValue.fields],
|
|
931
|
+
structApiName: apiName,
|
|
932
|
+
type: propertyTypeTypeToOntologyIrType(type.mainValue.type)
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
return void 0;
|
|
936
|
+
}
|
|
937
|
+
|
|
858
938
|
// src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts
|
|
859
|
-
function propertyTypeTypeToOntologyIrType(type) {
|
|
939
|
+
function propertyTypeTypeToOntologyIrType(type, apiName, sharedPropertyType) {
|
|
860
940
|
switch (true) {
|
|
861
941
|
case (typeof type === "object" && type.type === "marking"):
|
|
862
942
|
return {
|
|
@@ -912,7 +992,8 @@ function propertyTypeTypeToOntologyIrType(type) {
|
|
|
912
992
|
return {
|
|
913
993
|
type: "struct",
|
|
914
994
|
struct: {
|
|
915
|
-
structFields
|
|
995
|
+
structFields,
|
|
996
|
+
mainValue: convertMainValue(type, apiName, sharedPropertyType)
|
|
916
997
|
}
|
|
917
998
|
};
|
|
918
999
|
case (typeof type === "object" && type.type === "string"):
|
|
@@ -986,6 +1067,7 @@ function propertyTypeTypeToOntologyIrType(type) {
|
|
|
986
1067
|
function convertSpt({
|
|
987
1068
|
type,
|
|
988
1069
|
array,
|
|
1070
|
+
reducers,
|
|
989
1071
|
description,
|
|
990
1072
|
apiName,
|
|
991
1073
|
displayName,
|
|
@@ -1011,10 +1093,10 @@ function convertSpt({
|
|
|
1011
1093
|
type: array ? {
|
|
1012
1094
|
type: "array",
|
|
1013
1095
|
array: {
|
|
1014
|
-
subtype: propertyTypeTypeToOntologyIrType(type),
|
|
1015
|
-
reducers:
|
|
1096
|
+
subtype: propertyTypeTypeToOntologyIrType(type, apiName),
|
|
1097
|
+
reducers: convertReducers(type, apiName, reducers)
|
|
1016
1098
|
}
|
|
1017
|
-
} : propertyTypeTypeToOntologyIrType(type),
|
|
1099
|
+
} : propertyTypeTypeToOntologyIrType(type, apiName),
|
|
1018
1100
|
aliases: aliases ?? [],
|
|
1019
1101
|
baseFormatter,
|
|
1020
1102
|
dataConstraints: dataConstraint,
|
|
@@ -1228,11 +1310,12 @@ function convertInterface(interfaceType) {
|
|
|
1228
1310
|
extendsInterfaces: interfaceType.extendsInterfaces.map((i) => i.apiName),
|
|
1229
1311
|
// these are omitted from our internal types but we need to re-add them for the final json
|
|
1230
1312
|
properties: [],
|
|
1231
|
-
propertiesV3: Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([apiName, prop]) => convertInterfaceProperty(prop, apiName)))
|
|
1313
|
+
propertiesV3: Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([apiName, prop]) => convertInterfaceProperty(prop, apiName))),
|
|
1314
|
+
extendsInterfacesMetadata: interfaceType.extendsInterfaces.map((i) => convertInterface(i))
|
|
1232
1315
|
};
|
|
1233
1316
|
}
|
|
1234
1317
|
function convertDatasourceDefinition(objectType, properties) {
|
|
1235
|
-
const baseDatasource = objectType.datasources?.find((ds) => ["dataset", "stream", "restrictedView"].includes(ds.type));
|
|
1318
|
+
const baseDatasource = objectType.datasources?.find((ds) => ["dataset", "stream", "restrictedView", "direct"].includes(ds.type));
|
|
1236
1319
|
switch (baseDatasource?.type) {
|
|
1237
1320
|
case "stream":
|
|
1238
1321
|
const window = baseDatasource.retentionPeriod;
|
|
@@ -1271,6 +1354,15 @@ function convertDatasourceDefinition(objectType, properties) {
|
|
|
1271
1354
|
propertyMapping: buildPropertyMapping(properties)
|
|
1272
1355
|
}
|
|
1273
1356
|
};
|
|
1357
|
+
case "direct":
|
|
1358
|
+
return {
|
|
1359
|
+
type: "direct",
|
|
1360
|
+
direct: {
|
|
1361
|
+
directSourceRid: objectType.apiName,
|
|
1362
|
+
propertyMapping: buildPropertyMapping(properties),
|
|
1363
|
+
propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName)
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1274
1366
|
case "dataset":
|
|
1275
1367
|
default:
|
|
1276
1368
|
if (objectType.properties?.some((prop) => typeof prop.type === "object" && prop.type.type === "marking") || baseDatasource?.objectSecurityPolicy || baseDatasource?.propertySecurityGroups) {
|
|
@@ -1311,6 +1403,7 @@ function convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName
|
|
|
1311
1403
|
},
|
|
1312
1404
|
additionalMandatory: {
|
|
1313
1405
|
markings: {},
|
|
1406
|
+
assumedMarkingsV2: {},
|
|
1314
1407
|
assumedMarkings: []
|
|
1315
1408
|
}
|
|
1316
1409
|
}
|
|
@@ -1327,9 +1420,9 @@ function convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName
|
|
|
1327
1420
|
const usedProperties = /* @__PURE__ */ new Set();
|
|
1328
1421
|
ds.propertySecurityGroups?.forEach((psg) => {
|
|
1329
1422
|
psg.properties.forEach((propertyName) => {
|
|
1330
|
-
!validPropertyNames.has(propertyName) ? process.env.NODE_ENV !== "production" ?
|
|
1331
|
-
!!usedProperties.has(propertyName) ? process.env.NODE_ENV !== "production" ?
|
|
1332
|
-
!(propertyName !== primaryKeyPropertyApiName) ? process.env.NODE_ENV !== "production" ?
|
|
1423
|
+
!validPropertyNames.has(propertyName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property "${propertyName}" in property security group ${psg.name} does not exist in the properties list`) : invariant9__default.default(false) : void 0;
|
|
1424
|
+
!!usedProperties.has(propertyName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property "${propertyName}" is used in multiple property security groups`) : invariant9__default.default(false) : void 0;
|
|
1425
|
+
!(propertyName !== primaryKeyPropertyApiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property "${propertyName}" in property security group ${psg.name} cannot be the primary key`) : invariant9__default.default(false) : void 0;
|
|
1333
1426
|
usedProperties.add(propertyName);
|
|
1334
1427
|
});
|
|
1335
1428
|
});
|
|
@@ -1337,7 +1430,7 @@ function convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName
|
|
|
1337
1430
|
rid: ds.objectSecurityPolicy?.name || "defaultObjectSecurityPolicy",
|
|
1338
1431
|
security: {
|
|
1339
1432
|
type: "granular",
|
|
1340
|
-
granular: convertGranularPolicy(ds.objectSecurityPolicy?.granularPolicy, ds.objectSecurityPolicy?.
|
|
1433
|
+
granular: convertGranularPolicy(ds.objectSecurityPolicy?.granularPolicy, ds.objectSecurityPolicy?.appliedMarkings, ds.objectSecurityPolicy?.assumedMarkings)
|
|
1341
1434
|
},
|
|
1342
1435
|
type: {
|
|
1343
1436
|
type: "primaryKey",
|
|
@@ -1350,7 +1443,7 @@ function convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName
|
|
|
1350
1443
|
rid: psg.name,
|
|
1351
1444
|
security: {
|
|
1352
1445
|
type: "granular",
|
|
1353
|
-
granular: convertGranularPolicy(psg.granularPolicy, psg.
|
|
1446
|
+
granular: convertGranularPolicy(psg.granularPolicy, psg.appliedMarkings, psg.assumedMarkings)
|
|
1354
1447
|
},
|
|
1355
1448
|
type: {
|
|
1356
1449
|
type: "property",
|
|
@@ -1362,7 +1455,7 @@ function convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName
|
|
|
1362
1455
|
})) ?? []]
|
|
1363
1456
|
};
|
|
1364
1457
|
}
|
|
1365
|
-
function convertGranularPolicy(granularPolicy,
|
|
1458
|
+
function convertGranularPolicy(granularPolicy, appliedMarkings, assumedMarkings) {
|
|
1366
1459
|
return {
|
|
1367
1460
|
viewPolicy: {
|
|
1368
1461
|
granularPolicyCondition: granularPolicy ? convertSecurityCondition(granularPolicy) : {
|
|
@@ -1372,8 +1465,9 @@ function convertGranularPolicy(granularPolicy, additionalMandatoryMarkings) {
|
|
|
1372
1465
|
}
|
|
1373
1466
|
},
|
|
1374
1467
|
additionalMandatory: {
|
|
1375
|
-
markings:
|
|
1376
|
-
assumedMarkings: []
|
|
1468
|
+
markings: appliedMarkings ?? {},
|
|
1469
|
+
assumedMarkings: [],
|
|
1470
|
+
assumedMarkingsV2: assumedMarkings ?? {}
|
|
1377
1471
|
}
|
|
1378
1472
|
}
|
|
1379
1473
|
};
|
|
@@ -1606,7 +1700,7 @@ function convertValueTypeDataConstraints(dataConstraints) {
|
|
|
1606
1700
|
// src/conversion/toMarketplace/convertObjectPropertyType.ts
|
|
1607
1701
|
function convertObjectPropertyType(property) {
|
|
1608
1702
|
const apiName = namespace + property.apiName;
|
|
1609
|
-
!(!shouldNotHaveRenderHints(property.type) || !hasRenderHints(property.typeClasses)) ? process.env.NODE_ENV !== "production" ?
|
|
1703
|
+
!(!shouldNotHaveRenderHints(property.type) || !hasRenderHints(property.typeClasses)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property type ${apiName} of type '${getPropertyTypeName(property.type)}' should not have render hints`) : invariant9__default.default(false) : void 0;
|
|
1610
1704
|
const output = {
|
|
1611
1705
|
apiName: property.apiName,
|
|
1612
1706
|
sharedPropertyTypeApiName: property.sharedPropertyType?.apiName,
|
|
@@ -1621,10 +1715,10 @@ function convertObjectPropertyType(property) {
|
|
|
1621
1715
|
type: property.array ? {
|
|
1622
1716
|
type: "array",
|
|
1623
1717
|
array: {
|
|
1624
|
-
subtype: propertyTypeTypeToOntologyIrType(property.type),
|
|
1625
|
-
reducers: []
|
|
1718
|
+
subtype: propertyTypeTypeToOntologyIrType(property.type, property.apiName, property.sharedPropertyType),
|
|
1719
|
+
reducers: convertReducers(property.type, property.apiName, property.reducers ?? [], property.sharedPropertyType)
|
|
1626
1720
|
}
|
|
1627
|
-
} : propertyTypeTypeToOntologyIrType(property.type),
|
|
1721
|
+
} : propertyTypeTypeToOntologyIrType(property.type, property.apiName),
|
|
1628
1722
|
typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),
|
|
1629
1723
|
status: convertObjectStatus(property.status),
|
|
1630
1724
|
inlineAction: void 0,
|
|
@@ -1971,7 +2065,7 @@ function generateInterfaceSnippet(interfaceType, packageName) {
|
|
|
1971
2065
|
"interfaceApiName": interfaceType.apiName,
|
|
1972
2066
|
"packageName": packageName,
|
|
1973
2067
|
"objectOrInterfaceApiName": interfaceType.apiName,
|
|
1974
|
-
"propertyNames": Object.keys(interfaceType.
|
|
2068
|
+
"propertyNames": Object.keys(interfaceType.propertiesV3),
|
|
1975
2069
|
"interfaceName": interfaceType.displayMetadata.displayName
|
|
1976
2070
|
};
|
|
1977
2071
|
return getSnippets(interfaceSnippets, interfaceContext);
|
|
@@ -2488,6 +2582,9 @@ function renderHintFromBaseType(parameter, validation) {
|
|
|
2488
2582
|
throw new Error(`Unknown type ${type}`);
|
|
2489
2583
|
}
|
|
2490
2584
|
}
|
|
2585
|
+
function extractNamespace(apiName) {
|
|
2586
|
+
return apiName.substring(0, apiName.lastIndexOf(".") + 1);
|
|
2587
|
+
}
|
|
2491
2588
|
function withoutNamespace(apiName) {
|
|
2492
2589
|
const lastDot = apiName.lastIndexOf(".");
|
|
2493
2590
|
if (lastDot === -1) {
|
|
@@ -2526,12 +2623,41 @@ addDependency("${namespaceNoDot}", new URL(import.meta.url).pathname);
|
|
|
2526
2623
|
function addNamespaceIfNone(apiName) {
|
|
2527
2624
|
return apiName.includes(".") ? apiName : namespace + apiName;
|
|
2528
2625
|
}
|
|
2626
|
+
function initializeOntologyState(ns) {
|
|
2627
|
+
namespace = ns;
|
|
2628
|
+
dependencies = {};
|
|
2629
|
+
ontologyDefinition = {
|
|
2630
|
+
OBJECT_TYPE: {},
|
|
2631
|
+
ACTION_TYPE: {},
|
|
2632
|
+
LINK_TYPE: {},
|
|
2633
|
+
INTERFACE_TYPE: {},
|
|
2634
|
+
SHARED_PROPERTY_TYPE: {},
|
|
2635
|
+
VALUE_TYPE: {}
|
|
2636
|
+
};
|
|
2637
|
+
importedTypes = {
|
|
2638
|
+
SHARED_PROPERTY_TYPE: {},
|
|
2639
|
+
OBJECT_TYPE: {},
|
|
2640
|
+
ACTION_TYPE: {},
|
|
2641
|
+
LINK_TYPE: {},
|
|
2642
|
+
INTERFACE_TYPE: {},
|
|
2643
|
+
VALUE_TYPE: {}
|
|
2644
|
+
};
|
|
2645
|
+
}
|
|
2646
|
+
function getOntologyDefinition() {
|
|
2647
|
+
return ontologyDefinition;
|
|
2648
|
+
}
|
|
2649
|
+
function getImportedTypes() {
|
|
2650
|
+
return importedTypes;
|
|
2651
|
+
}
|
|
2652
|
+
function getNamespace() {
|
|
2653
|
+
return namespace;
|
|
2654
|
+
}
|
|
2529
2655
|
|
|
2530
2656
|
// src/cli/main.ts
|
|
2531
2657
|
var apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
|
|
2532
2658
|
var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
2533
2659
|
async function main(args = process.argv) {
|
|
2534
|
-
const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.
|
|
2660
|
+
const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.16.0-beta.10").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
|
|
2535
2661
|
input: {
|
|
2536
2662
|
alias: "i",
|
|
2537
2663
|
describe: "Input file",
|
|
@@ -2600,15 +2726,15 @@ async function main(args = process.argv) {
|
|
|
2600
2726
|
let apiNamespace = "";
|
|
2601
2727
|
if (commandLineOpts.apiNamespace.length !== 0) {
|
|
2602
2728
|
apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== "." ? commandLineOpts.apiNamespace + "." : commandLineOpts.apiNamespace;
|
|
2603
|
-
!(apiNamespace.length < 1024) ? process.env.NODE_ENV !== "production" ?
|
|
2604
|
-
!apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== "production" ?
|
|
2729
|
+
!(apiNamespace.length < 1024) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "API namespace is too long.") : invariant9__default.default(false) : void 0;
|
|
2730
|
+
!apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(.[a-z0-9-]+)*.$") : invariant9__default.default(false) : void 0;
|
|
2605
2731
|
}
|
|
2606
2732
|
consola.consola.info(`Loading ontology from ${commandLineOpts.input}`);
|
|
2607
2733
|
if (!commandLineOpts.generateCodeSnippets && (commandLineOpts.codeSnippetPackageName !== "" || commandLineOpts.codeSnippetDir !== path3__namespace.resolve("./"))) {
|
|
2608
2734
|
consola.consola.info("Package name and/or directory supplied for code snippets, but code snippet generation is false.");
|
|
2609
2735
|
}
|
|
2610
2736
|
if (commandLineOpts.randomnessKey !== void 0) {
|
|
2611
|
-
!uuidRegex.test(commandLineOpts.randomnessKey) ? process.env.NODE_ENV !== "production" ?
|
|
2737
|
+
!uuidRegex.test(commandLineOpts.randomnessKey) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "Supplied randomness key is not a uuid and shouldn't be used as a uniqueness guarantee") : invariant9__default.default(false) : void 0;
|
|
2612
2738
|
}
|
|
2613
2739
|
const ontologyIr = await loadOntology(commandLineOpts.input, apiNamespace, commandLineOpts.outputDir, commandLineOpts.dependencies, commandLineOpts.generateCodeSnippets, commandLineOpts.codeSnippetPackageName, commandLineOpts.codeSnippetDir, commandLineOpts.randomnessKey);
|
|
2614
2740
|
consola.consola.info(`Saving ontology to ${commandLineOpts.output}`);
|
|
@@ -2653,43 +2779,44 @@ var CREATE_OR_MODIFY_OBJECT_PARAMETER = "objectToCreateOrModifyParameter";
|
|
|
2653
2779
|
var DELETE_OBJECT_PARAMETER = "objectToDeleteParameter";
|
|
2654
2780
|
var CREATE_INTERFACE_OBJECT_PARAMETER = "objectTypeParameter";
|
|
2655
2781
|
var MODIFY_INTERFACE_OBJECT_PARAMETER = "interfaceObjectToModifyParameter";
|
|
2656
|
-
function defineAction(
|
|
2782
|
+
function defineAction(actionDefInput) {
|
|
2783
|
+
const actionDef = cloneDefinition(actionDefInput);
|
|
2657
2784
|
const apiName = namespace + actionDef.apiName;
|
|
2658
2785
|
const parameterIds = (actionDef.parameters ?? []).map((p) => p.id);
|
|
2659
2786
|
if (ontologyDefinition[OntologyEntityTypeEnum.ACTION_TYPE][apiName] !== void 0) {
|
|
2660
2787
|
throw new Error(`Action type with apiName ${actionDef.apiName} is already defined`);
|
|
2661
2788
|
}
|
|
2662
|
-
!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(actionDef.apiName) ? process.env.NODE_ENV !== "production" ?
|
|
2789
|
+
!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(actionDef.apiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Action type apiName "${actionDef.apiName}" must be alphanumeric, lowercase, and kebab-case`) : invariant9__default.default(false) : void 0;
|
|
2663
2790
|
const parameterIdsSet = new Set(parameterIds);
|
|
2664
|
-
!(parameterIdsSet.size === parameterIds.length) ? process.env.NODE_ENV !== "production" ?
|
|
2791
|
+
!(parameterIdsSet.size === parameterIds.length) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Parameter ids must be unique`) : invariant9__default.default(false) : void 0;
|
|
2665
2792
|
const parameterIdsNotFound = Array.from(referencedParameterIds(actionDef)).filter((p) => !parameterIdsSet.has(p));
|
|
2666
|
-
!(parameterIdsNotFound.length === 0) ? process.env.NODE_ENV !== "production" ?
|
|
2793
|
+
!(parameterIdsNotFound.length === 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Parameters ${JSON.stringify(parameterIdsNotFound)} were referenced but not defined`) : invariant9__default.default(false) : void 0;
|
|
2667
2794
|
const definedSectionIds = new Set(Object.keys(actionDef.sections ?? []));
|
|
2668
2795
|
const undefinedSectionsInOrdering = (actionDef.formContentOrdering ?? []).flatMap((s) => s.type === "parameterId" ? [] : [s.sectionId]).filter((sId) => !definedSectionIds.has(sId));
|
|
2669
|
-
!(undefinedSectionsInOrdering.length === 0) ? process.env.NODE_ENV !== "production" ?
|
|
2670
|
-
!(actionDef.rules.length > 0) ? process.env.NODE_ENV !== "production" ?
|
|
2796
|
+
!(undefinedSectionsInOrdering.length === 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Sections [${undefinedSectionsInOrdering}] were referenced in content ordering but not defined`) : invariant9__default.default(false) : void 0;
|
|
2797
|
+
!(actionDef.rules.length > 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Action type ${actionDef.apiName} must have at least one logic rule`) : invariant9__default.default(false) : void 0;
|
|
2671
2798
|
actionDef.rules.forEach((rule) => {
|
|
2672
2799
|
if (rule.type === "modifyObjectRule") {
|
|
2673
|
-
!parameterIds.some((id) => id === rule.modifyObjectRule.objectToModify) ? process.env.NODE_ENV !== "production" ?
|
|
2800
|
+
!parameterIds.some((id) => id === rule.modifyObjectRule.objectToModify) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Object to modify parameter must be defined in parameters`) : invariant9__default.default(false) : void 0;
|
|
2674
2801
|
}
|
|
2675
2802
|
if (rule.type === "deleteObjectRule") {
|
|
2676
|
-
!parameterIds.some((id) => id === rule.deleteObjectRule.objectToDelete) ? process.env.NODE_ENV !== "production" ?
|
|
2803
|
+
!parameterIds.some((id) => id === rule.deleteObjectRule.objectToDelete) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Object to delete parameter must be defined in parameters`) : invariant9__default.default(false) : void 0;
|
|
2677
2804
|
}
|
|
2678
2805
|
if (rule.type === "modifyInterfaceRule") {
|
|
2679
2806
|
const interfaceParam = actionDef.parameters.find((p) => p.id === rule.modifyInterfaceRule.interfaceObjectToModifyParameter);
|
|
2680
|
-
!(interfaceParam !== void 0 && typeof interfaceParam.type === "object" && (interfaceParam.type.type === "interfaceReference" || interfaceParam.type.type === "interfaceReferenceList")) ? process.env.NODE_ENV !== "production" ?
|
|
2807
|
+
!(interfaceParam !== void 0 && typeof interfaceParam.type === "object" && (interfaceParam.type.type === "interfaceReference" || interfaceParam.type.type === "interfaceReferenceList")) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Interface object to modify parameter must be an interface reference`) : invariant9__default.default(false) : void 0;
|
|
2681
2808
|
const interfaceReference = interfaceParam.type.type === "interfaceReference" ? interfaceParam.type.interfaceReference.interfaceTypeRid : interfaceParam.type.interfaceReferenceList.interfaceTypeRid;
|
|
2682
|
-
!(ontologyDefinition.INTERFACE_TYPE[interfaceReference] !== void 0 || importedTypes.INTERFACE_TYPE[interfaceReference] !== void 0) ? process.env.NODE_ENV !== "production" ?
|
|
2809
|
+
!(ontologyDefinition.INTERFACE_TYPE[interfaceReference] !== void 0 || importedTypes.INTERFACE_TYPE[interfaceReference] !== void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Interface type ${interfaceReference} does not exist`) : invariant9__default.default(false) : void 0;
|
|
2683
2810
|
const interfaceType = ontologyDefinition.INTERFACE_TYPE[interfaceReference];
|
|
2684
2811
|
Object.keys(rule.modifyInterfaceRule.sharedPropertyValues).forEach((spt) => {
|
|
2685
|
-
!Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== "production" ?
|
|
2812
|
+
!Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Shared property type ${spt} does not exist in interface type ${interfaceReference}`) : invariant9__default.default(false) : void 0;
|
|
2686
2813
|
});
|
|
2687
2814
|
}
|
|
2688
2815
|
if (rule.type === "addInterfaceRule") {
|
|
2689
2816
|
const interfaceType = ontologyDefinition.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName] ?? importedTypes.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName];
|
|
2690
|
-
!(interfaceType !== void 0) ? process.env.NODE_ENV !== "production" ?
|
|
2817
|
+
!(interfaceType !== void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Interface type ${rule.addInterfaceRule.interfaceApiName} does not exist`) : invariant9__default.default(false) : void 0;
|
|
2691
2818
|
Object.keys(rule.addInterfaceRule.sharedPropertyValues).forEach((spt) => {
|
|
2692
|
-
!Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== "production" ?
|
|
2819
|
+
!Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Shared property type ${spt} does not exist in interface type ${interfaceType.apiName}`) : invariant9__default.default(false) : void 0;
|
|
2693
2820
|
});
|
|
2694
2821
|
}
|
|
2695
2822
|
});
|
|
@@ -3160,6 +3287,10 @@ function extractAllowedValuesFromPropertyType(type) {
|
|
|
3160
3287
|
};
|
|
3161
3288
|
default:
|
|
3162
3289
|
switch (type.type) {
|
|
3290
|
+
case "decimal":
|
|
3291
|
+
return {
|
|
3292
|
+
type: "range"
|
|
3293
|
+
};
|
|
3163
3294
|
case "marking":
|
|
3164
3295
|
return type.markingType === "CBAC" ? {
|
|
3165
3296
|
type: "cbacMarking"
|
|
@@ -3181,6 +3312,8 @@ function extractActionParameterType(pt) {
|
|
|
3181
3312
|
const typeType = pt.type;
|
|
3182
3313
|
if (typeof typeType === "object") {
|
|
3183
3314
|
switch (typeType.type) {
|
|
3315
|
+
case "decimal":
|
|
3316
|
+
return maybeAddList("decimal", pt);
|
|
3184
3317
|
case "marking":
|
|
3185
3318
|
return maybeAddList("marking", pt);
|
|
3186
3319
|
case "string":
|
|
@@ -3247,9 +3380,9 @@ function validateParameterCondition(condition, currentParameterId, seenParameter
|
|
|
3247
3380
|
switch (condition.type) {
|
|
3248
3381
|
case "parameter":
|
|
3249
3382
|
const overrideParamId = condition.parameterId;
|
|
3250
|
-
!parameters?.some((p) => p.id === overrideParamId) ? process.env.NODE_ENV !== "production" ?
|
|
3251
|
-
!(overrideParamId !== currentParameterId) ? process.env.NODE_ENV !== "production" ?
|
|
3252
|
-
!seenParameterIds.has(overrideParamId) ? process.env.NODE_ENV !== "production" ?
|
|
3383
|
+
!parameters?.some((p) => p.id === overrideParamId) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Parameter condition on ${currentParameterId} is referencing unknown parameter ${overrideParamId}`) : invariant9__default.default(false) : void 0;
|
|
3384
|
+
!(overrideParamId !== currentParameterId) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Parameter condition on ${currentParameterId} is referencing itself`) : invariant9__default.default(false) : void 0;
|
|
3385
|
+
!seenParameterIds.has(overrideParamId) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Parameter condition on ${currentParameterId} is referencing later parameter ${overrideParamId}`) : invariant9__default.default(false) : void 0;
|
|
3253
3386
|
break;
|
|
3254
3387
|
case "and":
|
|
3255
3388
|
if ("conditions" in condition) {
|
|
@@ -3277,11 +3410,11 @@ function validateParameterPrefill(currentParameterId, seenParameterIds, paramete
|
|
|
3277
3410
|
if (!defaultValue) return;
|
|
3278
3411
|
switch (defaultValue.type) {
|
|
3279
3412
|
case "objectParameterPropertyValue":
|
|
3280
|
-
!parameters?.some((p) => p.id === defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== "production" ?
|
|
3281
|
-
!seenParameterIds.has(defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== "production" ?
|
|
3413
|
+
!parameters?.some((p) => p.id === defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Default value for parameter ${currentParameterId} is referencing unknown parameter ${defaultValue.objectParameterPropertyValue.parameterId}`) : invariant9__default.default(false) : void 0;
|
|
3414
|
+
!seenParameterIds.has(defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Default value for parameter ${currentParameterId} is referencing later parameter ${defaultValue.objectParameterPropertyValue.parameterId}`) : invariant9__default.default(false) : void 0;
|
|
3282
3415
|
break;
|
|
3283
3416
|
case "staticValue":
|
|
3284
|
-
!(defaultValue.staticValue.type === parameters?.find((p) => p.id === currentParameterId)?.type) ? process.env.NODE_ENV !== "production" ?
|
|
3417
|
+
!(defaultValue.staticValue.type === parameters?.find((p) => p.id === currentParameterId)?.type) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Default static value for parameter ${currentParameterId} does not match type`) : invariant9__default.default(false) : void 0;
|
|
3285
3418
|
break;
|
|
3286
3419
|
case "staticObject":
|
|
3287
3420
|
case "interfaceParameterPropertyValue":
|
|
@@ -3296,10 +3429,10 @@ function validateParameterPrefill(currentParameterId, seenParameterIds, paramete
|
|
|
3296
3429
|
}
|
|
3297
3430
|
function validateActionParameters(def, properties, name) {
|
|
3298
3431
|
[...Object.keys(def.parameterConfiguration ?? {})].forEach((id) => {
|
|
3299
|
-
!(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || def.parameterConfiguration?.[id].customParameterType !== void 0 || isTargetParameter(id)) ? process.env.NODE_ENV !== "production" ?
|
|
3432
|
+
!(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || def.parameterConfiguration?.[id].customParameterType !== void 0 || isTargetParameter(id)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Parameter ${id} does not exist as a property on ${name} and its type is not explicitly defined`) : invariant9__default.default(false) : void 0;
|
|
3300
3433
|
});
|
|
3301
3434
|
[...Object.keys(def.nonParameterMappings ?? {}), ...def.excludedProperties ?? []].forEach((id) => {
|
|
3302
|
-
!(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || properties.includes(withoutNamespace(id))) ? process.env.NODE_ENV !== "production" ?
|
|
3435
|
+
!(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || properties.includes(withoutNamespace(id))) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Property ${id} does not exist as a property on ${name}`) : invariant9__default.default(false) : void 0;
|
|
3303
3436
|
});
|
|
3304
3437
|
}
|
|
3305
3438
|
function createDefaultParameterOrdering(def, properties, parameters, priorityId) {
|
|
@@ -3309,7 +3442,7 @@ function validateParameterOrdering(parameterOrdering, parameterSet, actionApiNam
|
|
|
3309
3442
|
const orderingSet = new Set(parameterOrdering);
|
|
3310
3443
|
const missingParameters = [...parameterSet].filter((param) => !orderingSet.has(param));
|
|
3311
3444
|
const extraneousParameters = parameterOrdering.filter((param) => !parameterSet.has(param));
|
|
3312
|
-
!(extraneousParameters.length === 0 && missingParameters.length === 0) ? process.env.NODE_ENV !== "production" ?
|
|
3445
|
+
!(extraneousParameters.length === 0 && missingParameters.length === 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Action parameter ordering for ${actionApiName} does not match expected parameters. Extraneous parameters in ordering: {${extraneousParameters}}, Missing parameters in ordering: {${missingParameters}}`) : invariant9__default.default(false) : void 0;
|
|
3313
3446
|
}
|
|
3314
3447
|
function isTargetParameter(parameterId) {
|
|
3315
3448
|
return parameterId === MODIFY_OBJECT_PARAMETER || parameterId === CREATE_OR_MODIFY_OBJECT_PARAMETER || parameterId === CREATE_INTERFACE_OBJECT_PARAMETER || parameterId === MODIFY_INTERFACE_OBJECT_PARAMETER;
|
|
@@ -3383,7 +3516,8 @@ function convertMappingValue(value) {
|
|
|
3383
3516
|
}
|
|
3384
3517
|
|
|
3385
3518
|
// src/api/defineCreateInterfaceObjectAction.ts
|
|
3386
|
-
function defineCreateInterfaceObjectAction(
|
|
3519
|
+
function defineCreateInterfaceObjectAction(defInput) {
|
|
3520
|
+
const def = cloneDefinition(defInput);
|
|
3387
3521
|
const allProperties = getFlattenedInterfaceProperties(def.interfaceType);
|
|
3388
3522
|
validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);
|
|
3389
3523
|
const actionInterfaceProperties = Object.entries(allProperties).filter(([apiName, type]) => isPropertyParameter(def, apiName, getInterfacePropertyTypeType(type)));
|
|
@@ -3473,7 +3607,8 @@ function defineCreateInterfaceObjectAction(def) {
|
|
|
3473
3607
|
}
|
|
3474
3608
|
|
|
3475
3609
|
// src/api/defineCreateObjectAction.ts
|
|
3476
|
-
function defineCreateObjectAction(
|
|
3610
|
+
function defineCreateObjectAction(defInput) {
|
|
3611
|
+
const def = cloneDefinition(defInput);
|
|
3477
3612
|
validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);
|
|
3478
3613
|
const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter((ds) => ds.type === "derived").flatMap((ds) => Object.keys(ds.propertyMapping));
|
|
3479
3614
|
const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter((id) => isPropertyParameter(def, id, def.objectType.properties?.[id].type) && !isStruct(def.objectType.properties?.[id].type) && !propertiesWithDerivedDatasources.includes(id));
|
|
@@ -3538,7 +3673,8 @@ function defineCreateObjectAction(def) {
|
|
|
3538
3673
|
}
|
|
3539
3674
|
|
|
3540
3675
|
// src/api/defineCreateOrModifyObjectAction.ts
|
|
3541
|
-
function defineCreateOrModifyObjectAction(
|
|
3676
|
+
function defineCreateOrModifyObjectAction(defInput) {
|
|
3677
|
+
const def = cloneDefinition(defInput);
|
|
3542
3678
|
validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);
|
|
3543
3679
|
const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter((ds) => ds.type === "derived").flatMap((ds) => Object.keys(ds.propertyMapping));
|
|
3544
3680
|
const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter((id) => !Object.keys(def.nonParameterMappings ?? {}).includes(id) && !def.excludedProperties?.includes(id) && !isStruct(def.objectType.properties?.[id].type) && id !== def.objectType.primaryKeyPropertyApiName && !propertiesWithDerivedDatasources.includes(id));
|
|
@@ -3618,7 +3754,8 @@ function defineCreateOrModifyObjectAction(def) {
|
|
|
3618
3754
|
}
|
|
3619
3755
|
|
|
3620
3756
|
// src/api/defineDeleteInterfaceObjectAction.ts
|
|
3621
|
-
function defineDeleteInterfaceObjectAction(
|
|
3757
|
+
function defineDeleteInterfaceObjectAction(defInput) {
|
|
3758
|
+
const def = cloneDefinition(defInput);
|
|
3622
3759
|
return defineAction({
|
|
3623
3760
|
apiName: def.apiName ?? `delete-interface-object-${kebab(def.interfaceType.apiName.split(".").pop() ?? def.interfaceType.apiName)}`,
|
|
3624
3761
|
displayName: def.displayName ?? `Delete ${def.interfaceType.displayMetadata.displayName}`,
|
|
@@ -3658,7 +3795,8 @@ function defineDeleteInterfaceObjectAction(def) {
|
|
|
3658
3795
|
}
|
|
3659
3796
|
|
|
3660
3797
|
// src/api/defineDeleteObjectAction.ts
|
|
3661
|
-
function defineDeleteObjectAction(
|
|
3798
|
+
function defineDeleteObjectAction(defInput) {
|
|
3799
|
+
const def = cloneDefinition(defInput);
|
|
3662
3800
|
return defineAction({
|
|
3663
3801
|
apiName: def.apiName ?? `delete-object-${kebab(def.objectType.apiName.split(".").pop() ?? def.objectType.apiName)}`,
|
|
3664
3802
|
displayName: def.displayName ?? `Delete ${def.objectType.displayName}`,
|
|
@@ -3723,9 +3861,10 @@ function combineApiNamespaceIfMissing(namespace2, apiName) {
|
|
|
3723
3861
|
}
|
|
3724
3862
|
|
|
3725
3863
|
// src/api/defineInterface.ts
|
|
3726
|
-
function defineInterface(
|
|
3864
|
+
function defineInterface(interfaceDefInput) {
|
|
3865
|
+
const interfaceDef = cloneDefinition(interfaceDefInput);
|
|
3727
3866
|
const apiName = namespace + interfaceDef.apiName;
|
|
3728
|
-
!(ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][apiName] === void 0) ? process.env.NODE_ENV !== "production" ?
|
|
3867
|
+
!(ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][apiName] === void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Interface ${apiName} already exists`) : invariant9__default.default(false) : void 0;
|
|
3729
3868
|
const spts = Object.fromEntries(Object.entries(interfaceDef.properties ?? {}).filter(([_name, prop]) => {
|
|
3730
3869
|
return isInterfaceSharedPropertyType(prop) || "apiName" in prop;
|
|
3731
3870
|
}).map(([s, spt]) => {
|
|
@@ -3758,7 +3897,7 @@ function defineInterface(interfaceDef) {
|
|
|
3758
3897
|
const status = mapSimplifiedStatusToInterfaceTypeStatus(interfaceDef.status ?? {
|
|
3759
3898
|
type: "active"
|
|
3760
3899
|
});
|
|
3761
|
-
!(status.type !== "deprecated" || status.deprecated.message && status.deprecated.deadline) ? process.env.NODE_ENV !== "production" ?
|
|
3900
|
+
!(status.type !== "deprecated" || status.deprecated.message && status.deprecated.deadline) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Deprecated status must include message and deadline properties.`) : invariant9__default.default(false) : void 0;
|
|
3762
3901
|
const fullInterface = {
|
|
3763
3902
|
apiName,
|
|
3764
3903
|
displayMetadata: {
|
|
@@ -3785,16 +3924,18 @@ function defineInterface(interfaceDef) {
|
|
|
3785
3924
|
}
|
|
3786
3925
|
function verifyBasePropertyDefinition(namespace2, apiName, type) {
|
|
3787
3926
|
const unNamespacedTypeApiName = withoutNamespace(type.apiName);
|
|
3788
|
-
!(isPropertyTypeType(type.type) || isExotic(type.type)) ? process.env.NODE_ENV !== "production" ?
|
|
3789
|
-
!(namespace2 + apiName === type.apiName || apiName === unNamespacedTypeApiName) ? process.env.NODE_ENV !== "production" ?
|
|
3927
|
+
!(isPropertyTypeType(type.type) || isExotic(type.type)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Invalid data type ${JSON.stringify(type)} for property ${apiName} on InterfaceType ${apiName}`) : invariant9__default.default(false) : void 0;
|
|
3928
|
+
!(namespace2 + apiName === type.apiName || apiName === unNamespacedTypeApiName) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `property key and it's apiName must be identical. ${JSON.stringify({
|
|
3790
3929
|
key: apiName,
|
|
3791
3930
|
apiName: type.apiName
|
|
3792
|
-
})}`) :
|
|
3931
|
+
})}`) : invariant9__default.default(false) : void 0;
|
|
3793
3932
|
return type;
|
|
3794
3933
|
}
|
|
3795
|
-
function defineInterfaceLinkConstraint(
|
|
3934
|
+
function defineInterfaceLinkConstraint(linkDefInput) {
|
|
3935
|
+
const linkDef = cloneDefinition(linkDefInput);
|
|
3936
|
+
!(importedTypes[OntologyEntityTypeEnum.INTERFACE_TYPE][linkDef.from.apiName] == null) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Cannot define a link constraint from imported interface ${linkDef.from.apiName}. The "from" side must be a locally defined interface.`) : invariant9__default.default(false) : void 0;
|
|
3796
3937
|
const fromLinkMeta = getLinkMeta(linkDef);
|
|
3797
|
-
!(linkDef.from.links.find((a) => a.metadata.apiName === fromLinkMeta.apiName) == null) ? process.env.NODE_ENV !== "production" ?
|
|
3938
|
+
!(linkDef.from.links.find((a) => a.metadata.apiName === fromLinkMeta.apiName) == null) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`) : invariant9__default.default(false) : void 0;
|
|
3798
3939
|
linkDef.from.links.push({
|
|
3799
3940
|
cardinality: linkDef.toMany ? "MANY" : "SINGLE",
|
|
3800
3941
|
linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),
|
|
@@ -3824,7 +3965,8 @@ function getLinkMeta(meta) {
|
|
|
3824
3965
|
}
|
|
3825
3966
|
|
|
3826
3967
|
// src/api/defineLink.ts
|
|
3827
|
-
function defineLink(
|
|
3968
|
+
function defineLink(linkDefinitionInput) {
|
|
3969
|
+
const linkDefinition = cloneDefinition(linkDefinitionInput);
|
|
3828
3970
|
let fullLinkDefinition;
|
|
3829
3971
|
if ("one" in linkDefinition) {
|
|
3830
3972
|
fullLinkDefinition = {
|
|
@@ -3886,7 +4028,8 @@ function convertLinkTypeMetadata(metadata) {
|
|
|
3886
4028
|
}
|
|
3887
4029
|
|
|
3888
4030
|
// src/api/defineModifyInterfaceObjectAction.ts
|
|
3889
|
-
function defineModifyInterfaceObjectAction(
|
|
4031
|
+
function defineModifyInterfaceObjectAction(defInput) {
|
|
4032
|
+
const def = cloneDefinition(defInput);
|
|
3890
4033
|
const allProperties = getFlattenedInterfaceProperties(def.interfaceType);
|
|
3891
4034
|
validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);
|
|
3892
4035
|
const actionInterfaceProperties = Object.entries(allProperties).filter(([apiName, type]) => {
|
|
@@ -3978,7 +4121,8 @@ function defineModifyInterfaceObjectAction(def) {
|
|
|
3978
4121
|
}
|
|
3979
4122
|
|
|
3980
4123
|
// src/api/defineModifyObjectAction.ts
|
|
3981
|
-
function defineModifyObjectAction(
|
|
4124
|
+
function defineModifyObjectAction(defInput) {
|
|
4125
|
+
const def = cloneDefinition(defInput);
|
|
3982
4126
|
validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);
|
|
3983
4127
|
const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter((id) => isPropertyParameter(def, id, def.objectType.properties?.[id].type) && id !== def.objectType.primaryKeyPropertyApiName);
|
|
3984
4128
|
const parameterNames = new Set(propertyParameters);
|
|
@@ -4055,10 +4199,11 @@ function defineModifyObjectAction(def) {
|
|
|
4055
4199
|
}
|
|
4056
4200
|
});
|
|
4057
4201
|
}
|
|
4058
|
-
function defineSharedPropertyType(
|
|
4202
|
+
function defineSharedPropertyType(sptDefInput) {
|
|
4203
|
+
const sptDef = cloneDefinition(sptDefInput);
|
|
4059
4204
|
const apiName = namespace + sptDef.apiName;
|
|
4060
|
-
!(ontologyDefinition[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][apiName] === void 0) ? process.env.NODE_ENV !== "production" ?
|
|
4061
|
-
!(!shouldNotHaveRenderHints(sptDef.type) || !hasRenderHints(sptDef.typeClasses)) ? process.env.NODE_ENV !== "production" ?
|
|
4205
|
+
!(ontologyDefinition[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][apiName] === void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Shared property type ${apiName} already exists`) : invariant9__default.default(false) : void 0;
|
|
4206
|
+
!(!shouldNotHaveRenderHints(sptDef.type) || !hasRenderHints(sptDef.typeClasses)) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Shared property type ${apiName} of type '${getPropertyTypeName(sptDef.type)}' should not have render hints`) : invariant9__default.default(false) : void 0;
|
|
4062
4207
|
const fullSpt = {
|
|
4063
4208
|
...sptDef,
|
|
4064
4209
|
apiName,
|
|
@@ -4114,7 +4259,8 @@ function convertValueTypeTypeToBaseType(valueType) {
|
|
|
4114
4259
|
throw new Error("Invalid ValueTypeType");
|
|
4115
4260
|
}
|
|
4116
4261
|
}
|
|
4117
|
-
function defineValueType(
|
|
4262
|
+
function defineValueType(valueTypeDefInput) {
|
|
4263
|
+
const valueTypeDef = cloneDefinition(valueTypeDefInput);
|
|
4118
4264
|
const {
|
|
4119
4265
|
apiName: inputApiName,
|
|
4120
4266
|
displayName,
|
|
@@ -4125,10 +4271,10 @@ function defineValueType(valueTypeDef) {
|
|
|
4125
4271
|
} = valueTypeDef;
|
|
4126
4272
|
const apiName = namespacePrefix ? namespace + inputApiName : inputApiName;
|
|
4127
4273
|
const semverValidation = /^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/;
|
|
4128
|
-
!semverValidation.test(version) ? process.env.NODE_ENV !== "production" ?
|
|
4274
|
+
!semverValidation.test(version) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "Version is not a valid semver") : invariant9__default.default(false) : void 0;
|
|
4129
4275
|
const existingVersions = ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][apiName] ?? [];
|
|
4130
4276
|
const duplicateVersion = existingVersions.find((vt2) => vt2.version === version);
|
|
4131
|
-
!(duplicateVersion === void 0) ? process.env.NODE_ENV !== "production" ?
|
|
4277
|
+
!(duplicateVersion === void 0) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, `Value type with apiName ${apiName} and version ${version} is already defined`) : invariant9__default.default(false) : void 0;
|
|
4132
4278
|
const typeName = typeof type.type === "string" ? type.type : type.type.type === "struct" ? "structV2" : type.type.type;
|
|
4133
4279
|
const constraints = type.constraints ? type.constraints.map((constraint) => {
|
|
4134
4280
|
const output = {
|
|
@@ -4197,8 +4343,8 @@ function importSharedPropertyType(opts) {
|
|
|
4197
4343
|
} = opts;
|
|
4198
4344
|
const fullApiName = packageName === void 0 ? apiName : `${packageName}.${apiName}`;
|
|
4199
4345
|
if (packageName !== void 0) {
|
|
4200
|
-
!!packageName.endsWith(".") ? process.env.NODE_ENV !== "production" ?
|
|
4201
|
-
!(packageName.match("[A-Z]") == null) ? process.env.NODE_ENV !== "production" ?
|
|
4346
|
+
!!packageName.endsWith(".") ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "Package name format invalid ends with period") : invariant9__default.default(false) : void 0;
|
|
4347
|
+
!(packageName.match("[A-Z]") == null) ? process.env.NODE_ENV !== "production" ? invariant9__default.default(false, "Package name includes upper case characters") : invariant9__default.default(false) : void 0;
|
|
4202
4348
|
}
|
|
4203
4349
|
const spt = {
|
|
4204
4350
|
apiName: fullApiName,
|
|
@@ -4229,10 +4375,13 @@ exports.MODIFY_OBJECT_PARAMETER = MODIFY_OBJECT_PARAMETER;
|
|
|
4229
4375
|
exports.OntologyEntityTypeEnum = OntologyEntityTypeEnum;
|
|
4230
4376
|
exports.addDependency = addDependency;
|
|
4231
4377
|
exports.addNamespaceIfNone = addNamespaceIfNone;
|
|
4378
|
+
exports.cleanAndValidateLinkTypeId = cleanAndValidateLinkTypeId;
|
|
4379
|
+
exports.convertObjectStatus = convertObjectStatus;
|
|
4232
4380
|
exports.convertToDisplayName = uppercaseFirstLetter;
|
|
4233
4381
|
exports.convertToPluralDisplayName = convertToPluralDisplayName;
|
|
4234
4382
|
exports.convertType = propertyTypeTypeToOntologyIrType;
|
|
4235
4383
|
exports.default = main;
|
|
4384
|
+
exports.defaultTypeClasses = defaultTypeClasses;
|
|
4236
4385
|
exports.defineAction = defineAction;
|
|
4237
4386
|
exports.defineCreateInterfaceObjectAction = defineCreateInterfaceObjectAction;
|
|
4238
4387
|
exports.defineCreateObjectAction = defineCreateObjectAction;
|
|
@@ -4249,8 +4398,21 @@ exports.defineOntology = defineOntology;
|
|
|
4249
4398
|
exports.defineSharedPropertyType = defineSharedPropertyType;
|
|
4250
4399
|
exports.defineValueType = defineValueType;
|
|
4251
4400
|
exports.dumpOntologyFullMetadata = dumpOntologyFullMetadata;
|
|
4401
|
+
exports.extractNamespace = extractNamespace;
|
|
4402
|
+
exports.getImportedTypes = getImportedTypes;
|
|
4403
|
+
exports.getNamespace = getNamespace;
|
|
4404
|
+
exports.getOntologyDefinition = getOntologyDefinition;
|
|
4405
|
+
exports.getPropertyTypeName = getPropertyTypeName;
|
|
4406
|
+
exports.hasRenderHints = hasRenderHints;
|
|
4252
4407
|
exports.importOntologyEntity = importOntologyEntity;
|
|
4253
4408
|
exports.importSharedPropertyType = importSharedPropertyType;
|
|
4409
|
+
exports.initializeOntologyState = initializeOntologyState;
|
|
4410
|
+
exports.isExotic = isExotic;
|
|
4411
|
+
exports.isInterfaceSharedPropertyType = isInterfaceSharedPropertyType;
|
|
4412
|
+
exports.shouldBeIndexedForSearch = shouldBeIndexedForSearch;
|
|
4413
|
+
exports.shouldNotHaveRenderHints = shouldNotHaveRenderHints;
|
|
4414
|
+
exports.uppercaseFirstLetter = uppercaseFirstLetter;
|
|
4415
|
+
exports.withoutNamespace = withoutNamespace;
|
|
4254
4416
|
exports.wrapWithProxy = wrapWithProxy;
|
|
4255
4417
|
//# sourceMappingURL=index.cjs.map
|
|
4256
4418
|
//# sourceMappingURL=index.cjs.map
|