webfast 0.1.77 → 0.1.79
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.
- package/README.md +5 -0
- package/modules/bots/applications/telegram/set.js +1 -1
- package/modules/data/mongo/file.js +1 -1
- package/package.json +1 -1
- package/example.js +0 -68
    
        package/README.md
    CHANGED
    
    | @@ -6,6 +6,9 @@ WebFast! is a lightweight, model-based framework developed by Hybrid Institute. | |
| 6 6 |  | 
| 7 7 | 
             
            WebFast! provides a flexible and intuitive platform for creating web applications without the need for extensive coding. It empowers users to leverage a model-based approach, making it accessible to a broader audience, including those with limited coding experience.
         | 
| 8 8 |  | 
| 9 | 
            +
            ## Telegram Community Group
         | 
| 10 | 
            +
            Join the [WebFast! Telegram Community](https://t.me/webfast_community) for quick questions and further discussion of development of the webFast! Framework.
         | 
| 11 | 
            +
             | 
| 9 12 | 
             
            ## Features
         | 
| 10 13 |  | 
| 11 14 | 
             
            - **Lightweight**: Keep your projects streamlined with a minimalistic approach.
         | 
| @@ -117,6 +120,8 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file | |
| 117 120 |  | 
| 118 121 | 
             
            For questions or feedback, please feel free to [contact me on LinkedIn](https://linkedin.com/in/kaigartner). You can also reach out to me on Instagram: [@kaigartner](https://instagram.com/kaigartner).
         | 
| 119 122 |  | 
| 123 | 
            +
             | 
| 124 | 
            +
             | 
| 120 125 | 
             
            ---
         | 
| 121 126 |  | 
| 122 127 | 
             
            **Hybrid Institute** - Empowering the future with innovative solutions.
         | 
| @@ -13,7 +13,7 @@ module.exports = { | |
| 13 13 | 
             
                addToCollection : async function (program,collectionName, fieldName, data,search) {
         | 
| 14 14 | 
             
                    try {
         | 
| 15 15 | 
             
                        await client.connect();
         | 
| 16 | 
            -
                        const db = client.db( | 
| 16 | 
            +
                        const db = client.db(process.env.dbName);
         | 
| 17 17 | 
             
                        const collection = await db.collection(collectionName);
         | 
| 18 18 |  | 
| 19 19 | 
             
                        // Check if the field is an array in the existing document
         | 
| @@ -7,7 +7,7 @@ const client = new MongoClient(uri); | |
| 7 7 |  | 
| 8 8 | 
             
            module.exports = {
         | 
| 9 9 | 
             
                uploadBuffer: async function (progam,buffer, filename, metadata = {}, callback) {
         | 
| 10 | 
            -
                    const dbName =  | 
| 10 | 
            +
                    const dbName = process.env.dbName;
         | 
| 11 11 | 
             
                    await client.connect();
         | 
| 12 12 |  | 
| 13 13 | 
             
                    const db = client.db(dbName);
         | 
    
        package/package.json
    CHANGED
    
    
    
        package/example.js
    DELETED
    
    | @@ -1,68 +0,0 @@ | |
| 1 | 
            -
            const path = require(`path`);
         | 
| 2 | 
            -
            const contentPath = path.join(__dirname,`example`,`content`)
         | 
| 3 | 
            -
            let setArray = {
         | 
| 4 | 
            -
                wget : '/usr/local/bin/wget',
         | 
| 5 | 
            -
                process : {
         | 
| 6 | 
            -
                    ts : Date.now(),
         | 
| 7 | 
            -
                    socket : {
         | 
| 8 | 
            -
                        api : {
         | 
| 9 | 
            -
                            list : function(program,ws,json,data,path) {
         | 
| 10 | 
            -
                                // Example to create process for websocket path action and process data
         | 
| 11 | 
            -
                                console.log(`Example of list process`);
         | 
| 12 | 
            -
             | 
| 13 | 
            -
                                function generateRandomText(length) {
         | 
| 14 | 
            -
                                    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
         | 
| 15 | 
            -
                                    let result = '';
         | 
| 16 | 
            -
                                  
         | 
| 17 | 
            -
                                    for (let i = 0; i < length; i++) {
         | 
| 18 | 
            -
                                      result += characters.charAt(Math.floor(Math.random() * characters.length));
         | 
| 19 | 
            -
                                    }
         | 
| 20 | 
            -
                                  
         | 
| 21 | 
            -
                                    return result;
         | 
| 22 | 
            -
                                  }
         | 
| 23 | 
            -
             | 
| 24 | 
            -
                                  
         | 
| 25 | 
            -
                                // Loop for example through 
         | 
| 26 | 
            -
                                let exampleData = {
         | 
| 27 | 
            -
                                    list : [],
         | 
| 28 | 
            -
                                    ell : data.ell,
         | 
| 29 | 
            -
                                    action : data.action
         | 
| 30 | 
            -
                                }
         | 
| 31 | 
            -
             | 
| 32 | 
            -
                                const pushData = {};
         | 
| 33 | 
            -
                                for (let i in data.other.items) {
         | 
| 34 | 
            -
                                    const item = data.other.items[i];
         | 
| 35 | 
            -
                                    // We have itme
         | 
| 36 | 
            -
                                    const id = item.id;
         | 
| 37 | 
            -
                                    const key = item.name;
         | 
| 38 | 
            -
             | 
| 39 | 
            -
                                    pushData[key] = {
         | 
| 40 | 
            -
                                        id : id,
         | 
| 41 | 
            -
                                        text : generateRandomText(10)
         | 
| 42 | 
            -
                                    }
         | 
| 43 | 
            -
                                }
         | 
| 44 | 
            -
             | 
| 45 | 
            -
                                pushData.uuid = program.uuid.v4();
         | 
| 46 | 
            -
                                exampleData.list.push(pushData);
         | 
| 47 | 
            -
             | 
| 48 | 
            -
                                // Send websocket message create standard
         | 
| 49 | 
            -
                                const sendObject = {
         | 
| 50 | 
            -
                                    func : data.function,
         | 
| 51 | 
            -
                                    data : exampleData,
         | 
| 52 | 
            -
                                    js : `console.log("RUN FROM BACKEND")`
         | 
| 53 | 
            -
                                }
         | 
| 54 | 
            -
             | 
| 55 | 
            -
                                // Sedn back to front-end 
         | 
| 56 | 
            -
                                //ws.send();
         | 
| 57 | 
            -
                                
         | 
| 58 | 
            -
                                return sendObject;
         | 
| 59 | 
            -
                            }
         | 
| 60 | 
            -
                        }
         | 
| 61 | 
            -
                    }
         | 
| 62 | 
            -
                },
         | 
| 63 | 
            -
                contentPath : contentPath
         | 
| 64 | 
            -
            };
         | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 67 | 
            -
            let program = require(path.join(__dirname,`index.js`))(setArray);
         | 
| 68 | 
            -
            console.log(`Required`);
         |