-
Notifications
You must be signed in to change notification settings - Fork 17
Upgrade to Node.js v25.8.1 compatibility #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build output | ||
| dist/ | ||
| build/ | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log | ||
| npm-debug.log* | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Environment | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Test | ||
| coverage/ | ||
| .nyc_output/ | ||
|
|
||
| # Temporary files | ||
| tmp/ | ||
| temp/ | ||
| *.tmp |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -42,7 +42,7 @@ function initVm(j){ | |||||
| VMs[j].send({type:"settings", data:settings}); | ||||||
| VMs[j].on('message', (function(m) { | ||||||
| if (m.type === 'sms'){ | ||||||
| this.sendSMS(m,new Buffer(m.receiver).toString()); | ||||||
| this.sendSMS(m,Buffer.from(m.receiver).toString()); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Suggested change
|
||||||
| } | ||||||
| }).bind(this)); | ||||||
| VMs[j].on('error',(function(j){ | ||||||
|
|
@@ -121,7 +121,7 @@ Object.defineProperties(Connector.prototype, { | |||||
| }, | ||||||
| sendSMS : { | ||||||
| value: function(data,id){ | ||||||
| console.log("send SMS",new Buffer(data.receiver).toString(),new Buffer(data.sender).toString(),data.msgdata.toString()); | ||||||
| console.log("send SMS",Buffer.from(data.receiver).toString(),Buffer.from(data.sender).toString(),data.msgdata.toString()); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Suggested change
|
||||||
| this.emit("stats++",id); | ||||||
| this._sendSMS(data); | ||||||
| }, | ||||||
|
|
@@ -134,10 +134,10 @@ Object.defineProperties(Connector.prototype, { | |||||
| try{this.emit("sendSMS",data);}catch(e){console.log("Error",e)} | ||||||
| new Models.SMS({ | ||||||
| pdu: data, | ||||||
| sms : new Buffer(data.msgdata || "").toString(), | ||||||
| from: new Buffer(data.sender || "").toString(), | ||||||
| to: new Buffer(data.receiver || "").toString(), | ||||||
| SMSC: new Buffer(data.smsc_id || "").toString(), | ||||||
| sms : Buffer.from(data.msgdata || "").toString(), | ||||||
| from: Buffer.from(data.sender || "").toString(), | ||||||
| to: Buffer.from(data.receiver || "").toString(), | ||||||
| SMSC: Buffer.from(data.smsc_id || "").toString(), | ||||||
| MotCle : "", | ||||||
| success : false, | ||||||
| received : false | ||||||
|
|
@@ -156,10 +156,10 @@ Object.defineProperties(Connector.prototype, { | |||||
| try{this.emit("failSMS",data,raison);}catch(e){}; | ||||||
| var save = { | ||||||
| pdu: data, | ||||||
| sms : new Buffer(data.msgdata || "").toString(), | ||||||
| from: new Buffer(data.sender || "").toString(), | ||||||
| to: new Buffer(data.receiver || "").toString(), | ||||||
| SMSC: new Buffer(data.smsc_id || "").toString(), | ||||||
| sms : Buffer.from(data.msgdata || "").toString(), | ||||||
| from: Buffer.from(data.sender || "").toString(), | ||||||
| to: Buffer.from(data.receiver || "").toString(), | ||||||
| SMSC: Buffer.from(data.smsc_id || "").toString(), | ||||||
| MotCle : "", | ||||||
| success : false, | ||||||
| raison : raison | ||||||
|
|
@@ -178,10 +178,10 @@ Object.defineProperties(Connector.prototype, { | |||||
| try{this.emit("successSMS",data);}catch(e){} | ||||||
| new Models.SMS({ | ||||||
| pdu: data, | ||||||
| sms : new Buffer(data.msgdata || "").toString(), | ||||||
| from: new Buffer(data.sender || "").toString(), | ||||||
| to: new Buffer(data.receiver || "").toString(), | ||||||
| SMSC: new Buffer(data.smsc_id || "").toString(), | ||||||
| sms : Buffer.from(data.msgdata || "").toString(), | ||||||
| from: Buffer.from(data.sender || "").toString(), | ||||||
| to: Buffer.from(data.receiver || "").toString(), | ||||||
| SMSC: Buffer.from(data.smsc_id || "").toString(), | ||||||
| MotCle : keyword, | ||||||
| script : script, | ||||||
| success : true | ||||||
|
|
@@ -197,7 +197,7 @@ Object.defineProperties(Connector.prototype, { | |||||
| runSMS : { | ||||||
| value : function(data,err,items){ | ||||||
| var id = (data && data.receiver ? data.receiver : "unknow").toString(); | ||||||
| console.log("receive SMS",new Buffer(data.receiver).toString(),new Buffer(data.sender).toString(),data.msgdata.toString()); | ||||||
| console.log("receive SMS",Buffer.from(data.receiver).toString(),Buffer.from(data.sender).toString(),data.msgdata.toString()); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Suggested change
|
||||||
| this.emit("stats--",id); | ||||||
| if(err || !items) | ||||||
| return this.failSMS(data, err ? err : "Pas d'items" ); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -285,7 +285,7 @@ Client.prototype.store = function(cmd, key, value, callback, lifetime, flags) | |
|
|
||
| var set_flags = flags || 0; | ||
| var exp_time = lifetime || 0; | ||
| var tml_buf = new Buffer(value.toString()); | ||
| var tml_buf = Buffer.from(value.toString()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| var value_len = tml_buf.length || 0; | ||
| var query = [cmd, this.scope+key, set_flags, exp_time, value_len]; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -143,9 +143,9 @@ var lang = false; | |||||||||||||
| }else if (m.type === 'sms'){ | ||||||||||||||
| // console.log("recieve SMS",m.time); | ||||||||||||||
| m.msgdata_orig = m.msgdata; | ||||||||||||||
| m.msgdata = new Buffer(m.msgdata).toString().trim(); | ||||||||||||||
| m.receiver = new Buffer(m.receiver).toString().toLowerCase(); | ||||||||||||||
| m.sender = new Buffer(m.sender).toString().toLowerCase(); | ||||||||||||||
| m.msgdata = Buffer.from(m.msgdata).toString().trim(); | ||||||||||||||
| m.receiver = Buffer.from(m.receiver).toString().toLowerCase(); | ||||||||||||||
| m.sender = Buffer.from(m.sender).toString().toLowerCase(); | ||||||||||||||
|
Comment on lines
+146
to
+148
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Suggested change
|
||||||||||||||
| var priv = Symbol(m.sender); | ||||||||||||||
| m[priv] = true; | ||||||||||||||
| m.fileType = m.script.type; | ||||||||||||||
|
|
@@ -168,7 +168,7 @@ var lang = false; | |||||||||||||
| }).bind(null,m.file,sendError)); | ||||||||||||||
| } | ||||||||||||||
| /* definition de la session et du storage */ | ||||||||||||||
| var _id = new Buffer(m.sender).toString(); | ||||||||||||||
| var _id = Buffer.from(m.sender).toString(); | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
| m.filename = path.basename(m.file); | ||||||||||||||
| var MSG = function(conf){ | ||||||||||||||
| conf = conf || {}; | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Node.js versions
18.0.0through18.3.0, thefamilyproperty returned byos.networkInterfaces()is a number (4or6) rather than a string ('IPv4'or'IPv6'). Since the project'senginesfield inpackage.jsonnow specifiesnode: ">=18.0.0", using strict equalityx.family === 'IPv4'will fail to match any IPv4 interfaces on those Node.js versions. To ensure compatibility across all Node.js 18+ versions, check for both'IPv4'and4.