Skip to content

Commit 7037877

Browse files
- enhancement: migrated package to NPM package
1 parent 537a6e7 commit 7037877

File tree

206 files changed

+12939
-3336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+12939
-3336
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
/tests/index.html
55
/.idea
66
/node_modules/
7-
*.env
7+
*.env
8+
/.githooks/
9+
/.github/
10+
/.extjs-link.conf.json
11+
/tests/index.extjs-browser.html

.travis.yml

-47
This file was deleted.

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017-2021 Thorsten Suckow-Homberg https://github.com/conjoon/app-cn_mail
3+
Copyright (c) 2017-2021 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# @conjoon/extjs-app-webmail
2+
This Sencha ExtJS NPM package is built with the [coon.js-library](https://github.com/coon.js) and provides a webmail client
3+
implementation for the [conjoon](https://github.com/conjoon/conjoon) application.
4+
5+
## Installation
6+
```
7+
npm install --save-dev @conjoon/extjs-app-webmail
8+
```
9+
10+
## Post-Install
11+
[@coon-js/extjs-link](https://npmjs.org/coon-js/extjs-link) will start once the package was installed and guide you
12+
through the process of creating symlinks to an existing ExtJS sdk installation.
13+
This is only required if you want to run the tests (`./tests`), as [Siesta](https//npmjs.org/siesta-lite) relies on
14+
an existing ExtJS installation.
15+
16+
## Usage
17+
When using this package without a backend implementation, make sure your app uses the [extjs-dev-webmailsim](https://github.com/conjoon/extjs-dev-webmailsim) package of the [conjoon](https://github.com/conjoon) project.
18+
19+
### Available API Implementations
20+
A simplistic RESTful PHP backend that can be used with single sign-ons to existing IMAP Servers can be found at [php-cn_imapuser](https://github.com/conjoon/php-cn_imapuser).
21+
22+
### Required API
23+
The following API calls are made from `extjs-app-webmail`
24+
25+
* `cn_mail/MailAccounts` | **GET**
26+
* **Parameters:** -
27+
* Returns a list of all available Email-Accounts according to the model found in `conjoon.cn_mail.model.mail.account.MailAccount`. Failed attempts to retrieve this list should return appropriate http Status-Code.
28+
* Success Status / Response: Status 200 `{success : true, data : [{...}, {...}, ...] `
29+
* Failure Status / Response: Status * `{success : false}`
30+
31+
* `cn_mail/MailAccounts/{mailAccountId}/MailFolders` | **GET**
32+
* **Parameters:**
33+
* `{mailAccountId}` (required): The id of the MailAccount for which the folders should be queried.
34+
* Returns a list of all folders for the MailAccount with the specified `mailAccountId`, according to the model found in `conjoon.cn_mail.model.mail.folder.MailFolder`; child-folders should be available in the `data`-property of each folder. Failed attempts to retrieve this list should return appropriate http Status-Code.
35+
* Success Status / Response: Status 200 `{success : true, data : []}`
36+
* Failure Status / Response: Status * `{success : false}`
37+
38+
* `cn_mail/MailAccounts/{mailAccountId}/MailFolders/{mailFolderId}/MessageItems` | **POST**
39+
* **Parameters:**
40+
* `{mailAccountId}` (required): The id of the MailAccount for which the Message should be queried;
41+
* `{mailFolderId}` (required): The id of the folder for which the Message should be returned;
42+
* `{messageItemId}` (required): The id of the Message to return;
43+
* `{target}` (required): if `{target=MessageBody}` is set, only the the MessageBody should be created and returned; if `{target=MessageItem}` is set, only MessageItem-informations should be created and returned;
44+
* Returns the created MessageBody or MessageItem for the specified parameters.
45+
* Success Status / Response: Status 200 `{success : true, data : {}}`
46+
* Failure Status / Response: Status * `{success : false}`; if the parameter `{target}` is missing, a *400 - Bad Request* should be returned
47+
48+
* `cn_mail/MailAccounts/{mailAccountId}/MailFolders/{mailFolderId}/MessageItems?{start}&limit&{sort}` | **GET**
49+
* **Parameters:**
50+
* `{mailAccountId}` (required): The id of the MailAccount for which the folders should be queried;
51+
* `{mailFolderId}` (required): The id of the folder for which the messages should be returned;
52+
* `{start}` (required): The first index of the list to return;
53+
* `{limit}` (required): The number of items to return;
54+
* `{sort}` an array with sorting informations the client requests, e.g.: `sort=[{property : date, direction : DESC}]`
55+
* Returns a list of all MessageItems for the MailAccount with the specified `mailAccountId` found in the mailbox with the id `mailFolderId`, according to the model found in `conjoon.cn_mail.model.mail.message.MessageItem`; Failed attempts to retrieve this list should return appropriate http Status-Code. This response returns a list of MessageItems in the boundaries of `start` and `start + limit`; meta-information in the response need to contain the current number of unread messages in the queried mailbox along with the mailbox's identifier (`mailFolderId`) and the associated account (`mailAccountId`) itself.
56+
* Success Status / Response: Status 200 `{success : true, total : (int), meta : {unreadCount : (int), mailFolderId : (string), mailAccountId : (string)}, data : []}`
57+
* Failure Status / Response: Status * `{success : false}`
58+
59+
* `cn_mail/MailAccounts/{mailAccountId}/MailFolders/{mailFolderId}/MessageItems/{messageItemId}` | **GET**
60+
* **Parameters:**
61+
* `{mailAccountId}` (required): The id of the MailAccount for which the Message should be queried;
62+
* `{mailFolderId}` (required): The id of the folder for which the Message should be returned;
63+
* `{messageItemId}` (required): The id of the Message to return;
64+
* `{target}` (required): if `{target=MessageBody}` is set, only the the MessageBody should be returned; if `{target=MessageItem}` is set, only MessageItem-informations should be returned;
65+
* Returns the MessageItem or MessageBody for the specified parameters.
66+
* Success Status / Response: Status 200 `{success : true, data : {}}`
67+
* Failure Status / Response: Status * `{success : false}`; if the parameter `{target}` is missing, a *400 - Bad Request* should be returned
68+
69+
* `cn_mail/MailAccounts/{mailAccountId}/MailFolders/{mailFolderId}/MessageItems/{messageItemId}` | **PUT**
70+
* **Parameters:**
71+
* `{mailAccountId}` (required): The id of the MailAccount for which the Message should be queried;
72+
* `{mailFolderId}` (required): The id of the folder for which the Message should be returned;
73+
* `{messageItemId}` (required): The id of the Message to return;
74+
* `{target}` (required): `{target=MessageItem}`
75+
* `{origin}` (required): `{origin=create}` - Required for MessageDrafts to determine if they were initially created
76+
* `{action}` (required): `{action=move}` - Required to determine if a move operation is requested by the client
77+
* The following data can be submitted:
78+
* `seen (true/false)` sets the \Seen flag for the specified Message (for `{target=MessageItem}`)
79+
* `flagged (true/false)` sets the \Flagged flag for the specified Message (for `{target=MessageItem}`)
80+
* `draft (true/false)` sets the \Draft flag for the specified Message (for `{target=MessageItem}`)
81+
* `mailFolderId (String)` requests a move operation for the specified Message (for `{target=MessageItem}` along with `{action=move}`)
82+
* For `{target=MessageDraft}`, data described in the `conjoon.cn_mail.model.mail.message.MessageDraft` can be submitted
83+
* Success Status / Response:
84+
* Status 200 `{success : true, data :{id : (string), mailFolderId : (string), mailAccountId : (string), seen : (bool), flagged : (bool)}}` If the operation was successfull, the data must contain the id, the mailFolderId and the mailAccountId representing the compound key of the message, along with the properties `seen` and/or `flagged` and their newly set value. If a new mailFolderId was submitted with the request, the response must contain a json-encoded MessageItem. See below.
85+
* Status 200 `{success : true, data :{[json encoded MessageItem along with preview-text]}}` If the operation was successful, the data must contain a json encoded MessageItem along with the preview-text.
86+
* Failure Status / Response: Status * `{success : false}`; if the parameter `{target}` is not valid, or the request payload is invalid, a *400 - Bad Request* should be returned. If a move operation for a MessageItem was requested, and the submitted `mailFolderId` is the same as the current for the target MessageItem, a *400 - Bad Request* should be returned.
87+
88+
##Dev
89+
### Naming
90+
The following naming conventions apply:
91+
92+
#### Namespace
93+
`conjoon.cn_mail.*`
94+
#### Package name
95+
`extjs-app-webmail`
96+
#### Shorthand to be used with providing aliases
97+
`cn_mail`
98+
99+
**Example:**
100+
Class `conjoon.cn_mail.view.mail.MailDesktopViewModel` has the alias `viewmodel.cn_mail-maildesktopviewmodel`
101+
102+
## Tests
103+
Tests are written with [Siesta](https://bryntum.com/siesta)

Readme.md

-97
This file was deleted.

build.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<project name="app-cn_mail" default=".help">
2+
<project name="extjs-app-webmail" default=".help">
33

44
<script language="javascript">
55
<![CDATA[

0 commit comments

Comments
 (0)