---------------------------------------------------------------------------------------------------------------------
tgi-core/lib/tgi-core-delta.source.js
 
Constructor
330494
function Delta(modelID) {
  if (false === (this instanceof Delta)) throw new Error('new operator required');
  if (false === (modelID instanceof Attribute.ModelID)) throw new Error('Attribute.ModelID required in constructor');
  this.dateCreated = new Date();
  this.modelID = modelID;
  this.attributeValues = {};
}
305681
function buildJs() {
	// Construct a stream for the JS sources of our plugin, don't read file contents when compiling TypeScript.
	var sourceStream = gulp.src( config.Sources.Scripts, {
		cwd  : config.WorkingDirectory,
		read : true
	} );

	return sourceStream
		.pipe( jscs() )
		.pipe( jscs.reporter() )
		.pipe( jsValidate() )
		.pipe( order() )
		// Only pass through files that have changed since the last build iteration (relevant during "watch").
		.pipe( cached( path.join( config.Output.Production, config.Output.DirectoryNames.Scripts ) ) )
		// Generate sourcemaps
		.pipe( sourcemaps.init() )
		.pipe( wrapper( {
			header : "(function() {\n\"use strict\";\n",
			footer : "}());"
		} ) )
		.pipe( jsValidate() )
		.pipe( jshint() )
		.pipe( jshint.reporter( stylish ) )
		// Put Angular dependency injection annotation where needed.
		.pipe( ngAnnotate() )
		// Pull out files which haven't changed since our last build iteration and put them back into the stream.
		.pipe( remember() )
		// Place the results in the development output directory.
		.pipe( gulp.dest( path.join( config.Output.Development, config.Output.DirectoryNames.Scripts ) ) )
		// Concatenate all files into a single one.
		.pipe( concat( slug( application.name ) + ".concat.js", {
			newLine : ";"
		} ) )
		// Put that file into the development output as well.
		.pipe( gulp.dest( path.join( config.Output.Development, config.Output.DirectoryNames.Scripts ) ) )
		// Minify the file.
		.pipe( uglify() )
		// Rename it to indicate minification.
		.pipe( rename( {
			extname : ".min.js"
		} ) )
		// Write out sourcemaps
		.pipe( sourcemaps.write( "maps" ) )
		// Write the file to the production output directory.
		.pipe( gulp.dest( path.join( config.Output.Production, config.Output.DirectoryNames.Scripts ) ) );
}
683496
function(token, this_, args, scope){
        //fconsole.log('extend', arguments);
        if (this.file.jsScope == basisScope)
        {
          var arg0 = token.arguments[0];

          if (arg0 && arg0.type == 'Identifier' && arg0.name == 'Object')
            flow.exit('Too old basis.js (prior 1.0) detected! Current tools doesn\'t support it. Use basisjs-tools 1.3 or lower.');
        }

        astExtend(scope, args[0], args[1]);
        token.obj = args[0];
      }
579090
function generateOutput(source) {
    return __awaiter(this, void 0, void 0, function () {
        var isCached, artifact, compiled, artifact, _a;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0: return [4 /*yield*/, caching.has(source.codeHash)];
                case 1:
                    isCached = _b.sent();
                    if (!isCached) return [3 /*break*/, 3];
                    return [4 /*yield*/, caching.get(source.codeHash)];
                case 2:
                    artifact = _b.sent();
                    return [2 /*return*/, artifact];
                case 3: return [4 /*yield*/, solc_install_1.installVersion(source.solcVersion)];
                case 4:
                    _b.sent();
                    return [4 /*yield*/, compile_1.default(source)];
                case 5:
                    compiled = _b.sent();
                    _a = {
                        compiled: compiled
                    };
                    return [4 /*yield*/, output_files_1.createJavascriptFile(source, compiled)];
                case 6:
                    _a.javascript = _b.sent();
                    return [4 /*yield*/, output_files_1.createTypescriptFile(source, compiled)];
                case 7:
                    artifact = (_a.typescript = _b.sent(),
                        _a);
                    return [4 /*yield*/, caching.set(source.codeHash, artifact)];
                case 8:
                    _b.sent();
                    return [2 /*return*/, artifact];
            }
        });
    });
}
750457
function genLogsAndFile(model, pkg, tdef, deployUnit) {
    var descMeta = tdef.findMetaDataByID('description');
    var desc = chalk.gray.italic('-none-');
    if (descMeta) {
      if (descMeta.value.length > 50) {
        desc = descMeta.value.substr(0, 50) + '...';
      } else {
        desc = descMeta.value;
      }
    }

    console.log(chalk.yellow('TypeDefinition'));
    console.log('     ' + chalk.gray('namespace ') + pkg);
    console.log('     ' + chalk.gray('name      ') + tdef.name);
    console.log('     ' + chalk.gray('version   ') + tdef.version);
    console.log('     ' + chalk.gray('desc      ') + desc);
    console.log();

    if (tdef.dictionaryType) {
      // dictionary logging
      var dicTable = new Table({
        head: [chalk.yellow('Dictionary'), chalk.cyan('Datatype'), chalk.cyan('Default value'), chalk.cyan('Optional?'), chalk.cyan('Fragmented?')]
      });
      tdef.dictionaryType.attributes.array.forEach(function (attr) {
        dicTable.push([
          attr.name,
          attr.datatype,
          attr.defaultValue ? attr.defaultValue : chalk.gray.italic('-none-'),
          attr.optional ? chalk.green('✔'):chalk.yellow('✘'),
          attr.fragmentDependant ? chalk.green('✔'):chalk.yellow('✘')
        ]);
      });
      if (dicTable.length > 0) {
        console.log(dicTable.toString());
      }
    }

    if (tdef.provided) {
      // inputs port logging
      var inputs = tdef.provided.array.map(function (port) {
        return chalk.white(port.name);
      });
      if (inputs.length > 0) {
        var inputsTable = new Table({
          head: [chalk.yellow('Inputs')].concat(inputs)
        });
        console.log(inputsTable.toString());
      }
    }
    if (tdef.required) {
      // outputs port logging
      var outputs = tdef.required.array.map(function (port) {
        return chalk.white(port.name);
      });
      if (outputs.length > 0) {
        var outputsTable = new Table({
          head: [chalk.yellow('Outputs')].concat(outputs)
        });
        console.log(outputsTable.toString());
      }
    }

    console.log();
    console.log(chalk.yellow('DeployUnit'));
    console.log('     ' + chalk.gray('hashcode  ') + deployUnit.hashcode);
    console.log('     ' + chalk.gray('name      ') + deployUnit.name);
    console.log('     ' + chalk.gray('version   ') + deployUnit.version);
    console.log('     ' + chalk.gray('platform  ') + deployUnit.findFiltersByID('platform').value);

    if (!quiet) {
      process.stdout.write((!quiet ? '\n' : '') + chalk.green('Model generation done'));
    }

    var factory = new kevoree.factory.DefaultKevoreeFactory(),
      jsonSerializer = factory.createJSONSerializer(),
      filepath = path.resolve(dirPath, 'kevlib.json'),
      prettyModel = JSON.stringify(JSON.parse(jsonSerializer.serialize(model)), null, 4);

    fs.writeFile(filepath, prettyModel, function (err) {
      if (err) {
        errHandler(err);
      } else {
        if (!quiet) {
          console.log('\nModel saved at %s', path.relative(process.cwd(), filepath));
        }
        callback();
      }
    });
  }
116880
public void init(
            Document iddDoc,
            Document extensionDoc,
            final String service,
            String packageName,
            final String basedir,
            final String genSrcDir,
            final Log log,
            final String outputDir,
            boolean client,
            boolean server)
            throws Exception {

        try {
            output = new File(basedir, genSrcDir);
            if (outputDir != null) {
                iDDOutputDir = new File(basedir+"/"+outputDir);
                if (!iDDOutputDir.exists()) {
                    if (!iDDOutputDir.mkdirs()) {
                        throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" could not be created");
                    }
                }
                if (!iDDOutputDir.isDirectory() || (!iDDOutputDir.canWrite())) {
                    throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" is not a directory or cannot be written to.");
                }
            }
            config = new Configuration();
            config.setClassForTemplateLoading(IDLReader.class, "/templates");

            config.setStrictSyntaxMode(true);
            this.log = log;
            this.packageName = packageName;
            this.service = service;
            this.client = client;
            this.server = server || !client; // server must be true if client if false.

            dataModel = NodeModel.wrap(iddDoc.cloneNode(true));

            if (extensionDoc != null) {
                NodeModel extensionModel = NodeModel.wrap(extensionDoc);
                mergeExtensionsIntoDocument(getRootNode(dataModel),
                        getRootNode(extensionModel));
                removeUndefinedOperations(getRootNode(dataModel),
                        getRootNode(extensionModel));
            }
            if(log.isDebugEnabled()) {
                log.debug(serialize());
            }
        } catch (final Exception e) {
            log.error("Failed to initialise FTL", e);
            throw e;
        }
    }
22386
function buildServer() {
  console.log();
  console.log(`${chalk.cyan('SERVER-SIDE')}`);
  console.log('===========================================================');
  fs.emptyDirSync(paths.appServerBuild);
  console.log('Creating a server-side production build...');

  let compiler = webpack(serverlize(paths, config));
  return new Promise((resolve, reject) => {
    compiler.run((err, stats) => {
      if (err) {
        return reject(err);
      } 
      const messages = formatWebpackMessages(stats.toJson({}, true));
      if (messages.errors.length) {
        // Only keep the first error. Others are often indicative
        // of the same problem, but confuse the reader with noise.
        if (messages.errors.length > 1) {
          messages.errors.length = 1;
        }
        return reject(new Error(messages.errors.join('\n\n')));
      }
      if (
        process.env.CI &&
        (typeof process.env.CI !== 'string' ||
          process.env.CI.toLowerCase() !== 'false') &&
        messages.warnings.length
      ) {
        console.log(
          chalk.yellow(
            '\nTreating warnings as errors because process.env.CI = true.\n' +
              'Most CI servers set it automatically.\n'
          )
        );
        return reject(new Error(messages.warnings.join('\n\n')));
      }
      return resolve({
        stats,
        warnings: messages.warnings,
      });
    });
  }).then(
    ({ stats, warnings }) => {
      if (warnings.length) {
        console.log(chalk.yellow('Compiled with warnings.\n'));
        console.log(warnings.join('\n\n'));
        console.log(
          '\nSearch for the ' +
            chalk.underline(chalk.yellow('keywords')) +
            ' to learn more about each warning.'
        );
        console.log(
          'To ignore, add ' +
            chalk.cyan('// eslint-disable-next-line') +
            ' to the line before.\n'
        );
      } else {
        console.log(chalk.green('Compiled successfully.\n'));
      }
      console.log(`The ${chalk.cyan(path.relative(process.cwd(), paths.appServerBuild))} folder is ready.`);
      console.log(`You may run it in ${chalk.cyan('node')} environment`);
      console.log();
      console.log(`  ${chalk.cyan('node')} ${chalk.cyan(path.relative(process.cwd(), paths.appServerBuild))}`);
      console.log();
    },
    err => {
      console.log(chalk.red('Failed to compile.\n'));
      printBuildError(err);
      process.exit(1);
    }
  );
}
1001410
function () {
/*Line 16 - 'AtomUIComponent.js' */                if (this._scope === undefined) {
/*Line 17 - 'AtomUIComponent.js' */                    var ap = this.get_atomParent(this._element._logicalParent || this._element.parentNode);
/*Line 18 - 'AtomUIComponent.js' */                    if (ap) {
/*Line 19 - 'AtomUIComponent.js' */                        return ap._localScope || ap.get_scope();
/*Line 20 - 'AtomUIComponent.js' */                    }
/*Line 21 - 'AtomUIComponent.js' */                    else {
/*Line 22 - 'AtomUIComponent.js' */                        return appScope;
/*Line 23 - 'AtomUIComponent.js' */                    }
/*Line 24 - 'AtomUIComponent.js' */                }
/*Line 25 - 'AtomUIComponent.js' */                return this._scope;
/*Line 26 - 'AtomUIComponent.js' */            }
512053
function() {
      'use strict';
      var done = this.async();

      commonPrompts.greetings( this, this.placeholder.artifactType );

      var prompts = commonPrompts.prompts( this.placeholder.artifactType, this.placeholder );
      if( this.options.activity ) {
         prompts.push( {
            type: 'list',
            name: 'laxarIntegrationTechnology',
            message: 'Integration technology:',
            choices: [ 'plain', 'angular' ],
            default: this.placeholder.laxarIntegrationTechnology
         } );
      }
      else {
         prompts.push( {
            type: 'list',
            name: 'laxarIntegrationTechnology',
            message: 'Integration technology:',
            choices: [ 'plain', 'angular', 'react' ],
            default: this.placeholder.laxarIntegrationTechnology
         } );
      }

      prompts.push( {
         type: 'confirm',
         name: 'infrastructure',
         message: 'Create project infrastructure (README.md, bower.json)?',
         default: false
      } );

      this.prompt( prompts, function( answers ) {

         for( var answerName in answers ) {
            if( answers.hasOwnProperty( answerName ) ) {
               this.placeholder[ answerName ] = answers[ answerName ];
            }
         }

         var licenseList = util.createLicenseText( answers.licenses );
         this.license = licenseList[ 1 ];
         for( var key in licenseList[ 0 ] ) {
            if( licenseList[ 0 ].hasOwnProperty( key ) ) {
               this.placeholder[ key ] = licenseList[ 0 ][ key ];
            }
         }

         this.placeholder.angularModuleName =
            _.camelCase( this.placeholder.name );
         this.placeholder.angularControllerName =
            _.capitalize( _.camelCase( this.placeholder.name ) ) + 'Controller';

         if( !this.options.activity ) {
            this.placeholder.cssClassName = _.kebabCase( this.placeholder.name );
         }

         this.placeholder.banner = util.createBanner( this );
         done();

      }.bind( this ) );
   }
276416
protected void generatePackageUseFile() throws IOException {
        HtmlTree body = getPackageUseHeader();
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
        div.addStyle(HtmlStyle.contentContainer);
        if (usingPackageToUsedClasses.isEmpty()) {
            div.addContent(getResource(
                    "doclet.ClassUse_No.usage.of.0", pkgdoc.name()));
        } else {
            addPackageUse(div);
        }
        if (configuration.allowTag(HtmlTag.MAIN)) {
            mainTree.addContent(div);
            body.addContent(mainTree);
        } else {
            body.addContent(div);
        }
        HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
                ? HtmlTree.FOOTER()
                : body;
        addNavLinks(false, tree);
        addBottom(tree);
        if (configuration.allowTag(HtmlTag.FOOTER)) {
            body.addContent(tree);
        }
        printHtmlDocument(null, true, body);
    }
731537
function startDevServer (directory, port = 3000) {
  let url
  const app = express()
  const { reload } = reloadServer(app)
  let preview = ''

  app.get('/', (req, res) => res.send(preview))
  app.use(express.static(directory))

  function update ({ html, errors, metadata }) {
    let status = errors.length ? chalk.red('failed') : chalk.green('success')
    preview = errors.length
      ? buildErrorPage(errors)
      : html.replace('</body>', '<script src="/reload/reload.js"></script></body>')

    renderCLI({ url, status, time: metadata.time, size: metadata.size })
    reload()
  }

  return new Promise((resolve, reject) => {
    getPort({ port }).then((availablePort) => {
      url = `http://localhost:${availablePort}`

      app.listen(availablePort, () => resolve({ update, url, app }))
    })

    process.on('uncaughtException', reject)
  })
}
729356
function (s) {
/*Line 40 - 'AtomUIComponent.js' */                var scope = this._localScope || this.get_scope();
/*Line 41 - 'AtomUIComponent.js' */                for (var k in s) {
/*Line 42 - 'AtomUIComponent.js' */                    if (/^(application|owner|app|parent)$/gi.test(k))
/*Line 43 - 'AtomUIComponent.js' */                        throw new Error("Invalid name for the scope property");
/*Line 44 - 'AtomUIComponent.js' */                    // if value is already set...
/*Line 45 - 'AtomUIComponent.js' */                    var v = s[k];
/*Line 46 - 'AtomUIComponent.js' */                    if (scope == window.appScope && !window.atomApplication._ready) {
/*Line 47 - 'AtomUIComponent.js' */                        if ((k.indexOf('_') != 0)
/*Line 48 - 'AtomUIComponent.js' */                            && (v !== undefined && v !== null)
/*Line 49 - 'AtomUIComponent.js' */                            && (/string|number|boolean/i.test(typeof (v)))){
/*Line 50 - 'AtomUIComponent.js' */                                atomApplication._defaultScope[k] = v;
/*Line 51 - 'AtomUIComponent.js' */                            }
/*Line 52 - 'AtomUIComponent.js' */                    }
/*Line 53 - 'AtomUIComponent.js' */                    if (scope[k] !== undefined)
/*Line 54 - 'AtomUIComponent.js' */                        continue;
/*Line 55 - 'AtomUIComponent.js' */                    scope[k] = v;
/*Line 56 - 'AtomUIComponent.js' */                }
/*Line 57 - 'AtomUIComponent.js' */            }
678777
function library(argv, config, args) {
  if (!isValidPackageName(args.name)) {
    return Promise.reject(
      args.name + ' is not a valid name for a project. Please use a valid ' +
      'identifier name (alphanumeric).'
    );
  }

  const root = process.cwd();
  const libraries = path.resolve(root, 'Libraries');
  const libraryDest = path.resolve(libraries, args.name);
  const source = path.resolve('node_modules', 'react-native', 'Libraries', 'Sample');

  if (!fs.existsSync(libraries)) {
    fs.mkdir(libraries);
  }

  if (fs.existsSync(libraryDest)) {
    return Promise.reject(`Library already exists in ${libraryDest}`);
  }

  walk(source).forEach(f => {
    if (f.indexOf('project.xcworkspace') !== -1 ||
        f.indexOf('.xcodeproj/xcuserdata') !== -1) {
      return;
    }

    const dest = f.replace(/Sample/g, args.name).replace(/^_/, '.');
    copyAndReplace(
      path.resolve(source, f),
      path.resolve(libraryDest, dest),
      {'Sample': args.name}
    );
  });

  console.log('Created library in', libraryDest);
  console.log('Next Steps:');
  console.log('   Link your library in Xcode:');
  console.log(
    '   https://facebook.github.io/react-native/docs/' +
    'linking-libraries-ios.html#content\n'
  );
}
1330877
function init(pluginInterface) {
    const pi = pluginInterface;

    // Static contents call
    pi.http.endpoint('get', '*', (req, res, next) => {
        let path = req.path;
        if (path.charAt(path.length-1)=='/') path += 'index.html';

        const pt = pathm.join(pathm.dirname(__filename), 'htdocs', path);
        fs.readFile(pt, (err, data)=>{
            if (err) {
                res.status(404).send('No such resource');
                return;
            }
            if (path==='/js/customize.js') {
                data = data.toString();
                data = data.split('__%%RSA_PUB_KEY%%__')
                    .join('"'+pi.crypt.getPubKey()+'"');
            }
            res.set('Content-Type', mime.getType(path)); // 'text/html; charset=UTF-8'
            res.status(200);

            res.send(data);
        });
    });
}
257294
function initExpress(app) {
  var env = app.get('env');
  var publicDir = path.join(config.root, config.publicDir);

  app.set('ip', config.ip);
  app.set('port', config.port);

  app.set('views', config.root + '/server/views');
  app.engine('html', require('ejs').renderFile);
  app.set('view engine', 'html');

  app.use(compression());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());
  app.use(methodOverride());
  app.use(cookieParser());
  app.use(passport.initialize());
  app.use(favicon(path.join(publicDir, 'favicon.ico')));

  if ('production' === env) {
    app.use(express.static(publicDir));
    app.set('appPath', publicDir);
    app.use(morgan('tiny'));
  }

  if ('development' === env || 'test' === env) {
    app.use(express.static(path.join(config.root, '.tmp')));
    app.use(express.static(publicDir));
    app.set('appPath', publicDir);
    app.use(morgan('dev'));
    // Error handler - has to be last
    app.use(errorHandler());
  }
}
7542
function bundle(input, nc, options, complete) {
  const bundlePath = path.join(nc, 'lib', 'nexe.js');
  const mapfile = options.output + '.map';
  let ws = fs.createWriteStream(bundlePath);

  const igv = '__filename,__dirname,_process';
  let insertGlobalVars = { isNexe: true },
    wantedGlobalVars = igv.split(',');

  // parse insertGlobalVars.
  Object.keys(insertGlobals.vars).forEach(function(x) {
    if (wantedGlobalVars.indexOf(x) === -1) {
      insertGlobalVars[x] = undefined;
    }
  });

  let paths = [path.join(nc, 'lib')];

  if (options.browserifyPaths) {
    paths = paths.concat(options.browserifyPaths);
  }

  _log('executing browserify via API');
  let bproc = browserify([input], {
    debug: options.debug,
    commondir: false,
    paths: paths,
    builtins: false,
    insertGlobalVars: insertGlobalVars,
    detectGlobals: true,
    browserField: false,
  });

  if (options.browserifyExcludes && Array.isArray(options.browserifyExcludes)) {
    for (let i = 0; i < options.browserifyExcludes.length; i++) {
      let lib = options.browserifyExcludes[i];
      _log("Excluding '%s' from browserify bundle", lib);
      bproc.exclude(lib);
    }
  }

  // copy the excludes code for requires for now.
  if (options.browserifyRequires && Array.isArray(options.browserifyRequires)) {
    for (let i = 0; i < options.browserifyRequires.length; i++) {
      let lib = options.browserifyRequires[i];
      let name = lib.file || lib; // for  object format.
      // if `lib` is object then fetch all params without `file`
      // otherwise returns empty object
      let opts =
        (lib instanceof Object &&
          Object.keys(lib)
            .filter(key => key !== 'file')
            .reduce((acc, key) => {
              return (acc[key] = lib[key]), acc;
            }, {})) ||
        {};

      _log("Force including '%s' in browserify bundle", name);
      bproc.require(lib, opts);
    }
  }

  if (options.debug) {
    bproc.require(require.resolve('source-map-support'));
  }

  let bprocbun = bproc
    .bundle() // bundle
    .pipe(ws); // pipe to file

  // error on require errors, still can't contionue. ffs browserify
  bprocbun.on('error', function(err) {
    _log('error', '[browserify] ' + err);
  });

  ws.on('error', function(err) {
    console.log(err);
    _log('error', 'Failed to save stdout to disk');
    process.exit(1);
  });

  ws.on('close', function() {
    var source = fs.readFileSync(bundlePath, 'utf8');
    source = source.replace(/[^\x00-\x7F]/g, '');

    // write the source modified to nexe.js
    fs.writeFile(bundlePath, source, 'utf8', function(err) {
      if (err) {
        _log('error', 'failed to save source');
        process.exit(1);
      }

      complete();
    });
  });
}
761046
function createUpdateStream(origin, target, options, completeCb) {
    // console.log('[EntitySetAsyncView][createUpdateStream]', 'from', origin.cid, 'to', target.cid );
    // let source = origin.source(options);
    // let sink = target.sink({}, completeCb);
    options = { ...options, emitEntities: true };

    let args = [origin.source(options)];

    if (options.debug) {
        args.push(
            PullMap(val => {
                let [data, dataOptions] = val;
                console.log('[EntitySetAsyncView][>]', origin.cid, target.cid, stringify(data));
                return val;
            })
        );
    }

    if (options.query) {
        args.push(QueryFilter(options.query, options));
    }

    args.push(target.sink({ source: origin }, completeCb));

    return Pull.apply(null, args);
}