cronofy / cronofy-node

Node wrapper for the Cronofy API
https://docs.cronofy.com/developers
MIT License
49 stars 23 forks source link

Updated to 2.3.2 from 1.3.0 now have dataCenter error #39

Closed hipitihop closed 6 years ago

hipitihop commented 7 years ago

I updated to v 2.3.2 from 1.3.0 making adjustment to call constructor. But I get the following error. Do I need to pass extra parms/options now or ideas ?


    api: 'https://api' + (config.dataCenter ? '-' + config.dataCenter : '') + '.cronofy.com'
                                ^
.../node_modules/cronofy/src/index.js:21
    api: 'https://api' + (config.dataCenter ? '-' + config.dataCenter : '') + '.cronofy.com'
                                ^

TypeError: Cannot read property 'dataCenter' of undefined
    at new cronofy (.../node_modules/cronofy/src/index.js:21:33)
    at .../run/compiled_dev/parts/hat_node/cronofy.js:12:29
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at Object.runInThisContext (vm.js:116:38)
    at nodeGlobalRequire (.../run/compiled_dev/parts/goog/bootstrap/nodejs.js:87:6)
....
Process finished with exit code 1```
hipitihop commented 7 years ago

Update: Instead of empty constructor I now pass {"access_token": "...."} and above error is resolved, however now my readEvents is getting no results. I'll have to investigate further what has changed in the API, it's not immediately obvious in readme. Have these changes been docked somewhere ? I assume all this is why you have bumped breaking SEMVER

stephenbinns commented 7 years ago

Hi @hipitihop what does you call to readEvents look like?

hipitihop commented 7 years ago

@stephenbinns Unchanged from working in 1.3.0 is this some callback vs promise issue ?

readEvents({"access_token": "...obfuscated...",
             "include_managed": true,
             "only_managed": false,
             "tzid": "Australia/Brisbane",
             "from": "......",
             "to": "....."}, callback-fn)
stephenbinns commented 6 years ago

Is this still an issue for you @hipitihop?