Coder Social home page Coder Social logo

Comments (21)

Fabio53443 avatar Fabio53443 commented on July 20, 2024

npm run setup ;)
Dovrebbe settare tutto. è un po' che non lo uso lol

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Notion To [email protected] setup
node ./src/setup.cjs

node:internal/modules/cjs/loader:1080
throw err;
^

Error: Cannot find module 'C:\Users\gabri\Downloads\CVVtoNotion-master\CVVtoNotion-master\src\setup.cjs'
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v18.17.1

Ho provato a disinstallare e reinstallare node e npm, ma ancora niente

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Hai ragione, ho fatto un refactoring della struttura dei file ma ho dimenticato di cambiare il package.json. per ora basta che, dalla cartella fai node setup.cjs.In giornata risolvo.

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

should be fixed ;D

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Notion To [email protected] sync
node ./src/main.js

@notionhq/client warn: request fail { code: 'unauthorized', message: 'API token is invalid.' }
C:\Users\gabri\Downloads\CVVtoNotion-master\node_modules@notionhq\client\build\src\errors.js:162
return new APIResponseError({
^

APIResponseError: API token is invalid.
at buildRequestError (C:\Users\gabri\Downloads\CVVtoNotion-master\node_modules@notionhq\client\build\src\errors.js:162:16)
at Client.request (C:\Users\gabri\Downloads\CVVtoNotion-master\node_modules@notionhq\client\build\src\Client.js:304:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async query (file:///C:/Users/gabri/Downloads/CVVtoNotion-master/src/main.js:109:25)
at async file:///C:/Users/gabri/Downloads/CVVtoNotion-master/src/main.js:119:1 {
code: 'unauthorized',
status: 401,
headers: Headers {
[Symbol(map)]: [Object: null prototype] {
date: [ 'Mon, 04 Sep 2023 14:31:17 GMT' ],
'content-type': [ 'application/json; charset=utf-8' ],
'content-length': [ '87' ],
connection: [ 'close' ],
'x-powered-by': [ 'Express' ],
'x-notion-request-id': [ '524c5fcf-c8e5-4536-ab9b-b478898afc1a' ],
etag: [ 'W/"57-QCRLT3IovYEW+CkwyJQlFtiXiG8"' ],
vary: [ 'Accept-Encoding' ],
'cf-cache-status': [ 'DYNAMIC' ],
'set-cookie': [
'__cf_bm=AZv8hmuDD56F8RKyjug92IR52BE2antMOfNja.hylVI-1693837877-0-Aa17MY4yb1wBhKb3varYgjSKI2OAtuDu1QqyHPk1iflXPK+iiH0p5WYlPWh5wGqLG59jQMbDVq9DdbkhsCUQ3fo=; path=/; expires=Mon, 04-Sep-23 15:01:17 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None'
],
server: [ 'cloudflare' ],
'cf-ray': [ '8016ef6c0b934c57-MXP' ]
}
},
body: '{"object":"error","status":401,"code":"unauthorized","message":"API token is invalid."}'
}

Node.js v18.17.1

Potrei essere stupido io hahaha, l'api token è quella che inizia con secret vero? Perchè la ho messa ma evidentemente non è corretta.

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Questo viene mostrato quando eseguo npm run sync. Ho provato a reinstallare, e le credenziali inserite quando seguo npm run setup sono corrette

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Ho riprovato con node setup.cjs, e stavolta quando eseguo npm run sync da un errore diverso:

> Notion To [email protected] sync
> node ./src/main.js

node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module 'C:\Users\gabri\Desktop\CVVtoNotion-master\src\main.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Adesso provo a vedere se c'è qualche errore di collegamenti

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Ho ora sottomano il codice; rieseguo tutto da 0 e aggiusto se ci sono problemi. Ora come ora ti consiglio di riclonare la repo da 0 e vedere se va.

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Allora, update, essenzialmente il problema per la key è che node non riesce a settare variabili d'ambiente su windows con process.env integrato, quindi ora implemento una soluzione o con un secret.json o con un dotenv.

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Ok, grazie. Dimmi quando hai fatto che lo provo.

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Appena pushato il fix. per qualche motivo però ora sembra esserci qualche tipo di problema con la libreria su cui si basa il tutto che non sono in grado di capire e quindi risolvere. Odio javascript con tutto me stesso e se esistesse una libreria decente per CVV in python farei sicuramente con quella.
Rant over. Fammi sapere se a te va per qualche motivo al di fuori della comprensione di noi esseri umani.

Il problema è legato ad una funzione .getFullDate() che secondo Node non esiste, e il codice upstream sembra corretto confrontandolo con soluzioni online dello stsso problema. Ora provo con node 20. Se persiste apro un issue upstream.

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

https://github.com/MarcoBuster/ClasseVivaAPI
https://github.com/Lioydiano/Classeviva
potrebbero essercene altre

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Ho cancellato il commento perchè avevi pubblicato la chiave e una password. Ti consiglio di cambiare entrambi

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Oh caz sono ultra stupido, grazie mille. Ora cambio.

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Comunque continua a dire che la key non è valida

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024
> Notion To [email protected] sync
> node ./src/main.js


     █▒▒    █▒▒         █▒▒ █▒▒         █▒▒        █▒▒                   █▒▒▒     █▒▒              █▒▒

  █▒▒   █▒▒  █▒▒       █▒▒   █▒▒       █▒▒         █▒▒                   █▒ █▒▒   █▒▒              █▒▒    █▒

 █▒▒          █▒▒     █▒▒     █▒▒     █▒▒        █▒█▒ █▒    █▒▒          █▒▒ █▒▒  █▒▒    █▒▒     █▒█▒ █▒        █▒▒     █▒▒ █▒▒
 █▒▒           █▒▒   █▒▒       █▒▒   █▒▒           █▒▒    █▒▒  █▒▒       █▒▒  █▒▒ █▒▒  █▒▒  █▒▒    █▒▒   █▒▒  █▒▒  █▒▒   █▒▒  █▒▒
 █▒▒            █▒▒ █▒▒         █▒▒ █▒▒            █▒▒   █▒▒    █▒▒      █▒▒   █▒ █▒▒ █▒▒    █▒▒   █▒▒   █▒▒ █▒▒    █▒▒  █▒▒  █▒▒
  █▒▒   █▒▒      █▒▒▒▒           █▒▒▒▒             █▒▒    █▒▒  █▒▒       █▒▒    █▒ ▒▒  █▒▒  █▒▒    █▒▒   █▒▒  █▒▒  █▒▒   █▒▒  █▒▒
    █▒▒▒▒         █▒▒             █▒▒               █▒▒     █▒▒          █▒▒      █▒▒    █▒▒        █▒▒  █▒▒    █▒▒     █▒▒▒  █▒▒


Version: 1.1.1

██████╗ ███████╗██╗    ██╗ █████╗ ██████╗ ███████╗██╗
██╔══██╗██╔════╝██║    ██║██╔══██╗██╔══██╗██╔════╝██║
██████╔╝█████╗  ██║ █╗ ██║███████║██████╔╝█████╗  ██║
██╔══██╗██╔══╝  ██║███╗██║██╔══██║██╔══██╗██╔══╝  ╚═╝
██████╔╝███████╗╚███╔███╔╝██║  ██║██║  ██║███████╗██╗
╚═════╝ ╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝

There is sensitive data below, such as your Notion API key and your CVV login. Redact before posting.

Notion API key: secret_*api key* Notion database ID: *id*CVV login: *cvv login* CVV password: *cvv password*

@notionhq/client warn: request fail { code: 'unauthorized', message: 'API token is invalid.' }
C:\Users\gabri\Downloads\CVVtoNotion-master\node_modules\@notionhq\client\build\src\errors.js:162
        return new APIResponseError({
               ^

APIResponseError: API token is invalid.
    at buildRequestError (C:\Users\gabri\Downloads\CVVtoNotion-master\node_modules\@notionhq\client\build\src\errors.js:162:16)
    at Client.request (C:\Users\gabri\Downloads\CVVtoNotion-master\node_modules\@notionhq\client\build\src\Client.js:304:54)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async query (file:///C:/Users/gabri/Downloads/CVVtoNotion-master/src/main.js:135:25)
    at async file:///C:/Users/gabri/Downloads/CVVtoNotion-master/src/main.js:145:1 {
  code: 'unauthorized',
  status: 401,
  headers: Headers {
    [Symbol(map)]: [Object: null prototype] {
      date: [ 'Wed, 06 Sep 2023 21:30:55 GMT' ],
      'content-type': [ 'application/json; charset=utf-8' ],
      'content-length': [ '87' ],
      connection: [ 'close' ],
      'x-powered-by': [ 'Express' ],
      'x-notion-request-id': [ 'aaa12c14-ab66-42e3-9628-ee9e24e4cd6e' ],
      etag: [ 'W/"57-QCRLT3IovYEW+CkwyJQlFtiXiG8"' ],
      vary: [ 'Accept-Encoding' ],
      'cf-cache-status': [ 'DYNAMIC' ],
      'set-cookie': [
        '__cf_bm=TquskoNngVxEE46PYEfvcxLPP0ulacSHd0cDVlJbroY-1694035855-0-Ad0ge1itu023GMrHQ9Vtuovi8ONMPQln4HHk5Esla2vJO0vUbToIk+j2fGYJXXlhO/LBTHCTZUozIRRfOtm9hEE=; path=/; expires=Wed, 06-Sep-23 22:00:55 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None'
      ],
      server: [ 'cloudflare' ],
      'cf-ray': [ '8029d0de3eee5a07-MXP' ]
    }
  },
  body: '{"object":"error","status":401,"code":"unauthorized","message":"API token is invalid."}'
}

Node.js v18.17.1

Questo è il risultato (ho censurato i dati sensibili)

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Questo è lo stato delle cose ora come ora; aprirò un issue nella repo upstream quando ho tempo e si spera che si possa risolvere.

> Notion To CVV@1.1.1 sync
> node ./src/main.js


     █▒▒    █▒▒         █▒▒ █▒▒         █▒▒        █▒▒                   █▒▒▒     █▒▒              █▒▒
  █▒▒   █▒▒  █▒▒       █▒▒   █▒▒       █▒▒         █▒▒                   █▒ █▒▒   █▒▒              █▒▒    █▒
 █▒▒          █▒▒     █▒▒     █▒▒     █▒▒        █▒█▒ █▒    █▒▒          █▒▒ █▒▒  █▒▒    █▒▒     █▒█▒ █▒        █▒▒     █▒▒ █▒▒  
 █▒▒           █▒▒   █▒▒       █▒▒   █▒▒           █▒▒    █▒▒  █▒▒       █▒▒  █▒▒ █▒▒  █▒▒  █▒▒    █▒▒   █▒▒  █▒▒  █▒▒   █▒▒  █▒▒
 █▒▒            █▒▒ █▒▒         █▒▒ █▒▒            █▒▒   █▒▒    █▒▒      █▒▒   █▒ █▒▒ █▒▒    █▒▒   █▒▒   █▒▒ █▒▒    █▒▒  █▒▒  █▒▒
  █▒▒   █▒▒      █▒▒▒▒           █▒▒▒▒             █▒▒    █▒▒  █▒▒       █▒▒    █▒ ▒▒  █▒▒  █▒▒    █▒▒   █▒▒  █▒▒  █▒▒   █▒▒  █▒▒
    █▒▒▒▒         █▒▒             █▒▒               █▒▒     █▒▒          █▒▒      █▒▒    █▒▒        █▒▒  █▒▒    █▒▒     █▒▒▒  █▒▒


Version: 1.1.1

██████╗ ███████╗██╗    ██╗ █████╗ ██████╗ ███████╗██╗
██╔══██╗██╔════╝██║    ██║██╔══██╗██╔══██╗██╔════╝██║
██████╔╝█████╗  ██║ █╗ ██║███████║██████╔╝█████╗  ██║
██╔══██╗██╔══╝  ██║███╗██║██╔══██║██╔══██╗██╔══╝  ╚═╝
██████╔╝███████╗╚███╔███╔╝██║  ██║██║  ██║███████╗██╗
╚═════╝ ╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝

There is sensitive data below, such as your Notion API key and your CVV login. Redact before posting.

Notion API key: xxxx Notion database ID: xxxx login: xx@xxxxx.com CVV password: xxxxx

C:\Users\Fabio\Desktop\CVVtoNotion\CVVtoNotion\node_modules\classeviva.js\dist\src\classes\Rest.js:600
        const year = date.getFullYear();
                          ^

TypeError: date.getFullYear is not a function
    at #formatDate (C:\Users\Fabio\Desktop\CVVtoNotion\CVVtoNotion\node_modules\classeviva.js\dist\src\classes\Rest.js:600:27)
    at Rest.getAgenda (C:\Users\Fabio\Desktop\CVVtoNotion\CVVtoNotion\node_modules\classeviva.js\dist\src\classes\Rest.js:161:90)
    at agendafun (file:///C:/Users/Fabio/Desktop/CVVtoNotion/CVVtoNotion/src/main.js:66:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Users/Fabio/Desktop/CVVtoNotion/CVVtoNotion/src/main.js:149:14

Node.js v18.17.1

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Comunque chiuderò qui questo issue perchè è OT dal titolo. Ne aprirò un altro dedicato a questo.

from cvvtonotion.

Gabbo144 avatar Gabbo144 commented on July 20, 2024

Sì, ho collegato. Adesso riproverò

from cvvtonotion.

Fabio53443 avatar Fabio53443 commented on July 20, 2024

Pls apri un nuovo issue se continua ad essere rotto:)

(ps ho sistemato la cosa della data, quindi ora come ora a me funziona tutto tranne che la mia scuola ancora non avvia l'anno scolastico quindi l'agenda ancora non esiste)

from cvvtonotion.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.