How to use the infusion.extend function in infusion

To help you get started, we’ve selected a few infusion examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GPII / universal / gpii / node_modules / solutionsRegistry / src / js / generate-schemas.js View on Github external
gpii.solutionsRegistry.schemaGenerator.generateSettingsSchema = function (that) {
    var settingsSchema = require(fluid.module.resolvePath(that.options.baseSettingsSchema));
    // settings schema template from that.options.baseSettingsSchema
    // TODO: Add all solutions/settings and schemas from that.options.solutionsRegistryPath

    var solutionsSettings = gpii.solutionsRegistry.schemaGenerator.settingsFromSolutions(that);
    var genericSettings   = gpii.solutionsRegistry.schemaGenerator.genericSettings(that);

    var allSettings = fluid.extend({}, solutionsSettings, genericSettings);

    // Merge the generated settings schema data into the "base schema" at the right point.
    fluid.set(
        settingsSchema,
        "properties",
        allSettings
    );

    var settingsOutputPath = fluid.module.resolvePath(that.options.settingsSchemaOutputPath);
    var settingsOutputDir  = path.dirname(settingsOutputPath);
    if (!fs.existsSync(settingsOutputDir)) {
        mkdirp.sync(settingsOutputDir);
    }
    fs.writeFileSync(settingsOutputPath, JSON.stringify(settingsSchema, null, 2));
};
github GPII / universal / gpii / node_modules / ontologyHandler / src / ontologyHandler.js View on Github external
fluid.each(secondary.contexts, function (context, contextId) {
            var mcontext = master.contexts[contextId];
            // if not in master, just copy over from secondary:
            if (!mcontext) {
                master.contexts[contextId] = context;
            } else {
                // preferences and metadata should be the only things varying
                fluid.extend(true, mcontext.preferences, context.preferences);
                mcontext.metadata = fluid.makeArray(mcontext.metadata).concat(fluid.makeArray(context.metadata));
            }
        });
github GPII / universal / tests / production / CloudStatusProductionTests.js View on Github external
gpii.tests.productionConfigTesting.testDefs = fluid.transform(gpii.tests.development.testDefs, function (testDefIn) {
    var testDef = fluid.extend(true, {}, testDefIn, {
        name: "Flow Manager production tests",
        config: gpii.tests.productionConfigTesting.config,
        expect: 6,
        components: {
            healthRequest: {
                type: "kettle.test.request.http",
                options: {
                    hostname: "flowmanager",
                    path: "/health",
                    method: "GET",
                    expectedStatusCode: 200,
                    expectedPayload: {"isHealthy": true}
                }
            },
            readyRequest: {
                type: "kettle.test.request.http",
github GPII / universal / tests / ProductionConfigTests.js View on Github external
gpii.tests.productionConfigTesting.testDefs = fluid.transform(gpii.tests.development.testDefs, function (testDefIn) {
    var testDef = fluid.extend(true, {}, testDefIn, {
        name: "Flow Manager production tests",
        expect: 16,
        config: gpii.tests.productionConfigTesting.config,
        components: {
            healthRequest: {
                type: "kettle.test.request.http",
                options: {
                    hostname: "flowmanager",
                    path: "/health",
                    method: "GET",
                    expectedStatusCode: 200,
                    expectedPayload: {"isHealthy": true}
                }
            },
            readyRequest: {
                type: "kettle.test.request.http",
github GPII / universal / tests / UntrustedPSPIntegrationTests.js View on Github external
gpii.test.untrusted.pspIntegration.verifyRawPrefsAtEnd = function (that, preferences, sequenceNum, expectedChange) {
    var expectedPrefsChange = expectedChange ? expectedChange : gpii.test.untrusted.pspIntegration.expectedPrefsChange[sequenceNum];

    var expected = fluid.extend(true, {}, that.options.initialPrefs, expectedPrefsChange);
    jqUnit.assertDeepEq("The updated preferences have been saved to the cloud", expected, JSON.parse(preferences));
};
github GPII / universal / tests / UntrustedBrowserChannelTests.js View on Github external
gpii.tests.untrusted.flowManager.browserChannel.testDefs = fluid.transform(gpii.tests.flowManager.browserChannel.testDefs, function (testDefIn) {
    var testDef = fluid.extend(true, {}, testDefIn, {
        config: {
            configName: "gpii.tests.acceptance.untrusted.browserChannel.config",
            configPath: "%gpii-universal/tests/configs"
        }
    });
    return testDef;
});
github GPII / universal / tests / PreferencesServerErrorTests.js View on Github external
return fluid.transform(gpii.tests.preferencesServerErrorTests.testDefs, function (testDef) {
        return fluid.extend(true, {}, gpii.tests.preferencesServerErrorTests.testDefCommon, testDef);
    });
};
github GPII / universal / tests / UntrustedPSPIntegrationTests.js View on Github external
gpii.test.untrusted.pspIntegration.verifyRawPrefsAtEnd = function (that, preferences, sequenceNum, expectedChange) {
    fluid.log (that.options.name, ", number ", sequenceNum, " in the sequence");
    var expectedPrefsChange = expectedChange ? expectedChange : gpii.test.untrusted.pspIntegration.expectedPrefsChange[sequenceNum];

    var expected = fluid.extend(true, {}, that.options.initialPrefs, expectedPrefsChange);
    jqUnit.assertDeepEq("The updated preferences have been saved to the cloud", expected, JSON.parse(preferences));
};
github GPII / universal / gpii / node_modules / solutionsRegistry / src / js / sr-validation-middleware.js View on Github external
var validationResults = globalValidator.validate(schema, toValidate, schemaHash);

        if (validationResults.isValid) {
            validationPromise.resolve();
        }
        else {
            if (dataPathPrefix) {
                fluid.each(validationResults.errors, function (singleError) {
                    singleError.dataPath = fluid.copy(dataPathPrefix).concat(singleError.dataPath);
                });
            }
            var localisedErrors     = gpii.schema.validator.localiseErrors(validationResults.errors, toValidate, validationMiddleware.model.messages, validationMiddleware.options.rules.localisation);
            var localisedPayload    = fluid.copy(validationResults);
            localisedPayload.errors = localisedErrors;

            var failurePayload = fluid.extend({}, validationMiddleware.options.errorTemplate, localisedPayload);
            validationPromise.reject(failurePayload);
        }

        return validationPromise;
    };
};
github GPII / universal / gpii / node_modules / lifecycleManager / src / UserLogonStateChange.js View on Github external
}, function (err) {
        var error = fluid.extend(err, {
            message: "Rejected deviceReporter promise: " + err.message
        });
        errorEvent.fire(error);
    });
};