How to use the noflo.IP function in noflo

To help you get started, we’ve selected a few noflo 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 noflo / noflo-core / spec / mocha / Drop.js View on Github external
it('should drop it', (done) => {
      const ip = new noflo.IP('data', 'Foo');
      setTimeout(
        () => {
          chai.expect(Object.keys(ip)).to.eql([]);
          return done();
        },
        200,
      );
      ins.connect();
      ins.send(ip);
      ins.disconnect();
    });
  });
github noflo / noflo-core / components / DisconnectAfterPacket.js View on Github external
brackets[input.scope].forEach((bracket) => {
      output.sendIP('out', new noflo.IP('closeBracket', bracket));
    });
github samtecspg / articulate / api / components / agent.agent-domain-action.validate-correlation.js View on Github external
if (!agent) {
            errors.push(`Agent [${agent.id}] doesn't exists`);
        }
        if (!domain) {
            errors.push(`Domain [${domain.id}] doesn't exists`);
        }
        if (!action) {
            errors.push(`Action [${action.id}] doesn't exists`);
        }
        if (errors.length > 0) {
            return output.sendDone({ [PORT_ERROR]: new NoFlo.IP('data', Boom.badRequest(errors.join('\n')), { scope }) });
        }
        if (
            (action.agent === agent.agentName) &&
            (action.domain === domain.domainName)) {
            return output.sendDone({ [PORT_OUT]: new NoFlo.IP('data', action, { scope }) });
        }
        return output.sendDone({ [PORT_ERROR]: new NoFlo.IP('data', Boom.badRequest('The specified action is not linked with this domain or agent'), { scope }) });
    });
};
github samtecspg / articulate / api / components / agent.find-all-settings.js View on Github external
.then((settings) => {

                return output.sendDone({ [PORT_OUT]: new NoFlo.IP('data', settings, { scope }) });
            })
            .catch((err) => {
github samtecspg / articulate / api / components / agent.find-settings-by-name.js View on Github external
.then((setting) => {

                if (!setting) {
                    return output.sendDone({ [PORT_ERROR]: new NoFlo.IP('data', Boom.notFound(`Setting [${id}] not found`), { scope }) });
                }

                const settingData = setting.string_value_setting ? setting.string_value_setting : setting;
                return output.sendDone({ [PORT_OUT]: new NoFlo.IP('data', settingData, { scope }) });
            })
            .catch((err) => {
github samtecspg / articulate / api / components / domain.exists-by-id.js View on Github external
.then((exists) => {

                return output.sendDone({ [PORT_OUT]: new NoFlo.IP('data', exists, { scope }) });
            })
            .catch((err) => {
github samtecspg / articulate / api / components / agent.find-webhook-by-agent.js View on Github external
.then((webhook) => {

                if (!webhook) {
                    return output.sendDone({ [PORT_ERROR]: new NoFlo.IP('data', Boom.notFound(`Webhook [${id}] not found`), { scope }) });
                }

                webhook.agent = agentName;
                return output.sendDone({ [PORT_OUT]: new NoFlo.IP('data', webhook, { scope }) });
            })
            .catch((err) => {
github samtecspg / articulate / api / components / agent.exists-by-id.js View on Github external
.then((exists) => {

                return output.sendDone({ [PORT_OUT]: new NoFlo.IP('data', exists, { scope }) });
            })
            .catch((err) => {
github samtecspg / articulate / api / components / agent.find-domains-by-agent-id.js View on Github external
.catch((err) => {

                return output.sendDone({ [PORT_ERROR]: new NoFlo.IP('data', Boom.internal(err.message), { scope }) });
            });
    });
github samtecspg / articulate / api / components / saying.find-by-id.js View on Github external
.then((saying) => {

                if (!saying) {
                    return output.sendDone({ [PORT_ERROR]: new NoFlo.IP('data', Boom.notFound(`Saying [${id}] not found`), { scope }) });
                }

                return output.sendDone({ [PORT_OUT]: new NoFlo.IP('data', saying, { scope }) });
            })
            .catch((err) => {

noflo

Flow-Based Programming environment for JavaScript

MIT
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis