@fluid-experimental/property-properties 2.0.0-internal.2.2.0 → 2.0.0-internal.2.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"propertyFactory.js","sourceRoot":"","sources":["../src/propertyFactory.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;GAGG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACrD,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC;AAEtC,MAAM,EACF,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,SAAS,GACZ,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACnD,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B,MAAM,EACF,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,SAAS,GACZ,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AAEtD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC3D,MAAM,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAEzE,+BAA+B;AAC/B,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC9D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAChE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC9D,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,g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GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Declaration of the PropertyFactory class.\n * Responsible for creating property sets and registering property templates\n */\n\nconst _ = require('lodash');\nconst fastestJSONCopy = require('fastest-json-copy');\nconst deepCopy = fastestJSONCopy.copy;\n\nconst {\n Collection,\n ConsoleUtils,\n EventEmitter,\n SortedCollection,\n constants,\n GuidUtils,\n} = require('@fluid-experimental/property-common');\nconst { MSG } = constants;\n\nconst {\n TypeIdHelper,\n TemplateValidator,\n PathHelper,\n ChangeSet,\n} = require('@fluid-experimental/property-changeset');\n\nconst semver = require('semver');\nconst async = require('async');\nconst { PropertyTemplate } = require('./propertyTemplate');\nconst { PropertyTemplateWrapper } = require('./propertyTemplateWrapper');\n\n// Include the property classes\nconst { BaseProperty } = require('./properties/baseProperty');\nconst { NamedProperty } = require('./properties/namedProperty');\nconst { NodeProperty } = require('./properties/nodeProperty');\nconst { NamedNodeProperty } = require('./properties/namedNodeProperty');\nconst { ContainerProperty } = require('./properties/containerProperty');\nconst { ValueProperty } = require('./properties/valueProperty');\n\n// Include all primitive properties –- will register at the end.\nconst {\n Uint8Property,\n Uint16Property,\n Uint32Property,\n} = require('./properties/uintProperties');\n\nconst {\n Float32Property,\n Float64Property,\n} = require('./properties/floatProperties');\n\nconst {\n Int8Property,\n Int16Property,\n Int32Property,\n Int64Property,\n Uint64Property,\n} = require('./properties/intProperties');\n\nconst { StringProperty } = require('./properties/stringProperty');\nconst { BoolProperty } = require('./properties/boolProperty');\nconst { ReferenceProperty } = require('./properties/referenceProperty');\nconst { EnumProperty } = require('./properties/enumProperty');\n\n// Include collection properties\nconst { ArrayProperty } = require('./properties/arrayProperty');\nconst { SetProperty } = require('./properties/setProperty');\nconst { MapProperty } = require('./properties/mapProperty');\nconst { ValueMapProperty } = require('./properties/valueMapProperty');\nconst { IndexedCollectionBaseProperty } = require('./properties/indexedCollectionBaseProperty');\nconst { AbstractStaticCollectionProperty } = require('./properties/abstractStaticCollectionProperty');\n\nconst {\n Float32ArrayProperty,\n Float64ArrayProperty,\n Uint32ArrayProperty,\n Int32ArrayProperty,\n Uint64ArrayProperty,\n Int64ArrayProperty,\n Uint16ArrayProperty,\n Int16ArrayProperty,\n Uint8ArrayProperty,\n Int8ArrayProperty,\n StringArrayProperty,\n BoolArrayProperty,\n} = require('./properties/valueArrayProperty');\n\nconst { ReferenceMapProperty } = require('./properties/referenceMapProperty');\nconst { ReferenceArrayProperty } = require('./properties/referenceArrayProperty');\nconst { EnumArrayProperty } = require('./properties/enumArrayProperty');\n\nconst {\n Float64MapProperty,\n Float32MapProperty,\n Uint32MapProperty,\n Uint64MapProperty,\n Uint16MapProperty,\n Uint8MapProperty,\n Int32MapProperty,\n Int64MapProperty,\n Int16MapProperty,\n Int8MapProperty,\n StringMapProperty,\n BoolMapProperty,\n} = require('./properties/valueMapProperty');\n\nconst { LazyLoadedProperties } = require('./properties/lazyLoadedProperties');\n\n/**\n * Creates an instance of the TemplateValidator\n *\n * @constructor\n * @protected\n *\n * @param {bool} skipSemver - Flag passed to the constructor of the TemplateValidator. Skips semver validation.\n *\n * @ignore\n */\nvar _createTemplateValidator = function(skipSemver) {\n var hasSchema = function(typeid) {\n return this._localVersionedTemplates.has(typeid);\n };\n var params = {\n inheritsFrom: this.inheritsFrom.bind(this),\n hasSchema: hasSchema.bind(this),\n };\n\n if (skipSemver) {\n params.skipSemver = skipSemver;\n }\n\n return new TemplateValidator(params);\n};\n\n/**\n * Register a template\n *\n * @private\n *\n * @throws if in_template is invalid.\n * @throws if trying to register a primitive property.\n * @throws if updating an existing template without property changing the version number.\n * @throws if no in_template is passed.\n * @param {property-properties.PropertyTemplate|object} in_template - the template to register.\n */\nvar registerLocal = function(in_template) {\n var typeid = in_template.typeid;\n var remoteTemplates = this._getRemoteTemplates(typeid);\n\n if (!this._isNativePropertyConstructor(in_template)) {\n if (!(in_template instanceof PropertyTemplate)) {\n in_template = new PropertyTemplate(in_template);\n }\n\n // Here we are registering a user defined template. We need to check whether it is already registered\n // as a remote template.\n if (this._localPrimitivePropertiesAndTemplates.has(typeid) || remoteTemplates.length) {\n // Template already exists. The incoming template MUST match what is currently registered.\n // If they do not match, throw an error letting the user know that the templates are incompatible.\n\n if (!remoteTemplates.length) {\n console.warn(MSG.REGISTERING_EXISTING_TYPEID + typeid);\n }\n\n var templateValidator = _createTemplateValidator.call(this, true);\n\n var serializedInTemplate = in_template.serializeCanonical();\n\n var localValidationResults = { isValid: true };\n if (this._localPrimitivePropertiesAndTemplates.has(typeid)) {\n var localRegisteredTemplate = this._localPrimitivePropertiesAndTemplates.item(typeid).getPropertyTemplate();\n\n localValidationResults = templateValidator.validate(\n localRegisteredTemplate.serializeCanonical(),\n serializedInTemplate,\n );\n }\n\n if (localValidationResults.isValid) {\n var remoteValidationResults = { isValid: true };\n if (remoteTemplates.length) {\n _.every(remoteTemplates, function(template) {\n remoteValidationResults = templateValidator.validate(\n template.serializeCanonical(),\n serializedInTemplate,\n );\n\n return remoteValidationResults.isValid;\n });\n }\n }\n\n if (!localValidationResults.isValid) {\n throw new Error(\n MSG.TEMPLATE_MISMATCH + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(localValidationResults.errors), 0, 2),\n );\n } else if (!remoteValidationResults.isValid) {\n throw new Error(\n MSG.REMOTE_TEMPLATE_MISMATCH + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(remoteValidationResults.errors), 0, 2),\n );\n } else if (this._localPrimitivePropertiesAndTemplates.has(typeid)) {\n // Template is already registered. Do nothing.\n return;\n }\n }\n\n if (in_template._isVersioned()) {\n var validationResult = this.validate(in_template.serializeCanonical());\n\n if (validationResult.isValid) {\n var typeidWithoutVersion = in_template.getTypeidWithoutVersion();\n var version = in_template.getVersion();\n this._validateSemver(in_template, true);\n\n // Semver validation passed. Add the template to the local versioned templates collection\n if (this._localVersionedTemplates.has(typeidWithoutVersion)) {\n this._localVersionedTemplates.item(typeidWithoutVersion).add(version, in_template);\n } else {\n var collection = _createVersionedSortedCollection();\n this._localVersionedTemplates.add(typeidWithoutVersion, collection);\n collection.add(version, in_template);\n }\n } else {\n throw new Error(\n MSG.FAILED_TO_REGISTER + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(validationResult.errors), 0, 2),\n );\n }\n } else {\n throw new Error(MSG.UNVERSIONED_TEMPLATE + ' Template with typeid = ' + typeid + ' is not versioned.');\n }\n // Forward to the internal function\n this._registerTypeId(typeid, in_template);\n } else {\n throw new Error(\n MSG.CANNOT_REGISTER_PRIMITIVE + typeid,\n );\n }\n};\n\n/**\n * Helper function used to extract the error messages from a list of Error objects\n * @param {Array.<Error>} in_errors - List of error objects\n * @private\n * @returns {Array.<string>} List of error messages\n */\nvar _extractErrorMessage = function(in_errors) {\n return _.map(in_errors, function(error) {\n return error.message;\n });\n};\n\n/**\n * Helper function used to create a sorted collection\n * @returns {property-common.Datastructures.SortedCollection} Empty sorted collection\n * @private\n */\nvar _createVersionedSortedCollection = function() {\n var collection = new SortedCollection();\n collection.setComparisonFunction(function(versionA, versionB) {\n if (semver.gt(versionA, versionB)) {\n return 1;\n } else if (semver.lt(versionA, versionB)) {\n return -1;\n }\n\n return 0;\n });\n return collection;\n};\n\n/**\n * Extracts typeids directly referred to in a template and that are not locally known\n *\n * @public\n * @param {property-properties.PropertyTemplate|object} in_template - from which to extract dependencies\n *\n * @returns {Array} list of unknown typeids\n */\nvar _extractUnknownDependencies = function(in_template) {\n var self = this;\n var dependencies = PropertyTemplate.extractDependencies(in_template);\n\n dependencies = dependencies.filter(function(typeid) {\n return !self._localPrimitivePropertiesAndTemplates.has(typeid);\n });\n\n return dependencies;\n};\n\n/**\n * Pushes a template request task onto the template requests queue\n *\n * @public\n * @param {String} in_typeid - typeid of the template to retrieve\n */\nvar _pushTemplateRequestTask = function(in_typeid) {\n var that = this;\n\n if (that.missingDependencies[in_typeid].requested === true) {\n return;\n }\n that.missingDependencies[in_typeid].requested = true;\n\n this.templateRequestsQueue.push({ typeid: in_typeid, context: that._templateStore }, function(response) {\n if (response.error) {\n that.templateRequestsResults.errors[in_typeid] = response.error;\n } else {\n var template = response.template;\n that.templateRequestsResults.schemas[in_typeid] = template;\n var unknownDependencies = _extractUnknownDependencies.call(that, template);\n\n try {\n registerLocal.call(that, template);\n } catch (error) {\n that.templateRequestsResults.errors[in_typeid] = [error];\n return;\n }\n\n // Launch new requests for those dependencies\n for (var d = 0; d < unknownDependencies.length; d++) {\n var typeid = unknownDependencies[d];\n\n if (that.missingDependencies[typeid] === undefined) {\n that.missingDependencies[typeid] = { requested: false };\n if (that.templateRequestsResults.errors[typeid] === undefined) {\n that.templateRequestsResults.errors[typeid] = {};\n }\n if (that.templateRequestsResults.schemas[typeid] === undefined) {\n that.templateRequestsResults.schemas[typeid] = {};\n }\n\n _pushTemplateRequestTask.call(that, typeid);\n }\n }\n\n delete that.missingDependencies[template.typeid];\n }\n });\n};\n\n/**\n * Creates a new collection of property templates used later on\n * to instantiate property sets based on the typeid (Type identifier).\n */\nclass PropertyFactory {\n /**\n * @constructor\n * @protected\n * @alias property-properties.PropertyFactory\n */\n constructor() {\n // Unfortunately, PropertyFactory can't inherit from EventEmitter class as\n // it shares the same member methods names `register` and `unregister`.\n this._eventEmitter = new EventEmitter();\n\n this._templateValidator = _createTemplateValidator.call(this);\n\n // Collection containing both local templates and primitive properties\n this._localPrimitivePropertiesAndTemplates = new Collection();\n\n // Collection containing the local templates sorted by their version number in an ascending order\n this._localVersionedTemplates = new Collection();\n\n // Collection containing the remote templates sorted by their version number in an ascending order\n // within a specified scope.\n this._remoteScopedAndVersionedTemplates = new Collection();\n\n // To hold the template store the PropertyFactory interacts with.\n this._templateStore = undefined;\n\n // Async queue of schema retrieval tasks\n this.templateRequestsQueue = undefined;\n\n // List of missing dependencies\n this.missingDependencies = undefined;\n\n // Structure containing results the process of retrieving property set schemas from store\n this.templateRequestsResults = {\n errors: {},\n schemas: {},\n };\n\n // Cache of inheritsFrom() request results\n this._inheritanceCache = {};\n\n /** Cache of constructor function that are auto-generated for typeids */\n this._typedPropertyConstructorCache = {};\n\n /** A cache of functions that create the properties */\n this._cachedCreationFunctions = new Map();\n\n /**\n * Usually we will use the precompiled creation functions, but those all share the same constant properties.\n * Since it is allowed to overwrite constants via default values, we have to explicitly instantiate new\n * property instances for constants. Since the constants themselves may contain nested property instances,\n * we use this flag to indicate that for all nested properties, we do not want to use the precompiled\n * instantiation functions.\n */\n this._forceInstantion = false;\n\n this._init();\n }\n\n /**\n * Add a listener for a given type of event.\n *\n * @param {string} eventName - A string representing the type of event upon which the\n * listener will be notified.\n * @param {function} eventListener - The function to call when the \"type\" of event\n * is emitted.\n * @public\n */\n addListener(eventName, eventListener) {\n this._eventEmitter.addListener(eventName, eventListener);\n }\n\n /**\n * Remove a listener for a given type of event. Iff a listener was removed,\n * an event 'removeListener' will be emitted.\n *\n * @param {string} eventName - A string representing the type of event on which the\n * listener was attached.\n * @param {function} eventListener - The function to remove from the list of functions\n * @public\n */\n removeListener(eventName, eventListener) {\n this._eventEmitter.removeListener(eventName, eventListener);\n }\n\n /**\n * Initialize the PropertyFactory by registering primitive types\n */\n _init() {\n // Register all primitive properties\n this._registerTypeId('BaseProperty', BaseProperty, 'all');\n this._registerTypeId('NodeProperty', NodeProperty, 'all');\n this._registerTypeId('ContainerProperty', ContainerProperty, 'all');\n\n // Register the primitive types for the context single\n this._registerTypeId('Int8', Int8Property);\n this._registerTypeId('Uint8', Uint8Property);\n this._registerTypeId('Int16', Int16Property);\n this._registerTypeId('Uint16', Uint16Property);\n this._registerTypeId('Int32', Int32Property);\n this._registerTypeId('Int64', Int64Property);\n this._registerTypeId('Uint64', Uint64Property);\n this._registerTypeId('Uint32', Uint32Property);\n this._registerTypeId('Float32', Float32Property);\n this._registerTypeId('Float64', Float64Property);\n this._registerTypeId('Bool', BoolProperty);\n this._registerTypeId('String', StringProperty);\n this._registerTypeId('Reference', ReferenceProperty);\n this._registerTypeId('Enum', EnumProperty);\n\n // Register the primitive types for the context array\n this._registerTypeId('Int8', Int8ArrayProperty, 'array');\n this._registerTypeId('Uint8', Uint8ArrayProperty, 'array');\n this._registerTypeId('Int16', Int16ArrayProperty, 'array');\n this._registerTypeId('Uint16', Uint16ArrayProperty, 'array');\n this._registerTypeId('Int32', Int32ArrayProperty, 'array');\n this._registerTypeId('Uint32', Uint32ArrayProperty, 'array');\n this._registerTypeId('Int64', Int64ArrayProperty, 'array');\n this._registerTypeId('Uint64', Uint64ArrayProperty, 'array');\n this._registerTypeId('Float32', Float32ArrayProperty, 'array');\n this._registerTypeId('Float64', Float64ArrayProperty, 'array');\n this._registerTypeId('String', StringArrayProperty, 'array');\n this._registerTypeId('Bool', BoolArrayProperty, 'array');\n this._registerTypeId('Reference', ReferenceArrayProperty, 'array');\n this._registerTypeId('Enum', EnumArrayProperty, 'array');\n\n // Register the primitive types for the context map\n this._registerTypeId('Int8', Int8MapProperty, 'map');\n this._registerTypeId('Uint8', Uint8MapProperty, 'map');\n this._registerTypeId('Int16', Int16MapProperty, 'map');\n this._registerTypeId('Uint16', Uint16MapProperty, 'map');\n this._registerTypeId('Int32', Int32MapProperty, 'map');\n this._registerTypeId('Uint32', Uint32MapProperty, 'map');\n this._registerTypeId('Int64', Int64MapProperty, 'map');\n this._registerTypeId('Uint64', Uint64MapProperty, 'map');\n this._registerTypeId('Float32', Float32MapProperty, 'map');\n this._registerTypeId('Float64', Float64MapProperty, 'map');\n this._registerTypeId('Bool', BoolMapProperty, 'map');\n this._registerTypeId('String', StringMapProperty, 'map');\n this._registerTypeId('Reference', ReferenceMapProperty, 'map');\n\n // Register the default templates\n var NamedPropertyTemplate = {\n typeid: 'NamedProperty',\n properties: [\n { id: 'guid', typeid: 'String' },\n ],\n };\n\n var NamedNodePropertyTemplate = {\n typeid: 'NamedNodeProperty',\n inherits: ['NodeProperty', 'NamedProperty'],\n };\n\n var RelationshipPropertyTemplate = {\n typeid: 'RelationshipProperty',\n inherits: ['NodeProperty', 'NamedProperty'],\n properties: [\n { id: 'to', typeid: 'Reference' },\n ],\n };\n\n this._registerTypeId(NamedPropertyTemplate.typeid, NamedPropertyTemplate);\n this._registerTypeId(NamedNodePropertyTemplate.typeid, NamedNodePropertyTemplate);\n this._registerTypeId(RelationshipPropertyTemplate.typeid, RelationshipPropertyTemplate);\n }\n\n /**\n * Register a template which are used to instantiate properties. To find out more about templates,\n * see https://docs.google.com/document/d/1-7kXkKTu3AZLjKyKl7XK2VuAJRSbUxo3ZuPA8bzWocs/edit\n *\n * In addition to json structures\n * it also accepts typeids, as well as arrays of jsons ans arrays of typeids\n * as arguments. IN the case of jsons, the behavior is similar to the behavior of registerLocal.\n * In the case of typeids, it adds it to a list of unknown dependencies if the corresponding template\n * is not known locally. The case of arrays is a a repetitive application of the scalar type.\n *\n * @param {property-properties.PropertyTemplate|object|String|Array} in_input - a template, a typeid or an array of either\n */\n register(in_input) {\n if (this.missingDependencies === undefined) {\n this.missingDependencies = {};\n }\n\n // 3 cases to consider:\n\n // 1. in_input is an object\n // Determine the list of dependencies and if at least one is not available locally.\n // If this is the case, add it to the list of pending dependencies.\n // If no missing dependency, call registerLocal on the object (Classical case)\n\n // 2. in_input is a string (typeid)\n // If in_input is a type id that cannot be resolved locally, add it to the list of missing dependencies.\n // Otherwise, nothing to do. The corresponding template is already registered locally.\n\n // 3. in_input is an array of strings (typeids) or jsons\n // apply step 1. or 2. for all elements of array\n\n var validateArray = function(array) {\n var isInvalid = _.some(array, function(value) {\n return !PropertyTemplate.isTemplate(value) && !TypeIdHelper.isTemplateTypeid(value);\n });\n\n return !isInvalid;\n };\n\n var input_array = undefined;\n if (PropertyTemplate.isTemplate(in_input) || typeof in_input === 'string') {\n input_array = [in_input];\n } else if (_.isArray(in_input)) {\n input_array = in_input;\n } else {\n throw (new TypeError(MSG.ATTEMPT_TO_REGISTER_WITH_BAD_ARGUMENT));\n }\n\n if (!validateArray(input_array)) {\n throw (new Error(MSG.ATTEMPT_TO_REGISTER_WITH_BAD_ARGUMENT));\n }\n\n for (var i = 0; i < input_array.length; i++) {\n var elem = input_array[i];\n if (typeof elem === 'string') {\n if (!this._localPrimitivePropertiesAndTemplates.has(elem)) {\n if (this.missingDependencies[elem] === undefined) {\n this.missingDependencies[elem] = { requested: false };\n }\n }\n } else if (PropertyTemplate.isTemplate(elem)) {\n if (this.missingDependencies[elem.typeid] !== undefined) {\n delete this.missingDependencies[elem.typeid];\n }\n registerLocal.call(this, elem);\n delete this.missingDependencies[elem];\n }\n }\n }\n\n /**\n * Recursively parses the object of the specified type and returns the created\n * array of PropertySets Templates. It does the same thing as the registerFrom()\n * function, but it returns the array of templates instead of registering them.\n * Throws an error if any conversion error occurs.\n *\n * @param {String} in_fromType - The type of the object to convert.\n * The only type supported so far is 'JSONSchema'.\n * @param {Object} in_toConvert - The object to convert\n * @throws if in_fromType is not valid.\n * @throws if the in_toConvert object is not a valid template.\n * @returns {Array.<object>} Array of Property Sets Templates\n */\n convertToTemplates(in_fromType, in_toConvert) {\n switch (in_fromType) {\n default:\n throw new Error(MSG.UNKNOWN_TYPE + in_fromType);\n }\n }\n\n /**\n * Recursively parses the object of the specified type and registers the created\n * Property Sets Templates. It does the same work as the convertToTemplates()\n * function, but it registers the templates for you instead of returning them.\n * Throws an error if any conversion error occurs.\n *\n * @param {String} in_fromType - The type of the object to convert.\n * The only type supported so far is 'JSONSchema'.\n * @param {Object} in_toConvert - The object to convert\n * @throws if in_toConvert is not valid.\n * @throws if in_fromType is not a valid object type.\n */\n registerFrom(in_fromType, in_toConvert) {\n var psetsTemplates = this.convertToTemplates(in_fromType, in_toConvert);\n for (var i = 0; i < psetsTemplates.length; i++) {\n this.register(psetsTemplates[i]);\n }\n }\n\n /**\n * Validate semver.\n * Here we compare the incoming template with its previous/next version in the\n * local and remote registry with the intent of detecting semver violations.\n * The semver rules for templates are as follows:\n *\n * - If the template structure has been altered (delete/modify existing field) then the MAJOR version should be\n * bumped.\n *\n * - If the template structure has been extended (add new fields) then the MINOR version should be bumped.\n *\n * - If the annotation field has been updated then the PATCH version should be bumped.\n *\n * If any of these rules have been broken then a warning message is printed onto the console.\n *\n * @param {object|property-properties.PropertyTemplate} in_template - The template to compare against\n * its previous or next versions.\n * @param {boolean} in_compareRemote - Flag indicating whether we want to compare the given\n * template against the remote registry.\n *\n * @private\n */\n _validateSemver(in_template, in_compareRemote) {\n var typeidWithoutVersion = in_template.getTypeidWithoutVersion();\n var version = in_template.getVersion();\n var typeid = in_template.typeid;\n var validationResults;\n\n var warnings = [];\n\n if (this._localVersionedTemplates.has(typeidWithoutVersion)) {\n var previousLocalVersion = this._localVersionedTemplates.item(typeidWithoutVersion)\n .getNearestPreviousItem(version);\n\n if (previousLocalVersion) {\n validationResults = this._templateValidator\n .validate(in_template.serializeCanonical(), previousLocalVersion.serializeCanonical());\n warnings.push.apply(warnings, validationResults.warnings);\n } else {\n var nextLocalVersion = this._localVersionedTemplates.item(typeidWithoutVersion).getNearestNextItem(version);\n if (nextLocalVersion) {\n validationResults = this._templateValidator\n .validate(nextLocalVersion.serializeCanonical(), in_template.serializeCanonical());\n warnings.push.apply(warnings, validationResults.warnings);\n }\n }\n }\n\n if (in_compareRemote) {\n var that = this;\n this._remoteScopedAndVersionedTemplates.iterate(function(scope, remoteVersionedTemplates) {\n if (remoteVersionedTemplates.has(typeidWithoutVersion)) {\n var previousRemoteVersion = remoteVersionedTemplates.item(typeidWithoutVersion)\n .getNearestPreviousItem(version);\n\n if (previousRemoteVersion) {\n validationResults = that._templateValidator.validate(\n in_template.serializeCanonical(),\n previousRemoteVersion.getPropertyTemplate().serializeCanonical(),\n );\n warnings.push.apply(warnings, validationResults.warnings);\n } else {\n var nextRemoteVersion = remoteVersionedTemplates.item(typeidWithoutVersion).getNearestNextItem(version);\n if (nextRemoteVersion) {\n validationResults = that._templateValidator.validate(\n nextRemoteVersion.getPropertyTemplate().serializeCanonical(),\n in_template.serializeCanonical(),\n );\n warnings.push.apply(warnings, validationResults.warnings);\n }\n }\n }\n });\n }\n\n if (!_.isEmpty(warnings)) {\n console.warn(\n 'Template with typeid = ' + typeid +\n ' is valid but with the following warnings = ' + JSON.stringify(warnings, 0, 2),\n );\n }\n }\n\n /**\n * Internal method used to register remote templates coming over the wire.\n * @param {property-properties.PropertyTemplate|object} in_remoteTemplate - The remote template to register\n * @param {string} in_scope - The scope in which the template will be stored in. The scope is usually determined by\n * the currently checked out workspaces. Each workspace can have their own set of versioned templates\n * that may be different from other workspaces.\n * @protected\n */\n _registerRemoteTemplate(in_remoteTemplate, in_scope) {\n if (!(in_remoteTemplate instanceof PropertyTemplate)) {\n in_remoteTemplate = new PropertyTemplate(in_remoteTemplate);\n }\n\n var typeidWithoutVersion = in_remoteTemplate.getTypeidWithoutVersion();\n var version = in_remoteTemplate.getVersion();\n var typeid = in_remoteTemplate.typeid;\n\n if (this._localPrimitivePropertiesAndTemplates.has(typeid)) {\n // Template already exists. The incoming template MUST match what is registered.\n // If they do not match, throw an error letting the user know that the templates are incompatible.\n // This is likely due to the fact that the developer did not bump its version.\n var registeredTemplate = this._localPrimitivePropertiesAndTemplates.item(typeid).getPropertyTemplate();\n\n var templateValidator = _createTemplateValidator.call(this);\n var validationResults = templateValidator.validate(\n registeredTemplate.serializeCanonical(),\n in_remoteTemplate.serializeCanonical(),\n );\n if (!validationResults.isValid) {\n throw new Error(\n MSG.TEMPLATE_MISMATCH + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(validationResults.errors), 0, 2),\n );\n }\n } else if (in_remoteTemplate._isVersioned()) {\n this._validateSemver(in_remoteTemplate);\n var wrappedTemplate = new PropertyTemplateWrapper(in_remoteTemplate, in_scope);\n\n if (this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n if (this._remoteScopedAndVersionedTemplates.item(in_scope).has(typeidWithoutVersion)) {\n if (!this._remoteScopedAndVersionedTemplates.item(in_scope).item(typeidWithoutVersion).has(version)) {\n this._remoteScopedAndVersionedTemplates.item(in_scope)\n .item(typeidWithoutVersion)\n .add(version, wrappedTemplate);\n }\n } else {\n var versionCollection = _createVersionedSortedCollection();\n versionCollection.add(version, wrappedTemplate);\n this._remoteScopedAndVersionedTemplates.item(in_scope).add(typeidWithoutVersion, versionCollection);\n }\n } else {\n var namespaceCollection = new Collection();\n var versionCollection = _createVersionedSortedCollection();\n namespaceCollection.add(typeidWithoutVersion, versionCollection);\n versionCollection.add(version, wrappedTemplate);\n this._remoteScopedAndVersionedTemplates.add(in_scope, namespaceCollection);\n }\n } else {\n throw new Error(MSG.UNVERSIONED_REMOTE_TEMPLATE + ' \\n' + JSON.stringify(in_remoteTemplate, 0, 2));\n }\n }\n\n /**\n * Remove the scope from the remote templates collection\n * @param {string} in_scope - The scope to remove\n * @protected\n */\n _removeScope(in_scope) {\n var that = this;\n\n if (this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n // remove the schemas in this scope from the inheritance cache.\n this._remoteScopedAndVersionedTemplates.item(in_scope).iterate(function(nt, schemas) {\n schemas.iterate(function(k, schema) {\n delete that._inheritanceCache[schema.getPropertyTemplate().typeid];\n });\n });\n\n this._remoteScopedAndVersionedTemplates.remove(in_scope);\n }\n }\n\n /**\n * Triggered when a template is registered.\n * @event property-properties.PropertyFactory#registered\n * @param {property-properties.Template} Template - The template being registered.\n * @memberof property-properties.PropertyFactory\n *\n */\n\n /**\n * Register a template or a primitive property\n *\n * This is the internal function used to register templates and primitive properties.\n *\n * @param {property-properties.PropertyTemplate|string} in_typeid - typeid of for the property the given\n * template/constructor represents\n * @param {property-properties.PropertyTemplate|object|property-properties.BaseProperty} in_templateOrProperty -\n * Template/native property class to associate with the typeid\n * @param {string} [in_context='single'] - The context for which the parameter is added (if it is set to all the\n * object will be used in all contexts)\n */\n _registerTypeId(in_typeid, in_templateOrProperty, in_context) {\n // If the input is not yet a BaseProperty derived type or a\n // PropertyTemplate, we create a PropertyTemplate object for it\n\n if (!(in_templateOrProperty instanceof PropertyTemplate ||\n this._isNativePropertyConstructor(in_templateOrProperty))) {\n in_templateOrProperty = new PropertyTemplate(in_templateOrProperty);\n }\n\n // If no context is specified we assign one\n if (!in_context) {\n // By default templates are registered for all contexts together, BaseProperties are registered separately\n in_context = in_templateOrProperty instanceof PropertyTemplate ? 'all' : 'single';\n }\n\n if (in_context !== 'all') {\n if (!this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n this._localPrimitivePropertiesAndTemplates.add(in_typeid, new Collection());\n }\n this._localPrimitivePropertiesAndTemplates.item(in_typeid).add(in_context, in_templateOrProperty);\n } else if (!this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n var wrapper = new PropertyTemplateWrapper(in_templateOrProperty);\n this._localPrimitivePropertiesAndTemplates.add(in_typeid, wrapper);\n }\n\n this._eventEmitter.emit('registered', in_templateOrProperty);\n }\n\n /**\n * Validate a template.\n * Check that the template is syntactically correct as well as semantically correct.\n *\n * @param {object|property-properties.PropertyTemplate} in_template - The template to check against.\n *\n * @returns {object|undefined} map of key-value pairs where the path of the invalid property is the key,\n * and the value is the error message.\n *\n * i.e.\n *\n * ```\n * <pre>\n * {\n * 'isValid': true or false,\n * 'typeid': 'The typeid of the object being parsed',\n * 'unresolvedTypes': [ 'An array', 'of strong typeids', 'that were found',\n * 'in the document', 'but not resolved from the local cache' ],\n * 'resolvedTypes': [ 'Array of', 'strong types resolved', 'during template parsing'],\n * 'errors': [ 'Array of', 'objects describing', 'syntax errors in the template' ]\n * ...\n * }\n * </pre>\n * ```\n */\n validate(in_template) {\n return this._templateValidator.validate(in_template);\n }\n\n /**\n * Get a template or property object based on a typeid and a context\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} [in_context] - The context of the property to create\n * @param {string} [in_scope] - The scope in which the property typeid is defined\n *\n * @returns {property-properties.PropertyTemplate|object|property-properties.BaseProperty|undefined}\n * Template/Property identified by the typeid.\n */\n _get(in_typeid, in_context, in_scope = undefined) {\n var templateOrProperty = this._getWrapper(in_typeid, in_context, in_scope);\n if (templateOrProperty instanceof PropertyTemplateWrapper) {\n return templateOrProperty.getPropertyTemplate();\n }\n return templateOrProperty;\n }\n\n /**\n * Get a template or property object based on a typeid and a context\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} [in_context] - The context of the property to create\n * @param {string} [in_scope] - The scope in which the property typeid is defined\n *\n * @returns {property-properties.PropertyTemplateWrapper|property-properties.BaseProperty|undefined}\n * Template/Property identified by the typeid.\n */\n _getWrapper(in_typeid, in_context, in_scope) {\n if (this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n var typeidItem = this._localPrimitivePropertiesAndTemplates.item(in_typeid);\n if (!(typeidItem instanceof Collection)) {\n return typeidItem;\n } else {\n var context = in_context || 'single';\n return this._localPrimitivePropertiesAndTemplates.item(in_typeid).item(context);\n }\n } else if (in_scope && this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n var splitTypeId = TypeIdHelper.extractVersion(in_typeid);\n if (splitTypeId.version) {\n var typeidWithoutVersion = splitTypeId.typeidWithoutVersion;\n var version = splitTypeId.version;\n\n if (this._remoteScopedAndVersionedTemplates.item(in_scope).has(typeidWithoutVersion) &&\n this._remoteScopedAndVersionedTemplates.item(in_scope).item(typeidWithoutVersion).has(version)) {\n return this._remoteScopedAndVersionedTemplates.item(in_scope).item(typeidWithoutVersion).item(version);\n }\n }\n }\n\n return undefined;\n }\n\n /**\n * Get template based on typeid\n *\n * @param {string} in_typeid - The type unique identifier\n * @returns {property-properties.PropertyTemplate|undefined} Template identified by the typeid.\n */\n getTemplate(in_typeid) {\n return this._localPrimitivePropertiesAndTemplates.has(in_typeid) && !TypeIdHelper.isPrimitiveType(in_typeid)\n ? this._localPrimitivePropertiesAndTemplates.item(in_typeid).getPropertyTemplate()\n : undefined;\n }\n\n /**\n * Get remote templates based on typeid\n * @private\n * @param {string} in_typeid - The type unique identifier\n * @returns {array<property-properties.PropertyTemplate>} Array of templates.\n */\n _getRemoteTemplates(in_typeid) {\n var templatesFound = [];\n\n var parsedTypeId = TypeIdHelper.extractVersion(in_typeid);\n var typeidWithoutVersion = parsedTypeId.typeidWithoutVersion;\n var version = parsedTypeId.version;\n\n this._remoteScopedAndVersionedTemplates.iterate(function(scope, remoteVersionedTemplates) {\n if (remoteVersionedTemplates.has(typeidWithoutVersion) &&\n remoteVersionedTemplates.item(typeidWithoutVersion).item(version)) {\n templatesFound.push(remoteVersionedTemplates.item(typeidWithoutVersion).item(version).getPropertyTemplate());\n }\n });\n\n return templatesFound;\n }\n\n /**\n * Create an instance of the given property typeid if there is a template registered for it.\n * Otherwise, this method returns undefined. Searches also in scoped templates.\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} in_context - The type of collection of values that the property contains.\n * Accepted values are \"single\" (default), \"array\", \"map\" and \"set\".\n * @param {object|undefined} in_initialProperties - A set of initial values for the PropertySet being created\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n * @returns {property-properties.BaseProperty|undefined} the property instance\n * @private\n */\n _createProperty(\n in_typeid, in_context, in_initialProperties, in_scope) {\n const ifNotSingleOrUndefined = (in_context || 'single') !== 'single';\n ConsoleUtils.assert(ifNotSingleOrUndefined || _.isString(in_typeid), MSG.UNKNOWN_TYPEID_SPECIFIED + in_typeid);\n let context = in_context;\n if (!context) {\n // If no context is supplied, we check whether the typeid contains a context\n if (!TypeIdHelper.isReferenceTypeId(in_typeid)) {\n var splitTypeId = TypeIdHelper.extractContext(in_typeid);\n in_typeid = splitTypeId.typeid;\n context = splitTypeId.context;\n }\n }\n\n let propertyCreationFunction = undefined;\n\n if (!this._forceInstantion) {\n // Check, whether we already have a property creation function for this property\n // in the cache\n const scopeFunctionEntry = this._cachedCreationFunctions.get(in_typeid);\n const contextFunctionEntry = scopeFunctionEntry && scopeFunctionEntry.get(in_scope);\n propertyCreationFunction = contextFunctionEntry && contextFunctionEntry.get(context);\n }\n\n // If we don't have a cached function or are requested to explicitly instantiate the property\n // we have to first create a property definition by recursively traversing all templates\n let propertyDef;\n if (!propertyCreationFunction) {\n propertyDef = {};\n this._createDefFromPropertyDeclaration({\n typeid: in_typeid,\n context: context || 'single',\n }, in_scope, propertyDef);\n }\n\n let property;\n if (!this._forceInstantion) {\n // If we don't yet have a creation function, we will create one here\n propertyCreationFunction = propertyCreationFunction ||\n this._definePropertyCreationFunction(propertyDef, in_typeid, in_scope, context);\n\n // Create the property by invoking the precompiled creation function\n property = propertyCreationFunction();\n\n // If initial properties have been provided, we will assign them to the\n // default initialized property\n if (in_initialProperties !== undefined) {\n this._setInitialValue(property, {\n value: in_initialProperties,\n }, false);\n }\n } else {\n // Directly instantiate the property from the definition (without using) a precompield function\n property = this._instantiatePropertyDef(propertyDef, in_scope, in_initialProperties && {\n value: in_initialProperties,\n });\n }\n\n return property;\n }\n\n /**\n * Creates an instance of the property described in the property definition.\n *\n * Note: this function won't create any constant children, it is only used to\n * instantiate nested constant properties and those will be set to constant\n * after their instantiation.\n *\n * @param {Object} propertyDef - The property defintion for the property to create\n * @param {String} in_scope - The scope for the property to create\n * @param {String} in_initialProperties - The initial values for the property\n *\n * @returns {BaseProperty} An instance of the property\n */\n _instantiatePropertyDef(propertyDef, in_scope, in_initialProperties) {\n let rootProperty = undefined;\n\n // This stack is used to recursively iterate over the property definition\n const creationStack = [{\n id: undefined,\n entry: propertyDef,\n parent: undefined,\n }];\n\n while (creationStack.length > 0) {\n const currentEntry = creationStack.pop();\n\n // We have an entry on the stack that is just waiting for its children to finish, but has already\n // been created\n if (currentEntry.signalChildrenFinished) {\n currentEntry.property._signalAllStaticMembersHaveBeenAdded(in_scope);\n\n if (currentEntry.initialValue) {\n this._setInitialValue(currentEntry.property, currentEntry.initialValue, true);\n }\n continue;\n }\n\n // Create the property instance\n let property = new (currentEntry.entry.constructorFunction)(currentEntry.entry.entry);\n\n // Insert / append the property to the parent\n if (currentEntry.parent) {\n if (currentEntry.entry.optional) {\n currentEntry.parent._insert(property.getId(), property, true);\n } else {\n currentEntry.parent._append(property, currentEntry.entry.allowChildMerges);\n }\n } else {\n // If we are at the root, we store the property object to return it later\n rootProperty = property;\n }\n\n // For named properties we have to assign a GUID (note: all constant properties in\n // a template will share this GUID)\n if (currentEntry.setGuid) {\n property.value = GuidUtils.generateGUID();\n }\n\n // Assign optional children\n if (currentEntry.entry.optionalChildren) {\n for (let [id, typeid] of Object.entries(currentEntry.entry.optionalChildren)) {\n property._addOptionalChild(id, typeid);\n }\n }\n\n // Recursively process all children of this entry\n if (currentEntry.entry.children) {\n // Create an entry on the stack, which is later needed,\n // to signal that all child properties have been added\n const parentStackEntry = {\n signalChildrenFinished: true,\n initialValue: currentEntry.entry.initialValue,\n property,\n };\n creationStack.push(parentStackEntry);\n\n for (let [id, child] of currentEntry.entry.children) {\n creationStack.push({\n parent: property,\n id: id,\n entry: child,\n setGuid: currentEntry.entry.assignGuid && id ===\n 'guid',\n });\n }\n } else {\n // If there are no children, we directly assign the initial value and\n // signal that the property has completely been initialized\n if (currentEntry.entry.initialValue) {\n this._setInitialValue(property, currentEntry.entry.initialValue, true);\n }\n\n if (currentEntry.entry.signal) {\n property._signalAllStaticMembersHaveBeenAdded(in_scope);\n }\n }\n }\n\n if (in_initialProperties !== undefined) {\n this._setInitialValue(rootProperty, in_initialProperties, true);\n }\n\n return rootProperty;\n }\n\n /**\n * Creates a javascript function that instantiates the requested property\n *\n * @param {Object} propertyDef - The property defintion for the property for which the function is created\n * @param {String} in_typeid - The typeid for the property for which the function is created\n * @param {String} in_scope - The scope for the property for which the function is created\n * @param {String} in_context - The context for the property for which the function is created\n *\n * @returns {Function} A function that creates an instance of the property\n */\n _definePropertyCreationFunction(propertyDef, in_typeid, in_scope, in_context) {\n // This stack is used to recursively iterate over the property definition\n const creationStack = [{\n id: null,\n def: propertyDef,\n parent: undefined,\n }];\n\n let creationFunctionSource = \"\";\n let currentParameterIndex = 0;\n let parameters = [];\n let currentPropertyNumber = 0;\n let currentPropertyVarName = \"\";\n let resultVarName;\n\n while (creationStack.length > 0) {\n const currentEntry = creationStack.pop();\n\n // We have an entry on the stack that is just waiting for its children to finish, but has already\n // been created\n if (currentEntry.signalChildrenFinished) {\n // Add the signalling function\n creationFunctionSource +=\n `${currentEntry.propertyVarname}._signalAllStaticMembersHaveBeenAdded(${JSON.stringify(in_scope)});\\n`;\n continue;\n }\n\n // Determine the initial value for this property\n let initialValue = currentEntry.def.initialValue !== undefined ?\n currentEntry.def.initialValue :\n undefined;\n\n if (currentEntry.def.entry.id) {\n let parentEntry = currentEntry.parentStackEntry;\n let path = [currentEntry.def.entry.id];\n\n // We have to walk the whole parent chain and extract for\n // each parent the initial values. Entries further up in the\n // chain can overwrite entries further down\n while (parentEntry) {\n if (parentEntry.initialValue) {\n // Extract changes to be applied to this property\n let filteredChangeSet = parentEntry.initialValue.value;\n for (let i = 0; i < path.length; i++) {\n filteredChangeSet = filteredChangeSet && filteredChangeSet[path[i]];\n }\n\n // Update the initial value with the extract changeset\n if (_.isObject(filteredChangeSet)) {\n if (initialValue === undefined) {\n initialValue = {\n typed: false,\n value: filteredChangeSet,\n };\n } else if (_.isObject(initialValue)) {\n Object.assign(initialValue.value, filteredChangeSet);\n } else {\n throw new TypeError('Invalid default values specified');\n }\n } else if (filteredChangeSet !== undefined) {\n if (initialValue === undefined) {\n initialValue = {\n value: undefined,\n typed: false,\n };\n }\n initialValue.value = filteredChangeSet;\n }\n }\n if (parentEntry.id !== null) {\n path.unshift(parentEntry.id);\n }\n parentEntry = parentEntry.parentStackEntry;\n }\n }\n\n if (currentEntry.def.constant) {\n // If we have a constant property, we create a concrete property object instance and share it\n // among all instances of the parent property\n let instantiatedChild;\n try {\n // Usually we would use the precompiled creation functions, but those all share\n // the same constant properties. Since it is allowed to overwrite constants via\n // default values, we have to explicitly instantiate new property instances for\n // constants. Since the constants themselves may contain nested property instances,\n // we use this flag to indicate that for all nested properties, we do not want to use\n // the precompiled instantiation functions.\n this._forceInstantion = true;\n instantiatedChild =\n this._instantiatePropertyDef(currentEntry.def, in_scope, currentEntry.def.initialValue);\n } finally {\n this._forceInstantion = false;\n }\n instantiatedChild._setAsConstant();\n\n // Add a reference to the newly instantiate constant property to the parameters and add\n // a command to add it into the tree\n parameters.push(instantiatedChild);\n creationFunctionSource += `${currentEntry.parentVarName}._append(\n parameters[${currentParameterIndex}], ${currentEntry.def.allowChildMerges}\n );\\n`;\n currentParameterIndex += 1;\n } else {\n // Put the constructor function and the description of the property into the\n // parameters array\n parameters.push(currentEntry.def.constructorFunction);\n parameters.push(currentEntry.def.entry);\n\n // and add the instantiation call to the generated function\n currentPropertyNumber++;\n currentPropertyVarName = `property${currentPropertyNumber}`;\n creationFunctionSource +=\n `const ${currentPropertyVarName} =\n new parameters[${currentParameterIndex}](parameters[${currentParameterIndex + 1}]);\\n`;\n currentParameterIndex += 2;\n\n // Insert / append the property to the parent\n if (currentEntry.parentVarName !== undefined) {\n creationFunctionSource += currentEntry.def.optional\n ? `${currentEntry.parentVarName}._insert(\n ${JSON.stringify(currentEntry.def.entry.id)}, ${currentPropertyVarName}, true\n );\\n`\n : `${currentEntry.parentVarName}._append(\n ${currentPropertyVarName}, ${currentEntry.def.allowChildMerges}\n );\\n`;\n } else {\n resultVarName = currentPropertyVarName;\n }\n\n // For named properties we have to add a calll to assign a GUID to the function\n if (currentEntry.setGuid) {\n creationFunctionSource += `${currentPropertyVarName}.value = GuidUtils.generateGUID();\\n`;\n }\n\n // And if there are any optional children, we add them here (should this be further optimized? I\n // propbably would not have to be done on every instantiation, those could be stored in the prototype)\n if (currentEntry.def.optionalChildren) {\n for (let [id, typeid] of Object.entries(currentEntry.def.optionalChildren)) {\n creationFunctionSource += `${currentPropertyVarName}._addOptionalChild(\n ${JSON.stringify(id)},\n ${JSON.stringify(typeid)}\n );\\n`;\n }\n }\n\n // Recursively process all children of this entry\n if (currentEntry.def.children) {\n // Create an entry on the stack, which is later needed,\n // to signal that all child properties have been added\n const parentStackEntry = {\n signalChildrenFinished: true,\n initialValue: currentEntry.def.initialValue,\n propertyVarname: currentPropertyVarName,\n parentStackEntry: currentEntry.parentStackEntry,\n id: currentEntry.id,\n };\n creationStack.push(parentStackEntry);\n\n // Recursively add all children to the stack\n for (let [id, child] of currentEntry.def.children) {\n creationStack.push({\n parentVarName: currentPropertyVarName,\n id: id,\n def: child,\n signalParent: false,\n setGuid: currentEntry.def.assignGuid && id === 'guid',\n parentStackEntry,\n });\n }\n } else {\n // This is a leaf property, so if there is a default value\n // we directly assign it here\n if (initialValue !== undefined) {\n creationFunctionSource += !_.isObject(initialValue.value)\n // We have a primitive property and thus direclty invoke the setValue function\n ? `${currentPropertyVarName}.setValue(${JSON.stringify(initialValue.value)})\\n`\n // For non primitive properties, we currently use the member on the property factory,\n // probably we could further optimize this to directly call the correct function on the\n // property\n : `this._setInitialValue(${currentPropertyVarName},\n ${JSON.stringify(initialValue)},\n false);\\n`;\n }\n\n // If this property is constant, we assign the constant flag\n if (currentEntry.def.constant) {\n creationFunctionSource += `${currentPropertyVarName}._setAsConstant();\\n`;\n }\n\n // If necessary, signal that the propert has been fully initialized (is this ever needed?)\n if (currentEntry.def.signal) {\n creationFunctionSource += `${currentPropertyVarName}._signalAllStaticMembersHaveBeenAdded(\n ${JSON.stringify(in_scope)}\n );\\n`;\n }\n }\n }\n }\n\n // Add the return statement at the end of the function\n creationFunctionSource += ` return ${resultVarName};`;\n\n // Finally, create the actual JS function with the source we compiled above\n let creationFunction = new Function('parameters',' GuidUtils', creationFunctionSource).bind(this,\n parameters, GuidUtils);\n\n // Add the created function to the cache\n let scopesFunction = this._cachedCreationFunctions.get(in_typeid);\n if (!scopesFunction) {\n scopesFunction = new Map();\n this._cachedCreationFunctions.set(in_typeid, scopesFunction);\n }\n let contextsFunction = scopesFunction.get(in_scope);\n if (!contextsFunction) {\n contextsFunction = new Map();\n scopesFunction.set(in_scope, contextsFunction);\n }\n contextsFunction.set(in_context, creationFunction);\n\n return creationFunction;\n }\n\n /**\n * Sets a value to a property\n * The value can be passed through a default, initial or constant.\n *\n * @param {string} property - The property to set the value for\n * @param {object} valueParsed - The value to set in the given property\n * @param {string} value - The value to set\n * @param {boolean} typed - Whether the value has a different type than the property (polymorphic).\n * @param {string} typeid - THe typeid of the property.\n */\n _setInitialValue(property, valueParsed, unsetConstant) {\n if (unsetConstant) {\n property._unsetAsConstant();\n }\n if (property instanceof ValueProperty || property instanceof StringProperty) {\n property.setValue(valueParsed.value);\n } else if (valueParsed.typed) {\n property._setValues(valueParsed.value, true, true);\n } else if ((property.getTypeid() !== 'ContainerProperty') || (property._getChildrenCount() > 0)) {\n property._setValues(valueParsed.value, false, true);\n } else if (!valueParsed.typeid) {\n throw new Error(MSG.FIELD_TYPEID_IS_REQUIRED + property._id + '.typeid');\n } else {\n property._setValues(valueParsed.value, false, true);\n }\n }\n\n /**\n * Create an instance of the given property typeid if there is a template registered for it.\n * Otherwise, this method returns undefined.\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} in_context - The type of collection of values that the property contains.\n * Accepted values are \"single\" (default), \"array\", \"map\" and \"set\".\n * @param {object=} in_initialProperties - A set of initial values for the PropertySet being created\n * @param {object=} in_options - Additional options\n *\n * @returns {property-properties.BaseProperty|undefined} the property instance\n */\n create(in_typeid, in_context, in_initialProperties) {\n return this._createProperty(in_typeid, in_context, in_initialProperties, null);\n }\n\n /**\n * Creates a constructor function for the given typeid and id. The function will inherit from the\n * passed base constructor, but have the typeid and id assigned in its constructor. This way, we\n * avoid the storage overhead of having those members in each instance of the property.\n *\n * @param {String} in_context - The context of the property\n * @param {String} in_typeid - The typeid of the property\n * @param {Function} in_baseConstructor - The constructor to inherit from\n * @param {String} in_id - The Id of the property\n * @param {String} in_scope - The scope of the property\n *\n * @returns {Function} The constructor for the property\n */\n _getConstructorFunctionForTypeidAndID(in_context,\n in_typeid,\n in_baseConstructor,\n in_id,\n in_scope) {\n // Create a unique key for this constructor\n let key = in_context === 'single' ?\n in_typeid :\n in_context + '<' + in_typeid + '>';\n\n if (in_id !== undefined) {\n key = key + '-' + in_id;\n }\n\n if (in_scope && !this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n key += '-' + in_scope;\n }\n\n // Check, whether we already have this function in the cache\n if (this._typedPropertyConstructorCache[key]) {\n return this._typedPropertyConstructorCache[key];\n }\n\n // If it is not in the cache, create the function\n\n // This creates a class that will have the correct name in the debugger, but I am not\n // sure whether we want to use a dynamic eval for this. It might be flagged by some security scans\n // It should be safe, since we control the name of constructorClasses for properties\n // eslint-disable-next-line no-new-func\n var propertyConstructorFunction = class extends in_baseConstructor { };\n propertyConstructorFunction.prototype._typeid = in_typeid;\n\n Object.defineProperty(propertyConstructorFunction, 'name', { value: in_baseConstructor.name });\n\n if (in_id !== undefined) {\n propertyConstructorFunction.prototype._id = in_id;\n }\n\n this._typedPropertyConstructorCache[key] = propertyConstructorFunction;\n\n return propertyConstructorFunction;\n }\n\n /**\n * Creates a property definition for a non-collection property with the entry and constructor function assigned\n * Children will be added later by parseTemplate.\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} in_id - The id of the property to create\n * @param {property-properties.PropertyTemplate|object|property-properties.BaseProperty} in_templateOrConstructor -\n * the Template/Property for this in_typeid\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n *\n * @returns {property-properties.BaseProperty} The property that serves as parent for the properties in the template\n * @private\n */\n _createNonCollectionPropertyDef(in_typeid, in_id,\n in_templateOrConstructor, in_scope, propertyDef) {\n let ConstructorFunction;\n const params = {\n typeid: in_typeid,\n id: in_id,\n };\n\n if (this.inheritsFrom(in_typeid, 'NamedProperty', { scope: in_scope })) {\n // An id of NULL means that the GUID of the property is used if it is a named property\n params.id = in_id || null;\n }\n\n const wrapper = this._getWrapper(in_typeid, undefined, in_scope);\n const creationType = wrapper.getCreationType();\n\n switch (creationType) {\n case 'Enum':\n params._enumDictionary = in_templateOrConstructor._enumDictionary;\n ConstructorFunction = EnumProperty;\n break;\n case 'NodeProperty':\n ConstructorFunction = NodeProperty;\n params.typeid = params.typeid || 'NodeProperty';\n break;\n case 'NamedProperty':\n ConstructorFunction = NamedProperty;\n params.typeid = params.typeid || 'NamedProperty';\n break;\n default:\n ConstructorFunction = ContainerProperty;\n params.typeid = params.typeid || 'ContainerProperty';\n }\n\n ConstructorFunction = this._getConstructorFunctionForTypeidAndID(\n 'single', in_typeid, ConstructorFunction, in_id, in_scope);\n\n propertyDef.constructorFunction = ConstructorFunction;\n propertyDef.signal = true;\n propertyDef.entry = params;\n propertyDef.context = 'single';\n propertyDef.typeid = in_typeid;\n }\n\n /**\n * Check whether a typeid is registered\n * @param {string} in_typeid - The type unique identifier\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n * @returns {boolean} Returns true if the typeid is registered. False otherwise.\n * @private\n */\n _isRegisteredTypeid(in_typeid, in_scope) {\n return !!this._get(in_typeid, undefined, in_scope);\n }\n\n /**\n * Checks if there exists a registered template with a corresponding typeid\n * example:example would match to example:example-1.0.0\n * example:example-1.0.0 would not match to example:example only to example:example-1.0.0\n * @param {string} in_typeid - The type unique identifier with or without a version\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n * @returns {boolean} Returns true if a match is found. False otherwise.\n * @private\n */\n _hasCorrespondingRegisteredTypeid(in_typeid, in_scope) {\n if (in_typeid.includes('-')) {\n return this._isRegisteredTypeid(in_typeid, in_scope);\n }\n\n var registered = this._localVersionedTemplates.has(in_typeid) ||\n this._localPrimitivePropertiesAndTemplates.has(in_typeid);\n\n if (!registered && in_scope && this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n registered = this._remoteScopedAndVersionedTemplates.item(in_scope).has(in_typeid);\n }\n\n return registered;\n }\n\n /**\n * Check whether the given typeid is a specialized constructor\n * Specialized constructors are of Array or Map types\n * @param {string} in_typeid - The type unique identifier\n * @returns {boolean} Returns true if the typeid is a specialized constructor\n * @private\n */\n _isSpecializedConstructor(in_typeid) {\n return this._localPrimitivePropertiesAndTemplates.item(in_typeid) instanceof Collection;\n }\n\n /**\n * Generate the typeid according to multiple settings\n *\n * @param {Object} in_propertiesEntry - Describes the property object to create\n * @param {string=} [in_propertiesEntry.id] - The name of the property\n * @param {string=} [in_propertiesEntry.typeid] - The type identifier\n * @param {string=} [in_propertiesEntry.context] - Context in which the property is created\n * @param {Object=} [in_propertiesEntry.properties] - Context in which the property is created\n * @param {number} [in_propertiesEntry.length] - The length of an array property\n * @param {string} in_scope - The scope in which the property typeid is defined\n * @param {string} context - The context of the property\n *\n * @returns {string} The typeid.\n */\n _computeTypeid(in_propertiesEntry, in_scope, context) {\n var typeid = in_propertiesEntry.typeid;\n if (context === 'single') {\n var valueParsed = this._parseTypedValue(in_propertiesEntry, in_scope, context);\n if ((valueParsed.typed) && (valueParsed.typeid)) {\n typeid = in_propertiesEntry.typedValue.typeid;\n }\n }\n // We create a polymorphic collection (one inheriting from BaseProperty), if no typeid is specified\n // but a context is given\n if (!typeid && context !== 'single') {\n typeid = context !== 'set' ? 'ContainerProperty' : 'NamedProperty';\n }\n if (in_propertiesEntry.typeid && TypeIdHelper.isReferenceTypeId(in_propertiesEntry.typeid)) {\n typeid = 'Reference';\n }\n return typeid;\n }\n\n /**\n * Creates a propertyDef for the given properties entry\n *\n * @param {Object} in_propertiesEntry - Describes the property object to create\n * @param {string=} [in_propertiesEntry.id] - The name of the property\n * @param {string=} [in_propertiesEntry.typeid] - The type identifier\n * @param {string=} [in_propertiesEntry.context] - Context in which the property is created\n * @param {Object=} [in_propertiesEntry.properties] - Context in which the property is created\n * @param {number} [in_propertiesEntry.length] - The length of an array property\n * @param {string} in_scope - The scope in which the property typeid is defined\n * @param {Object} out_propertyDef - The created property definition\n */\n _createDefFromPropertyDeclaration(in_propertiesEntry, in_scope, out_propertyDef) {\n var context = in_propertiesEntry.context !== undefined ? in_propertiesEntry.context : 'single';\n var typeid = this._computeTypeid(in_propertiesEntry, in_scope, context);\n var referenceTarget = typeid === 'Reference' ?\n TypeIdHelper.extractReferenceTargetTypeIdFromReference(in_propertiesEntry.typeid) : undefined;\n\n if (typeid) {\n if (this._isRegisteredTypeid(typeid, in_scope) &&\n (!referenceTarget || this._hasCorrespondingRegisteredTypeid(referenceTarget, in_scope))) {\n var templateOrConstructor = this._get(typeid, context, in_scope);\n var isSpecializedConstructor = this._isSpecializedConstructor(typeid);\n\n if (this._isNativePropertyConstructor(templateOrConstructor) &&\n (isSpecializedConstructor || context === 'single')) {\n if (TypeIdHelper.isReferenceTypeId(typeid) || in_propertiesEntry.id !== undefined) {\n templateOrConstructor = this._getConstructorFunctionForTypeidAndID(in_propertiesEntry.context,\n in_propertiesEntry.typeid,\n templateOrConstructor,\n in_propertiesEntry.id,\n in_scope);\n }\n\n out_propertyDef.constructorFunction = templateOrConstructor;\n out_propertyDef.signal = false;\n out_propertyDef.entry = in_propertiesEntry;\n out_propertyDef.context = in_propertiesEntry.context;\n out_propertyDef.typeid = in_propertiesEntry.typeid;\n\n // If this is a primitive type, we create it via the registered constructor\n var result = new templateOrConstructor(in_propertiesEntry); // eslint-disable-line new-cap\n return result;\n } else {\n const templateWrapper = this._getWrapper(typeid, context, in_scope);\n templateOrConstructor = templateWrapper.getCompiledTemplate(this);\n if (context === 'single') {\n // If we have a template in a single context, we create it directly here\n\n // Create the base object\n this._createNonCollectionPropertyDef(\n typeid,\n in_propertiesEntry.id,\n templateOrConstructor,\n in_scope,\n out_propertyDef,\n );\n\n this._parseTemplate(templateOrConstructor, in_scope,\n !!(templateOrConstructor.inherits), out_propertyDef);\n } else {\n // If we have other contexts, we have to create the corresponding property object for that context\n\n // check if a specialized collection is needed\n var isEnum = this.inheritsFrom(typeid, 'Enum', { scope: in_scope });\n\n var constructorFunction;\n switch (context) {\n case 'array':\n if (isEnum) {\n var enumPropertyEntry = deepCopy(in_propertiesEntry);\n enumPropertyEntry._enumDictionary = templateOrConstructor._enumDictionary;\n in_propertiesEntry = enumPropertyEntry;\n\n constructorFunction = EnumArrayProperty;\n } else {\n constructorFunction = ArrayProperty;\n }\n break;\n case 'set':\n // Validate that a set inherit from a NamedProperty\n var typeid = in_propertiesEntry.typeid;\n if (!this.inheritsFrom(typeid, 'NamedProperty', { scope: in_scope })) {\n throw new Error(MSG.SET_ONLY_NAMED_PROPS + typeid);\n }\n\n constructorFunction = SetProperty;\n break;\n case 'map':\n constructorFunction = MapProperty;\n break;\n default:\n throw new Error(MSG.UNKNOWN_CONTEXT_SPECIFIED + context);\n }\n\n out_propertyDef.constructorFunction = constructorFunction;\n out_propertyDef.signal = false;\n out_propertyDef.entry = in_propertiesEntry;\n out_propertyDef.typeid = typeid;\n out_propertyDef.context = context;\n }\n }\n } else {\n // We tried to create a property with an unknown typeid\n // that means we have no template and don't know what to instantiate\n // TODO: look for and use the missing template somehow at this point\n typeid = referenceTarget || typeid;\n throw new Error(MSG.UNKNOWN_TYPEID_SPECIFIED + typeid);\n }\n } else {\n if (!in_propertiesEntry.properties) {\n in_propertiesEntry.properties = [];\n }\n\n // If this is a declaration which contains a properties list, we have to create a new container property for it\n let copiedPropertyEntry = Object.assign({typeid: 'ContainerProperty'}, in_propertiesEntry);\n out_propertyDef.constructorFunction = ContainerProperty;\n out_propertyDef.entry = copiedPropertyEntry;\n out_propertyDef.signal = false;\n out_propertyDef.typeid = copiedPropertyEntry.typeid;\n out_propertyDef.context = 'single';\n\n // And then parse the entry like a template\n this._parseTemplate(in_propertiesEntry, in_scope, false, out_propertyDef);\n }\n\n // If this property inherits from NamedProperty we assign a random GUID\n if (typeid && this.inheritsFrom(typeid, 'NamedProperty', { scope: in_scope })) {\n out_propertyDef.assignGuid = true;\n }\n }\n\n /**\n * Method used to determine whether the given object is a property constructor\n *\n * @param {Object} in_obj - Object to check.\n * @returns {boolean} True if the object is a BaseProperty.\n * @private\n */\n _isNativePropertyConstructor(in_obj) {\n // TODO: This tests seems dangerous. I think it is based on the assumption that constructor is not\n // overwritten in the derived classes (which it probably should be)\n return (in_obj.constructor && in_obj.constructor === ContainerProperty.constructor);\n }\n\n /**\n * Checks whether the property has a typedValue and replaces the value and the typeid\n * with the ones in the typedValue.\n * @param {Object} in_property - The property top parse.\n * @param {string} in_scope - The scope in which in_template is defined in\n * @param {string} in_context - The context of the in_property\n * @returns {Boolean} - True if the property has a typedValue.\n * @throws {TYPED_VALUES_MUST_DERIVE_FROM_BASE_TYPE} - Thrown when setting a typed value for a primitive.\n * @private\n */\n _parseTypedValue(in_property, in_scope, in_context) {\n var res = {\n typed: false,\n value: in_property.value,\n typeid: in_property.typeid,\n };\n\n if (in_property.typedValue) {\n var typeid = in_property.typeid || 'ContainerProperty';\n\n // Setting typedValue to a primitive is not supported\n if (TypeIdHelper.isPrimitiveType(typeid)) {\n throw new Error(MSG.TYPED_VALUES_FOR_PRIMITIVES_NOT_SUPPORTED + in_property.id);\n }\n\n res.typed = true;\n if (in_context === 'single') {\n if (!in_property.typedValue.typeid) {\n throw new Error(MSG.FIELD_TYPEID_IS_REQUIRED + 'typedValue ' + typeid);\n }\n\n if (!this.inheritsFrom(in_property.typedValue.typeid, typeid, { scope: in_scope })) {\n throw new Error(MSG.TYPED_VALUES_MUST_DERIVE_FROM_BASE_TYPE +\n in_property.typedValue.typeid + ' must be a subclass of ' + typeid);\n }\n\n res.value = in_property.typedValue.value;\n res.typeid = in_property.typedValue.typeid;\n } else {\n res.value = in_property.typedValue;\n }\n }\n\n return res;\n }\n\n /**\n * Parse a given property template appending its property and constant objects to the given propertyDef\n *\n * @param {property-properties.PropertyTemplate} in_template - template for the property\n * @param {string} in_scope - The scope in which in_template is defined in\n * @param {boolean} in_allowChildMerges - Whether merging of children (nested properties) is allowed.\n * This is used for extending inherited properties.\n * @param {Object} out_propertyDef - The created property definition\n * @private\n */\n _parseTemplate(in_template, in_scope, in_allowChildMerges, propertyDef) {\n // Check if there are nested property arrays\n if (!(in_template.inherits && in_template.inherits.indexOf('Enum') !== -1)) {\n if (in_template.properties) {\n const properties = in_template.properties;\n\n for (let i = 0; i < properties.length; i++) {\n const id = properties[i].id;\n const typeid = properties[i].typeid || 'ContainerProperty';\n const context = properties[i].context || 'single';\n const optional = properties[i].optional || false;\n\n const valueParsed = this._parseTypedValue(properties[i], in_scope, context);\n\n if (optional) {\n propertyDef.optionalChildren = propertyDef.optionalChildren || {};\n propertyDef.entry.optionalChildren = true;\n propertyDef.optionalChildren[id] = typeid;\n }\n\n if (valueParsed.value) {\n const newChildEntry = {\n initialValue: valueParsed,\n optional,\n allowChildMerges: in_allowChildMerges,\n };\n propertyDef.children = propertyDef.children || [];\n propertyDef.children.unshift([properties[i].id, newChildEntry]);\n this._createDefFromPropertyDeclaration(properties[i],\n in_scope, newChildEntry);\n } else if (!optional) {\n const newChildEntry = {\n initialValue: undefined,\n };\n propertyDef.children = propertyDef.children || [];\n propertyDef.children.unshift([properties[i].id, newChildEntry]);\n this._createDefFromPropertyDeclaration(properties[i],\n in_scope, newChildEntry);\n }\n }\n }\n\n if (in_template.constants) {\n const constants = in_template.constants;\n for (let i = 0; i < constants.length; i++) {\n const context = constants[i].context || 'single';\n const valueParsed = this._parseTypedValue(constants[i], in_scope, context);\n\n const newChildEntry = {\n initialValue: undefined,\n constant: true,\n };\n propertyDef.children = propertyDef.children || [];\n propertyDef.children.unshift([constants[i].id, newChildEntry]);\n\n this._createDefFromPropertyDeclaration(constants[i], in_scope, newChildEntry);\n\n if (valueParsed.value) {\n newChildEntry.initialValue = valueParsed;\n }\n }\n }\n }\n }\n\n // private params:\n // @param {string} [in_options.scope] - The scope in which the property typeid is defined\n /**\n * Checks whether the template with typeid in_templateTypeid inherits from the template in in_baseTypeid\n *\n * Note: By default, this also returns true if in_templateTypeid === in_baseTypeid, since in most use cases\n * the user wants to check whether a given template has all members as another template and so this is\n * true for the template itself\n *\n * @param {string} in_templateTypeid - Template for which we want to check, whether in_baseTypeid is a parent\n * @param {string} in_baseTypeid - The base template to check for\n * @param {object} [in_options] - Additional options\n * @param {boolean} [in_options.includeSelf=true] - Also return true if in_templateTypeid === in_baseTypeid\n * @param {property-properties.Workspace} [in_options.workspace] - A checked out workspace to check against. If supplied,\n * the function will check against the schemas that have been registered within the workspace\n * @throws if no template is found for in_templateTypeid\n * @returns {boolean} True if in_baseTypeid is a parent of in_templateTypeid or\n * if (in_includeSelf == true and in_templateTypeid == in_baseTypeid)\n */\n inheritsFrom(in_templateTypeid, in_baseTypeid, in_options) {\n const cachedInheritance = this._inheritanceCache[in_templateTypeid];\n\n in_options = in_options || {};\n\n if (in_templateTypeid === in_baseTypeid &&\n (!!in_options.includeSelf || in_options.includeSelf === undefined)) {\n return true;\n }\n\n // check the inheritance of primitive typeid\n if ((TypeIdHelper.isPrimitiveType(in_templateTypeid) ||\n TypeIdHelper.isReservedType(in_templateTypeid)) &&\n (TypeIdHelper.isPrimitiveType(in_baseTypeid) ||\n TypeIdHelper.isReservedType(in_baseTypeid))) {\n return TypeIdHelper.nativeInheritsFrom(in_templateTypeid, in_baseTypeid);\n }\n\n // look in the cache first\n if (cachedInheritance && cachedInheritance[in_baseTypeid]) {\n return true;\n } else {\n var parents = {};\n this._getAllParentsForTemplateInternal(in_templateTypeid, parents, true, in_options.scope);\n\n // update the cache\n this._inheritanceCache[in_templateTypeid] = parents;\n\n return parents[in_baseTypeid] !== undefined;\n }\n }\n\n // private params:\n // @param {string|undefined} [in_options.scope] - The scope in which the template was stored.\n /**\n * Returns all the typeids the template inherits from (including all possible paths through multiple inheritance).\n * The order of the elements in the array is unspecified.\n *\n * @param {string} in_typeid - typeid of the template\n * @param {object} [in_options] - Additional options\n * @param {boolean} [in_options.includeBaseProperty=false] - Include BaseProperty as parent.\n * Everything implicitly inherits from BaseProperty, but it is not explicitly listed in the template,\n * so it is only included if explicitly requested.\n * @param {property-properties.Workspace} [in_options.workspace] - A checked out workspace to check against.\n * If supplied, the function will check against the schemas that have been registered within the workspace.\n * @throws if no template found for in_typeid. Make sure it is registered first.\n * @returns {Array.<string>} typeids of all inherited types (in unspecified order)\n */\n getAllParentsForTemplate(in_typeid, in_options) {\n in_options = in_options || {};\n // We just forward the request to the internal function\n var parents = {};\n var scope = in_options.workspace ?\n in_options.workspace.getRoot()._getCheckedOutRepositoryInfo().getScope() :\n in_options.scope;\n this._getAllParentsForTemplateInternal(in_typeid, parents, !!in_options.includeBaseProperty, scope);\n\n return _.keys(parents);\n }\n\n /**\n * Returns all the typeids the template inherits from (including all possible paths through multiple inheritance).\n *\n * @param {string} in_typeid - typeid of the template\n * @param {Object} out_parents - Map containing the parents\n * @param {Boolean} in_includeBaseProperty - Include BaseProperty as parent. Everything implicitly inherits from\n * BaseProperty, but it is not explicitly listed in the template, so it is only be included if explicitly requested.\n * @param {string} [in_scope] - The scope in which the property typeid is defined.\n */\n _getAllParentsForTemplateInternal(in_typeid,\n out_parents,\n in_includeBaseProperty,\n in_scope) {\n if (TypeIdHelper.isPrimitiveType(in_typeid)) {\n // Everything inherits from BaseProperty.\n if (in_includeBaseProperty) {\n out_parents['AbstractStaticCollectionProperty'] = true;\n out_parents['BaseProperty'] = true;\n }\n return;\n }\n\n var template = this._get(in_typeid, undefined, in_scope);\n if (!template) {\n throw new Error(MSG.NON_EXISTING_TYPEID + in_typeid);\n }\n\n // Everything inherits from BaseProperty.\n if (in_includeBaseProperty) {\n out_parents['AbstractStaticCollectionProperty'] = true;\n out_parents['BaseProperty'] = true;\n }\n\n // Run over all parents and insert them into the parents array\n if (template.inherits) {\n // We have to distinguish the cases where the parents are either specified as a single string or an array\n var parents = _.isArray(template.inherits) ? template.inherits : [template.inherits];\n\n for (var i = 0; i < parents.length; i++) {\n // Mark it as parent\n out_parents[parents[i]] = true;\n\n // Continue recursively\n this._getAllParentsForTemplateInternal(parents[i], out_parents, undefined, in_scope);\n }\n }\n }\n\n /**\n * Internal function used to clear and reinitialize the PropertyFactory\n * @private\n */\n _clear() {\n this._localPrimitivePropertiesAndTemplates = new Collection();\n this._localVersionedTemplates = new Collection();\n this._remoteScopedAndVersionedTemplates = new Collection();\n this._inheritanceCache = {};\n this._typedPropertyConstructorCache = {};\n\n this._init();\n }\n\n /**\n * Reregisters a template (by overwriting the existing template).\n *\n * This should NEVER be necessary in the final application, but it might be helpful during interactive debugging\n * sessions, when trying out different templates.\n *\n * @protected\n * @param {property-properties.PropertyTemplate|object|property-properties.BaseProperty} in_template -\n * The template to reregister\n */\n _reregister(in_template) {\n var typeid = in_template.typeid;\n\n if (!(in_template instanceof PropertyTemplate)) {\n in_template = new PropertyTemplate(in_template);\n }\n\n var typeidWithoutVersion = in_template.getTypeidWithoutVersion();\n var version = in_template.getVersion();\n\n // Remove the existing entry\n this._localPrimitivePropertiesAndTemplates.remove(typeid);\n\n if (this._localVersionedTemplates.has(typeidWithoutVersion)) {\n if (this._localVersionedTemplates.item(typeidWithoutVersion).has(version)) {\n this._localVersionedTemplates.item(typeidWithoutVersion).remove(version);\n }\n }\n\n // Clear this schema from the inheritance cache\n delete this._inheritanceCache[typeid];\n\n // Remove the typeid from the constructor cache\n var registeredConstructors = _.keys(this._typedPropertyConstructorCache);\n for (var i = 0; i < registeredConstructors.length; i++) {\n if (registeredConstructors[i].substr(0, typeid.length) === typeid) {\n delete this._typedPropertyConstructorCache[registeredConstructors[i]];\n }\n }\n\n // Remove from typeid creation cache\n this._cachedCreationFunctions.delete(typeid);\n\n // And repeat the registration\n registerLocal.call(this, in_template);\n }\n\n /**\n * Initializes the schema store.\n * @public\n * @param {Object} in_options - the store settings.\n * @param {getBearerTokenFn} in_options.getBearerToken - Function that accepts a callback.\n * Function that should be called with an error or the OAuth2 bearer token representing the user.\n * @param {string} in_options.url - The root of the url used in the request to retrieve PropertySet schemas.\n *\n * @returns {Promise} Return an empty promise when checkout resolve or reject with error.\n */\n async initializeSchemaStore(in_options) {\n // https://regex101.com/r/TlgGJp/2\n var regexBaseUrl = /^(https?:)?\\/\\/((.[-a-zA-Z0-9@:%_+~#=.]{2,256}){1,2}\\.[a-z]{2,6}|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})(:\\d{1,5})?(\\/[-a-zA-Z0-9@:%_+.~#?&/=]*)*$/; // eslint-disable-line max-len\n\n if (!in_options || !in_options.getBearerToken || !_.isFunction(in_options.getBearerToken) || !in_options.url) {\n return Promise.reject(new Error(MSG.MISSING_FSS_INIT_OPTIONS));\n }\n\n if (!regexBaseUrl.test(in_options.url)) {\n return Promise.reject(new Error(MSG.FSS_BASEURL_WRONG));\n }\n\n if (in_options.url.slice(-1) !== '/') {\n in_options.url = in_options.url + '/';\n }\n\n this._templateStore = new ForgeSchemaStore(in_options);\n\n return Promise.resolve();\n }\n\n /**\n * Pushes a template request task onto the template requests queue\n *\n * @param {String} in_task - schema retrieval task\n * @param {String} in_callback - callback of the task\n *\n * @private\n */\n _retrieveTemplateRequestWorker(in_task, in_callback) {\n var store = in_task.context;\n if (store) {\n store.retrieveTemplate(in_task.typeid).then(function(response) {\n in_callback(response);\n }).catch(function(error) {\n in_callback({ error: error });\n });\n } else {\n throw new Error(MSG.INVALID_TEMPLATE_STORE);\n }\n }\n\n /**\n * Tries to resolve dependencies after some calls to register() have been made\n *\n * @public\n *\n * @returns {Promise} A promise that resolves to an object with the following structure:\n *\n * ```json\n * {\n * errors: {\n * typeid1: errors,\n * ...\n * typeidn: errors\n * },\n * templates: {\n * typeid1: [], array of templates\n * ...\n * typeidn: [] array of templates\n * }\n * }\n * ```\n */\n async resolveSchemas() {\n // Only one queue at a time can be processed.\n if (this.templateRequestsQueue !== undefined) {\n return Promise.reject(new Error(MSG.DEPENDENCIES_RESOLUTION_IN_PROGRESS));\n }\n\n this.templateRequestsQueue = async.queue(this._retrieveTemplateRequestWorker, 5);\n\n var that = this;\n\n // 0. Inspect locally registered templates for unknown dependencies\n this._localPrimitivePropertiesAndTemplates.iterate(function(key, type) {\n if (!that._isSpecializedConstructor(key) && PropertyTemplate.isTemplate(type.getPropertyTemplate())) {\n var unknownDeps = _extractUnknownDependencies.call(that, type.getPropertyTemplate());\n for (var d = 0; d < unknownDeps.length; d++) {\n var dep = unknownDeps[d];\n if (that.missingDependencies[dep] === undefined) {\n that.missingDependencies[dep] = { requested: false };\n }\n }\n }\n });\n\n var typeids = Object.keys(this.missingDependencies);\n\n // 1. Iterate over missing dependencies. Create pending request entries. Set status to pending.\n // Push template retrieve task to the queue for unresolved typeids (missing dependencies)\n for (var i = 0; i < typeids.length; i++) {\n var typeid = typeids[i];\n if (that.templateRequestsResults.errors[typeid] === undefined) {\n that.templateRequestsResults.errors[typeid] = {};\n }\n if (that.templateRequestsResults.schemas[typeid] === undefined) {\n that.templateRequestsResults.schemas[typeid] = {};\n }\n\n _pushTemplateRequestTask.call(that, typeid);\n }\n\n return new Promise(function(resolve, reject) {\n if (that.templateRequestsQueue.length() === 0) {\n resolve({ errors: {}, schemas: {} });\n that.templateRequestsQueue = undefined;\n } else {\n that.templateRequestsQueue.drain = function() {\n var errors = _.compact(_.pluck(that.templateRequestsResults.errors, 'typeid'));\n var results = that.templateRequestsResults;\n var resultsKeys = Object.keys(that.templateRequestsResults.schemas);\n var tempMissingDependencies = [];\n let tempConstant;\n // create missing dependencies for contextKeyType\n for (var j = 0; j < resultsKeys.length; j++) {\n var templateWrapper = that._getWrapper(results.schemas[resultsKeys[j]].typeid, undefined, undefined);\n if (templateWrapper) {\n var compiledTemplate = templateWrapper.getCompiledTemplate(that);\n if (compiledTemplate.constants) {\n for (var s = 0; s < compiledTemplate.constants.length; s++) {\n tempConstant = compiledTemplate.constants[s];\n if (tempConstant.contextKeyType === 'typeid' &&\n tempConstant.context === 'map' &&\n tempConstant.value) {\n var valueKeys = Object.keys(tempConstant.value);\n for (var z = 0; z < valueKeys.length; z++) {\n if (TypeIdHelper.isTemplateTypeid(valueKeys[z]) &&\n !(valueKeys[z] in that.templateRequestsResults.schemas) &&\n !(tempMissingDependencies.includes(valueKeys[z]))) {\n tempMissingDependencies.push(valueKeys[z]);\n }\n }\n }\n }\n }\n }\n }\n if (tempMissingDependencies.length !== 0) {\n for (var j = 0; j < tempMissingDependencies.length; j++) {\n var missingTypeid = tempMissingDependencies[j];\n if (that.missingDependencies[missingTypeid] === undefined) {\n that.missingDependencies[missingTypeid] = { requested: false };\n if (that.templateRequestsResults.errors[missingTypeid] === undefined) {\n that.templateRequestsResults.errors[missingTypeid] = {};\n }\n if (that.templateRequestsResults.schemas[missingTypeid] === undefined) {\n that.templateRequestsResults.schemas[missingTypeid] = {};\n }\n }\n _pushTemplateRequestTask.call(that, missingTypeid);\n }\n }\n\n if (that.templateRequestsQueue.length() === 0) {\n that.templateRequestsResults = { errors: {}, schemas: {} };\n if (errors.length && errors.length > 0) {\n reject(new Error('Some errors occured'));\n } else {\n that.missingDependencies = {};\n resolve(results);\n }\n that.templateRequestsQueue = undefined;\n }\n };\n }\n });\n }\n\n /**\n * Determines whether the given property is an instance of the property type corresponding to the given native\n * property typeid and context.\n *\n * @public\n * @param {property-properties.BaseProperty} in_property - The property to test\n * @param {String} in_primitiveTypeid - Native property typeid\n * @param {String} in_context - Context of the property\n * @returns {boolean} True, if the property is an instance of the corresponding type\n */\n instanceOf(in_property, in_primitiveTypeid, in_context) {\n var templateConstructor = this._get(in_primitiveTypeid, in_context);\n var result = false;\n if (templateConstructor && this._isNativePropertyConstructor(templateConstructor)) {\n result = in_property instanceof templateConstructor;\n }\n return result;\n }\n}\n\nconst PropertyFactorySingleton = new PropertyFactory();\nexport { PropertyFactorySingleton as PropertyFactory };\n\nLazyLoadedProperties.AbstractStaticCollectionProperty = AbstractStaticCollectionProperty;\nLazyLoadedProperties.IndexedCollectionBaseProperty = IndexedCollectionBaseProperty;\nLazyLoadedProperties.ContainerProperty = ContainerProperty;\nLazyLoadedProperties.ArrayProperty = ArrayProperty;\nLazyLoadedProperties.EnumArrayProperty = EnumArrayProperty;\nLazyLoadedProperties.ReferenceProperty = ReferenceProperty;\nLazyLoadedProperties.StringProperty = StringProperty;\nLazyLoadedProperties.ValueProperty = ValueProperty;\nLazyLoadedProperties.ValueMapProperty = ValueMapProperty;\nLazyLoadedProperties.ReferenceMapProperty = ReferenceMapProperty;\nLazyLoadedProperties.NodeProperty = NodeProperty;\nLazyLoadedProperties.PropertyFactory = PropertyFactorySingleton;\n"]}
1
+ {"version":3,"file":"propertyFactory.js","sourceRoot":"","sources":["../src/propertyFactory.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;GAGG;AAEH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;OASG;IACH,UAAU,CAAC,WAAW,EAAE,kBAAkB,EAAE,UAAU;QAClD,IAAI,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;QACpE,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,mBAAmB,IAAI,IAAI,CAAC,4BAA4B,CAAC,mBAAmB,CAAC,EAAE;YAC/E,MAAM,GAAG,WAAW,YAAY,mBAAmB,CAAC;SACvD;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAED,MAAM,wBAAwB,GAAG,IAAI,eAAe,EAAE,CAAC;AAClB,mDAAe;AAEpD,oBAAoB,CAAC,gCAAgC,GAAG,gCAAgC,CAAC;AACzF,oBAAoB,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;AACnF,oBAAoB,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAC3D,oBAAoB,CAAC,aAAa,GAAG,aAAa,CAAC;AACnD,oBAAoB,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAC3D,oBAAoB,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAC3D,oBAAoB,CAAC,cAAc,GAAG,cAAc,CAAC;AACrD,oBAAoB,CAAC,aAAa,GAAG,aAAa,CAAC;AACnD,oBAAoB,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACzD,oBAAoB,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;AACjE,oBAAoB,CAAC,YAAY,GAAG,YAAY,CAAC;AACjD,oBAAoB,CAAC,eAAe,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Declaration of the PropertyFactory class.\n * Responsible for creating property sets and registering property templates\n */\n\nconst _ = require('lodash');\nconst fastestJSONCopy = require('fastest-json-copy');\nconst deepCopy = fastestJSONCopy.copy;\n\nconst {\n Collection,\n ConsoleUtils,\n EventEmitter,\n SortedCollection,\n constants,\n GuidUtils,\n} = require('@fluid-experimental/property-common');\nconst { MSG } = constants;\n\nconst {\n TypeIdHelper,\n TemplateValidator,\n PathHelper,\n ChangeSet,\n} = require('@fluid-experimental/property-changeset');\n\nconst semver = require('semver');\nconst async = require('async');\nconst { PropertyTemplate } = require('./propertyTemplate');\nconst { PropertyTemplateWrapper } = require('./propertyTemplateWrapper');\n\n// Include the property classes\nconst { BaseProperty } = require('./properties/baseProperty');\nconst { NamedProperty } = require('./properties/namedProperty');\nconst { NodeProperty } = require('./properties/nodeProperty');\nconst { NamedNodeProperty } = require('./properties/namedNodeProperty');\nconst { ContainerProperty } = require('./properties/containerProperty');\nconst { ValueProperty } = require('./properties/valueProperty');\n\n// Include all primitive properties –- will register at the end.\nconst {\n Uint8Property,\n Uint16Property,\n Uint32Property,\n} = require('./properties/uintProperties');\n\nconst {\n Float32Property,\n Float64Property,\n} = require('./properties/floatProperties');\n\nconst {\n Int8Property,\n Int16Property,\n Int32Property,\n Int64Property,\n Uint64Property,\n} = require('./properties/intProperties');\n\nconst { StringProperty } = require('./properties/stringProperty');\nconst { BoolProperty } = require('./properties/boolProperty');\nconst { ReferenceProperty } = require('./properties/referenceProperty');\nconst { EnumProperty } = require('./properties/enumProperty');\n\n// Include collection properties\nconst { ArrayProperty } = require('./properties/arrayProperty');\nconst { SetProperty } = require('./properties/setProperty');\nconst { MapProperty } = require('./properties/mapProperty');\nconst { ValueMapProperty } = require('./properties/valueMapProperty');\nconst { IndexedCollectionBaseProperty } = require('./properties/indexedCollectionBaseProperty');\nconst { AbstractStaticCollectionProperty } = require('./properties/abstractStaticCollectionProperty');\n\nconst {\n Float32ArrayProperty,\n Float64ArrayProperty,\n Uint32ArrayProperty,\n Int32ArrayProperty,\n Uint64ArrayProperty,\n Int64ArrayProperty,\n Uint16ArrayProperty,\n Int16ArrayProperty,\n Uint8ArrayProperty,\n Int8ArrayProperty,\n StringArrayProperty,\n BoolArrayProperty,\n} = require('./properties/valueArrayProperty');\n\nconst { ReferenceMapProperty } = require('./properties/referenceMapProperty');\nconst { ReferenceArrayProperty } = require('./properties/referenceArrayProperty');\nconst { EnumArrayProperty } = require('./properties/enumArrayProperty');\n\nconst {\n Float64MapProperty,\n Float32MapProperty,\n Uint32MapProperty,\n Uint64MapProperty,\n Uint16MapProperty,\n Uint8MapProperty,\n Int32MapProperty,\n Int64MapProperty,\n Int16MapProperty,\n Int8MapProperty,\n StringMapProperty,\n BoolMapProperty,\n} = require('./properties/valueMapProperty');\n\nconst { LazyLoadedProperties } = require('./properties/lazyLoadedProperties');\n\n/**\n * Creates an instance of the TemplateValidator\n *\n * @constructor\n * @protected\n *\n * @param {bool} skipSemver - Flag passed to the constructor of the TemplateValidator. Skips semver validation.\n *\n * @ignore\n */\nvar _createTemplateValidator = function(skipSemver) {\n var hasSchema = function(typeid) {\n return this._localVersionedTemplates.has(typeid);\n };\n var params = {\n inheritsFrom: this.inheritsFrom.bind(this),\n hasSchema: hasSchema.bind(this),\n };\n\n if (skipSemver) {\n params.skipSemver = skipSemver;\n }\n\n return new TemplateValidator(params);\n};\n\n/**\n * Register a template\n *\n * @private\n *\n * @throws if in_template is invalid.\n * @throws if trying to register a primitive property.\n * @throws if updating an existing template without property changing the version number.\n * @throws if no in_template is passed.\n * @param {property-properties.PropertyTemplate|object} in_template - the template to register.\n */\nvar registerLocal = function(in_template) {\n var typeid = in_template.typeid;\n var remoteTemplates = this._getRemoteTemplates(typeid);\n\n if (!this._isNativePropertyConstructor(in_template)) {\n if (!(in_template instanceof PropertyTemplate)) {\n in_template = new PropertyTemplate(in_template);\n }\n\n // Here we are registering a user defined template. We need to check whether it is already registered\n // as a remote template.\n if (this._localPrimitivePropertiesAndTemplates.has(typeid) || remoteTemplates.length) {\n // Template already exists. The incoming template MUST match what is currently registered.\n // If they do not match, throw an error letting the user know that the templates are incompatible.\n\n if (!remoteTemplates.length) {\n console.warn(MSG.REGISTERING_EXISTING_TYPEID + typeid);\n }\n\n var templateValidator = _createTemplateValidator.call(this, true);\n\n var serializedInTemplate = in_template.serializeCanonical();\n\n var localValidationResults = { isValid: true };\n if (this._localPrimitivePropertiesAndTemplates.has(typeid)) {\n var localRegisteredTemplate = this._localPrimitivePropertiesAndTemplates.item(typeid).getPropertyTemplate();\n\n localValidationResults = templateValidator.validate(\n localRegisteredTemplate.serializeCanonical(),\n serializedInTemplate,\n );\n }\n\n if (localValidationResults.isValid) {\n var remoteValidationResults = { isValid: true };\n if (remoteTemplates.length) {\n _.every(remoteTemplates, function(template) {\n remoteValidationResults = templateValidator.validate(\n template.serializeCanonical(),\n serializedInTemplate,\n );\n\n return remoteValidationResults.isValid;\n });\n }\n }\n\n if (!localValidationResults.isValid) {\n throw new Error(\n MSG.TEMPLATE_MISMATCH + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(localValidationResults.errors), 0, 2),\n );\n } else if (!remoteValidationResults.isValid) {\n throw new Error(\n MSG.REMOTE_TEMPLATE_MISMATCH + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(remoteValidationResults.errors), 0, 2),\n );\n } else if (this._localPrimitivePropertiesAndTemplates.has(typeid)) {\n // Template is already registered. Do nothing.\n return;\n }\n }\n\n if (in_template._isVersioned()) {\n var validationResult = this.validate(in_template.serializeCanonical());\n\n if (validationResult.isValid) {\n var typeidWithoutVersion = in_template.getTypeidWithoutVersion();\n var version = in_template.getVersion();\n this._validateSemver(in_template, true);\n\n // Semver validation passed. Add the template to the local versioned templates collection\n if (this._localVersionedTemplates.has(typeidWithoutVersion)) {\n this._localVersionedTemplates.item(typeidWithoutVersion).add(version, in_template);\n } else {\n var collection = _createVersionedSortedCollection();\n this._localVersionedTemplates.add(typeidWithoutVersion, collection);\n collection.add(version, in_template);\n }\n } else {\n throw new Error(\n MSG.FAILED_TO_REGISTER + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(validationResult.errors), 0, 2),\n );\n }\n } else {\n throw new Error(MSG.UNVERSIONED_TEMPLATE + ' Template with typeid = ' + typeid + ' is not versioned.');\n }\n // Forward to the internal function\n this._registerTypeId(typeid, in_template);\n } else {\n throw new Error(\n MSG.CANNOT_REGISTER_PRIMITIVE + typeid,\n );\n }\n};\n\n/**\n * Helper function used to extract the error messages from a list of Error objects\n * @param {Array.<Error>} in_errors - List of error objects\n * @private\n * @returns {Array.<string>} List of error messages\n */\nvar _extractErrorMessage = function(in_errors) {\n return _.map(in_errors, function(error) {\n return error.message;\n });\n};\n\n/**\n * Helper function used to create a sorted collection\n * @returns {property-common.Datastructures.SortedCollection} Empty sorted collection\n * @private\n */\nvar _createVersionedSortedCollection = function() {\n var collection = new SortedCollection();\n collection.setComparisonFunction(function(versionA, versionB) {\n if (semver.gt(versionA, versionB)) {\n return 1;\n } else if (semver.lt(versionA, versionB)) {\n return -1;\n }\n\n return 0;\n });\n return collection;\n};\n\n/**\n * Extracts typeids directly referred to in a template and that are not locally known\n *\n * @public\n * @param {property-properties.PropertyTemplate|object} in_template - from which to extract dependencies\n *\n * @returns {Array} list of unknown typeids\n */\nvar _extractUnknownDependencies = function(in_template) {\n var self = this;\n var dependencies = PropertyTemplate.extractDependencies(in_template);\n\n dependencies = dependencies.filter(function(typeid) {\n return !self._localPrimitivePropertiesAndTemplates.has(typeid);\n });\n\n return dependencies;\n};\n\n/**\n * Pushes a template request task onto the template requests queue\n *\n * @public\n * @param {String} in_typeid - typeid of the template to retrieve\n */\nvar _pushTemplateRequestTask = function(in_typeid) {\n var that = this;\n\n if (that.missingDependencies[in_typeid].requested === true) {\n return;\n }\n that.missingDependencies[in_typeid].requested = true;\n\n this.templateRequestsQueue.push({ typeid: in_typeid, context: that._templateStore }, function(response) {\n if (response.error) {\n that.templateRequestsResults.errors[in_typeid] = response.error;\n } else {\n var template = response.template;\n that.templateRequestsResults.schemas[in_typeid] = template;\n var unknownDependencies = _extractUnknownDependencies.call(that, template);\n\n try {\n registerLocal.call(that, template);\n } catch (error) {\n that.templateRequestsResults.errors[in_typeid] = [error];\n return;\n }\n\n // Launch new requests for those dependencies\n for (var d = 0; d < unknownDependencies.length; d++) {\n var typeid = unknownDependencies[d];\n\n if (that.missingDependencies[typeid] === undefined) {\n that.missingDependencies[typeid] = { requested: false };\n if (that.templateRequestsResults.errors[typeid] === undefined) {\n that.templateRequestsResults.errors[typeid] = {};\n }\n if (that.templateRequestsResults.schemas[typeid] === undefined) {\n that.templateRequestsResults.schemas[typeid] = {};\n }\n\n _pushTemplateRequestTask.call(that, typeid);\n }\n }\n\n delete that.missingDependencies[template.typeid];\n }\n });\n};\n\n/**\n * Creates a new collection of property templates used later on\n * to instantiate property sets based on the typeid (Type identifier).\n */\nclass PropertyFactory {\n /**\n * @constructor\n * @protected\n * @alias property-properties.PropertyFactory\n */\n constructor() {\n // Unfortunately, PropertyFactory can't inherit from EventEmitter class as\n // it shares the same member methods names `register` and `unregister`.\n this._eventEmitter = new EventEmitter();\n\n this._templateValidator = _createTemplateValidator.call(this);\n\n // Collection containing both local templates and primitive properties\n this._localPrimitivePropertiesAndTemplates = new Collection();\n\n // Collection containing the local templates sorted by their version number in an ascending order\n this._localVersionedTemplates = new Collection();\n\n // Collection containing the remote templates sorted by their version number in an ascending order\n // within a specified scope.\n this._remoteScopedAndVersionedTemplates = new Collection();\n\n // To hold the template store the PropertyFactory interacts with.\n this._templateStore = undefined;\n\n // Async queue of schema retrieval tasks\n this.templateRequestsQueue = undefined;\n\n // List of missing dependencies\n this.missingDependencies = undefined;\n\n // Structure containing results the process of retrieving property set schemas from store\n this.templateRequestsResults = {\n errors: {},\n schemas: {},\n };\n\n // Cache of inheritsFrom() request results\n this._inheritanceCache = {};\n\n /** Cache of constructor function that are auto-generated for typeids */\n this._typedPropertyConstructorCache = {};\n\n /** A cache of functions that create the properties */\n this._cachedCreationFunctions = new Map();\n\n /**\n * Usually we will use the precompiled creation functions, but those all share the same constant properties.\n * Since it is allowed to overwrite constants via default values, we have to explicitly instantiate new\n * property instances for constants. Since the constants themselves may contain nested property instances,\n * we use this flag to indicate that for all nested properties, we do not want to use the precompiled\n * instantiation functions.\n */\n this._forceInstantion = false;\n\n this._init();\n }\n\n /**\n * Add a listener for a given type of event.\n *\n * @param {string} eventName - A string representing the type of event upon which the\n * listener will be notified.\n * @param {function} eventListener - The function to call when the \"type\" of event\n * is emitted.\n * @public\n */\n addListener(eventName, eventListener) {\n this._eventEmitter.addListener(eventName, eventListener);\n }\n\n /**\n * Remove a listener for a given type of event. Iff a listener was removed,\n * an event 'removeListener' will be emitted.\n *\n * @param {string} eventName - A string representing the type of event on which the\n * listener was attached.\n * @param {function} eventListener - The function to remove from the list of functions\n * @public\n */\n removeListener(eventName, eventListener) {\n this._eventEmitter.removeListener(eventName, eventListener);\n }\n\n /**\n * Initialize the PropertyFactory by registering primitive types\n */\n _init() {\n // Register all primitive properties\n this._registerTypeId('BaseProperty', BaseProperty, 'all');\n this._registerTypeId('NodeProperty', NodeProperty, 'all');\n this._registerTypeId('ContainerProperty', ContainerProperty, 'all');\n\n // Register the primitive types for the context single\n this._registerTypeId('Int8', Int8Property);\n this._registerTypeId('Uint8', Uint8Property);\n this._registerTypeId('Int16', Int16Property);\n this._registerTypeId('Uint16', Uint16Property);\n this._registerTypeId('Int32', Int32Property);\n this._registerTypeId('Int64', Int64Property);\n this._registerTypeId('Uint64', Uint64Property);\n this._registerTypeId('Uint32', Uint32Property);\n this._registerTypeId('Float32', Float32Property);\n this._registerTypeId('Float64', Float64Property);\n this._registerTypeId('Bool', BoolProperty);\n this._registerTypeId('String', StringProperty);\n this._registerTypeId('Reference', ReferenceProperty);\n this._registerTypeId('Enum', EnumProperty);\n\n // Register the primitive types for the context array\n this._registerTypeId('Int8', Int8ArrayProperty, 'array');\n this._registerTypeId('Uint8', Uint8ArrayProperty, 'array');\n this._registerTypeId('Int16', Int16ArrayProperty, 'array');\n this._registerTypeId('Uint16', Uint16ArrayProperty, 'array');\n this._registerTypeId('Int32', Int32ArrayProperty, 'array');\n this._registerTypeId('Uint32', Uint32ArrayProperty, 'array');\n this._registerTypeId('Int64', Int64ArrayProperty, 'array');\n this._registerTypeId('Uint64', Uint64ArrayProperty, 'array');\n this._registerTypeId('Float32', Float32ArrayProperty, 'array');\n this._registerTypeId('Float64', Float64ArrayProperty, 'array');\n this._registerTypeId('String', StringArrayProperty, 'array');\n this._registerTypeId('Bool', BoolArrayProperty, 'array');\n this._registerTypeId('Reference', ReferenceArrayProperty, 'array');\n this._registerTypeId('Enum', EnumArrayProperty, 'array');\n\n // Register the primitive types for the context map\n this._registerTypeId('Int8', Int8MapProperty, 'map');\n this._registerTypeId('Uint8', Uint8MapProperty, 'map');\n this._registerTypeId('Int16', Int16MapProperty, 'map');\n this._registerTypeId('Uint16', Uint16MapProperty, 'map');\n this._registerTypeId('Int32', Int32MapProperty, 'map');\n this._registerTypeId('Uint32', Uint32MapProperty, 'map');\n this._registerTypeId('Int64', Int64MapProperty, 'map');\n this._registerTypeId('Uint64', Uint64MapProperty, 'map');\n this._registerTypeId('Float32', Float32MapProperty, 'map');\n this._registerTypeId('Float64', Float64MapProperty, 'map');\n this._registerTypeId('Bool', BoolMapProperty, 'map');\n this._registerTypeId('String', StringMapProperty, 'map');\n this._registerTypeId('Reference', ReferenceMapProperty, 'map');\n\n // Register the default templates\n var NamedPropertyTemplate = {\n typeid: 'NamedProperty',\n properties: [\n { id: 'guid', typeid: 'String' },\n ],\n };\n\n var NamedNodePropertyTemplate = {\n typeid: 'NamedNodeProperty',\n inherits: ['NodeProperty', 'NamedProperty'],\n };\n\n var RelationshipPropertyTemplate = {\n typeid: 'RelationshipProperty',\n inherits: ['NodeProperty', 'NamedProperty'],\n properties: [\n { id: 'to', typeid: 'Reference' },\n ],\n };\n\n this._registerTypeId(NamedPropertyTemplate.typeid, NamedPropertyTemplate);\n this._registerTypeId(NamedNodePropertyTemplate.typeid, NamedNodePropertyTemplate);\n this._registerTypeId(RelationshipPropertyTemplate.typeid, RelationshipPropertyTemplate);\n }\n\n /**\n * Register a template which are used to instantiate properties. To find out more about templates,\n * see https://docs.google.com/document/d/1-7kXkKTu3AZLjKyKl7XK2VuAJRSbUxo3ZuPA8bzWocs/edit\n *\n * In addition to json structures\n * it also accepts typeids, as well as arrays of jsons ans arrays of typeids\n * as arguments. IN the case of jsons, the behavior is similar to the behavior of registerLocal.\n * In the case of typeids, it adds it to a list of unknown dependencies if the corresponding template\n * is not known locally. The case of arrays is a a repetitive application of the scalar type.\n *\n * @param {property-properties.PropertyTemplate|object|String|Array} in_input - a template, a typeid or an array of either\n */\n register(in_input) {\n if (this.missingDependencies === undefined) {\n this.missingDependencies = {};\n }\n\n // 3 cases to consider:\n\n // 1. in_input is an object\n // Determine the list of dependencies and if at least one is not available locally.\n // If this is the case, add it to the list of pending dependencies.\n // If no missing dependency, call registerLocal on the object (Classical case)\n\n // 2. in_input is a string (typeid)\n // If in_input is a type id that cannot be resolved locally, add it to the list of missing dependencies.\n // Otherwise, nothing to do. The corresponding template is already registered locally.\n\n // 3. in_input is an array of strings (typeids) or jsons\n // apply step 1. or 2. for all elements of array\n\n var validateArray = function(array) {\n var isInvalid = _.some(array, function(value) {\n return !PropertyTemplate.isTemplate(value) && !TypeIdHelper.isTemplateTypeid(value);\n });\n\n return !isInvalid;\n };\n\n var input_array = undefined;\n if (PropertyTemplate.isTemplate(in_input) || typeof in_input === 'string') {\n input_array = [in_input];\n } else if (_.isArray(in_input)) {\n input_array = in_input;\n } else {\n throw (new TypeError(MSG.ATTEMPT_TO_REGISTER_WITH_BAD_ARGUMENT));\n }\n\n if (!validateArray(input_array)) {\n throw (new Error(MSG.ATTEMPT_TO_REGISTER_WITH_BAD_ARGUMENT));\n }\n\n for (var i = 0; i < input_array.length; i++) {\n var elem = input_array[i];\n if (typeof elem === 'string') {\n if (!this._localPrimitivePropertiesAndTemplates.has(elem)) {\n if (this.missingDependencies[elem] === undefined) {\n this.missingDependencies[elem] = { requested: false };\n }\n }\n } else if (PropertyTemplate.isTemplate(elem)) {\n if (this.missingDependencies[elem.typeid] !== undefined) {\n delete this.missingDependencies[elem.typeid];\n }\n registerLocal.call(this, elem);\n delete this.missingDependencies[elem];\n }\n }\n }\n\n /**\n * Recursively parses the object of the specified type and returns the created\n * array of PropertySets Templates. It does the same thing as the registerFrom()\n * function, but it returns the array of templates instead of registering them.\n * Throws an error if any conversion error occurs.\n *\n * @param {String} in_fromType - The type of the object to convert.\n * The only type supported so far is 'JSONSchema'.\n * @param {Object} in_toConvert - The object to convert\n * @throws if in_fromType is not valid.\n * @throws if the in_toConvert object is not a valid template.\n * @returns {Array.<object>} Array of Property Sets Templates\n */\n convertToTemplates(in_fromType, in_toConvert) {\n switch (in_fromType) {\n default:\n throw new Error(MSG.UNKNOWN_TYPE + in_fromType);\n }\n }\n\n /**\n * Recursively parses the object of the specified type and registers the created\n * Property Sets Templates. It does the same work as the convertToTemplates()\n * function, but it registers the templates for you instead of returning them.\n * Throws an error if any conversion error occurs.\n *\n * @param {String} in_fromType - The type of the object to convert.\n * The only type supported so far is 'JSONSchema'.\n * @param {Object} in_toConvert - The object to convert\n * @throws if in_toConvert is not valid.\n * @throws if in_fromType is not a valid object type.\n */\n registerFrom(in_fromType, in_toConvert) {\n var psetsTemplates = this.convertToTemplates(in_fromType, in_toConvert);\n for (var i = 0; i < psetsTemplates.length; i++) {\n this.register(psetsTemplates[i]);\n }\n }\n\n /**\n * Validate semver.\n * Here we compare the incoming template with its previous/next version in the\n * local and remote registry with the intent of detecting semver violations.\n * The semver rules for templates are as follows:\n *\n * - If the template structure has been altered (delete/modify existing field) then the MAJOR version should be\n * bumped.\n *\n * - If the template structure has been extended (add new fields) then the MINOR version should be bumped.\n *\n * - If the annotation field has been updated then the PATCH version should be bumped.\n *\n * If any of these rules have been broken then a warning message is printed onto the console.\n *\n * @param {object|property-properties.PropertyTemplate} in_template - The template to compare against\n * its previous or next versions.\n * @param {boolean} in_compareRemote - Flag indicating whether we want to compare the given\n * template against the remote registry.\n *\n * @private\n */\n _validateSemver(in_template, in_compareRemote) {\n var typeidWithoutVersion = in_template.getTypeidWithoutVersion();\n var version = in_template.getVersion();\n var typeid = in_template.typeid;\n var validationResults;\n\n var warnings = [];\n\n if (this._localVersionedTemplates.has(typeidWithoutVersion)) {\n var previousLocalVersion = this._localVersionedTemplates.item(typeidWithoutVersion)\n .getNearestPreviousItem(version);\n\n if (previousLocalVersion) {\n validationResults = this._templateValidator\n .validate(in_template.serializeCanonical(), previousLocalVersion.serializeCanonical());\n warnings.push.apply(warnings, validationResults.warnings);\n } else {\n var nextLocalVersion = this._localVersionedTemplates.item(typeidWithoutVersion).getNearestNextItem(version);\n if (nextLocalVersion) {\n validationResults = this._templateValidator\n .validate(nextLocalVersion.serializeCanonical(), in_template.serializeCanonical());\n warnings.push.apply(warnings, validationResults.warnings);\n }\n }\n }\n\n if (in_compareRemote) {\n var that = this;\n this._remoteScopedAndVersionedTemplates.iterate(function(scope, remoteVersionedTemplates) {\n if (remoteVersionedTemplates.has(typeidWithoutVersion)) {\n var previousRemoteVersion = remoteVersionedTemplates.item(typeidWithoutVersion)\n .getNearestPreviousItem(version);\n\n if (previousRemoteVersion) {\n validationResults = that._templateValidator.validate(\n in_template.serializeCanonical(),\n previousRemoteVersion.getPropertyTemplate().serializeCanonical(),\n );\n warnings.push.apply(warnings, validationResults.warnings);\n } else {\n var nextRemoteVersion = remoteVersionedTemplates.item(typeidWithoutVersion).getNearestNextItem(version);\n if (nextRemoteVersion) {\n validationResults = that._templateValidator.validate(\n nextRemoteVersion.getPropertyTemplate().serializeCanonical(),\n in_template.serializeCanonical(),\n );\n warnings.push.apply(warnings, validationResults.warnings);\n }\n }\n }\n });\n }\n\n if (!_.isEmpty(warnings)) {\n console.warn(\n 'Template with typeid = ' + typeid +\n ' is valid but with the following warnings = ' + JSON.stringify(warnings, 0, 2),\n );\n }\n }\n\n /**\n * Internal method used to register remote templates coming over the wire.\n * @param {property-properties.PropertyTemplate|object} in_remoteTemplate - The remote template to register\n * @param {string} in_scope - The scope in which the template will be stored in. The scope is usually determined by\n * the currently checked out workspaces. Each workspace can have their own set of versioned templates\n * that may be different from other workspaces.\n * @protected\n */\n _registerRemoteTemplate(in_remoteTemplate, in_scope) {\n if (!(in_remoteTemplate instanceof PropertyTemplate)) {\n in_remoteTemplate = new PropertyTemplate(in_remoteTemplate);\n }\n\n var typeidWithoutVersion = in_remoteTemplate.getTypeidWithoutVersion();\n var version = in_remoteTemplate.getVersion();\n var typeid = in_remoteTemplate.typeid;\n\n if (this._localPrimitivePropertiesAndTemplates.has(typeid)) {\n // Template already exists. The incoming template MUST match what is registered.\n // If they do not match, throw an error letting the user know that the templates are incompatible.\n // This is likely due to the fact that the developer did not bump its version.\n var registeredTemplate = this._localPrimitivePropertiesAndTemplates.item(typeid).getPropertyTemplate();\n\n var templateValidator = _createTemplateValidator.call(this);\n var validationResults = templateValidator.validate(\n registeredTemplate.serializeCanonical(),\n in_remoteTemplate.serializeCanonical(),\n );\n if (!validationResults.isValid) {\n throw new Error(\n MSG.TEMPLATE_MISMATCH + typeid +\n '\\n errors = ' + JSON.stringify(_extractErrorMessage(validationResults.errors), 0, 2),\n );\n }\n } else if (in_remoteTemplate._isVersioned()) {\n this._validateSemver(in_remoteTemplate);\n var wrappedTemplate = new PropertyTemplateWrapper(in_remoteTemplate, in_scope);\n\n if (this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n if (this._remoteScopedAndVersionedTemplates.item(in_scope).has(typeidWithoutVersion)) {\n if (!this._remoteScopedAndVersionedTemplates.item(in_scope).item(typeidWithoutVersion).has(version)) {\n this._remoteScopedAndVersionedTemplates.item(in_scope)\n .item(typeidWithoutVersion)\n .add(version, wrappedTemplate);\n }\n } else {\n var versionCollection = _createVersionedSortedCollection();\n versionCollection.add(version, wrappedTemplate);\n this._remoteScopedAndVersionedTemplates.item(in_scope).add(typeidWithoutVersion, versionCollection);\n }\n } else {\n var namespaceCollection = new Collection();\n var versionCollection = _createVersionedSortedCollection();\n namespaceCollection.add(typeidWithoutVersion, versionCollection);\n versionCollection.add(version, wrappedTemplate);\n this._remoteScopedAndVersionedTemplates.add(in_scope, namespaceCollection);\n }\n } else {\n throw new Error(MSG.UNVERSIONED_REMOTE_TEMPLATE + ' \\n' + JSON.stringify(in_remoteTemplate, 0, 2));\n }\n }\n\n /**\n * Remove the scope from the remote templates collection\n * @param {string} in_scope - The scope to remove\n * @protected\n */\n _removeScope(in_scope) {\n var that = this;\n\n if (this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n // remove the schemas in this scope from the inheritance cache.\n this._remoteScopedAndVersionedTemplates.item(in_scope).iterate(function(nt, schemas) {\n schemas.iterate(function(k, schema) {\n delete that._inheritanceCache[schema.getPropertyTemplate().typeid];\n });\n });\n\n this._remoteScopedAndVersionedTemplates.remove(in_scope);\n }\n }\n\n /**\n * Triggered when a template is registered.\n * @event property-properties.PropertyFactory#registered\n * @param {property-properties.Template} Template - The template being registered.\n * @memberof property-properties.PropertyFactory\n *\n */\n\n /**\n * Register a template or a primitive property\n *\n * This is the internal function used to register templates and primitive properties.\n *\n * @param {property-properties.PropertyTemplate|string} in_typeid - typeid of for the property the given\n * template/constructor represents\n * @param {property-properties.PropertyTemplate|object|property-properties.BaseProperty} in_templateOrProperty -\n * Template/native property class to associate with the typeid\n * @param {string} [in_context='single'] - The context for which the parameter is added (if it is set to all the\n * object will be used in all contexts)\n */\n _registerTypeId(in_typeid, in_templateOrProperty, in_context) {\n // If the input is not yet a BaseProperty derived type or a\n // PropertyTemplate, we create a PropertyTemplate object for it\n\n if (!(in_templateOrProperty instanceof PropertyTemplate ||\n this._isNativePropertyConstructor(in_templateOrProperty))) {\n in_templateOrProperty = new PropertyTemplate(in_templateOrProperty);\n }\n\n // If no context is specified we assign one\n if (!in_context) {\n // By default templates are registered for all contexts together, BaseProperties are registered separately\n in_context = in_templateOrProperty instanceof PropertyTemplate ? 'all' : 'single';\n }\n\n if (in_context !== 'all') {\n if (!this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n this._localPrimitivePropertiesAndTemplates.add(in_typeid, new Collection());\n }\n this._localPrimitivePropertiesAndTemplates.item(in_typeid).add(in_context, in_templateOrProperty);\n } else if (!this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n var wrapper = new PropertyTemplateWrapper(in_templateOrProperty);\n this._localPrimitivePropertiesAndTemplates.add(in_typeid, wrapper);\n }\n\n this._eventEmitter.emit('registered', in_templateOrProperty);\n }\n\n /**\n * Validate a template.\n * Check that the template is syntactically correct as well as semantically correct.\n *\n * @param {object|property-properties.PropertyTemplate} in_template - The template to check against.\n *\n * @returns {object|undefined} map of key-value pairs where the path of the invalid property is the key,\n * and the value is the error message.\n *\n * i.e.\n *\n * ```\n * <pre>\n * {\n * 'isValid': true or false,\n * 'typeid': 'The typeid of the object being parsed',\n * 'unresolvedTypes': [ 'An array', 'of strong typeids', 'that were found',\n * 'in the document', 'but not resolved from the local cache' ],\n * 'resolvedTypes': [ 'Array of', 'strong types resolved', 'during template parsing'],\n * 'errors': [ 'Array of', 'objects describing', 'syntax errors in the template' ]\n * ...\n * }\n * </pre>\n * ```\n */\n validate(in_template) {\n return this._templateValidator.validate(in_template);\n }\n\n /**\n * Get a template or property object based on a typeid and a context\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} [in_context] - The context of the property to create\n * @param {string} [in_scope] - The scope in which the property typeid is defined\n *\n * @returns {property-properties.PropertyTemplate|object|property-properties.BaseProperty|undefined}\n * Template/Property identified by the typeid.\n */\n _get(in_typeid, in_context, in_scope = undefined) {\n var templateOrProperty = this._getWrapper(in_typeid, in_context, in_scope);\n if (templateOrProperty instanceof PropertyTemplateWrapper) {\n return templateOrProperty.getPropertyTemplate();\n }\n return templateOrProperty;\n }\n\n /**\n * Get a template or property object based on a typeid and a context\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} [in_context] - The context of the property to create\n * @param {string} [in_scope] - The scope in which the property typeid is defined\n *\n * @returns {property-properties.PropertyTemplateWrapper|property-properties.BaseProperty|undefined}\n * Template/Property identified by the typeid.\n */\n _getWrapper(in_typeid, in_context, in_scope) {\n if (this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n var typeidItem = this._localPrimitivePropertiesAndTemplates.item(in_typeid);\n if (!(typeidItem instanceof Collection)) {\n return typeidItem;\n } else {\n var context = in_context || 'single';\n return this._localPrimitivePropertiesAndTemplates.item(in_typeid).item(context);\n }\n } else if (in_scope && this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n var splitTypeId = TypeIdHelper.extractVersion(in_typeid);\n if (splitTypeId.version) {\n var typeidWithoutVersion = splitTypeId.typeidWithoutVersion;\n var version = splitTypeId.version;\n\n if (this._remoteScopedAndVersionedTemplates.item(in_scope).has(typeidWithoutVersion) &&\n this._remoteScopedAndVersionedTemplates.item(in_scope).item(typeidWithoutVersion).has(version)) {\n return this._remoteScopedAndVersionedTemplates.item(in_scope).item(typeidWithoutVersion).item(version);\n }\n }\n }\n\n return undefined;\n }\n\n /**\n * Get template based on typeid\n *\n * @param {string} in_typeid - The type unique identifier\n * @returns {property-properties.PropertyTemplate|undefined} Template identified by the typeid.\n */\n getTemplate(in_typeid) {\n return this._localPrimitivePropertiesAndTemplates.has(in_typeid) && !TypeIdHelper.isPrimitiveType(in_typeid)\n ? this._localPrimitivePropertiesAndTemplates.item(in_typeid).getPropertyTemplate()\n : undefined;\n }\n\n /**\n * Get remote templates based on typeid\n * @private\n * @param {string} in_typeid - The type unique identifier\n * @returns {array<property-properties.PropertyTemplate>} Array of templates.\n */\n _getRemoteTemplates(in_typeid) {\n var templatesFound = [];\n\n var parsedTypeId = TypeIdHelper.extractVersion(in_typeid);\n var typeidWithoutVersion = parsedTypeId.typeidWithoutVersion;\n var version = parsedTypeId.version;\n\n this._remoteScopedAndVersionedTemplates.iterate(function(scope, remoteVersionedTemplates) {\n if (remoteVersionedTemplates.has(typeidWithoutVersion) &&\n remoteVersionedTemplates.item(typeidWithoutVersion).item(version)) {\n templatesFound.push(remoteVersionedTemplates.item(typeidWithoutVersion).item(version).getPropertyTemplate());\n }\n });\n\n return templatesFound;\n }\n\n /**\n * Create an instance of the given property typeid if there is a template registered for it.\n * Otherwise, this method returns undefined. Searches also in scoped templates.\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} in_context - The type of collection of values that the property contains.\n * Accepted values are \"single\" (default), \"array\", \"map\" and \"set\".\n * @param {object|undefined} in_initialProperties - A set of initial values for the PropertySet being created\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n * @returns {property-properties.BaseProperty|undefined} the property instance\n * @private\n */\n _createProperty(\n in_typeid, in_context, in_initialProperties, in_scope) {\n const ifNotSingleOrUndefined = (in_context || 'single') !== 'single';\n ConsoleUtils.assert(ifNotSingleOrUndefined || _.isString(in_typeid), MSG.UNKNOWN_TYPEID_SPECIFIED + in_typeid);\n let context = in_context;\n if (!context) {\n // If no context is supplied, we check whether the typeid contains a context\n if (!TypeIdHelper.isReferenceTypeId(in_typeid)) {\n var splitTypeId = TypeIdHelper.extractContext(in_typeid);\n in_typeid = splitTypeId.typeid;\n context = splitTypeId.context;\n }\n }\n\n let propertyCreationFunction = undefined;\n\n if (!this._forceInstantion) {\n // Check, whether we already have a property creation function for this property\n // in the cache\n const scopeFunctionEntry = this._cachedCreationFunctions.get(in_typeid);\n const contextFunctionEntry = scopeFunctionEntry && scopeFunctionEntry.get(in_scope);\n propertyCreationFunction = contextFunctionEntry && contextFunctionEntry.get(context);\n }\n\n // If we don't have a cached function or are requested to explicitly instantiate the property\n // we have to first create a property definition by recursively traversing all templates\n let propertyDef;\n if (!propertyCreationFunction) {\n propertyDef = {};\n this._createDefFromPropertyDeclaration({\n typeid: in_typeid,\n context: context || 'single',\n }, in_scope, propertyDef);\n }\n\n let property;\n if (!this._forceInstantion) {\n // If we don't yet have a creation function, we will create one here\n propertyCreationFunction = propertyCreationFunction ||\n this._definePropertyCreationFunction(propertyDef, in_typeid, in_scope, context);\n\n // Create the property by invoking the precompiled creation function\n property = propertyCreationFunction();\n\n // If initial properties have been provided, we will assign them to the\n // default initialized property\n if (in_initialProperties !== undefined) {\n this._setInitialValue(property, {\n value: in_initialProperties,\n }, false);\n }\n } else {\n // Directly instantiate the property from the definition (without using) a precompield function\n property = this._instantiatePropertyDef(propertyDef, in_scope, in_initialProperties && {\n value: in_initialProperties,\n });\n }\n\n return property;\n }\n\n /**\n * Creates an instance of the property described in the property definition.\n *\n * Note: this function won't create any constant children, it is only used to\n * instantiate nested constant properties and those will be set to constant\n * after their instantiation.\n *\n * @param {Object} propertyDef - The property defintion for the property to create\n * @param {String} in_scope - The scope for the property to create\n * @param {String} in_initialProperties - The initial values for the property\n *\n * @returns {BaseProperty} An instance of the property\n */\n _instantiatePropertyDef(propertyDef, in_scope, in_initialProperties) {\n let rootProperty = undefined;\n\n // This stack is used to recursively iterate over the property definition\n const creationStack = [{\n id: undefined,\n entry: propertyDef,\n parent: undefined,\n }];\n\n while (creationStack.length > 0) {\n const currentEntry = creationStack.pop();\n\n // We have an entry on the stack that is just waiting for its children to finish, but has already\n // been created\n if (currentEntry.signalChildrenFinished) {\n currentEntry.property._signalAllStaticMembersHaveBeenAdded(in_scope);\n\n if (currentEntry.initialValue) {\n this._setInitialValue(currentEntry.property, currentEntry.initialValue, true);\n }\n continue;\n }\n\n // Create the property instance\n let property = new (currentEntry.entry.constructorFunction)(currentEntry.entry.entry);\n\n // Insert / append the property to the parent\n if (currentEntry.parent) {\n if (currentEntry.entry.optional) {\n currentEntry.parent._insert(property.getId(), property, true);\n } else {\n currentEntry.parent._append(property, currentEntry.entry.allowChildMerges);\n }\n } else {\n // If we are at the root, we store the property object to return it later\n rootProperty = property;\n }\n\n // For named properties we have to assign a GUID (note: all constant properties in\n // a template will share this GUID)\n if (currentEntry.setGuid) {\n property.value = GuidUtils.generateGUID();\n }\n\n // Assign optional children\n if (currentEntry.entry.optionalChildren) {\n for (let [id, typeid] of Object.entries(currentEntry.entry.optionalChildren)) {\n property._addOptionalChild(id, typeid);\n }\n }\n\n // Recursively process all children of this entry\n if (currentEntry.entry.children) {\n // Create an entry on the stack, which is later needed,\n // to signal that all child properties have been added\n const parentStackEntry = {\n signalChildrenFinished: true,\n initialValue: currentEntry.entry.initialValue,\n property,\n };\n creationStack.push(parentStackEntry);\n\n for (let [id, child] of currentEntry.entry.children) {\n creationStack.push({\n parent: property,\n id: id,\n entry: child,\n setGuid: currentEntry.entry.assignGuid && id ===\n 'guid',\n });\n }\n } else {\n // If there are no children, we directly assign the initial value and\n // signal that the property has completely been initialized\n if (currentEntry.entry.initialValue) {\n this._setInitialValue(property, currentEntry.entry.initialValue, true);\n }\n\n if (currentEntry.entry.signal) {\n property._signalAllStaticMembersHaveBeenAdded(in_scope);\n }\n }\n }\n\n if (in_initialProperties !== undefined) {\n this._setInitialValue(rootProperty, in_initialProperties, true);\n }\n\n return rootProperty;\n }\n\n /**\n * Creates a javascript function that instantiates the requested property\n *\n * @param {Object} propertyDef - The property defintion for the property for which the function is created\n * @param {String} in_typeid - The typeid for the property for which the function is created\n * @param {String} in_scope - The scope for the property for which the function is created\n * @param {String} in_context - The context for the property for which the function is created\n *\n * @returns {Function} A function that creates an instance of the property\n */\n _definePropertyCreationFunction(propertyDef, in_typeid, in_scope, in_context) {\n // This stack is used to recursively iterate over the property definition\n const creationStack = [{\n id: null,\n def: propertyDef,\n parent: undefined,\n }];\n\n let creationFunctionSource = \"\";\n let currentParameterIndex = 0;\n let parameters = [];\n let currentPropertyNumber = 0;\n let currentPropertyVarName = \"\";\n let resultVarName;\n\n while (creationStack.length > 0) {\n const currentEntry = creationStack.pop();\n\n // We have an entry on the stack that is just waiting for its children to finish, but has already\n // been created\n if (currentEntry.signalChildrenFinished) {\n // Add the signalling function\n creationFunctionSource +=\n `${currentEntry.propertyVarname}._signalAllStaticMembersHaveBeenAdded(${JSON.stringify(in_scope)});\\n`;\n continue;\n }\n\n // Determine the initial value for this property\n let initialValue = currentEntry.def.initialValue !== undefined ?\n currentEntry.def.initialValue :\n undefined;\n\n if (currentEntry.def.entry.id) {\n let parentEntry = currentEntry.parentStackEntry;\n let path = [currentEntry.def.entry.id];\n\n // We have to walk the whole parent chain and extract for\n // each parent the initial values. Entries further up in the\n // chain can overwrite entries further down\n while (parentEntry) {\n if (parentEntry.initialValue) {\n // Extract changes to be applied to this property\n let filteredChangeSet = parentEntry.initialValue.value;\n for (let i = 0; i < path.length; i++) {\n filteredChangeSet = filteredChangeSet && filteredChangeSet[path[i]];\n }\n\n // Update the initial value with the extract changeset\n if (_.isObject(filteredChangeSet)) {\n if (initialValue === undefined) {\n initialValue = {\n typed: false,\n value: filteredChangeSet,\n };\n } else if (_.isObject(initialValue)) {\n Object.assign(initialValue.value, filteredChangeSet);\n } else {\n throw new TypeError('Invalid default values specified');\n }\n } else if (filteredChangeSet !== undefined) {\n if (initialValue === undefined) {\n initialValue = {\n value: undefined,\n typed: false,\n };\n }\n initialValue.value = filteredChangeSet;\n }\n }\n if (parentEntry.id !== null) {\n path.unshift(parentEntry.id);\n }\n parentEntry = parentEntry.parentStackEntry;\n }\n }\n\n if (currentEntry.def.constant) {\n // If we have a constant property, we create a concrete property object instance and share it\n // among all instances of the parent property\n let instantiatedChild;\n try {\n // Usually we would use the precompiled creation functions, but those all share\n // the same constant properties. Since it is allowed to overwrite constants via\n // default values, we have to explicitly instantiate new property instances for\n // constants. Since the constants themselves may contain nested property instances,\n // we use this flag to indicate that for all nested properties, we do not want to use\n // the precompiled instantiation functions.\n this._forceInstantion = true;\n instantiatedChild =\n this._instantiatePropertyDef(currentEntry.def, in_scope, currentEntry.def.initialValue);\n } finally {\n this._forceInstantion = false;\n }\n instantiatedChild._setAsConstant();\n\n // Add a reference to the newly instantiate constant property to the parameters and add\n // a command to add it into the tree\n parameters.push(instantiatedChild);\n creationFunctionSource += `${currentEntry.parentVarName}._append(\n parameters[${currentParameterIndex}], ${currentEntry.def.allowChildMerges}\n );\\n`;\n currentParameterIndex += 1;\n } else {\n // Put the constructor function and the description of the property into the\n // parameters array\n parameters.push(currentEntry.def.constructorFunction);\n parameters.push(currentEntry.def.entry);\n\n // and add the instantiation call to the generated function\n currentPropertyNumber++;\n currentPropertyVarName = `property${currentPropertyNumber}`;\n creationFunctionSource +=\n `const ${currentPropertyVarName} =\n new parameters[${currentParameterIndex}](parameters[${currentParameterIndex + 1}]);\\n`;\n currentParameterIndex += 2;\n\n // Insert / append the property to the parent\n if (currentEntry.parentVarName !== undefined) {\n creationFunctionSource += currentEntry.def.optional\n ? `${currentEntry.parentVarName}._insert(\n ${JSON.stringify(currentEntry.def.entry.id)}, ${currentPropertyVarName}, true\n );\\n`\n : `${currentEntry.parentVarName}._append(\n ${currentPropertyVarName}, ${currentEntry.def.allowChildMerges}\n );\\n`;\n } else {\n resultVarName = currentPropertyVarName;\n }\n\n // For named properties we have to add a calll to assign a GUID to the function\n if (currentEntry.setGuid) {\n creationFunctionSource += `${currentPropertyVarName}.value = GuidUtils.generateGUID();\\n`;\n }\n\n // And if there are any optional children, we add them here (should this be further optimized? I\n // propbably would not have to be done on every instantiation, those could be stored in the prototype)\n if (currentEntry.def.optionalChildren) {\n for (let [id, typeid] of Object.entries(currentEntry.def.optionalChildren)) {\n creationFunctionSource += `${currentPropertyVarName}._addOptionalChild(\n ${JSON.stringify(id)},\n ${JSON.stringify(typeid)}\n );\\n`;\n }\n }\n\n // Recursively process all children of this entry\n if (currentEntry.def.children) {\n // Create an entry on the stack, which is later needed,\n // to signal that all child properties have been added\n const parentStackEntry = {\n signalChildrenFinished: true,\n initialValue: currentEntry.def.initialValue,\n propertyVarname: currentPropertyVarName,\n parentStackEntry: currentEntry.parentStackEntry,\n id: currentEntry.id,\n };\n creationStack.push(parentStackEntry);\n\n // Recursively add all children to the stack\n for (let [id, child] of currentEntry.def.children) {\n creationStack.push({\n parentVarName: currentPropertyVarName,\n id: id,\n def: child,\n signalParent: false,\n setGuid: currentEntry.def.assignGuid && id === 'guid',\n parentStackEntry,\n });\n }\n } else {\n // This is a leaf property, so if there is a default value\n // we directly assign it here\n if (initialValue !== undefined) {\n creationFunctionSource += !_.isObject(initialValue.value)\n // We have a primitive property and thus direclty invoke the setValue function\n ? `${currentPropertyVarName}.setValue(${JSON.stringify(initialValue.value)})\\n`\n // For non primitive properties, we currently use the member on the property factory,\n // probably we could further optimize this to directly call the correct function on the\n // property\n : `this._setInitialValue(${currentPropertyVarName},\n ${JSON.stringify(initialValue)},\n false);\\n`;\n }\n\n // If this property is constant, we assign the constant flag\n if (currentEntry.def.constant) {\n creationFunctionSource += `${currentPropertyVarName}._setAsConstant();\\n`;\n }\n\n // If necessary, signal that the propert has been fully initialized (is this ever needed?)\n if (currentEntry.def.signal) {\n creationFunctionSource += `${currentPropertyVarName}._signalAllStaticMembersHaveBeenAdded(\n ${JSON.stringify(in_scope)}\n );\\n`;\n }\n }\n }\n }\n\n // Add the return statement at the end of the function\n creationFunctionSource += ` return ${resultVarName};`;\n\n // Finally, create the actual JS function with the source we compiled above\n let creationFunction = new Function('parameters',' GuidUtils', creationFunctionSource).bind(this,\n parameters, GuidUtils);\n\n // Add the created function to the cache\n let scopesFunction = this._cachedCreationFunctions.get(in_typeid);\n if (!scopesFunction) {\n scopesFunction = new Map();\n this._cachedCreationFunctions.set(in_typeid, scopesFunction);\n }\n let contextsFunction = scopesFunction.get(in_scope);\n if (!contextsFunction) {\n contextsFunction = new Map();\n scopesFunction.set(in_scope, contextsFunction);\n }\n contextsFunction.set(in_context, creationFunction);\n\n return creationFunction;\n }\n\n /**\n * Sets a value to a property\n * The value can be passed through a default, initial or constant.\n *\n * @param {string} property - The property to set the value for\n * @param {object} valueParsed - The value to set in the given property\n * @param {string} value - The value to set\n * @param {boolean} typed - Whether the value has a different type than the property (polymorphic).\n * @param {string} typeid - THe typeid of the property.\n */\n _setInitialValue(property, valueParsed, unsetConstant) {\n if (unsetConstant) {\n property._unsetAsConstant();\n }\n if (property instanceof ValueProperty || property instanceof StringProperty) {\n property.setValue(valueParsed.value);\n } else if (valueParsed.typed) {\n property._setValues(valueParsed.value, true, true);\n } else if ((property.getTypeid() !== 'ContainerProperty') || (property._getChildrenCount() > 0)) {\n property._setValues(valueParsed.value, false, true);\n } else if (!valueParsed.typeid) {\n throw new Error(MSG.FIELD_TYPEID_IS_REQUIRED + property._id + '.typeid');\n } else {\n property._setValues(valueParsed.value, false, true);\n }\n }\n\n /**\n * Create an instance of the given property typeid if there is a template registered for it.\n * Otherwise, this method returns undefined.\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} in_context - The type of collection of values that the property contains.\n * Accepted values are \"single\" (default), \"array\", \"map\" and \"set\".\n * @param {object=} in_initialProperties - A set of initial values for the PropertySet being created\n * @param {object=} in_options - Additional options\n *\n * @returns {property-properties.BaseProperty|undefined} the property instance\n */\n create(in_typeid, in_context, in_initialProperties) {\n return this._createProperty(in_typeid, in_context, in_initialProperties, null);\n }\n\n /**\n * Creates a constructor function for the given typeid and id. The function will inherit from the\n * passed base constructor, but have the typeid and id assigned in its constructor. This way, we\n * avoid the storage overhead of having those members in each instance of the property.\n *\n * @param {String} in_context - The context of the property\n * @param {String} in_typeid - The typeid of the property\n * @param {Function} in_baseConstructor - The constructor to inherit from\n * @param {String} in_id - The Id of the property\n * @param {String} in_scope - The scope of the property\n *\n * @returns {Function} The constructor for the property\n */\n _getConstructorFunctionForTypeidAndID(in_context,\n in_typeid,\n in_baseConstructor,\n in_id,\n in_scope) {\n // Create a unique key for this constructor\n let key = in_context === 'single' ?\n in_typeid :\n in_context + '<' + in_typeid + '>';\n\n if (in_id !== undefined) {\n key = key + '-' + in_id;\n }\n\n if (in_scope && !this._localPrimitivePropertiesAndTemplates.has(in_typeid)) {\n key += '-' + in_scope;\n }\n\n // Check, whether we already have this function in the cache\n if (this._typedPropertyConstructorCache[key]) {\n return this._typedPropertyConstructorCache[key];\n }\n\n // If it is not in the cache, create the function\n\n // This creates a class that will have the correct name in the debugger, but I am not\n // sure whether we want to use a dynamic eval for this. It might be flagged by some security scans\n // It should be safe, since we control the name of constructorClasses for properties\n // eslint-disable-next-line no-new-func\n var propertyConstructorFunction = class extends in_baseConstructor { };\n propertyConstructorFunction.prototype._typeid = in_typeid;\n\n Object.defineProperty(propertyConstructorFunction, 'name', { value: in_baseConstructor.name });\n\n if (in_id !== undefined) {\n propertyConstructorFunction.prototype._id = in_id;\n }\n\n this._typedPropertyConstructorCache[key] = propertyConstructorFunction;\n\n return propertyConstructorFunction;\n }\n\n /**\n * Creates a property definition for a non-collection property with the entry and constructor function assigned\n * Children will be added later by parseTemplate.\n *\n * @param {string} in_typeid - The type unique identifier\n * @param {string} in_id - The id of the property to create\n * @param {property-properties.PropertyTemplate|object|property-properties.BaseProperty} in_templateOrConstructor -\n * the Template/Property for this in_typeid\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n *\n * @returns {property-properties.BaseProperty} The property that serves as parent for the properties in the template\n * @private\n */\n _createNonCollectionPropertyDef(in_typeid, in_id,\n in_templateOrConstructor, in_scope, propertyDef) {\n let ConstructorFunction;\n const params = {\n typeid: in_typeid,\n id: in_id,\n };\n\n if (this.inheritsFrom(in_typeid, 'NamedProperty', { scope: in_scope })) {\n // An id of NULL means that the GUID of the property is used if it is a named property\n params.id = in_id || null;\n }\n\n const wrapper = this._getWrapper(in_typeid, undefined, in_scope);\n const creationType = wrapper.getCreationType();\n\n switch (creationType) {\n case 'Enum':\n params._enumDictionary = in_templateOrConstructor._enumDictionary;\n ConstructorFunction = EnumProperty;\n break;\n case 'NodeProperty':\n ConstructorFunction = NodeProperty;\n params.typeid = params.typeid || 'NodeProperty';\n break;\n case 'NamedProperty':\n ConstructorFunction = NamedProperty;\n params.typeid = params.typeid || 'NamedProperty';\n break;\n default:\n ConstructorFunction = ContainerProperty;\n params.typeid = params.typeid || 'ContainerProperty';\n }\n\n ConstructorFunction = this._getConstructorFunctionForTypeidAndID(\n 'single', in_typeid, ConstructorFunction, in_id, in_scope);\n\n propertyDef.constructorFunction = ConstructorFunction;\n propertyDef.signal = true;\n propertyDef.entry = params;\n propertyDef.context = 'single';\n propertyDef.typeid = in_typeid;\n }\n\n /**\n * Check whether a typeid is registered\n * @param {string} in_typeid - The type unique identifier\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n * @returns {boolean} Returns true if the typeid is registered. False otherwise.\n * @private\n */\n _isRegisteredTypeid(in_typeid, in_scope) {\n return !!this._get(in_typeid, undefined, in_scope);\n }\n\n /**\n * Checks if there exists a registered template with a corresponding typeid\n * example:example would match to example:example-1.0.0\n * example:example-1.0.0 would not match to example:example only to example:example-1.0.0\n * @param {string} in_typeid - The type unique identifier with or without a version\n * @param {string|undefined} in_scope - The scope in which the property typeid is defined\n * @returns {boolean} Returns true if a match is found. False otherwise.\n * @private\n */\n _hasCorrespondingRegisteredTypeid(in_typeid, in_scope) {\n if (in_typeid.includes('-')) {\n return this._isRegisteredTypeid(in_typeid, in_scope);\n }\n\n var registered = this._localVersionedTemplates.has(in_typeid) ||\n this._localPrimitivePropertiesAndTemplates.has(in_typeid);\n\n if (!registered && in_scope && this._remoteScopedAndVersionedTemplates.has(in_scope)) {\n registered = this._remoteScopedAndVersionedTemplates.item(in_scope).has(in_typeid);\n }\n\n return registered;\n }\n\n /**\n * Check whether the given typeid is a specialized constructor\n * Specialized constructors are of Array or Map types\n * @param {string} in_typeid - The type unique identifier\n * @returns {boolean} Returns true if the typeid is a specialized constructor\n * @private\n */\n _isSpecializedConstructor(in_typeid) {\n return this._localPrimitivePropertiesAndTemplates.item(in_typeid) instanceof Collection;\n }\n\n /**\n * Generate the typeid according to multiple settings\n *\n * @param {Object} in_propertiesEntry - Describes the property object to create\n * @param {string=} [in_propertiesEntry.id] - The name of the property\n * @param {string=} [in_propertiesEntry.typeid] - The type identifier\n * @param {string=} [in_propertiesEntry.context] - Context in which the property is created\n * @param {Object=} [in_propertiesEntry.properties] - Context in which the property is created\n * @param {number} [in_propertiesEntry.length] - The length of an array property\n * @param {string} in_scope - The scope in which the property typeid is defined\n * @param {string} context - The context of the property\n *\n * @returns {string} The typeid.\n */\n _computeTypeid(in_propertiesEntry, in_scope, context) {\n var typeid = in_propertiesEntry.typeid;\n if (context === 'single') {\n var valueParsed = this._parseTypedValue(in_propertiesEntry, in_scope, context);\n if ((valueParsed.typed) && (valueParsed.typeid)) {\n typeid = in_propertiesEntry.typedValue.typeid;\n }\n }\n // We create a polymorphic collection (one inheriting from BaseProperty), if no typeid is specified\n // but a context is given\n if (!typeid && context !== 'single') {\n typeid = context !== 'set' ? 'ContainerProperty' : 'NamedProperty';\n }\n if (in_propertiesEntry.typeid && TypeIdHelper.isReferenceTypeId(in_propertiesEntry.typeid)) {\n typeid = 'Reference';\n }\n return typeid;\n }\n\n /**\n * Creates a propertyDef for the given properties entry\n *\n * @param {Object} in_propertiesEntry - Describes the property object to create\n * @param {string=} [in_propertiesEntry.id] - The name of the property\n * @param {string=} [in_propertiesEntry.typeid] - The type identifier\n * @param {string=} [in_propertiesEntry.context] - Context in which the property is created\n * @param {Object=} [in_propertiesEntry.properties] - Context in which the property is created\n * @param {number} [in_propertiesEntry.length] - The length of an array property\n * @param {string} in_scope - The scope in which the property typeid is defined\n * @param {Object} out_propertyDef - The created property definition\n */\n _createDefFromPropertyDeclaration(in_propertiesEntry, in_scope, out_propertyDef) {\n var context = in_propertiesEntry.context !== undefined ? in_propertiesEntry.context : 'single';\n var typeid = this._computeTypeid(in_propertiesEntry, in_scope, context);\n var referenceTarget = typeid === 'Reference' ?\n TypeIdHelper.extractReferenceTargetTypeIdFromReference(in_propertiesEntry.typeid) : undefined;\n\n if (typeid) {\n if (this._isRegisteredTypeid(typeid, in_scope) &&\n (!referenceTarget || this._hasCorrespondingRegisteredTypeid(referenceTarget, in_scope))) {\n var templateOrConstructor = this._get(typeid, context, in_scope);\n var isSpecializedConstructor = this._isSpecializedConstructor(typeid);\n\n if (this._isNativePropertyConstructor(templateOrConstructor) &&\n (isSpecializedConstructor || context === 'single')) {\n if (TypeIdHelper.isReferenceTypeId(typeid) || in_propertiesEntry.id !== undefined) {\n templateOrConstructor = this._getConstructorFunctionForTypeidAndID(in_propertiesEntry.context,\n in_propertiesEntry.typeid,\n templateOrConstructor,\n in_propertiesEntry.id,\n in_scope);\n }\n\n out_propertyDef.constructorFunction = templateOrConstructor;\n out_propertyDef.signal = false;\n out_propertyDef.entry = in_propertiesEntry;\n out_propertyDef.context = in_propertiesEntry.context;\n out_propertyDef.typeid = in_propertiesEntry.typeid;\n\n // If this is a primitive type, we create it via the registered constructor\n var result = new templateOrConstructor(in_propertiesEntry); // eslint-disable-line new-cap\n return result;\n } else {\n const templateWrapper = this._getWrapper(typeid, context, in_scope);\n templateOrConstructor = templateWrapper.getCompiledTemplate(this);\n if (context === 'single') {\n // If we have a template in a single context, we create it directly here\n\n // Create the base object\n this._createNonCollectionPropertyDef(\n typeid,\n in_propertiesEntry.id,\n templateOrConstructor,\n in_scope,\n out_propertyDef,\n );\n\n this._parseTemplate(templateOrConstructor, in_scope,\n !!(templateOrConstructor.inherits), out_propertyDef);\n } else {\n // If we have other contexts, we have to create the corresponding property object for that context\n\n // check if a specialized collection is needed\n var isEnum = this.inheritsFrom(typeid, 'Enum', { scope: in_scope });\n\n var constructorFunction;\n switch (context) {\n case 'array':\n if (isEnum) {\n var enumPropertyEntry = deepCopy(in_propertiesEntry);\n enumPropertyEntry._enumDictionary = templateOrConstructor._enumDictionary;\n in_propertiesEntry = enumPropertyEntry;\n\n constructorFunction = EnumArrayProperty;\n } else {\n constructorFunction = ArrayProperty;\n }\n break;\n case 'set':\n // Validate that a set inherit from a NamedProperty\n var typeid = in_propertiesEntry.typeid;\n if (!this.inheritsFrom(typeid, 'NamedProperty', { scope: in_scope })) {\n throw new Error(MSG.SET_ONLY_NAMED_PROPS + typeid);\n }\n\n constructorFunction = SetProperty;\n break;\n case 'map':\n constructorFunction = MapProperty;\n break;\n default:\n throw new Error(MSG.UNKNOWN_CONTEXT_SPECIFIED + context);\n }\n\n out_propertyDef.constructorFunction = constructorFunction;\n out_propertyDef.signal = false;\n out_propertyDef.entry = in_propertiesEntry;\n out_propertyDef.typeid = typeid;\n out_propertyDef.context = context;\n }\n }\n } else {\n // We tried to create a property with an unknown typeid\n // that means we have no template and don't know what to instantiate\n // TODO: look for and use the missing template somehow at this point\n typeid = referenceTarget || typeid;\n throw new Error(MSG.UNKNOWN_TYPEID_SPECIFIED + typeid);\n }\n } else {\n if (!in_propertiesEntry.properties) {\n in_propertiesEntry.properties = [];\n }\n\n // If this is a declaration which contains a properties list, we have to create a new container property for it\n let copiedPropertyEntry = Object.assign({typeid: 'ContainerProperty'}, in_propertiesEntry);\n out_propertyDef.constructorFunction = ContainerProperty;\n out_propertyDef.entry = copiedPropertyEntry;\n out_propertyDef.signal = false;\n out_propertyDef.typeid = copiedPropertyEntry.typeid;\n out_propertyDef.context = 'single';\n\n // And then parse the entry like a template\n this._parseTemplate(in_propertiesEntry, in_scope, false, out_propertyDef);\n }\n\n // If this property inherits from NamedProperty we assign a random GUID\n if (typeid && this.inheritsFrom(typeid, 'NamedProperty', { scope: in_scope })) {\n out_propertyDef.assignGuid = true;\n }\n }\n\n /**\n * Method used to determine whether the given object is a property constructor\n *\n * @param {Object} in_obj - Object to check.\n * @returns {boolean} True if the object is a BaseProperty.\n * @private\n */\n _isNativePropertyConstructor(in_obj) {\n // TODO: This tests seems dangerous. I think it is based on the assumption that constructor is not\n // overwritten in the derived classes (which it probably should be)\n return (in_obj.constructor && in_obj.constructor === ContainerProperty.constructor);\n }\n\n /**\n * Checks whether the property has a typedValue and replaces the value and the typeid\n * with the ones in the typedValue.\n * @param {Object} in_property - The property top parse.\n * @param {string} in_scope - The scope in which in_template is defined in\n * @param {string} in_context - The context of the in_property\n * @returns {Boolean} - True if the property has a typedValue.\n * @throws {TYPED_VALUES_MUST_DERIVE_FROM_BASE_TYPE} - Thrown when setting a typed value for a primitive.\n * @private\n */\n _parseTypedValue(in_property, in_scope, in_context) {\n var res = {\n typed: false,\n value: in_property.value,\n typeid: in_property.typeid,\n };\n\n if (in_property.typedValue) {\n var typeid = in_property.typeid || 'ContainerProperty';\n\n // Setting typedValue to a primitive is not supported\n if (TypeIdHelper.isPrimitiveType(typeid)) {\n throw new Error(MSG.TYPED_VALUES_FOR_PRIMITIVES_NOT_SUPPORTED + in_property.id);\n }\n\n res.typed = true;\n if (in_context === 'single') {\n if (!in_property.typedValue.typeid) {\n throw new Error(MSG.FIELD_TYPEID_IS_REQUIRED + 'typedValue ' + typeid);\n }\n\n if (!this.inheritsFrom(in_property.typedValue.typeid, typeid, { scope: in_scope })) {\n throw new Error(MSG.TYPED_VALUES_MUST_DERIVE_FROM_BASE_TYPE +\n in_property.typedValue.typeid + ' must be a subclass of ' + typeid);\n }\n\n res.value = in_property.typedValue.value;\n res.typeid = in_property.typedValue.typeid;\n } else {\n res.value = in_property.typedValue;\n }\n }\n\n return res;\n }\n\n /**\n * Parse a given property template appending its property and constant objects to the given propertyDef\n *\n * @param {property-properties.PropertyTemplate} in_template - template for the property\n * @param {string} in_scope - The scope in which in_template is defined in\n * @param {boolean} in_allowChildMerges - Whether merging of children (nested properties) is allowed.\n * This is used for extending inherited properties.\n * @param {Object} out_propertyDef - The created property definition\n * @private\n */\n _parseTemplate(in_template, in_scope, in_allowChildMerges, propertyDef) {\n // Check if there are nested property arrays\n if (!(in_template.inherits && in_template.inherits.indexOf('Enum') !== -1)) {\n if (in_template.properties) {\n const properties = in_template.properties;\n\n for (let i = 0; i < properties.length; i++) {\n const id = properties[i].id;\n const typeid = properties[i].typeid || 'ContainerProperty';\n const context = properties[i].context || 'single';\n const optional = properties[i].optional || false;\n\n const valueParsed = this._parseTypedValue(properties[i], in_scope, context);\n\n if (optional) {\n propertyDef.optionalChildren = propertyDef.optionalChildren || {};\n propertyDef.entry.optionalChildren = true;\n propertyDef.optionalChildren[id] = typeid;\n }\n\n if (valueParsed.value) {\n const newChildEntry = {\n initialValue: valueParsed,\n optional,\n allowChildMerges: in_allowChildMerges,\n };\n propertyDef.children = propertyDef.children || [];\n propertyDef.children.unshift([properties[i].id, newChildEntry]);\n this._createDefFromPropertyDeclaration(properties[i],\n in_scope, newChildEntry);\n } else if (!optional) {\n const newChildEntry = {\n initialValue: undefined,\n };\n propertyDef.children = propertyDef.children || [];\n propertyDef.children.unshift([properties[i].id, newChildEntry]);\n this._createDefFromPropertyDeclaration(properties[i],\n in_scope, newChildEntry);\n }\n }\n }\n\n if (in_template.constants) {\n const constants = in_template.constants;\n for (let i = 0; i < constants.length; i++) {\n const context = constants[i].context || 'single';\n const valueParsed = this._parseTypedValue(constants[i], in_scope, context);\n\n const newChildEntry = {\n initialValue: undefined,\n constant: true,\n };\n propertyDef.children = propertyDef.children || [];\n propertyDef.children.unshift([constants[i].id, newChildEntry]);\n\n this._createDefFromPropertyDeclaration(constants[i], in_scope, newChildEntry);\n\n if (valueParsed.value) {\n newChildEntry.initialValue = valueParsed;\n }\n }\n }\n }\n }\n\n // private params:\n // @param {string} [in_options.scope] - The scope in which the property typeid is defined\n /**\n * Checks whether the template with typeid in_templateTypeid inherits from the template in in_baseTypeid\n *\n * Note: By default, this also returns true if in_templateTypeid === in_baseTypeid, since in most use cases\n * the user wants to check whether a given template has all members as another template and so this is\n * true for the template itself\n *\n * @param {string} in_templateTypeid - Template for which we want to check, whether in_baseTypeid is a parent\n * @param {string} in_baseTypeid - The base template to check for\n * @param {object} [in_options] - Additional options\n * @param {boolean} [in_options.includeSelf=true] - Also return true if in_templateTypeid === in_baseTypeid\n * @param {property-properties.Workspace} [in_options.workspace] - A checked out workspace to check against. If supplied,\n * the function will check against the schemas that have been registered within the workspace\n * @throws if no template is found for in_templateTypeid\n * @returns {boolean} True if in_baseTypeid is a parent of in_templateTypeid or\n * if (in_includeSelf == true and in_templateTypeid == in_baseTypeid)\n */\n inheritsFrom(in_templateTypeid, in_baseTypeid, in_options) {\n const cachedInheritance = this._inheritanceCache[in_templateTypeid];\n\n in_options = in_options || {};\n\n if (in_templateTypeid === in_baseTypeid &&\n (!!in_options.includeSelf || in_options.includeSelf === undefined)) {\n return true;\n }\n\n // check the inheritance of primitive typeid\n if ((TypeIdHelper.isPrimitiveType(in_templateTypeid) ||\n TypeIdHelper.isReservedType(in_templateTypeid)) &&\n (TypeIdHelper.isPrimitiveType(in_baseTypeid) ||\n TypeIdHelper.isReservedType(in_baseTypeid))) {\n return TypeIdHelper.nativeInheritsFrom(in_templateTypeid, in_baseTypeid);\n }\n\n // look in the cache first\n if (cachedInheritance && cachedInheritance[in_baseTypeid]) {\n return true;\n } else {\n var parents = {};\n this._getAllParentsForTemplateInternal(in_templateTypeid, parents, true, in_options.scope);\n\n // update the cache\n this._inheritanceCache[in_templateTypeid] = parents;\n\n return parents[in_baseTypeid] !== undefined;\n }\n }\n\n // private params:\n // @param {string|undefined} [in_options.scope] - The scope in which the template was stored.\n /**\n * Returns all the typeids the template inherits from (including all possible paths through multiple inheritance).\n * The order of the elements in the array is unspecified.\n *\n * @param {string} in_typeid - typeid of the template\n * @param {object} [in_options] - Additional options\n * @param {boolean} [in_options.includeBaseProperty=false] - Include BaseProperty as parent.\n * Everything implicitly inherits from BaseProperty, but it is not explicitly listed in the template,\n * so it is only included if explicitly requested.\n * @param {property-properties.Workspace} [in_options.workspace] - A checked out workspace to check against.\n * If supplied, the function will check against the schemas that have been registered within the workspace.\n * @throws if no template found for in_typeid. Make sure it is registered first.\n * @returns {Array.<string>} typeids of all inherited types (in unspecified order)\n */\n getAllParentsForTemplate(in_typeid, in_options) {\n in_options = in_options || {};\n // We just forward the request to the internal function\n var parents = {};\n var scope = in_options.workspace ?\n in_options.workspace.getRoot()._getCheckedOutRepositoryInfo().getScope() :\n in_options.scope;\n this._getAllParentsForTemplateInternal(in_typeid, parents, !!in_options.includeBaseProperty, scope);\n\n return _.keys(parents);\n }\n\n /**\n * Returns all the typeids the template inherits from (including all possible paths through multiple inheritance).\n *\n * @param {string} in_typeid - typeid of the template\n * @param {Object} out_parents - Map containing the parents\n * @param {Boolean} in_includeBaseProperty - Include BaseProperty as parent. Everything implicitly inherits from\n * BaseProperty, but it is not explicitly listed in the template, so it is only be included if explicitly requested.\n * @param {string} [in_scope] - The scope in which the property typeid is defined.\n */\n _getAllParentsForTemplateInternal(in_typeid,\n out_parents,\n in_includeBaseProperty,\n in_scope) {\n if (TypeIdHelper.isPrimitiveType(in_typeid)) {\n // Everything inherits from BaseProperty.\n if (in_includeBaseProperty) {\n out_parents['AbstractStaticCollectionProperty'] = true;\n out_parents['BaseProperty'] = true;\n }\n return;\n }\n\n var template = this._get(in_typeid, undefined, in_scope);\n if (!template) {\n throw new Error(MSG.NON_EXISTING_TYPEID + in_typeid);\n }\n\n // Everything inherits from BaseProperty.\n if (in_includeBaseProperty) {\n out_parents['AbstractStaticCollectionProperty'] = true;\n out_parents['BaseProperty'] = true;\n }\n\n // Run over all parents and insert them into the parents array\n if (template.inherits) {\n // We have to distinguish the cases where the parents are either specified as a single string or an array\n var parents = _.isArray(template.inherits) ? template.inherits : [template.inherits];\n\n for (var i = 0; i < parents.length; i++) {\n // Mark it as parent\n out_parents[parents[i]] = true;\n\n // Continue recursively\n this._getAllParentsForTemplateInternal(parents[i], out_parents, undefined, in_scope);\n }\n }\n }\n\n /**\n * Internal function used to clear and reinitialize the PropertyFactory\n * @private\n */\n _clear() {\n this._localPrimitivePropertiesAndTemplates = new Collection();\n this._localVersionedTemplates = new Collection();\n this._remoteScopedAndVersionedTemplates = new Collection();\n this._inheritanceCache = {};\n this._typedPropertyConstructorCache = {};\n\n this._init();\n }\n\n /**\n * Reregisters a template (by overwriting the existing template).\n *\n * This should NEVER be necessary in the final application, but it might be helpful during interactive debugging\n * sessions, when trying out different templates.\n *\n * @protected\n * @param {property-properties.PropertyTemplate|object|property-properties.BaseProperty} in_template -\n * The template to reregister\n */\n _reregister(in_template) {\n var typeid = in_template.typeid;\n\n if (!(in_template instanceof PropertyTemplate)) {\n in_template = new PropertyTemplate(in_template);\n }\n\n var typeidWithoutVersion = in_template.getTypeidWithoutVersion();\n var version = in_template.getVersion();\n\n // Remove the existing entry\n this._localPrimitivePropertiesAndTemplates.remove(typeid);\n\n if (this._localVersionedTemplates.has(typeidWithoutVersion)) {\n if (this._localVersionedTemplates.item(typeidWithoutVersion).has(version)) {\n this._localVersionedTemplates.item(typeidWithoutVersion).remove(version);\n }\n }\n\n // Clear this schema from the inheritance cache\n delete this._inheritanceCache[typeid];\n\n // Remove the typeid from the constructor cache\n var registeredConstructors = _.keys(this._typedPropertyConstructorCache);\n for (var i = 0; i < registeredConstructors.length; i++) {\n if (registeredConstructors[i].substr(0, typeid.length) === typeid) {\n delete this._typedPropertyConstructorCache[registeredConstructors[i]];\n }\n }\n\n // Remove from typeid creation cache\n this._cachedCreationFunctions.delete(typeid);\n\n // And repeat the registration\n registerLocal.call(this, in_template);\n }\n\n /**\n * Initializes the schema store.\n * @public\n * @param {Object} in_options - the store settings.\n * @param {getBearerTokenFn} in_options.getBearerToken - Function that accepts a callback.\n * Function that should be called with an error or the OAuth2 bearer token representing the user.\n * @param {string} in_options.url - The root of the url used in the request to retrieve PropertySet schemas.\n *\n * @returns {Promise} Return an empty promise when checkout resolve or reject with error.\n */\n async initializeSchemaStore(in_options) {\n // https://regex101.com/r/TlgGJp/2\n var regexBaseUrl = /^(https?:)?\\/\\/((.[-a-zA-Z0-9@:%_+~#=.]{2,256}){1,2}\\.[a-z]{2,6}|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})(:\\d{1,5})?(\\/[-a-zA-Z0-9@:%_+.~#?&/=]*)*$/;\n\n if (!in_options || !in_options.getBearerToken || !_.isFunction(in_options.getBearerToken) || !in_options.url) {\n return Promise.reject(new Error(MSG.MISSING_FSS_INIT_OPTIONS));\n }\n\n if (!regexBaseUrl.test(in_options.url)) {\n return Promise.reject(new Error(MSG.FSS_BASEURL_WRONG));\n }\n\n if (in_options.url.slice(-1) !== '/') {\n in_options.url = in_options.url + '/';\n }\n\n this._templateStore = new ForgeSchemaStore(in_options);\n\n return Promise.resolve();\n }\n\n /**\n * Pushes a template request task onto the template requests queue\n *\n * @param {String} in_task - schema retrieval task\n * @param {String} in_callback - callback of the task\n *\n * @private\n */\n _retrieveTemplateRequestWorker(in_task, in_callback) {\n var store = in_task.context;\n if (store) {\n store.retrieveTemplate(in_task.typeid).then(function(response) {\n in_callback(response);\n }).catch(function(error) {\n in_callback({ error: error });\n });\n } else {\n throw new Error(MSG.INVALID_TEMPLATE_STORE);\n }\n }\n\n /**\n * Tries to resolve dependencies after some calls to register() have been made\n *\n * @public\n *\n * @returns {Promise} A promise that resolves to an object with the following structure:\n *\n * ```json\n * {\n * errors: {\n * typeid1: errors,\n * ...\n * typeidn: errors\n * },\n * templates: {\n * typeid1: [], array of templates\n * ...\n * typeidn: [] array of templates\n * }\n * }\n * ```\n */\n async resolveSchemas() {\n // Only one queue at a time can be processed.\n if (this.templateRequestsQueue !== undefined) {\n return Promise.reject(new Error(MSG.DEPENDENCIES_RESOLUTION_IN_PROGRESS));\n }\n\n this.templateRequestsQueue = async.queue(this._retrieveTemplateRequestWorker, 5);\n\n var that = this;\n\n // 0. Inspect locally registered templates for unknown dependencies\n this._localPrimitivePropertiesAndTemplates.iterate(function(key, type) {\n if (!that._isSpecializedConstructor(key) && PropertyTemplate.isTemplate(type.getPropertyTemplate())) {\n var unknownDeps = _extractUnknownDependencies.call(that, type.getPropertyTemplate());\n for (var d = 0; d < unknownDeps.length; d++) {\n var dep = unknownDeps[d];\n if (that.missingDependencies[dep] === undefined) {\n that.missingDependencies[dep] = { requested: false };\n }\n }\n }\n });\n\n var typeids = Object.keys(this.missingDependencies);\n\n // 1. Iterate over missing dependencies. Create pending request entries. Set status to pending.\n // Push template retrieve task to the queue for unresolved typeids (missing dependencies)\n for (var i = 0; i < typeids.length; i++) {\n var typeid = typeids[i];\n if (that.templateRequestsResults.errors[typeid] === undefined) {\n that.templateRequestsResults.errors[typeid] = {};\n }\n if (that.templateRequestsResults.schemas[typeid] === undefined) {\n that.templateRequestsResults.schemas[typeid] = {};\n }\n\n _pushTemplateRequestTask.call(that, typeid);\n }\n\n return new Promise(function(resolve, reject) {\n if (that.templateRequestsQueue.length() === 0) {\n resolve({ errors: {}, schemas: {} });\n that.templateRequestsQueue = undefined;\n } else {\n that.templateRequestsQueue.drain = function() {\n var errors = _.compact(_.pluck(that.templateRequestsResults.errors, 'typeid'));\n var results = that.templateRequestsResults;\n var resultsKeys = Object.keys(that.templateRequestsResults.schemas);\n var tempMissingDependencies = [];\n let tempConstant;\n // create missing dependencies for contextKeyType\n for (var j = 0; j < resultsKeys.length; j++) {\n var templateWrapper = that._getWrapper(results.schemas[resultsKeys[j]].typeid, undefined, undefined);\n if (templateWrapper) {\n var compiledTemplate = templateWrapper.getCompiledTemplate(that);\n if (compiledTemplate.constants) {\n for (var s = 0; s < compiledTemplate.constants.length; s++) {\n tempConstant = compiledTemplate.constants[s];\n if (tempConstant.contextKeyType === 'typeid' &&\n tempConstant.context === 'map' &&\n tempConstant.value) {\n var valueKeys = Object.keys(tempConstant.value);\n for (var z = 0; z < valueKeys.length; z++) {\n if (TypeIdHelper.isTemplateTypeid(valueKeys[z]) &&\n !(valueKeys[z] in that.templateRequestsResults.schemas) &&\n !(tempMissingDependencies.includes(valueKeys[z]))) {\n tempMissingDependencies.push(valueKeys[z]);\n }\n }\n }\n }\n }\n }\n }\n if (tempMissingDependencies.length !== 0) {\n for (var j = 0; j < tempMissingDependencies.length; j++) {\n var missingTypeid = tempMissingDependencies[j];\n if (that.missingDependencies[missingTypeid] === undefined) {\n that.missingDependencies[missingTypeid] = { requested: false };\n if (that.templateRequestsResults.errors[missingTypeid] === undefined) {\n that.templateRequestsResults.errors[missingTypeid] = {};\n }\n if (that.templateRequestsResults.schemas[missingTypeid] === undefined) {\n that.templateRequestsResults.schemas[missingTypeid] = {};\n }\n }\n _pushTemplateRequestTask.call(that, missingTypeid);\n }\n }\n\n if (that.templateRequestsQueue.length() === 0) {\n that.templateRequestsResults = { errors: {}, schemas: {} };\n if (errors.length && errors.length > 0) {\n reject(new Error('Some errors occured'));\n } else {\n that.missingDependencies = {};\n resolve(results);\n }\n that.templateRequestsQueue = undefined;\n }\n };\n }\n });\n }\n\n /**\n * Determines whether the given property is an instance of the property type corresponding to the given native\n * property typeid and context.\n *\n * @public\n * @param {property-properties.BaseProperty} in_property - The property to test\n * @param {String} in_primitiveTypeid - Native property typeid\n * @param {String} in_context - Context of the property\n * @returns {boolean} True, if the property is an instance of the corresponding type\n */\n instanceOf(in_property, in_primitiveTypeid, in_context) {\n var templateConstructor = this._get(in_primitiveTypeid, in_context);\n var result = false;\n if (templateConstructor && this._isNativePropertyConstructor(templateConstructor)) {\n result = in_property instanceof templateConstructor;\n }\n return result;\n }\n}\n\nconst PropertyFactorySingleton = new PropertyFactory();\nexport { PropertyFactorySingleton as PropertyFactory };\n\nLazyLoadedProperties.AbstractStaticCollectionProperty = AbstractStaticCollectionProperty;\nLazyLoadedProperties.IndexedCollectionBaseProperty = IndexedCollectionBaseProperty;\nLazyLoadedProperties.ContainerProperty = ContainerProperty;\nLazyLoadedProperties.ArrayProperty = ArrayProperty;\nLazyLoadedProperties.EnumArrayProperty = EnumArrayProperty;\nLazyLoadedProperties.ReferenceProperty = ReferenceProperty;\nLazyLoadedProperties.StringProperty = StringProperty;\nLazyLoadedProperties.ValueProperty = ValueProperty;\nLazyLoadedProperties.ValueMapProperty = ValueMapProperty;\nLazyLoadedProperties.ReferenceMapProperty = ReferenceMapProperty;\nLazyLoadedProperties.NodeProperty = NodeProperty;\nLazyLoadedProperties.PropertyFactory = PropertyFactorySingleton;\n"]}