Skip to content

Commit e10893a

Browse files
build: update dependencies and related scripts and docs
1 parent 7ba81da commit e10893a

File tree

10 files changed

+248
-220
lines changed

10 files changed

+248
-220
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/docs
21
/build
32
/node_modules
43
/.idea

README.md

+34-27
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22

33
conjoon application module for providing user authentication against an imap server.
44

5+
## About
6+
This package supports [rest-api-email](https:://github.com/conjoon/rest-api-description) for authenticating
7+
a user against an IMAP server, where the sign-in crendentials for an IMAP-account are the login-information
8+
submitted via this package's login form.
9+
10+
It is best suited for ISPs who wish to enable webmail services for their clients based on single account information.
11+
512
## Installation
613
```bash
7-
$ npm install --save-dev @conjoon/extjs-app-imapuser
14+
$ npm i @conjoon/extjs-app-imapuser
815
```
916

10-
If you want to develop with this package, run the `build:dev`-script afterwards:
17+
If you want to develop with this package, run the `build:dev`-script:
1118
```bash
1219
$ npm run build:dev
1320
```
@@ -17,10 +24,8 @@ Testing environment will then be available via
1724
$ npm test
1825
```
1926

20-
For using the package as an external dependency in an application, use
21-
```bash
22-
$ npm install --save-prod @conjoon/extjs-app-imapuser
23-
```
27+
For using the package as an external dependency in an application:
28+
<br>
2429
In your `app.json`, add this package as a requirement, and make sure your ExtJS `workspace.json`
2530
is properly configured to look up local repositories in the `node_modules`-directory.
2631

@@ -34,29 +39,31 @@ Example (`workspace.json`) :
3439
}
3540
```
3641

37-
## Configuration options
38-
39-
### Rest API
40-
- `service.rest-imapuser.base` - the base url to the [service](#required_services) providing endpoints for the [rest-imapuser](https://github.com/conjoon/rest-api-description)-API
41-
42-
43-
## Usage
44-
When using this package without a backend implementation, make sure your app uses the [extjs-app-imapusersim](https://github.com/conjoon/extjs-app-imapusersim) package of the [conjoon](https://github.com/conjoon) project.
45-
46-
### Required Services <a name="required_services"></a>
47-
This package requires a service that complies with the REST API described in `rest-imapuser` which can be found
48-
in the [REST API description](https://github.com/conjoon/rest-api-description) of the **conjoon**-project.
49-
50-
The url of this service can be configured in the configuration file for this package.
42+
Update the `app.json` of the application by specifying this package in the `uses`-property in
43+
either the `development` and/or `prodution` section:
5144

45+
*Example:*
5246
```json
5347
{
54-
"service": {
55-
"rest-imapuser": {
56-
"base" : "https://localhost/rest-imapuser/api/v1"
57-
}
48+
"development": {
49+
"uses": [
50+
"extjs-dev-imapusersim",
51+
"extjs-app-imapuser",
52+
"extjs-app-webmail",
53+
"extjs-dev-webmailsim"
54+
]
55+
},
56+
"production": {
57+
"uses": [
58+
"extjs-app-imapuser",
59+
"extjs-app-webmail"
60+
]
5861
}
59-
}
62+
}
6063
```
61-
Please refer to the documentation of [extjs-lib-core](https://github.com/coon-js/extjs-lib-core) on how to
62-
create package-specific configurations.
64+
65+
## Configuration and Usage
66+
For more information on how to configure and use the package, refer to the [documentation](./docs/README.md).
67+
68+
## Tests
69+
Tests are written with [Siesta](https://bryntum.com/siesta). Documentation can be found [here](./tests/README.md).

docs/README.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# @conjoon/extjs-app-imapuser Documentation
2+
3+
**extjs-app-imapuser** is a **coon.js** package and is tagged as such in the
4+
`package.json`:
5+
6+
```json
7+
{
8+
"coon-js": {
9+
"package": {
10+
"autoLoad": {
11+
"registerController": true
12+
},
13+
"config": "${package.resourcePath}/extjs-app-imapuser.conf.json"
14+
}
15+
}
16+
}
17+
```
18+
19+
By default, this package's configuration can be found in this package's `resources` folder
20+
in a file named `extjs-app-imapuser.conf.json`.
21+
22+
### Required Services
23+
This package requires a service that complies with the REST API described in `rest-api-email` which can be found
24+
in the [REST API description](https://github.com/conjoon/rest-api-description) of the **conjoon**-project.
25+
26+
#### Mocking required Services
27+
When using this package without a backend implementation, your app can use the
28+
[extjs-dev-imapusersim](https://github.com/conjoon/extjs-dev-imapusersim) package of
29+
the [conjoon](https://github.com/conjoon) project.
30+
31+
## What goes into a `extjs-app-imapuser` configuration?
32+
33+
The package takes care of sending sign-in credentials of a user via HTTP to a backend
34+
implementing [rest-api-email](https://github.com/conjoon/rest-api-description). Used in a
35+
**coon.js**-application, it will also hook into the preLaunch-process and render views for providing
36+
form inputs for the user.
37+
The configuration file for this package has two main entries: `tile` and `service`:
38+
39+
```json
40+
{
41+
"title": "Login",
42+
"service": {
43+
"rest-imapuser" : {
44+
"base" : "https://ddev-ms-email.ddev.site/rest-imapuser/api/v0/"
45+
}
46+
}
47+
}
48+
```
49+
50+
- `title` - The title of the package. This is used for assembling navigation entries, or changing the
51+
`document.title` of the browser instance the application runs in. This package notifies interested
52+
observers with this title whenever view of the package gets activated and gains the focus.
53+
- `service` - Endpoint configuration for this package. Used to create required URLs for outgoing
54+
HTTP-requests. Holds the key `rest-imapuser.base` that must hold the base URL where the endpoints for authentication
55+
as described in [rest-api-mail](https://github.com/conjoon/rest-api-description) can be found.

0 commit comments

Comments
 (0)