Add first version for usage as CLI Tool
NOT FINISHED!
This commit is contained in:
@@ -14,39 +14,29 @@
|
||||
2. Request a token for some Account (user could have multiple accounts) using the Account `url` and the users `intent`
|
||||
3. Use the token to authenticate for every other API-Call
|
||||
|
||||
Example login:
|
||||
## CLI (Work in progress)
|
||||
|
||||
```python
|
||||
auth = ACAuthenticator()
|
||||
session = auth.login(username, password)
|
||||
pprint(session)
|
||||
user = session['user']
|
||||
# use first account
|
||||
account = auth.find_account(account_name)
|
||||
```
|
||||
> activecollab [options] [command] [object] [arguments]
|
||||
|
||||
Example request token
|
||||
### Options
|
||||
|
||||
```python
|
||||
token = ACTokenAuthenticator(account, user).issue_token_intent()
|
||||
pprint(token)
|
||||
```
|
||||
- config=<file> - read config from file (json)
|
||||
|
||||
Example client request
|
||||
### Command
|
||||
|
||||
```python
|
||||
ac = ACClient(account, token)
|
||||
res = ac.get_projects()
|
||||
pprint(res.json())
|
||||
```
|
||||
- list
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
-
|
||||
### Object
|
||||
|
||||
## Configuration
|
||||
- info - get Info like version nummer from server
|
||||
- project
|
||||
- task
|
||||
- subtask
|
||||
- people
|
||||
- invoice
|
||||
|
||||
config.ini:
|
||||
|
||||
```ini
|
||||
[LOGIN]
|
||||
username = you@example.com
|
||||
password = very-secret
|
||||
account_name = "#123456"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user