13 Commits

Author SHA1 Message Date
Surya Paolo
757bf44c68 Aggiornamento PiuChebuono: lista Totali del Produttore. 2025-02-26 19:08:00 +01:00
Surya Paolo
57679fe649 aggiornamenti vari. prima di VITE 2025-02-25 18:13:01 +01:00
Surya Paolo
f8de205cf6 - aggiornato catalogo lista con filtri per editori e grafico 2025-02-13 21:14:51 +01:00
Surya Paolo
d77f9381e5 - aggiornati gli argomenti in base a GM 2025-02-12 18:31:59 +01:00
Surya Paolo
b643c7cdc3 - Cataloghi aggiornamento... 2025-02-11 18:57:57 +01:00
Surya Paolo
f674791dbc ver: 1.1.21:
- Lista dei Cataloghi
- Gestione Cataloghi in base alla configurazione
2025-02-10 22:48:46 +01:00
Surya Paolo
3e9ab0af53 - AI
- Aggiornamento QUASAR
2025-02-06 19:00:02 +01:00
Surya Paolo
2f92dfe5b0 Cataloghi... 2025-02-05 12:13:27 +01:00
Surya Paolo
41d5f562ec ver 1.1.20:
- corretto campo foto che non compariva più.
 - sistemato i campi aggiuntivi e i richiesti.
- migliorato la barra in alto di selezione.
- aggiunto alcune icone.
2025-02-03 17:18:27 +01:00
Surya Paolo
341b4b8ec7 - Gruppi si chiamano ora "Organizzazioni".
- Categorie dei Gruppi aggiornate.
- Email ora compare sul profilo se non hai telegram e anche sugli annunci.
2025-01-28 23:32:32 +01:00
Surya Paolo
b56e25d1fa - sono uscito da tutti i circuiti che sono a zero e anche admin. 2025-01-15 16:48:31 +01:00
Surya Paolo
332b8992a9 - nella lista circuiti ora si vedono tutti gli annunci del circuito stesso 2025-01-15 15:39:53 +01:00
Surya Paolo
5ba86e3641 - Lista iscritti: aggiunto le note e il flag "Da Contattare" 2025-01-14 19:16:57 +01:00
60 changed files with 3252 additions and 1629 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -16,8 +16,8 @@ URLBASE_APP1=https://localhost
PORT_APP1=8080
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
HTTPS_LOCALHOST=true
DEBUG=0
DEBUG=0
VITE_DEBUG=0
VITE_DEBUG=0
TESTING_ON=1
LOCALE=1
DELAY_SENDEMAIL=2000
@@ -43,4 +43,8 @@ SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
MIAB_HOST=box.lamiaposta.org
MIAB_ADMIN_EMAIL=admin@lamiaposta.org
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
DS_API_KEY="sk-222e3addb3d8455d8b0516d93906eec7"
API_KEY_MSSQL="m68yADSr123MIVIDA@154$DSAGVOK"
SERVER_A_URL="http://51.77.156.69:3000"

View File

@@ -16,8 +16,8 @@ URLBASE_APP1=https://localhost
PORT_APP1=8080
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
HTTPS_LOCALHOST=true
DEBUG=0
DEBUG=0
VITE_DEBUG=0
VITE_DEBUG=0
TESTING_ON=1
LOCALE=1
DELAY_SENDEMAIL=2000
@@ -40,4 +40,5 @@ FTPSERVER_USER=ftpusrsrv_
FTPSERVER_PWD=ftpmypwd@1A_
AUTH_NEW_SITES=123123123
SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
DS_API_KEY="sk-222e3addb3d8455d8b0516d93906eec7"

View File

@@ -1,12 +1,12 @@
DATABASE=test_FreePlanet
DATABASE=test_PiuCheBuono
UDB=paofreeplanet
PDB=mypassword@1A
SEND_EMAIL=0
SEND_EMAIL_ORDERS=1
PORT=3000
appTelegram_TEST=["1","13"]
appTelegram=["1","13"]
appTelegram_DEVELOP=["13"]
appTelegram_TEST=["1","17"]
appTelegram=["1","17"]
appTelegram_DEVELOP=["17"]
DOMAIN=mongodb://localhost:27017/
AUTH_MONGODB=1
MONGODB_USER=admin
@@ -16,8 +16,8 @@ URLBASE_APP1=https://localhost
PORT_APP1=8080
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
HTTPS_LOCALHOST=true
DEBUG=0
DEBUG=0
VITE_DEBUG=0
VITE_DEBUG=0
TESTING_ON=1
LOCALE=1
DELAY_SENDEMAIL=2000
@@ -40,4 +40,11 @@ FTPSERVER_USER=ftpusrsrv_
FTPSERVER_PWD=ftpmypwd@1A_
AUTH_NEW_SITES=123123123
SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
MIAB_HOST=box.lamiaposta.org
MIAB_ADMIN_EMAIL=admin@lamiaposta.org
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
DS_API_KEY="sk-222e3addb3d8455d8b0516d93906eec7"
API_KEY_MSSQL="m68yADSr123MIVIDA@154$DSAGVOK"
SERVER_A_URL="http://51.77.156.69:3000"

View File

@@ -12,7 +12,7 @@ AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadminREAL@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
VITE_DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:paolo@freeplanet.app"
@@ -20,7 +20,7 @@ PUBLIC_VAPI_KEY="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnr
PRIVATE_VAPI_KEY="St9UMzcS76Q9yKG6RInAuYydYjFRliqwHTJY3A5wjO0"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SERVER_CRT=fullchain.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PROD=1

View File

@@ -15,17 +15,15 @@ AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadminREAL@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
VITE_DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
PUBLIC_VAPI_KEY="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc"
PRIVATE_VAPI_KEY="LVpFDJuKscdHuQr5pe20dFuYuWX1-ZRb6x72PP-Pp4I"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PATH_CERT_KEY=privkey.pem
PATH_SERVER_CRT=fullchain.pem
PROD=1
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
@@ -37,4 +35,11 @@ SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
MIAB_HOST=box.lamiaposta.org
MIAB_ADMIN_EMAIL=admin@lamiaposta.org
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
#DB_CONNECTION=sqlsrv
DB_HOST_SQLSRVTEST=31.3.180.50
DB_PORT_SQLSRVTEST=14338
DB_DATABASE_SQLSRVTEST=ANAG_MACRO
DB_USERNAME_SQLSRVTEST=woo
DB_PASSWORD_SQLSRVTEST=4n4traPe@

View File

@@ -12,17 +12,15 @@ AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadminREAL@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
VITE_DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
PUBLIC_VAPI_KEY="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnrB9KrSrh0-aDCODXBm7sZ1DDs"
PRIVATE_VAPI_KEY="St9UMzcS76Q9yKG6RInAuYydYjFRliqwHTJY3A5wjO0"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PATH_CERT_KEY=privkey.pem
PATH_SERVER_CRT=fullchain.pem
PROD=1
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ

View File

@@ -15,7 +15,7 @@ AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
VITE_DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
@@ -23,7 +23,7 @@ PUBLIC_VAPI_KEY="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-
PRIVATE_VAPI_KEY="LVpFDJuKscdHuQr5pe20dFuYuWX1-ZRb6x72PP-Pp4I"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SERVER_CRT=fullchain.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PROD=0

View File

@@ -12,7 +12,7 @@ AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
VITE_DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
@@ -20,7 +20,7 @@ PUBLIC_VAPI_KEY="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnr
PRIVATE_VAPI_KEY="St9UMzcS76Q9yKG6RInAuYydYjFRliqwHTJY3A5wjO0"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SERVER_CRT=fullchain.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PROD=0

View File

@@ -13,7 +13,7 @@ AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
VITE_DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:paolo@freeplanet.app"
@@ -21,7 +21,7 @@ PUBLIC_VAPI_KEY="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnr
PRIVATE_VAPI_KEY="St9UMzcS76Q9yKG6RInAuYydYjFRliqwHTJY3A5wjO0"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SERVER_CRT=fullchain.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PROD=0

File diff suppressed because it is too large Load Diff

View File

@@ -417,7 +417,7 @@ async function mystart() {
}
mycron();
if (!process.env.DEBUG) {
if (!process.env.VITE_DEBUG) {
mycron();
}
}
@@ -546,14 +546,14 @@ function testmsgwebpush() {
// Cron every X minutes
cron.schedule('*/1 * * * *', () => {
// console.log('Running Cron Job');
// if (!process.env.DEBUG) {
// if (!process.env.VITE_DEBUG) {
mycron();
// }
});
// Cron every X minutes
cron.schedule('*/60 * * * *', async () => {
if (!process.env.DEBUG) {
if (!process.env.VITE_DEBUG) {
mycron_30min();
}
});

View File

@@ -1,170 +0,0 @@
Ven 02/12 ORE 11:16: USER [surya1977]: 💫🍚 progetto riso: 🍚💫
rete italiana di scambio orizzontale
siamo una rete di comunità consapevoli, basata sul sostegno reciproco, la fiducia, la condivisione e l'ascolto.
coltiviamo terreno fertile per creare, in armonia con la natura, un mondo di collettività libere e autosufficienti, attraverso un circuito di scambio di esperienze umane, beni e servizi.
1⃣ 👉🏻 entra nel canale progetto riso:
sul post fissato in alto, troverai tutte le info sul progetto e su come entrare nel gruppo della tua provincia.
2⃣ 👉🏻 registrati alla app di riso (anche da pc), dove potrai:
✅ inserire i tuoi talenti e ciò che sai fare, offrendo beni, servizi, ospitalità, eventi.
✅ entrare nel circuito della tua città per condividere e scambiare di persona.
✅ utilizzare il ris come strumento di scambio (moneta virtuale) tra i membri della comunità territoriale della tua provincia.
👉🏻 🔥 clicca qui per registrarti su riso app
entrando sul bot riso premi su avvia (o start) e segui le istruzioni
3⃣ condividi il progetto ai tuoi amici ed aiuta così a far crescere questa rete e crescere insieme 💚 partecipa al cambiamento. riso sei anche tu.
se hai bisogno di aiuto chiedi in questa chat: 👉🏻 chat riso help
Gio 05/01 ORE 19:28: USER [paoloar77]: vai al sito
Gio 05/01 ORE 19:28: USER [paoloar77]: link da condividere
Gio 16/02 ORE 18:14: USER [paoloar77]: vai al sito
Mar 06/06 ORE 19:39: USER [paoloar77]: ciaooooooooooooooooo
Mar 06/06 ORE 19:54: USER [paoloar77]: dasjdalksjdasdklasjkldasjlkdjasl
Sab 17/06 ORE 20:03: USER [paoloar77]: pro v adsasdasdaksdas
Dom 18/06 ORE 19:22: USER [paoloar77]: /start inv
Dom 18/06 ORE 19:42: USER [paoloar77]: /start inv
Dom 18/06 ORE 19:58: USER [paoloar77]: /start inv
Dom 18/06 ORE 19:59: USER [paoloar77]: /start inv
Dom 18/06 ORE 19:59: USER [paoloar77]: /start inv
Ven 23/06 ORE 14:08: USER [paoloar77]: link da condividere
Sab 30/09 ORE 00:21: USER [SuryaArena]: vai al sito
Sab 30/09 ORE 00:32: USER [SuryaArena]: vai al sito
Gio 12/10 ORE 11:11: USER [paoloar77]: prova
Gio 12/10 ORE 11:48: USER [paoloar77]: prova
Gio 12/10 ORE 12:07: USER [SuryaArena]: prova
Gio 12/10 ORE 12:07: USER [SuryaArena]: prova
Gio 12/10 ORE 12:09: USER [SuryaArena]: prova
Gio 12/10 ORE 12:10: USER [SuryaArena]: prova
Gio 12/10 ORE 12:10: USER [SuryaArena]: prova
Gio 12/10 ORE 12:13: USER [SuryaArena]: prova
Gio 12/10 ORE 12:14: USER [SuryaArena]: prova
Gio 12/10 ORE 12:16: USER [SuryaArena]: prova
Gio 12/10 ORE 12:21: USER [SuryaArena]: prova
Gio 12/10 ORE 12:33: USER [paoloar77]: prova
Gio 12/10 ORE 12:33: USER [SuryaArena]: ciao
Gio 12/10 ORE 12:33: USER [SuryaArena]: prova
Gio 12/10 ORE 12:45: USER [SuryaArena]: bottone
Gio 12/10 ORE 14:49: USER [paoloar77]: bottone
Gio 12/10 ORE 14:49: USER [paoloar77]: bottone
Gio 12/10 ORE 14:49: USER [paoloar77]: bottone
Gio 12/10 ORE 14:52: USER [paoloar77]: bottone
Gio 12/10 ORE 14:57: USER [paoloar77]: bottone
Gio 12/10 ORE 15:06: USER [paoloar77]: bottone
Ven 13/10 ORE 11:05: USER [SuryaArena]: bottone
Ven 13/10 ORE 11:40: USER [SuryaArena]: bottone
Dom 17/12 ORE 15:38: USER [admin]: prova
Dom 17/12 ORE 16:18: USER [admin]: vai al sito
Dom 17/12 ORE 16:19: USER [admin]: vai al sito
Dom 17/12 ORE 16:19: USER [admin]: il mio profilo
Dom 17/12 ORE 16:19: USER [admin]: prova
Dom 17/12 ORE 16:19: USER [admin]: link da condividere
Sab 30/12 ORE 20:06: USER [admin]: gruppo di acquisto per le arance:
produttore:
🍊sicilia frutta express (catania)
la piccola azienda a conduzione familiare di giovanni si trova in provincia di catania (sicilia), i frutti vengono prodotti rispettando i principi della biodinamica infatti non viene utilizzato nulla di chimico (niente irrorazioni) e la concimazione avviene tramite concimi naturali (letame).
⚠️ offerta sconto valida solo fino al 3 gennaio 2024, raggiungendo 100 kg totali di ordini di arance:
i prezzi sono compresi di spese di spedizione e di gestione.
🍊 arance tarocco spremuta: 1,20 € / kg
🥑 avocado: 7,80 € / kg
🍋 limoni: 2,40 € / kg
👉🏻 entra sul gruppo telegram piu che buono
per le prenotazioni potete registratevi sul nuovo sito:
👉🏻 piu che buono - gas e bottega (piuchebuono.app)
come funziona:
- registratevi su piuchebuono.app, verificate la email.
- accedete e poi cliccate su "gruppo di acquisto".
- cliccate sul carrello verde 🛒 per aggiungere i kg che desiderate.
- per finire: cliccare su "procedi all'ordine" e confermate.
Dom 21/01 ORE 19:00: USER [paoloar77]: 👉🏻 indietro
Mar 23/04 ORE 22:31: USER [paoloar77]: ciao
Mer 24/04 ORE 20:45: USER [paoloar77]: invia a paolo
Mer 24/04 ORE 20:45: USER [paoloar77]: 📨 invia a paolo
Mer 24/04 ORE 20:58: USER [paoloar77]: grass e prova italic
Mer 24/04 ORE 21:19: USER [paoloar77]: 👍 si
Mer 24/04 ORE 22:02: USER [paoloar77]: ✅ la regolarizzazione può avv
Mer 24/04 ORE 22:15: USER [paoloar77]: ❗importante❗
💚🍚 cari membri dei circuiti ris,
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il regolamento di funzionamento dei circuiti ris.
📖 leggi qui il regolamento (https://riso.app/regolamento)
il gruppo dei facilitatori territoriali di riso ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del regolamento (indicata in corsivo):
➡️ "… ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro * , entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la comunità, in accordo con il gruppo tecnico, deliberi il rientro di alcune posizioni con decisione motivata; lutente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
✅ * la regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
📣 invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel gruppo territoriale, oppure come commento a questo stesso post, pubblicato sul canale progetto riso, entro il giorno 5 maggio
https://t.me/riso_canale/739
in attesa di riscontri, salutiamo! 🍚💚
il gruppo dei facilitatori territoriali riso
Mer 03/07 ORE 13:13: USER [paoloar77]: ciao

View File

@@ -16,7 +16,7 @@
"engines": {
"node": "^18.19.0"
},
"author": "Paolo Arena",
"author": "Surya",
"license": "MIT",
"dependencies": {
"basic-ftp": "^5.0.2",
@@ -28,7 +28,7 @@
"country-codes-list": "^1.6.8",
"crypto-js": "^4.1.1",
"csurf": "^1.11.0",
"dotenv": "^16.0.2",
"dotenv": "^16.4.7",
"ejs": "^3.1.8",
"email-templates": "^10.0.1",
"express": "^4.18.1",
@@ -53,6 +53,7 @@
"node-telegram-bot-api": "^0.65.1",
"nodemailer": "^6.7.8",
"npm-check-updates": "^16.14.18",
"openai": "^4.83.0",
"pdf-lib": "^1.17.1",
"pdf-parse": "^1.1.1",
"pem": "^1.14.6",
@@ -64,6 +65,7 @@
"save": "^2.5.0",
"sharp": "^0.30.7",
"superagent": "^8.0.0",
"tedious": "^18.6.1",
"url-parse": "^1.5.10",
"validator": "^13.7.0",
"vhost": "^3.0.2",

View File

@@ -0,0 +1,27 @@
require("dotenv").config();
const { Sequelize } = require("sequelize");
const sequelize = new Sequelize(process.env.DB_DATABASE_SQLSRVTEST, process.env.DB_USERNAME_SQLSRVTEST, process.env.DB_PASSWORD_SQLSRVTEST, {
host: process.env.DB_HOST_SQLSRVTEST || "localhost",
port: process.env.DB_PORT_SQLSRVTEST || 1433,
dialect: "mssql",
dialectOptions: {
options: {
encrypt: false, // Cambia a true se usi SSL
},
},
logging: false, // Disabilita il logging delle query
});
async function testConnection() {
try {
await sequelize.authenticate();
console.log("Connessione al database riuscita!");
} catch (error) {
console.error("Errore nella connessione al database:", error);
}
}
testConnection();
module.exports = sequelize;

View File

@@ -0,0 +1,460 @@
const axios = require('axios');
const server_constants = require('../tools/server_constants');
const shared_consts = require('../tools/shared_nodejs');
const SERVER_A_URL = process.env.SERVER_A_URL || "http://IP_DI_SERVER_A:3000";
const API_KEY = process.env.API_KEY_MSSQL;
// Funzione per ottenere i dati
const getArticlesSales = async () => {
try {
const query = `
SELECT
a.IdArticolo, a.Titolo, a.DataPubblicazione, a.Ean13 AS isbn,
a.IdCollana, y.DescrizioneCollana, i2.DescrArgomento, a.ListaArgomenti,
a.Pagine, a.IdTipoFormato, a.Misure,
COALESCE(o.totVen, 0) as totVen, COALESCE(u.totFat, 0) as totFat,
COALESCE(p.rank3M, 0) as rank3M, COALESCE(t.fatrank3M, 0) as fatrank3M,
COALESCE(q.rank6M, 0) as rank6M, COALESCE(r.rank1Y, 0) as rank1Y,
COALESCE(t.fat3mesi, 0) as fatLast3M, COALESCE(p.venduti3mesi, 0) as vLast3M,
COALESCE(q.venduti6mesi, 0) as vLast6M, COALESCE(r.venduti1anno, 0) as vLastY,
s.ultimoOrdine as dataUltimoOrdine
FROM T_WEB_Articoli a
LEFT JOIN (SELECT CodArticoloGM, SUM(Qta) as totVen FROM T_WEB_Ordini GROUP BY CodArticoloGM) o
ON a.IdArticolo = o.CodArticoloGM
LEFT JOIN (SELECT CodArticolo, SUM(TRY_CAST(Qta AS INT)) as totFat FROM T_WEB_ArticoliFatturati WHERE ISNUMERIC(Qta) = 1 GROUP BY CodArticolo) u
ON a.IdArticolo = u.CodArticolo
WHERE a.IdStatoProdotto IS NOT NULL
ORDER BY totVen DESC;
`;
const response = await axios.post(SERVER_A_URL + '/query', { query }, {
headers: { 'x-api-key': API_KEY }
});
return response.data || [];
} catch (error) {
console.error("Errore nel recupero degli articoli:", error);
throw new Error("Errore nel recupero degli articoli venduti.");
}
};
// Endpoint per ottenere i dati in formato JSON
exports.getArticlesSalesHandler = async (req, res) => {
try {
const data = await getArticlesSales();
if (!data.length) return res.status(404).json({ message: "Nessun articolo trovato." });
res.json(data);
} catch (error) {
res.status(500).json({ error: error.message });
}
};
// Endpoint per esportare i dati come file JSON
exports.exportArticlesSalesByJSON = async (req, res) => {
try {
const data = await getArticlesSales();
if (!data.length) return res.status(404).json({ message: "Nessun articolo trovato." });
res.setHeader("Content-Type", "application/json");
res.setHeader("Content-Disposition", `attachment; filename="ranking_articles_${new Date().toISOString().split('T')[0]}.json"`);
res.json(data);
} catch (error) {
res.status(500).json({ error: error.message });
}
};
const formatDate = (dateValue) => {
const date = new Date(dateValue);
const day = String(date.getDate()).padStart(2, '0');
const month = String(date.getMonth() + 1).padStart(2, '0');
const year = date.getFullYear();
return `${day}/${month}/${year}`;
};
const getTableContent = async (options) => {
try {
// Verifica se la tabella esiste
const checkTableQuery = `SELECT COUNT(*) as tableExists FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '${options.nameTable}'`;
const checkResponse = await axios.post(SERVER_A_URL + '/query', { query: checkTableQuery }, {
headers: { 'x-api-key': API_KEY }
});
if (!checkResponse.data || checkResponse.data.length === 0 || checkResponse.data[0].tableExists === 0) {
return `La tabella '${options.nameTable}' non esiste.`;
}
// Recupera le colonne della tabella principale dal catalogo
const columnsQuery = `SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '${options.nameTable}'`;
const columnsResponse = await axios.post(SERVER_A_URL + '/query', { query: columnsQuery }, {
headers: { 'x-api-key': API_KEY }
});
const tableColumns = columnsResponse.data.map(col => col.COLUMN_NAME);
// Mappatura per unire i campi (ID e Descrizione)
const mergedMapping = {
"IdStatoProdotto": "DescrizioneStatoProdotto",
"IdTipologia": "DescrizioneTipologia",
"IdTipoFormato": "DescrizioneFormato",
"IdCollana": "DescrizioneCollana",
"ListaArgomenti": "DescrArgomento",
"ListaAutori": "AutoriCompleti",
"IdMarchioEditoriale": "CasaEditrice",
};
// Costruisce la query per recuperare i record
let dataQuery = "";
let columnsToShow = 'T.*';
if (options.fieldGM) {
columnsToShow = 'T.' + options.fieldGM;
}
if (options.nameTable.toLowerCase() === 't_web_articoli') {
if (true) {
dataQuery = `
SELECT TOP ${options.numrec}
${columnsToShow}
` + (options.campispeciali ? `
,f.DescrizioneStatoProdotto
,i.DescrizioneTipologia
,n.DescrizioneFormato
,y.DescrizioneCollana
,z.AutoriCompleti
,i2.DescrArgomento
,z3.CasaEditrice` : ``) + (options.showQtaDisponibile ? ` ,q.QtaDisponibile ` : ``) +
` FROM T_WEB_Articoli T
JOIN(
SELECT IdArticolo, MAX(DataOra) AS data
FROM T_WEB_Articoli
GROUP BY IdArticolo
) b ON T.IdArticolo = b.IdArticolo AND T.DataOra = b.data `
+ (options.campispeciali ?
` LEFT JOIN(
SELECT e.IdStatoProdotto, e.Descrizione as DescrizioneStatoProdotto
FROM T_WEB_StatiProdotto e
JOIN(
SELECT IdStatoProdotto, MAX(DataOra) as data1
FROM T_WEB_StatiProdotto
GROUP BY IdStatoProdotto
) c ON e.IdStatoProdotto = c.IdStatoProdotto AND e.DataOra = c.data1
) f ON T.IdStatoProdotto = f.IdStatoProdotto
LEFT JOIN(
SELECT g.IdTipologia, g.Descrizione as DescrizioneTipologia
FROM T_WEB_Tipologie g
JOIN(
SELECT IdTipologia, MAX(DataOra) as data1
FROM T_WEB_Tipologie
GROUP BY IdTipologia
) h ON g.IdTipologia = h.IdTipologia AND g.DataOra = h.data1
) i ON T.IdTipologia = i.IdTipologia
LEFT JOIN(
SELECT l.IdTipoFormato, l.Descrizione as DescrizioneFormato
FROM T_WEB_TipiFormato l
JOIN(
SELECT IdTipoFormato, MAX(DataOra) as data1
FROM T_WEB_TipiFormato
GROUP BY IdTipoFormato
) m ON l.IdTipoFormato = m.IdTipoFormato AND l.DataOra = m.data1
) n ON T.IdTipoFormato = n.IdTipoFormato
LEFT JOIN(
SELECT v.IdCollana, v.Descrizione as DescrizioneCollana
FROM T_WEB_Collane v
INNER JOIN(
SELECT IdCollana, MAX(ID) as MaxID
FROM T_WEB_Collane
GROUP BY IdCollana
) x ON v.IdCollana = x.IdCollana AND v.ID = x.MaxID
) y ON T.IdCollana = y.IdCollana
LEFT JOIN(
SELECT g2.IdArgomento, g2.Descrizione as DescrArgomento
FROM T_WEB_Argomenti g2
INNER JOIN(
SELECT IdArgomento, MAX(DataOra) as data12
FROM T_WEB_Argomenti
GROUP BY IdArgomento
) h ON g2.IdArgomento = h.IdArgomento AND g2.DataOra = h.data12
) i2 ON T.ListaArgomenti = i2.IdArgomento
LEFT JOIN(
SELECT
T1.IdArticolo,
STUFF((
SELECT ',' + ISNULL(A2.AutoreCompleto, '')
FROM(
SELECT CAST('<root><x>' + REPLACE(T1.ListaAutori, ',', '</x><x>') + '</x></root>' AS XML) AS DataXML
) X
CROSS APPLY X.DataXML.nodes('/root/x') AS A(x)
CROSS APPLY(
SELECT TRY_CAST(LTRIM(RTRIM(A.x.value('.', 'VARCHAR(100)'))) AS INT) AS AutoreID
) CA
JOIN(
SELECT a.IdAutore, CONCAT(a.Nome, ' ', a.Cognome) AS AutoreCompleto
FROM T_WEB_Autori a
JOIN(
SELECT IdAutore, MAX(DataOra) AS maxData
FROM T_WEB_Autori
GROUP BY IdAutore
) aa ON a.IdAutore = aa.IdAutore AND a.DataOra = aa.maxData
) A2 ON CA.AutoreID = A2.IdAutore
FOR XML PATH(''), TYPE
).value('.', 'NVARCHAR(MAX)'), 1, 1, '') AS AutoriCompleti
FROM T_WEB_Articoli T1
GROUP BY T1.IdArticolo, T1.ListaAutori
) z ON T.IdArticolo = z.IdArticolo
LEFT JOIN(
SELECT a3.IdMarchioEditoriale, a3.Descrizione as CasaEditrice
FROM T_WEB_MarchiEditoriali a3
JOIN(
SELECT IdMarchioEditoriale, MAX(DataOra) as maxData
FROM T_WEB_MarchiEditoriali
GROUP BY IdMarchioEditoriale
) aa3 ON a3.IdMarchioEditoriale = aa3.IdMarchioEditoriale AND a3.DataOra = aa3.maxData
) z3 ON T.IdMarchioEditoriale = z3.IdMarchioEditoriale `
: ``)
+ (options.showQtaDisponibile ?
` LEFT JOIN(
SELECT o.Codice, o.QtaDisponibile
FROM T_WEB_Disponibile o
JOIN(
SELECT Codice, MAX(DataOra) as data1
FROM T_WEB_Disponibile
GROUP BY Codice
) p ON o.Codice = p.Codice AND o.DataOra = p.data1
) q ON T.IdArticolo = q.Codice` : ``)
} else {
dataQuery += `
SELECT TOP ${options.numrec}
T.*
FROM T_WEB_Articoli T
JOIN(
SELECT IdArticolo, MAX(DataOra) AS data
FROM T_WEB_Articoli
GROUP BY IdArticolo
) b ON T.IdArticolo = b.IdArticolo AND T.DataOra = b.data
`;
}
} else {
dataQuery = `SELECT TOP ${options.numrec} * FROM ${options.nameTable} `;
}
if (options.where && options.where.trim() !== "") {
dataQuery += ` WHERE ${options.where} `;
}
// Esegue la query per recuperare i dati
console.log('dataQuery', dataQuery);
const dataResponse = await axios.post(SERVER_A_URL + '/query', { query: dataQuery }, {
headers: { 'x-api-key': API_KEY }
});
const records = dataResponse.data;
if (!records || records.length === 0) {
return `Nessun record trovato nella tabella '${options.nameTable}'.`;
}
// Determina quali colonne visualizzare.
let displayColumns;
if (options.nameTable.toLowerCase() === 't_web_articoli') {
// Usa tutte le proprietà del record, escludendo le colonne dei campi uniti (quelle usate per il merge)
displayColumns = Object.keys(records[0]).filter(col => !Object.values(mergedMapping).includes(col));
} else {
displayColumns = tableColumns;
}
// Funzione per ottenere il valore da visualizzare, fondendo i campi se presente nella mappatura
const getDisplayValue = (record, col) => {
let value = record[col] ?? 'NULL';
// Format date solo se il nome della colonna indica una data/ora
if ((col.toLowerCase().includes("data") || col.toLowerCase().includes("ora")) && value !== 'NULL') {
if (value.includes(',')) {
// Se ci sono più valori separati da virgola, formatta ciascuno se è una data valida
value = value.split(',')
.map(item => {
const trimmed = item.trim();
const parsed = Date.parse(trimmed);
return !isNaN(parsed) ? formatDate(trimmed) : trimmed;
})
.join(', ');
} else {
const parsed = Date.parse(value);
if (!isNaN(parsed)) {
value = formatDate(value);
}
}
}
if (mergedMapping[col]) {
return `${record[mergedMapping[col]] || ''} (${value})`;
}
return value;
};
// Costruisce l'output HTML
let output = "";
if (options.outhtml) {
if (records.length === 1) {
// Se c'è un solo record, visualizza una lista di chiavi e valori
const record = records[0];
output += `
< table border = '1' style = "border-collapse: collapse; width: 50%;" >
<thead>
<tr>
<th style="padding: 8px; background-color: #f2f2f2;">Campo</th>
<th style="padding: 8px; background-color: #f2f2f2;">Valore</th>
</tr>
</thead>
<tbody>
`;
displayColumns.forEach(column => {
output += `
<tr>
<td style="padding: 8px;">${column}</td>
<td style="padding: 8px;">${getDisplayValue(record, column)}</td>
</tr>
`;
});
output += `
</tbody>
</table >
`;
} else {
// Se ci sono più record, visualizza una tabella con intestazioni
output += "<table border='1' style='border-collapse: collapse; width: 100%;'><thead><tr>";
displayColumns.forEach(column => {
output += `< th style = "padding: 8px; background-color: #f2f2f2;" > ${column}</th > `;
});
output += "</tr></thead><tbody>";
records.forEach(record => {
output += "<tr>";
displayColumns.forEach(column => {
output += `< td style = "padding: 8px;" > ${getDisplayValue(record, column)}</td > `;
});
output += "</tr>";
});
output += "</tbody></table>";
}
} else {
// solo dati
output = {};
if (options.fieldGM) {
if (records && records.length === 1) {
output[options.fieldGM] = records[0][options.fieldGM];
}
} else {
output = [];
records.forEach(record => {
let myrec = {}
displayColumns.forEach(column => {
myrec[column] = `${getDisplayValue(record, column)} `;
});
output.push(myrec)
});
}
}
return output;
} catch (error) {
console.error("Errore nel recupero della tabella: ", error.message);
if (options.outhtml) {
output = `
<head>
<meta charset="UTF-8">
<title>Errore nel Recupero della Tabella ${options.nameTable}</title>
<style>
body {
font - family: Arial, sans-serif;
background-color: #f7f7f7;
color: #333;
padding: 20px;
}
.error-container {
background - color: #ffe6e6;
border: 1px solid #ff4d4d;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
max-width: 800px;
margin: auto;
}
.error-title {
font - size: 24px;
font-weight: bold;
color: #d8000c;
margin-bottom: 10px;
}
.error-message {
font - size: 16px;
white-space: pre-wrap;
background: #fff;
padding: 10px;
border: 1px solid #ddd;
border-radius: 3px;
}
</style>
</head>
<body>
<div class="error-container">
<div class="error-title">Errore nel Recupero della Tabella ${options.nameTable} con query: ${options.where}</div>
<div class="error-message">
${error.response.data.error || error.stack || error.message}
</div>
</div>
</body>
`;
}
return output;
// throw new Error("Errore nel recupero della tabella.");
}
};
// Endpoint per mostrare i dati della tabella
exports.viewTable = async (req, res) => {
try {
const options = req.body.options;
const tableContent = await getTableContent(options);
let out = {};
if (options.outhtml) {
out = `
<h2>Tabella: ${options.nameTable}</h2>
${tableContent}
`
} else {
out = tableContent;
}
return res.send({ code: server_constants.RIS_CODE_OK, data: out });
} catch (error) {
console.error('Error: ', error);
return res.send({ code: server_constants.RIS_CODE_ERR, error });
}
};
// Endpoint per mostrare i dati della tabella
exports.queryTable = async (req, res) => {
try {
const options = req.body.options;
const tableContent = await getTableContent(options);
let out = {};
if (options.outhtml) {
out = `
<h2>Tabella: ${options.nameTable}</h2>
${tableContent}
`
} else {
out = tableContent;
}
return res.send({ code: server_constants.RIS_CODE_OK, data: out });
} catch (error) {
console.error('Error: ', error);
return res.send({ code: server_constants.RIS_CODE_ERR, error });
}
};

View File

@@ -127,5 +127,6 @@
"🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.": "🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.",
"🚫 %s ha rifiutato l'accesso alla App a %s !": "🚫 %s ha rifiutato l'accesso alla App a %s !",
"✅ Hai Ammesso l'accesso alla App a %s !": "✅ Hai Ammesso l'accesso alla App a %s !",
"Good: %": "Good: %"
"Good: %": "Good: %",
"Service: %": "Service: %"
}

View File

@@ -13,12 +13,12 @@ mongoose.plugin(schema => {
});
const CatAISchema = new Schema({
_id: {
type: Number,
},
name: {
type: String,
},
idapp: {
type: String,
},
img: {
type: String,
},
@@ -47,7 +47,7 @@ CatAISchema.statics.executeQueryTable = function (idapp, params) {
};
CatAISchema.statics.findAllIdApp = async function (idapp) {
const myfind = {};
const myfind = { idapp };
return await CatAI.find(myfind).sort({ name: 1 });
};

128
src/server/models/catalog.js Executable file
View File

@@ -0,0 +1,128 @@
const mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
const { ObjectId } = require('mongodb');
const { IImg } = require('../models/myscheda');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const CatalogSchema = new Schema({
idapp: {
type: String,
},
active: {
type: Boolean,
default: false,
},
title: {
type: String,
},
foto_collana: IImg,
idCollane: [{
type: Number,
}],
argomenti: [{
type: String,
}],
editore: [{ type: String }],
descr_introduttiva: {
type: String,
},
idPageAssigned: {
type: String,
},
idPageAssigned_stampa: {
type: String,
},
referenti: [{
type: String,
}],
img_bordata: IImg,
img_intro: IImg,
img_bordata_stampa: IImg,
img_intro_stampa: IImg,
pagina_introduttiva_sfondo_nero: {
type: Boolean,
},
pdf_generato: String,
data_generato: {
type: Date,
},
pdf_online: String,
data_online: {
type: Date,
},
date_created: {
type: Date,
default: Date.now
},
date_updated: {
type: Date,
},
});
/*
TOLTO ALTRIMENTI su /settable non mi crea l'ID
CatalogSchema.pre('save', async function (next) {
if (this.isNew) {
this._id = new ObjectId();
}
next();
});
*/
CatalogSchema.statics.getFieldsForSearch = function () {
return [{ field: 'title', type: tools.FieldType.string }]
};
CatalogSchema.statics.executeQueryTable = function (idapp, params, user) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params, user);
};
CatalogSchema.statics.findAllIdApp = async function (idapp) {
const Catalog = this;
const arrrec = await Catalog.aggregate([
// Filtra i documenti per idapp
{ $match: { idapp } },
// Ordina i risultati per titolo
{ $sort: { title: 1 } },
// Esegui il join con la collezione Collana
{
$lookup: {
from: "collanas", // Nome della collezione Collana
localField: "idCollane", // Campo in Catalog
foreignField: "idCollana", // Campo in Collana
as: "collana_info" // Nome del campo che conterrà i risultati del join
}
},
]);
return arrrec;
};
const Catalog = mongoose.model('Catalog', CatalogSchema);
Catalog.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Catalog };

View File

@@ -16,6 +16,9 @@ const CatProdSchema = new Schema({
idapp: {
type: String,
},
idArgomento: {
type: Number,
},
name: {
type: String,
},
@@ -55,6 +58,36 @@ CatProdSchema.statics.findAllIdApp = async function (idapp) {
return await CatProd.find(myfind).sort({ name: 1 });
};
CatProdSchema.statics.getCatProdWithTitleCount = async function (idapp) {
try {
const result = await CatProd.aggregate([
{ $match: { idapp } },
{
$lookup: {
from: 'productinfos', // Nome della tua collezione productInfo
localField: '_id',
foreignField: 'idCatProds',
as: 'products'
}
},
{
$project: {
_id: 1,
name: 1,
quanti: { $size: '$products' } // Conta il numero di prodotti per ciascun CatProd
}
},
{ $sort: { name: 1 } } // Ordina i risultati per nome
]);
return result;
} catch (error) {
console.error('Error retrieving CatProd with title count:', error);
throw error;
}
}
const CatProd = mongoose.model('CatProd', CatProdSchema);
CatProd.createIndexes((err) => {

View File

@@ -279,7 +279,7 @@ CircuitSchema.statics.isCircuitAdmin = async function (idrec, username) {
const mycirc = await Circuit.findOne({ _id: idrec }).lean();
if (mycirc) {
return mycirc.admins.some(admin => admin.username === username);
return mycirc.admins.some(admin => (admin.username === username) || (admin.username === shared_consts.USER_ADMIN_CIRCUITS));
}
return false;
@@ -1003,7 +1003,9 @@ CircuitSchema.statics.getListAdminsByCircuitPath = async function (idapp, circui
{ deleted: { $exists: true, $eq: false } }],
}, { admins: 1 }).lean();
return arr && arr.admins ? arr.admins : [];
let myarr = arr && arr.admins ? arr.admins : [];
return [...myarr, shared_consts.USER_ADMIN_CIRCUITS]
};
@@ -1206,7 +1208,7 @@ CircuitSchema.statics.isAdminCircuit = async function (idapp, circuitname, usern
if (arr) {
for (const admin of arr.admins) {
if (admin.username === username)
if ((admin.username === username) || (shared_consts.USER_ADMIN_CIRCUITS === username))
return true;
}
}

View File

@@ -18,10 +18,7 @@ const CollanaSchema = new Schema({
idCollana: {
type: Number,
},
descrizione: {
type: String,
},
Descrizione_Estesa: {
title: {
type: String,
},
dataOra: {
@@ -40,7 +37,7 @@ var Collana = module.exports = mongoose.model('Collana', CollanaSchema);
module.exports.getFieldsForSearch = function () {
return [
{ field: 'descrizione', type: tools.FieldType.string },
{ field: 'title', type: tools.FieldType.string },
]
};
@@ -52,7 +49,7 @@ module.exports.executeQueryTable = function (idapp, params) {
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Collana.find(myfind).sort({name: 1, surname: 1});
return await Collana.find(myfind).sort({title: 1}).lean();
};
module.exports.createIndexes((err) => {

View File

@@ -70,7 +70,7 @@ module.exports.executeQueryTable = function (idapp, params) {
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Gasordine.find(myfind);
return await Gasordine.find(myfind).sort({dataora_chiusura_ordini: -1}).lean();
};

View File

@@ -6,6 +6,7 @@ const { ObjectId } = require('mongodb');
const { MySchedaSchema, IDimensioni, IImg, IText, IAreaDiStampa } = require('../models/myscheda');
mongoose.Promise = global.Promise;
mongoose.level = "F";
@@ -60,13 +61,14 @@ const catalogo = new Schema(
excludeproductTypes: [{ type: Number }],
editore: [{ type: String }],
argomenti: [{ type: String }],
idCollana: { type: Number },
idCollane: [{ type: Number }],
sort_field: { type: String },
sort_dir: { type: Number },
pdf: { type: Boolean },
pdf_filename: { type: String },
printable: { type: Boolean },
indebug: { type: Boolean },
maxnumlibri: { type: Number },
first_page: IDimensioni,
last_page: IDimensioni,
@@ -139,6 +141,9 @@ const MyElemSchema = new Schema({
parambool3: {
type: Boolean,
},
parambool4: {
type: Boolean,
},
number: {
type: Number,
},
@@ -176,6 +181,12 @@ const MyElemSchema = new Schema({
width: {
type: Number,
},
heightcard: {
type: String,
},
widthcard: {
type: String,
},
link: {
type: String,
},
@@ -361,29 +372,114 @@ MyElemSchema.statics.findAllIdApp = async function (idapp) {
const myfind = { idapp };
const arrrec = await MyElem.find(myfind).lean().sort({ order: 1 });
const aggiorna = false;
let arrrec = null;
if (aggiorna) {
arrrec = await MyElem.find(myfind).sort({ order: 1 });
for (const elem of arrrec) {
if (elem.heightimg === 'NaNpx') {
elem.heightimg = '';
await elem.save();
}
}
} else {
arrrec = await MyElem.find(myfind).lean().sort({ order: 1 });
}
return arrrec;
};
async function deleteOldMyElems(idapp) {
try {
const { MyPage } = require('../models/mypage');
// 1. Recupera tutti gli _id dalle pagine
const existingPages = await MyPage.find({idapp}).select('_id').lean();
const existingPageIds = existingPages.map(page => page._id.toString());
// 2. Trova gli MyElem che hanno idPage non esistenti in MyPage
const elemsToDelete = await MyElem.find({
idapp,
idPage: { $nin: existingPageIds }
});
if (elemsToDelete.length > 0) {
// 3. Esegui la cancellazione
const result = await MyElem.deleteMany({ idPage: { $nin: existingPageIds } });
console.log(`Cancellati ${result.deletedCount} documenti di MyElem.`);
} else {
console.log('Nessun documento da cancellare.');
}
} catch (error) {
console.error('Errore durante la cancellazione dei documenti:', error);
}
}
MyElemSchema.statics.findallSchedeTemplate = async function (idapp) {
const MyElem = this;
try {
const { MyPage } = require('../models/mypage');
const ris = await MyElem.find({ idapp }).lean();
const schedeTemplate = ris.flatMap(elem =>
elem.catalogo && elem.catalogo.arrSchede ?
elem.catalogo && elem.catalogo.arrSchede ?
elem.catalogo.arrSchede
.filter(scheda => scheda.scheda?.isTemplate)
.map(scheda => ({
...scheda, // mantieni i dati originali della scheda
idPageOrig: elem.idPage // aggiungi l'idPage
}))
}))
: []
);
if (idapp === '18') {
const duplicateIds = schedeTemplate.reduce((acc, scheda) => {
const id = scheda.scheda._id; // Ottieni l'ID della scheda
if (!acc[id]) {
acc[id] = []; // Inizializza un array per tenere traccia delle pagine
}
acc[id].push(scheda.idPageOrig); // Aggiungi l'idPage all'array
return acc;
}, {});
// Filtra i duplicati
const duplicates = Object.entries(duplicateIds)
.filter(([_, pages]) => pages.length > 1) // Mantieni solo gli ID con più di un'istanza
.map(([id, pages]) => ({ id, pages })); // Ottieni ID e pagine corrispondenti
// Recupera i dettagli delle pagine
const pageIds = duplicates.flatMap(dup => dup.pages); // Estrai tutti gli idPage
const pages = await MyPage.find({ idapp, _id: { $in: pageIds } }).lean();
// Crea una mappatura tra idPage e title
const pageMap = pages.reduce((acc, page) => {
acc[page._id] = page.title; // Mappa idPage a title
return acc;
}, {});
// Associa i titoli delle pagine agli ID duplicati
const resultWithTitles = duplicates.map(dup => ({
id: dup.id,
pages: dup.pages.map(_id => ({
_id,
title: pageMap[_id] || 'Titolo non trovato' // Usa la mappatura per trovare il titolo
}))
}));
if (resultWithTitles.length > 0) {
console.log('Duplicati e titoli delle pagine:', JSON.stringify(resultWithTitles, null, 2));
await deleteOldMyElems(idapp);
}
}
return schedeTemplate;
} catch (e) {
console.error('Err', e);
@@ -405,6 +501,7 @@ MyElemSchema.statics.getNewFreeNameTemplate = async function (idapp, idPageOrig,
{
'catalogo.arrSchede.scheda.name': 1,
'catalogo.arrSchede.scheda.isTemplate': 1,
'catalogo.arrSchede.scheda.isPagIntro': 1,
'catalogo.arrSchede.scheda.idPage': 1
});

View File

@@ -34,9 +34,9 @@ const MyGroupSchema = new Schema({
descr: {
type: String,
},
idCatGrp: {
idCatGrp: [{
type: Number,
},
}],
userId: {
type: String,
},
@@ -251,6 +251,7 @@ MyGroupSchema.statics.getWhatToShow = function (idapp, username) {
website: 1,
link_telegram: 1,
note: 1,
da_contattare: 1,
admins: 1,
blocked: 1,
req_users: 1,
@@ -347,6 +348,17 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname
},
},
{ $project: whatToShow },
{
$lookup: {
from: 'catgrps',
localField: 'idCatGrp',
foreignField: '_id',
as: 'recCatGrp',
},
},
{
$project: shared_consts.getProjectByTable(shared_consts.TABLES_MYGROUPS, {}),
},
];

View File

@@ -166,7 +166,7 @@ MyPageSchema.statics.findAllIdApp = async function (idapp) {
return await MyPage.find(myfind, (err, arrrec) => {
return arrrec
});
}).sort({ title: 1 }).lean();
};
MyPageSchema.statics.findOnlyStruttRec = async function (idapp) {
@@ -229,7 +229,7 @@ MyPageSchema.statics.findInternalPages = async function (idapp) {
only_residenti: 1,
}, (err, arrrec) => {
return arrrec
});
}).lean();
};
const MyPage = mongoose.model('MyPage', MyPageSchema);

View File

@@ -113,6 +113,7 @@ const IElementiScheda = new Schema({
const scheletroScheda = {
idapp: { type: String },
isTemplate: { type: Boolean },
isPagIntro: { type: Boolean },
linkIdTemplate: { type: String },
name: { type: String },
numschede_perRiga: { type: Number },
@@ -130,7 +131,7 @@ const scheletroScheda = {
excludeproductTypes: [{ type: Number }],
editore: [{ type: String }],
argomenti: [{ type: String }],
idCollana: { type: Number },
idCollane: [{ type: Number }],
author: { type: String },
sort_field: { type: String },
sort_dir: { type: Number },
@@ -161,4 +162,4 @@ MyScheda.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyScheda, MySchedaSchema, IDimensioni, IImg, IText, IAreaDiStampa };
module.exports = { MyScheda, MySchedaSchema, IDimensioni, IImg, IText, IAreaDiStampa, IImg };

View File

@@ -526,6 +526,20 @@ module.exports.findAllIdApp = async function (idapp, code, id, all) {
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'collanas',
localField: 'productInfo.idCollana',
foreignField: '_id',
as: 'productInfo.collana'
}
},
{
$unwind: {
path: '$productInfo.collana',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'catprods',

View File

@@ -27,6 +27,9 @@ const productInfoSchema = new Schema({
unique: true,
required: true,
},
codice: { // codice interno prodotto
type: String,
},
id_wp: { // id in wordpress
type: String,
},
@@ -119,11 +122,14 @@ const productInfoSchema = new Schema({
type: String,
},
idAuthors: [{ type: Schema.Types.ObjectId, ref: 'Author' }],
idCollana: { type: Schema.Types.ObjectId, ref: 'Collana' },
idCollana: { type: Number },
idPublisher: { type: Schema.Types.ObjectId, ref: 'Publisher' },
collezione: {
type: String,
},
ListaArgomenti: {
type: String,
},
date_pub: {
type: Date,
},
@@ -310,6 +316,84 @@ module.exports.replaceProductImgToImageFile = async function (abilitaserver) {
};
/**
* @typedef {Object} Article
* @property {bigint} Id
* @property {number} IdArticolo
* @property {string} Ean13
* @property {string} Titolo
* @property {string} ListaAutori
* @property {string} ListaArgomenti
* @property {number} IdStatoProdotto
* @property {number} PrezzoIvato
* @property {number} IdMarchioEditoriale
* @property {number} IdCollana
* @property {Date} DataPubblicazione
* @property {number} IdTipologia
* @property {number} IdTipoFormato
* @property {string} Misure
* @property {string} Pagine
* @property {string} Sottotitolo
* @property {string} Durata
* @property {string} Numero
* @property {string} Edizione
* @property {string} Ristampa
* @property {Date} DataInizioCampagna
* @property {Date} DataFineCampagna
* @property {number} ScontoCampagna
* @property {number} PrezzoIvatoScontatoCampagna
* @property {Date} DataOra
* @property {boolean} Enabled
* @property {number} IDTagGruppo
* @property {string} Utente
* @property {number} PercIva
* @property {number} IdTitoloOriginale
* @property {boolean} EnabledAlFresco
* @property {number} CodEdizione
* @property {string} FasciaEta
* @property {string} DescrizioneStatoProdotto
* @property {string} DescrizioneTipologia
* @property {string} DescrizioneFormato
* @property {string} DescrizioneCollana
* @property {string} DescrArgomento
* @property {string} AutoriCompleti
* @property {string} CasaEditrice
*/
/**
* Aggiorna il prodotto basandosi su un articolo
* @param {Article} article - Dati dell'articolo da aggiornare
* @param {boolean} creanew
* @returns {Promise<void>}
*/
module.exports.aggiornaProductFromGMArticle = async function (article, creanew) {
const ProductInfo = this;
try {
if (article) {
// cerca se esiste sul db locale
let findrec = this.find({ sku: article.IdArticolo }).lean();
if (findrec) {
// Articolo Trovato !
} else {
// articolo inesistente, lo vuoi creare ?
if (creanew) {
findrec = null;
}
}
if (findrec) {
}
}
} catch (e) {
console.error('Error aggiornaProductFromGMArticle:', err);
}
};
module.exports.correggiProductTypes = async function () {
const ProductInfo = this;
const bulkOps = [];

View File

@@ -42,7 +42,7 @@ module.exports.executeQueryTable = function (idapp, params) {
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Publisher.find(myfind);
return await Publisher.find(myfind).sort({ name: 1 }).lean();
};
module.exports.createIndexes((err) => {

View File

@@ -15,6 +15,8 @@ mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const OpenAI = require("openai");
const QueryAISchema = new Schema({
idapp: {
type: String,
@@ -73,7 +75,7 @@ QueryAISchema.statics.getFieldsForSearch = function () {
QueryAISchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, 0, params);
return tools.executeQueryTable(this, idapp, params);
};

View File

@@ -241,9 +241,12 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
tag = 'newhosp';
tablerec = 'myhosps';
}
let eventobj = await tools.getAnnuncioForTelegram(recnotif.myrectableorig, tablerec, mydescr, userorig, true);
// newdescr = eventobj.descrperNotif;
recnotif.textcontent_Telegram = eventobj.newdescrtelegram;
if (recnotif.myrectableorig) {
let eventobj = await tools.getAnnuncioForTelegram(recnotif.myrectableorig, tablerec, mydescr, userorig, true);
recnotif.textcontent_Telegram = eventobj.newdescrtelegram;
} else {
recnotif.textcontent_Telegram = newdescr;
}
recnotif.linkaddTelegram = '';
} else if (recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_EVENTS) {
recnotif.openUrl = shared_consts.getDirectoryByTable(shared_consts.TABLES_MYBACHECAS, true) + myidrec;

View File

@@ -360,6 +360,9 @@ const UserSchema = new mongoose.Schema({
note: {
type: String,
},
da_contattare: {
type: Boolean,
},
qualifica: {
type: String,
},
@@ -692,6 +695,14 @@ UserSchema.statics.isEditor = function (perm) {
return false;
}
};
UserSchema.statics.isGrafico = function (perm) {
try {
return ((perm & shared_consts.Permissions.Grafico) ===
shared_consts.Permissions.Grafico);
} catch (e) {
return false;
}
};
UserSchema.statics.isZoomeri = function (perm) {
try {
@@ -867,6 +878,9 @@ UserSchema.statics.findByCredentials = function (idapp, username, password, pwdc
UserSchema.statics.findByUsername = async function (idapp, username, alsoemail, onlyifVerifiedByAportador) {
const User = this;
if (!username)
return null;
const myreg = ['^', username, '$'].join('');
let regexusername = new RegExp(myreg, 'i');
@@ -1902,6 +1916,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.qualifica': 1,
'profile.biografia': 1,
'profile.note': 1,
'profile.da_contattare': 1,
'profile.teleg_id': 1,
'profile.username_telegram': 1,
'profile.firstname_telegram': 1,
@@ -1922,6 +1937,8 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.friends': 1,
email: 1,
date_reg: 1,
perm: 1,
'useraport.perm': 1,
'useraport.username': 1,
'useraport.profile.img': 1,
};
@@ -1949,6 +1966,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.qualifica': 1,
'profile.biografia': 1,
'profile.note': 1,
'profile.da_contattare': 1,
'profile.teleg_id': 1,
'profile.username_telegram': 1,
'profile.firstname_telegram': 1,
@@ -1969,6 +1987,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.friends': 1,
email: 1,
date_reg: 1,
'useraport.perm': 1,
'useraport.username': 1,
'useraport.profile.img': 1,
};
@@ -1997,6 +2016,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.qualifica': 1,
'profile.biografia': 1,
'profile.note': 1,
'profile.da_contattare': 1,
'profile.teleg_id': 1,
'profile.username_telegram': 1,
'profile.firstname_telegram': 1,
@@ -2019,8 +2039,10 @@ UserSchema.statics.getUserProfileByUsername = async function (
'comune': 1,
email: 1,
date_reg: 1,
'useraport.perm': 1,
'useraport.username': 1,
'useraport.profile.img': 1,
perm: 1,
};
}
@@ -3423,6 +3445,7 @@ function getWhatToShow(idapp, username) {
'profile.qualifica': 1,
'profile.biografia': 1,
'profile.note': 1,
'profile.da_contattare': 1,
'profile.username_telegram': 1,
'profile.firstname_telegram': 1,
'profile.lastname_telegram': 1,
@@ -3443,6 +3466,8 @@ function getWhatToShow(idapp, username) {
'profile.friends': 1,
'profile.handshake': 1,
'profile.note': 1,
'profile.da_contattare': 1,
perm: 1,
};
}
@@ -3467,12 +3492,14 @@ function getWhatToShow_Unknown(idapp, username) {
'profile.calc': 1,
date_reg: 1,
'profile.note': 1,
'profile.da_contattare': 1,
'profile.handshake': 1,
'profile.friends': 1,
'profile.favorite': 1,
'profile.bookmark': 1,
'profile.attend': 1,
'profile.seen': 1,
perm: 1,
}
}
@@ -3501,11 +3528,13 @@ UserSchema.statics.getWhatToShow_IfFriends = async function (idapp, username) {
groups: 1,
'profile.handshake': 1,
'profile.note': 1,
'profile.da_contattare': 1,
'profile.friends': 1,
'profile.favorite': 1,
'profile.bookmark': 1,
'profile.attend': 1,
'profile.seen': 1,
perm: 1,
};
};
@@ -5355,6 +5384,8 @@ UserSchema.statics.getQueryReceiveRISUsers = function (idapp, hours) {
"profile.img": 1,
'profile.handshake': 1,
'profile.note': 1,
'profile.da_contattare': 1,
perm: 1,
},
},
];

View File

@@ -1,6 +1,6 @@
module.exports = {
list: [
{_id: 1, descr: 'Offro'},
{_id: 2, descr: 'Cerco'},
{_id: 1, descr: '🟢 Offro'},
{_id: 2, descr: '🔴 Cerco'},
],
};

View File

@@ -1,6 +1,6 @@
module.exports = {
list: [
{_id: 1, descr: 'Offro'},
{_id: 2, descr: 'Cerco'},
{_id: 1, descr: '🟢 Offro'},
{_id: 2, descr: '🔴 Cerco'},
],
};

View File

@@ -0,0 +1,26 @@
const { ObjectId } = require('mongodb');
module.exports = {
list: [
/*{ _id: ObjectId('605c72e2f9b1a019c1e4f4a1'), idapp: '18', title: 'Alimentazione Sana' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a2'), idapp: '18', title: 'Attualità e Informazione Libera' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a3'), idapp: '18', title: 'Psicologia e Crescita Personale' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a4'), idapp: '18', title: 'Educazione e Formazione' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a5'), idapp: '18', title: 'Bambini e Ragazzi Felici' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a6'), idapp: '18', title: 'Salute e Benessere Naturali' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a7'), idapp: '18', title: 'Nuove Scienze' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a8'), idapp: '18', title: 'Spiritualità e Sciamanesimo' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4a9'), idapp: '18', title: 'Storia e Archeologia Segreta' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4aa'), idapp: '18', title: 'Autosufficienza, Autoproduzione e Vita Naturale' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4ab'), idapp: '18', title: 'Yoga' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4ac'), idapp: '18', title: 'Amici Animali' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4ad'), idapp: '18', title: 'Corpi Energetici' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4ae'), idapp: '18', title: 'Erbe, Alberi e Natura' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4af'), idapp: '18', title: 'Astrologia, Esoterismi e Numerologia' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4b0'), idapp: '18', title: 'Universo Femminile' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4b1'), idapp: '18', title: 'Sessualità e Relazione di coppia' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4b2'), idapp: '18', title: 'Tarocchi, Oracoli e Carte' },
{ _id: ObjectId('605c72e2f9b1a019c1e4f4b3'), idapp: '18', title: 'Techiche per il corpo' },
*/
],
};

View File

@@ -2,79 +2,105 @@ module.exports = {
list: [
{
_id: 1,
descr: 'Abitare',
},
{
_id: 2,
descr: 'Arte',
descr: 'Ospitalità ed accoglienza',
color: '#00BCD4',
icon: 'fa fa-bed'
},
{
_id: 3,
descr: 'Alimentazione',
descr: 'Prodotti Alimentari',
color: '#4CAF50',
icon: 'fa fa-apple-alt'
},
{
_id: 4,
descr: 'Artigianato',
descr: 'Prodotti Artigianali e Artistici',
color: '#9C27B0',
icon: 'fa fa-paint-brush'
},
{
_id: 5,
descr: 'Assistenza Legale',
},
{
_id: 6,
descr: 'Benessere',
},
{
_id: 7,
descr: 'Gruppi Locali',
descr: 'Servizi di Assistenza e Integrazione',
color: '#2196F3',
icon: 'fa fa-hands-helping'
},
{
_id: 8,
descr: 'Istruzione',
},
{
_id: 2,
descr: 'Arte',
},
{
_id: 9,
descr: 'Mobilità',
},
{
_id: 10,
descr: 'Sport',
},
{
_id: 11,
descr: 'Servizi',
descr: 'Servizi Formativi ed Educativi',
color: '#FFC107',
icon: 'fa fa-book'
},
{
_id: 12,
descr: 'Tecnologia',
},
{
_id: 13,
descr: 'Turismo',
color: '#607D8B',
icon: 'fa fa-laptop'
},
{
_id: 14,
descr: 'Ecovillaggi / Comunità',
},
{
_id: 15,
descr: 'Feste',
},
{
_id: 16,
descr: 'Altro',
},
{
_id: 17,
descr: 'AutoProduzione',
descr: 'Comunità ed Ecovillaggi',
color: '#8BC34A',
icon: 'fa fa-users'
},
{
_id: 18,
descr: 'Salute',
descr: 'Salute e Benessere',
color: '#E91E63',
icon: 'fa fa-heart'
},
{
_id: 20,
descr: 'Progetti Umanitari (Volontari)',
color: '#F44336',
icon: 'fa fa-hands'
},
{
_id: 31,
descr: 'Servizi per l\'Agricoltura, orto',
color: '#009688',
icon: 'fa fa-leaf'
},
{
_id: 32,
descr: 'Servizi di Distribuzione e Logistica',
color: '#3F51B5',
icon: 'fa fa-truck'
},
{
_id: 33,
descr: 'Servizi di Consulenza',
color: '#CDDC39',
icon: 'fa fa-briefcase'
},
{
_id: 34,
descr: 'Attività Ricreative e di Intrattenim.',
color: '#FF5722',
icon: 'fa fa-music'
},
{
_id: 36,
descr: 'Manutenzione e riparazioni',
color: '#673AB7',
icon: 'fa fa-wrench'
},
{
_id: 37,
descr: 'Cura della persona',
color: '#FFEB3B',
icon: 'fa fa-user'
},
{
_id: 40,
descr: 'Energia',
color: '#03A9F4',
icon: 'fa fa-bolt'
},
{
_id: 41,
descr: 'Servizi e prodotti per la casa',
color: '#FF9800',
icon: 'fa fa-home'
},
],
};
};

View File

@@ -1,189 +1,189 @@
const {ObjectId} = require('mongodb');
const { ObjectId } = require('mongodb');
module.exports = {
list: [
{
"_id" : ObjectId("615a353c002c8298f4495be7"),
"idapp" : "1",
"label" : "Dono",
"__v" : 0
"_id": ObjectId("615a353c002c8298f4495be7"),
"idapp": "1",
"label": "Dono",
"__v": 0
},
{
"_id" : ObjectId("61bc466567de9a1f54b25494"),
"idapp" : "1",
"label" : "Offerta Libera",
"__v" : 0
"_id": ObjectId("61bc466567de9a1f54b25494"),
"idapp": "1",
"label": "Offerta Libera",
"__v": 0
},
{
"_id" : ObjectId("61bc454867de9a1f54b25462"),
"idapp" : "1",
"label" : "Baratto (scambio Beni o Servizi)",
"__v" : 0
"_id": ObjectId("61bc454867de9a1f54b25462"),
"idapp": "1",
"label": "Baratto (scambio Beni o Servizi)",
"__v": 0
},
{
"_id" : ObjectId("61bc482667de9a1f54b2549c"),
"idapp" : "1",
"label" : "Scambio Lavoro",
"__v" : 0
"_id": ObjectId("61bc482667de9a1f54b2549c"),
"idapp": "1",
"label": "Scambio Lavoro",
"__v": 0
},
{
"_id" : ObjectId("61bc482667de9a1f54b2649c"),
"idapp" : "1",
"label" : "Monete Alternative",
"__v" : 0
"_id": ObjectId("61bc482667de9a1f54b2649c"),
"idapp": "1",
"label": "Monete Alternative",
"__v": 0
},
{
"_id" : ObjectId("61bc482667de9a1f54b3549e"),
"idapp" : "1",
"label" : "Euro",
"__v" : 0
"_id": ObjectId("61bc482667de9a1f54b3549e"),
"idapp": "1",
"label": "Euro",
"__v": 0
},
{
"_id" : ObjectId("615a353c002c8298f4495bf7"),
"idapp" : "12",
"label" : "Dono",
"__v" : 0
"_id": ObjectId("615a353c002c8298f4495bf7"),
"idapp": "12",
"label": "Dono",
"__v": 0
},
{
"_id" : ObjectId("61bc466567de9a1f54b254f4"),
"idapp" : "12",
"label" : "Offerta Libera",
"__v" : 0
"_id": ObjectId("61bc466567de9a1f54b254f4"),
"idapp": "12",
"label": "Offerta Libera",
"__v": 0
},
{
"_id" : ObjectId("61bc454867de9a1f54b254f2"),
"idapp" : "12",
"label" : "Baratto",
"__v" : 0
"_id": ObjectId("61bc454867de9a1f54b254f2"),
"idapp": "12",
"label": "Baratto",
"__v": 0
},
{
"_id" : ObjectId("61bc482667de9a1f54b25412"),
"idapp" : "12",
"label" : "Scambio Lavoro",
"__v" : 0
"_id": ObjectId("61bc482667de9a1f54b25412"),
"idapp": "12",
"label": "Scambio Lavoro",
"__v": 0
},
{
"_id" : ObjectId("61bc482667de9a1f64b254ab"),
"idapp" : "12",
"label" : "Monete Alternative",
"__v" : 0
"_id": ObjectId("61bc482667de9a1f64b254ab"),
"idapp": "12",
"label": "Monete Alternative",
"__v": 0
},
{
"_id" : ObjectId("61bc482667de9a1f64b254fb"),
"idapp" : "12",
"label" : "Euro",
"__v" : 0
"_id": ObjectId("61bc482667de9a1f64b254fb"),
"idapp": "12",
"label": "Euro",
"__v": 0
},
{
"_id" : ObjectId("5dbc6b0801234f629f75e98d"),
"idapp" : "2",
"__v" : 0,
"label" : "Offerta Libera"
"_id": ObjectId("5dbc6b0801234f629f75e98d"),
"idapp": "2",
"__v": 0,
"label": "Offerta Libera"
},
/* 2 */
{
"_id" : ObjectId("5dbc6b1001234f629f75e98e"),
"idapp" : "2",
"__v" : 0,
"label" : "Ingresso Gratuito"
"_id": ObjectId("5dbc6b1001234f629f75e98e"),
"idapp": "2",
"__v": 0,
"label": "Ingresso Gratuito"
},
/* 3 */
{
"_id" : ObjectId("5dbc6b1801234f629f75e98f"),
"idapp" : "2",
"__v" : 0,
"label" : "Contributo",
"showprice" : true
"_id": ObjectId("5dbc6b1801234f629f75e98f"),
"idapp": "2",
"__v": 0,
"label": "Contributo",
"showprice": true
},
/* 4 */
{
"_id" : ObjectId("5dbc6b3001234f629f75e990"),
"idapp" : "2",
"__v" : 0
"_id": ObjectId("5dbc6b3001234f629f75e990"),
"idapp": "2",
"__v": 0
},
{
"_id" : ObjectId("602c315137d9f0738ded312f"),
"idapp" : "10",
"__v" : 0,
"label" : "Contributo",
"showprice" : true
"_id": ObjectId("602c315137d9f0738ded312f"),
"idapp": "10",
"__v": 0,
"label": "Contributo",
"showprice": true
},
/* 7 */
{
"_id" : ObjectId("602c316037d9f0738ded3132"),
"idapp" : "10",
"__v" : 0,
"label" : "Gratuito"
"_id": ObjectId("602c316037d9f0738ded3132"),
"idapp": "10",
"__v": 0,
"label": "Gratuito"
},
/* 8 */
{
"_id" : ObjectId("60514b3f733ce468d09366f2"),
"idapp" : "10",
"__v" : 0,
"label" : "Evento ONLINE Gratuito"
"_id": ObjectId("60514b3f733ce468d09366f2"),
"idapp": "10",
"__v": 0,
"label": "Evento ONLINE Gratuito"
},
{
"_id" : ObjectId("515a353c002c8298f4495bf7"),
"idapp" : "13",
"label" : "Dono",
"__v" : 0
"_id": ObjectId("515a353c002c8298f4495bf7"),
"idapp": "13",
"label": "🎁 Dono",
"__v": 0
},
{
"_id" : ObjectId("51bc466567de9a1f54b254f4"),
"idapp" : "13",
"label" : "Offerta Libera",
"__v" : 0
"_id": ObjectId("51bc466567de9a1f54b254f4"),
"idapp": "13",
"label": "💸 Offerta Libera",
"__v": 0
},
{
"_id" : ObjectId("51bc454867de9a1f54b254f2"),
"idapp" : "13",
"label" : "Baratto",
"__v" : 0
"_id": ObjectId("51bc454867de9a1f54b254f2"),
"idapp": "13",
"label": "🤝 Baratto",
"__v": 0
},
{
"_id" : ObjectId("51bc482667de9a1f54b25412"),
"idapp" : "13",
"label" : "Scambio Lavoro",
"__v" : 0
"_id": ObjectId("51bc482667de9a1f54b25412"),
"idapp": "13",
"label": "💪 Scambio Lavoro",
"__v": 0
},
{
"_id" : ObjectId("51bc482667de9a1f64b254ab"),
"idapp" : "13",
"label" : "Monete Alternative",
"__v" : 0
"_id": ObjectId("51bc482667de9a1f64b254ab"),
"idapp": "13",
"label": "🪙 Monete Alternative",
"__v": 0
},
{
"_id" : ObjectId("51bc482667de9a1f64b254ac"),
"idapp" : "13",
"label" : "RIS",
"__v" : 0
"_id": ObjectId("51bc482667de9a1f64b254ac"),
"idapp": "13",
"label": "🍚 RIS",
"__v": 0
},
{
"_id" : ObjectId("51bc482667de9a1f64b254fb"),
"idapp" : "13",
"label" : "Euro",
"__v" : 0
"_id": ObjectId("51bc482667de9a1f64b254fb"),
"idapp": "13",
"label": "💶 Euro",
"__v": 0
},
{
"_id" : ObjectId("51bc482667de9a1f64b254ff"),
"idapp" : "13",
"label" : "Bitcoin",
"__v" : 0
"_id": ObjectId("51bc482667de9a1f64b254ff"),
"idapp": "13",
"label": "Bitcoin",
"__v": 0
},
{
"_id" : ObjectId("51bc482667de9a1f64b255ff"),
"idapp" : "13",
"label" : "Banca del Tempo",
"__v" : 0
},
"_id": ObjectId("51bc482667de9a1f64b255ff"),
"idapp": "13",
"label": "Banca del Tempo",
"__v": 0
}
]
}

View File

@@ -1,85 +1,82 @@
module.exports = {
list: [
{_id: 1, idSectorGood: [1], descr: 'Abbigliamento donna'},
{_id: 2, idSectorGood: [1], descr: 'Abbigliamento uomo'},
{_id: 3, idSectorGood: [1], descr: 'Accessori'},
{_id: 4, idSectorGood: [1], descr: 'Scarpe donna'},
{_id: 5, idSectorGood: [1], descr: 'Scarpe uomo'},
{_id: 6, idSectorGood: [2], descr: 'Bagno'},
{_id: 7, idSectorGood: [2], descr: 'Camera'},
{_id: 8, idSectorGood: [2], descr: 'Complementi d\'arredo'},
{_id: 9, idSectorGood: [2], descr: 'Cucina'},
{_id: 10, idSectorGood: [2], descr: 'Esterno'},
{_id: 11, idSectorGood: [2], descr: 'Soggiorno'},
{_id: 12, idSectorGood: [3], descr: 'Altri veicoli'},
{_id: 13, idSectorGood: [3], descr: 'Auto'},
{_id: 14, idSectorGood: [3], descr: 'Moto'},
{_id: 15, idSectorGood: [3], descr: 'Camper'},
{_id: 16, idSectorGood: [3], descr: 'Van (furgoni camperizzati)'},
{_id: 17, idSectorGood: [4], descr: 'Bigiotteria'},
{_id: 18, idSectorGood: [4], descr: 'Lavoretti'},
{_id: 19, idSectorGood: [4], descr: 'Altro'},
{_id: 20, idSectorGood: [5], descr: 'Accessori bellezza'},
{_id: 21, idSectorGood: [5], descr: 'Creme e detergenti'},
{_id: 22, idSectorGood: [5], descr: 'Trucchi e profumi'},
{_id: 23, idSectorGood: [6], descr: 'Giocattoli e giochi di società'},
{_id: 24, idSectorGood: [6], descr: 'Igiene e pannolini'},
{_id: 25, idSectorGood: [6], descr: 'Lettini e culle'},
{_id: 26, idSectorGood: [6], descr: 'Passeggini & co'},
{_id: 27, idSectorGood: [6], descr: 'Vestiti e scarpe'},
{_id: 28, idSectorGood: [7], descr: 'Bere'},
{_id: 29, idSectorGood: [7], descr: 'Mangiare'},
{_id: 30, idSectorGood: [8], descr: 'Antiquariato'},
{_id: 31, idSectorGood: [8], descr: 'Collezionismo'},
{_id: 32, idSectorGood: [9], descr: 'Altro'},
{_id: 33, idSectorGood: [9], descr: 'Cellulari e accessori'},
{_id: 34, idSectorGood: [9], descr: 'Computer e software'},
{_id: 35, idSectorGood: [9], descr: 'Elettrodomestici'},
{_id: 36, idSectorGood: [9], descr: 'Fotografia'},
{_id: 37, idSectorGood: [9], descr: 'Videogiochi e console'},
{_id: 38, idSectorGood: [10], descr: 'Console'},
{_id: 39, idSectorGood: [10], descr: 'Giochi di società'},
{_id: 40, idSectorGood: [10], descr: 'PC games'},
{_id: 41, idSectorGood: [11], descr: 'Attrezzatura'},
{_id: 42, idSectorGood: [11], descr: 'Materiali'},
{_id: 43, idSectorGood: [11], descr: 'Prodotti'},
{_id: 44, idSectorGood: [11], descr: 'Strumentazione'},
{_id: 45, idSectorGood: [12], descr: ' riviste e fumetti'},
{_id: 46, idSectorGood: [13], descr: 'CD e vinili'},
{_id: 47, idSectorGood: [13], descr: 'Film e DVD'},
{_id: 48, idSectorGood: [13], descr: 'Strumenti musicali'},
{_id: 49, idSectorGood: [14], descr: 'Arredamento'},
{_id: 50, idSectorGood: [14], descr: 'Attrezzature e accessori'},
{_id: 51, idSectorGood: [14], descr: 'Cancelleria e cartucce'},
{_id: 52, idSectorGood: [15], descr: 'Abbigliamento'},
{_id: 53, idSectorGood: [15], descr: 'Attrezzature e accessori Sport'},
{_id: 54, idSectorGood: [15], descr: 'Bici e accessori'},
{_id: 55, idSectorGood: [17], descr: 'Edilizia'},
{_id: 56, idSectorGood: [17], descr: 'Cucina'},
{_id: 57, idSectorGood: [17], descr: 'Modellismo'},
{_id: 58, idSectorGood: [17], descr: 'Cucito'},
{_id: 59, idSectorGood: [17], descr: 'Pulizia'},
{_id: 60, idSectorGood: [17], descr: 'Per Imbiancare'},
{_id: 61, idSectorGood: [17], descr: 'Giardinaggio'},
{_id: 62, idSectorGood: [17], descr: 'Falegnameria'},
{_id: 63, idSectorGood: [7], descr: 'Pane'},
{_id: 64, idSectorGood: [7], descr: 'Pasta'},
{_id: 65, idSectorGood: [7], descr: 'Formaggi'},
{_id: 66, idSectorGood: [7], descr: 'Olio'},
{_id: 67, idSectorGood: [7], descr: 'Fervida'},
{_id: 68, idSectorGood: [7], descr: 'Fermentati'},
{_id: 69, idSectorGood: [7], descr: 'Marmellate'},
{_id: 70, idSectorGood: [7], descr: 'Salse'},
{_id: 71, idSectorGood: [20], descr: 'Cereali'},
{_id: 72, idSectorGood: [20], descr: 'Frutta'},
{_id: 73, idSectorGood: [20], descr: 'Ortaggi'},
{_id: 74, idSectorGood: [20], descr: 'Zootecnia'},
{_id: 75, idSectorGood: [20], descr: 'Giardinaggio'},
{_id: 76, idSectorGood: [20], descr: 'Biologica'},
{_id: 77, idSectorGood: [20], descr: 'Permacultura'},
{_id: 78, idSectorGood: [20], descr: 'Sinergico'},
{_id: 79, idSectorGood: [20], descr: 'Tradizionale'},
{_id: 80, idSectorGood: [20], descr: 'Viticoltura'},
{_id: 81, idSectorGood: [20], descr: 'Acquacoltura'},
{ _id: 1, idSectorGood: [1], descr: 'Abbigliamento donna', icon: 'fas fa-tshirt', color: 'pink' },
{ _id: 2, idSectorGood: [1], descr: 'Abbigliamento uomo', icon: 'fas fa-tshirt', color: 'blue' },
{ _id: 3, idSectorGood: [1], descr: 'Accessori', icon: 'fas fa-glasses', color: 'purple' },
{ _id: 4, idSectorGood: [1], descr: 'Scarpe donna', icon: 'fas fa-shoe-prints', color: 'pink' },
{ _id: 5, idSectorGood: [1], descr: 'Scarpe uomo', icon: 'fas fa-shoe-prints', color: 'blue' },
{ _id: 6, idSectorGood: [2], descr: 'Bagno', icon: 'fas fa-bath', color: 'teal' },
{ _id: 7, idSectorGood: [2], descr: 'Camera', icon: 'fas fa-bed', color: 'indigo' },
{ _id: 8, idSectorGood: [2], descr: 'Complementi d\'arredo', icon: 'fas fa-couch', color: 'brown' },
{ _id: 9, idSectorGood: [2], descr: 'Cucina', icon: 'fas fa-utensils', color: 'orange' },
{ _id: 10, idSectorGood: [2], descr: 'Esterno', icon: 'fas fa-tree', color: 'green' },
{ _id: 11, idSectorGood: [2], descr: 'Soggiorno', icon: 'fas fa-tv', color: 'grey' },
{ _id: 12, idSectorGood: [3], descr: 'Altri veicoli', icon: 'fas fa-car', color: 'black' },
{ _id: 13, idSectorGood: [3], descr: 'Auto', icon: 'fas fa-car', color: 'red' },
{ _id: 14, idSectorGood: [3], descr: 'Moto', icon: 'fas fa-motorcycle', color: 'black' },
{ _id: 15, idSectorGood: [3], descr: 'Camper', icon: 'fas fa-caravan', color: 'orange' },
{ _id: 16, idSectorGood: [3], descr: 'Van (furgoni camperizzati)', icon: 'fas fa-truck', color: 'blue' },
{ _id: 17, idSectorGood: [4], descr: 'Bigiotteria', icon: 'fas fa-gem', color: 'gold' },
{ _id: 18, idSectorGood: [4], descr: 'Lavoretti', icon: 'fas fa-paint-brush', color: 'yellow' },
{ _id: 19, idSectorGood: [4], descr: 'Altro', icon: 'fas fa-question', color: 'grey' },
{ _id: 20, idSectorGood: [5], descr: 'Accessori bellezza', icon: 'fas fa-spa', color: 'pink' },
{ _id: 21, idSectorGood: [5], descr: 'Creme e detergenti', icon: 'fas fa-pump-soap', color: 'teal' },
{ _id: 22, idSectorGood: [5], descr: 'Trucchi e profumi', icon: 'fas fa-palette', color: 'purple' },
{ _id: 23, idSectorGood: [6], descr: 'Giocattoli e giochi di società', icon: 'fas fa-dice', color: 'yellow' },
{ _id: 24, idSectorGood: [6], descr: 'Igiene e pannolini', icon: 'fas fa-baby', color: 'pink' },
{ _id: 25, idSectorGood: [6], descr: 'Lettini e culle', icon: 'fas fa-baby-carriage', color: 'blue' },
{ _id: 26, idSectorGood: [6], descr: 'Passeggini & co', icon: 'fas fa-baby-carriage', color: 'green' },
{ _id: 27, idSectorGood: [6], descr: 'Vestiti e scarpe', icon: 'fas fa-socks', color: 'purple' },
{ _id: 28, idSectorGood: [7], descr: 'Bere', icon: 'fas fa-glass-cheers', color: 'red' },
{ _id: 29, idSectorGood: [7], descr: 'Mangiare', icon: 'fas fa-utensils', color: 'orange' },
{ _id: 30, idSectorGood: [8], descr: 'Antiquariato', icon: 'fas fa-history', color: 'brown' },
{ _id: 31, idSectorGood: [8], descr: 'Collezionismo', icon: 'fas fa-coins', color: 'gold' },
{ _id: 32, idSectorGood: [9], descr: 'Cellulari e accessori', icon: 'fas fa-mobile-alt', color: 'blue' },
{ _id: 33, idSectorGood: [9], descr: 'Computer e software', icon: 'fas fa-laptop', color: 'grey' },
{ _id: 34, idSectorGood: [9], descr: 'Elettrodomestici', icon: 'fas fa-blender', color: 'green' },
{ _id: 35, idSectorGood: [9], descr: 'Fotografia', icon: 'fas fa-camera', color: 'black' },
{ _id: 36, idSectorGood: [9], descr: 'Videogiochi e console', icon: 'fas fa-gamepad', color: 'purple' },
{ _id: 37, idSectorGood: [10], descr: 'Console', icon: 'fas fa-gamepad', color: 'black' },
{ _id: 38, idSectorGood: [10], descr: 'Giochi di società', icon: 'fas fa-dice', color: 'yellow' },
{ _id: 39, idSectorGood: [10], descr: 'PC games', icon: 'fas fa-desktop', color: 'blue' },
{ _id: 40, idSectorGood: [11], descr: 'Attrezzatura', icon: 'fas fa-tools', color: 'grey' },
{ _id: 41, idSectorGood: [11], descr: 'Materiali', icon: 'fas fa-box-open', color: 'brown' },
{ _id: 42, idSectorGood: [11], descr: 'Prodotti', icon: 'fas fa-box', color: 'green' },
{ _id: 43, idSectorGood: [11], descr: 'Strumentazione', icon: 'fas fa-toolbox', color: 'blue' },
{ _id: 44, idSectorGood: [12], descr: ' riviste e fumetti', icon: 'fas fa-book-open', color: 'red' },
{ _id: 45, idSectorGood: [13], descr: 'CD e vinili', icon: 'fas fa-compact-disc', color: 'black' },
{ _id: 46, idSectorGood: [13], descr: 'Film e DVD', icon: 'fas fa-film', color: 'blue' },
{ _id: 47, idSectorGood: [13], descr: 'Strumenti musicali', icon: 'fas fa-guitar', color: 'brown' },
{ _id: 48, idSectorGood: [14], descr: 'Arredamento', icon: 'fas fa-couch', color: 'brown' },
{ _id: 49, idSectorGood: [14], descr: 'Attrezzature e accessori', icon: 'fas fa-tools', color: 'grey' },
{ _id: 50, idSectorGood: [14], descr: 'Cancelleria e cartucce', icon: 'fas fa-print', color: 'blue' },
{ _id: 51, idSectorGood: [15], descr: 'Abbigliamento', icon: 'fas fa-tshirt', color: 'purple' },
{ _id: 52, idSectorGood: [15], descr: 'Attrezzature e accessori Sport', icon: 'fas fa-football-ball', color: 'green' },
{ _id: 53, idSectorGood: [15], descr: 'Bici e accessori', icon: 'fas fa-bicycle', color: 'blue' },
{ _id: 54, idSectorGood: [17], descr: 'Edilizia', icon: 'fas fa-hard-hat', color: 'orange' },
{ _id: 55, idSectorGood: [17], descr: 'Modellismo', icon: 'fas fa-puzzle-piece', color: 'yellow' },
{ _id: 56, idSectorGood: [17], descr: 'Cucito', icon: 'fas fa-cut', color: 'pink' },
{ _id: 57, idSectorGood: [17], descr: 'Pulizia', icon: 'fas fa-broom', color: 'green' },
{ _id: 58, idSectorGood: [17], descr: 'Per Imbiancare', icon: 'fas fa-paint-roller', color: 'white' },
{ _id: 59, idSectorGood: [17], descr: 'Giardinaggio', icon: 'fas fa-seedling', color: 'green' },
{ _id: 60, idSectorGood: [17], descr: 'Falegnameria', icon: 'fas fa-hammer', color: 'brown' },
{ _id: 61, idSectorGood: [7], descr: 'Pane', icon: 'fas fa-bread-slice', color: 'brown' },
{ _id: 62, idSectorGood: [7], descr: 'Pasta', icon: 'fas fa-utensils', color: 'yellow' },
{ _id: 63, idSectorGood: [7], descr: 'Formaggi', icon: 'fas fa-cheese', color: 'yellow' },
{ _id: 64, idSectorGood: [7], descr: 'Olio', icon: 'fas fa-oil-can', color: 'green' },
{ _id: 65, idSectorGood: [7], descr: 'Fervida', icon: 'fas fa-fire', color: 'red' },
{ _id: 66, idSectorGood: [7], descr: 'Fermentati', icon: 'fas fa-beer', color: 'brown' },
{ _id: 67, idSectorGood: [7], descr: 'Marmellate', icon: 'fas fa-jar', color: 'orange' },
{ _id: 68, idSectorGood: [7], descr: 'Salse', icon: 'fas fa-mortar-pestle', color: 'red' },
{ _id: 69, idSectorGood: [20], descr: 'Cereali', icon: 'fas fa-wheat', color: 'yellow' },
{ _id: 70, idSectorGood: [20], descr: 'Frutta', icon: 'fas fa-apple-alt', color: 'red' },
{ _id: 71, idSectorGood: [20], descr: 'Ortaggi', icon: 'fas fa-carrot', color: 'orange' },
{ _id: 72, idSectorGood: [20], descr: 'Zootecnia', icon: 'fas fa-paw', color: 'brown' },
{ _id: 73, idSectorGood: [20], descr: 'Biologica', icon: 'fas fa-leaf', color: 'green' },
{ _id: 74, idSectorGood: [20], descr: 'Permacultura', icon: 'fas fa-recycle', color: 'green' },
{ _id: 75, idSectorGood: [20], descr: 'Sinergico', icon: 'fas fa-handshake', color: 'green' },
{ _id: 76, idSectorGood: [20], descr: 'Tradizionale', icon: 'fas fa-tractor', color: 'brown' },
{ _id: 77, idSectorGood: [20], descr: 'Viticoltura', icon: 'fas fa-wine-glass-alt', color: 'purple' },
{ _id: 78, idSectorGood: [20], descr: 'Acquacoltura', icon: 'fas fa-fish', color: 'blue' },
],
};
};

View File

@@ -1,8 +1,8 @@
module.exports = {
list: [
{_id: 0, descr: '[Nessuno]', years_of_exp: 0},
{_id: 1, descr: 'Elementare', years_of_exp: 1},
{_id: 2, descr: 'Intermedio', years_of_exp: 2},
{_id: 3, descr: 'Avanzato', years_of_exp: 3},
{_id: 2, descr: 'Elementare', years_of_exp: 1},
{_id: 3, descr: 'Intermedio', years_of_exp: 2},
{_id: 4, descr: 'Avanzato', years_of_exp: 3},
],
};

View File

@@ -17,11 +17,11 @@ module.exports = {
const mydbfile = require(pathfile);
if (mydbfile && mydbfile.list) {
return table.insertMany(mydbfile.list, {ordered: false}).
then((ris) => {
console.log('Populate table ', tablename);
return !!ris;
});
return table.insertMany(mydbfile.list, { ordered: false }).
then((ris) => {
console.log('Populate table ', tablename);
return !!ris;
});
}
}
} catch (e) {
@@ -30,53 +30,69 @@ module.exports = {
},
async insertIntoDb_NoDuplicate(attiva, tablename, table, field) {
async insertIntoDb_NoDuplicate(attiva, tablename, table, field, field2) {
let numrec = 0;
let numupdated = 0;
try {
if (!attiva && await table.countDocuments({}) > 0)
return;
if (!attiva && await table.countDocuments({}) > 0) return;
const pathfile = Path.join(__dirname, tablename + '.js');
if (tools.isFileExists(pathfile)) {
const mydbfile = require(pathfile);
if (mydbfile && mydbfile.list) {
for (const rec of mydbfile.list) {
let obj = {};
obj[field] = rec[field];
let query = {};
if (field)
query[field] = rec[field];
if (field2)
query[field2] = rec[field2];
var mynewrec = new table(rec);
if (rec.hasOwnProperty('idapp')) {
obj.idapop = rec['idapp'];
if (rec.hasOwnProperty('_id')) {
query._id = rec._id;
}
const exist = await table.find(obj);
if (exist.length <= 0) {
try {
const ris = await mynewrec.save();
if (ris) {
if (rec.hasOwnProperty('idapp')) {
query.idapp = rec.idapp;
}
try {
const existingDoc = await table.findOne(query);
if (!existingDoc) {
console.log('ADD: ' + query);
const { value: existingDoc, upserted } = await table.findOneAndUpdate(
query,
{ $set: rec },
{ upsert: true, new: true }
);
if (upserted) {
// Il documento non esisteva, è stato creato
console.log('Inserted document with _id:', existingDoc._id);
numrec++;
}
} catch (e) {
console.log('error ', e);
}
} else {
// Il documento esiste, lo aggiorniamo
const ris = await table.updateOne({ _id: existingDoc._id }, { $set: rec });
if (ris && ris.nModified > 0)
numupdated++;
}
} catch (e) {
console.log('Error processing record: ', tablename, e);
}
}
if (numrec > 0)
console.log('*** Insert', numrec, 'record on ' + tablename);
if (numrec > 0 || numupdated > 0) {
console.log(`*** Inserted ${numrec} and updated ${numupdated} records in ${tablename}`);
}
}
}
} catch (e) {
console.log('error insertIntoDb', e);
console.log('Error in insertIntoDb_NoDuplicate:', e);
}
},
async rewriteTable(table) {
@@ -85,15 +101,15 @@ module.exports = {
let field = '';
try {
const {City} = require('../models/city');
const {Province} = require('../models/province');
const {Sector} = require('../models/sector');
const {SectorGood} = require('../models/sectorgood');
const {Skill} = require('../models/skill');
const {Good} = require('../models/good');
const { City } = require('../models/city');
const { Province } = require('../models/province');
const { Sector } = require('../models/sector');
const { SectorGood } = require('../models/sectorgood');
const { Skill } = require('../models/skill');
const { Good } = require('../models/good');
// const {SubSkill} = require('../models/subskill');
const {Contribtype} = require('../models/contribtype');
const {Level} = require('../models/level');
const { Contribtype } = require('../models/contribtype');
const { Level } = require('../models/level');
if (table === 'cities') {
mytab = City;
@@ -127,11 +143,11 @@ module.exports = {
if (mytab) {
await mytab.collection.drop();
// mongoose.connection.db.dropCollection(table, function(err) {
console.log('Delete ', table);
// await mytab.remove({});
console.log('Delete ', table);
// await mytab.remove({});
this.insertIntoDb_NoDuplicate(false, table, mytab, field);
// });
this.insertIntoDb_NoDuplicate(false, table, mytab, field);
// });
}
return true;
} catch (e) {
@@ -163,7 +179,11 @@ module.exports = {
attiva = scrivi_contribtype;
}
await this.insertIntoDb_NoDuplicate(attiva, rec.table, mytable, rec.key);
if (mytable) {
await this.insertIntoDb_NoDuplicate(attiva, rec.table, mytable, rec.key, rec.key2);
} else {
console.error('Tabella ', mytable, ' non esistente!')
}
}
console.log('FINE - popolaTabelleNuove');

View File

@@ -8,7 +8,7 @@ module.exports = {
{_id: 6, descr: 'Bimbi', icon: 'fas fa-child', color: 'cyan-7'},
{_id: 7, descr: 'Cibo'},
{_id: 8, descr: 'Collezionismo e Antiquariato'},
{_id: 9, descr: 'Elettronica'},
{_id: 9, descr: 'Elettronica di Consumo'},
{_id: 10, descr: 'Giochi', icon: 'fas fa-gamepad', color: 'purple-7'},
{_id: 11, descr: 'Hobby', icon: 'fas fa-guitar', color: 'cyan-7'},
{_id: 12, descr: 'Libri', icon: 'fas fa-book', color: 'indigo-7'},
@@ -19,7 +19,7 @@ module.exports = {
{_id: 17, descr: 'Attrezzature', icon: 'fas fa-tools', color: 'blue-7'},
{_id: 18, descr: 'Animali', icon: 'fas fa-paw', color: 'green-7'},
{_id: 19, descr: 'Arte / Decorazioni', icon: 'fas fa-palette', color: 'purple-7'},
{_id: 20, descr: 'Agricoltura', icon: 'fa-seedling', color: 'green-7'},
{_id: 20, descr: 'Agricoltura', icon: 'fas fa-seedling', color: 'green-7'},
],
};

View File

@@ -1,3 +1,27 @@
/*
module.exports = {
list: [
{ _id: 2, descr: 'Agricoltura', icon: 'fas fa-tractor', color: '#4CAF50' },
{ _id: 3, descr: 'Cibo e Ristorazione', icon: 'fas fa-utensils', color: '#FF9800' },
{ _id: 4, descr: 'Animali', icon: 'fas fa-paw', color: '#795548' },
{ _id: 5, descr: 'Auto e Veicoli', icon: 'fas fa-car', color: '#607D8B' },
{ _id: 6, descr: 'Salute e Benessere', icon: 'fas fa-heartbeat', color: '#E91E63' },
{ _id: 7, descr: 'Casa e Arredamento', icon: 'fas fa-home', color: '#9C27B0' },
{ _id: 8, descr: 'Attività Ricreative e di Intrattenim.', icon: 'fas fa-gamepad', color: '#FF5722' },
{ _id: 13, descr: 'Tecnologie', icon: 'fas fa-microchip', color: '#2196F3' },
{ _id: 15, descr: 'Artigianato', icon: 'fas fa-hammer', color: '#FFC107' },
{ _id: 16, descr: 'Arte e Cultura', icon: 'fas fa-palette', color: '#3F51B5' },
{ _id: 17, descr: 'Assistenza e Integrazione', icon: 'fas fa-hands-helping', color: '#00BCD4' },
{ _id: 18, descr: 'Attività fisica e sportiva', icon: 'fas fa-running', color: '#8BC34A' },
{ _id: 20, descr: 'Bambini', icon: 'fas fa-baby', color: '#FFEB3B' },
{ _id: 21, descr: 'Consulenza e Supporto Professionale', icon: 'fas fa-briefcase', color: '#9E9E9E' },
{ _id: 22, descr: 'Formazione e crescita personale', icon: 'fas fa-graduation-cap', color: '#673AB7' },
{ _id: 23, descr: 'Manutenzione e riparazione', icon: 'fas fa-wrench', color: '#F44336' },
{ _id: 24, descr: 'Mobilità e Trasporti', icon: 'fas fa-bus', color: '#009688' },
],
};
*/
module.exports = {
list: [
{_id: 1, descr: 'Abitare'},
@@ -14,4 +38,4 @@ module.exports = {
{_id: 13, descr: 'Tecnologie'},
{_id: 14, descr: 'Servizi'},
],
};
};

View File

@@ -1,6 +1,6 @@
module.exports = {
list: [
{_id: 1, descr: 'Di Persona', icon:'fas fa-people-carry', color:'green-8' },
{_id: 2, descr: 'On Line', icon:'fas fa-desktop', color: 'indigo-7'},
{_id: 1, descr: '👤 Di Persona', icon:'fas fa-people-carry', color:'green-8' },
{_id: 2, descr: '💻 On Line', icon:'fas fa-desktop', color: 'indigo-7'},
],
};

View File

@@ -55,6 +55,73 @@ const { exec } = require('child_process');
const execPromise = util.promisify(exec);
async function updateProductInfo(recproductInfoAttuale, product, idapp, mycatstr) {
if (!recproductInfoAttuale || !mycatstr) return recproductInfoAttuale;
let idArgomentoNum = null;
let productInfo = null;
if (product.ListaArgomenti) {
idArgomentoNum = parseInt(product.ListaArgomenti);
productInfo = { ...recproductInfoAttuale, idArgomento: idArgomentoNum };
} else {
productInfo = { ...recproductInfoAttuale };
}
let reccatprod = await findOrCreateCatProd(idapp, idArgomentoNum, mycatstr);
if (reccatprod) {
updateProductInfoCatProds(productInfo, reccatprod);
}
return productInfo;
}
async function findOrCreateCatProd(idapp, idArgomento, DescrArgomento) {
let reccatprod = null;
if (idArgomento) {
reccatprod = await CatProd.findOne({ idapp, idArgomento }).lean();
}
if (!reccatprod) {
reccatprod = await CatProd.findOne({ idapp, name: DescrArgomento }).lean();
if (reccatprod) {
if (idArgomento) {
await CatProd.findOneAndUpdate(
{ _id: reccatprod._id },
{ $set: { idArgomento } },
{ new: true, upsert: false }
);
}
} else {
if (idArgomento) {
try {
reccatprod = new CatProd({ idapp, idArgomento, name: DescrArgomento });
await reccatprod.save();
} catch (e) {
console.error('Errore nella creazione di CatProd:', e);
return null;
}
}
}
}
return reccatprod;
}
function updateProductInfoCatProds(productInfo, reccatprod) {
if (productInfo) {
const isChanged = (!productInfo.idCatProds || productInfo.idCatProds.length < 1) ||
(productInfo.idCatProds[0].toString() !== reccatprod._id.toString());
if (isChanged) {
productInfo.idCatProds = [reccatprod._id];
console.log('ARGOMENTO VARIATO!', reccatprod.name);
}
}
}
async function compressPdf(inputFile, outputFile, compressione) {
try {
const tempFolder = path.join(cwd, "temp");
@@ -537,8 +604,11 @@ async function extractArrayDataFromCSV(idapp, rec) {
arrcampi_product = getValoriAndIndice_Product(null);
for (const campoobj of arrcampi_productInfo) {
if (rec.hasOwnProperty(campoobj.name)) {
let myval = tools.ripulisciCampo(rec[campoobj.name]);
// TODO: controlla che il campo rec[campoobj.name] esista anche se minuscolo/maiuscolo
const mykey = Object.keys(rec).find(key => key.toLowerCase() === campoobj.name.toLowerCase());
if (mykey) {
let myval = tools.ripulisciCampo(rec[mykey]);
productInfo[campoobj.name] = (myval === 'TRUE' || myval.toUpperCase() === 'SI') ? true : ((myval === 'FALSE' || myval.toUpperCase() === 'NO') ? false : myval);
}
@@ -776,7 +846,7 @@ router.post('/import', authenticate, async (req, res) => {
let imported = 0;
let errors = 0;
const ripopola = true;
const ripopola = true; // SETTARE su TRUE
if (ripopola) {
dataObjects = null;
@@ -838,6 +908,7 @@ router.post('/import', authenticate, async (req, res) => {
let indprod = 0;
let newprod = 0;
if (numprod) {
// Rimuove prima tutti i valori precedenti
let risupdate = await ProductInfo.updateMany({ idapp }, {
@@ -875,12 +946,13 @@ router.post('/import', authenticate, async (req, res) => {
// split versioneGM in array with separated ","
let arrversGM = versGM.split(",").map(x => x.trim());
const recproductInfoAttuale = await ProductInfo.findOne({ idapp, code: productInfo.code });
const recproductInfoAttuale = await ProductInfo.findOne({ idapp, code: product.isbn });
let productInfo = {
idapp: product.idapp,
code: product.isbn ? product.isbn : product.code,
sku: product.sku,
idCatProds: recproductInfoAttuale?.idCatProds,
// id_wp: product._id,
@@ -898,19 +970,36 @@ router.post('/import', authenticate, async (req, res) => {
}
if (!productInfo.idCatProds) {
productInfo.idCatProds = [];
}
// Aggiorna la collana solo se non è stata già impostata nel record attuale
if (recproductInfoAttuale && !recproductInfoAttuale.idCollana && product.DescrizioneCollana) {
productInfo.idCollana = product.IdCollana;
reccollana = await Collana.findOne({ idapp, idCollana }).lean();
//if (recproductInfoAttuale && !recproductInfoAttuale.idCollana && product.DescrizioneCollana) {
if (recproductInfoAttuale && product.DescrizioneCollana) {
const idCollanaNum = parseInt(product.IdCollana)
productInfo.idCollana = idCollanaNum;
reccollana = await Collana.findOne({ idapp, idCollana: idCollanaNum }).lean();
if (!reccollana) {
// Non esiste questa collana, quindi la creo !
reccoll = new Collana({ idapp, idCollana: product.IdCollana, descrizione: product.DescrizioneCollana });
ris = await reccoll.save();
try {
// Non esiste questa collana, quindi la creo !
reccoll = new Collana({ idapp, idCollana: idCollanaNum, title: product.DescrizioneCollana });
ris = await reccoll.save();
} catch (e) {
console.error('Err', e);
}
}
}
if (recproductInfoAttuale && product.DescrArgomento) {
productInfo = await updateProductInfo(productInfo, product, idapp, product.DescrArgomento);
}
if (product.DataPubblicazione) {
productInfo.date_pub = new Date(product.DataPubblicazione);
// convert data to timestamp
@@ -976,9 +1065,11 @@ router.post('/import', authenticate, async (req, res) => {
if (!recmacro.isbn) {
recmacro.isbn = recrankingisbn.isbn;
}
// Se Pagine non sono state settate
if ((!recmacro.Pagine || recmacro.Pagine === 0) && recrankingisbn.Pagine)
recmacro.Pagine = recrankingisbn.Pagine;
// Se misure non sono state settate
if (!recmacro.misure && recrankingisbn.misure) {
recmacro.misure = recrankingisbn.misure;
}
@@ -1057,6 +1148,12 @@ router.post('/import', authenticate, async (req, res) => {
checkout_link: product.checkout_link ? product.checkout_link : '',
}
let esisteindb = await ProductInfo.findOne({ code: productInfo.code }).lean();
if (esisteindb) {
productInfo.idCatProds = esisteindb.idCatProds;
productInfo.idSubCatProds = esisteindb.idSubCatProds;
}
let versione = 0;
if (indprod % 100 === 0)
@@ -1102,32 +1199,54 @@ router.post('/import', authenticate, async (req, res) => {
productInfo.name = productInfo.name.replace(/ - Usato$| - Nuovo$| - Epub$| - Ebook$| - Mobi$| - DVD$| - Streaming$| - Download$/, "");
const recrankingisbn = await ImportaIsbn.findOne({ sku: product.sku }).lean();
let reccateg = null;
if (product.categories) {
arrcat = product.categories.trim().split(',');
for (const mycat of arrcat) {
let mycatstr = mycat.trim();
// Verifica prima se questa categoria è stata aggiornata !
if (recrankingisbn && recrankingisbn.DescrArgomento) {
// Controlla se ci sono le sottocategorie:
arrsubcat = mycatstr.trim().split('>');
if (arrsubcat.length > 1) {
// Ci sono delle sottocategorie
mycatstr = arrsubcat[0].trim();
product.subcat_name = arrsubcat[1].trim();;
if (tools.isArray(recrankingisbn.ListaArgomenti) && recrankingisbn.ListaArgomenti.length > 1) {
console.log('ListaArgomenti STA RITORNANDO UN ARRAY !!!! ', recrankingisbn.ListaArgomenti);
}
// Cerca la Categoria
reccateg = await CatProd.findOne({ idapp, name: mycatstr }).lean();
if (!reccateg) {
// Non esiste questo produttore, quindi lo creo !
reccateg = new CatProd({ idapp, name: mycatstr });
ris = await reccateg.save();
// !!!!
for (const idArgomento of recrankingisbn.ListaArgomenti) {
mycatstr = recrankingisbn.DescrArgomento;
if (mycatstr)
productInfo = await updateProductInfo(productInfo, product, idapp, mycatstr);
}
} else {
arrcat = product.categories.trim().split(',');
for (const mycat of arrcat) {
let mycatstr = mycat.trim();
// Controlla se ci sono le sottocategorie:
arrsubcat = mycatstr.trim().split('>');
if (arrsubcat.length > 1) {
// Ci sono delle sottocategorie
mycatstr = arrsubcat[0].trim();
product.subcat_name = arrsubcat[1].trim();;
}
// Cerca la Categoria
reccateg = await CatProd.findOne({ idapp, name: mycatstr }).lean();
}
if (!reccateg) {
// Non esiste questo produttore, quindi lo creo !
reccateg = new CatProd({ idapp, name: mycatstr });
ris = await reccateg.save();
console.log('CREA con ARGOMENTO VECCHIO... ', mycatstr);
reccateg = await CatProd.findOne({ idapp, name: mycatstr }).lean();
}
if (reccateg) {
productInfo.idCatProds.push(reccateg._id);
if (reccateg) {
productInfo.idCatProds.push(reccateg._id);
}
}
}
}
@@ -1232,7 +1351,6 @@ router.post('/import', authenticate, async (req, res) => {
product.active = true;
}
let esisteindb = await ProductInfo.findOne({ code: productInfo.code }).lean();
// Update ProductInfo
let risrecInfo = await ProductInfo.findOneAndUpdate({ code: productInfo.code }, { $set: productInfo }, { new: true, upsert: true });
if (risrecInfo) {
@@ -1313,6 +1431,23 @@ router.post('/import', authenticate, async (req, res) => {
variazione.quantita = arrvariazioni[ind].quantita;
}
// *** CONTROLLA SE AGGIORNARE O MENO DETERMINATI CAMPI CHE SONO STATI GIA' SETTATI
if (recrankingisbn) {
if (product.misure !== recrankingisbn.misure && recrankingisbn.misure) {
product.misure = recrankingisbn.misure;
}
if (product.formato !== recrankingisbn.formato && recrankingisbn.formato) {
product.formato = recrankingisbn.formato;
}
if (product.Pagine !== recrankingisbn.Pagine && recrankingisbn.Pagine) {
product.Pagine = recrankingisbn.Pagine;
}
if (product.Edizione !== recrankingisbn.Edizione && recrankingisbn.Edizione) {
product.Edizione = recrankingisbn.Edizione;
}
}
variazione.active = true; // ++ ??
variazione.versione = versione;
variazione.versione = versione;

View File

@@ -21,6 +21,10 @@ const globalTables = require('../tools/globalTables');
const { ObjectId } = require('mongodb');
const OpenAI = require("openai");
const { PassThrough } = require('stream');
router.post('/getlist', authenticate_noerror, async function (req, res, next) {
@@ -43,4 +47,128 @@ router.post('/getlist', authenticate_noerror, async function (req, res, next) {
});
async function getDeepSeekResponse(prompt, options) {
try {
const deepseek = new OpenAI({
baseURL: 'https://api.deepseek.com/v1',
apiKey: process.env.DS_API_KEY,
defaultHeaders: {
'Content-Type': 'application/json'
}
});
if (!options.withexplain) {
prompt = prompt + '\n' + 'Ritornami solo il risultato, senza spiegazione.';
}
if (options.outputType) {
prompt = prompt + '\n' + options.outputType;
}
const completionStream = await deepseek.chat.completions.create({
model: options.model || "deepseek-chat",
messages: [
{ role: "system", content: options?.contestsystem || "" },
{ role: "user", content: prompt }
],
temperature: options?.temp || 0.3,
max_tokens: options?.max_tokens || 1000,
stream: options?.stream || false,
});
if (options?.stream) {
// Creiamo un PassThrough stream per inviare i chunk al frontend
/*const stream = new PassThrough();
completionStream.on('data', (chunk) => {
stream.write(`data: ${JSON.stringify(chunk)}\n\n`);
});
completionStream.on('end', () => {
stream.end();
});
return stream;*/
return completionStream;
} else {
if (!completionStream || !completionStream.choices || completionStream.choices.length === 0) {
throw new Error('Invalid response from DeepSeek API');
}
return completionStream.choices[0];
}
} catch (error) {
console.error('DeepSeek Error:', error.response?.data || error.message);
throw new Error('Failed to get AI response');
}
}
router.post('/ds', authenticate, async (req, res) => {
const { prompt, options } = req.body;
const isstream = (options && options?.stream)
if (isstream) {
// Se lo streaming è abilitato, restituiamo un flusso di dati
res.setHeader('Content-Type', 'text/event-stream');
res.setHeader('Cache-Control', 'no-cache');
res.setHeader('Connection', 'keep-alive');
try {
// Ottieni il flusso di dati da DeepSeek
const completionStream = await getDeepSeekResponse(prompt, options);
for await (const chunk of completionStream) {
if (chunk.choices && chunk.choices[0]) {
const data = JSON.stringify({ choice: chunk.choices[0] });
res.write(`data: ${data}\n\n`);
try {
const msg = chunk.choices[0].delta.content;
if (msg) {
console.log(msg);
// await tools.sleep(10000)
}
} catch (e) {
console.error('Error: ' + e.message);
}
}
}
res.write('data: [DONE]\n\n');
res.end();
} catch (error) {
const errorstr = 'DeepSeek API Error:' + (error.response?.data || error.message)
console.error(errorstr);
// In caso di errore durante lo streaming, invia un messaggio di errore
const errorData = JSON.stringify({
code: server_constants.RIS_CODE_ERR,
error: errorstr,
});
res.write(`data: ${errorData}\n\n`);
res.end();
}
} else {
try {
// Se lo streaming non è abilitato, restituisci la risposta completa
const choice = await getDeepSeekResponse(prompt, options);
return res.send({
code: server_constants.RIS_CODE_OK,
choice,
});
} catch (error) {
const errorstr = 'DeepSeek API Error:' + (error.response?.data || error.message)
console.error(errorstr);
// In caso di errore senza streaming, restituisci un errore standard
return res.send({
code: server_constants.RIS_CODE_ERR,
error: errorstr,
});
}
}
});
module.exports = router;

View File

@@ -0,0 +1,15 @@
const express = require("express");
const { getArticlesSalesHandler, exportArticlesSalesByJSON, viewTable, queryTable } = require("../controllers/articleController");
const { authenticate } = require("../middleware/authenticate");
const router = express.Router();
router.post("/articles-sales", authenticate, getArticlesSalesHandler);
router.post("/export-articles-sales-json", authenticate, exportArticlesSalesByJSON);
router.post("/view-table", authenticate, viewTable);
router.post("/query", authenticate, queryTable);
module.exports = router;

View File

@@ -28,6 +28,11 @@ async function getCircuitRecAdminsInfo(idapp, data) {
if (myuser && myuser.profile)
admin.profile = { img: myuser.profile.img };
}
if (data.admins.length === 0) {
data.admins.push({username: shared_consts.USER_ADMIN_CIRCUITS})
}
}
} catch (e) {
console.error(e);

View File

@@ -76,6 +76,7 @@ const Gasordine = require('../models/gasordine');
const Product = require('../models/product');
const Author = require('../models/author');
const Collana = require('../models/collana');
const { Catalog } = require('../models/catalog');
const Publisher = require('../models/publisher');
const ProductInfo = require('../models/productInfo');
const Scontistica = require('../models/scontistica');
@@ -219,58 +220,65 @@ router.post(process.env.LINK_REQUEST_NEWPASSWORD, async (req, res) => {
// Invio la Nuova Password richiesta dal reset!
// Ritorna il token per poter effettuare le chiamate...
router.post(process.env.LINK_UPDATE_PWD, async (req, res) => {
const body = _.pick(req.body, ['idapp', 'email', 'tokenforgot', 'tokenforgot_code', 'password']);
const idapp = body.idapp;
const email = body.email.toLowerCase().trim();
const tokenforgot = body.tokenforgot;
const tokenforgot_code = body.tokenforgot_code;
const password = body.password;
const msg = 'Richiesta Nuova Password: idapp= ' + idapp + ' email = ' + email;
console.log(msg);
// telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
try {
const body = _.pick(req.body, ['idapp', 'email', 'tokenforgot', 'tokenforgot_code', 'password']);
const idapp = body.idapp;
const email = body.email.toLowerCase().trim();
const tokenforgot = body.tokenforgot;
const tokenforgot_code = body.tokenforgot_code;
const password = body.password;
const msg = 'Richiesta Nuova Password: idapp= ' + idapp + ' email = ' + email;
let user = null;
console.log(msg);
user = await User.findByLinkTokenforgot(idapp, email, tokenforgot)
.then((user) => {
return user;
}).catch((e) => {
console.log(process.env.LINK_UPDATE_PWD, e.message);
res.status(400).send();
});
// telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
if (!user) {
user = await User.findByLinkTokenforgotCode(idapp, email, tokenforgot_code)
let user = null;
user = await User.findByLinkTokenforgot(idapp, email, tokenforgot)
.then((user) => {
return user;
}).catch((e) => {
console.log(process.env.LINK_UPDATE_PWD, e.message);
res.status(400).send();
});
}
if (!user) {
return res.send(
{ code: server_constants.RIS_CODE_TOKEN_RESETPASSWORD_NOT_FOUND });
} else {
// aggiorna la nuova password
user.password = password;
user.lasttimeonline = new Date();
if (!user) {
user = await User.findByLinkTokenforgotCode(idapp, email, tokenforgot_code)
.then((user) => {
return user;
}).catch((e) => {
console.log(process.env.LINK_UPDATE_PWD, e.message);
res.status(400).send();
});
}
// Crea token
user.generateAuthToken(req).then(ris => {
user.tokenforgot = ''; // Svuota il tokenforgot perché non ti servirà più...
user.tokenforgot_code = ''; // Svuota il tokenforgot perché non ti servirà più...
if (!user) {
return res.send(
{ code: server_constants.RIS_CODE_TOKEN_RESETPASSWORD_NOT_FOUND });
} else {
// aggiorna la nuova password
user.password = password;
user.lasttimeonline = new Date();
// Salva lo User
user.save().then(() => {
res.header('x-auth', ris.token)
.header('x-refrtok', ris.refreshToken)
.send({ code: server_constants.RIS_CODE_OK }); // Ritorna il token di ritorno
// Crea token
user.generateAuthToken(req).then(ris => {
user.tokenforgot = ''; // Svuota il tokenforgot perché non ti servirà più...
user.tokenforgot_code = ''; // Svuota il tokenforgot perché non ti servirà più...
// Salva lo User
user.save().then(() => {
res.header('x-auth', ris.token)
.header('x-refrtok', ris.refreshToken)
.send({ code: server_constants.RIS_CODE_OK }); // Ritorna il token di ritorno
});
});
});
}
} catch (e) {
console.error('Error: ', e);
}
});
router.post('/testServer', authenticate_noerror, async (req, res) => {
@@ -349,6 +357,7 @@ router.post('/settable', authenticate, async (req, res) => {
if ((!User.isAdmin(req.user.perm)
&& !User.isManager(req.user.perm)
&& !User.isEditor(req.user.perm)
&& !User.isGrafico(req.user.perm)
&& !User.isFacilitatore(req.user.perm))
&&
await !tools.ModificheConsentite(req, params.table, fieldsvalue, mydata ? mydata._id : '')) {
@@ -404,12 +413,18 @@ router.post('/settable', authenticate, async (req, res) => {
delete mydata['__v'];
delete mydata['__proto__'];
let mytablerec = new mytable(mydata);
const isNotNew = (mydata['_id'] !== undefined && mydata['_id'] !== 0 && mydata['_id'] !== '');
let mytablerec = null;
mytablerec = new mytable(mydata);
// console.log('mytablerec', mytablerec);
const mytablestrutt = globalTables.getTableByTableName(params.table);
if (mydata['_id'] !== undefined && mydata['_id'] !== 0 && mydata['_id'] !== '') {
if (isNotNew) {
mytablerec.isNew = false;
}
@@ -419,7 +434,9 @@ router.post('/settable', authenticate, async (req, res) => {
} else if (params.table === 'hours') {
} else {
if ((mydata['_id'] === undefined || mydata['_id'] === '' || (mytablerec.isNew && mydata['_id'] === 0)) && (mytablerec._id === undefined || mytablerec._id === '0')) {
if ((mydata['_id'] === undefined || mydata['_id'] === '' ||
(mytablerec.isNew && mydata['_id'] === 0))
&& (mytablerec._id === undefined || mytablerec._id === '0')) {
mytablerec._id = new ObjectId();
mydata._id = new ObjectId();
mytablerec.isNew = true;
@@ -485,6 +502,11 @@ router.post('/settable', authenticate, async (req, res) => {
return await myPromise
.then(async (doupdate) => {
if (false) {
let plainObject = mytablerec.toObject();
console.log(plainObject);
}
if (doupdate)
return mytable.updateOne({ _id: mytablerec._id }, mydata, { new: true })
else
@@ -660,6 +682,32 @@ router.post('/setsubrec', authenticate, (req, res) => {
});
router.post('/getobj', authenticate_noerror, async (req, res) => {
try {
let cmd = req.body.cmd;
let idapp = req.user ? req.user.idapp : sanitizeHtml(req.body.idapp); // Cambiato from params.idapp a req.body.idapp
let ris = null;
if (cmd === 'lista_editori') {
ris = await User.find(
{
idapp,
perm: { $bitsAnySet: 0b10000 },
},
{ username: 1, name: 1, surname: 1 }
).sort({ username: 1 }).lean();
}
// Invia la risposta
res.status(200).send({ code: server_constants.RIS_CODE_OK, data: ris });
} catch (e) {
console.error(`ERROR getobj`, e.message);
res.status(200).send({ code: server_constants.RIS_CODE_OK, data: [] });
}
});
router.post('/gettable', authenticate_noerror, (req, res) => {
let params = req.body;
@@ -860,17 +908,19 @@ async function duplicatePage(pageId, newpath) {
const catalogo = elem.catalogo;
for (const recscheda of catalogo.arrSchede) {
if (recscheda.scheda?.isTemplate) {
// Se è un template allora devo mettergli un altro ID !
recscheda.scheda._id = new mongoose.Types.ObjectId();
// recscheda.scheda.name = getNewFreeNameTemplate(recscheda.scheda?.name)
if (catalogo) {
for (const recscheda of catalogo.arrSchede) {
if (recscheda.scheda?.isTemplate) {
// Se è un template allora devo mettergli un altro ID !
recscheda.scheda._id = new mongoose.Types.ObjectId();
// recscheda.scheda.name = getNewFreeNameTemplate(recscheda.scheda?.name)
}
}
}
let newelem = { ...elem };
elem.catalogo = { ...catalogo };
if (catalogo)
elem.catalogo = { ...catalogo };
const newElem = new MyElem({
...elem, // Copia le proprietà dell'elemento
@@ -1844,7 +1894,9 @@ function load(req, res, version) {
let storehouses = Storehouse.findAllIdApp(idapp);
let providers = Provider.findAllIdApp(idapp);
let catprods = Product.getArrCatProds(idapp, shared_consts.PROD.BOTTEGA);
let catprtotali = CatProd.getCatProdWithTitleCount(idapp);
let collane = Collana.findAllIdApp(idapp);
let catalogs = Catalog.findAllIdApp(idapp);
let catprods_gas = Product.getArrCatProds(idapp, shared_consts.PROD.GAS);
let subcatprods = SubCatProd.findAllIdApp(idapp);
let gasordines = Gasordine.findAllIdApp(idapp);
@@ -1958,6 +2010,8 @@ function load(req, res, version) {
publishers,
myschedas,
collane,
catalogs,
catprtotali,
]).then((arrdata) => {
// console.table(arrdata);
let myuser = req.user;
@@ -2054,6 +2108,8 @@ function load(req, res, version) {
publishers: arrdata[50],
myschedas: arrdata[51],
collane: arrdata[52],
catalogs: arrdata[53],
catprtotali: arrdata[54],
});
const prova = 1;

View File

@@ -44,7 +44,8 @@ router.post('/load', authenticate, async (req, res) => {
SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif);
const whatshow = MyGroup.getWhatToShow(idapp, req.user.username);
let data = await MyGroup.findOne({ idapp, groupname }, whatshow).lean();
// let data = await MyGroup.findOne({ idapp, groupname }, whatshow).lean();
let data = await MyGroup.getInfoGroupByGroupname(idapp, groupname);
/*
if (data.mycircuits) {
@@ -54,7 +55,8 @@ router.post('/load', authenticate, async (req, res) => {
}
}
*/
if (data.mycircuits) {
for (let i = 0; i < data.mycircuits.length; i++) {
const mycirc = await Circuit.findOne({ idapp, name: data.mycircuits[i].circuitname }).lean();

View File

@@ -87,308 +87,313 @@ router.post('/test1', async (req, res) => {
// POST /users
router.post('/', async (req, res) => {
tools.mylog('POST /users');
const body = _.pick(req.body, [
'email',
'password',
'username',
'group',
'name',
'surname',
'idapp',
'keyappid',
'lang',
'profile',
'aportador_solidario']);
body.email = body.email.toLowerCase();
try {
tools.mylog('POST /users');
const body = _.pick(req.body, [
'email',
'password',
'username',
'group',
'name',
'surname',
'idapp',
'keyappid',
'lang',
'profile',
'aportador_solidario']);
body.email = body.email.toLowerCase();
const user = new User(body);
user.ipaddr = tools.getiPAddressUser(req);
const user = new User(body);
user.ipaddr = tools.getiPAddressUser(req);
user.email = user.email.trim();
user.username = user.username.trim();
user.name = user.name.trim();
user.surname = user.surname.trim();
user.email = user.email.trim();
user.username = user.username.trim();
user.name = user.name.trim();
user.surname = user.surname.trim();
if ((user.aportador_solidario === 'tuo_username') || (user.aportador_solidario === '{username}')) {
user.aportador_solidario = 'paoloar77';
}
// tools.mylog("LANG PASSATO = " + user.lang, "IDAPP", user.idapp);
if (!tools.isAlphaNumericAndSpecialCharacter(body.username) ||
body.email.length < 6 ||
body.username.length < 4 || body.password.length < 5) {
await tools.snooze(5000);
console.log('Username non valido in Registrazione: ' + body.username);
res.status(400).
send({ code: server_constants.RIS_CODE_USERNAME_NOT_VALID, msg: '' });
return 1;
}
if (tools.blockwords(body.username) || tools.blockwords(body.name) ||
tools.blockwords(body.surname)) {
// tools.writeIPToBan(user.ipaddr + ': [' + user.username + '] ' + user.name + ' ' + user.surname);
await tools.snooze(5000);
return res.status(404).send();
}
user.linkreg = reg.getlinkregByEmail(body.idapp, body.email, body.username);
user.verified_email = false;
user.lasttimeonline = new Date();
user.date_reg = new Date();
user.aportador_iniziale = user.aportador_solidario;
let regexpire = req.body['regexpire'];
let nonchiedereverifica = false;
if (regexpire) {
nonchiedereverifica = await User.getifRegTokenIsValid(body.idapp, regexpire);
}
if (!nonchiedereverifica)
regexpire = '';
if (!tools.getAskToVerifyReg(body.idapp) || nonchiedereverifica) {
// Se non devo chiedere di verificare all'Invitato, allora lo verifico direttamente
user.verified_by_aportador = true;
}
/* if (user.idapp === tools.AYNI) {
user.profile.paymenttypes = ['paypal'];
} */
// Controlla se anche l'ultimo record era dallo stesso IP:
const lastrec = await User.getLastRec(body.idapp);
if (!!lastrec) {
if (process.env.LOCALE !== '1') {
if (lastrec.ipaddr === user.ipaddr) {
// Se l'ha fatto troppo ravvicinato
if (lastrec.date_reg) {
let ris = tools.isdiffSecDateLess(lastrec.date_reg, 3);
if (ris) {
const msg = user.ipaddr + ': [' + user.username + '] ' + user.name + ' ' +
user.surname;
tools.writeIPToBan(msg);
await User.findOneAndUpdate({ _id: user._id }, { $set: { banIp: true } });
await telegrambot.sendMsgTelegramToTheAdmin(body.idapp, '‼️ BAN: ' + msg, true);
await tools.snooze(5000);
res.status(400).
send({ code: server_constants.RIS_CODE_BANIP, msg: '' });
return 1;
}
}
}
if ((user.aportador_solidario === 'tuo_username') || (user.aportador_solidario === '{username}')) {
user.aportador_solidario = 'paoloar77';
}
}
// user.perm = 3;
// if (tools.testing()) {
// user.verified_email = true;
// }
// tools.mylog("LANG PASSATO = " + user.lang, "IDAPP", user.idapp);
// if (user.profile.intcode_cell) {
// if (user.profile.cell.substring(0, user.profile.intcode_cell.length) === user.profile.intcode_cell) {
// user.profile.cell = user.profile.cell.substring(user.profile.intcode_cell.length)
// }
// }
let exit;
let utentenonancoraVerificato = false;
const trovarec = await User.findByCredentials(user.idapp, user.username, user.password, true);
// Check if already esist email or username
exit = await User.findByUsername(user.idapp, user.username).
then((useralreadyexist) => {
if (useralreadyexist) {
if (tools.getAskToVerifyReg(useralreadyexist.idapp)) {
if (!useralreadyexist.verified_by_aportador && useralreadyexist.profile.teleg_id > 0) {
if (trovarec) {
utentenonancoraVerificato = true;
}
}
}
if (!utentenonancoraVerificato) {
res.status(400).
send({
code: server_constants.RIS_CODE_USERNAME_ALREADY_EXIST,
msg: '',
});
return 1;
}
}
});
if (!utentenonancoraVerificato) {
if (exit === 1)
return;
exit = await User.findByEmail(user.idapp, user.email).
then((useralreadyexist) => {
if (useralreadyexist) {
res.status(400).
send({
code: server_constants.RIS_CODE_EMAIL_ALREADY_EXIST,
msg: '',
});
return 1;
}
});
if (exit === 1)
return;
let recuser = null;
recuser = await User.findByCellAndNameSurname(user.idapp, user.profile.cell,
user.name, user.surname);
if (recuser && user.name !== '' && user.surname !== '' &&
user.profile.cell !== '') {
console.log('UTENTE GIA ESISTENTE:\n');
console.log(user);
// User already registered!
if (!tools.isAlphaNumericAndSpecialCharacter(body.username) ||
body.email.length < 6 ||
body.username.length < 4 || body.password.length < 5) {
await tools.snooze(5000);
console.log('Username non valido in Registrazione: ' + body.username);
res.status(400).
send({ code: server_constants.RIS_CODE_USER_ALREADY_EXIST, msg: '' });
send({ code: server_constants.RIS_CODE_USERNAME_NOT_VALID, msg: '' });
return 1;
}
}
let recextra = null;
user.aportador_solidario = user.aportador_solidario.trim();
user.aportador_solidario = user.aportador_solidario.replace('@', '');
let id_aportador = await User.getIdByUsername(user.idapp, user.aportador_solidario);
if (!id_aportador) {
// Cerca se esiste l'aportador solidario con l'username Telegram
const useraportador = await User.getUserByUsernameTelegram(user.idapp, user.aportador_solidario);
if (useraportador) {
id_aportador = useraportador._id;
user.aportador_solidario = useraportador.username;
if (tools.blockwords(body.username) || tools.blockwords(body.name) ||
tools.blockwords(body.surname)) {
// tools.writeIPToBan(user.ipaddr + ': [' + user.username + '] ' + user.name + ' ' + user.surname);
await tools.snooze(5000);
return res.status(404).send();
}
}
user.linkreg = reg.getlinkregByEmail(body.idapp, body.email, body.username);
user.verified_email = false;
user.lasttimeonline = new Date();
user.date_reg = new Date();
user.aportador_iniziale = user.aportador_solidario;
let idMyGroupSite = tools.getidMyGroupBySite(body.idapp);
user.idMyGroup = idMyGroupSite ? idMyGroupSite : '';
let regexpire = req.body['regexpire'];
let nonchiedereverifica = false;
if (regexpire) {
nonchiedereverifica = await User.getifRegTokenIsValid(body.idapp, regexpire);
}
if (id_aportador) {
// Ottiene l'username "corretto" (senza maiuscole o minuscole)
user.aportador_solidario = await User.getRealUsernameByUsername(user.idapp, user.aportador_solidario);
}
if (!nonchiedereverifica)
regexpire = '';
if (!id_aportador && tools.getAskToVerifyReg(body.idapp)) {
// Si sta tentando di registrare una persona sotto che non corrisponde!
let msg = 'Il link di registrazione non sembra risultare valido.<br>invitante: ' +
user.aportador_solidario + '<br>username: ' + user.username;
if (!tools.getAskToVerifyReg(body.idapp) || nonchiedereverifica) {
// Se non devo chiedere di verificare all'Invitato, allora lo verifico direttamente
user.verified_by_aportador = true;
}
await telegrambot.sendMsgTelegramToTheManagers(user.idapp, msg);
res.status(400).
send({
code: server_constants.RIS_CODE_USER_APORTADOR_NOT_VALID,
msg: '',
});
return 1;
}
/* if (user.idapp === tools.AYNI) {
user.profile.paymenttypes = ['paypal'];
} */
// Controlla se anche l'ultimo record era dallo stesso IP:
const lastrec = await User.getLastRec(body.idapp);
if (!!lastrec) {
if (process.env.LOCALE !== '1') {
if (lastrec.ipaddr === user.ipaddr) {
// Se l'ha fatto troppo ravvicinato
if (lastrec.date_reg) {
let ris = tools.isdiffSecDateLess(lastrec.date_reg, 3);
if (ris) {
const msg = user.ipaddr + ': [' + user.username + '] ' + user.name + ' ' +
user.surname;
tools.writeIPToBan(msg);
if (utentenonancoraVerificato) {
if (id_aportador) {
// Se mi sono registrato ma l'invitante non mi abilita, allora il posso registrarmi nuovamente, con lo stesso username e password,
// con un'altro link di un'altro invitante !
await User.setaportador_solidario(user.idapp, user.username,
user.aportador_solidario);
await User.findOneAndUpdate({ _id: user._id }, { $set: { banIp: true } });
const myuser = await User.findOne({ _id: trovarec._id });
if (myuser) {
await telegrambot.sendMsgTelegramToTheAdmin(body.idapp, '‼️ BAN: ' + msg, true);
await telegrambot.askConfirmationUser(myuser.idapp, shared_consts.CallFunz.REGISTRATION, myuser);
const { token, refreshToken } = await myuser.generateAuthToken(req);
res
.header('x-auth', token)
.header('x-refrtok', refreshToken)
.send(myuser);
return true;
await tools.snooze(5000);
res.status(400).
send({ code: server_constants.RIS_CODE_BANIP, msg: '' });
return 1;
}
}
}
}
}
}
// let already_registered = (recextra || user.aportador_solidario === tools.APORTADOR_NONE) && (user.idapp === tools.AYNI);
// user.perm = 3;
// if (tools.testing()) {
// user.verified_email = true;
// }
// Check if is an other people aportador_solidario
// if (user.profile.intcode_cell) {
// if (user.profile.cell.substring(0, user.profile.intcode_cell.length) === user.profile.intcode_cell) {
// user.profile.cell = user.profile.cell.substring(user.profile.intcode_cell.length)
// }
// }
let exit;
/*if (already_registered) {
// Check in the extraList if is present!
const msg = 'Utente non trovato: ' + user.name + ' ' + user.surname + ' ' + user.profile.nationality + ' ' + user.profile.cell + ' email: ' + user.email + ' username: ' + user.username;
console.log('Utente non trovato; ', msg);
await telegrambot.sendMsgTelegramToTheManagers(user.idapp, msg);
res.status(400).send({
code: server_constants.RIS_CODE_USER_EXTRALIST_NOTFOUND,
msg: 'Controlla se il numero ' + user.profile.cell + ' è corretto.'
});
return 1;
} */
let utentenonancoraVerificato = false;
return user.save().then(async () => {
return User.findByUsername(user.idapp, user.username, false).
then((usertrovato) => {
const trovarec = await User.findByCredentials(user.idapp, user.username, user.password, true);
// tools.mylog("TROVATO USERNAME ? ", user.username, usertrovato);
if (usertrovato !== null) {
return user.generateAuthToken(req);
} else {
res.status(400).send();
return 0;
// Check if already esist email or username
exit = await User.findByUsername(user.idapp, user.username).
then((useralreadyexist) => {
if (useralreadyexist) {
if (tools.getAskToVerifyReg(useralreadyexist.idapp)) {
if (!useralreadyexist.verified_by_aportador && useralreadyexist.profile.teleg_id > 0) {
if (trovarec) {
utentenonancoraVerificato = true;
}
}
}
if (!utentenonancoraVerificato) {
res.status(400).
send({
code: server_constants.RIS_CODE_USERNAME_ALREADY_EXIST,
msg: '',
});
return 1;
}
}
}).
then(async (ris) => {
// tools.mylog("passo il TOKEN: ", token);
if (recextra) {
recextra.registered = true;
recextra.username = user.username;
await recextra.save();
// await User.fixUsername(user.idapp, user.ind_order, user.username);
}
return ris;
}).
then(async (ris) => {
// tools.mylog("LINKREG = " + user.linkreg);
// Invia un'email all'utente
// tools.mylog('process.env.TESTING_ON', process.env.TESTING_ON);
console.log('res.locale', res.locale);
await telegrambot.askConfirmationUser(user.idapp, shared_consts.CallFunz.REGISTRATION, user, '', '', '', regexpire);
// if (!tools.testing()) {
await sendemail.sendEmail_Registration(user.lang, user.email, user,
user.idapp, user.linkreg);
// }
res
.header('x-auth', ris.token)
.header('x-refrtok', ris.refreshToken)
.send(user);
return true;
});
}).catch((e) => {
if (!utentenonancoraVerificato) {
if (exit === 1)
return;
exit = await User.findByEmail(user.idapp, user.email).
then((useralreadyexist) => {
if (useralreadyexist) {
res.status(400).
send({
code: server_constants.RIS_CODE_EMAIL_ALREADY_EXIST,
msg: '',
});
return 1;
}
});
if (exit === 1)
return;
let recuser = null;
recuser = await User.findByCellAndNameSurname(user.idapp, user.profile.cell,
user.name, user.surname);
if (recuser && user.name !== '' && user.surname !== '' &&
user.profile.cell !== '') {
console.log('UTENTE GIA ESISTENTE:\n');
console.log(user);
// User already registered!
res.status(400).
send({ code: server_constants.RIS_CODE_USER_ALREADY_EXIST, msg: '' });
return 1;
}
}
let recextra = null;
user.aportador_solidario = user.aportador_solidario.trim();
user.aportador_solidario = user.aportador_solidario.replace('@', '');
let id_aportador = await User.getIdByUsername(user.idapp, user.aportador_solidario);
if (!id_aportador) {
// Cerca se esiste l'aportador solidario con l'username Telegram
const useraportador = await User.getUserByUsernameTelegram(user.idapp, user.aportador_solidario);
if (useraportador) {
id_aportador = useraportador._id;
user.aportador_solidario = useraportador.username;
}
}
let idMyGroupSite = tools.getidMyGroupBySite(body.idapp);
user.idMyGroup = idMyGroupSite ? idMyGroupSite : '';
if (id_aportador) {
// Ottiene l'username "corretto" (senza maiuscole o minuscole)
user.aportador_solidario = await User.getRealUsernameByUsername(user.idapp, user.aportador_solidario);
}
if (!id_aportador && tools.getAskToVerifyReg(body.idapp)) {
// Si sta tentando di registrare una persona sotto che non corrisponde!
let msg = 'Il link di registrazione non sembra risultare valido.<br>invitante: ' +
user.aportador_solidario + '<br>username: ' + user.username;
await telegrambot.sendMsgTelegramToTheManagers(user.idapp, msg);
res.status(400).
send({
code: server_constants.RIS_CODE_USER_APORTADOR_NOT_VALID,
msg: '',
});
return 1;
}
if (utentenonancoraVerificato) {
if (id_aportador) {
// Se mi sono registrato ma l'invitante non mi abilita, allora il posso registrarmi nuovamente, con lo stesso username e password,
// con un'altro link di un'altro invitante !
await User.setaportador_solidario(user.idapp, user.username,
user.aportador_solidario);
const myuser = await User.findOne({ _id: trovarec._id });
if (myuser) {
await telegrambot.askConfirmationUser(myuser.idapp, shared_consts.CallFunz.REGISTRATION, myuser);
const { token, refreshToken } = await myuser.generateAuthToken(req);
res
.header('x-auth', token)
.header('x-refrtok', refreshToken)
.send(myuser);
return true;
}
}
}
// let already_registered = (recextra || user.aportador_solidario === tools.APORTADOR_NONE) && (user.idapp === tools.AYNI);
// Check if is an other people aportador_solidario
/*if (already_registered) {
// Check in the extraList if is present!
const msg = 'Utente non trovato: ' + user.name + ' ' + user.surname + ' ' + user.profile.nationality + ' ' + user.profile.cell + ' email: ' + user.email + ' username: ' + user.username;
console.log('Utente non trovato; ', msg);
await telegrambot.sendMsgTelegramToTheManagers(user.idapp, msg);
res.status(400).send({
code: server_constants.RIS_CODE_USER_EXTRALIST_NOTFOUND,
msg: 'Controlla se il numero ' + user.profile.cell + ' è corretto.'
});
return 1;
} */
return user.save().then(async () => {
return User.findByUsername(user.idapp, user.username, false).
then((usertrovato) => {
// tools.mylog("TROVATO USERNAME ? ", user.username, usertrovato);
if (usertrovato !== null) {
return user.generateAuthToken(req);
} else {
res.status(400).send();
return 0;
}
}).
then(async (ris) => {
// tools.mylog("passo il TOKEN: ", token);
if (recextra) {
recextra.registered = true;
recextra.username = user.username;
await recextra.save();
// await User.fixUsername(user.idapp, user.ind_order, user.username);
}
return ris;
}).
then(async (ris) => {
// tools.mylog("LINKREG = " + user.linkreg);
// Invia un'email all'utente
// tools.mylog('process.env.TESTING_ON', process.env.TESTING_ON);
console.log('res.locale', res.locale);
await telegrambot.askConfirmationUser(user.idapp, shared_consts.CallFunz.REGISTRATION, user, '', '', '', regexpire);
// if (!tools.testing()) {
await sendemail.sendEmail_Registration(user.lang, user.email, user,
user.idapp, user.linkreg);
// }
res
.header('x-auth', ris.token)
.header('x-refrtok', ris.refreshToken)
.send(user);
return true;
});
}).catch((e) => {
console.error(e.message);
res.status(400).send(e);
});
} catch (e) {
console.error(e.message);
res.status(400).send(e);
});
}
});
router.get('/:idapp/:username', async (req, res) => {
@@ -1093,6 +1098,10 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
} else if (mydata.dbop === 'ReplaceAllCircuits') {
// ++ Replace All Circuitname with 'Circuito RIS %s'
await Circuit.replaceAllCircuitNames(idapp);
} else if (mydata.dbop === 'eliminaCatProds') {
await CatProd.deleteMany({ idapp });
await SubCatProd.deleteMany({ idapp });
} else if (mydata.dbop === 'visuStat') {
// ris = await User.visuUtentiNonInNavi(idapp);
//} else if (mydata.dbop === 'creaNavi') {
@@ -1398,6 +1407,11 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
if (User.isAdmin(req.user.perm)) {
ris = globalTables.replaceUsername(req.body.idapp, mydata.search_username, mydata.replace_username);
}
} else if (mydata.dbop === 'ExitFromAllCircuitWithZero') {
if (User.isAdmin(req.user.perm)) {
ris = globalTables.ExitFromAllCircuitWithZero(req.body.idapp, mydata.search_username);
}
} else if (mydata.dbop === 'replaceAportadorSolidario') {
if (User.isAdmin(req.user.perm)) {
@@ -1590,7 +1604,7 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
const deleteCart = await Cart.deleteMany({ idapp });
ris = deleteCart;
} catch (e) {
console.error('Err:', e);
}

View File

@@ -938,7 +938,7 @@ module.exports = {
if (user.lastid_newstosent !== id_newstosent.toString()) {
// console.log('@@@@@ COMPARE DIVERSI: lastid', user.lastid_newstosent, 'idsent', id_newstosent.toString());
if (process.env.DEBUG)
if (process.env.VITE_DEBUG)
await tools.snooze(5000);
// Send Email to the User

View File

@@ -142,6 +142,7 @@ myLoad().then(ris => {
const mygoods_router = require('./router/mygoods_router');
const mygen_router = require('./router/mygen_router');
const aitools_router = require('./router/aitools_router');
const article_router = require('./router/articleRoutes');
const { MyEvent } = require('./models/myevent');
@@ -262,6 +263,7 @@ myLoad().then(ris => {
app.use('/mygoods', mygoods_router);
app.use('/mygen', mygen_router);
app.use('/aitools', aitools_router);
app.use('/apisqlsrv', article_router);
mystart();
@@ -302,7 +304,7 @@ async function mystart() {
}
mycron();
if (!process.env.DEBUG) {
if (!process.env.VITE_DEBUG) {
mycron();
}
}
@@ -427,14 +429,14 @@ function testmsgwebpush() {
// Cron every X minutes
cron.schedule('*/1 * * * *', () => {
// console.log('Running Cron Job');
// if (!process.env.DEBUG) {
// if (!process.env.VITE_DEBUG) {
mycron();
// }
});
// Cron every X minutes
cron.schedule('*/60 * * * *', async () => {
if (!process.env.DEBUG) {
if (!process.env.VITE_DEBUG) {
mycron_30min();
}
});
@@ -720,8 +722,8 @@ function getCredentials(hostname) {
if (NUOVO_METODO_TEST) {
if (METODO_MULTI_CORS) {
const fileprivkey = `/etc/letsencrypt/live/${hostname}/privkey.pem`;
const filecert = `/etc/letsencrypt/live/${hostname}/cert.pem`;
const fileprivkey = `/etc/letsencrypt/live/${hostname}/` + process.env.PATH_CERT_KEY;
const filecert = `/etc/letsencrypt/live/${hostname}/` + process.env.PATH_SERVER_CRT;
console.log('fileprivkey: ', fileprivkey, ' filecert: ', filecert);
@@ -820,7 +822,7 @@ function startServer(app, port) {
// Configurazione CORS dettagliata
const corsOptions = {
origin: '*',
/*origin: function (origin, callback) {
// Array di domini consentiti
const allowedOrigins = [
@@ -1043,11 +1045,11 @@ function startServer(app, port) {
ws.send(JSON.stringify({ type: 'output', data: data }));
// Controlla se c'è una richiesta di input
if (buffer.endsWith(': ') || buffer.includes('? ') ||
if (buffer && (buffer.endsWith(': ') || buffer.includes('? ') ||
buffer.toLowerCase().includes('password')
|| buffer.includes('Inserisci')
|| buffer.includes('Inserted')
|| buffer.includes('(Y')
|| buffer.includes('(Y'))
) {
ws.send(JSON.stringify({ type: 'input_required', prompt: data.trim() }));
buffer = '';

View File

@@ -277,7 +277,7 @@ const Menu = {
'Inv e NO 7 Req',
MSGSTAFF: emoji.get('incoming_envelope') + ' Invia a STAFF',
MSGAPPARTIENE_CIRCUITI_RIS: 'Invia a Utenti dei Circuiti RIS',
MSGPAOLO: emoji.get('incoming_envelope') + ' Invia a PAOLO',
MSGPAOLO: emoji.get('incoming_envelope') + ' Invia a SURYA',
RESTART_SRV: emoji.get('incoming_envelope') + 'Restart-NodeJs',
REBOOT_SRV: emoji.get('incoming_envelope') + 'Reboot-VPS!',
EXECSH: emoji.get('incoming_envelope') + 'ExecSH',
@@ -487,7 +487,7 @@ const txt = {
emoji.get('dizzy'),
MSG_ASK_USERNAME_BO: 'Scrivete nel messaggio l\'username (SENZA SPAZI) o la email con cui vi siete registrati sul sito di %s:',
MSG_ASK_USERNAME_INVITANTE: 'Scrivi nel messaggio <b>l\'USERNAME TELEGRAM</b> di chi ti ha INVITATO',
MSG_NEW_REG: '<br><br>⁉️🙈 Per aiuto scrivi sulla <a href="https://t.me/riso_gruppo">Chat RISO</a><br>oppure direttamente a Paolo (@surya1977) ☀️.',
MSG_NEW_REG: '<br><br>⁉️🙈 Per aiuto scrivi sulla <a href="https://t.me/riso_gruppo">Chat RISO</a><br>oppure direttamente a Surya (@surya1977) ☀️.',
MSG_ERRORE_INVITANTE_NOT_FOUND: 'L\'username dell\'invitante appena digitato non sembra essere corretto! Ti ricordo che dev\'essere l\'username con cui si è registrato su %s',
MSG_ERRORE_USERNAME: 'Attenzione! Devi inserire solo lo username (40 caratteri massimo)',
MSG_ERRORE_USERNAME_NOT_FOUND: 'Per Completare la Verifica Telegram BOT, dovete ora scrivere qui sotto nel messaggio l\'Username (senza spazi) OPPURE la email con cui vi siete registrati sul sito',
@@ -503,7 +503,7 @@ const txt = {
MSG_EXIT_TELEGRAM: 'L\'account è stato ora scollegato da questo Telegram BOT.',
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
' Si è appena Registrato "%s" (n. %s)\nInvitato da %s',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s si sta registrando alla App %d e ti chiede di poter entrare. Confermi di conoscerla ?',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍‍♂️ Accetta Ingresso nel GRUPPO %s:',
MSG_FRIENDS_NOT_ACCEPTED_CONFIRMED: '🚫 Hai rifiutato la richiesta di Amicizia di %s !',
MSG_HANDSHAKE_NOT_ACCEPTED_CONFIRMED: '🚫 Hai rifiutato la richiesta di Stretta di mano di %s !',
@@ -552,7 +552,7 @@ const txt_es = {
MSG_EXIT_TELEGRAM: 'La cuenta ha sido desconectada de Telegram BOT.',
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
' Acaba de registrarse "%s (n. %s)"\n(Invitado de %s)',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s Abilita Nuova Registrazione:',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍‍♂️ Accetta Ingresso nel GRUPPO %s:',
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
@@ -585,7 +585,7 @@ const txt_fr = {
MSG_EXIT_TELEGRAM: 'L\'account a été déconnecté de Telegram BOT.',
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
' Vous venez à peine de vous inscrire "%s (n. %s) %s',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s Abilita Nuova Registrazione:',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍‍♂️ Accetta Ingresso nel GRUPPO %s:',
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
@@ -616,7 +616,7 @@ const txt_si = {
MSG_EXIT_TELEGRAM: 'Račun se nahaja v programu Telegram BOT.',
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
'Registracija registracije %s (n. %s)\n(povabil ga %s)',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s Abilita Nuova Registrazione:',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍‍♂️ Accetta Ingresso nel GRUPPO %s:',
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
@@ -646,7 +646,7 @@ const txt_en = {
MSG_EXIT_TELEGRAM: 'The account has now been disconnected from this Telegram BOT.',
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
' He/She\'s just registered "%s (n. %s)"\n(Invited from %s)',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s Abilita Nuova Registrazione:',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍‍♂️ Accetta Ingresso nel GRUPPO %s:',
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
@@ -679,7 +679,7 @@ const txt_pt = {
MSG_EXIT_TELEGRAM: 'A conta foi agora desconectada deste Telegrama BOT.',
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
' Acabou de se registar "%s (n. %s)"\n(Convidado por %s)',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s Abilita Nuova Registrazione:',
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍‍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍‍♂️ Accetta Ingresso nel GRUPPO %s:',
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
@@ -696,7 +696,7 @@ const txt_pt = {
const TelegramBot = require('node-telegram-bot-api');
const ADMIN_IDTELEGRAM_TEST = 5356627050; // 5022837609; //Surya Arena
const ADMIN_IDTELEGRAM_TEST = 5356627050; // 5022837609; //Surya A.
const MyTelegramBot = {
@@ -927,7 +927,7 @@ const MyTelegramBot = {
let useraportador = await User.getUserShortDataByUsername(idapp, userDest);
if (useraportador && useraportador.tokenreg && (regexpire.toLowerCase() === useraportador.tokenreg.toLowerCase())) {
if (useraportador && useraportador.tokenreg && useraportador.tokenreg && (regexpire && (regexpire?.toLowerCase() === useraportador.tokenreg?.toLowerCase()))) {
const nonchiedereverifica = await User.getifRegTokenIsValid(idapp, useraportador.tokenreg);
if (nonchiedereverifica)
notask_verif = true;
@@ -939,7 +939,7 @@ const MyTelegramBot = {
await setVerifiedReg(myuser.idapp, myuser.lang, myuser.username, userDest);
} else {
msg_notifpush = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username);
msg_notifpush = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username, nomeapp);
domanda = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username, nomeapp) + '<br>' + struserinfomsg;
keyb = cl.getInlineKeyboard(myuser.lang, [
@@ -1539,7 +1539,7 @@ async function local_sendMsgTelegram(idapp, username, text) {
}
function getstr(lang, key, param1) {
function getstr(lang, key, ...params) {
let mystr = '';
@@ -1578,8 +1578,8 @@ function getstr(lang, key, param1) {
if (!mystr || mystr === '')
mystr = txt[key];
if (!!param1) {
mystr = printf(mystr, param1);
if (params.length > 0) {
mystr = printf(mystr, ...params);
}
return mystr;
@@ -1653,7 +1653,7 @@ class Telegram {
let risp = '';
const id = msg.chat.id;
let testo = msg.text.toLowerCase().trim();
let testo = msg.text?.toLowerCase()?.trim();
testo = testo.replace('!', '');
testo = testo.replace('?', '');
testo = testo.replace('é', 'è');
@@ -1778,9 +1778,9 @@ class Telegram {
rec.user.index + ']: ' + rec.user.name + ' ' + rec.user.surname +
'\nUsername: ' + rec.user.username + '\n' + 'Email: ' +
rec.user.email + '\nLang: ' + rec.user.lang + tools.ACAPO;
risp += 'Num Invitati: ' + myrec.numinvitati + tools.ACAPO;
risp += 'Num Invitati Attivi: ' + myrec.numinvitatiattivi +
tools.ACAPO;
risp += 'Invitato da ' + rec.user.aportador_solidario + tools.ACAPO;
risp += 'Username Telegram ' + rec.user.profile.username_telegram + tools.ACAPO;
risp += 'Telegram ID ' + rec.user.profile.teleg_id + tools.ACAPO;
} else {
risp = 'Ancora non ti sei Attivato sul BOT';
}
@@ -1897,7 +1897,7 @@ class Telegram {
noanswer = true;
let myfaq = this.geturlfaq();
risp = 'Ciao {username}, Io mi chiamo BOT e sono il tuo assistente Virtuale ' + emo.ROBOT_FACE + emo.JOY2 + '\n' +
'Usa il menu qui sotto per interagire col BOT\n' +
'Usa il menu qui sotto per interagire col BOT, cliccando sul bottone in basso, con 4 quadratini dentro\n' +
'\nPer <strong>AIUTO</strong>, clicca qui:\n👉🏻👉🏻<a href="' + myfaq +
'">FAQ di AIUTO</a> (risposte alle domande più frequenti)\n\nSe non trovi risposta allora contatta la <a href="' +
tools.getTelegramSupportChat(this.idapp) + '">Chat di HELP</a>.\nGrazie';
@@ -2103,7 +2103,7 @@ class Telegram {
// await this.menumsg_to_Nave(msg, cmd2);
// } else if (testo === Menu.MSG_SI_INVITATI_NO_7REQ_INVITATI) {
// await this.menumsg_Si_Invitati_No_7Req(msg);
} else if (cmd1.toLowerCase() === Menu.MSG_TO_USER) {
} else if (cmd1 && cmd1.toLowerCase() === Menu.MSG_TO_USER) {
await this.menumsg_A_Utente(msg);
} else if (testo === Menu.SETPICPROFILE) {
await this.setPhotoProfile(rec.user, msg.from.id);
@@ -2523,7 +2523,10 @@ class Telegram {
async menuRestartSrv(rec, msg, cmd2) {
if (cmd2 === '6711') {
await MyTelegramBot.sendMsgTelegramToTheAdminAllSites(this.chisono(rec) + ' ha rilanciato il Server NODE.JS...');
const freeSpace = await tools.getFreeDiskSpace();
const strfree = `Spazio libero su disco: ${freeSpace}`;
await MyTelegramBot.sendMsgTelegramToTheAdminAllSites(this.chisono(rec) + ' ha rilanciato il Server NODE.JS... \n' + strfree);
let file = '~/batch/production_restart_server.sh';
if (process.env.NODE_ENV === 'test') {
file = '~/batch/test_restart_server.sh';
@@ -2543,7 +2546,10 @@ class Telegram {
async menuLogSrv(rec, msg, cmd2) {
if (cmd2 === '6711') {
const ris = await tools.execScriptByTelegram(this.idapp, msg, '~/batch/logserver.sh', this.chisono(rec) + ' Visualizzo il Log del Server...');
const freeSpace = await tools.getFreeDiskSpace();
const strfree = `Spazio libero su disco: ${freeSpace}`;
console.log(strfree);
const ris = await tools.execScriptByTelegram(this.idapp, msg, '~/batch/logserver.sh', this.chisono(rec) + ' Visualizzo il Log del Server... \n' + strfree);
} else {
this.nonAbilitato(msg);
}
@@ -2832,7 +2838,7 @@ class Telegram {
async setUsernameInvitante(msg) {
try {
let mymsg = msg.text.toString().trim().toLowerCase();
let mymsg = msg.text?.toString()?.trim().toLowerCase();
let nomeapp = tools.getNomeAppByIdApp(this.idapp);
@@ -3059,7 +3065,7 @@ class Telegram {
texttosend = await this.getNextZoom(msg);
}
const cmd = texttosend.toLowerCase();
const cmd = texttosend?.toLowerCase();
if (usersall) {
if (this.isSelMenu(msg, cmd, 'INDIETRO')) {
@@ -3265,7 +3271,7 @@ class Telegram {
getInvitanteByMsg(msg) {
try {
let mymsg = msg.text.toString().trim().toLowerCase();
let mymsg = msg.text?.toString().trim().toLowerCase();
let invitante = '';
let regexpire = '';
const sep = '-'
@@ -3318,8 +3324,7 @@ class Telegram {
}
const rec = this.getRecInMem(msg);
let testo = msg.text.toLowerCase().trim();
let testo = msg.text?.toLowerCase()?.trim();
status = this.getstatus(rec);
if (testo === Menu.EXIT_TELEGRAM) {
@@ -3383,7 +3388,7 @@ class Telegram {
rec.chatId = msg.chat.id;
rec.messageId = msg.message_id;
rec.msgall_status = StatusMSGALL.CONFIRM;
const cmd = rec.msgtosent.toLowerCase();
const cmd = rec?.msgtosent?.toString()?.toLowerCase() ?? '';
let achi = this.getDestinStr(msg, rec.msgall_achi, rec);
let domanda = '';
if (rec.msgall_domanda) {
@@ -3710,7 +3715,7 @@ class Telegram {
for (const rec of recuser.menuDb) {
if (rec.active_mem) {
if (rec.idapp === idapp && rec.lang === lang &&
rec.label.toLowerCase() === testo) {
rec.label?.toLowerCase() === testo) {
return true;
}
}
@@ -3728,7 +3733,7 @@ class Telegram {
for (const recdb of recuser.menuDb) {
if (recdb.active_mem) {
if (recdb.idapp === idapp && recdb.lang === lang &&
recdb.label.toLowerCase() === testo) {
recdb.label?.toLowerCase() === testo) {
if (recdb.type === shared_consts.BOTTYPE_TEXT) {
return recdb.value;
} else if (recdb.type === shared_consts.BOTTYPE_LINK) {
@@ -3769,7 +3774,7 @@ class Telegram {
for (const recdb of recuser.menuDb) {
if (recdb.active_mem) {
if (recdb.idapp === idapp && recdb.lang === lang &&
recdb.label.toLowerCase() === testo) {
recdb.label?.toLowerCase() === testo) {
if (recdb.type === shared_consts.BOTTYPE_MARKDOWN) {
return 'Markdown'
} else {
@@ -3794,7 +3799,7 @@ class Telegram {
for (const recdb of recuser.menuDb) {
if (recdb.active_mem) {
if (recdb.idapp === idapp && recdb.lang === lang &&
recdb.label.toLowerCase() === testo) {
recdb.label?.toLowerCase() === testo) {
if (recdb.type === shared_consts.BOTTYPE_BOTTONI_INLINE) {
const jsonString = '[{"text": "primo", "callback_data": "1"}, {"text": "sec", "callback_data": "2"}]';
const jsonObject = JSON.parse(jsonString);
@@ -4029,7 +4034,7 @@ class Telegram {
return 0;
});*/
}
if (risSendPhoto) {
inviato = true;
}

View File

@@ -17,8 +17,8 @@ let jsonUser1 = {
email: 'paolo.arena77@gmail.com',
password: '$2a$12$hTv40mdq.x35Up7HQ9faae1JgHrohcvp45vt8eMkGhQv/Zv.8.MIG',
username: 'paoloar77',
name: 'Paolo',
surname: 'Arena',
name: 'Surya',
surname: '',
idapp: '1',
lang: 'it',
keyappid: 'KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF',

View File

@@ -47,6 +47,9 @@ const sanitizeHtml = require('sanitize-html');
const { exec } = require('child_process');
const util = require('util');
const execPromise = util.promisify(exec);
const { spawn } = require('child_process');
const readline = require('readline');
@@ -522,10 +525,6 @@ class ImageDownloader {
}
}
// Funzione per implementare il ritardo tra i tentativi
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
module.exports = {
MYAPPS: [],
@@ -1432,6 +1431,12 @@ module.exports = {
},
getAdminsByCircuit(circuit) {
// return circuit.admins
return [...circuit.admins, { username: shared_consts.USER_ADMIN_CIRCUITS }]
},
sendNotificationByCircuit: async function (idapp, usernameOrig, circuitname, cmd, value, telegram, username_action, extrarec) {
const { Circuit } = require('../models/circuit');
@@ -1509,7 +1514,7 @@ module.exports = {
const groupOrig = '' //++Todo: extrarec.groupOrig
for (const singleadmin of circuit.admins) {
for (const singleadmin of this.getAdminsByCircuit(circuit)) {
try {
if (singleadmin.username) {
if (usernameOrig === singleadmin.username)
@@ -1616,12 +1621,12 @@ module.exports = {
const telegrambot = require('../telegram/telegrambot');
if (!circuit || !circuit.admins) {
if (!circuit || !this.getAdminsByCircuit(circuit)) {
console.error('sendNotifToCircuitsAdmin: missing circuit or circuit.admins', circuit);
return;
}
for (const singleadmin of circuit.admins) {
for (const singleadmin of this.getAdminsByCircuit(circuit)) {
try {
if (singleadmin && singleadmin.username) {
const user = await User.getUserShortDataByUsername(idapp, singleadmin.username);
@@ -2865,6 +2870,7 @@ module.exports = {
'user.profile.img': 1,
'user.profile.qualifica': 1,
'user.profile.note': 1,
'profile.da_contattare': 1,
});
if (qa1) query = [...query, ...qa1];
query.push({ $unwind: '$user' });
@@ -2915,6 +2921,7 @@ module.exports = {
'user.profile.img': 1,
'user.profile.qualifica': 1,
'user.profile.note': 1,
'profile.da_contattare': 1,
});
if (qa1) query = [...query, ...qa1];
query.push({ $unwind: '$user' });
@@ -5034,11 +5041,14 @@ module.exports = {
descrcontent = '';
}
mystr += `${icon} <strong>${title}</strong>`;
if (acapo) {
mystr += `\n`;
} else {
mystr += `: `;
if (title && icon) {
mystr += `${icon} <strong>${title}</strong>`;
if (acapo) {
mystr += `\n`;
} else {
mystr += `: `;
}
}
if (descrcontent) {
mystr += `${descrcontent}\n`;
@@ -5331,7 +5341,7 @@ module.exports = {
descrperNotif = i18n.__('NEW_EVENT', userorig, datastr, mydescr, dovestr);
}
let contatto = userorig;
let contatto_telegram = '';
try {
@@ -5340,6 +5350,8 @@ module.exports = {
if (username_telegram) {
contatto_telegram = `@${username_telegram}`;
contatto = contatto_telegram;
} else {
contatto = myrec.email;
}
} catch (e) {
}
@@ -5383,7 +5395,7 @@ module.exports = {
contatto = '';
}
}
if ((myrec.contact_telegram && myrec.contact_telegram.toLowerCase() !== contatto_telegram.toLowerCase()) || !contatto) {
if ((myrec.contact_telegram && myrec.contact_telegram?.toLowerCase() !== contatto_telegram?.toLowerCase()) || !contatto) {
contatto += '\n' + myrec.contact_telegram;
}
/*if (myrec.contact_phone) {
@@ -5401,7 +5413,7 @@ module.exports = {
out += `<strong>${myrec.descr}</strong>\n\n`;
if (datastr)
out += this.addRowTelegram('', 'Data Evento', datastr, true, true);
out += this.addRowTelegram('', '', datastr, true, true);
if (cat)
out += this.addRowTelegram('⭐️', 'Categoria', cat, true, true);
@@ -5415,7 +5427,7 @@ module.exports = {
// descrcontent = '<span size="3"><b>Prova Pao</b> Ciaooo</span>';
if (descrcontent)
out += this.addRowTelegram('📝', 'Descrizione ' + newdescr, descrcontent, true, true);
out += this.addRowTelegram('', '', '📝 ' + descrcontent, true, true);
const localita = this.getComuniEProvinceByRec(myrec);
@@ -5696,7 +5708,7 @@ module.exports = {
const allElements = document.body.querySelectorAll('*');
allElements.forEach(element => {
const tagName = element.tagName.toLowerCase();
const tagName = element.tagName?.toLowerCase();
if (!allowedTags.includes(tagName)) {
// Crea un nodo di testo e sostituisci l'elemento con quel nodo di testo
@@ -5929,7 +5941,25 @@ module.exports = {
console.log(JSON.stringify(result, null, 2)); // Stampa il risultato in formato JSON
}
});
},
async getFreeDiskSpace(path = '/') {
try {
const { stdout } = await execPromise(`df -k ${path} | tail -1 | awk '{print $4}'`);
const freeSpaceKB = parseInt(stdout.trim());
const freeSpaceGB = (freeSpaceKB / 1024 / 1024).toFixed(2);
return `${freeSpaceGB} GB`;
} catch (error) {
console.error('Errore nel recupero dello spazio libero su disco:', error);
return null;
}
},
// Funzione per implementare il ritardo tra i tentativi
sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
};

View File

@@ -23,6 +23,7 @@ const { Contribtype } = require('../models/contribtype');
const { PaymentType } = require('../models/paymenttype');
const { Discipline } = require('../models/discipline');
const { Skill } = require('../models/skill');
const { Catalog } = require('../models/catalog');
const { Good } = require('../models/good');
const { SubSkill } = require('../models/subskill');
const { MySkill } = require('../models/myskill');
@@ -73,7 +74,7 @@ const Department = require('../models/department');
const CatProd = require('../models/catprod');
const Collana = require('../models/collana');
const CatAI = require('../models/catai');
const QueryAI = require('../models/queryai');
const { QueryAI } = require('../models/queryai');
const SubCatProd = require('../models/subcatprod');
const { Category } = require('../models/category');
const ShareWithUs = require('../models/sharewithus');
@@ -218,6 +219,8 @@ module.exports = {
mytable = Graduatoria;
else if (tablename === 'skills')
mytable = Skill;
else if (tablename === 'catalogs')
mytable = Catalog;
else if (tablename === 'goods')
mytable = Good;
else if (tablename === 'subskills')
@@ -953,7 +956,45 @@ module.exports = {
res.status(408).send({});
}
}
},
async removeAdminIfZeroBalance(idapp, username) {
try {
// Trova l'account con saldo_pend a zero
const accountarr = await Account.find({ idapp, username: username, saldo_pend: 0 }).lean();
if (accountarr) {
for (const recaccount of accountarr) {
// Rimuovi l'username dalla lista degli admins nel Circuit
const ris = await Circuit.findOneAndUpdate(
{ _id: recaccount.circuitId },
{ $pull: { admins: { username: username } } }, // Rimuove l'username dalla lista degli admins
{ new: true } // Opzione per restituire il documento aggiornato
);
const nomecircuito = ris.name;
// Esco anche dal Circuito personale:
await User.findOneAndUpdate(
{ idapp, username },
{ $pull: { 'profile.mycircuits': { circuitname: nomecircuito } } }
);
if (ris)
console.log(`L'username ${username} è stato rimosso dagli admins di ` + nomecircuito);
}
} else {
console.log(`Nessun account trovato con saldo_pend a zero per l'username: ${username}.`);
}
} catch (error) {
console.error('Errore durante l\'operazione:', error);
}
},
async ExitFromAllCircuitWithZero(idapp, username) {
return await this.removeAdminIfZeroBalance(idapp, username);
},
};

View File

@@ -53,6 +53,8 @@ module.exports = {
FILTER_USER_ONLINE_6_MESI: 268435456,
FILTER_NOTE: 536870912,
FILTER_SENZA_NOTE: 1073741824,
FILTER_DA_CONTATTARE: 2147483648,
FILTER_FACILITATORE: 4294967296,
OPTIONS_SEARCH_ONLY_FULL_WORDS: 1,
OPTIONS_SEARCH_USER_ONLY_FULL_WORDS: 2,
@@ -160,9 +162,10 @@ module.exports = {
TABLES_CIRCUITS: 'circuits',
TABLES_MYGROUPS: 'mygroups',
TABLES_ATTIVITAS: 'attivitas',
TABLES_CATALOG: 'catalogs',
MYTABS: [{ id: 0, table: 'none' },
{ id: 1, table: 'myskills' },
{ id: 1, table: this.TABLES_MYSKILLS },
{ id: 2, table: 'mybachecas' },
{ id: 3, table: 'myhosps' },
{ id: 4, table: 'mygoods' },
@@ -207,7 +210,7 @@ module.exports = {
TABLES_GETCOMPLETEREC: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'attivitas'],
//++Todo: per abilitare gli utenti ad inserire un Circuito aggiungere 'circuits' alla lista TABLES_PERM_NEWREC
TABLES_PERM_NEWREC: ['skills', 'goods', 'subskills', 'mygroups', 'myhosps'],
TABLES_PERM_NEWREC: ['skills', 'goods', 'subskills', 'mygroups', 'myhosps', 'catalogs'],
TABLES_REACTIONS: ['mybachecas', 'myhosps', 'myskills', 'mygoods', 'attivitas'],
@@ -220,7 +223,7 @@ module.exports = {
TABLES_GROUPS_NOTIFICATION: ['mygroups'],
TABLES_CIRCUITS_NOTIFICATION: ['circuits'],
TABLES_ENABLE_GETTABLE_FOR_NOT_LOGGED: ['attivitas'],
TABLES_ENABLE_GETTABLE_FOR_NOT_LOGGED: ['attivitas', 'catalogs'],
TABLES_NUM_AS_ID_NUMBER: [],
@@ -253,7 +256,7 @@ module.exports = {
],
TABLES_USER_ID: ['mygroups', 'myskills', 'mybachecas', 'myhosps', 'mygoods'],
TABLES_CREATEDBY: ['mygroups', 'circuits', 'attivitas'],
TABLES_UPDATE_LASTMODIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'bots', 'mygroups', 'circuits', 'attivitas', 'myelems', 'mypages', 'productinfos', 'products'],
TABLES_UPDATE_LASTMODIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'bots', 'mygroups', 'circuits', 'attivitas', 'myelems', 'mypages', 'productinfos', 'products', 'catalogs'],
TABLES_FIELDS_DESCR_AND_CITY_AND_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods'],
@@ -263,24 +266,30 @@ module.exports = {
TABLES_POPULATE_DATA: [
{
table: 'adtypegoods',
key: 'descr',
}, {
table: 'adtypes',
key: 'descr',
keyOFF: 'descr',
},
{ table: 'catgrps', key: 'descr' },
{
table: 'catalogs',
key: 'title',
},
{
table: 'adtypes',
keyOFF: 'descr',
},
{ table: 'catgrps' },
{
table: 'contribtypes',
key: 'descr',
keyOLD: 'descr',
},
{ table: 'goods', key: 'descr' },
{ table: 'goods', key: 'descr', key2: 'idSectorGood' },
{ table: 'levels', key: 'descr' },
{ table: 'cities', key: 'comune' },
{ table: 'provinces', key: 'descr' },
{ table: 'sectorgoods', key: 'descr' },
{ table: 'sectors', key: 'descr' },
{ table: 'skills', key: 'descr' },
{ table: 'statusSkills', key: 'descr' },
{ table: 'sectorgoods', keyOLD: 'descr' },
{ table: 'sectors', keyOLD: 'descr' },
// { table: 'skills', key: 'descr', key2: 'idSector' },
{ table: 'skills' },
{ table: 'statusSkills', keyOLD: 'descr' },
// { table: 'catais', key: 'descr' },
// { table: 'queryais', key: 'descr' },
],
@@ -349,6 +358,7 @@ module.exports = {
Editor: 16,
Zoomeri: 32,
Department: 64,
Grafico: 128,
},
MessageOptions: {
@@ -969,6 +979,7 @@ module.exports = {
adType: 1,
photos: 1,
note: 1,
da_contattare: 1,
descr: 1,
date_created: 1,
date_updated: 1,
@@ -976,6 +987,7 @@ module.exports = {
username: 1,
name: 1,
surname: 1,
email: 1,
groupname: 1,
lasttimeonline: 1,
comune: 1,
@@ -989,6 +1001,7 @@ module.exports = {
'profile.mycircuits': 1,
'profile.qualifica': 1,
'profile.note': 1,
'profile.da_contattare': 1,
'profile.resid_province': 1,
'profile.resid_card': 1,
'profile.username_telegram': 1,
@@ -1001,6 +1014,7 @@ module.exports = {
username_who_report: 1,
namecomplete: 1,
date_reg: 1,
perm: 1,
};
if (proj_add)
@@ -1034,6 +1048,8 @@ module.exports = {
return add + 'grp' + add
} else if (table === 'circuits') {
return add + 'circuit' + add
} else if (table === 'catalogs') {
return add + 'catalogs' + add
}
return ''
@@ -1079,6 +1095,7 @@ module.exports = {
CAMPI_PRODUCTINFO: [
{ name: 'name', type: '' },
{ name: 'code', type: '' },
{ name: 'codice', type: '' },
{ name: 'description', type: 1 },
{ name: 'link_scheda', type: '' },
{ name: 'idCatProds', type: '' },
@@ -1165,6 +1182,11 @@ module.exports = {
COMMUNITY_ACCOUNT: 2,
},
CmdQueryMs: {
GET: 0,
SET: 1,
},
// Download, DVD, Epub, Mobi, Nuovo, PDF, Streaming, Usato
};

View File

@@ -1 +1 @@
1.1.16
1.1.22

356
yarn.lock
View File

@@ -492,6 +492,175 @@
"@smithy/types" "^3.7.1"
tslib "^2.6.2"
"@azure/abort-controller@^2.0.0":
version "2.1.2"
resolved "https://registry.yarnpkg.com/@azure/abort-controller/-/abort-controller-2.1.2.tgz#42fe0ccab23841d9905812c58f1082d27784566d"
integrity sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==
dependencies:
tslib "^2.6.2"
"@azure/core-auth@^1.3.0", "@azure/core-auth@^1.4.0", "@azure/core-auth@^1.7.2", "@azure/core-auth@^1.8.0", "@azure/core-auth@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.9.0.tgz#ac725b03fabe3c892371065ee9e2041bee0fd1ac"
integrity sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-util" "^1.11.0"
tslib "^2.6.2"
"@azure/core-client@^1.3.0", "@azure/core-client@^1.5.0", "@azure/core-client@^1.9.2":
version "1.9.2"
resolved "https://registry.yarnpkg.com/@azure/core-client/-/core-client-1.9.2.tgz#6fc69cee2816883ab6c5cdd653ee4f2ff9774f74"
integrity sha512-kRdry/rav3fUKHl/aDLd/pDLcB+4pOFwPPTVEExuMyaI5r+JBbMWqRbCY1pn5BniDaU3lRxO9eaQ1AmSMehl/w==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-auth" "^1.4.0"
"@azure/core-rest-pipeline" "^1.9.1"
"@azure/core-tracing" "^1.0.0"
"@azure/core-util" "^1.6.1"
"@azure/logger" "^1.0.0"
tslib "^2.6.2"
"@azure/core-http-compat@^2.0.1":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@azure/core-http-compat/-/core-http-compat-2.2.0.tgz#20ff535b2460151ea7e68767287996c84cd28738"
integrity sha512-1kW8ZhN0CfbNOG6C688z5uh2yrzALE7dDXHiR9dY4vt+EbhGZQSbjDa5bQd2rf3X2pdWMsXbqbArxUyeNdvtmg==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-client" "^1.3.0"
"@azure/core-rest-pipeline" "^1.19.0"
"@azure/core-lro@^2.2.0":
version "2.7.2"
resolved "https://registry.yarnpkg.com/@azure/core-lro/-/core-lro-2.7.2.tgz#787105027a20e45c77651a98b01a4d3b01b75a08"
integrity sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-util" "^1.2.0"
"@azure/logger" "^1.0.0"
tslib "^2.6.2"
"@azure/core-paging@^1.1.1":
version "1.6.2"
resolved "https://registry.yarnpkg.com/@azure/core-paging/-/core-paging-1.6.2.tgz#40d3860dc2df7f291d66350b2cfd9171526433e7"
integrity sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==
dependencies:
tslib "^2.6.2"
"@azure/core-rest-pipeline@^1.17.0", "@azure/core-rest-pipeline@^1.19.0", "@azure/core-rest-pipeline@^1.8.0", "@azure/core-rest-pipeline@^1.8.1", "@azure/core-rest-pipeline@^1.9.1":
version "1.19.0"
resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.19.0.tgz#4cc60d3f2ee68cf0ef379851b4ed175f7932c8c5"
integrity sha512-bM3308LRyg5g7r3Twprtqww0R/r7+GyVxj4BafcmVPo4WQoGt5JXuaqxHEFjw2o3rvFZcUPiqJMg6WuvEEeVUA==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-auth" "^1.8.0"
"@azure/core-tracing" "^1.0.1"
"@azure/core-util" "^1.11.0"
"@azure/logger" "^1.0.0"
http-proxy-agent "^7.0.0"
https-proxy-agent "^7.0.0"
tslib "^2.6.2"
"@azure/core-tracing@^1.0.0", "@azure/core-tracing@^1.0.1":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.2.0.tgz#7be5d53c3522d639cf19042cbcdb19f71bc35ab2"
integrity sha512-UKTiEJPkWcESPYJz3X5uKRYyOcJD+4nYph+KpfdPRnQJVrZfk0KJgdnaAWKfhsBBtAf/D58Az4AvCJEmWgIBAg==
dependencies:
tslib "^2.6.2"
"@azure/core-util@^1.0.0", "@azure/core-util@^1.10.0", "@azure/core-util@^1.11.0", "@azure/core-util@^1.2.0", "@azure/core-util@^1.6.1":
version "1.11.0"
resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.11.0.tgz#f530fc67e738aea872fbdd1cc8416e70219fada7"
integrity sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==
dependencies:
"@azure/abort-controller" "^2.0.0"
tslib "^2.6.2"
"@azure/identity@^4.2.1":
version "4.6.0"
resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.6.0.tgz#276957b59fed96cf48d5e50fc728c3c226e4f105"
integrity sha512-ANpO1iAvcZmpD4QY7/kaE/P2n66pRXsDp3nMUC6Ow3c9KfXOZF7qMU9VgqPw8m7adP7TVIbVyrCEmD9cth3KQQ==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-auth" "^1.9.0"
"@azure/core-client" "^1.9.2"
"@azure/core-rest-pipeline" "^1.17.0"
"@azure/core-tracing" "^1.0.0"
"@azure/core-util" "^1.11.0"
"@azure/logger" "^1.0.0"
"@azure/msal-browser" "^4.0.1"
"@azure/msal-node" "^2.15.0"
events "^3.0.0"
jws "^4.0.0"
open "^8.0.0"
stoppable "^1.1.0"
tslib "^2.2.0"
"@azure/keyvault-common@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@azure/keyvault-common/-/keyvault-common-2.0.0.tgz#91e50df01d9bfa8f55f107bb9cdbc57586b2b2a4"
integrity sha512-wRLVaroQtOqfg60cxkzUkGKrKMsCP6uYXAOomOIysSMyt1/YM0eUn9LqieAWM8DLcU4+07Fio2YGpPeqUbpP9w==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-auth" "^1.3.0"
"@azure/core-client" "^1.5.0"
"@azure/core-rest-pipeline" "^1.8.0"
"@azure/core-tracing" "^1.0.0"
"@azure/core-util" "^1.10.0"
"@azure/logger" "^1.1.4"
tslib "^2.2.0"
"@azure/keyvault-keys@^4.4.0":
version "4.9.0"
resolved "https://registry.yarnpkg.com/@azure/keyvault-keys/-/keyvault-keys-4.9.0.tgz#83ad2370429d1f576e6c5c59ff165761e2d8feab"
integrity sha512-ZBP07+K4Pj3kS4TF4XdkqFcspWwBHry3vJSOFM5k5ZABvf7JfiMonvaFk2nBF6xjlEbMpz5PE1g45iTMme0raQ==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-auth" "^1.3.0"
"@azure/core-client" "^1.5.0"
"@azure/core-http-compat" "^2.0.1"
"@azure/core-lro" "^2.2.0"
"@azure/core-paging" "^1.1.1"
"@azure/core-rest-pipeline" "^1.8.1"
"@azure/core-tracing" "^1.0.0"
"@azure/core-util" "^1.0.0"
"@azure/keyvault-common" "^2.0.0"
"@azure/logger" "^1.0.0"
tslib "^2.2.0"
"@azure/logger@^1.0.0", "@azure/logger@^1.1.4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@azure/logger/-/logger-1.1.4.tgz#223cbf2b424dfa66478ce9a4f575f59c6f379768"
integrity sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==
dependencies:
tslib "^2.6.2"
"@azure/msal-browser@^4.0.1":
version "4.2.1"
resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-4.2.1.tgz#f8b96035b9ca421c8db2c8da1067a667a64034cd"
integrity sha512-pJX+HNVxEEvxqj3xvnFKMi/Yb6jadwOWN2QkDagj2GV2XXxJg3qq5zkE+czVw6Cmf4QiXxct+J0WF23sE8vZyA==
dependencies:
"@azure/msal-common" "15.1.1"
"@azure/msal-common@14.16.0":
version "14.16.0"
resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-14.16.0.tgz#f3470fcaec788dbe50859952cd499340bda23d7a"
integrity sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==
"@azure/msal-common@15.1.1":
version "15.1.1"
resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-15.1.1.tgz#2bd9bef17857217f25b5885e7b2824bfd9c8edab"
integrity sha512-bvLWYq9fleAcTJ6H+hfkG91On6vI/UhGyOB7Z6r0Bsa+KTL3zPtigmGCOJgdxrEklOYD88X9SehexLDH/5NRKQ==
"@azure/msal-node@^2.15.0":
version "2.16.2"
resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-2.16.2.tgz#3eb768d36883ea6f9a939c0b5b467b518e78fffc"
integrity sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==
dependencies:
"@azure/msal-common" "14.16.0"
jsonwebtoken "^9.0.0"
uuid "^8.3.0"
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2":
version "7.26.2"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85"
@@ -1068,6 +1237,11 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
"@js-joda/core@^5.6.1":
version "5.6.4"
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-5.6.4.tgz#abafce9b30302639bfe4a71bad5120fe39654f10"
integrity sha512-ChdLDTYMEoYoiKZMT90wZMEdGvZ2/QZMnhvjvEqeO5oLoxUfSiLzfe6Lhf3g88+MhZ+utbAu7PAxX1sZkLo5pA==
"@ladjs/country-language@^0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@ladjs/country-language/-/country-language-0.2.1.tgz#553f776fa1eb295d0344ed06525a945f94cdafaa"
@@ -1875,6 +2049,14 @@
"@types/bson" "*"
"@types/node" "*"
"@types/node-fetch@^2.6.4":
version "2.6.12"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.12.tgz#8ab5c3ef8330f13100a7479e2cd56d3386830a03"
integrity sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==
dependencies:
"@types/node" "*"
form-data "^4.0.0"
"@types/node@*", "@types/node@>=10.0.0":
version "22.10.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766"
@@ -1882,6 +2064,28 @@
dependencies:
undici-types "~6.20.0"
"@types/node@>=18":
version "22.13.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.4.tgz#3fe454d77cd4a2d73c214008b3e331bfaaf5038a"
integrity sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg==
dependencies:
undici-types "~6.20.0"
"@types/node@^18.11.18":
version "18.19.75"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.75.tgz#be932799d1ab40779ffd16392a2b2300f81b565d"
integrity sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw==
dependencies:
undici-types "~5.26.4"
"@types/readable-stream@^4.0.0":
version "4.0.18"
resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.18.tgz#5d8d15d26c776500ce573cae580787d149823bfc"
integrity sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA==
dependencies:
"@types/node" "*"
safe-buffer "~5.1.1"
"@types/semver-utils@^1.1.1":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@types/semver-utils/-/semver-utils-1.1.3.tgz#f78233e6613e53626844112422845f0f13b573fb"
@@ -1930,6 +2134,13 @@ abbrev@1, abbrev@^1.0.0:
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
abort-controller@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==
dependencies:
event-target-shim "^5.0.0"
accepts@~1.3.4, accepts@~1.3.8:
version "1.3.8"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e"
@@ -2529,6 +2740,16 @@ bl@^4.0.3:
inherits "^2.0.4"
readable-stream "^3.4.0"
bl@^6.0.11:
version "6.0.19"
resolved "https://registry.yarnpkg.com/bl/-/bl-6.0.19.tgz#c4487282bb18768186f02fec6be1be3b5b93677b"
integrity sha512-4Ay3A3oDfGg3GGirhl4s62ebtnk0pJZA5mLp672MPKOQXsWvXjEF4dqdXySjJIs7b9OVr/O8aOo0Lm+xdjo2JA==
dependencies:
"@types/readable-stream" "^4.0.0"
buffer "^6.0.3"
inherits "^2.0.4"
readable-stream "^4.2.0"
bluebird@3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
@@ -2758,6 +2979,14 @@ buffer@^5.5.0, buffer@^5.6.0:
base64-js "^1.3.1"
ieee754 "^1.1.13"
buffer@^6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==
dependencies:
base64-js "^1.3.1"
ieee754 "^1.2.1"
busboy@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893"
@@ -3716,6 +3945,11 @@ define-data-property@^1.0.1, define-data-property@^1.1.4:
es-errors "^1.3.0"
gopd "^1.0.1"
define-lazy-prop@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
define-properties@^1.2.0, define-properties@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c"
@@ -4016,7 +4250,7 @@ dot-prop@^6.0.1:
dependencies:
is-obj "^2.0.0"
dotenv@^16.0.2:
dotenv@^16.4.7:
version "16.4.7"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.7.tgz#0e20c5b82950140aa99be360a8a5f52335f53c26"
integrity sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==
@@ -4419,6 +4653,11 @@ event-stream@^4.0.1:
stream-combiner "^0.2.2"
through "^2.3.8"
event-target-shim@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
eventemitter3@^3.0.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
@@ -4429,6 +4668,11 @@ eventemitter3@^4.0.0:
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
events@^3.0.0, events@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
execa@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50"
@@ -4849,6 +5093,11 @@ forever-agent@~0.6.1:
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==
form-data-encoder@1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040"
integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==
form-data-encoder@^2.1.2:
version "2.1.4"
resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-2.1.4.tgz#261ea35d2a70d48d30ec7a9603130fa5515e9cd5"
@@ -4881,6 +5130,14 @@ form-data@~2.3.2:
combined-stream "^1.0.6"
mime-types "^2.1.12"
formdata-node@^4.3.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-4.4.1.tgz#23f6a5cb9cb55315912cbec4ff7b0f59bbd191e2"
integrity sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==
dependencies:
node-domexception "1.0.0"
web-streams-polyfill "4.0.0-beta.3"
formidable@^1.2.2:
version "1.2.6"
resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.6.tgz#d2a51d60162bbc9b4a055d8457a7c75315d1a168"
@@ -5747,7 +6004,7 @@ http-proxy-agent@^5.0.0:
agent-base "6"
debug "4"
http-proxy-agent@^7.0.2:
http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e"
integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==
@@ -5849,14 +6106,14 @@ iconv-lite@0.4.24, iconv-lite@^0.4.4:
dependencies:
safer-buffer ">= 2.1.2 < 3"
iconv-lite@0.6.3, iconv-lite@^0.6.2:
iconv-lite@0.6.3, iconv-lite@^0.6.2, iconv-lite@^0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"
ieee754@^1.1.13:
ieee754@^1.1.13, ieee754@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
@@ -6146,7 +6403,7 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2:
is-accessor-descriptor "^1.0.1"
is-data-descriptor "^1.0.1"
is-docker@^2.0.0:
is-docker@^2.0.0, is-docker@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
@@ -6438,7 +6695,7 @@ is-wsl@^1.1.0:
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==
is-wsl@^2.1.1:
is-wsl@^2.1.1, is-wsl@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
@@ -6973,6 +7230,11 @@ jpeg-js@^0.2.0:
resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.2.0.tgz#53e448ec9d263e683266467e9442d2c5a2ef5482"
integrity sha512-Ni9PffhJtYtdD7VwxH6V2MnievekGfUefosGCHadog0/jAevRu6HPjYeMHbUemn0IPE8d4wGa8UsOGsX+iKy2g==
js-md4@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/js-md4/-/js-md4-0.3.2.tgz#cd3b3dc045b0c404556c81ddb5756c23e59d7cf5"
integrity sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==
js-stringify@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/js-stringify/-/js-stringify-1.0.2.tgz#1736fddfd9724f28a3682adc6230ae7e4e9679db"
@@ -7106,7 +7368,7 @@ jsonparse@^1.3.1:
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==
jsonwebtoken@^9.0.1:
jsonwebtoken@^9.0.0, jsonwebtoken@^9.0.1:
version "9.0.2"
resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3"
integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==
@@ -8267,6 +8529,11 @@ napi-build-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==
native-duplexpair@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/native-duplexpair/-/native-duplexpair-1.0.0.tgz#7899078e64bf3c8a3d732601b3d40ff05db58fa0"
integrity sha512-E7QQoM+3jvNtlmyfqRZ0/U75VFgCls+fSkbml2MpgWkWyz3ox8Y58gNhfuziuQYGNNQAbFZJQck55LHCnCK6CA==
natives@^1.1.3:
version "1.1.6"
resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb"
@@ -8340,6 +8607,11 @@ node-cron@^3.0.2:
dependencies:
uuid "8.3.2"
node-domexception@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==
node-emoji@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c"
@@ -8352,7 +8624,7 @@ node-ensure@^0.0.0:
resolved "https://registry.yarnpkg.com/node-ensure/-/node-ensure-0.0.0.tgz#ecae764150de99861ec5c810fd5d096b183932a7"
integrity sha512-DRI60hzo2oKN1ma0ckc6nQWlHU69RH6xN0sjQTjMpChPfTYvKZdcQFfdYK2RWbJcKyUizSIy/l8OTGxMAM1QDw==
node-fetch@^2.6.0:
node-fetch@^2.6.0, node-fetch@^2.6.7:
version "2.7.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
@@ -8784,6 +9056,28 @@ open@7:
is-docker "^2.0.0"
is-wsl "^2.1.1"
open@^8.0.0:
version "8.4.2"
resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9"
integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==
dependencies:
define-lazy-prop "^2.0.0"
is-docker "^2.1.1"
is-wsl "^2.2.0"
openai@^4.83.0:
version "4.83.0"
resolved "https://registry.yarnpkg.com/openai/-/openai-4.83.0.tgz#87edfebecf8a4dc2317269dd704cf0ebd9f11979"
integrity sha512-fmTsqud0uTtRKsPC7L8Lu55dkaTwYucqncDHzVvO64DKOpNTuiYwjbR/nVgpapXuYy8xSnhQQPUm+3jQaxICgw==
dependencies:
"@types/node" "^18.11.18"
"@types/node-fetch" "^2.6.4"
abort-controller "^3.0.0"
agentkeepalive "^4.2.1"
form-data-encoder "1.7.2"
formdata-node "^4.3.2"
node-fetch "^2.6.7"
openurl@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/openurl/-/openurl-1.1.1.tgz#3875b4b0ef7a52c156f0db41d4609dbb0f94b387"
@@ -9796,6 +10090,17 @@ readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
readable-stream@^4.2.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.7.0.tgz#cedbd8a1146c13dfff8dab14068028d58c15ac91"
integrity sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==
dependencies:
abort-controller "^3.0.0"
buffer "^6.0.3"
events "^3.3.0"
process "^0.11.10"
string_decoder "^1.3.0"
readdirp@~3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
@@ -10801,6 +11106,11 @@ stealthy-require@^1.1.1:
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==
stoppable@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/stoppable/-/stoppable-1.1.0.tgz#32da568e83ea488b08e4d7ea2c3bcc9d75015d5b"
integrity sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==
stream-combiner@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.2.2.tgz#aec8cbac177b56b6f4fa479ced8c1912cee52858"
@@ -10911,7 +11221,7 @@ string.prototype.trimstart@^1.0.8:
define-properties "^1.2.1"
es-object-atoms "^1.0.0"
string_decoder@^1.1.1:
string_decoder@^1.1.1, string_decoder@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
@@ -11148,6 +11458,22 @@ tar@^6.1.11, tar@^6.1.2:
mkdirp "^1.0.3"
yallist "^4.0.0"
tedious@^18.6.1:
version "18.6.1"
resolved "https://registry.yarnpkg.com/tedious/-/tedious-18.6.1.tgz#1c4a3f06c891be67a032117e2e25193286d44496"
integrity sha512-9AvErXXQTd6l7TDd5EmM+nxbOGyhnmdbp/8c3pw+tjaiSXW9usME90ET/CRG1LN1Y9tPMtz/p83z4Q97B4DDpw==
dependencies:
"@azure/core-auth" "^1.7.2"
"@azure/identity" "^4.2.1"
"@azure/keyvault-keys" "^4.4.0"
"@js-joda/core" "^5.6.1"
"@types/node" ">=18"
bl "^6.0.11"
iconv-lite "^0.6.3"
js-md4 "^0.3.2"
native-duplexpair "^1.0.0"
sprintf-js "^1.1.3"
test-exclude@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"
@@ -11537,6 +11863,11 @@ underscore@~1.13.1:
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.7.tgz#970e33963af9a7dda228f17ebe8399e5fbe63a10"
integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==
undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
undici-types@~6.20.0:
version "6.20.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433"
@@ -11695,7 +12026,7 @@ utils-merge@1.0.1:
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==
uuid@8.3.2, uuid@^8.3.2:
uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
@@ -11874,6 +12205,11 @@ web-resource-inliner@^6.0.1:
node-fetch "^2.6.0"
valid-data-url "^3.0.0"
web-streams-polyfill@4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz#2898486b74f5156095e473efe989dcf185047a38"
integrity sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==
webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"