!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/node-red/test/unit/@node-red/editor-api/lib/admin/   drwxr-xr-x
Free 13.27 GB of 57.97 GB (22.89%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     plugins_spec.js (3.03 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
const should = require("should");
const request = require('supertest');
const express = require('express');
const bodyParser = require("body-parser");

var app;

var NR_TEST_UTILS = require("nr-test-utils");

var plugins = NR_TEST_UTILS.require("@node-red/editor-api/lib/admin/plugins");

describe("api/editor/plugins", function() {
    const pluginList = [
        {
            "id": "test-module/test-set",
            "enabled": true,
            "local": false,
            "plugins": [
                {
                    "type": "foo",
                    "id": "a-plugin",
                    "module": "test-module"
                },
                {
                    "type": "bar",
                    "id": "a-plugin2",
                    "module": "test-module"
                },
                {
                    "type": "foo",
                    "id": "a-plugin3",
                    "module": "test-module"
                }
            ]
        },
        {
            "id": "test-module/test-disabled-set",
            "enabled": false,
            "local": false,
            "plugins": []
        }
    ];
    const pluginConfigs = `
<!-- --- [red-plugin:test-module/test-set] --- -->
test-module-config`;

    const pluginCatalogs = { "test-module": {"foo": "bar"}};

    before(function() {
        app = express();
        app.use(bodyParser.json());
        app.get("/plugins",plugins.getAll);
        app.get("/plugins/messages",plugins.getCatalogs);

        plugins.init({
            plugins: {
                getPluginList: async function() { return pluginList },
                getPluginConfigs: async function() { return pluginConfigs },
                getPluginCatalogs: async function() { return pluginCatalogs }
            }
        })
    });

    it('returns the list of plugins', function(done) {
        request(app)
        .get("/plugins")
        .set('Accept', 'application/json')
        .expect(200)
        .end(function(err,res) {
            if (err) {
                return done(err);
            }
            try {
                JSON.stringify(res.body).should.eql(JSON.stringify(pluginList));
                done();
            } catch(err) {
                done(err)
            }
        });
    });
    it('returns the plugin configs', function(done) {
        request(app)
        .get("/plugins")
        .set('Accept', 'text/html')
        .expect(200)
        .expect(pluginConfigs)
        .end(function(err,res) {
            if (err) {
                return done(err);
            }
            done();
        });
    });
    it('returns the plugin catalogs', function(done) {
        request(app)
        .get("/plugins/messages")
        .set('Accept', 'application/json')
        .expect(200)
        .end(function(err,res) {
            if (err) {
                return done(err);
            }
            try {
                JSON.stringify(res.body).should.eql(JSON.stringify(pluginCatalogs));
                done();
            } catch(err) {
                done(err)
            }
        });
    });
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.035 ]--