├── .github
├── FUNDING.yml
└── workflows
│ ├── automated.yml
│ └── manual.yml
├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CoCreate.config.js
├── LICENSE
├── README.md
├── docs
└── index.html
├── package.json
├── release.config.js
├── src
├── client
│ ├── addresses
│ │ ├── createAddress.html
│ │ ├── createForwardedAddress.html
│ │ ├── deleteAddress.html
│ │ ├── deleteForwardedAddress.html
│ │ ├── getAddressInfo.html
│ │ ├── listRegisteredAddresses.html
│ │ ├── listRegisteredAddressesForUser.html
│ │ ├── renameDomainInAddresses.html
│ │ ├── requestAddressesInfo.html
│ │ ├── requestForwardedAddressesInfo.html
│ │ ├── updateAddressInfo.html
│ │ └── updateForwardedAddressInfo.html
│ ├── application passwords
│ │ ├── createApplicationPassword.html
│ │ ├── deleteApplicationPassword.html
│ │ ├── listApplicationPasswords.html
│ │ └── requestASPInfo.html
│ ├── archive messages
│ │ ├── listArchivedMsgs.html
│ │ ├── restoreAllArchivedMsgs.html
│ │ └── restoreArchivedMsg.html
│ ├── audit
│ │ ├── createAudit.html
│ │ ├── exportAuditedEmails.html
│ │ └── requestAuditInfo.html
│ ├── authentication
│ │ ├── authenticateUser.html
│ │ ├── invalidateAuthToken.html
│ │ ├── listAuthEvents.html
│ │ └── requestEventInfo.html
│ ├── autoreplies
│ │ ├── deleteAutoreplyInfo.html
│ │ ├── requestAutoreplyInfo.html
│ │ └── updateAutoreplyInfo.html
│ ├── dkim
│ │ ├── create.html
│ │ ├── delete.html
│ │ ├── information.html
│ │ ├── list.html
│ │ └── resolve.html
│ ├── domain aliases
│ │ ├── createDomainAlias.html
│ │ ├── deleteDomainAlias.html
│ │ ├── getListRegisteredDomainAlias.html
│ │ ├── requestDomainAlias.html
│ │ └── resolveDomainAlias.html
│ ├── filters
│ │ ├── createFilter.html
│ │ ├── deleteFilter.html
│ │ ├── listFilterForUser.html
│ │ ├── requestFilterInfo.html
│ │ └── updateFilterInfo.html
│ ├── mailbox
│ │ ├── createMailbox.html
│ │ ├── deleteMailbox.html
│ │ ├── listMailbox.html
│ │ ├── requestMailbox.html
│ │ └── updateMailbox.html
│ ├── message
│ │ ├── deleteAllMessages.html
│ │ ├── deleteMessage.html
│ │ ├── downloadAttachment.html
│ │ ├── forwardStoredMessage.html
│ │ ├── getMessageSource.html
│ │ ├── listMessagesInMailbox.html
│ │ ├── requestMessagesInfo.html
│ │ ├── searchMessage.html
│ │ ├── submitDraftForDelivery.html
│ │ ├── updateMessageInfo.html
│ │ └── uploadMessage.html
│ ├── storage
│ │ ├── downloadFile.html
│ │ └── getListStoredFile.html
│ ├── submission
│ │ └── submitMessageForDelivery.html
│ ├── two factor auth
│ │ ├── disable2FA.html
│ │ ├── disableCustom2FA.html
│ │ ├── disableTOTPAuth.html
│ │ ├── enableCustom2FA.html
│ │ ├── enableTOTPSeed.html
│ │ ├── generateTOTPToken.html
│ │ └── validateTOTPSeed.html
│ └── users
│ │ ├── createUser.html
│ │ ├── deleteUser.html
│ │ ├── listRegisteredUsers.html
│ │ ├── logoutUser.html
│ │ ├── openChangeStream.html
│ │ ├── recalculateQuotaForAllUsers.html
│ │ ├── recalculateQuotaUser.html
│ │ ├── requestUserInfo.html
│ │ ├── resetPassword.html
│ │ ├── resolveUserId.html
│ │ └── updateUserInfo.html
└── js
│ ├── Cocreate-APISocket.js
│ ├── Cocreate-wildduck-address.js
│ ├── Cocreate-wildduck-archive.js
│ ├── Cocreate-wildduck-asp.js
│ ├── Cocreate-wildduck-audit.js
│ ├── Cocreate-wildduck-auth.js
│ ├── Cocreate-wildduck-autoreply.js
│ ├── Cocreate-wildduck-dkim.js
│ ├── Cocreate-wildduck-domain_alias.js
│ ├── Cocreate-wildduck-filter.js
│ ├── Cocreate-wildduck-mailbox.js
│ ├── Cocreate-wildduck-message.js
│ ├── Cocreate-wildduck-storage.js
│ ├── Cocreate-wildduck-submission.js
│ ├── Cocreate-wildduck-two_factor_auth.js
│ └── Cocreate-wildduck-user.js
├── src_server
└── apis
│ ├── email
│ └── Cocreate-email.js
│ └── utils
│ └── index.js
└── webpack.config.js
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: CoCreate-app
4 |
--------------------------------------------------------------------------------
/.github/workflows/automated.yml:
--------------------------------------------------------------------------------
1 | name: Automated
2 | "on":
3 | push:
4 | branches:
5 | - master
6 | jobs:
7 | about:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Checkout
11 | uses: actions/checkout@v2
12 | - name: Jaid/action-sync-node-meta
13 | uses: jaid/action-sync-node-meta@v1.4.0
14 | with:
15 | direction: overwrite-github
16 | githubToken: "${{ secrets.GITHUB }}"
17 | release:
18 | runs-on: ubuntu-latest
19 | steps:
20 | - name: Checkout
21 | uses: actions/checkout@v2
22 | - name: Semantic Release
23 | uses: cycjimmy/semantic-release-action@v2
24 | id: semantic
25 | with:
26 | extra_plugins: |
27 | @semantic-release/changelog
28 | @semantic-release/git
29 | @semantic-release/github
30 | env:
31 | GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
32 | NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
33 | outputs:
34 | new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
35 | new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
36 | cdn:
37 | runs-on: ubuntu-latest
38 | needs: release
39 | if: needs.release.outputs.new_release_published == 'true'
40 | env:
41 | VERSION: "${{ needs.release.outputs.new_release_version }}"
42 | steps:
43 | - name: Checkout
44 | uses: actions/checkout@v2
45 | - name: setup nodejs
46 | uses: actions/setup-node@v2
47 | with:
48 | node-version: 14.15.4
49 | - name: yarn install
50 | run: >
51 | echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
52 | .npmrc
53 |
54 | yarn install
55 | - name: yarn build
56 | run: yarn build
57 | - name: upload bundle as version
58 | uses: CoCreate-app/CoCreate-s3@master
59 | with:
60 | aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
61 | aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
62 | bucket: testcrudbucket
63 | source: ./dist
64 | destination: "/email/${{env.VERSION}}"
65 | acl: public-read
66 | - name: upload bundle as latest
67 | uses: CoCreate-app/CoCreate-s3@master
68 | with:
69 | aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
70 | aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
71 | bucket: testcrudbucket
72 | source: ./dist
73 | destination: /email/latest
74 | acl: public-read
75 | invalidations: true
76 | docs:
77 | runs-on: ubuntu-latest
78 | steps:
79 | - name: Checkout
80 | uses: actions/checkout@v2
81 |
82 | - name: update documentation
83 | uses: CoCreate-app/CoCreate-docs@master
84 |
--------------------------------------------------------------------------------
/.github/workflows/manual.yml:
--------------------------------------------------------------------------------
1 | name: Manual Workflow
2 | on:
3 | workflow_dispatch:
4 | inputs:
5 | invalidations:
6 | description: |
7 | If set to 'true', invalidates previous upload.
8 | default: "true"
9 | required: true
10 |
11 | jobs:
12 | cdn:
13 | runs-on: ubuntu-latest
14 | env:
15 | DRY_RUN: ${{ github.event.inputs.dry_run }}
16 | GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
17 | NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
18 |
19 | steps:
20 | - name: Checkout
21 | uses: actions/checkout@v2
22 | - name: setup nodejs
23 | uses: actions/setup-node@v2
24 | with:
25 | node-version: 14.15.4
26 | - name: yarn install
27 | run: >
28 | echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
29 | .npmrc
30 |
31 | yarn install
32 | - name: yarn build
33 | run: yarn build
34 | - name: upload latest bundle
35 | uses: CoCreate-app/CoCreate-s3@master
36 | with:
37 | aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
38 | aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
39 | distributionId: "${{ secrets.DISTRIBUTION_ID }}"
40 | bucket: testcrudbucket
41 | source: ./dist
42 | destination: /email/latest
43 | acl: public-read
44 | invalidations: ${{ github.event.inputs.invalidations }}
45 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ignore
2 | node_modules
3 | dist
4 | .npmrc
5 | yarn.lock
6 |
7 | logs
8 | *.log
9 | npm-debug.log*
10 | yarn-debug.log*
11 | yarn-error.log*
12 | lerna-debug.log*
13 | .pnpm-debug.log*
14 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 1.0.0 (2021-11-01)
2 |
3 |
4 | ### Bug Fixes
5 |
6 | * add workflow, update to docs, readme ([a7660fe](https://github.com/CoCreate-app/CoCreate-email/commit/a7660fe76820cf09bbdddfd533456fe13ea83778))
7 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to CoCreate-email
2 |
3 | This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-email/graphs/contributors).
4 | You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-email/pulls),
5 | [propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-email/issues).
6 |
7 | In the examples below, substitute your Github username for `contributor` in URLs.
8 |
9 | ## Fork the Project
10 |
11 | Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-email) and check out your copy.
12 |
13 | ```
14 | git email https://github.com/contributor/CoCreate-email.git
15 | cd CoCreate-email
16 | git remote add upstream https://github.com/CoCreate-app/CoCreate-email.git
17 | ```
18 |
19 | ## Create a Topic Branch
20 |
21 | Make sure your fork is up-to-date and create a topic branch for your feature or bug fix on dev branch.
22 |
23 | ```
24 | git checkout dev
25 | git pull upstream dev
26 | git checkout -b my-feature-branch
27 | ```
28 |
29 | ## Write Tests
30 |
31 | Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build.
32 |
33 | We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
34 |
35 | ## Write Code
36 |
37 | Implement your feature or bug fix.
38 |
39 | ## Write Documentation
40 |
41 | Document any external behavior in the [README](README.md).
42 |
43 | ## Commit Changes
44 |
45 | Make sure git knows your name and email address:
46 |
47 | ```
48 | git config --global user.name "Your Name"
49 | git config --global user.email "contributor@example.com"
50 | ```
51 |
52 | We use [semantic-release](https://github.com/semantic-release/semantic-release) as process to generate changelog
53 | and to release. Write meaningful commits according to
54 | [Commit Message Formats](https://github.com/semantic-release/semantic-release#commit-message-format) is important.
55 |
56 | ```
57 | git add ...
58 | git commit -am "commit-type(optional topic): a meaningful message"
59 | ```
60 |
61 | Here is an example of the release type that should be done based on a [semantic-release](https://github.com/semantic-release/semantic-release):
62 |
63 | | Commit message | Release type |
64 | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
65 | | `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
66 | | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
67 | | `perf(pencil): remove graphiteWidth option` `BREAKING CHANGE: The graphiteWidth option has been removed.` `The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |
68 |
69 |
70 | ## Push
71 |
72 | ```
73 | git push origin my-feature-branch
74 | ```
75 |
76 | ## Make a Pull Request
77 |
78 | Go to [https://github.com/CoCreate-app/CoCreate-email](https://github.com/CoCreate-app/CoCreate-email) and select your feature branch.
79 | Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
80 |
81 | ## Rebase
82 |
83 | If you've been working on a change for a while, rebase with upstream/dev.
84 |
85 | ```
86 | git fetch upstream
87 | git rebase upstream/dev
88 | git push origin my-feature-branch -f
89 | ```
90 |
91 | ## Be Patient
92 |
93 | It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang in there!
94 |
95 | ## Thank You
96 |
97 | Please do know that we really appreciate and value your time and work. We love you, really.
--------------------------------------------------------------------------------
/CoCreate.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "config": {
3 | "apiKey": "2061acef-0451-4545-f754-60cf8160",
4 | "organization_Id": "5ff747727005da1c272740ab",
5 | "host": "general.cocreate.app"
6 | },
7 |
8 | "sources": [{
9 | "entry": "./docs/index.html",
10 | "collection": "files",
11 | "document_id": "6027120e5e697f4f26a98a53",
12 | "key": "src",
13 | "data":{
14 | "name": "index.html",
15 | "path": "/docs/email/index.html",
16 | "domains": [
17 | "cocreate.app",
18 | "general.cocreate.app"
19 | ],
20 | "directory": "/docs/email",
21 | "content-type": "text/html",
22 | "public": "true",
23 | "website_id": "614298c2829b690010a5c031"
24 | }
25 | }
26 | ],
27 |
28 | "extract": {
29 | "directory": "./src/",
30 | "extensions": [
31 | "js",
32 | "css",
33 | "html"
34 | ],
35 | "ignores": [
36 | "node_modules",
37 | "vendor",
38 | "bower_components",
39 | "archive"
40 | ]
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 CoCreate LLC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CoCreate-email
2 |
3 | A simple email component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/email)
4 |
5 | 
6 | 
7 | 
8 | 
9 |
10 | 
11 |
12 | ## [Docs & Demo](https://cocreate.app/docs/email)
13 |
14 | For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/email)
15 |
16 | ## CDN
17 |
18 | ```html
19 |
20 | ```
21 |
22 | ```html
23 |
24 | ```
25 |
26 | ## NPM
27 |
28 | ```shell
29 | $ npm install @cocreate/email
30 | ```
31 |
32 | # Table of Contents
33 |
34 | - [Table of Contents](#table-of-contents)
35 | - [Announcements](#announcements)
36 | - [Roadmap](#roadmap)
37 | - [How to Contribute](#how-to-contribute)
38 | - [About](#about)
39 | - [License](#license)
40 |
41 |
42 |
43 | # Announcements
44 |
45 | All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-email/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-email/releases). You may also subscribe to email for releases and breaking changes.
46 |
47 |
48 |
49 | # Roadmap
50 |
51 | If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-email/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-email/pulls). We would love to hear your feedback.
52 |
53 |
54 |
55 | # About
56 |
57 | CoCreate-email is guided and supported by the CoCreate Developer Experience Team.
58 |
59 | Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries.
60 |
61 | CoCreate-email is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.
62 |
63 |
64 |
65 | # How to Contribute
66 |
67 | We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-email/blob/master/CONTRIBUTING.md) guide for details.
68 |
69 | We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-email/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-email/pulls) or merely upvote or comment on existing issues or pull requests.
70 |
71 | We appreciate your continued support, thank you!
72 |
73 | # License
74 |
75 | [The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-email/blob/master/LICENSE)
76 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | CoCreate-email Documentation | CoCreateJS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
CoCreate-email
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
A simple HTML5, CSS and pure javascript component. Easy configuration using data-attributes and highly styleable.
45 |
46 |
47 |
48 |
Install
49 |
npm install cocreate-email
50 |
Or you can use cdn link:
51 |
https://cdn.cocreate.app/CoCreate-email.min.js
52 |
53 |
Usage
54 |
55 |
This is email reference
56 |
57 |
58 |
59 | <div></div>
60 |
61 |
62 |
This is email reference
63 |
This is email reference
64 |
65 |
Attributes
66 |
67 |
68 | email string optional
69 | email-attribute
70 |
71 |
72 | email string optional
73 | email-attribute
74 |
75 |
76 |
77 |
78 |
79 |
80 |
Demo
81 |
127 |
128 |
129 |
130 |
131 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@cocreate/email",
3 | "version": "1.0.0",
4 | "description": "A simple email component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5 | "keywords": [
6 | "email",
7 | "cocreate",
8 | "low-code-framework",
9 | "no-code-framework",
10 | "cocreatejs",
11 | "cocreatejs-component",
12 | "cocreate-framework",
13 | "no-code",
14 | "low-code",
15 | "collaborative-framework",
16 | "realtime",
17 | "realtime-framework",
18 | "collaboration",
19 | "shared-editing",
20 | "html5-framework",
21 | "javascript-framework"
22 | ],
23 | "publishConfig": {
24 | "access": "public"
25 | },
26 | "scripts": {
27 | "start": "npx webpack --config webpack.config.js",
28 | "build": "NODE_ENV=production npx webpack --config webpack.config.js",
29 | "dev": "npx webpack --config webpack.config.js --watch",
30 | "docs": "node ./node_modules/@cocreate/docs/src/index.js"
31 | },
32 | "repository": {
33 | "type": "git",
34 | "url": "git+https://github.com/CoCreate-app/CoCreate-email.git"
35 | },
36 | "author": "CoCreate LLC",
37 | "license": "MIT",
38 | "bugs": {
39 | "url": "https://github.com/CoCreate-app/CoCreate-email/issues"
40 | },
41 | "homepage": "https://cocreate.app/docs/email",
42 | "funding": {
43 | "type": "GitHub Sponsors ❤",
44 | "url": "https://github.com/sponsors/CoCreate-app"
45 | },
46 | "main": "./src/index.js",
47 | "devDependencies": {
48 | "@babel/core": "^7.9.6",
49 | "@babel/preset-env": "^7.9.6",
50 | "babel-loader": "^8.1.0",
51 | "clean-webpack-plugin": "^3.0.0",
52 | "html-webpack-plugin": "^4.5.0",
53 | "uglifyjs-webpack-plugin": "^2.2.0",
54 | "webpack": "^5.24.4",
55 | "webpack-cli": "^4.5.0",
56 | "webpack-log": "^3.0.1",
57 | "file-loader": "^6.2.0",
58 | "style-loader": "^2.0.0",
59 | "terser-webpack-plugin": "^5.1.1"
60 | },
61 | "dependencies": {
62 | "@cocreate/docs": "^1.0.3"
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/release.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | dryRun: false,
3 | branches: ["master"],
4 | plugins: [
5 | "@semantic-release/commit-analyzer",
6 | "@semantic-release/release-notes-generator",
7 | [
8 | "@semantic-release/changelog",
9 | {
10 | changelogFile: "CHANGELOG.md",
11 | },
12 | ],
13 | "@semantic-release/npm",
14 | "@semantic-release/github",
15 | [
16 | "@semantic-release/git",
17 | {
18 | assets: ["CHANGELOG.md", "package.json"],
19 | },
20 | ],
21 | ],
22 | };
--------------------------------------------------------------------------------
/src/client/addresses/createAddress.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | upload meassage
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
53 |
54 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/src/client/addresses/createForwardedAddress.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | create forwarded address
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
68 |
69 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/src/client/addresses/deleteAddress.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/addresses/deleteForwardedAddress.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/addresses/getAddressInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Get Address Info
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
28 |
29 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/src/client/addresses/listRegisteredAddresses.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Get Address Info
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
50 |
51 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/src/client/addresses/listRegisteredAddressesForUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/client/addresses/renameDomainInAddresses.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/addresses/requestAddressesInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/addresses/requestForwardedAddressesInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/addresses/updateAddressInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | Update Address Info
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
64 |
65 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
--------------------------------------------------------------------------------
/src/client/addresses/updateForwardedAddressInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | update forwarded address
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
62 |
63 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/src/client/application passwords/createApplicationPassword.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/application passwords/deleteApplicationPassword.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/application passwords/listApplicationPasswords.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/application passwords/requestASPInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/archive messages/listArchivedMsgs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/archive messages/restoreAllArchivedMsgs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/archive messages/restoreArchivedMsg.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/audit/createAudit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/audit/exportAuditedEmails.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/audit/requestAuditInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/authentication/authenticateUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/authentication/invalidateAuthToken.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/client/authentication/listAuthEvents.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/authentication/requestEventInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/autoreplies/deleteAutoreplyInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/autoreplies/requestAutoreplyInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/autoreplies/updateAutoreplyInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/client/dkim/create.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/dkim/delete.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CHECK YOUR CONSOLE
5 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/dkim/information.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CHECK YOUR CONSOLE
5 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/dkim/list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/client/dkim/resolve.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | REsolve DKIM from DOMAIN
5 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/domain aliases/createDomainAlias.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/domain aliases/deleteDomainAlias.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/domain aliases/getListRegisteredDomainAlias.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/client/domain aliases/requestDomainAlias.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/domain aliases/resolveDomainAlias.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/filters/createFilter.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
26 |
27 |
28 |
29 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/client/filters/deleteFilter.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/filters/listFilterForUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/client/filters/requestFilterInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/filters/updateFilterInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
27 |
28 |
29 |
30 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/client/mailbox/createMailbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/mailbox/deleteMailbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/mailbox/listMailbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/mailbox/requestMailbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/mailbox/updateMailbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/message/deleteAllMessages.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/message/deleteMessage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/message/downloadAttachment.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/client/message/forwardStoredMessage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/client/message/getMessageSource.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/message/listMessagesInMailbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/message/requestMessagesInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/message/searchMessage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/message/submitDraftForDelivery.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
17 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/client/message/updateMessageInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
17 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/client/message/uploadMessage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | upload meassage
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
67 |
68 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/src/client/storage/downloadFile.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/storage/getListStoredFile.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/submission/submitMessageForDelivery.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
17 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/client/two factor auth/disable2FA.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/two factor auth/disableCustom2FA.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/two factor auth/disableTOTPAuth.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/two factor auth/enableCustom2FA.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/client/two factor auth/enableTOTPSeed.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/two factor auth/generateTOTPToken.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/client/two factor auth/validateTOTPSeed.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/client/users/createUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/client/users/deleteUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/client/users/listRegisteredUsers.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/client/users/logoutUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/users/openChangeStream.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoCreate-app/CoCreate-email/f2e0eaf5fdea6eb83c0d8dc2e8dddb9ebdf4c4e2/src/client/users/openChangeStream.html
--------------------------------------------------------------------------------
/src/client/users/recalculateQuotaForAllUsers.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/client/users/recalculateQuotaUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/users/requestUserInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/users/resetPassword.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/users/resolveUserId.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/client/users/updateUserInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/js/Cocreate-APISocket.js:
--------------------------------------------------------------------------------
1 | var CocreateAPiSocket = function() {
2 |
3 | /*this.classBtns = [];
4 | this.server = `${location.protocol}//52.203.210.252:8080`;
5 | this.urlAction = '/api/management/email';
6 | this.url = this.server+this.urlAction;
7 | */
8 | this.req_socket = 'email';
9 | this.init();
10 | };
11 |
12 | CocreateAPiSocket.prototype.init = function (){
13 | let _this = this;
14 | //Actions BTNS
15 | console.log('init .. ')
16 | this.actionsBtn();
17 | console.log("SocketOn Client -> ",this.req_socket)
18 | CoCreateSocket.listen(this.req_socket,data=>{
19 | console.log("REsponseSocket",data);
20 | _this.setResult(data);
21 | })
22 | }
23 |
24 | CocreateAPiSocket.prototype.actionsBtn = function(){
25 | let that = this;
26 | this.classBtns.forEach(selectorBtn => {
27 | let list_btns_actions = document.querySelectorAll(selectorBtn);
28 | list_btns_actions.forEach(btn => {
29 | btn.addEventListener("click", that.click_btn,false);
30 | btn.refClass = that;
31 | btn.selector = selectorBtn;
32 | });
33 | });
34 | }
35 |
36 | CocreateAPiSocket.prototype.createAdtional = function(value){
37 | let obj = {};
38 | obj['getAttribute'] = function(){
39 | return 'class';
40 | }
41 | obj['value'] = value
42 | return obj;
43 | }
44 |
45 | CocreateAPiSocket.prototype.preview_validate_btn = function(btn,event){
46 | return true;
47 | }
48 |
49 | CocreateAPiSocket.prototype.validateKeysJson = function(json,rules){
50 | let keys_json = Object.keys(json);
51 | keys_json.forEach(key=>{
52 | const index = rules.indexOf(key);
53 | if(index != -1)
54 | rules.splice(index, 1);
55 | });
56 | if( rules.length )
57 | throw "Requires the following "+ rules.toString();
58 | },
59 |
60 | CocreateAPiSocket.prototype.click_btn = function(event){
61 | event.preventDefault();
62 | let btn = this;
63 | let that = event.currentTarget.refClass;
64 | let selector = event.currentTarget.selector
65 | if(!that.preview_validate_btn(btn,event))
66 | return false;
67 | let dataToSend = that.getDataJSON(btn,that);
68 | dataToSend['type'] = selector;
69 | //that.socket(selector,dataToSend)
70 | that.socket(dataToSend,that)
71 | }
72 |
73 | CocreateAPiSocket.prototype.getDataJSON = function(btn,that){
74 | let form = btn.closest("form");
75 | let inputs = [].slice.call(form.querySelectorAll('['+that.data_param+']'));
76 | let data = {}
77 | inputs.forEach(input => {
78 | data[input.getAttribute(that.data_param)] = input.value;
79 | });
80 | return data;
81 | }
82 |
83 | CocreateAPiSocket.prototype.setResult = function(data) {
84 | }
85 |
86 | CocreateAPiSocket.prototype.socket = function(data,that){
87 | console.log(".... Sending Request Socket to endPint [email].....");
88 | console.log(data);
89 | //socket.emit('email',data);
90 | CoCreateSocket.send(that.req_socket,data);
91 | console.log(".... Send to socket .....");
92 | }
93 |
94 |
95 | /*TEMP only to see result */
96 |
97 | /*socket.on('email',function(data){
98 | console.log("REsponseSocket",data);
99 | })*/
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-address.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailCreateAddressBtn','.emailCreateForwardedAddressBtn','.emailDeleteForwardedAddressBtn','.emailGetListAddressBtn',
3 | '.emailListUserAddressBtn','.emailGetInfoAddressBtn','.emailRenameAddressDomainBtn','.emailRequestAddressInfoBtn',
4 | '.emailRequestForwardedAddressInfoBtn','.emailDeleteAddressBtn','.emailUpdateAddressInfoBtn','.emailUpdateForwardedAddressInfoBtn'];
5 |
6 | this.data_param = 'data-mail_address';
7 |
8 |
9 | CocreateAPiSocket.call(this);
10 |
11 | };
12 |
13 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
14 | CocreateEmail.prototype.constructor = CocreateEmail;
15 |
16 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-archive.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailGetListArchivedMsgsBtn','.emailRestoreArchivedMsgBtn','.emailRestoreArchivedAllMsgBtn'];
3 |
4 | this.data_param = 'data-mail_archive';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-asp.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailCreateAspBtn','.emailDeleteAspBtn','.emailGetListAspsBtn','.emailRequestAspInfoBtn'];
3 |
4 | this.data_param = 'data-mail_asp';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-audit.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailCreateAuditBtn','.emailExportAuditBtn','.emailRequestAuditBtn'];
3 |
4 | this.data_param = 'data-mail_audit';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-auth.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailAuthenticateUserBtn','.emailInvalidateAuthTokenBtn','.emailListAuthEventBtn','.emailRequestEventInfoBtn'];
3 |
4 | this.data_param = 'data-mail_auth';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-autoreply.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailDeleteAutoreplyInfoBtn','.emailRequestAutoreplyInfoBtn','.emailUpdateAutoreplyInfoBtn'];
3 |
4 | this.data_param = 'data-mail_autoreply';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-dkim.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailDkimBtn','.emailDkimListBtn','.emailDkimInfoBtn','.emailDkimDeleteBtn','.emailDkimResolveBtn'];
3 | this.data_param = 'data-mail_dkim';
4 | CocreateAPiSocket.call(this);
5 | };
6 |
7 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
8 | CocreateEmail.prototype.constructor = CocreateEmail;
9 |
10 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-domain_alias.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailCreateDomainAliasBtn','.emailDeleteDomainAliasBtn','.emailListDomainAliasesBtn','.emailRequestDomainAliasBtn','.emailResolveDomainAliasBtn'];
3 |
4 | this.data_param = 'data-mail_domain_alias';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-filter.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailCreateFilterBtn','.emailDeleteFilterBtn','.emailListFilterBtn','.emailRequestFilterBtn','.emailUpdateFilterBtn'];
3 |
4 | this.data_param = 'data-mail_filter';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-mailbox.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailCreateMailboxBtn','.emailDeleteMailboxBtn','.emailListMailboxBtn','.emailRequestMailboxBtn','.emailUpdateMailboxBtn'];
3 |
4 | this.data_param = 'data-mail_mailbox';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-message.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailDeleteMessageBtn','.emailDeleteAllMessageBtn','.emailDownloadAttachmentBtn',
3 | '.emailForwardStoredMessageBtn','.emailGetMessageSourceBtn','.emailGetListMessagesMailboxBtn',
4 | '.emailRequestMessageInfoBtn','.emailSearchMessageBtn','.emailSubmitDraftBtn','.emailUpdateMessageBtn',
5 | '.emailUploadMessageBtn'];
6 |
7 | this.data_param = 'data-mail_message'
8 |
9 |
10 | CocreateAPiSocket.call(this);
11 |
12 | };
13 |
14 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
15 | CocreateEmail.prototype.constructor = CocreateEmail;
16 |
17 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-storage.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailDeleteFileBtn','.emailDownloadFileBtn','.emailGetListStoredFilesBtn','.emailUploadFileBtn'];
3 |
4 | this.data_param = 'data-mail_storage';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-submission.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailSubmitMessageForDelivery'];
3 |
4 | this.data_param = 'data-mail_submission';
5 |
6 |
7 | CocreateAPiSocket.call(this);
8 |
9 | };
10 |
11 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
12 | CocreateEmail.prototype.constructor = CocreateEmail;
13 |
14 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-two_factor_auth.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailDisable2FABtn','.emailDisableTOTPAuthBtn','.emailDisableCustom2FABtn',
3 | '.emailEnableTOTPSeedBtn','.emailCustom2FABtn','.emailGenerateTOTPSeedBtn','.emailValidateTOTPBtn'];
4 |
5 | this.data_param = 'data-mail_two_factor_auth';
6 |
7 |
8 | CocreateAPiSocket.call(this);
9 |
10 | };
11 |
12 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
13 | CocreateEmail.prototype.constructor = CocreateEmail;
14 |
15 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src/js/Cocreate-wildduck-user.js:
--------------------------------------------------------------------------------
1 | var CocreateEmail = function() {
2 | this.classBtns = ['.emailCreateUserBtn','.emailDeleteUserBtn','.emailGetListUserBtn','.emailLogoutUserBtn',
3 | '.emailQuotaResetAllUsersBtn','.emailQuotaResetUserBtn','.emailRequestUserInfoBtn','.emailResetPswUserBtn',
4 | '.emailResolveIdUserBtn','.emailUpdateUserInfoBtn'];
5 |
6 | this.data_param = 'data-mail_user';
7 |
8 |
9 | CocreateAPiSocket.call(this);
10 |
11 | };
12 |
13 | CocreateEmail.prototype = Object.create(CocreateAPiSocket.prototype);
14 | CocreateEmail.prototype.constructor = CocreateEmail;
15 |
16 | var CocreateEmail = new CocreateEmail();
--------------------------------------------------------------------------------
/src_server/apis/email/Cocreate-email.js:
--------------------------------------------------------------------------------
1 | /* global Y */
2 | 'use strict'
3 | var utils= require('../utils');
4 |
5 |
6 | const CoCreateBase = require("../../base");
7 | //const {ObjectID, Binary} = require("mongodb");
8 |
9 | class CoCreateEmail extends CoCreateBase {
10 | constructor(wsManager, db) {
11 | super(wsManager, db);
12 | this.init();
13 | this.url_wilddock = 'http://3.231.17.247:8080';
14 | }
15 |
16 | init() {
17 | if (this.wsManager) {
18 | this.wsManager.on('email', (socket, data) => this.sendEmail(socket, data));
19 | }
20 | }
21 | async sendEmail(socket, data) {
22 |
23 | console.log("emaiul from lee");
24 | let data_original = data;
25 | let type = data['type'];
26 | delete data['type'];
27 | let url = '';
28 | let method = '';
29 | let targets = [];
30 | let tags = [];
31 | /*Address*/
32 | switch (type) {
33 | case '.emailCreateAddressBtn':
34 | url = '/users/:USER/addresses'.replace(/:USER/gi, data['user']);
35 | if(data['tags_val'])
36 | data['tags'] = JSON.parse(data['tags_val']);
37 | else
38 | data['tags'] = [];
39 | delete data['tags_val'];
40 |
41 | method = 'POST'
42 | break;
43 |
44 | case '.emailCreateForwardedAddressBtn':
45 | url = '/addresses/forwarded';
46 | method = 'POST';
47 |
48 | if(data['tags_val'])
49 | data['tags'] = JSON.parse(data['tags_val']);
50 | else
51 | data['tags'] = [];
52 | delete data['tags_val'];
53 |
54 | if(data['targets_val'])
55 | data['targets'] = JSON.parse(data['targets_val']);
56 | else
57 | data['targets'] = [];
58 | delete data['targets_val'];
59 |
60 | if(data['autoreply_val'])
61 | data['autoreply'] = JSON.parse(data['autoreply_val']);
62 | else
63 | data['autoreply'] = {};
64 | delete data['autoreply_val'];
65 |
66 | break;
67 |
68 | case '.emailDeleteForwardedAddressBtn':
69 | url = '/addresses/forwarded/' + data['address'];
70 | method = 'DELETE';
71 | delete data['address'];
72 | break;
73 |
74 | case '.emailDeleteAddressBtn':
75 | url = '/users/'+ data['user'] + '/addresses/' + data['address'];
76 | method = 'DELETE';
77 | delete data['user'];
78 | delete data['address'];
79 | break;
80 |
81 | case '.emailGetInfoAddressBtn':
82 | url = '/addresses/resolve/' + data['address'];
83 | method = 'GET';
84 | delete data['address'];
85 | break;
86 |
87 | case '.emailListUserAddressBtn':
88 | url = '/users/'+ data['user'] +'/addresses';
89 | method = 'GET';
90 | delete data['user'];
91 | break;
92 |
93 | case '.emailGetListAddressBtn':
94 | url = `/addresses?`;
95 | if(data['query'])
96 | url += `query=${data['query']}&`;
97 | if(data['tags'])
98 | url += `tags=${data['tags']}&`;
99 | if(data['requiredTags'])
100 | url += `requiredTags=${data['requiredTags']}&`;
101 | if(data['limit'])
102 | url +=`limit=${data['limit']}&`;
103 | if(data['page'])
104 | url +=`page=${data['page']}&`;
105 | if(data['next'])
106 | url +=`next=${data['next']}&`;
107 | if(data['previous'])
108 | url +=`previous=${data['previous']}&`;
109 | console.log(url)
110 | method ='GET';
111 | break;
112 |
113 | case '.emailRenameAddressDomainBtn':
114 | url = '/addresses/renameDomain';
115 | method = 'PUT';
116 | break;
117 |
118 | case '.emailRequestAddressInfoBtn':
119 | url = '/users/'+ data['user'] +'/addresses/'+ data['address'];
120 | method = 'GET';
121 | break;
122 |
123 | case '.emailRequestForwardedAddressInfoBtn':
124 | url = '/addresses/forwarded/' + data['address'];
125 | method = 'GET';
126 | break;
127 |
128 | case '.emailUpdateAddressInfoBtn':
129 | url = '/users/'+ data['user_id'] +'/addresses/'+ data['address_id'];
130 | method = 'PUT';
131 | if(data['tags_val'])
132 | data['tags'] = JSON.parse(data['tags_val']);
133 | else
134 | data['tags'] = [];
135 | if(!data['address'])
136 | delete data['address'];
137 | delete data['tags_val'];
138 | delete data['user_id'];
139 | delete data['address_id'];
140 | console.log(url)
141 | break;
142 |
143 | case '.emailUpdateForwardedAddressInfoBtn':
144 | url = '/addresses/forwarded/' + data['address_id'];
145 | method = 'PUT';
146 |
147 | if(!data['forwards'])
148 | data['forwards'] = 0;
149 | if(data['tags_val'])
150 | data['tags'] = JSON.parse(data['tags_val']);
151 | else
152 | data['tags'] = [];
153 | delete data['tags_val'];
154 |
155 | if(data['targets_val'])
156 | data['targets'] = JSON.parse(data['targets_val']);
157 | else
158 | data['targets'] = [];
159 | delete data['targets_val'];
160 |
161 | if(data['autoreply_val'])
162 | data['autoreply'] = JSON.parse(data['autoreply_val']);
163 | else
164 | data['autoreply'] = {};
165 | delete data['autoreply_val'];
166 |
167 | delete data['address_id'];
168 | console.log(data)
169 | break;
170 |
171 | }
172 |
173 | /*DKIM*/
174 | switch (type) {
175 | case '.emailDkimListBtn':
176 | url = '/dkim';
177 | method = 'GET';
178 | data = {};
179 | break;
180 | case '.emailDkimBtn':
181 | url = '/dkim';
182 | method = 'POST';
183 | break;
184 | case '.emailDkimDeleteBtn':
185 | var id_dkim = data['dkim_id'] || '';
186 | delete data['dkim_id'];
187 | url = '/dkim/'+id_dkim;
188 | method = 'DELETE';
189 | data = {}
190 | break;
191 | case '.emailDkimResolveBtn':
192 | var domain = data['domain'] || '';
193 | delete data['domain'];
194 | url = '/dkim/resolve/'+domain;
195 | method = 'GET';
196 | data = {};
197 | break;
198 | case '.emailDkimInfoBtn':
199 | var id_dkim = data['dkim_id'] || '';
200 | delete data['dkim_id'];
201 | url = '/dkim/'+id_dkim;
202 | method = 'GET';
203 | data = {};
204 | break;
205 | }
206 |
207 | /*USER*/
208 | switch (type) {
209 |
210 | case '.emailCreateUserBtn':
211 | url = '/users';
212 | method = 'POST';
213 | tags.push(data['tags']);
214 | data['tags'] = tags;
215 | break;
216 |
217 | case '.emailDeleteUserBtn':
218 | url = '/users/' + data['user'];
219 | method = 'DELETE';
220 | break;
221 |
222 | case '.emailGetListUserBtn':
223 | url = '/users';
224 | method = 'GET';
225 | break;
226 |
227 | case '.emailLogoutUserBtn':
228 | url = '/users/'+ data['user'] +'/logout';
229 | method = 'PUT';
230 | break;
231 |
232 | // openstream
233 | // end
234 | case '.emailQuotaResetAllUsersBtn':
235 | url = '/quota/reset';
236 | method = 'POST';
237 | break;
238 |
239 | case '.emailQuotaResetUserBtn':
240 | url = '/users/'+ data['user'] +'/quota/reset';
241 | method = 'POST';
242 | break;
243 |
244 | case '.emailRequestUserInfoBtn':
245 | url = '/users/'+ data['user'];
246 | method = 'GET';
247 | break;
248 |
249 | case '.emailResetPswUserBtn':
250 | url = '/users/'+ data['user'] +'/password/reset';
251 | method = 'POST';
252 | break;
253 |
254 | case '.emailResolveIdUserBtn':
255 | url = '/users/resolve/'+ data['username'];
256 | method = 'GET';
257 | break;
258 |
259 | case '.emailUpdateUserInfoBtn':
260 | url = '/users/' + data['user'];
261 | method = 'PUT';
262 | delete data['user'];
263 | break;
264 |
265 | }
266 |
267 | /* Application Passwords */
268 | switch (type) {
269 | case '.emailCreateAspBtn':
270 | url = '/users/' + data['user'] + '/asps';
271 | method = 'POST';
272 | delete data['user'];
273 | break;
274 |
275 | case '.emailDeleteAspBtn':
276 | url = '/users/'+ data['user'] +'/asps/'+ data['asp'];
277 | method = 'DELETE';
278 | break;
279 |
280 | case '.emailGetListAspsBtn':
281 | url = '/users/'+ data['user'] +'/asps';
282 | method = 'GET';
283 | break;
284 |
285 | case '.emailRequestAspInfoBtn':
286 | url = '/users/'+ data['user'] +'/asps/'+ data['asp'];
287 | method = 'GET';
288 | break;
289 |
290 | }
291 |
292 | /* Archive */
293 | switch (type) {
294 | case '.emailGetListArchivedMsgsBtn':
295 | url = `/users/${data['user']}/archived/messages`;
296 | method = 'GET';
297 | break;
298 |
299 | case '.emailRestoreArchivedMsgBtn':
300 | url = `/users/${data['user']}/archived/messages/${data['message']}/restore`;
301 | method = 'POST';
302 | delete data['user'];
303 | delete data['message'];
304 | break;
305 |
306 | case '.emailRestoreArchivedAllMsgBtn':
307 | url = `/users/${data['user']}/archived/restore`;
308 | method = 'POST';
309 | delete data['user'];
310 | break;
311 | }
312 |
313 | /* Audit */
314 |
315 | switch (type) {
316 | //not ready
317 | case '.emailCreateAuditBtn':
318 | url = '/audit';
319 | method = 'POST';
320 | break;
321 |
322 | case '.emailExportAuditBtn':
323 | url = `/audit/${data['audit']}/export.mbox`;
324 | method = 'GET';
325 | break;
326 |
327 | case '.emailRequestAuditBtn':
328 | url = `/audit/${data['audit']}`;
329 | method = 'GET';
330 | break;
331 |
332 | }
333 |
334 | /* Authenticate */
335 | switch (type) {
336 | case '.emailAuthenticateUserBtn':
337 | url = '/authenticate';
338 | method = 'POST';
339 | // data['scope'] = "master";
340 | data['token'] = "true";
341 | break;
342 |
343 | case '.emailInvalidateAuthTokenBtn':
344 | url = '/authenticate';
345 | method = 'DELETE';
346 | break;
347 |
348 | case '.emailListAuthEventBtn':
349 | url = `/users/${data['user']}/authlog`;
350 | method = 'GET';
351 | break;
352 |
353 | case '.emailRequestEventInfoBtn':
354 | url = `/users/${data['user']}/authlog/${data['event']}`;
355 | method = 'GET';
356 | break;
357 | }
358 |
359 | /* Autoreplies */
360 | switch (type) {
361 | case '.emailDeleteAutoreplyInfoBtn':
362 | url = `/users/${data['user']}/autoreply`;
363 | method = 'DELETE';
364 | break;
365 |
366 | case '.emailRequestAutoreplyInfoBtn':
367 | url = `/users/${data['user']}/autoreply`;
368 | method = 'GET';
369 | break;
370 |
371 | case '.emailUpdateAutoreplyInfoBtn':
372 | url = `/users/${data['user']}/autoreply`;
373 | method = 'PUT'
374 | delete data['user'];
375 | break;
376 | }
377 | /*DomainAlias*/
378 | switch (type) {
379 | case '.emailCreateDomainAliasBtn':
380 | url = `/domainaliases`;
381 | method = 'POST';
382 | break;
383 |
384 | case '.emailDeleteDomainAliasBtn':
385 | url = `/domainaliases/${data['alias']}`;
386 | method = 'DELETE';
387 | break;
388 |
389 | case '.emailListDomainAliasesBtn':
390 | url =`/domainaliases`;
391 | method = 'GET';
392 | break;
393 |
394 | case '.emailRequestDomainAliasBtn':
395 | url = `/domainaliases/${data['alias']}`;
396 | method = 'GET';
397 | break;
398 |
399 | case '.emailResolveDomainAliasBtn':
400 | url = `/domainaliases/resolve/${data['alias']}`;
401 | method = 'GET';
402 | break;
403 |
404 | }
405 | /*Filter*/
406 | switch (type) {
407 |
408 | case '.emailCreateFilterBtn':
409 | url = `/users/${data['user']}/filters`;
410 | method = 'POST';
411 |
412 | data['query'] = JSON.parse(data['query_value']);
413 | delete data['query_value'];
414 | data['action'] = JSON.parse(data['action_value']);
415 | delete data['action_value'];
416 | delete data['user'];
417 | break;
418 |
419 | case '.emailDeleteFilterBtn':
420 | url = `/users/${data['user']}/filters/${data['filter']}`;
421 | method = 'DELETE';
422 | break;
423 |
424 | case '.emailListFilterBtn':
425 | url = `/users/${data['user']}/filters`;
426 | method = 'GET';
427 | break;
428 |
429 | case '.emailRequestFilterBtn':
430 | url = `/users/${data['user']}/filters/${data['filter']}`;
431 | method = 'GET';
432 | break;
433 |
434 | case '.emailUpdateFilterBtn':
435 | url = `/users/${data['user']}/filters/${data['filter']}`;
436 | method = "PUT";
437 | data['query'] = JSON.parse(data['query_value']);
438 | delete data['query_value'];
439 | data['action'] = JSON.parse(data['action_value']);
440 | delete data['action_value'];
441 | delete data['user'];
442 | delete data['filter'];
443 | break;
444 | }
445 |
446 | /*Mailbox*/
447 | switch (type) {
448 | case '.emailCreateMailboxBtn':
449 | url = `/users/${data['user']}/mailboxes`;
450 | method = 'POST';
451 | delete data['user'];
452 | break;
453 |
454 | case '.emailDeleteMailboxBtn':
455 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}`;
456 | method = 'DELETE';
457 | break;
458 |
459 | case '.emailListMailboxBtn':
460 | url = `/users/${data['user']}/mailboxes`;
461 | method = 'GET';
462 | break;
463 |
464 | case '.emailRequestMailboxBtn':
465 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}`;
466 | method = 'GET';
467 | break;
468 |
469 | case '.emailUpdateMailboxBtn':
470 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}`;
471 | method = 'PUT';
472 | delete data['user'];
473 | delete data['mailbox'];
474 | break;
475 | }
476 | /* Message */
477 | switch (type) {
478 | case '.emailDeleteMessageBtn':
479 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages/${data['message']}`;
480 | method = 'DELETE';
481 | break;
482 |
483 | case '.emailDeleteAllMessageBtn':
484 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages`;
485 | method = 'DELETE';
486 | break;
487 |
488 | case '.emailForwardStoredMessageBtn':
489 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages/${data['message']}/forward`;
490 | let addresses = [];
491 | addresses.push(data['addresses']);
492 | data['addresses'] = addresses;
493 | method = 'POST';
494 | break;
495 |
496 | case '.emailGetMessageSourceBtn':
497 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages/${data['message']}/message.eml`;
498 | method = 'GET';
499 | break;
500 |
501 | case '.emailGetListMessagesMailboxBtn':
502 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages`;
503 | method = 'GET';
504 | break;
505 |
506 | case '.emailRequestMessageInfoBtn':
507 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages/${data['message']}`;
508 | method = 'GET';
509 | break;
510 |
511 | case '.emailSearchMessageBtn':
512 | url = `/users/${data['user']}/search`;
513 | method = 'GET';
514 | break;
515 |
516 | case '.emailSubmitDraftBtn':
517 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages/${data['message']}/submit`;
518 | method = 'POST';
519 | // delete data['user'];
520 | // delete data['mailbox'];
521 | // delete data['message'];
522 | break;
523 |
524 | case '.emailUpdateMessageBtn':
525 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages`;
526 | method = 'PUT';
527 | break;
528 |
529 | case '.emailUploadMessageBtn':
530 | url = `/users/${data['user']}/mailboxes/${data['mailbox']}/messages`;
531 | method = 'POST';
532 | if(data['from_val']){
533 | data['from'] = JSON.parse(data['from_val']);
534 | delete data['from_val'];
535 | }
536 | if(data['to_val']){
537 | data['to'] = JSON.parse(data['to_val']);
538 | delete data['to_val'];
539 | }
540 | delete data['user'];
541 | delete data['mailbox'];
542 | break;
543 |
544 | }
545 |
546 | /*Storage*/
547 | switch (type) {
548 | case '.emailDeleteFileBtn':
549 | url = `/users/${data['user']}/storage/${data['file']}`;
550 | method = 'DELETE';
551 | break;
552 |
553 | case '.emailDownloadFileBtn':
554 | url = `/users/${data['user']}/storage/${data['file']}`;
555 | method = 'GET';
556 | break;
557 |
558 | case '.emailGetListStoredFilesBtn':
559 | url = `/users/${data['user']}/storage`;
560 | method = 'GET';
561 | break;
562 |
563 | case '.emailUploadFileBtn':
564 | url = `/users/${data['user']}/storage`;
565 | method = 'POST';
566 | break;
567 |
568 | }
569 | /*Submission*/
570 | switch (type) {
571 | case '.emailSubmitMessageForDelivery':
572 | url = `/users/${data['user']}/submit`;
573 | method = 'POST';
574 | if(data['from_address']){
575 | data['from'] = {};
576 | data['from'].address = data['from_address'];
577 | delete data['from_address'];
578 | }
579 | if(data['to_address']){
580 | data['to'] = [];
581 | let dataTo = {};
582 | dataTo.address = data['to_address'];
583 | data['to'].push(dataTo);
584 | delete data['to_address'];
585 | }
586 | break;
587 | }
588 |
589 | switch (type) {
590 | case '.emailDisable2FABtn':
591 | url = `/users/${data['user']}/2fa`;
592 | method = 'DELETE';
593 | break;
594 |
595 | case '.emailDisableTOTPAuthBtn':
596 | url = `/users/${data['user']}/2fa/totp`;
597 | method = 'DELETE';
598 | break;
599 |
600 | case '.emailDisableCustom2FABtn':
601 | url = `/users/${data['user']}/2fa/custom`;
602 | method = 'DELETE';
603 | break;
604 |
605 | case '.emailEnableTOTPSeedBtn':
606 | url = `/users/${data['user']}/2fa/totp/enable`;
607 | method = 'POST';
608 | break;
609 |
610 | case '.emailCustom2FABtn':
611 | url = `/users/${data['user']}/2fa/custom`;
612 | method = 'PUT';
613 | delete data['user'];
614 | break;
615 |
616 | case '.emailGenerateTOTPSeedBtn':
617 | url = `/users/${data['user']}/2fa/totp/setup`;
618 | method = 'POST';
619 | break;
620 |
621 | case '.emailValidateTOTPBtn':
622 | url = `/users/${data['user']}/2fa/totp/check`;
623 | method = 'POST';
624 | break;
625 | }
626 | utils.req(this.url_wilddock+url,method,data,this.wsManager,socket,'email',data_original);
627 |
628 | }
629 | }//end Class CoCreateDomain
630 | module.exports = CoCreateEmail;
631 |
--------------------------------------------------------------------------------
/src_server/apis/utils/index.js:
--------------------------------------------------------------------------------
1 | const axios = require('axios');
2 |
3 | module.exports.req=(url,method,params,wsManager,socket,response,data_original)=>{
4 |
5 | console.log("Send Req "+method+" AXIOS "+ response);
6 | axios({
7 | method: method,
8 | url: url,
9 | data: params
10 | }).then(function (resp) {
11 | console.log("Succes REQ")
12 | send_response(wsManager,socket,{result : true,response : resp.data,'data_request':data_original},response);
13 |
14 | }).catch(function (error) {
15 | console.log("ERROR REQ")
16 | send_response(wsManager,socket,{result : false,response : error.data ,'data_request':data_original},response);
17 | });
18 | }
19 |
20 | var send_response=(wsManager,socket,obj,send_response)=>{
21 | console.log("Response TO-> "+send_response)
22 | //console.log("Object ->", obj)
23 | //socket.emit(send_response,obj)
24 | wsManager.send(socket, send_response, obj)
25 | }
26 |
27 |
28 | var send_error=(wsManager,socket,obj,send_response)=>{
29 | // console.log("error ",obj)
30 | let result = obj;
31 | // delete result.error['request'];// when error, obj too large
32 | // let result = {type:obj.type, error:obj.error};
33 | //socket.emit(send_response,result)
34 | wsManager.send(socket, send_response, obj)
35 | //res.send(obj);
36 | }
37 |
38 | module.exports.send_response = send_response;
39 | module.exports.send_error = send_error;
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require("path")
2 | const TerserPlugin = require("terser-webpack-plugin")
3 | const MiniCssExtractPlugin = require("mini-css-extract-plugin")
4 | let isProduction = process.env.NODE_ENV === "production"
5 | const { CleanWebpackPlugin } = require("clean-webpack-plugin")
6 |
7 | module.exports = {
8 | entry: {
9 | "CoCreate-email": "./src/CoCreate-email.js",
10 | },
11 | output: {
12 | path: path.resolve(__dirname, "dist"),
13 | filename: isProduction ? "[name].min.js" : "[name].js",
14 | libraryTarget: "umd",
15 | libraryExport: "default",
16 | library: ["CoCreate", "email"],
17 | globalObject: "this",
18 | // publicPath: 'https://server.cocreate.app/CoCreateJS/dist/'
19 | },
20 |
21 | plugins: [
22 | new CleanWebpackPlugin(),
23 | new MiniCssExtractPlugin({
24 | filename: "[name].css",
25 | }),
26 | ],
27 | // Default mode for Webpack is production.
28 | // Depending on mode Webpack will apply different things
29 | // on final bundle. For now we don't need production's JavaScript
30 | // minifying and other thing so let's set mode to development
31 | mode: isProduction ? "production" : "development",
32 | module: {
33 | rules: [
34 | {
35 | test: /.js$/,
36 | exclude: /(node_modules)/,
37 | use: {
38 | loader: "babel-loader",
39 | options: {
40 | plugins: ["@babel/plugin-transform-modules-commonjs"],
41 | },
42 | },
43 | },
44 | {
45 | test: /.css$/i,
46 | use: [
47 | { loader: "style-loader", options: { injectType: "linkTag" } },
48 | "file-loader",
49 | ],
50 | },
51 | ],
52 | },
53 |
54 | // add source map
55 | ...(isProduction ? {} : { devtool: "eval-source-map" }),
56 |
57 | optimization: {
58 | minimize: true,
59 | minimizer: [
60 | new TerserPlugin({
61 | extractComments: true,
62 | // cache: true,
63 | parallel: true,
64 | // sourceMap: true, // Must be set to true if using source-maps in production
65 | terserOptions: {
66 | // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
67 | // extractComments: 'all',
68 | compress: {
69 | drop_console: true,
70 | },
71 | },
72 | }),
73 | ],
74 | splitChunks: {
75 | chunks: "all",
76 | minSize: 200,
77 | // maxSize: 99999,
78 | //minChunks: 1,
79 |
80 | cacheGroups: {
81 | defaultVendors: false,
82 | },
83 | },
84 | },
85 | }
86 |
--------------------------------------------------------------------------------