Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue "pbkdf Authentication method not supported#20" #21

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
624dbdb
add: pbkdf2 authentication
Fiwel00 Jul 11, 2023
ba53b38
add: reworked to node-fetch
Fiwel00 Jul 15, 2023
29f92f7
update: node modules naming convention
Fiwel00 Jul 15, 2023
aa6f0a6
remove: console logs
Fiwel00 Jul 17, 2023
8e430e2
refactor: param interface
Fiwel00 Jul 17, 2023
efaa605
removed: unused pipe
Fiwel00 Jul 17, 2023
60d829e
removed: dupplicate http request call
Fiwel00 Jul 17, 2023
83fea9f
refactor: params order
Fiwel00 Jul 17, 2023
5c7a90a
refactor activecalls.js
Fiwel00 Jul 25, 2023
fa70f08
fix calls.js
Fiwel00 Jul 25, 2023
9d1ef74
refactor dial.js
Fiwel00 Jul 25, 2023
4fa23d8
refactor markread.js
Fiwel00 Jul 25, 2023
e0f8bcd
added support for Fritzbox!7.50 tam.js
Fiwel00 Jul 25, 2023
9152d4c
fix phonebook.js & tamdownload.js
Fiwel00 Jul 28, 2023
7fd4d8f
added TODO implementation for toggleswitch.js
Fiwel00 Jul 28, 2023
da68ece
refactor version.js
Fiwel00 Jul 28, 2023
cf8089a
eslint & package.json
Fiwel00 Jul 28, 2023
87b4d5f
added new GetDevices/GetDeviceByName functionality
Fiwel00 Aug 8, 2023
b2d4f03
updated readme
Fiwel00 Aug 8, 2023
0e9055d
Create npm-publish.yml
Fiwel00 Aug 8, 2023
12fb25e
added test for getDeviceByName
Fiwel00 Aug 8, 2023
ba9a10b
Merge branch 'master' of https://github.com/Fiwel00/fritzbox.js
Fiwel00 Aug 8, 2023
0c6f351
release 2.1.1
Fiwel00 Aug 8, 2023
5fc2827
added package-lock.js
Fiwel00 Aug 8, 2023
e7f78ff
fix linting issues
Fiwel00 Aug 10, 2023
715dc2e
updated test script
Fiwel00 Aug 10, 2023
50834d8
remove tests for github actions
Fiwel00 Aug 10, 2023
1b36e9c
fix getSmartDevice
Fiwel00 Sep 28, 2023
d681208
fix error handling for resetDevice
Fiwel00 Sep 29, 2023
9592cca
fix resetDevice response
Fiwel00 Sep 29, 2023
1b6d6ef
fix github action release to npm
Fiwel00 Sep 29, 2023
dd10476
Update package.json
Fiwel00 Sep 29, 2023
e69d243
update version package.json
Fiwel00 Oct 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
}
}
32 changes: 32 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_SECRET_NEO_FRITZBOX}}
54 changes: 8 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FritzBox.js
# NeoFritzBox.js
[![GitHub release](https://img.shields.io/github/release/lesander/fritzbox.js.svg?maxAge=1)]()
[![Completion Status](https://img.shields.io/badge/completion-70%25-green.svg)]()
[![Build Status](https://travis-ci.org/lesander/fritzbox.js.svg?branch=master&cache=pls)](https://travis-ci.org/lesander/fritzbox.js)
Expand All @@ -8,19 +8,19 @@

The most powerful, simple and complete [AVM](https://avm.de) Fritz!Box [API](https://avm.de/Schnittstellen).

**This project is still a work in progress. [See issue #1 for the current status.](https://github.com/lesander/fritzbox.js/issues/1)**
**This project is a fork of [fritzbox.js](https://github.com/lesander/fritzbox.js) is mostly a refactoring excerise. But it already welcomes some new changes**

## Getting Started
This module is future-proof and uses async/await promises.

This means that you need to run NodeJS version `7.6.0` or newer. If your NodeJS version is between `7.0.0` and `7.5.0` you can use the harmony flag `--harmony-async-await` to make use of the async/await promises.

This package was tested on Fritz!Box 7390 and 7490, with firmware versions `6.53`, `6.51` and `6.83`.
This package was tested on Fritz!Box 7520, with firmware versions `7.50`.

## Installing

```
npm install fritzbox.js
npm install neofritzbox.js
```

## Usage
Expand All @@ -47,52 +47,14 @@ const options = {
To minimize overhead and limit login requests made to the Fritz!Box it is recommended to store the SID once one has been obtained using [`fritz.getSessionId`](https://fritzbox.js.org/api/#fritzLogin.getSessionId).

## Documentation
Want to get started with FritzBox.js? Cool! The API is
[documented and available here](https://fritzbox.js.org/api), and you can
[see some examples](/test) in the `test/` folder.
The only available documentation is from the base repository and does not include any additional feature that have been implemented see [fritzbox.js documentation](https://fritzbox.js.org/api).

Tests for new features have been written and you can [see some examples](/test) in the `test/` folder.

## Contributing
If you'd like to contribute to FritzBox.js, or file a bug or feature request,
If you'd like to contribute to NeoFritzBox.js, or file a bug or feature request,
please head over to [the issue tracker](/issues) or [open a pull request](/pulls).

## Migrating from 1.x.x to 2.x.x
FritzBox.js v2.x is not backwards compatible with v1.x.
One of the mayor changes includes the switch to `async/await` Promises.
In v1.x, Promises were implemented with a `then`, `catch`:

```js
fritz.getCalls(options)
.then((callHistory) => {
console.log(callHistory)
})
.catch((error) => {
console.log(error)
})
```

With v2.x, the `catch` will no longer catch any errors, since the module is now
built to provide support for `await`. Any errors will be passed along like this:

```js
fritz.getCalls(options)
.then((callHistory) => {
if (callHistory.error) return console.log(callHistory.error.message)
console.log(callHistory)
})
```

Of course, this can be simplified using `await`:

```js
let callHistory = await fritz.getCalls(options)
if (callHistory.error) return console.log(callHistory.error.message)
console.log(callHistory)
```

Note that any Promise waiting to be fulfilled using `await` should be put inside an `async` function.

For more changes, please see the [roadmap](https://github.com/lesander/fritzbox.js/issues/1).

## License
This software is open-sourced under the MIT License ([see the LICENSE file for
the full license](/LICENSE)).
Expand Down
23 changes: 11 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@
* Source-code available on GitHub.
* https://git.io/fritzbox
*/

import pckJson from './package.json' assert { type: 'json'}
const fritzConfig = {
version: require('./package.json').version,
debug: require('./package.json').options.debug
version: pckJson.version,
debug: pckJson.options.debug
}

const dir = 'src'
const fritzLogin = require('./' + dir + '/login.js')
const fritzSystem = require('./' + dir + '/system.js')
const fritzFon = require('./' + dir + '/fon.js')
const fritzDect = require('./' + dir + '/dect.js')
const fritzWlan = require('./' + dir + '/wlan.js')
import fritzLogin from './src/login.js'
import fritzSystem from './src/system.js'
import fritzFon from './src/fon.js'
import fritzDect from './src/dect.js'
import fritzWlan from './src/wlan.js'

const fritz = Object.assign(
{}, fritzConfig, fritzSystem, fritzLogin,
fritzFon, fritzDect, fritzWlan
)

process.on('unhandledRejection', function (reason, r) {
console.log('\x1b[31m[FritzBox.js] Encountered unhandled Promise rejection.\n' +
console.error('\x1b[31m[FritzBox.js] Encountered unhandled Promise rejection.\n' +
'The script has been stopped. See the full stack trace below for more information.\n' +
'If you think this has to do with FritzBox.js directly,\n' +
'please do no hesitate to open an issue on GitHub.\n')
console.log(reason, r)
console.error(reason, r)
process.exit(1)
})

module.exports = fritz
export default fritz
Loading