Initial backup 2026-02-17
This commit is contained in:
7
skills/imap-smtp-email/.clawhub/origin.json
Normal file
7
skills/imap-smtp-email/.clawhub/origin.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 1,
|
||||
"registry": "https://clawhub.ai",
|
||||
"slug": "imap-smtp-email",
|
||||
"installedVersion": "0.0.2",
|
||||
"installedAt": 1770184147403
|
||||
}
|
||||
17
skills/imap-smtp-email/.env
Normal file
17
skills/imap-smtp-email/.env
Normal file
@@ -0,0 +1,17 @@
|
||||
# IMAP Configuration (receiving email)
|
||||
IMAP_HOST=imap.gmail.com
|
||||
IMAP_PORT=993
|
||||
IMAP_USER=Anthonymau@gmail.com
|
||||
IMAP_PASS=wfuxqjhweqjojswm
|
||||
IMAP_TLS=true
|
||||
IMAP_REJECT_UNAUTHORIZED=false
|
||||
IMAP_MAILBOX=INBOX
|
||||
|
||||
# SMTP Configuration (sending email)
|
||||
SMTP_HOST=smtp.gmail.com
|
||||
SMTP_PORT=587
|
||||
SMTP_SECURE=false
|
||||
SMTP_USER=Anthonymau@gmail.com
|
||||
SMTP_PASS=wfuxqjhweqjojswm
|
||||
SMTP_FROM=Anthonymau@gmail.com
|
||||
SMTP_REJECT_UNAUTHORIZED=true
|
||||
151
skills/imap-smtp-email/README.md
Normal file
151
skills/imap-smtp-email/README.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# IMAP/SMTP Email Skill
|
||||
|
||||
Read and send email via IMAP/SMTP protocol. Works with any IMAP/SMTP server including Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, and vip.188.com.
|
||||
|
||||
## Quick Setup
|
||||
|
||||
1. **Create `.env` file** with your credentials:
|
||||
|
||||
```bash
|
||||
# IMAP Configuration (receiving email)
|
||||
IMAP_HOST=imap.gmail.com
|
||||
IMAP_PORT=993
|
||||
IMAP_USER=your@gmail.com
|
||||
IMAP_PASS=your_app_password
|
||||
IMAP_TLS=true
|
||||
IMAP_MAILBOX=INBOX
|
||||
|
||||
# SMTP Configuration (sending email)
|
||||
SMTP_HOST=smtp.gmail.com
|
||||
SMTP_PORT=587
|
||||
SMTP_SECURE=false
|
||||
SMTP_USER=your@gmail.com
|
||||
SMTP_PASS=your_app_password
|
||||
SMTP_FROM=your@gmail.com
|
||||
```
|
||||
|
||||
2. **Install dependencies:**
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. **Test the connection:**
|
||||
```bash
|
||||
node scripts/imap.js check
|
||||
node scripts/smtp.js test
|
||||
```
|
||||
|
||||
## IMAP Commands (Receiving Email)
|
||||
|
||||
### Check for new emails
|
||||
```bash
|
||||
node scripts/imap.js check --limit 10
|
||||
node scripts/imap.js check --recent 2h # Last 2 hours
|
||||
node scripts/imap.js check --recent 30m # Last 30 minutes
|
||||
```
|
||||
|
||||
### Fetch specific email
|
||||
```bash
|
||||
node scripts/imap.js fetch <uid>
|
||||
```
|
||||
|
||||
### Search emails
|
||||
```bash
|
||||
node scripts/imap.js search --unseen
|
||||
node scripts/imap.js search --from "sender@example.com"
|
||||
node scripts/imap.js search --subject "important"
|
||||
node scripts/imap.js search --recent 24h
|
||||
```
|
||||
|
||||
### Mark as read/unread
|
||||
```bash
|
||||
node scripts/imap.js mark-read <uid>
|
||||
node scripts/imap.js mark-unread <uid>
|
||||
```
|
||||
|
||||
### List mailboxes
|
||||
```bash
|
||||
node scripts/imap.js list-mailboxes
|
||||
```
|
||||
|
||||
## SMTP Commands (Sending Email)
|
||||
|
||||
### Test SMTP connection
|
||||
```bash
|
||||
node scripts/smtp.js test
|
||||
```
|
||||
|
||||
### Send email
|
||||
```bash
|
||||
# Simple text email
|
||||
node scripts/smtp.js send --to recipient@example.com --subject "Hello" --body "World"
|
||||
|
||||
# HTML email
|
||||
node scripts/smtp.js send --to recipient@example.com --subject "Newsletter" --html --body "<h1>Welcome</h1>"
|
||||
|
||||
# Email with attachment
|
||||
node scripts/smtp.js send --to recipient@example.com --subject "Report" --body "Please find attached" --attach report.pdf
|
||||
|
||||
# Multiple recipients
|
||||
node scripts/smtp.js send --to "a@example.com,b@example.com" --cc "c@example.com" --subject "Update" --body "Team update"
|
||||
```
|
||||
|
||||
## Common Email Servers
|
||||
|
||||
| Provider | IMAP Host | IMAP Port | SMTP Host | SMTP Port |
|
||||
|----------|-----------|-----------|-----------|-----------|
|
||||
| 163.com | imap.163.com | 993 | smtp.163.com | 465 |
|
||||
| vip.163.com | imap.vip.163.com | 993 | smtp.vip.163.com | 465 |
|
||||
| 126.com | imap.126.com | 993 | smtp.126.com | 465 |
|
||||
| vip.126.com | imap.vip.126.com | 993 | smtp.vip.126.com | 465 |
|
||||
| 188.com | imap.188.com | 993 | smtp.188.com | 465 |
|
||||
| vip.188.com | imap.vip.188.com | 993 | smtp.vip.188.com | 465 |
|
||||
| yeah.net | imap.yeah.net | 993 | smtp.yeah.net | 465 |
|
||||
| Gmail | imap.gmail.com | 993 | smtp.gmail.com | 587 |
|
||||
| Outlook | outlook.office365.com | 993 | smtp.office365.com | 587 |
|
||||
| QQ Mail | imap.qq.com | 993 | smtp.qq.com | 587 |
|
||||
|
||||
**Important for 163.com:**
|
||||
- Use **authorization code** (授权码), not account password
|
||||
- Enable IMAP/SMTP in web settings first
|
||||
|
||||
## Configuration Options
|
||||
|
||||
**IMAP:**
|
||||
- `IMAP_HOST` - Server hostname
|
||||
- `IMAP_PORT` - Server port
|
||||
- `IMAP_USER` - Your email address
|
||||
- `IMAP_PASS` - Your password or app-specific password
|
||||
- `IMAP_TLS` - Use TLS (true for SSL, false for STARTTLS)
|
||||
- `IMAP_REJECT_UNAUTHORIZED` - Accept self-signed certs
|
||||
- `IMAP_MAILBOX` - Default mailbox (INBOX)
|
||||
|
||||
**SMTP:**
|
||||
- `SMTP_HOST` - Server hostname
|
||||
- `SMTP_PORT` - Server port (587 for STARTTLS, 465 for SSL)
|
||||
- `SMTP_SECURE` - true for SSL (465), false for STARTTLS (587)
|
||||
- `SMTP_USER` - Your email address
|
||||
- `SMTP_PASS` - Your password or app-specific password
|
||||
- `SMTP_FROM` - Default sender email (optional)
|
||||
- `SMTP_REJECT_UNAUTHORIZED` - Accept self-signed certs
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Connection errors:**
|
||||
- Verify IMAP/SMTP server is running and accessible
|
||||
- Check host/port settings in `.env`
|
||||
|
||||
**Authentication failed:**
|
||||
- For Gmail: Use App Password (not account password if 2FA enabled)
|
||||
- For 163.com: Use authorization code (授权码), not account password
|
||||
|
||||
**TLS/SSL errors:**
|
||||
- For self-signed certs: Set `IMAP_REJECT_UNAUTHORIZED=false` or `SMTP_REJECT_UNAUTHORIZED=false`
|
||||
|
||||
## Files
|
||||
|
||||
- `SKILL.md` - Skill documentation
|
||||
- `scripts/imap.js` - IMAP CLI tool
|
||||
- `scripts/smtp.js` - SMTP CLI tool
|
||||
- `package.json` - Node.js dependencies
|
||||
- `.env` - Your credentials (create manually)
|
||||
190
skills/imap-smtp-email/SKILL.md
Normal file
190
skills/imap-smtp-email/SKILL.md
Normal file
@@ -0,0 +1,190 @@
|
||||
---
|
||||
name: imap-smtp-email
|
||||
description: Read and send email via IMAP/SMTP. Check for new/unread messages, fetch content, search mailboxes, mark as read/unread, and send emails with attachments. Works with any IMAP/SMTP server including Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, and vip.188.com.
|
||||
---
|
||||
|
||||
# IMAP/SMTP Email Tool
|
||||
|
||||
Read, search, and manage email via IMAP protocol. Send email via SMTP. Supports Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, vip.188.com, and any standard IMAP/SMTP server.
|
||||
|
||||
## Configuration
|
||||
|
||||
Create `.env` in the skill folder or set environment variables:
|
||||
|
||||
```bash
|
||||
# IMAP Configuration (receiving email)
|
||||
IMAP_HOST=imap.gmail.com # Server hostname
|
||||
IMAP_PORT=993 # Server port
|
||||
IMAP_USER=your@email.com
|
||||
IMAP_PASS=your_password
|
||||
IMAP_TLS=true # Use TLS/SSL connection
|
||||
IMAP_REJECT_UNAUTHORIZED=true # Set to false for self-signed certs
|
||||
IMAP_MAILBOX=INBOX # Default mailbox
|
||||
|
||||
# SMTP Configuration (sending email)
|
||||
SMTP_HOST=smtp.gmail.com # SMTP server hostname
|
||||
SMTP_PORT=587 # SMTP port (587 for STARTTLS, 465 for SSL)
|
||||
SMTP_SECURE=false # true for SSL (465), false for STARTTLS (587)
|
||||
SMTP_USER=your@gmail.com # Your email address
|
||||
SMTP_PASS=your_password # Your password or app password
|
||||
SMTP_FROM=your@gmail.com # Default sender email (optional)
|
||||
SMTP_REJECT_UNAUTHORIZED=true # Set to false for self-signed certs
|
||||
```
|
||||
|
||||
## Common Email Servers
|
||||
|
||||
| Provider | IMAP Host | IMAP Port | SMTP Host | SMTP Port |
|
||||
|----------|-----------|-----------|-----------|-----------|
|
||||
| 163.com | imap.163.com | 993 | smtp.163.com | 465 |
|
||||
| vip.163.com | imap.vip.163.com | 993 | smtp.vip.163.com | 465 |
|
||||
| 126.com | imap.126.com | 993 | smtp.126.com | 465 |
|
||||
| vip.126.com | imap.vip.126.com | 993 | smtp.vip.126.com | 465 |
|
||||
| 188.com | imap.188.com | 993 | smtp.188.com | 465 |
|
||||
| vip.188.com | imap.vip.188.com | 993 | smtp.vip.188.com | 465 |
|
||||
| yeah.net | imap.yeah.net | 993 | smtp.yeah.net | 465 |
|
||||
| Gmail | imap.gmail.com | 993 | smtp.gmail.com | 587 |
|
||||
| Outlook | outlook.office365.com | 993 | smtp.office365.com | 587 |
|
||||
| QQ Mail | imap.qq.com | 993 | smtp.qq.com | 587 |
|
||||
|
||||
**Important for 163.com:**
|
||||
- Use **authorization code** (授权码), not account password
|
||||
- Enable IMAP/SMTP in web settings first
|
||||
|
||||
## IMAP Commands (Receiving Email)
|
||||
|
||||
### check
|
||||
Check for new/unread emails.
|
||||
|
||||
```bash
|
||||
node scripts/imap.js check [--limit 10] [--mailbox INBOX] [--recent 2h]
|
||||
```
|
||||
|
||||
Options:
|
||||
- `--limit <n>`: Max results (default: 10)
|
||||
- `--mailbox <name>`: Mailbox to check (default: INBOX)
|
||||
- `--recent <time>`: Only show emails from last X time (e.g., 30m, 2h, 7d)
|
||||
|
||||
### fetch
|
||||
Fetch full email content by UID.
|
||||
|
||||
```bash
|
||||
node scripts/imap.js fetch <uid> [--mailbox INBOX]
|
||||
```
|
||||
|
||||
### download
|
||||
Download all attachments from an email, or a specific attachment.
|
||||
|
||||
```bash
|
||||
node scripts/imap.js download <uid> [--mailbox INBOX] [--dir <path>] [--file <filename>]
|
||||
```
|
||||
|
||||
Options:
|
||||
- `--mailbox <name>`: Mailbox (default: INBOX)
|
||||
- `--dir <path>`: Output directory (default: current directory)
|
||||
- `--file <filename>`: Download only the specified attachment (default: download all)
|
||||
|
||||
### search
|
||||
Search emails with filters.
|
||||
|
||||
```bash
|
||||
node scripts/imap.js search [options]
|
||||
|
||||
Options:
|
||||
--unseen Only unread messages
|
||||
--seen Only read messages
|
||||
--from <email> From address contains
|
||||
--subject <text> Subject contains
|
||||
--recent <time> From last X time (e.g., 30m, 2h, 7d)
|
||||
--since <date> After date (YYYY-MM-DD)
|
||||
--before <date> Before date (YYYY-MM-DD)
|
||||
--limit <n> Max results (default: 20)
|
||||
--mailbox <name> Mailbox to search (default: INBOX)
|
||||
```
|
||||
|
||||
### mark-read / mark-unread
|
||||
Mark message(s) as read or unread.
|
||||
|
||||
```bash
|
||||
node scripts/imap.js mark-read <uid> [uid2 uid3...]
|
||||
node scripts/imap.js mark-unread <uid> [uid2 uid3...]
|
||||
```
|
||||
|
||||
### list-mailboxes
|
||||
List all available mailboxes/folders.
|
||||
|
||||
```bash
|
||||
node scripts/imap.js list-mailboxes
|
||||
```
|
||||
|
||||
## SMTP Commands (Sending Email)
|
||||
|
||||
### send
|
||||
Send email via SMTP.
|
||||
|
||||
```bash
|
||||
node scripts/smtp.js send --to <email> --subject <text> [options]
|
||||
```
|
||||
|
||||
**Required:**
|
||||
- `--to <email>`: Recipient (comma-separated for multiple)
|
||||
- `--subject <text>`: Email subject, or `--subject-file <file>`
|
||||
|
||||
**Optional:**
|
||||
- `--body <text>`: Plain text body
|
||||
- `--html`: Send body as HTML
|
||||
- `--body-file <file>`: Read body from file
|
||||
- `--html-file <file>`: Read HTML from file
|
||||
- `--cc <email>`: CC recipients
|
||||
- `--bcc <email>`: BCC recipients
|
||||
- `--attach <file>`: Attachments (comma-separated)
|
||||
- `--from <email>`: Override default sender
|
||||
|
||||
**Examples:**
|
||||
```bash
|
||||
# Simple text email
|
||||
node scripts/smtp.js send --to recipient@example.com --subject "Hello" --body "World"
|
||||
|
||||
# HTML email
|
||||
node scripts/smtp.js send --to recipient@example.com --subject "Newsletter" --html --body "<h1>Welcome</h1>"
|
||||
|
||||
# Email with attachment
|
||||
node scripts/smtp.js send --to recipient@example.com --subject "Report" --body "Please find attached" --attach report.pdf
|
||||
|
||||
# Multiple recipients
|
||||
node scripts/smtp.js send --to "a@example.com,b@example.com" --cc "c@example.com" --subject "Update" --body "Team update"
|
||||
```
|
||||
|
||||
### test
|
||||
Test SMTP connection by sending a test email to yourself.
|
||||
|
||||
```bash
|
||||
node scripts/smtp.js test
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
## Security Notes
|
||||
|
||||
- Store credentials in `.env` (add to `.gitignore`)
|
||||
- For Gmail: use App Password if 2FA is enabled
|
||||
- For 163.com: use authorization code (授权码), not account password
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Connection timeout:**
|
||||
- Verify server is running and accessible
|
||||
- Check host/port configuration
|
||||
|
||||
**Authentication failed:**
|
||||
- Verify username (usually full email address)
|
||||
- Check password is correct
|
||||
- For 163.com: use authorization code, not account password
|
||||
- For Gmail: use App Password if 2FA enabled
|
||||
|
||||
**TLS/SSL errors:**
|
||||
- Match `IMAP_TLS`/`SMTP_SECURE` setting to server requirements
|
||||
- For self-signed certs: set `IMAP_REJECT_UNAUTHORIZED=false` or `SMTP_REJECT_UNAUTHORIZED=false`
|
||||
1
skills/imap-smtp-email/node_modules/.bin/he
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/.bin/he
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
../he/bin/he
|
||||
1
skills/imap-smtp-email/node_modules/.bin/quoted-printable
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/.bin/quoted-printable
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
../quoted-printable/bin/quoted-printable
|
||||
1
skills/imap-smtp-email/node_modules/.bin/semver
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/.bin/semver
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
../semver/bin/semver
|
||||
1
skills/imap-smtp-email/node_modules/.bin/tlds
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/.bin/tlds
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
../tlds/bin.js
|
||||
476
skills/imap-smtp-email/node_modules/.package-lock.json
generated
vendored
Normal file
476
skills/imap-smtp-email/node_modules/.package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,476 @@
|
||||
{
|
||||
"name": "imap-smtp-email-skill",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@selderee/plugin-htmlparser2": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.11.0.tgz",
|
||||
"integrity": "sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"domhandler": "^5.0.3",
|
||||
"selderee": "^0.11.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://ko-fi.com/killymxi"
|
||||
}
|
||||
},
|
||||
"node_modules/@zone-eu/mailsplit": {
|
||||
"version": "5.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@zone-eu/mailsplit/-/mailsplit-5.4.8.tgz",
|
||||
"integrity": "sha512-eEyACj4JZ7sjzRvy26QhLgKEMWwQbsw1+QZnlLX+/gihcNH07lVPOcnwf5U6UAL7gkc//J3jVd76o/WS+taUiA==",
|
||||
"license": "(MIT OR EUPL-1.1+)",
|
||||
"dependencies": {
|
||||
"libbase64": "1.3.0",
|
||||
"libmime": "5.3.7",
|
||||
"libqp": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/core-util-is": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/deepmerge": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dom-serializer": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
|
||||
"integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.2",
|
||||
"entities": "^4.2.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/domelementtype": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
|
||||
"integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/fb55"
|
||||
}
|
||||
],
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/domhandler": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
|
||||
"integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domhandler?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/domutils": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",
|
||||
"integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"dom-serializer": "^2.0.0",
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.3"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "16.6.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",
|
||||
"integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/encoding-japanese": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/encoding-japanese/-/encoding-japanese-2.2.0.tgz",
|
||||
"integrity": "sha512-EuJWwlHPZ1LbADuKTClvHtwbaFn4rOD+dRAbWysqEOXRc2Uui0hJInNJrsdH0c+OhJA4nrCBdSkW4DD5YxAo6A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"he": "bin/he"
|
||||
}
|
||||
},
|
||||
"node_modules/html-to-text": {
|
||||
"version": "9.0.5",
|
||||
"resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-9.0.5.tgz",
|
||||
"integrity": "sha512-qY60FjREgVZL03vJU6IfMV4GDjGBIoOyvuFdpBDIX9yTlDw0TjxVBQp+P8NvpdIXNJvfWBTNul7fsAQJq2FNpg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@selderee/plugin-htmlparser2": "^0.11.0",
|
||||
"deepmerge": "^4.3.1",
|
||||
"dom-serializer": "^2.0.0",
|
||||
"htmlparser2": "^8.0.2",
|
||||
"selderee": "^0.11.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/htmlparser2": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz",
|
||||
"integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==",
|
||||
"funding": [
|
||||
"https://github.com/fb55/htmlparser2?sponsor=1",
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/fb55"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.3",
|
||||
"domutils": "^3.0.1",
|
||||
"entities": "^4.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/imap": {
|
||||
"version": "0.8.19",
|
||||
"resolved": "https://registry.npmjs.org/imap/-/imap-0.8.19.tgz",
|
||||
"integrity": "sha512-z5DxEA1uRnZG73UcPA4ES5NSCGnPuuouUx43OPX7KZx1yzq3N8/vx2mtXEShT5inxB3pRgnfG1hijfu7XN2YMw==",
|
||||
"dependencies": {
|
||||
"readable-stream": "1.1.x",
|
||||
"utf7": ">=1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/imap-simple": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/imap-simple/-/imap-simple-5.1.0.tgz",
|
||||
"integrity": "sha512-FLZm1v38C5ekN46l/9X5gBRNMQNVc5TSLYQ3Hsq3xBLvKwt1i5fcuShyth8MYMPuvId1R46oaPNrH92hFGHr/g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"iconv-lite": "~0.4.13",
|
||||
"imap": "^0.8.18",
|
||||
"nodeify": "^1.0.0",
|
||||
"quoted-printable": "^1.0.0",
|
||||
"utf8": "^2.1.1",
|
||||
"uuencode": "0.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz",
|
||||
"integrity": "sha512-mjWH5XxnhMA8cFnDchr6qRP9S/kLntKuEfIYku+PaN1CnS8v+OG9O/BKpRCVRJvpIkgAZm0Pf5Is3iSSOILlcg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/leac": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/leac/-/leac-0.6.0.tgz",
|
||||
"integrity": "sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://ko-fi.com/killymxi"
|
||||
}
|
||||
},
|
||||
"node_modules/libbase64": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/libbase64/-/libbase64-1.3.0.tgz",
|
||||
"integrity": "sha512-GgOXd0Eo6phYgh0DJtjQ2tO8dc0IVINtZJeARPeiIJqge+HdsWSuaDTe8ztQ7j/cONByDZ3zeB325AHiv5O0dg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/libmime": {
|
||||
"version": "5.3.7",
|
||||
"resolved": "https://registry.npmjs.org/libmime/-/libmime-5.3.7.tgz",
|
||||
"integrity": "sha512-FlDb3Wtha8P01kTL3P9M+ZDNDWPKPmKHWaU/cG/lg5pfuAwdflVpZE+wm9m7pKmC5ww6s+zTxBKS1p6yl3KpSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encoding-japanese": "2.2.0",
|
||||
"iconv-lite": "0.6.3",
|
||||
"libbase64": "1.3.0",
|
||||
"libqp": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/libmime/node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/libqp": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/libqp/-/libqp-2.1.1.tgz",
|
||||
"integrity": "sha512-0Wd+GPz1O134cP62YU2GTOPNA7Qgl09XwCqM5zpBv87ERCXdfDtyKXvV7c9U22yWJh44QZqBocFnXN11K96qow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/linkify-it": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
|
||||
"integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"uc.micro": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mailparser": {
|
||||
"version": "3.9.3",
|
||||
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.9.3.tgz",
|
||||
"integrity": "sha512-AnB0a3zROum6fLaa52L+/K2SoRJVyFDk78Ea6q1D0ofcZLxWEWDtsS1+OrVqKbV7r5dulKL/AwYQccFGAPpuYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@zone-eu/mailsplit": "5.4.8",
|
||||
"encoding-japanese": "2.2.0",
|
||||
"he": "1.2.0",
|
||||
"html-to-text": "9.0.5",
|
||||
"iconv-lite": "0.7.2",
|
||||
"libmime": "5.3.7",
|
||||
"linkify-it": "5.0.0",
|
||||
"nodemailer": "7.0.13",
|
||||
"punycode.js": "2.3.1",
|
||||
"tlds": "1.261.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mailparser/node_modules/iconv-lite": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
|
||||
"integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/nodeify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/nodeify/-/nodeify-1.0.1.tgz",
|
||||
"integrity": "sha512-n7C2NyEze8GCo/z73KdbjRsBiLbv6eBn1FxwYKQ23IqGo7pQY3mhQan61Sv7eEDJCiyUjTVrVkXTzJCo1dW7Aw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-promise": "~1.0.0",
|
||||
"promise": "~1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nodemailer": {
|
||||
"version": "7.0.13",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.13.tgz",
|
||||
"integrity": "sha512-PNDFSJdP+KFgdsG3ZzMXCgquO7I6McjY2vlqILjtJd0hy8wEvtugS9xKRF2NWlPNGxvLCXlTNIae4serI7dinw==",
|
||||
"license": "MIT-0",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/parseley": {
|
||||
"version": "0.12.1",
|
||||
"resolved": "https://registry.npmjs.org/parseley/-/parseley-0.12.1.tgz",
|
||||
"integrity": "sha512-e6qHKe3a9HWr0oMRVDTRhKce+bRO8VGQR3NyVwcjwrbhMmFCX9KszEV35+rn4AdilFAq9VPxP/Fe1wC9Qjd2lw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"leac": "^0.6.0",
|
||||
"peberminta": "^0.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://ko-fi.com/killymxi"
|
||||
}
|
||||
},
|
||||
"node_modules/peberminta": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/peberminta/-/peberminta-0.9.0.tgz",
|
||||
"integrity": "sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://ko-fi.com/killymxi"
|
||||
}
|
||||
},
|
||||
"node_modules/promise": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/promise/-/promise-1.3.0.tgz",
|
||||
"integrity": "sha512-R9WrbTF3EPkVtWjp7B7umQGVndpsi+rsDAfrR4xAALQpFLa/+2OriecLhawxzvii2gd9+DZFwROWDuUUaqS5yA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-promise": "~1"
|
||||
}
|
||||
},
|
||||
"node_modules/punycode.js": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
|
||||
"integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/quoted-printable": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/quoted-printable/-/quoted-printable-1.0.1.tgz",
|
||||
"integrity": "sha512-cihC68OcGiQOjGiXuo5Jk6XHANTHl1K4JLk/xlEJRTIXfy19Sg6XzB95XonYgr+1rB88bCpr7WZE7D7AlZow4g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"utf8": "^2.1.0"
|
||||
},
|
||||
"bin": {
|
||||
"quoted-printable": "bin/quoted-printable"
|
||||
}
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "1.1.14",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
||||
"integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.1",
|
||||
"isarray": "0.0.1",
|
||||
"string_decoder": "~0.10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/selderee": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/selderee/-/selderee-0.11.0.tgz",
|
||||
"integrity": "sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"parseley": "^0.12.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://ko-fi.com/killymxi"
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
|
||||
"integrity": "sha512-mfmm3/H9+67MCVix1h+IXTpDwL6710LyHuk7+cWC9T1mE0qz4iHhh6r4hU2wrIT9iTsAAC2XQRvfblL028cpLw==",
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
},
|
||||
"node_modules/string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
||||
"integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tlds": {
|
||||
"version": "1.261.0",
|
||||
"resolved": "https://registry.npmjs.org/tlds/-/tlds-1.261.0.tgz",
|
||||
"integrity": "sha512-QXqwfEl9ddlGBaRFXIvNKK6OhipSiLXuRuLJX5DErz0o0Q0rYxulWLdFryTkV5PkdZct5iMInwYEGe/eR++1AA==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"tlds": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/uc.micro": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
|
||||
"integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/utf7": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/utf7/-/utf7-1.0.2.tgz",
|
||||
"integrity": "sha512-qQrPtYLLLl12NF4DrM9CvfkxkYI97xOb5dsnGZHE3teFr0tWiEZ9UdgMPczv24vl708cYMpe6mGXGHrotIp3Bw==",
|
||||
"dependencies": {
|
||||
"semver": "~5.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/utf8": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz",
|
||||
"integrity": "sha512-QXo+O/QkLP/x1nyi54uQiG0XrODxdysuQvE5dtVqv7F5K2Qb6FsN+qbr6KhF5wQ20tfcV3VQp0/2x1e1MRSPWg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/uuencode": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/uuencode/-/uuencode-0.0.4.tgz",
|
||||
"integrity": "sha512-yEEhCuCi5wRV7Z5ZVf9iV2gWMvUZqKJhAs1ecFdKJ0qzbyaVelmsE3QjYAamehfp9FKLiZbKldd+jklG3O0LfA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
33
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/CHANGELOG.md
generated
vendored
Normal file
33
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# Changelog
|
||||
|
||||
## Version 0.11.0
|
||||
|
||||
* (`selderee`) Escape sequences in selectors.
|
||||
|
||||
## Version 0.10.0
|
||||
|
||||
* Targeting Node.js version 14 and ES2020;
|
||||
* Bump dependencies.
|
||||
|
||||
## Version 0.9.0
|
||||
|
||||
* Bump dependencies - fix "./core module cannot be found" issue.
|
||||
|
||||
## Version 0.8.1
|
||||
|
||||
* Sync with `selderee` package version. Now all dependencies are TypeScript, dual CommonJS/ES module packages;
|
||||
* Use `rollup-plugin-cleanup` to condition published files.
|
||||
|
||||
## Version 0.7.0
|
||||
|
||||
* Drop Node.js version 10 support. At least 12.22.x is required.
|
||||
|
||||
## Version 0.6.0
|
||||
|
||||
* `selderee` 0.6.0 - [changelog](https://github.com/mxxii/selderee/blob/main/packages/selderee/CHANGELOG.md).
|
||||
|
||||
## Version 0.5.0
|
||||
|
||||
Initial release.
|
||||
|
||||
Aiming at Node.js version 10 and up.
|
||||
21
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/LICENSE
generated
vendored
Normal file
21
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021-2022 KillyMXI <killy@mxii.eu.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
15
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/README.md
generated
vendored
Normal file
15
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/README.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# selderee
|
||||
|
||||

|
||||

|
||||
[](https://github.com/mxxii/selderee/blob/main/LICENSE)
|
||||
|
||||
[selderee](https://github.com/mxxii/selderee) plugin - selectors decision tree builder for [htmlparser2](https://github.com/fb55/htmlparser2) DOM AST.
|
||||
|
||||
(Technically, the package depends not on `htmlparser2` but on [domhandler](https://github.com/fb55/domhandler), underlying package of `htmlparser2`.)
|
||||
|
||||
----
|
||||
|
||||
[Changelog](https://github.com/mxxii/selderee/blob/main/packages/plugin-htmlparser2/CHANGELOG.md).
|
||||
|
||||
See [main README file](https://github.com/mxxii/selderee/blob/main/README.md) for more info.
|
||||
94
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs
generated
vendored
Normal file
94
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var domhandler = require('domhandler');
|
||||
var selderee = require('selderee');
|
||||
|
||||
function hp2Builder(nodes) {
|
||||
return new selderee.Picker(handleArray(nodes));
|
||||
}
|
||||
function handleArray(nodes) {
|
||||
const matchers = nodes.map(handleNode);
|
||||
return (el, ...tail) => matchers.flatMap(m => m(el, ...tail));
|
||||
}
|
||||
function handleNode(node) {
|
||||
switch (node.type) {
|
||||
case 'terminal': {
|
||||
const result = [node.valueContainer];
|
||||
return (el, ...tail) => result;
|
||||
}
|
||||
case 'tagName':
|
||||
return handleTagName(node);
|
||||
case 'attrValue':
|
||||
return handleAttrValueName(node);
|
||||
case 'attrPresence':
|
||||
return handleAttrPresenceName(node);
|
||||
case 'pushElement':
|
||||
return handlePushElementNode(node);
|
||||
case 'popElement':
|
||||
return handlePopElementNode(node);
|
||||
}
|
||||
}
|
||||
function handleTagName(node) {
|
||||
const variants = {};
|
||||
for (const variant of node.variants) {
|
||||
variants[variant.value] = handleArray(variant.cont);
|
||||
}
|
||||
return (el, ...tail) => {
|
||||
const continuation = variants[el.name];
|
||||
return (continuation) ? continuation(el, ...tail) : [];
|
||||
};
|
||||
}
|
||||
function handleAttrPresenceName(node) {
|
||||
const attrName = node.name;
|
||||
const continuation = handleArray(node.cont);
|
||||
return (el, ...tail) => (Object.prototype.hasOwnProperty.call(el.attribs, attrName))
|
||||
? continuation(el, ...tail)
|
||||
: [];
|
||||
}
|
||||
function handleAttrValueName(node) {
|
||||
const callbacks = [];
|
||||
for (const matcher of node.matchers) {
|
||||
const predicate = matcher.predicate;
|
||||
const continuation = handleArray(matcher.cont);
|
||||
callbacks.push((attr, el, ...tail) => (predicate(attr) ? continuation(el, ...tail) : []));
|
||||
}
|
||||
const attrName = node.name;
|
||||
return (el, ...tail) => {
|
||||
const attr = el.attribs[attrName];
|
||||
return (attr || attr === '')
|
||||
? callbacks.flatMap(cb => cb(attr, el, ...tail))
|
||||
: [];
|
||||
};
|
||||
}
|
||||
function handlePushElementNode(node) {
|
||||
const continuation = handleArray(node.cont);
|
||||
const leftElementGetter = (node.combinator === '+')
|
||||
? getPrecedingElement
|
||||
: getParentElement;
|
||||
return (el, ...tail) => {
|
||||
const next = leftElementGetter(el);
|
||||
if (next === null) {
|
||||
return [];
|
||||
}
|
||||
return continuation(next, el, ...tail);
|
||||
};
|
||||
}
|
||||
const getPrecedingElement = (el) => {
|
||||
const prev = el.prev;
|
||||
if (prev === null) {
|
||||
return null;
|
||||
}
|
||||
return (domhandler.isTag(prev)) ? prev : getPrecedingElement(prev);
|
||||
};
|
||||
const getParentElement = (el) => {
|
||||
const parent = el.parent;
|
||||
return (parent && domhandler.isTag(parent)) ? parent : null;
|
||||
};
|
||||
function handlePopElementNode(node) {
|
||||
const continuation = handleArray(node.cont);
|
||||
return (el, next, ...tail) => continuation(next, ...tail);
|
||||
}
|
||||
|
||||
exports.hp2Builder = hp2Builder;
|
||||
16
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.d.ts
generated
vendored
Normal file
16
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Element } from 'domhandler';
|
||||
import { Picker, Ast } from 'selderee';
|
||||
/**
|
||||
* A {@link BuilderFunction} implementation.
|
||||
*
|
||||
* Creates a function (in a {@link Picker} wrapper) that can run
|
||||
* the decision tree against `htmlparser2` `Element` nodes.
|
||||
*
|
||||
* @typeParam V - the type of values associated with selectors.
|
||||
*
|
||||
* @param nodes - nodes ({@link DecisionTreeNode})
|
||||
* from the root level of the decision tree.
|
||||
*
|
||||
* @returns a {@link Picker} object.
|
||||
*/
|
||||
export declare function hp2Builder<V>(nodes: Ast.DecisionTreeNode<V>[]): Picker<Element, V>;
|
||||
90
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.mjs
generated
vendored
Normal file
90
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.mjs
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
import { isTag } from 'domhandler';
|
||||
import { Picker } from 'selderee';
|
||||
|
||||
function hp2Builder(nodes) {
|
||||
return new Picker(handleArray(nodes));
|
||||
}
|
||||
function handleArray(nodes) {
|
||||
const matchers = nodes.map(handleNode);
|
||||
return (el, ...tail) => matchers.flatMap(m => m(el, ...tail));
|
||||
}
|
||||
function handleNode(node) {
|
||||
switch (node.type) {
|
||||
case 'terminal': {
|
||||
const result = [node.valueContainer];
|
||||
return (el, ...tail) => result;
|
||||
}
|
||||
case 'tagName':
|
||||
return handleTagName(node);
|
||||
case 'attrValue':
|
||||
return handleAttrValueName(node);
|
||||
case 'attrPresence':
|
||||
return handleAttrPresenceName(node);
|
||||
case 'pushElement':
|
||||
return handlePushElementNode(node);
|
||||
case 'popElement':
|
||||
return handlePopElementNode(node);
|
||||
}
|
||||
}
|
||||
function handleTagName(node) {
|
||||
const variants = {};
|
||||
for (const variant of node.variants) {
|
||||
variants[variant.value] = handleArray(variant.cont);
|
||||
}
|
||||
return (el, ...tail) => {
|
||||
const continuation = variants[el.name];
|
||||
return (continuation) ? continuation(el, ...tail) : [];
|
||||
};
|
||||
}
|
||||
function handleAttrPresenceName(node) {
|
||||
const attrName = node.name;
|
||||
const continuation = handleArray(node.cont);
|
||||
return (el, ...tail) => (Object.prototype.hasOwnProperty.call(el.attribs, attrName))
|
||||
? continuation(el, ...tail)
|
||||
: [];
|
||||
}
|
||||
function handleAttrValueName(node) {
|
||||
const callbacks = [];
|
||||
for (const matcher of node.matchers) {
|
||||
const predicate = matcher.predicate;
|
||||
const continuation = handleArray(matcher.cont);
|
||||
callbacks.push((attr, el, ...tail) => (predicate(attr) ? continuation(el, ...tail) : []));
|
||||
}
|
||||
const attrName = node.name;
|
||||
return (el, ...tail) => {
|
||||
const attr = el.attribs[attrName];
|
||||
return (attr || attr === '')
|
||||
? callbacks.flatMap(cb => cb(attr, el, ...tail))
|
||||
: [];
|
||||
};
|
||||
}
|
||||
function handlePushElementNode(node) {
|
||||
const continuation = handleArray(node.cont);
|
||||
const leftElementGetter = (node.combinator === '+')
|
||||
? getPrecedingElement
|
||||
: getParentElement;
|
||||
return (el, ...tail) => {
|
||||
const next = leftElementGetter(el);
|
||||
if (next === null) {
|
||||
return [];
|
||||
}
|
||||
return continuation(next, el, ...tail);
|
||||
};
|
||||
}
|
||||
const getPrecedingElement = (el) => {
|
||||
const prev = el.prev;
|
||||
if (prev === null) {
|
||||
return null;
|
||||
}
|
||||
return (isTag(prev)) ? prev : getPrecedingElement(prev);
|
||||
};
|
||||
const getParentElement = (el) => {
|
||||
const parent = el.parent;
|
||||
return (parent && isTag(parent)) ? parent : null;
|
||||
};
|
||||
function handlePopElementNode(node) {
|
||||
const continuation = handleArray(node.cont);
|
||||
return (el, next, ...tail) => continuation(next, ...tail);
|
||||
}
|
||||
|
||||
export { hp2Builder };
|
||||
47
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/package.json
generated
vendored
Normal file
47
skills/imap-smtp-email/node_modules/@selderee/plugin-htmlparser2/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "@selderee/plugin-htmlparser2",
|
||||
"version": "0.11.0",
|
||||
"description": "selderee plugin - selectors decision tree builder for htmlparser2 DOM.",
|
||||
"keywords": [
|
||||
"htmlparser2",
|
||||
"selderee",
|
||||
"plugin",
|
||||
"selderee plugin"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mxxii/selderee.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/mxxii/selderee/issues"
|
||||
},
|
||||
"homepage": "https://github.com/mxxii/selderee",
|
||||
"author": "KillyMXI",
|
||||
"funding": "https://ko-fi.com/killymxi",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
"import": "./lib/hp2-builder.mjs",
|
||||
"require": "./lib/hp2-builder.cjs"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "./lib/hp2-builder.cjs",
|
||||
"module": "./lib/hp2-builder.mjs",
|
||||
"types": "./lib/hp2-builder.d.ts",
|
||||
"typedocMain": "./src/hp2-builder.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"build:rollup": "rollup -c",
|
||||
"build:types": "tsc -d --emitDeclarationOnly --declarationDir ./lib",
|
||||
"build": "npm run clean && npm run build:rollup && npm run build:types",
|
||||
"clean": "rimraf lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"domhandler": "^5.0.3",
|
||||
"selderee": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"htmlparser2": "^8.0.1"
|
||||
}
|
||||
}
|
||||
153
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/LICENSE.EUPL-1.2
generated
vendored
Normal file
153
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/LICENSE.EUPL-1.2
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
EUROOPA LIIDU TARKVARA VABA KASUTUSE LITSENTS v. 1.2
|
||||
EUPL © Euroopa Liit 2007, 2016
|
||||
|
||||
Euroopa Liidu tarkvara vaba kasutuse litsents („EUPL“) kehtib allpool määratletud teose suhtes, mida levitatakse vastavalt käesoleva litsentsi tingimustele. Teost on keelatud kasutada muul viisil kui vastavalt käesoleva litsentsi tingimustele niivõrd, kuivõrd sellise kasutamise suhtes kehtivad teose autoriõiguse omaja õigused).
|
||||
|
||||
Teost levitatakse vastavalt käesoleva litsentsi tingimustele, kui allpool määratletud litsentsiandja paneb vahetult teose autoriõiguse märke järele järgmise märke:
|
||||
|
||||
Litsentsitud EUPL alusel
|
||||
|
||||
või on muul viisil väljendanud soovi litsentsida originaalteos EUPL alusel.
|
||||
|
||||
1. Mõisted
|
||||
Käesolevas litsentsis kasutatakse järgmisi mõisteid:
|
||||
|
||||
— „litsents“ – käesolev litsents;
|
||||
|
||||
— „originaalteos“ – teos või tarkvara, mida litsentsiandja käesoleva litsentsi alusel levitab või edastab ning mis on kättesaadav lähtekoodina ja teatavatel juhtudel ka täitmiskoodina;
|
||||
|
||||
— „tuletatud teos“ – teos või tarkvara, mida litsentsisaajal on olnud võimalik luua tuginedes originaalteosele või selle muudetud versioonile. Käesolevas litsentsis ei määratleta muudatuse ulatust või sõltuvust originaalteosest, mis on vajalik selleks, et klassifitseerida teos tuletatud teoseks; selline ulatus määratakse kindlaks vastavalt artiklis 15 nimetatud riigis kehtivatele autoriõigust käsitlevatele õigusaktidele;
|
||||
|
||||
— „teos“ – originaalteos või sellest tuletatud teosed;
|
||||
|
||||
— „lähtekood“ – teose inimloetav vorm, mida inimestel on kõige lihtsam uurida ja muuta;
|
||||
|
||||
— „täitmiskood“ – igasugune kood, mille on tavaliselt koostanud arvuti ja mis on mõeldud arvuti poolt programmina tõlgendamiseks;
|
||||
|
||||
— „litsentsiandja“ – füüsiline või juriidiline isik, kes levitab või edastab teost litsentsi alusel;
|
||||
|
||||
— „edasiarendaja“ – füüsiline või juriidiline isik, kes muudab teost litsentsi alusel või osaleb muul moel tuletatud teose loomises;
|
||||
|
||||
— „litsentsisaaja“ või „Teie“ – iga füüsiline või juriidiline isik, kes kasutab teost ükskõik mis moel vastavalt litsentsi tingimustele;
|
||||
|
||||
— „levitamine“ või „edastamine“ – teose koopiate müümine, teisele isikule andmine, laenutamine, rentimine, levitamine, edastamine, ülekandmine või teose koopiate või selle oluliste funktsioonide muul viisil teistele füüsilistele või juriidilistele isikutele kättesaadavaks tegemine võrgus või võrguväliselt.
|
||||
|
||||
2. Litsentsiga antavate õiguste ulatus
|
||||
Käesolevaga annab litsentsiandja Teile ülemaailmse, tasuta, all-litsentsi andmise õigusega lihtlitsentsi, mille alusel võite teha originaalteose autoriõiguse kehtivusaja jooksul järgmist:
|
||||
|
||||
— kasutada teost mis tahes eesmärgil ja mis tahes viisil,
|
||||
|
||||
— teost reprodutseerida,
|
||||
|
||||
— teost muuta ja luua teosel põhinevaid tuletatud teoseid,
|
||||
|
||||
— teost või selle koopiaid üldsusele edastada, sealhulgas neid kättesaadavaks teha või eksponeerida, samuti avalikult esitada,
|
||||
|
||||
— teost või selle koopiaid levitada,
|
||||
|
||||
— teost või selle koopiaid laenutada ja rentida,
|
||||
|
||||
— anda all-litsentse teose või selle koopiate suhtes kehtivate õiguste kohta.
|
||||
|
||||
Neid õigusi võib teostada mistahes praegu tuntud või hiljem leiutatud keskkonnas, toel või formaadis, ja sellises ulatuses, nagu lubab kohaldatav õigus.
|
||||
|
||||
Riikides, kus kehtivad isiklikud õigused, loobub litsentsiandja seadusega lubatud ulatuses oma õigusest teostada isiklikke õigusi, et oleks võimalik eespool loetletud varalisi õigusi litsentsida.
|
||||
|
||||
Litsentsiandja annab litsentsisaajale tasuta lihtlitsentsi kõigi litsentsiandjale kuuluvate patentide kasutamiseks ulatuses, mis on vajalik teose suhtes käesoleva litsentsiga antud õiguste kasutamiseks.
|
||||
|
||||
3. Lähtekoodi edastamine
|
||||
Litsentsiandja võib teose kättesaadavaks teha kas lähtekoodi või täitmiskoodi kujul. Kui teos tehakse kättesaadavaks täitmiskoodi kujul, lisab litsentsiandja igale tema poolt levitatavale teose koopiale lähtekoodi masinloetava koopia või näitab teose autoriõiguse märke järele lisatud märkega ära hoidla, kust lähtekood on kergesti ja tasuta kättesaadav seni, kuni litsentsiandja jätkab teose levitamist või edastamist.
|
||||
|
||||
4. Autoriõiguse piiramine
|
||||
Käesolev litsents ei võta litsentsisaajalt võimalusi, mis tulenevad teose õiguste omaja ainuõiguste suhtes kehtestatud eranditest või ainuõiguste piiramisest, nende õiguste ammendumisest või muudest nende õiguste suhtes kohaldatavatest piirangutest.
|
||||
|
||||
5. Litsentsisaaja kohustused
|
||||
Eespool nimetatud õigused antakse litsentsisaajale tingimusel, et ta peab kinni teatavatest piirangutest ja täidab teatavaid talle pandud kohustusi. Need kohustused on järgmised:
|
||||
|
||||
Õigus autorsusele. Litsentsisaaja hoiab puutumatuna kõik autoriõiguse, patentide ja kaubamärkide kohta käivad märked ja kõik märked, mis viitavad litsentsile ja garantii puudumisele. Litsentsisaaja peab teose iga tema poolt levitatavale või edastatavale koopiale lisama nimetatud märgete koopiad ja litsentsi koopia. Litsentsisaaja peab tagama, et iga tuletatud teos kannab selget märget selle kohta, et teost on muudetud ja muutmise kuupäeva.
|
||||
Klausel vaba kasutamise tagamise kohta (copyleft). Kui litsentsisaaja levitab või edastab originaalteose või tuletatud teoste koopiaid, toimub see levitamine või edastamine vastavalt käesoleva litsentsi tingimustele või käesoleva litsentsi hilisema versiooni tingimustele, välja arvatud juhul, kui originaalteost levitatakse ainult vastavalt litsentsi käesolevale versioonile (näiteks märkides „ainult EUPL v.1.2“). Litsentsisaaja ei tohi (litsentsiandjaks saades) teosele või tuletatud teosele lisada ega kehtestada mingeid lisatingimusi, mis muudavad või piiravad litsentsi tingimusi.
|
||||
Ühilduvuse klausel. Kui litsentsisaaja levitab või edastab tuletatud teoseid või nende koopiaid, mis põhinevad nii teosel kui ka teisel, käesoleva litsentsiga ühilduva litsentsi alusel litsentsitud teosel, võib see levitamine või edastamine toimuda vastavalt nimetatud ühilduva litsentsi tingimustele. Käesolevas klauslis tähendab „ühilduv litsents“ käesoleva litsentsi lisas loetletud litsentse. Kui litsentsisaaja ühilduvale litsentsile vastavad kohustused on vastuolus tema kohustustega vastavalt käesolevale litsentsile, loetakse kehtivaks ühilduva litsentsi kohased kohustused.
|
||||
Lähtekoodi lisamine. Teose koopiate levitamisel või edastamisel lisab litsentsisaaja igale koopiale lähtekoodi masinloetava koopia või näitab ära hoidla, kust lähtekood on kergesti ja tasuta kättesaadav seni, kuni litsentsisaaja jätkab teose levitamist või edastamist.
|
||||
Õiguskaitse. Käesoleva litsentsiga ei anta luba kasutada litsentsiandja ärinimesid, kaubamärke, teenindusmärke või nimesid, välja arvatud juhul, kui see on vajalik mõistlikuks ja tavapäraseks kasutamiseks teose päritolu kirjeldamisel ja autoriõiguse märke sisu reprodutseerimisel.
|
||||
6. Autorsuse ahel
|
||||
Esialgne litsentsiandja tagab, et käesoleva litsentsiga antav autoriõigus originaalteosele kuulub talle või on talle litsentsitud ja et tal on õigus seda litsentsiga edasi anda.
|
||||
|
||||
Iga edasiarendaja tagab, et autoriõigus tema poolt teosele tehtavatele muudatustele kuulub talle või on talle litsentsitud ja et tal on õigus litsentsi anda.
|
||||
|
||||
Iga kord, kui Te võtate vastu litsentsi, annavad esialgne litsentsiandja ja hilisemad edasiarendajad Teile litsentsi nende osaluse kasutamiseks teoses vastavalt käesoleva litsentsi tingimustele.
|
||||
|
||||
7. Garantii puudumine
|
||||
Teos on veel pooleli ja arvukad edasiarendajad parendavad seda järjepidevalt. See ei ole lõpetatud teos ja võib seetõttu sisaldada defekte ja programmivigu, mis on omased seda liiki arendustegevusele.
|
||||
|
||||
Seetõttu levitatakse teost litsentsi alusel „sellisena, nagu see on“ ilma teose suhtes kehtiva garantiita, muu hulgas garantiita kaubandusliku kvaliteedi kohta, garantiita sobivuse kohta mingi kindla eesmärgi jaoks, garantiita defektide ja vigade puudumise kohta, garantiita täpsuse kohta ja selle kohta, et ei ole rikutud muid intellektuaalse omandi õigusi peale käesoleva litsentsi artiklis 6 nimetatud autoriõiguse.
|
||||
|
||||
Käesolev garantii puudumise klausel on litsentsi oluline osa ja teosele õiguste andmise eeltingimus.
|
||||
|
||||
8. Vastutuse välistamine
|
||||
Välja arvatud tahtliku õiguserikkumise või füüsilistele isikutele tekitatud otsese kahju puhul, ei vastuta litsentsiandja mitte mingil juhul litsentsi või teose kasutamise tagajärjel tekkinud mistahes otsese või kaudse, varalise või moraalse kahju eest, muu hulgas maineväärtuse langusest tekkinud kahju, tööseisakute, arvutirikke ja talitlushäirete, andmete kadumise ja ärikahju eest, isegi juhul kui litsentsiandjat on sellise kahju tekkimise võimalikkusest teavitatud. Litsentsiandja vastutab siiski vastavalt tootevastutust käsitlevatele õigusaktidele niivõrd, kuivõrd need õigusaktid on teose suhtes kohaldatavad.
|
||||
|
||||
9. Lisakokkulepped
|
||||
Teose levitamisel võite Te sõlmida lisakokkuleppe, milles määratakse kindlaks käesoleva litsentsiga vastavuses olevad kohustused või teenused. Kuid kui olete nõus võtma kohustusi, võite Te tegutseda ainult iseenda nimel ja vastutusel, mitte esialgse litsentsiandja või teiste edasiarendajate nimel, ja ainult juhul, kui Te nõustute vabastama edasiarendajad vastutusest, kaitsma ja hoidma neid kahju tekkimise eest vastutuse või nõuete osas, mida nende vastu võidakse esitada selle tagajärjel, et Teie pakute garantiid või võtate lisavastutuse.
|
||||
|
||||
10. Litsentsiga nõustumine
|
||||
Käesoleva litsentsi sätetega saab nõustuda, klõpsates ikoonile „Nõustun“ litsentsi teksti näitava akna all või väljendades nõusolekut muul sarnasel viisil vastavalt kehtivatele õigusaktidele. Sellele ikoonile klõpsates väljendate selgelt ja pöördumatult oma nõusolekut käesoleva litsentsi ja kõigi selle tingimuste suhtes.
|
||||
|
||||
Samuti nõustute pöördumatult käesoleva litsentsi ja kõigi selle tingimustega, kui teostate Teile käesoleva litsentsi artikliga 2 antud õigusi, näiteks kasutate teost, loote tuletatud teose või levitate või edastate teost või selle koopiaid.
|
||||
|
||||
11. Üldsuse teavitamine
|
||||
Juhul, kui Te kasutate teose levitamiseks või edastamiseks elektroonilisi sidevahendeid (näiteks võimaldate teose allalaadimist veebisaidilt), tuleb levitamiskanalil või andmekandjal (näiteks veebisaidil) teha üldsusele kättesaadavaks vähemalt kohaldatava õiguse alusel kohustuslik teave litsentsiandja ja litsentsi kohta ning selle kohta, kuidas see on litsentsisaajale kättesaadav, litsentsilepingu sõlmimise kohta ja selle kohta, kuidas litsentsisaaja saab litsentsi säilitada ja reprodutseerida.
|
||||
|
||||
12. Litsentsi lõppemine
|
||||
Litsents ja sellega antud õigused lõppevad automaatselt juhul, kui litsentsisaaja rikub litsentsi tingimusi.
|
||||
|
||||
Sellise lõppemise korral ei lõpe ühegi sellise isiku litsents, kes sai teose litsentsisaajalt vastavalt litsentsi tingimustele, juhul kui see isik täidab jätkuvalt litsentsi tingimusi.
|
||||
|
||||
13. Muud sätted
|
||||
Ilma et see piiraks litsentsi artikli 9 kohaldamist, sisaldab litsents kogu kokkulepet, mis osapoolte vahel seose teosega on.
|
||||
|
||||
Kui mõni litsentsi säte on vastavalt kohaldatavatele õigusaktidele kehtetu või seda ei ole võimalik jõustada, ei mõjuta see litsentsi kui terviku kehtivust ega jõustatavust. Sellist sätet tõlgendatakse või muudetakse nii nagu vaja, et see kehtiks ja saaks tagada selle täitmise.
|
||||
|
||||
Euroopa Komisjon võib avaldada käesoleva litsentsi muid keeleversioone või uusi versioone või lisa uuendatud versioone, kuivõrd see on vajalik ja mõistlik, vähendamata sellega litsentsiga antavate õiguste ulatust. Litsentsi uued versioonid avaldatakse kordumatu versiooninumbriga.
|
||||
|
||||
Käesoleva litsentsi kõik keeleversioonid, mille Euroopa Komisjon on heaks kiitnud, on võrdväärsed. Osapooled võivad kasutada enda valitud keeleversiooni.
|
||||
|
||||
14. Kohtualluvus
|
||||
Ilma et see piiraks konkreetse osapooltevahelise kokkuleppe kohaldamist,
|
||||
|
||||
— kuuluvad käesoleva litsentsi tõlgendamisest tulenevad kohtuvaidlused Euroopa Liidu institutsioonide, organite, büroode või asutuste kui litsentsiandja ja mistahes litsentsisaaja vahel Euroopa Liidu Kohtu pädevusse, nagu on sätestatud Euroopa Liidu toimimise lepingu artiklis 272,
|
||||
|
||||
— kuuluvad käesoleva litsentsi tõlgendamisest tulenevad kohtuvaidlused muude osapoolte vahel selle pädeva kohtu ainupädevusse, kelle tööpiirkonnas asub litsentsiandja elukoht või peamine tegevuskoht.
|
||||
|
||||
15. Kohaldatav õigus
|
||||
Ilma et see piiraks konkreetse osapooltevahelise kokkuleppe kohaldamist,
|
||||
|
||||
— kohaldatakse käesoleva litsentsi suhtes selle Euroopa Liidu liikmesriigi õigust, kus paikneb litsentsiandja peakorter, elukoht või asukoht,
|
||||
|
||||
— kohaldatakse litsentsi suhtes Belgia õigust, kui litsentsiandja peakorter, elukoht või asukoht asub väljaspool Euroopa Liidu liikmesriike.
|
||||
|
||||
Liide
|
||||
Euroopa Liidu tarkvara vaba kasutuse litsentsi artiklis 5 osutatud „ühilduvad litsentsid“ on järgmised:
|
||||
|
||||
— GNU General Public License (GPL) v. 2, v. 3
|
||||
|
||||
— GNU Affero General Public License (AGPL) v. 3
|
||||
|
||||
— Open Software License (OSL) v. 2.1, v. 3.0
|
||||
|
||||
— Eclipse Public License (EPL) v. 1.0
|
||||
|
||||
— CeCILL v. 2.0, v. 2.1
|
||||
|
||||
— Mozilla Public Licence (MPL) v. 2
|
||||
|
||||
— GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
||||
|
||||
— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) muude teoste puhul peale tarkvara
|
||||
|
||||
— European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
||||
|
||||
— Québec Free and Open-Source Licence – Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+)
|
||||
|
||||
Euroopa Komisjon võib käesolevat lisa ajakohastada loetletud litsentside hilisemate versioonidega ilma, et peaks selleks koostama EUPLi uue versiooni, eeldusel et nende litsentsidega tagatakse käesoleva litsentsi artiklis 2 sätestatud õigused ja kaitstakse hõlmatud lähtekoodi eksklusiivse omastamise eest.
|
||||
|
||||
Kõigi muude käesoleva liite muudatuste või täienduste jaoks on vaja koostada EUPLi uus versioon.
|
||||
21
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/LICENSE.MIT
generated
vendored
Normal file
21
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/LICENSE.MIT
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2011-2019, 2024 Andris Reinman and Zone Media OÜ
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
214
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/README.md
generated
vendored
Normal file
214
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/README.md
generated
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
# mailsplit
|
||||
|
||||
Split an email message stream into structured parts and join these parts back into an email message stream. If you do not modify the parsed data then the rebuilt message should be an exact copy of the original.
|
||||
|
||||
This is useful if you want to modify some specific parts of an email, for example to add tracking images or unsubscribe links to the HTML part of the message without changing any other parts of the email.
|
||||
|
||||
Supports both <CR><LF> and <LF> (or mixed) line endings. Embedded rfc822 messages are also parsed, in this case you would get two sequential 'node' objects with no 'data' or 'body' in between (first 'node' is for the container node and second for the root node of the embedded message).
|
||||
|
||||
In general this module is a primitive for building e-mail parsers/handlers like [mailparser](https://www.npmjs.com/package/mailparser). Alternatively you could use it to parse other MIME-like structures, for example _mbox_ files or multipart/form-data uploads.
|
||||
|
||||
See [rewrite-html.js](examples/rewrite-html.js) for an usage example where HTML content is modified on the fly (example script adds a link to every _text/html_ node)
|
||||
|
||||
## Usage
|
||||
|
||||
### Install
|
||||
|
||||
Install from [npm](https://www.npmjs.com/package/mailsplit)
|
||||
|
||||
npm install mailsplit --save
|
||||
|
||||
### Split message stream
|
||||
|
||||
`Splitter` is a transformable stream where input is a byte stream and output is an object stream.
|
||||
|
||||
```javascript
|
||||
let Splitter = require('mailsplit').Splitter;
|
||||
let splitter = new Splitter(options);
|
||||
```
|
||||
|
||||
Where
|
||||
|
||||
- **options** is an optional options object
|
||||
- **options.ignoreEmbedded** (boolean, defaults to false) if true then treat message/rfc822 node as normal leaf node and do not try to parse it
|
||||
- **options.maxHeadSize** (number, defaults to Infinity) limits message header size in bytes
|
||||
|
||||
#### Events
|
||||
|
||||
**'data'** event emits the next parsed object from the message stream.
|
||||
|
||||
#### Data objects
|
||||
|
||||
- **type**
|
||||
- `'node'` means that we reached the next mime node and the previous one is completely processed
|
||||
- `'data'` provides us multipart body parts, including boundaries. This data is not directly related to any specific multipart node, basically it includes everything between the end of one normal node and the header of next node
|
||||
- `'body'` provides us next chunk for the last seen `'node'` element
|
||||
- **value** is a buffer value for `'body'` and `'data'` parts
|
||||
- **getDecoder()** is a function that returns a stream object you can use to decode node contents. Write data from 'body' to decoder and read decoded Buffer value out from it
|
||||
- **getEncoder()** is a function that returns a stream object you can use to encode node contents. Write buffer data to encoder and read encoded object value out that you can pass to a Joiner
|
||||
|
||||
Element with type `'node'` has a bunch of header related methods and properties, see [below](#manipulating-headers).
|
||||
|
||||
**Example**
|
||||
|
||||
```javascript
|
||||
let Splitter = require('mailsplit').Splitter;
|
||||
let splitter = new Splitter();
|
||||
// handle parsed data
|
||||
splitter.on('data', data => {
|
||||
switch (data.type) {
|
||||
case 'node':
|
||||
// node header block
|
||||
process.stdout.write(data.getHeaders());
|
||||
break;
|
||||
case 'data':
|
||||
// multipart message structure
|
||||
// this is not related to any specific 'node' block as it includes
|
||||
// everything between the end of some node body and between the next header
|
||||
process.stdout.write(data.value);
|
||||
break;
|
||||
case 'body':
|
||||
// Leaf element body. Includes the body for the last 'node' block. You might
|
||||
// have several 'body' calls for a single 'node' block
|
||||
process.stdout.write(data.value);
|
||||
break;
|
||||
}
|
||||
});
|
||||
// send data to the parser
|
||||
someMessagStream.pipe(splitter);
|
||||
```
|
||||
|
||||
### Manipulating headers
|
||||
|
||||
If the data object has `type='node'` then you can modify headers for that node (headers can be modified until the data object is passed over to a `Joiner`)
|
||||
|
||||
- **node.getHeaders()** returns a Buffer value with generated headers. If you have not modified the headers object in any way then you should get the exact copy of the original. In case you have done something (for example removed a key, or added a new header key), then all linebreaks are forced to <CR><LF> even if the original headers used just <LF>
|
||||
- **node.setContentType(contentType)** sets or updates mime type for the node
|
||||
- **node.setCharset(charset)** sets or updates character set in the Content-Type header
|
||||
- **node.setFilename(filename)** sets or updates filename in the Content-Disposition header (unicode allowed)
|
||||
|
||||
You can manipulate specific header keys as well using the `headers` object
|
||||
|
||||
- **node.headers.get(key)** returns an array of strings with all header rows for the selected key (these are full header lines, so key name is part of the row string, eg `["Subject: This is subject line"]`)
|
||||
- **node.headers.getFirst(key)** returns string value of the specified header key (eg `"This is subject line"`)
|
||||
- **node.headers.hasHeader(key)** returns boolean value if the specified header key exists
|
||||
- **node.headers.add(key, value [,index])** adds a new header value to the specified index or to the top of the header block if index is not specified
|
||||
- **node.headers.update(key, value, [,relativeKeyIndex])** replaces a header value to the specified relative key index (note that relative key index means relative to the same header key, eg if multiple exist and you specify `1` as the value, then it will update the second) or if no relative key index is specified, then it will remove all header value matches found for the key and append one at the last matching key index found with the specified value. If a relative key index is specified and it does not exist then it will be replaced (eg if there are two headers of `X-Foo-Bar` and you pass `2`, meaning it will update the third, no updates will be made since the third did not exist)
|
||||
- **node.headers.remove(key)** remove header value
|
||||
- **node.headers.mbox** If this is a MBOX formatted message then this value holds the prefix line (eg. "From MAILER-DAEMON Fri Jul 8 12:08:34 2011")
|
||||
- **node.headers.mbox** If this is a POST form-data then this value holds the HTTP prefix line (eg. "POST /upload.php HTTP/1.1")
|
||||
|
||||
Additionally you can check the details of the node with the following properties automatically parsed from the headers:
|
||||
|
||||
- **node.root** if true then it means this is the message root, so this node should contain Subject, From, To etc. headers
|
||||
- **node.contentType** returns the mime type of the node (eg. 'text/html')
|
||||
- **node.disposition** either `'attachment'`, `'inline'` or `false` if not set
|
||||
- **node.charset** returns the charset of the node as defined in 'Content-Type' header (eg. 'UTF-8') or false if not defined
|
||||
- **node.encoding** returns the Transfer-Encoding value (eg. 'base64' or 'quoted-printable') or false if not defined
|
||||
- **node.multipart** if has value, then this is a multipart node (does not have 'body' parts)
|
||||
- **node.filename** is set if the headers contain a filename value. This is decoded to unicode, so it is a normal string or false if not found
|
||||
|
||||
### Join parsed message stream
|
||||
|
||||
`Joiner` is a transformable stream where input is the object stream form `Splitter` and output is a byte stream.
|
||||
|
||||
```javascript
|
||||
let Splitter = require('mailsplit').Splitter;
|
||||
let Joiner = require('mailsplit').Joiner;
|
||||
let splitter = new Splitter();
|
||||
let joiner = new Joiner();
|
||||
// pipe a message source to splitter, then joiner and finally to stdout
|
||||
someMessagStream
|
||||
.pipe(splitter)
|
||||
.pipe(joiner)
|
||||
.pipe(process.stdout);
|
||||
```
|
||||
|
||||
### Rewrite specific nodes
|
||||
|
||||
`Rewriter` is a simple helper class to modify nodes that match a filter function. You can pipe a Splitter stream directly into a Rewriter and pipe Rewriter output to a Joiner.
|
||||
|
||||
Rewriter takes the following argument:
|
||||
|
||||
- **filterFunc** gets the current node as argument and starts processing it if `filterFunc` returns true
|
||||
|
||||
Once Rewriter finds a matching node, it emits the following event:
|
||||
|
||||
- _'node'_ with an object argument `data`
|
||||
- `data.node` includes the current node with headers
|
||||
- `data.decoder` is the decoder stream that you can read data from
|
||||
- `data.encoder` is the encoder stream that you can write data to. Whatever you write into that stream will be encoded properly and inserted as the content of the current node
|
||||
|
||||
```javascript
|
||||
let Splitter = require('mailsplit').Splitter;
|
||||
let Joiner = require('mailsplit').Joiner;
|
||||
let Rewriter = require('mailsplit').Rewriter;
|
||||
let splitter = new Splitter();
|
||||
let joiner = new Joiner();
|
||||
let rewriter = new Rewriter(node => node.contentType === 'text/html');
|
||||
rewriter.on('node', data => {
|
||||
// manage headers with node.headers
|
||||
node.headers.add('X-Processed-Time', new Date.toISOString());
|
||||
// do nothing, just reencode existing data
|
||||
data.decoder.pipe(data.encoder);
|
||||
});
|
||||
// pipe a message source to splitter, then rewriter, then joiner and finally to stdout
|
||||
someMessagStream
|
||||
.pipe(splitter)
|
||||
.pipe(rewriter)
|
||||
.pipe(joiner)
|
||||
.pipe(process.stdout);
|
||||
```
|
||||
|
||||
### Stream specific nodes
|
||||
|
||||
`Streamer` is a simple helper class to stream nodes that match a filter function. You can pipe a Splitter stream directly into a Streamer and pipe Streamer output to a Joiner.
|
||||
|
||||
Streamer takes the following argument:
|
||||
|
||||
- **filterFunc** gets the current node as argument and starts processing it if `filterFunc` returns true
|
||||
|
||||
Once Streamer finds a matching node, it emits the following event:
|
||||
|
||||
- _'node'_ with an object argument `data`
|
||||
- `data.node` includes the current node with headers (informational only, you can't modify it)
|
||||
- `data.decoder` is the decoder stream that you can read data from
|
||||
- `data.done` is a function you must call once you have processed the stream
|
||||
|
||||
```javascript
|
||||
let Splitter = require('mailsplit').Splitter;
|
||||
let Joiner = require('mailsplit').Joiner;
|
||||
let Streamer = require('mailsplit').Streamer;
|
||||
let fs = require('fs');
|
||||
let splitter = new Splitter();
|
||||
let joiner = new Joiner();
|
||||
let streamer = new Streamer(node => node.contentType === 'image/jpeg');
|
||||
streamer.on('node', data => {
|
||||
// write to file
|
||||
data.decoder.pipe(fs.createWriteStream(data.node.filename || 'image.jpg'));
|
||||
data.done();
|
||||
});
|
||||
// pipe a message source to splitter, then streamer, then joiner and finally to stdout
|
||||
someMessagStream
|
||||
.pipe(splitter)
|
||||
.pipe(streamer)
|
||||
.pipe(joiner)
|
||||
.pipe(process.stdout);
|
||||
```
|
||||
|
||||
### Benchmark
|
||||
|
||||
Parsing and re-building messages is not fast but it isn't slow either. On my Macbook Pro I got around 22 MB/second (single process, single parsing queue) when parsing random messages from my own email archive. Time spent includes file calls to find and load random messages from disk.
|
||||
|
||||
```
|
||||
Streaming 20000 random messages through a plain PassThrough
|
||||
Done. 20000 messages [1244 MB] processed in 10.095 s. with average of 1981 messages/sec [123 MB/s]
|
||||
Streaming 20000 random messages through Splitter and Joiner
|
||||
Done. 20000 messages [1244 MB] processed in 55.882 s. with average of 358 messages/sec [22 MB/s]
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Dual licensed under **MIT** or **EUPLv1.1+**
|
||||
|
||||
> `mailsplit` is part of the Zone Mail Suite (ZMS). Suite of programs and modules for an efficient, fast and modern email server.
|
||||
17
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/index.js
generated
vendored
Normal file
17
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
const MessageSplitter = require('./lib/message-splitter');
|
||||
const MessageJoiner = require('./lib/message-joiner');
|
||||
const NodeRewriter = require('./lib/node-rewriter');
|
||||
const NodeStreamer = require('./lib/node-streamer');
|
||||
const Headers = require('./lib/headers');
|
||||
const ChunkedPassthrough = require('./lib/chunked-passthrough');
|
||||
|
||||
module.exports = {
|
||||
Splitter: MessageSplitter,
|
||||
Joiner: MessageJoiner,
|
||||
Rewriter: NodeRewriter,
|
||||
Streamer: NodeStreamer,
|
||||
ChunkedPassthrough,
|
||||
Headers
|
||||
};
|
||||
37
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/chunked-passthrough.js
generated
vendored
Normal file
37
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/chunked-passthrough.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
const { Transform } = require('stream');
|
||||
|
||||
class ChunkedPassthrough extends Transform {
|
||||
constructor(options = {}) {
|
||||
let config = {
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: false
|
||||
};
|
||||
super(config);
|
||||
this.chunkSize = options.chunkSize || 64 * 1024; // 64KB default
|
||||
this.buffer = Buffer.alloc(0);
|
||||
}
|
||||
|
||||
_transform(chunk, encoding, callback) {
|
||||
this.buffer = Buffer.concat([this.buffer, chunk]);
|
||||
|
||||
if (this.buffer.length >= this.chunkSize) {
|
||||
this.push(this.buffer);
|
||||
this.buffer = Buffer.alloc(0);
|
||||
}
|
||||
|
||||
callback();
|
||||
}
|
||||
|
||||
_flush(callback) {
|
||||
// Send remaining data
|
||||
if (this.buffer.length > 0) {
|
||||
this.push(this.buffer);
|
||||
this.buffer = Buffer.alloc(0);
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ChunkedPassthrough;
|
||||
55
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/flowed-decoder.js
generated
vendored
Normal file
55
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/flowed-decoder.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
'use strict';
|
||||
|
||||
// Helper class to rewrite nodes with specific mime type
|
||||
|
||||
const Transform = require('stream').Transform;
|
||||
const libmime = require('libmime');
|
||||
|
||||
/**
|
||||
* Really bad "stream" transform to parse format=flowed content
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} delSp True if delsp option was used
|
||||
*/
|
||||
class FlowedDecoder extends Transform {
|
||||
constructor(config) {
|
||||
super();
|
||||
this.config = config || {};
|
||||
|
||||
this.chunks = [];
|
||||
this.chunklen = 0;
|
||||
|
||||
this.libmime = new libmime.Libmime({ Iconv: config.Iconv });
|
||||
}
|
||||
|
||||
_transform(chunk, encoding, callback) {
|
||||
if (!chunk || !chunk.length) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
if (!encoding !== 'buffer') {
|
||||
chunk = Buffer.from(chunk, encoding);
|
||||
}
|
||||
|
||||
this.chunks.push(chunk);
|
||||
this.chunklen += chunk.length;
|
||||
|
||||
callback();
|
||||
}
|
||||
|
||||
_flush(callback) {
|
||||
if (this.chunklen) {
|
||||
let currentBody = Buffer.concat(this.chunks, this.chunklen);
|
||||
|
||||
if (this.config.encoding === 'base64') {
|
||||
currentBody = Buffer.from(currentBody.toString('binary'), 'base64');
|
||||
}
|
||||
|
||||
let content = this.libmime.decodeFlowed(currentBody.toString('binary'), this.config.delSp);
|
||||
this.push(Buffer.from(content, 'binary'));
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = FlowedDecoder;
|
||||
238
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/headers.js
generated
vendored
Normal file
238
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/headers.js
generated
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
'use strict';
|
||||
|
||||
const libmime = require('libmime');
|
||||
|
||||
/**
|
||||
* Class Headers to parse and handle message headers. Headers instance allows to
|
||||
* check existing, delete or add new headers
|
||||
*/
|
||||
class Headers {
|
||||
constructor(headers, config) {
|
||||
config = config || {};
|
||||
|
||||
if (Array.isArray(headers)) {
|
||||
// already using parsed headers
|
||||
this.changed = true;
|
||||
this.headers = false;
|
||||
this.parsed = true;
|
||||
this.lines = headers;
|
||||
} else {
|
||||
// using original string/buffer headers
|
||||
this.changed = false;
|
||||
this.headers = headers;
|
||||
this.parsed = false;
|
||||
this.lines = false;
|
||||
}
|
||||
this.mbox = false;
|
||||
this.http = false;
|
||||
|
||||
this.libmime = new libmime.Libmime({ Iconv: config.Iconv });
|
||||
}
|
||||
|
||||
hasHeader(key) {
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
key = this._normalizeHeader(key);
|
||||
return typeof this.lines.find(line => line.key === key) === 'object';
|
||||
}
|
||||
|
||||
get(key) {
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
key = this._normalizeHeader(key);
|
||||
let lines = this.lines.filter(line => line.key === key).map(line => line.line);
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
getDecoded(key) {
|
||||
return this.get(key)
|
||||
.map(line => this.libmime.decodeHeader(line))
|
||||
.filter(line => line && line.value);
|
||||
}
|
||||
|
||||
getFirst(key) {
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
key = this._normalizeHeader(key);
|
||||
let header = this.lines.find(line => line.key === key);
|
||||
if (!header) {
|
||||
return '';
|
||||
}
|
||||
return ((this.libmime.decodeHeader(header.line) || {}).value || '').toString().trim();
|
||||
}
|
||||
|
||||
getList() {
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
return this.lines;
|
||||
}
|
||||
|
||||
add(key, value, index) {
|
||||
if (typeof value === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof value === 'number') {
|
||||
value = value.toString();
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
value = Buffer.from(value);
|
||||
}
|
||||
|
||||
value = value.toString('binary');
|
||||
this.addFormatted(key, this.libmime.foldLines(key + ': ' + value.replace(/\r?\n/g, ''), 76, false), index);
|
||||
}
|
||||
|
||||
addFormatted(key, line, index) {
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
index = index || 0;
|
||||
this.changed = true;
|
||||
|
||||
if (!line) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof line !== 'string') {
|
||||
line = line.toString('binary');
|
||||
}
|
||||
|
||||
let header = {
|
||||
key: this._normalizeHeader(key),
|
||||
line
|
||||
};
|
||||
|
||||
if (index < 1) {
|
||||
this.lines.unshift(header);
|
||||
} else if (index >= this.lines.length) {
|
||||
this.lines.push(header);
|
||||
} else {
|
||||
this.lines.splice(index, 0, header);
|
||||
}
|
||||
}
|
||||
|
||||
remove(key) {
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
key = this._normalizeHeader(key);
|
||||
for (let i = this.lines.length - 1; i >= 0; i--) {
|
||||
if (this.lines[i].key === key) {
|
||||
this.changed = true;
|
||||
this.lines.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update(key, value, relativeIndex) {
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
let keyName = key;
|
||||
let index = 0;
|
||||
key = this._normalizeHeader(key);
|
||||
let relativeIndexCount = 0;
|
||||
let relativeMatchFound = false;
|
||||
for (let i = this.lines.length - 1; i >= 0; i--) {
|
||||
if (this.lines[i].key === key) {
|
||||
if (relativeIndex && relativeIndex !== relativeIndexCount) {
|
||||
relativeIndexCount++;
|
||||
continue;
|
||||
}
|
||||
index = i;
|
||||
this.changed = true;
|
||||
this.lines.splice(i, 1);
|
||||
if (relativeIndex) {
|
||||
relativeMatchFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (relativeIndex && !relativeMatchFound) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.add(keyName, value, index);
|
||||
}
|
||||
|
||||
build(lineEnd) {
|
||||
if (!this.changed && !lineEnd) {
|
||||
return typeof this.headers === 'string' ? Buffer.from(this.headers, 'binary') : this.headers;
|
||||
}
|
||||
|
||||
if (!this.parsed) {
|
||||
this._parseHeaders();
|
||||
}
|
||||
|
||||
lineEnd = lineEnd || '\r\n';
|
||||
|
||||
let headers = this.lines.map(line => line.line.replace(/\r?\n/g, lineEnd)).join(lineEnd) + `${lineEnd}${lineEnd}`;
|
||||
|
||||
if (this.mbox) {
|
||||
headers = this.mbox + lineEnd + headers;
|
||||
}
|
||||
|
||||
if (this.http) {
|
||||
headers = this.http + lineEnd + headers;
|
||||
}
|
||||
|
||||
return Buffer.from(headers, 'binary');
|
||||
}
|
||||
|
||||
_normalizeHeader(key) {
|
||||
return (key || '').toLowerCase().trim();
|
||||
}
|
||||
|
||||
_parseHeaders() {
|
||||
if (!this.headers) {
|
||||
this.lines = [];
|
||||
this.parsed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
let lines = this.headers
|
||||
.toString('binary')
|
||||
.replace(/[\r\n]+$/, '')
|
||||
.split(/\r?\n/);
|
||||
|
||||
for (let i = lines.length - 1; i >= 0; i--) {
|
||||
let chr = lines[i].charAt(0);
|
||||
if (i && (chr === ' ' || chr === '\t')) {
|
||||
lines[i - 1] += '\r\n' + lines[i];
|
||||
lines.splice(i, 1);
|
||||
} else {
|
||||
let line = lines[i];
|
||||
if (!i && /^From /i.test(line)) {
|
||||
// mbox file
|
||||
this.mbox = line;
|
||||
lines.splice(i, 1);
|
||||
continue;
|
||||
} else if (!i && /^POST /i.test(line)) {
|
||||
// HTTP POST request
|
||||
this.http = line;
|
||||
lines.splice(i, 1);
|
||||
continue;
|
||||
}
|
||||
let key = this._normalizeHeader(line.substr(0, line.indexOf(':')));
|
||||
lines[i] = {
|
||||
key,
|
||||
line
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
this.lines = lines;
|
||||
this.parsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// expose to the world
|
||||
module.exports = Headers;
|
||||
30
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/message-joiner.js
generated
vendored
Normal file
30
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/message-joiner.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const Transform = require('stream').Transform;
|
||||
|
||||
class MessageJoiner extends Transform {
|
||||
constructor() {
|
||||
let options = {
|
||||
readableObjectMode: false,
|
||||
writableObjectMode: true
|
||||
};
|
||||
super(options);
|
||||
}
|
||||
|
||||
_transform(obj, encoding, callback) {
|
||||
if (Buffer.isBuffer(obj)) {
|
||||
this.push(obj);
|
||||
} else if (obj.type === 'node') {
|
||||
this.push(obj.getHeaders());
|
||||
} else if (obj.value) {
|
||||
this.push(obj.value);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
|
||||
_flush(callback) {
|
||||
return callback();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MessageJoiner;
|
||||
422
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/message-splitter.js
generated
vendored
Normal file
422
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/message-splitter.js
generated
vendored
Normal file
@@ -0,0 +1,422 @@
|
||||
'use strict';
|
||||
|
||||
const Transform = require('stream').Transform;
|
||||
const MimeNode = require('./mime-node');
|
||||
|
||||
const MAX_HEAD_SIZE = 1 * 1024 * 1024;
|
||||
const MAX_CHILD_NODES = 1000;
|
||||
|
||||
const HEAD = 0x01;
|
||||
const BODY = 0x02;
|
||||
|
||||
class MessageSplitter extends Transform {
|
||||
constructor(config) {
|
||||
let options = {
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: false
|
||||
};
|
||||
super(options);
|
||||
|
||||
this.config = config || {};
|
||||
this.maxHeadSize = this.config.maxHeadSize || MAX_HEAD_SIZE;
|
||||
this.maxChildNodes = this.config.maxChildNodes || MAX_CHILD_NODES;
|
||||
this.tree = [];
|
||||
this.nodeCounter = 0;
|
||||
this.newNode();
|
||||
this.tree.push(this.node);
|
||||
this.line = false;
|
||||
this.hasFailed = false;
|
||||
}
|
||||
|
||||
_transform(chunk, encoding, callback) {
|
||||
// process line by line
|
||||
// find next line ending
|
||||
let pos = 0;
|
||||
let i = 0;
|
||||
let group = {
|
||||
type: 'none'
|
||||
};
|
||||
let groupstart = this.line ? -this.line.length : 0;
|
||||
let groupend = 0;
|
||||
|
||||
let checkTrailingLinebreak = data => {
|
||||
if (data.type === 'body' && data.node.parentNode && data.value && data.value.length) {
|
||||
if (data.value[data.value.length - 1] === 0x0a) {
|
||||
groupstart--;
|
||||
groupend--;
|
||||
pos--;
|
||||
if (data.value.length > 1 && data.value[data.value.length - 2] === 0x0d) {
|
||||
groupstart--;
|
||||
groupend--;
|
||||
pos--;
|
||||
if (groupstart < 0 && !this.line) {
|
||||
// store only <CR> as <LF> should be on the positive side
|
||||
this.line = Buffer.allocUnsafe(1);
|
||||
this.line[0] = 0x0d;
|
||||
}
|
||||
data.value = data.value.slice(0, data.value.length - 2);
|
||||
} else {
|
||||
data.value = data.value.slice(0, data.value.length - 1);
|
||||
}
|
||||
} else if (data.value[data.value.length - 1] === 0x0d) {
|
||||
groupstart--;
|
||||
groupend--;
|
||||
pos--;
|
||||
data.value = data.value.slice(0, data.value.length - 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let iterateData = () => {
|
||||
for (let len = chunk.length; i < len; i++) {
|
||||
// find next <LF>
|
||||
if (chunk[i] === 0x0a) {
|
||||
// line end
|
||||
|
||||
let start = Math.max(pos, 0);
|
||||
pos = ++i;
|
||||
|
||||
return this.processLine(chunk.slice(start, i), false, (err, data, flush) => {
|
||||
if (err) {
|
||||
this.hasFailed = true;
|
||||
return setImmediate(() => callback(err));
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return setImmediate(iterateData);
|
||||
}
|
||||
|
||||
if (flush) {
|
||||
if (group && group.type !== 'none') {
|
||||
if (group.type === 'body' && groupend >= groupstart && group.node.parentNode) {
|
||||
// do not include the last line ending for body
|
||||
if (chunk[groupend - 1] === 0x0a) {
|
||||
groupend--;
|
||||
if (groupend >= groupstart && chunk[groupend - 1] === 0x0d) {
|
||||
groupend--;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (groupstart !== groupend) {
|
||||
group.value = chunk.slice(groupstart, groupend);
|
||||
if (groupend < i) {
|
||||
data.value = chunk.slice(groupend, i);
|
||||
}
|
||||
}
|
||||
this.push(group);
|
||||
group = {
|
||||
type: 'none'
|
||||
};
|
||||
groupstart = groupend = i;
|
||||
}
|
||||
this.push(data);
|
||||
groupend = i;
|
||||
return setImmediate(iterateData);
|
||||
}
|
||||
|
||||
if (data.type === group.type) {
|
||||
// shift slice end position forward
|
||||
groupend = i;
|
||||
} else {
|
||||
if (group.type === 'body' && groupend >= groupstart && group.node.parentNode) {
|
||||
// do not include the last line ending for body
|
||||
if (chunk[groupend - 1] === 0x0a) {
|
||||
groupend--;
|
||||
if (groupend >= groupstart && chunk[groupend - 1] === 0x0d) {
|
||||
groupend--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (group.type !== 'none' && group.type !== 'node') {
|
||||
// we have a previous data/body chunk to output
|
||||
if (groupstart !== groupend) {
|
||||
group.value = chunk.slice(groupstart, groupend);
|
||||
if (group.value && group.value.length) {
|
||||
this.push(group);
|
||||
group = {
|
||||
type: 'none'
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.type === 'node') {
|
||||
this.push(data);
|
||||
groupstart = i;
|
||||
groupend = i;
|
||||
} else if (groupstart < 0) {
|
||||
groupstart = i;
|
||||
groupend = i;
|
||||
checkTrailingLinebreak(data);
|
||||
if (data.value && data.value.length) {
|
||||
this.push(data);
|
||||
}
|
||||
} else {
|
||||
// start new body/data chunk
|
||||
group = data;
|
||||
groupstart = groupend;
|
||||
groupend = i;
|
||||
}
|
||||
}
|
||||
return setImmediate(iterateData);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// skip last linebreak for body
|
||||
if (pos >= groupstart + 1 && group.type === 'body' && group.node.parentNode) {
|
||||
// do not include the last line ending for body
|
||||
if (chunk[pos - 1] === 0x0a) {
|
||||
pos--;
|
||||
if (pos >= groupstart && chunk[pos - 1] === 0x0d) {
|
||||
pos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (group.type !== 'none' && group.type !== 'node' && pos > groupstart) {
|
||||
// we have a leftover data/body chunk to push out
|
||||
group.value = chunk.slice(groupstart, pos);
|
||||
|
||||
if (group.value && group.value.length) {
|
||||
this.push(group);
|
||||
group = {
|
||||
type: 'none'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (pos < chunk.length) {
|
||||
if (this.line) {
|
||||
this.line = Buffer.concat([this.line, chunk.slice(pos)]);
|
||||
} else {
|
||||
this.line = chunk.slice(pos);
|
||||
}
|
||||
}
|
||||
callback();
|
||||
};
|
||||
|
||||
setImmediate(iterateData);
|
||||
}
|
||||
|
||||
_flush(callback) {
|
||||
if (this.hasFailed) {
|
||||
return callback();
|
||||
}
|
||||
this.processLine(false, true, (err, data) => {
|
||||
if (err) {
|
||||
return setImmediate(() => callback(err));
|
||||
}
|
||||
if (data && (data.type === 'node' || (data.value && data.value.length))) {
|
||||
this.push(data);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
compareBoundary(line, startpos, boundary) {
|
||||
// --{boundary}\r\n or --{boundary}--\r\n
|
||||
if (line.length < boundary.length + 3 + startpos || line.length > boundary.length + 6 + startpos) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < boundary.length; i++) {
|
||||
if (line[i + 2 + startpos] !== boundary[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
let pos = 0;
|
||||
for (let i = boundary.length + 2 + startpos; i < line.length; i++) {
|
||||
let c = line[i];
|
||||
if (pos === 0 && (c === 0x0d || c === 0x0a)) {
|
||||
// 1: next node
|
||||
return 1;
|
||||
}
|
||||
if (pos === 0 && c !== 0x2d) {
|
||||
// expecting "-"
|
||||
return false;
|
||||
}
|
||||
if (pos === 1 && c !== 0x2d) {
|
||||
// expecting "-"
|
||||
return false;
|
||||
}
|
||||
if (pos === 2 && c !== 0x0d && c !== 0x0a) {
|
||||
// expecting line terminator, either <CR> or <LF>
|
||||
return false;
|
||||
}
|
||||
if (pos === 3 && c !== 0x0a) {
|
||||
// expecting line terminator <LF>
|
||||
return false;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
|
||||
// 2: multipart end
|
||||
return 2;
|
||||
}
|
||||
|
||||
checkBoundary(line) {
|
||||
let startpos = 0;
|
||||
if (line.length >= 1 && (line[0] === 0x0d || line[0] === 0x0a)) {
|
||||
startpos++;
|
||||
if (line.length >= 2 && (line[0] === 0x0d || line[1] === 0x0a)) {
|
||||
startpos++;
|
||||
}
|
||||
}
|
||||
if (line.length < 4 || line[startpos] !== 0x2d || line[startpos + 1] !== 0x2d) {
|
||||
// defnitely not a boundary
|
||||
return false;
|
||||
}
|
||||
|
||||
let boundary;
|
||||
if (this.node._boundary && (boundary = this.compareBoundary(line, startpos, this.node._boundary))) {
|
||||
// 1: next child
|
||||
// 2: multipart end
|
||||
return boundary;
|
||||
}
|
||||
|
||||
if (this.node._parentBoundary && (boundary = this.compareBoundary(line, startpos, this.node._parentBoundary))) {
|
||||
// 3: next sibling
|
||||
// 4: parent end
|
||||
return boundary + 2;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
processLine(line, final, next) {
|
||||
let flush = false;
|
||||
|
||||
if (this.line && line) {
|
||||
line = Buffer.concat([this.line, line]);
|
||||
this.line = false;
|
||||
} else if (this.line && !line) {
|
||||
line = this.line;
|
||||
this.line = false;
|
||||
}
|
||||
|
||||
if (!line) {
|
||||
line = Buffer.alloc(0);
|
||||
}
|
||||
|
||||
if (this.nodeCounter > this.maxChildNodes) {
|
||||
let err = new Error('Max allowed child nodes exceeded');
|
||||
err.code = 'EMAXLEN';
|
||||
return next(err);
|
||||
}
|
||||
|
||||
// we check boundary outside the HEAD/BODY scope as it may appear anywhere
|
||||
let boundary = this.checkBoundary(line);
|
||||
if (boundary) {
|
||||
// reached boundary, switch context
|
||||
switch (boundary) {
|
||||
case 1:
|
||||
// next child
|
||||
this.newNode(this.node);
|
||||
flush = true;
|
||||
break;
|
||||
case 2:
|
||||
// reached end of children, keep current node
|
||||
break;
|
||||
case 3: {
|
||||
// next sibling
|
||||
let parentNode = this.node.parentNode;
|
||||
if (parentNode && parentNode.contentType === 'message/rfc822') {
|
||||
// special case where immediate parent is an inline message block
|
||||
// move up another step
|
||||
parentNode = parentNode.parentNode;
|
||||
}
|
||||
this.newNode(parentNode);
|
||||
flush = true;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
// special case when boundary close a node with only header.
|
||||
if (this.node && this.node._headerlen && !this.node.headers) {
|
||||
this.node.parseHeaders();
|
||||
this.push(this.node);
|
||||
}
|
||||
// move up
|
||||
if (this.tree.length) {
|
||||
this.node = this.tree.pop();
|
||||
}
|
||||
this.state = BODY;
|
||||
break;
|
||||
}
|
||||
|
||||
return next(
|
||||
null,
|
||||
{
|
||||
node: this.node,
|
||||
type: 'data',
|
||||
value: line
|
||||
},
|
||||
flush
|
||||
);
|
||||
}
|
||||
|
||||
switch (this.state) {
|
||||
case HEAD: {
|
||||
this.node.addHeaderChunk(line);
|
||||
if (this.node._headerlen > this.maxHeadSize) {
|
||||
let err = new Error('Max header size for a MIME node exceeded');
|
||||
err.code = 'EMAXLEN';
|
||||
return next(err);
|
||||
}
|
||||
if (final || (line.length === 1 && line[0] === 0x0a) || (line.length === 2 && line[0] === 0x0d && line[1] === 0x0a)) {
|
||||
let currentNode = this.node;
|
||||
|
||||
currentNode.parseHeaders();
|
||||
|
||||
// if the content is attached message then just continue
|
||||
if (
|
||||
currentNode.contentType === 'message/rfc822' &&
|
||||
!this.config.ignoreEmbedded &&
|
||||
(!currentNode.encoding || ['7bit', '8bit', 'binary'].includes(currentNode.encoding)) &&
|
||||
(this.config.defaultInlineEmbedded ? currentNode.disposition !== 'attachment' : currentNode.disposition === 'inline')
|
||||
) {
|
||||
currentNode.messageNode = true;
|
||||
this.newNode(currentNode);
|
||||
if (currentNode.parentNode) {
|
||||
this.node._parentBoundary = currentNode.parentNode._boundary;
|
||||
}
|
||||
} else {
|
||||
if (currentNode.contentType === 'message/rfc822') {
|
||||
currentNode.messageNode = false;
|
||||
}
|
||||
this.state = BODY;
|
||||
if (currentNode.multipart && currentNode._boundary) {
|
||||
this.tree.push(currentNode);
|
||||
}
|
||||
}
|
||||
|
||||
return next(null, currentNode, flush);
|
||||
}
|
||||
|
||||
return next();
|
||||
}
|
||||
case BODY: {
|
||||
return next(
|
||||
null,
|
||||
{
|
||||
node: this.node,
|
||||
type: this.node.multipart ? 'data' : 'body',
|
||||
value: line
|
||||
},
|
||||
flush
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
next(null, false);
|
||||
}
|
||||
|
||||
newNode(parent) {
|
||||
this.node = new MimeNode(parent || false, this.config);
|
||||
this.state = HEAD;
|
||||
this.nodeCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MessageSplitter;
|
||||
265
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/mime-node.js
generated
vendored
Normal file
265
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/mime-node.js
generated
vendored
Normal file
@@ -0,0 +1,265 @@
|
||||
'use strict';
|
||||
|
||||
const Headers = require('./headers');
|
||||
const libmime = require('libmime');
|
||||
const libqp = require('libqp');
|
||||
const libbase64 = require('libbase64');
|
||||
const PassThrough = require('stream').PassThrough;
|
||||
const pathlib = require('path');
|
||||
|
||||
class MimeNode {
|
||||
constructor(parentNode, config) {
|
||||
this.type = 'node';
|
||||
this.root = !parentNode;
|
||||
this.parentNode = parentNode;
|
||||
|
||||
this._parentBoundary = this.parentNode && this.parentNode._boundary;
|
||||
this._headersLines = [];
|
||||
this._headerlen = 0;
|
||||
|
||||
this._parsedContentType = false;
|
||||
this._boundary = false;
|
||||
|
||||
this.multipart = false;
|
||||
this.encoding = false;
|
||||
this.headers = false;
|
||||
this.contentType = false;
|
||||
this.flowed = false;
|
||||
this.delSp = false;
|
||||
|
||||
this.config = config || {};
|
||||
this.libmime = new libmime.Libmime({ Iconv: this.config.Iconv });
|
||||
|
||||
this.parentPartNumber = (parentNode && this.partNr) || [];
|
||||
this.partNr = false; // resolved later
|
||||
this.childPartNumbers = 0;
|
||||
}
|
||||
|
||||
getPartNr(provided) {
|
||||
if (provided) {
|
||||
return []
|
||||
.concat(this.partNr || [])
|
||||
.filter(nr => !isNaN(nr))
|
||||
.concat(provided);
|
||||
}
|
||||
let childPartNr = ++this.childPartNumbers;
|
||||
return []
|
||||
.concat(this.partNr || [])
|
||||
.filter(nr => !isNaN(nr))
|
||||
.concat(childPartNr);
|
||||
}
|
||||
|
||||
addHeaderChunk(line) {
|
||||
if (!line) {
|
||||
return;
|
||||
}
|
||||
this._headersLines.push(line);
|
||||
this._headerlen += line.length;
|
||||
}
|
||||
|
||||
parseHeaders() {
|
||||
if (this.headers) {
|
||||
return;
|
||||
}
|
||||
this.headers = new Headers(Buffer.concat(this._headersLines, this._headerlen), this.config);
|
||||
|
||||
this._parsedContentDisposition = this.libmime.parseHeaderValue(this.headers.getFirst('Content-Disposition'));
|
||||
|
||||
// if content-type is missing default to plaintext
|
||||
let contentHeader;
|
||||
if (this.headers.get('Content-Type').length) {
|
||||
contentHeader = this.headers.getFirst('Content-Type');
|
||||
} else {
|
||||
if (this._parsedContentDisposition.params.filename) {
|
||||
let extension = pathlib.parse(this._parsedContentDisposition.params.filename).ext.replace(/^\./, '');
|
||||
if (extension) {
|
||||
contentHeader = libmime.detectMimeType(extension);
|
||||
}
|
||||
}
|
||||
if (!contentHeader) {
|
||||
if (/^attachment$/i.test(this._parsedContentDisposition.value)) {
|
||||
contentHeader = 'application/octet-stream';
|
||||
} else {
|
||||
contentHeader = 'text/plain';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this._parsedContentType = this.libmime.parseHeaderValue(contentHeader);
|
||||
|
||||
this.encoding = this.headers
|
||||
.getFirst('Content-Transfer-Encoding')
|
||||
.replace(/\(.*\)/g, '')
|
||||
.toLowerCase()
|
||||
.trim();
|
||||
this.contentType = (this._parsedContentType.value || '').toLowerCase().trim() || false;
|
||||
this.charset = this._parsedContentType.params.charset || false;
|
||||
this.disposition = (this._parsedContentDisposition.value || '').toLowerCase().trim() || false;
|
||||
|
||||
// fix invalidly encoded disposition values
|
||||
if (this.disposition) {
|
||||
try {
|
||||
this.disposition = this.libmime.decodeWords(this.disposition);
|
||||
} catch (E) {
|
||||
// failed to parse disposition, keep as is (most probably an unknown charset is used)
|
||||
}
|
||||
}
|
||||
|
||||
this.filename = this._parsedContentDisposition.params.filename || this._parsedContentType.params.name || false;
|
||||
|
||||
if (this._parsedContentType.params.format && this._parsedContentType.params.format.toLowerCase().trim() === 'flowed') {
|
||||
this.flowed = true;
|
||||
if (this._parsedContentType.params.delsp && this._parsedContentType.params.delsp.toLowerCase().trim() === 'yes') {
|
||||
this.delSp = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.filename) {
|
||||
try {
|
||||
this.filename = this.libmime.decodeWords(this.filename);
|
||||
} catch (E) {
|
||||
// failed to parse filename, keep as is (most probably an unknown charset is used)
|
||||
}
|
||||
}
|
||||
|
||||
this.multipart =
|
||||
(this.contentType &&
|
||||
this.contentType.substr(0, this.contentType.indexOf('/')) === 'multipart' &&
|
||||
this.contentType.substr(this.contentType.indexOf('/') + 1)) ||
|
||||
false;
|
||||
this._boundary = (this._parsedContentType.params.boundary && Buffer.from(this._parsedContentType.params.boundary)) || false;
|
||||
|
||||
this.rfc822 = this.contentType === 'message/rfc822';
|
||||
|
||||
if (!this.parentNode || this.parentNode.rfc822) {
|
||||
this.partNr = this.parentNode ? this.parentNode.getPartNr('TEXT') : ['TEXT'];
|
||||
} else {
|
||||
this.partNr = this.parentNode ? this.parentNode.getPartNr() : [];
|
||||
}
|
||||
}
|
||||
|
||||
getHeaders() {
|
||||
if (!this.headers) {
|
||||
this.parseHeaders();
|
||||
}
|
||||
return this.headers.build();
|
||||
}
|
||||
|
||||
setContentType(contentType) {
|
||||
if (!this.headers) {
|
||||
this.parseHeaders();
|
||||
}
|
||||
|
||||
contentType = (contentType || '').toLowerCase().trim();
|
||||
if (contentType) {
|
||||
this._parsedContentType.value = contentType;
|
||||
}
|
||||
|
||||
if (!this.flowed && this._parsedContentType.params.format) {
|
||||
delete this._parsedContentType.params.format;
|
||||
}
|
||||
|
||||
if (!this.delSp && this._parsedContentType.params.delsp) {
|
||||
delete this._parsedContentType.params.delsp;
|
||||
}
|
||||
|
||||
this.headers.update('Content-Type', this.libmime.buildHeaderValue(this._parsedContentType));
|
||||
}
|
||||
|
||||
setCharset(charset) {
|
||||
if (!this.headers) {
|
||||
this.parseHeaders();
|
||||
}
|
||||
|
||||
charset = (charset || '').toLowerCase().trim();
|
||||
|
||||
if (charset === 'ascii') {
|
||||
charset = '';
|
||||
}
|
||||
|
||||
if (!charset) {
|
||||
if (!this._parsedContentType.value) {
|
||||
// nothing to set or update
|
||||
return;
|
||||
}
|
||||
delete this._parsedContentType.params.charset;
|
||||
} else {
|
||||
this._parsedContentType.params.charset = charset;
|
||||
}
|
||||
|
||||
if (!this._parsedContentType.value) {
|
||||
this._parsedContentType.value = 'text/plain';
|
||||
}
|
||||
|
||||
this.headers.update('Content-Type', this.libmime.buildHeaderValue(this._parsedContentType));
|
||||
}
|
||||
|
||||
setFilename(filename) {
|
||||
if (!this.headers) {
|
||||
this.parseHeaders();
|
||||
}
|
||||
|
||||
this.filename = (filename || '').toLowerCase().trim();
|
||||
|
||||
if (this._parsedContentType.params.name) {
|
||||
delete this._parsedContentType.params.name;
|
||||
this.headers.update('Content-Type', this.libmime.buildHeaderValue(this._parsedContentType));
|
||||
}
|
||||
|
||||
if (!this.filename) {
|
||||
if (!this._parsedContentDisposition.value) {
|
||||
// nothing to set or update
|
||||
return;
|
||||
}
|
||||
delete this._parsedContentDisposition.params.filename;
|
||||
} else {
|
||||
this._parsedContentDisposition.params.filename = this.filename;
|
||||
}
|
||||
|
||||
if (!this._parsedContentDisposition.value) {
|
||||
this._parsedContentDisposition.value = 'attachment';
|
||||
}
|
||||
|
||||
this.headers.update('Content-Disposition', this.libmime.buildHeaderValue(this._parsedContentDisposition));
|
||||
}
|
||||
|
||||
getDecoder() {
|
||||
if (!this.headers) {
|
||||
this.parseHeaders();
|
||||
}
|
||||
|
||||
switch (this.encoding) {
|
||||
case 'base64':
|
||||
return new libbase64.Decoder();
|
||||
case 'quoted-printable':
|
||||
return new libqp.Decoder();
|
||||
default:
|
||||
return new PassThrough();
|
||||
}
|
||||
}
|
||||
|
||||
getEncoder(encoding) {
|
||||
if (!this.headers) {
|
||||
this.parseHeaders();
|
||||
}
|
||||
|
||||
encoding = (encoding || '').toString().toLowerCase().trim();
|
||||
|
||||
if (encoding && encoding !== this.encoding) {
|
||||
this.headers.update('Content-Transfer-Encoding', encoding);
|
||||
} else {
|
||||
encoding = this.encoding;
|
||||
}
|
||||
|
||||
switch (encoding) {
|
||||
case 'base64':
|
||||
return new libbase64.Encoder();
|
||||
case 'quoted-printable':
|
||||
return new libqp.Encoder();
|
||||
default:
|
||||
return new PassThrough();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MimeNode;
|
||||
194
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/node-rewriter.js
generated
vendored
Normal file
194
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/node-rewriter.js
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
'use strict';
|
||||
|
||||
// Helper class to rewrite nodes with specific mime type
|
||||
|
||||
const Transform = require('stream').Transform;
|
||||
const FlowedDecoder = require('./flowed-decoder');
|
||||
|
||||
/**
|
||||
* NodeRewriter Transform stream. Updates content for all nodes with specified mime type
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} mimeType Define the Mime-Type to look for
|
||||
* @param {Function} rewriteAction Function to run with the node content
|
||||
*/
|
||||
class NodeRewriter extends Transform {
|
||||
constructor(filterFunc, rewriteAction) {
|
||||
let options = {
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: true
|
||||
};
|
||||
super(options);
|
||||
|
||||
this.filterFunc = filterFunc;
|
||||
this.rewriteAction = rewriteAction;
|
||||
|
||||
this.decoder = false;
|
||||
this.encoder = false;
|
||||
this.continue = false;
|
||||
}
|
||||
|
||||
_transform(data, encoding, callback) {
|
||||
this.processIncoming(data, callback);
|
||||
}
|
||||
|
||||
_flush(callback) {
|
||||
if (this.decoder) {
|
||||
// emit an empty node just in case there is pending data to end
|
||||
return this.processIncoming(
|
||||
{
|
||||
type: 'none'
|
||||
},
|
||||
callback
|
||||
);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
|
||||
processIncoming(data, callback) {
|
||||
if (this.decoder && data.type === 'body') {
|
||||
// data to parse
|
||||
if (!this.decoder.write(data.value)) {
|
||||
return this.decoder.once('drain', callback);
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
} else if (this.decoder && data.type !== 'body') {
|
||||
// stop decoding.
|
||||
// we can not process the current data chunk as we need to wait until
|
||||
// the parsed data is completely processed, so we store a reference to the
|
||||
// continue callback
|
||||
this.continue = () => {
|
||||
this.continue = false;
|
||||
this.decoder = false;
|
||||
this.encoder = false;
|
||||
this.processIncoming(data, callback);
|
||||
};
|
||||
return this.decoder.end();
|
||||
} else if (data.type === 'node' && this.filterFunc(data)) {
|
||||
// found matching node, create new handler
|
||||
this.emit('node', this.createDecodePair(data));
|
||||
} else if (this.readable && data.type !== 'none') {
|
||||
// we don't care about this data, just pass it over to the joiner
|
||||
this.push(data);
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
createDecodePair(node) {
|
||||
this.decoder = node.getDecoder();
|
||||
|
||||
if (['base64', 'quoted-printable'].includes(node.encoding)) {
|
||||
this.encoder = node.getEncoder();
|
||||
} else {
|
||||
this.encoder = node.getEncoder('quoted-printable');
|
||||
}
|
||||
|
||||
let lastByte = false;
|
||||
|
||||
let decoder = this.decoder;
|
||||
let encoder = this.encoder;
|
||||
let firstChunk = true;
|
||||
decoder.$reading = false;
|
||||
|
||||
let readFromEncoder = () => {
|
||||
decoder.$reading = true;
|
||||
|
||||
let data = encoder.read();
|
||||
if (data === null) {
|
||||
decoder.$reading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (firstChunk) {
|
||||
firstChunk = false;
|
||||
if (this.readable) {
|
||||
this.push(node);
|
||||
if (node.type === 'body') {
|
||||
lastByte = node.value && node.value.length && node.value[node.value.length - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let writeMore = true;
|
||||
if (this.readable) {
|
||||
writeMore = this.push({
|
||||
node,
|
||||
type: 'body',
|
||||
value: data
|
||||
});
|
||||
lastByte = data && data.length && data[data.length - 1];
|
||||
}
|
||||
|
||||
if (writeMore) {
|
||||
return setImmediate(readFromEncoder);
|
||||
} else {
|
||||
encoder.pause();
|
||||
// no idea how to catch drain? use timeout for now as poor man's substitute
|
||||
// this.once('drain', () => encoder.resume());
|
||||
setTimeout(() => {
|
||||
encoder.resume();
|
||||
setImmediate(readFromEncoder);
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
encoder.on('readable', () => {
|
||||
if (!decoder.$reading) {
|
||||
return readFromEncoder();
|
||||
}
|
||||
});
|
||||
|
||||
encoder.on('end', () => {
|
||||
if (firstChunk) {
|
||||
firstChunk = false;
|
||||
if (this.readable) {
|
||||
this.push(node);
|
||||
if (node.type === 'body') {
|
||||
lastByte = node.value && node.value.length && node.value[node.value.length - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lastByte !== 0x0a) {
|
||||
// make sure there is a terminating line break
|
||||
this.push({
|
||||
node,
|
||||
type: 'body',
|
||||
value: Buffer.from([0x0a])
|
||||
});
|
||||
}
|
||||
|
||||
if (this.continue) {
|
||||
return this.continue();
|
||||
}
|
||||
});
|
||||
|
||||
if (/^text\//.test(node.contentType) && node.flowed) {
|
||||
// text/plain; format=flowed is a special case
|
||||
let flowDecoder = decoder;
|
||||
decoder = new FlowedDecoder({
|
||||
delSp: node.delSp,
|
||||
encoding: node.encoding
|
||||
});
|
||||
flowDecoder.on('error', err => {
|
||||
decoder.emit('error', err);
|
||||
});
|
||||
flowDecoder.pipe(decoder);
|
||||
|
||||
// we don't know what kind of data we are going to get, does it comply with the
|
||||
// requirements of format=flowed, so we just cancel it
|
||||
node.flowed = false;
|
||||
node.delSp = false;
|
||||
node.setContentType();
|
||||
}
|
||||
|
||||
return {
|
||||
node,
|
||||
decoder,
|
||||
encoder
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NodeRewriter;
|
||||
121
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/node-streamer.js
generated
vendored
Normal file
121
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/lib/node-streamer.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
'use strict';
|
||||
|
||||
// Helper class to rewrite nodes with specific mime type
|
||||
|
||||
const Transform = require('stream').Transform;
|
||||
const FlowedDecoder = require('./flowed-decoder');
|
||||
|
||||
/**
|
||||
* NodeRewriter Transform stream. Updates content for all nodes with specified mime type
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} mimeType Define the Mime-Type to look for
|
||||
* @param {Function} streamAction Function to run with the node content
|
||||
*/
|
||||
class NodeStreamer extends Transform {
|
||||
constructor(filterFunc, streamAction) {
|
||||
let options = {
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: true
|
||||
};
|
||||
super(options);
|
||||
|
||||
this.filterFunc = filterFunc;
|
||||
this.streamAction = streamAction;
|
||||
|
||||
this.decoder = false;
|
||||
this.canContinue = false;
|
||||
this.continue = false;
|
||||
}
|
||||
|
||||
_transform(data, encoding, callback) {
|
||||
this.processIncoming(data, callback);
|
||||
}
|
||||
|
||||
_flush(callback) {
|
||||
if (this.decoder) {
|
||||
// emit an empty node just in case there is pending data to end
|
||||
return this.processIncoming(
|
||||
{
|
||||
type: 'none'
|
||||
},
|
||||
callback
|
||||
);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
|
||||
processIncoming(data, callback) {
|
||||
if (this.decoder && data.type === 'body') {
|
||||
// data to parse
|
||||
this.push(data);
|
||||
if (!this.decoder.write(data.value)) {
|
||||
return this.decoder.once('drain', callback);
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
} else if (this.decoder && data.type !== 'body') {
|
||||
// stop decoding.
|
||||
// we can not process the current data chunk as we need to wait until
|
||||
// the parsed data is completely processed, so we store a reference to the
|
||||
// continue callback
|
||||
|
||||
let doContinue = () => {
|
||||
this.continue = false;
|
||||
this.decoder = false;
|
||||
this.canContinue = false;
|
||||
this.processIncoming(data, callback);
|
||||
};
|
||||
|
||||
if (this.canContinue) {
|
||||
setImmediate(doContinue);
|
||||
} else {
|
||||
this.continue = () => doContinue();
|
||||
}
|
||||
|
||||
return this.decoder.end();
|
||||
} else if (data.type === 'node' && this.filterFunc(data)) {
|
||||
this.push(data);
|
||||
// found matching node, create new handler
|
||||
this.emit('node', this.createDecoder(data));
|
||||
} else if (this.readable && data.type !== 'none') {
|
||||
// we don't care about this data, just pass it over to the joiner
|
||||
this.push(data);
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
createDecoder(node) {
|
||||
this.decoder = node.getDecoder();
|
||||
|
||||
let decoder = this.decoder;
|
||||
decoder.$reading = false;
|
||||
|
||||
if (/^text\//.test(node.contentType) && node.flowed) {
|
||||
let flowDecoder = decoder;
|
||||
decoder = new FlowedDecoder({
|
||||
delSp: node.delSp
|
||||
});
|
||||
flowDecoder.on('error', err => {
|
||||
decoder.emit('error', err);
|
||||
});
|
||||
flowDecoder.pipe(decoder);
|
||||
}
|
||||
|
||||
return {
|
||||
node,
|
||||
decoder,
|
||||
done: () => {
|
||||
if (typeof this.continue === 'function') {
|
||||
// called once input stream is processed
|
||||
this.continue();
|
||||
} else {
|
||||
// called before input stream is processed
|
||||
this.canContinue = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NodeStreamer;
|
||||
38
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/package.json
generated
vendored
Normal file
38
skills/imap-smtp-email/node_modules/@zone-eu/mailsplit/package.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "@zone-eu/mailsplit",
|
||||
"version": "5.4.8",
|
||||
"description": "Split email messages into an object stream",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt",
|
||||
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
|
||||
},
|
||||
"author": "Andris Reinman",
|
||||
"license": "(MIT OR EUPL-1.1+)",
|
||||
"dependencies": {
|
||||
"libbase64": "1.3.0",
|
||||
"libmime": "5.3.7",
|
||||
"libqp": "2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "8.29.0",
|
||||
"eslint-config-nodemailer": "1.2.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"grunt": "1.6.1",
|
||||
"grunt-cli": "1.5.0",
|
||||
"grunt-contrib-nodeunit": "5.0.0",
|
||||
"grunt-eslint": "24.0.1",
|
||||
"random-message": "1.1.0"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"index.js"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zone-eu/mailsplit.git"
|
||||
}
|
||||
}
|
||||
19
skills/imap-smtp-email/node_modules/core-util-is/LICENSE
generated
vendored
Normal file
19
skills/imap-smtp-email/node_modules/core-util-is/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright Node.js contributors. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
3
skills/imap-smtp-email/node_modules/core-util-is/README.md
generated
vendored
Normal file
3
skills/imap-smtp-email/node_modules/core-util-is/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# core-util-is
|
||||
|
||||
The `util.is*` functions introduced in Node v0.12.
|
||||
107
skills/imap-smtp-email/node_modules/core-util-is/lib/util.js
generated
vendored
Normal file
107
skills/imap-smtp-email/node_modules/core-util-is/lib/util.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
// persons to whom the Software is furnished to do so, subject to the
|
||||
// following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// NOTE: These type checking functions intentionally don't use `instanceof`
|
||||
// because it is fragile and can be easily faked with `Object.create()`.
|
||||
|
||||
function isArray(arg) {
|
||||
if (Array.isArray) {
|
||||
return Array.isArray(arg);
|
||||
}
|
||||
return objectToString(arg) === '[object Array]';
|
||||
}
|
||||
exports.isArray = isArray;
|
||||
|
||||
function isBoolean(arg) {
|
||||
return typeof arg === 'boolean';
|
||||
}
|
||||
exports.isBoolean = isBoolean;
|
||||
|
||||
function isNull(arg) {
|
||||
return arg === null;
|
||||
}
|
||||
exports.isNull = isNull;
|
||||
|
||||
function isNullOrUndefined(arg) {
|
||||
return arg == null;
|
||||
}
|
||||
exports.isNullOrUndefined = isNullOrUndefined;
|
||||
|
||||
function isNumber(arg) {
|
||||
return typeof arg === 'number';
|
||||
}
|
||||
exports.isNumber = isNumber;
|
||||
|
||||
function isString(arg) {
|
||||
return typeof arg === 'string';
|
||||
}
|
||||
exports.isString = isString;
|
||||
|
||||
function isSymbol(arg) {
|
||||
return typeof arg === 'symbol';
|
||||
}
|
||||
exports.isSymbol = isSymbol;
|
||||
|
||||
function isUndefined(arg) {
|
||||
return arg === void 0;
|
||||
}
|
||||
exports.isUndefined = isUndefined;
|
||||
|
||||
function isRegExp(re) {
|
||||
return objectToString(re) === '[object RegExp]';
|
||||
}
|
||||
exports.isRegExp = isRegExp;
|
||||
|
||||
function isObject(arg) {
|
||||
return typeof arg === 'object' && arg !== null;
|
||||
}
|
||||
exports.isObject = isObject;
|
||||
|
||||
function isDate(d) {
|
||||
return objectToString(d) === '[object Date]';
|
||||
}
|
||||
exports.isDate = isDate;
|
||||
|
||||
function isError(e) {
|
||||
return (objectToString(e) === '[object Error]' || e instanceof Error);
|
||||
}
|
||||
exports.isError = isError;
|
||||
|
||||
function isFunction(arg) {
|
||||
return typeof arg === 'function';
|
||||
}
|
||||
exports.isFunction = isFunction;
|
||||
|
||||
function isPrimitive(arg) {
|
||||
return arg === null ||
|
||||
typeof arg === 'boolean' ||
|
||||
typeof arg === 'number' ||
|
||||
typeof arg === 'string' ||
|
||||
typeof arg === 'symbol' || // ES6 symbol
|
||||
typeof arg === 'undefined';
|
||||
}
|
||||
exports.isPrimitive = isPrimitive;
|
||||
|
||||
exports.isBuffer = require('buffer').Buffer.isBuffer;
|
||||
|
||||
function objectToString(o) {
|
||||
return Object.prototype.toString.call(o);
|
||||
}
|
||||
38
skills/imap-smtp-email/node_modules/core-util-is/package.json
generated
vendored
Normal file
38
skills/imap-smtp-email/node_modules/core-util-is/package.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "core-util-is",
|
||||
"version": "1.0.3",
|
||||
"description": "The `util.is*` functions introduced in Node v0.12.",
|
||||
"main": "lib/util.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/core-util-is"
|
||||
},
|
||||
"keywords": [
|
||||
"util",
|
||||
"isBuffer",
|
||||
"isArray",
|
||||
"isNumber",
|
||||
"isString",
|
||||
"isRegExp",
|
||||
"isThis",
|
||||
"isThat",
|
||||
"polyfill"
|
||||
],
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/core-util-is/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test.js",
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "^15.0.9"
|
||||
}
|
||||
}
|
||||
7
skills/imap-smtp-email/node_modules/deepmerge/.editorconfig
generated
vendored
Normal file
7
skills/imap-smtp-email/node_modules/deepmerge/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
1
skills/imap-smtp-email/node_modules/deepmerge/.eslintcache
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/deepmerge/.eslintcache
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"/Users/joshduff/code/deepmerge/test/custom-is-mergeable-object.js":"1"},{"size":1990,"mtime":1679007485753,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ktjd5k","/Users/joshduff/code/deepmerge/test/custom-is-mergeable-object.js",[],[]]
|
||||
167
skills/imap-smtp-email/node_modules/deepmerge/changelog.md
generated
vendored
Normal file
167
skills/imap-smtp-email/node_modules/deepmerge/changelog.md
generated
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
# [4.3.1](https://github.com/TehShrike/deepmerge/releases/tag/v4.3.1)
|
||||
|
||||
- Fix type definition for arrayMerge options. [#239](https://github.com/TehShrike/deepmerge/pull/239)
|
||||
|
||||
# [4.3.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.3.0)
|
||||
|
||||
- Avoid thrown errors if the target doesn't have `propertyIsEnumerable`. [#252](https://github.com/TehShrike/deepmerge/pull/252)
|
||||
|
||||
# [4.2.2](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.2)
|
||||
|
||||
- `isMergeableObject` is now only called if there are two values that could be merged. [a34dd4d2](https://github.com/TehShrike/deepmerge/commit/a34dd4d25bf5e250653540a2022bc832c7b00a19)
|
||||
|
||||
# [4.2.1](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.1)
|
||||
|
||||
- Fix: falsey values can now be merged. [#170](https://github.com/TehShrike/deepmerge/issues/170)
|
||||
|
||||
# [4.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.0)
|
||||
|
||||
- Properties are now only overwritten if they exist on the target object and are enumerable. [#164](https://github.com/TehShrike/deepmerge/pull/164)
|
||||
|
||||
Technically this could probably be a patch release since "which properties get overwritten" wasn't documented and accidentally overwriting a built-in function or some function up the property chain would almost certainly be undesirable, but it feels like a gray area, so here we are with a feature version bump.
|
||||
|
||||
# [4.1.2](https://github.com/TehShrike/deepmerge/releases/tag/v4.1.2)
|
||||
|
||||
- Rolled back #167 since `Object.assign` breaks ES5 support. [55067352](https://github.com/TehShrike/deepmerge/commit/55067352a92c65a6c44a5165f3387720aae1e192)
|
||||
|
||||
# [4.1.1](https://github.com/TehShrike/deepmerge/releases/tag/v4.1.1)
|
||||
|
||||
- The `options` argument is no longer mutated [#167](https://github.com/TehShrike/deepmerge/pull/167)
|
||||
|
||||
# [4.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.1.0)
|
||||
|
||||
- `cloneUnlessOtherwiseSpecified` is now exposed to the `arrayMerge` function [#165](https://github.com/TehShrike/deepmerge/pull/165)
|
||||
|
||||
# [4.0.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.0.0)
|
||||
|
||||
- The `main` entry point in `package.json` is now a CommonJS module instead of a UMD module [#155](https://github.com/TehShrike/deepmerge/pull/155)
|
||||
|
||||
# [3.3.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.3.0)
|
||||
|
||||
- Enumerable Symbol properties are now copied [#151](https://github.com/TehShrike/deepmerge/pull/151)
|
||||
|
||||
# [3.2.1](https://github.com/TehShrike/deepmerge/releases/tag/v3.2.1)
|
||||
|
||||
- bumping dev dependency versions to try to shut up bogus security warnings from Github/npm [#149](https://github.com/TehShrike/deepmerge/pull/149)
|
||||
|
||||
# [3.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.2.0)
|
||||
|
||||
- feature: added the [`customMerge`](https://github.com/TehShrike/deepmerge#custommerge) option [#133](https://github.com/TehShrike/deepmerge/pull/133)
|
||||
|
||||
# [3.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.1.0)
|
||||
|
||||
- typescript typing: make the `all` function generic [#129](https://github.com/TehShrike/deepmerge/pull/129)
|
||||
|
||||
# [3.0.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.0.0)
|
||||
|
||||
- drop ES module build [#123](https://github.com/TehShrike/deepmerge/issues/123)
|
||||
|
||||
# [2.2.1](https://github.com/TehShrike/deepmerge/releases/tag/v2.2.1)
|
||||
|
||||
- bug: typescript export type was wrong [#121](https://github.com/TehShrike/deepmerge/pull/121)
|
||||
|
||||
# [2.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v2.2.0)
|
||||
|
||||
- feature: added TypeScript typings [#119](https://github.com/TehShrike/deepmerge/pull/119)
|
||||
|
||||
# [2.1.1](https://github.com/TehShrike/deepmerge/releases/tag/v2.1.1)
|
||||
|
||||
- documentation: Rename "methods" to "api", note ESM syntax [#103](https://github.com/TehShrike/deepmerge/pull/103)
|
||||
- documentation: Fix grammar [#107](https://github.com/TehShrike/deepmerge/pull/107)
|
||||
- documentation: Restructure headers for clarity + some wording tweaks [108](https://github.com/TehShrike/deepmerge/pull/108) + [109](https://github.com/TehShrike/deepmerge/pull/109)
|
||||
|
||||
|
||||
# [2.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v2.1.0)
|
||||
|
||||
- feature: Support a custom `isMergeableObject` function [#96](https://github.com/TehShrike/deepmerge/pull/96)
|
||||
- documentation: note a Webpack bug that some users might need to work around [#100](https://github.com/TehShrike/deepmerge/pull/100)
|
||||
|
||||
# [2.0.1](https://github.com/TehShrike/deepmerge/releases/tag/v2.0.1)
|
||||
|
||||
- documentation: fix the old array merge algorithm in the readme. [#84](https://github.com/TehShrike/deepmerge/pull/84)
|
||||
|
||||
# [2.0.0](https://github.com/TehShrike/deepmerge/releases/tag/v2.0.0)
|
||||
|
||||
- breaking: the array merge algorithm has changed from a complicated thing to `target.concat(source).map(element => cloneUnlessOtherwiseSpecified(element, optionsArgument))`
|
||||
- breaking: The `clone` option now defaults to `true`
|
||||
- feature: `merge.all` now accepts an array of any size, even 0 or 1 elements
|
||||
|
||||
See [pull request 77](https://github.com/TehShrike/deepmerge/pull/77).
|
||||
|
||||
# [1.5.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.5.2)
|
||||
|
||||
- fix: no longer attempts to merge React elements [#76](https://github.com/TehShrike/deepmerge/issues/76)
|
||||
|
||||
# [1.5.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.5.1)
|
||||
|
||||
- bower support: officially dropping bower support. If you use bower, please depend on the [unpkg distribution](https://unpkg.com/deepmerge/dist/umd.js). See [#63](https://github.com/TehShrike/deepmerge/issues/63)
|
||||
|
||||
# [1.5.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.5.0)
|
||||
|
||||
- bug fix: merging objects into arrays was allowed, and doesn't make any sense. [#65](https://github.com/TehShrike/deepmerge/issues/65) published as a feature release instead of a patch because it is a decent behavior change.
|
||||
|
||||
# [1.4.4](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.4)
|
||||
|
||||
- bower support: updated `main` in bower.json
|
||||
|
||||
# [1.4.3](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.3)
|
||||
|
||||
- bower support: inline is-mergeable-object in a new CommonJS build, so that people using both bower and CommonJS can bundle the library [0b34e6](https://github.com/TehShrike/deepmerge/commit/0b34e6e95f989f2fc8091d25f0d291c08f3d2d24)
|
||||
|
||||
# [1.4.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.2)
|
||||
|
||||
- performance: bump is-mergeable-object dependency version for a slight performance improvement [5906c7](https://github.com/TehShrike/deepmerge/commit/5906c765d691d48e83d76efbb0d4b9ca150dc12c)
|
||||
|
||||
# [1.4.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.1)
|
||||
|
||||
- documentation: fix unpkg link [acc45b](https://github.com/TehShrike/deepmerge/commit/acc45be85519c1df906a72ecb24764b622d18d47)
|
||||
|
||||
# [1.4.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.0)
|
||||
|
||||
- api: instead of only exporting a UMD module, expose a UMD module with `pkg.main`, a CJS module with `pkg.browser`, and an ES module with `pkg.module` [#62](https://github.com/TehShrike/deepmerge/pull/62)
|
||||
|
||||
# [1.3.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.3.2)
|
||||
|
||||
- documentation: note the minified/gzipped file sizes [56](https://github.com/TehShrike/deepmerge/pull/56)
|
||||
- documentation: make data structures more readable in merge example: pull request [57](https://github.com/TehShrike/deepmerge/pull/57)
|
||||
|
||||
# [1.3.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.3.1)
|
||||
|
||||
- documentation: clarify and test some array merging documentation: pull request [51](https://github.com/TehShrike/deepmerge/pull/51)
|
||||
|
||||
# [1.3.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.3.0)
|
||||
|
||||
- feature: `merge.all`, a merge function that merges any number of objects: pull request [50](https://github.com/TehShrike/deepmerge/pull/50)
|
||||
|
||||
# [1.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.2.0)
|
||||
|
||||
- fix: an error that would be thrown when an array would be merged onto a truthy non-array value: pull request [46](https://github.com/TehShrike/deepmerge/pull/46)
|
||||
- feature: the ability to clone: Issue [28](https://github.com/TehShrike/deepmerge/issues/28), pull requests [44](https://github.com/TehShrike/deepmerge/pull/44) and [48](https://github.com/TehShrike/deepmerge/pull/48)
|
||||
- maintenance: added tests + travis to `.npmignore`: pull request [47](https://github.com/TehShrike/deepmerge/pull/47)
|
||||
|
||||
# [1.1.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.1.1)
|
||||
|
||||
- fix an issue where an error was thrown when merging an array onto a non-array: [Pull request 46](https://github.com/TehShrike/deepmerge/pull/46)
|
||||
|
||||
# [1.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.1.0)
|
||||
|
||||
- allow consumers to specify their own array merging algorithm: [Pull request 37](https://github.com/TehShrike/deepmerge/pull/37)
|
||||
|
||||
# [1.0.3](https://github.com/TehShrike/deepmerge/releases/tag/v1.0.3)
|
||||
|
||||
- adding bower.json back: [Issue 38](https://github.com/TehShrike/deepmerge/pull/38)
|
||||
- updating keywords and Github links in package.json [bc3898e](https://github.com/TehShrike/deepmerge/commit/bc3898e587a56f74591328f40f656b0152c1d5eb)
|
||||
|
||||
# [1.0.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.0.2)
|
||||
|
||||
- Updating the readme: dropping bower, testing that the example works: [7102fc](https://github.com/TehShrike/deepmerge/commit/7102fcc4ddec11e2d33205866f9f18df14e5aeb5)
|
||||
|
||||
# [1.0.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.0.1)
|
||||
|
||||
- `null`, dates, and regular expressions are now properly merged in arrays: [Issue 18](https://github.com/TehShrike/deepmerge/pull/18), plus commit: [ef1c6b](https://github.com/TehShrike/deepmerge/commit/ef1c6bac8350ba12a24966f0bc7da02560827586)
|
||||
|
||||
# 1.0.0
|
||||
|
||||
- Should only be a patch change, because this module is READY. [Issue 15](https://github.com/TehShrike/deepmerge/issues/15)
|
||||
- Regular expressions are now treated like primitive values when merging: [Issue 30](https://github.com/TehShrike/deepmerge/pull/30)
|
||||
- Dates are now treated like primitives when merging: [Issue 31](https://github.com/TehShrike/deepmerge/issues/31)
|
||||
133
skills/imap-smtp-email/node_modules/deepmerge/dist/cjs.js
generated
vendored
Normal file
133
skills/imap-smtp-email/node_modules/deepmerge/dist/cjs.js
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
'use strict';
|
||||
|
||||
var isMergeableObject = function isMergeableObject(value) {
|
||||
return isNonNullObject(value)
|
||||
&& !isSpecial(value)
|
||||
};
|
||||
|
||||
function isNonNullObject(value) {
|
||||
return !!value && typeof value === 'object'
|
||||
}
|
||||
|
||||
function isSpecial(value) {
|
||||
var stringValue = Object.prototype.toString.call(value);
|
||||
|
||||
return stringValue === '[object RegExp]'
|
||||
|| stringValue === '[object Date]'
|
||||
|| isReactElement(value)
|
||||
}
|
||||
|
||||
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
||||
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
|
||||
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
|
||||
|
||||
function isReactElement(value) {
|
||||
return value.$$typeof === REACT_ELEMENT_TYPE
|
||||
}
|
||||
|
||||
function emptyTarget(val) {
|
||||
return Array.isArray(val) ? [] : {}
|
||||
}
|
||||
|
||||
function cloneUnlessOtherwiseSpecified(value, options) {
|
||||
return (options.clone !== false && options.isMergeableObject(value))
|
||||
? deepmerge(emptyTarget(value), value, options)
|
||||
: value
|
||||
}
|
||||
|
||||
function defaultArrayMerge(target, source, options) {
|
||||
return target.concat(source).map(function(element) {
|
||||
return cloneUnlessOtherwiseSpecified(element, options)
|
||||
})
|
||||
}
|
||||
|
||||
function getMergeFunction(key, options) {
|
||||
if (!options.customMerge) {
|
||||
return deepmerge
|
||||
}
|
||||
var customMerge = options.customMerge(key);
|
||||
return typeof customMerge === 'function' ? customMerge : deepmerge
|
||||
}
|
||||
|
||||
function getEnumerableOwnPropertySymbols(target) {
|
||||
return Object.getOwnPropertySymbols
|
||||
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
||||
return Object.propertyIsEnumerable.call(target, symbol)
|
||||
})
|
||||
: []
|
||||
}
|
||||
|
||||
function getKeys(target) {
|
||||
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
|
||||
}
|
||||
|
||||
function propertyIsOnObject(object, property) {
|
||||
try {
|
||||
return property in object
|
||||
} catch(_) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
||||
function propertyIsUnsafe(target, key) {
|
||||
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
||||
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
|
||||
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
|
||||
}
|
||||
|
||||
function mergeObject(target, source, options) {
|
||||
var destination = {};
|
||||
if (options.isMergeableObject(target)) {
|
||||
getKeys(target).forEach(function(key) {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
||||
});
|
||||
}
|
||||
getKeys(source).forEach(function(key) {
|
||||
if (propertyIsUnsafe(target, key)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
||||
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
||||
} else {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
||||
}
|
||||
});
|
||||
return destination
|
||||
}
|
||||
|
||||
function deepmerge(target, source, options) {
|
||||
options = options || {};
|
||||
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
||||
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
||||
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
||||
// implementations can use it. The caller may not replace it.
|
||||
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
||||
|
||||
var sourceIsArray = Array.isArray(source);
|
||||
var targetIsArray = Array.isArray(target);
|
||||
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
||||
|
||||
if (!sourceAndTargetTypesMatch) {
|
||||
return cloneUnlessOtherwiseSpecified(source, options)
|
||||
} else if (sourceIsArray) {
|
||||
return options.arrayMerge(target, source, options)
|
||||
} else {
|
||||
return mergeObject(target, source, options)
|
||||
}
|
||||
}
|
||||
|
||||
deepmerge.all = function deepmergeAll(array, options) {
|
||||
if (!Array.isArray(array)) {
|
||||
throw new Error('first argument should be an array')
|
||||
}
|
||||
|
||||
return array.reduce(function(prev, next) {
|
||||
return deepmerge(prev, next, options)
|
||||
}, {})
|
||||
};
|
||||
|
||||
var deepmerge_1 = deepmerge;
|
||||
|
||||
module.exports = deepmerge_1;
|
||||
139
skills/imap-smtp-email/node_modules/deepmerge/dist/umd.js
generated
vendored
Normal file
139
skills/imap-smtp-email/node_modules/deepmerge/dist/umd.js
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.deepmerge = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
var isMergeableObject = function isMergeableObject(value) {
|
||||
return isNonNullObject(value)
|
||||
&& !isSpecial(value)
|
||||
};
|
||||
|
||||
function isNonNullObject(value) {
|
||||
return !!value && typeof value === 'object'
|
||||
}
|
||||
|
||||
function isSpecial(value) {
|
||||
var stringValue = Object.prototype.toString.call(value);
|
||||
|
||||
return stringValue === '[object RegExp]'
|
||||
|| stringValue === '[object Date]'
|
||||
|| isReactElement(value)
|
||||
}
|
||||
|
||||
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
||||
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
|
||||
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
|
||||
|
||||
function isReactElement(value) {
|
||||
return value.$$typeof === REACT_ELEMENT_TYPE
|
||||
}
|
||||
|
||||
function emptyTarget(val) {
|
||||
return Array.isArray(val) ? [] : {}
|
||||
}
|
||||
|
||||
function cloneUnlessOtherwiseSpecified(value, options) {
|
||||
return (options.clone !== false && options.isMergeableObject(value))
|
||||
? deepmerge(emptyTarget(value), value, options)
|
||||
: value
|
||||
}
|
||||
|
||||
function defaultArrayMerge(target, source, options) {
|
||||
return target.concat(source).map(function(element) {
|
||||
return cloneUnlessOtherwiseSpecified(element, options)
|
||||
})
|
||||
}
|
||||
|
||||
function getMergeFunction(key, options) {
|
||||
if (!options.customMerge) {
|
||||
return deepmerge
|
||||
}
|
||||
var customMerge = options.customMerge(key);
|
||||
return typeof customMerge === 'function' ? customMerge : deepmerge
|
||||
}
|
||||
|
||||
function getEnumerableOwnPropertySymbols(target) {
|
||||
return Object.getOwnPropertySymbols
|
||||
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
||||
return Object.propertyIsEnumerable.call(target, symbol)
|
||||
})
|
||||
: []
|
||||
}
|
||||
|
||||
function getKeys(target) {
|
||||
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
|
||||
}
|
||||
|
||||
function propertyIsOnObject(object, property) {
|
||||
try {
|
||||
return property in object
|
||||
} catch(_) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
||||
function propertyIsUnsafe(target, key) {
|
||||
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
||||
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
|
||||
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
|
||||
}
|
||||
|
||||
function mergeObject(target, source, options) {
|
||||
var destination = {};
|
||||
if (options.isMergeableObject(target)) {
|
||||
getKeys(target).forEach(function(key) {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
||||
});
|
||||
}
|
||||
getKeys(source).forEach(function(key) {
|
||||
if (propertyIsUnsafe(target, key)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
||||
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
||||
} else {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
||||
}
|
||||
});
|
||||
return destination
|
||||
}
|
||||
|
||||
function deepmerge(target, source, options) {
|
||||
options = options || {};
|
||||
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
||||
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
||||
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
||||
// implementations can use it. The caller may not replace it.
|
||||
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
||||
|
||||
var sourceIsArray = Array.isArray(source);
|
||||
var targetIsArray = Array.isArray(target);
|
||||
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
||||
|
||||
if (!sourceAndTargetTypesMatch) {
|
||||
return cloneUnlessOtherwiseSpecified(source, options)
|
||||
} else if (sourceIsArray) {
|
||||
return options.arrayMerge(target, source, options)
|
||||
} else {
|
||||
return mergeObject(target, source, options)
|
||||
}
|
||||
}
|
||||
|
||||
deepmerge.all = function deepmergeAll(array, options) {
|
||||
if (!Array.isArray(array)) {
|
||||
throw new Error('first argument should be an array')
|
||||
}
|
||||
|
||||
return array.reduce(function(prev, next) {
|
||||
return deepmerge(prev, next, options)
|
||||
}, {})
|
||||
};
|
||||
|
||||
var deepmerge_1 = deepmerge;
|
||||
|
||||
return deepmerge_1;
|
||||
|
||||
}));
|
||||
20
skills/imap-smtp-email/node_modules/deepmerge/index.d.ts
generated
vendored
Normal file
20
skills/imap-smtp-email/node_modules/deepmerge/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
|
||||
declare function deepmerge<T1, T2>(x: Partial<T1>, y: Partial<T2>, options?: deepmerge.Options): T1 & T2;
|
||||
|
||||
declare namespace deepmerge {
|
||||
export interface Options {
|
||||
arrayMerge?(target: any[], source: any[], options?: ArrayMergeOptions): any[];
|
||||
clone?: boolean;
|
||||
customMerge?: (key: string, options?: Options) => ((x: any, y: any) => any) | undefined;
|
||||
isMergeableObject?(value: object): boolean;
|
||||
}
|
||||
export interface ArrayMergeOptions {
|
||||
isMergeableObject(value: object): boolean;
|
||||
cloneUnlessOtherwiseSpecified(value: object, options?: Options): object;
|
||||
}
|
||||
|
||||
export function all (objects: object[], options?: Options): object;
|
||||
export function all<T> (objects: Partial<T>[], options?: Options): T;
|
||||
}
|
||||
|
||||
export = deepmerge;
|
||||
106
skills/imap-smtp-email/node_modules/deepmerge/index.js
generated
vendored
Normal file
106
skills/imap-smtp-email/node_modules/deepmerge/index.js
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
var defaultIsMergeableObject = require('is-mergeable-object')
|
||||
|
||||
function emptyTarget(val) {
|
||||
return Array.isArray(val) ? [] : {}
|
||||
}
|
||||
|
||||
function cloneUnlessOtherwiseSpecified(value, options) {
|
||||
return (options.clone !== false && options.isMergeableObject(value))
|
||||
? deepmerge(emptyTarget(value), value, options)
|
||||
: value
|
||||
}
|
||||
|
||||
function defaultArrayMerge(target, source, options) {
|
||||
return target.concat(source).map(function(element) {
|
||||
return cloneUnlessOtherwiseSpecified(element, options)
|
||||
})
|
||||
}
|
||||
|
||||
function getMergeFunction(key, options) {
|
||||
if (!options.customMerge) {
|
||||
return deepmerge
|
||||
}
|
||||
var customMerge = options.customMerge(key)
|
||||
return typeof customMerge === 'function' ? customMerge : deepmerge
|
||||
}
|
||||
|
||||
function getEnumerableOwnPropertySymbols(target) {
|
||||
return Object.getOwnPropertySymbols
|
||||
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
||||
return Object.propertyIsEnumerable.call(target, symbol)
|
||||
})
|
||||
: []
|
||||
}
|
||||
|
||||
function getKeys(target) {
|
||||
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
|
||||
}
|
||||
|
||||
function propertyIsOnObject(object, property) {
|
||||
try {
|
||||
return property in object
|
||||
} catch(_) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
||||
function propertyIsUnsafe(target, key) {
|
||||
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
||||
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
|
||||
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
|
||||
}
|
||||
|
||||
function mergeObject(target, source, options) {
|
||||
var destination = {}
|
||||
if (options.isMergeableObject(target)) {
|
||||
getKeys(target).forEach(function(key) {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options)
|
||||
})
|
||||
}
|
||||
getKeys(source).forEach(function(key) {
|
||||
if (propertyIsUnsafe(target, key)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
||||
destination[key] = getMergeFunction(key, options)(target[key], source[key], options)
|
||||
} else {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options)
|
||||
}
|
||||
})
|
||||
return destination
|
||||
}
|
||||
|
||||
function deepmerge(target, source, options) {
|
||||
options = options || {}
|
||||
options.arrayMerge = options.arrayMerge || defaultArrayMerge
|
||||
options.isMergeableObject = options.isMergeableObject || defaultIsMergeableObject
|
||||
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
||||
// implementations can use it. The caller may not replace it.
|
||||
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified
|
||||
|
||||
var sourceIsArray = Array.isArray(source)
|
||||
var targetIsArray = Array.isArray(target)
|
||||
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray
|
||||
|
||||
if (!sourceAndTargetTypesMatch) {
|
||||
return cloneUnlessOtherwiseSpecified(source, options)
|
||||
} else if (sourceIsArray) {
|
||||
return options.arrayMerge(target, source, options)
|
||||
} else {
|
||||
return mergeObject(target, source, options)
|
||||
}
|
||||
}
|
||||
|
||||
deepmerge.all = function deepmergeAll(array, options) {
|
||||
if (!Array.isArray(array)) {
|
||||
throw new Error('first argument should be an array')
|
||||
}
|
||||
|
||||
return array.reduce(function(prev, next) {
|
||||
return deepmerge(prev, next, options)
|
||||
}, {})
|
||||
}
|
||||
|
||||
module.exports = deepmerge
|
||||
21
skills/imap-smtp-email/node_modules/deepmerge/license.txt
generated
vendored
Normal file
21
skills/imap-smtp-email/node_modules/deepmerge/license.txt
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012 James Halliday, Josh Duff, and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
42
skills/imap-smtp-email/node_modules/deepmerge/package.json
generated
vendored
Normal file
42
skills/imap-smtp-email/node_modules/deepmerge/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "deepmerge",
|
||||
"description": "A library for deep (recursive) merging of Javascript objects",
|
||||
"keywords": [
|
||||
"merge",
|
||||
"deep",
|
||||
"extend",
|
||||
"copy",
|
||||
"clone",
|
||||
"recursive"
|
||||
],
|
||||
"version": "4.3.1",
|
||||
"homepage": "https://github.com/TehShrike/deepmerge",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/TehShrike/deepmerge.git"
|
||||
},
|
||||
"main": "dist/cjs.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"test": "npm run build && tape test/*.js && jsmd readme.md && npm run test:typescript",
|
||||
"test:typescript": "tsc --noEmit test/typescript.ts && ts-node test/typescript.ts",
|
||||
"size": "npm run build && uglifyjs --compress --mangle -- ./dist/umd.js | gzip -c | wc -c"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.10.54",
|
||||
"is-mergeable-object": "1.1.0",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"jsmd": "^1.0.2",
|
||||
"rollup": "^1.23.1",
|
||||
"rollup-plugin-commonjs": "^10.1.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"tape": "^4.11.0",
|
||||
"ts-node": "7.0.1",
|
||||
"typescript": "=2.2.2",
|
||||
"uglify-js": "^3.6.1"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
264
skills/imap-smtp-email/node_modules/deepmerge/readme.md
generated
vendored
Normal file
264
skills/imap-smtp-email/node_modules/deepmerge/readme.md
generated
vendored
Normal file
@@ -0,0 +1,264 @@
|
||||
# deepmerge
|
||||
|
||||
Merges the enumerable properties of two or more objects deeply.
|
||||
|
||||
> UMD bundle is 723B minified+gzipped
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Example Usage
|
||||
<!--js
|
||||
const merge = require('./')
|
||||
-->
|
||||
|
||||
```js
|
||||
const x = {
|
||||
foo: { bar: 3 },
|
||||
array: [{
|
||||
does: 'work',
|
||||
too: [ 1, 2, 3 ]
|
||||
}]
|
||||
}
|
||||
|
||||
const y = {
|
||||
foo: { baz: 4 },
|
||||
quux: 5,
|
||||
array: [{
|
||||
does: 'work',
|
||||
too: [ 4, 5, 6 ]
|
||||
}, {
|
||||
really: 'yes'
|
||||
}]
|
||||
}
|
||||
|
||||
const output = {
|
||||
foo: {
|
||||
bar: 3,
|
||||
baz: 4
|
||||
},
|
||||
array: [{
|
||||
does: 'work',
|
||||
too: [ 1, 2, 3 ]
|
||||
}, {
|
||||
does: 'work',
|
||||
too: [ 4, 5, 6 ]
|
||||
}, {
|
||||
really: 'yes'
|
||||
}],
|
||||
quux: 5
|
||||
}
|
||||
|
||||
merge(x, y) // => output
|
||||
```
|
||||
|
||||
|
||||
### Installation
|
||||
|
||||
With [npm](http://npmjs.org) do:
|
||||
|
||||
```sh
|
||||
npm install deepmerge
|
||||
```
|
||||
|
||||
deepmerge can be used directly in the browser without the use of package managers/bundlers as well: [UMD version from unpkg.com](https://unpkg.com/deepmerge/dist/umd.js).
|
||||
|
||||
|
||||
### Include
|
||||
|
||||
deepmerge exposes a CommonJS entry point:
|
||||
|
||||
```
|
||||
const merge = require('deepmerge')
|
||||
```
|
||||
|
||||
The ESM entry point was dropped due to a [Webpack bug](https://github.com/webpack/webpack/issues/6584).
|
||||
|
||||
# API
|
||||
|
||||
|
||||
## `merge(x, y, [options])`
|
||||
|
||||
Merge two objects `x` and `y` deeply, returning a new merged object with the
|
||||
elements from both `x` and `y`.
|
||||
|
||||
If an element at the same key is present for both `x` and `y`, the value from
|
||||
`y` will appear in the result.
|
||||
|
||||
Merging creates a new object, so that neither `x` or `y` is modified.
|
||||
|
||||
**Note:** By default, arrays are merged by concatenating them.
|
||||
|
||||
## `merge.all(arrayOfObjects, [options])`
|
||||
|
||||
Merges any number of objects into a single result object.
|
||||
|
||||
```js
|
||||
const foobar = { foo: { bar: 3 } }
|
||||
const foobaz = { foo: { baz: 4 } }
|
||||
const bar = { bar: 'yay!' }
|
||||
|
||||
merge.all([ foobar, foobaz, bar ]) // => { foo: { bar: 3, baz: 4 }, bar: 'yay!' }
|
||||
```
|
||||
|
||||
|
||||
## Options
|
||||
|
||||
### `arrayMerge`
|
||||
|
||||
There are multiple ways to merge two arrays, below are a few examples but you can also create your own custom function.
|
||||
|
||||
Your `arrayMerge` function will be called with three arguments: a `target` array, the `source` array, and an `options` object with these properties:
|
||||
|
||||
- `isMergeableObject(value)`
|
||||
- `cloneUnlessOtherwiseSpecified(value, options)`
|
||||
|
||||
#### `arrayMerge` example: overwrite target array
|
||||
|
||||
Overwrites the existing array values completely rather than concatenating them:
|
||||
|
||||
```js
|
||||
const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray
|
||||
|
||||
merge(
|
||||
[1, 2, 3],
|
||||
[3, 2, 1],
|
||||
{ arrayMerge: overwriteMerge }
|
||||
) // => [3, 2, 1]
|
||||
```
|
||||
|
||||
#### `arrayMerge` example: combine arrays
|
||||
|
||||
Combines objects at the same index in the two arrays.
|
||||
|
||||
This was the default array merging algorithm pre-version-2.0.0.
|
||||
|
||||
```js
|
||||
const combineMerge = (target, source, options) => {
|
||||
const destination = target.slice()
|
||||
|
||||
source.forEach((item, index) => {
|
||||
if (typeof destination[index] === 'undefined') {
|
||||
destination[index] = options.cloneUnlessOtherwiseSpecified(item, options)
|
||||
} else if (options.isMergeableObject(item)) {
|
||||
destination[index] = merge(target[index], item, options)
|
||||
} else if (target.indexOf(item) === -1) {
|
||||
destination.push(item)
|
||||
}
|
||||
})
|
||||
return destination
|
||||
}
|
||||
|
||||
merge(
|
||||
[{ a: true }],
|
||||
[{ b: true }, 'ah yup'],
|
||||
{ arrayMerge: combineMerge }
|
||||
) // => [{ a: true, b: true }, 'ah yup']
|
||||
```
|
||||
|
||||
### `isMergeableObject`
|
||||
|
||||
By default, deepmerge clones every property from almost every kind of object.
|
||||
|
||||
You may not want this, if your objects are of special types, and you want to copy the whole object instead of just copying its properties.
|
||||
|
||||
You can accomplish this by passing in a function for the `isMergeableObject` option.
|
||||
|
||||
If you only want to clone properties of plain objects, and ignore all "special" kinds of instantiated objects, you probably want to drop in [`is-plain-object`](https://github.com/jonschlinkert/is-plain-object).
|
||||
|
||||
```js
|
||||
const { isPlainObject } = require('is-plain-object')
|
||||
|
||||
function SuperSpecial() {
|
||||
this.special = 'oh yeah man totally'
|
||||
}
|
||||
|
||||
const instantiatedSpecialObject = new SuperSpecial()
|
||||
|
||||
const target = {
|
||||
someProperty: {
|
||||
cool: 'oh for sure'
|
||||
}
|
||||
}
|
||||
|
||||
const source = {
|
||||
someProperty: instantiatedSpecialObject
|
||||
}
|
||||
|
||||
const defaultOutput = merge(target, source)
|
||||
|
||||
defaultOutput.someProperty.cool // => 'oh for sure'
|
||||
defaultOutput.someProperty.special // => 'oh yeah man totally'
|
||||
defaultOutput.someProperty instanceof SuperSpecial // => false
|
||||
|
||||
const customMergeOutput = merge(target, source, {
|
||||
isMergeableObject: isPlainObject
|
||||
})
|
||||
|
||||
customMergeOutput.someProperty.cool // => undefined
|
||||
customMergeOutput.someProperty.special // => 'oh yeah man totally'
|
||||
customMergeOutput.someProperty instanceof SuperSpecial // => true
|
||||
```
|
||||
|
||||
### `customMerge`
|
||||
|
||||
Specifies a function which can be used to override the default merge behavior for a property, based on the property name.
|
||||
|
||||
The `customMerge` function will be passed the key for each property, and should return the function which should be used to merge the values for that property.
|
||||
|
||||
It may also return undefined, in which case the default merge behaviour will be used.
|
||||
|
||||
```js
|
||||
const alex = {
|
||||
name: {
|
||||
first: 'Alex',
|
||||
last: 'Alexson'
|
||||
},
|
||||
pets: ['Cat', 'Parrot']
|
||||
}
|
||||
|
||||
const tony = {
|
||||
name: {
|
||||
first: 'Tony',
|
||||
last: 'Tonison'
|
||||
},
|
||||
pets: ['Dog']
|
||||
}
|
||||
|
||||
const mergeNames = (nameA, nameB) => `${nameA.first} and ${nameB.first}`
|
||||
|
||||
const options = {
|
||||
customMerge: (key) => {
|
||||
if (key === 'name') {
|
||||
return mergeNames
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const result = merge(alex, tony, options)
|
||||
|
||||
result.name // => 'Alex and Tony'
|
||||
result.pets // => ['Cat', 'Parrot', 'Dog']
|
||||
```
|
||||
|
||||
|
||||
### `clone`
|
||||
|
||||
*Deprecated.*
|
||||
|
||||
Defaults to `true`.
|
||||
|
||||
If `clone` is `false` then child objects will be copied directly instead of being cloned. This was the default behavior before version 2.x.
|
||||
|
||||
|
||||
# Testing
|
||||
|
||||
With [npm](http://npmjs.org) do:
|
||||
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
|
||||
# License
|
||||
|
||||
MIT
|
||||
22
skills/imap-smtp-email/node_modules/deepmerge/rollup.config.js
generated
vendored
Normal file
22
skills/imap-smtp-email/node_modules/deepmerge/rollup.config.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import resolve from 'rollup-plugin-node-resolve'
|
||||
import commonjs from 'rollup-plugin-commonjs'
|
||||
import pkg from './package.json'
|
||||
|
||||
export default {
|
||||
input: `index.js`,
|
||||
plugins: [
|
||||
commonjs(),
|
||||
resolve(),
|
||||
],
|
||||
output: [
|
||||
{
|
||||
file: pkg.main,
|
||||
format: `cjs`
|
||||
},
|
||||
{
|
||||
name: 'deepmerge',
|
||||
file: 'dist/umd.js',
|
||||
format: `umd`
|
||||
},
|
||||
],
|
||||
}
|
||||
11
skills/imap-smtp-email/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
11
skills/imap-smtp-email/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 The cheeriojs contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
109
skills/imap-smtp-email/node_modules/dom-serializer/README.md
generated
vendored
Normal file
109
skills/imap-smtp-email/node_modules/dom-serializer/README.md
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
# dom-serializer [](https://travis-ci.com/cheeriojs/dom-serializer)
|
||||
|
||||
Renders a [domhandler](https://github.com/fb55/domhandler) DOM node or an array of domhandler DOM nodes to a string.
|
||||
|
||||
```js
|
||||
import render from "dom-serializer";
|
||||
|
||||
// OR
|
||||
|
||||
const render = require("dom-serializer").default;
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
## `render`
|
||||
|
||||
▸ **render**(`node`: Node \| Node[], `options?`: [_Options_](#Options)): _string_
|
||||
|
||||
Renders a DOM node or an array of DOM nodes to a string.
|
||||
|
||||
Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
|
||||
#### Parameters:
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :-------- | :--------------------------------- | :------------ | :----------------------------- |
|
||||
| `node` | Node \| Node[] | - | Node to be rendered. |
|
||||
| `options` | [_DomSerializerOptions_](#Options) | {} | Changes serialization behavior |
|
||||
|
||||
**Returns:** _string_
|
||||
|
||||
## Options
|
||||
|
||||
### `encodeEntities`
|
||||
|
||||
• `Optional` **decodeEntities**: _boolean | "utf8"_
|
||||
|
||||
Encode characters that are either reserved in HTML or XML.
|
||||
|
||||
If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
|
||||
|
||||
**`default`** `decodeEntities`
|
||||
|
||||
---
|
||||
|
||||
### `decodeEntities`
|
||||
|
||||
• `Optional` **decodeEntities**: _boolean_
|
||||
|
||||
Option inherited from parsing; will be used as the default value for `encodeEntities`.
|
||||
|
||||
**`default`** true
|
||||
|
||||
---
|
||||
|
||||
### `emptyAttrs`
|
||||
|
||||
• `Optional` **emptyAttrs**: _boolean_
|
||||
|
||||
Print an empty attribute's value.
|
||||
|
||||
**`default`** xmlMode
|
||||
|
||||
**`example`** With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
|
||||
**`example`** With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
|
||||
---
|
||||
|
||||
### `selfClosingTags`
|
||||
|
||||
• `Optional` **selfClosingTags**: _boolean_
|
||||
|
||||
Print self-closing tags for tags without contents.
|
||||
|
||||
**`default`** xmlMode
|
||||
|
||||
**`example`** With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
|
||||
**`example`** With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
|
||||
---
|
||||
|
||||
### `xmlMode`
|
||||
|
||||
• `Optional` **xmlMode**: _boolean_ \| _"foreign"_
|
||||
|
||||
Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
|
||||
If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
|
||||
**`default`** false
|
||||
|
||||
---
|
||||
|
||||
## Ecosystem
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------------------------------------------- | ------------------------------------------------------- |
|
||||
| [htmlparser2](https://github.com/fb55/htmlparser2) | Fast & forgiving HTML/XML parser |
|
||||
| [domhandler](https://github.com/fb55/domhandler) | Handler for htmlparser2 that turns documents into a DOM |
|
||||
| [domutils](https://github.com/fb55/domutils) | Utilities for working with domhandler's DOM |
|
||||
| [css-select](https://github.com/fb55/css-select) | CSS selector engine, compatible with domhandler's DOM |
|
||||
| [cheerio](https://github.com/cheeriojs/cheerio) | The jQuery API for domhandler's DOM |
|
||||
| [dom-serializer](https://github.com/cheeriojs/dom-serializer) | Serializer for domhandler's DOM |
|
||||
|
||||
---
|
||||
|
||||
LICENSE: MIT
|
||||
3
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/foreignNames.d.ts
generated
vendored
Normal file
3
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/foreignNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const elementNames: Map<string, string>;
|
||||
export declare const attributeNames: Map<string, string>;
|
||||
//# sourceMappingURL=foreignNames.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAwCxB,CAAC;AACF,eAAO,MAAM,cAAc,qBA8D1B,CAAC"}
|
||||
100
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/foreignNames.js
generated
vendored
Normal file
100
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/foreignNames.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
export const elementNames = new Map([
|
||||
"altGlyph",
|
||||
"altGlyphDef",
|
||||
"altGlyphItem",
|
||||
"animateColor",
|
||||
"animateMotion",
|
||||
"animateTransform",
|
||||
"clipPath",
|
||||
"feBlend",
|
||||
"feColorMatrix",
|
||||
"feComponentTransfer",
|
||||
"feComposite",
|
||||
"feConvolveMatrix",
|
||||
"feDiffuseLighting",
|
||||
"feDisplacementMap",
|
||||
"feDistantLight",
|
||||
"feDropShadow",
|
||||
"feFlood",
|
||||
"feFuncA",
|
||||
"feFuncB",
|
||||
"feFuncG",
|
||||
"feFuncR",
|
||||
"feGaussianBlur",
|
||||
"feImage",
|
||||
"feMerge",
|
||||
"feMergeNode",
|
||||
"feMorphology",
|
||||
"feOffset",
|
||||
"fePointLight",
|
||||
"feSpecularLighting",
|
||||
"feSpotLight",
|
||||
"feTile",
|
||||
"feTurbulence",
|
||||
"foreignObject",
|
||||
"glyphRef",
|
||||
"linearGradient",
|
||||
"radialGradient",
|
||||
"textPath",
|
||||
].map((val) => [val.toLowerCase(), val]));
|
||||
export const attributeNames = new Map([
|
||||
"definitionURL",
|
||||
"attributeName",
|
||||
"attributeType",
|
||||
"baseFrequency",
|
||||
"baseProfile",
|
||||
"calcMode",
|
||||
"clipPathUnits",
|
||||
"diffuseConstant",
|
||||
"edgeMode",
|
||||
"filterUnits",
|
||||
"glyphRef",
|
||||
"gradientTransform",
|
||||
"gradientUnits",
|
||||
"kernelMatrix",
|
||||
"kernelUnitLength",
|
||||
"keyPoints",
|
||||
"keySplines",
|
||||
"keyTimes",
|
||||
"lengthAdjust",
|
||||
"limitingConeAngle",
|
||||
"markerHeight",
|
||||
"markerUnits",
|
||||
"markerWidth",
|
||||
"maskContentUnits",
|
||||
"maskUnits",
|
||||
"numOctaves",
|
||||
"pathLength",
|
||||
"patternContentUnits",
|
||||
"patternTransform",
|
||||
"patternUnits",
|
||||
"pointsAtX",
|
||||
"pointsAtY",
|
||||
"pointsAtZ",
|
||||
"preserveAlpha",
|
||||
"preserveAspectRatio",
|
||||
"primitiveUnits",
|
||||
"refX",
|
||||
"refY",
|
||||
"repeatCount",
|
||||
"repeatDur",
|
||||
"requiredExtensions",
|
||||
"requiredFeatures",
|
||||
"specularConstant",
|
||||
"specularExponent",
|
||||
"spreadMethod",
|
||||
"startOffset",
|
||||
"stdDeviation",
|
||||
"stitchTiles",
|
||||
"surfaceScale",
|
||||
"systemLanguage",
|
||||
"tableValues",
|
||||
"targetX",
|
||||
"targetY",
|
||||
"textLength",
|
||||
"viewBox",
|
||||
"viewTarget",
|
||||
"xChannelSelector",
|
||||
"yChannelSelector",
|
||||
"zoomAndPan",
|
||||
].map((val) => [val.toLowerCase(), val]));
|
||||
52
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/index.d.ts
generated
vendored
Normal file
52
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import type { AnyNode } from "domhandler";
|
||||
export interface DomSerializerOptions {
|
||||
/**
|
||||
* Print an empty attribute's value.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
*/
|
||||
emptyAttrs?: boolean;
|
||||
/**
|
||||
* Print self-closing tags for tags without contents.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
* @example With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
*
|
||||
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean | "foreign";
|
||||
/**
|
||||
* Encode characters that are either reserved in HTML or XML.
|
||||
*
|
||||
* If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
|
||||
*
|
||||
* @default `decodeEntities`
|
||||
*/
|
||||
encodeEntities?: boolean | "utf8";
|
||||
/**
|
||||
* Option inherited from parsing; will be used as the default value for `encodeEntities`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
decodeEntities?: boolean;
|
||||
}
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export declare function render(node: AnyNode | ArrayLike<AnyNode>, options?: DomSerializerOptions): string;
|
||||
export default render;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/index.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA4ED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,EAClC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR;AAED,eAAe,MAAM,CAAC"}
|
||||
190
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/index.js
generated
vendored
Normal file
190
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Module dependencies
|
||||
*/
|
||||
import * as ElementType from "domelementtype";
|
||||
import { encodeXML, escapeAttribute, escapeText } from "entities";
|
||||
/**
|
||||
* Mixed-case SVG and MathML tags & attributes
|
||||
* recognized by the HTML parser.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
||||
*/
|
||||
import { elementNames, attributeNames } from "./foreignNames.js";
|
||||
const unencodedElements = new Set([
|
||||
"style",
|
||||
"script",
|
||||
"xmp",
|
||||
"iframe",
|
||||
"noembed",
|
||||
"noframes",
|
||||
"plaintext",
|
||||
"noscript",
|
||||
]);
|
||||
function replaceQuotes(value) {
|
||||
return value.replace(/"/g, """);
|
||||
}
|
||||
/**
|
||||
* Format attributes
|
||||
*/
|
||||
function formatAttributes(attributes, opts) {
|
||||
var _a;
|
||||
if (!attributes)
|
||||
return;
|
||||
const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false
|
||||
? replaceQuotes
|
||||
: opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? encodeXML
|
||||
: escapeAttribute;
|
||||
return Object.keys(attributes)
|
||||
.map((key) => {
|
||||
var _a, _b;
|
||||
const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case attribute names */
|
||||
key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
||||
}
|
||||
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
||||
return key;
|
||||
}
|
||||
return `${key}="${encode(value)}"`;
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
/**
|
||||
* Self-enclosing tags
|
||||
*/
|
||||
const singleTag = new Set([
|
||||
"area",
|
||||
"base",
|
||||
"basefont",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"frame",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"isindex",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr",
|
||||
]);
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export function render(node, options = {}) {
|
||||
const nodes = "length" in node ? node : [node];
|
||||
let output = "";
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
output += renderNode(nodes[i], options);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
export default render;
|
||||
function renderNode(node, options) {
|
||||
switch (node.type) {
|
||||
case ElementType.Root:
|
||||
return render(node.children, options);
|
||||
// @ts-expect-error We don't use `Doctype` yet
|
||||
case ElementType.Doctype:
|
||||
case ElementType.Directive:
|
||||
return renderDirective(node);
|
||||
case ElementType.Comment:
|
||||
return renderComment(node);
|
||||
case ElementType.CDATA:
|
||||
return renderCdata(node);
|
||||
case ElementType.Script:
|
||||
case ElementType.Style:
|
||||
case ElementType.Tag:
|
||||
return renderTag(node, options);
|
||||
case ElementType.Text:
|
||||
return renderText(node, options);
|
||||
}
|
||||
}
|
||||
const foreignModeIntegrationPoints = new Set([
|
||||
"mi",
|
||||
"mo",
|
||||
"mn",
|
||||
"ms",
|
||||
"mtext",
|
||||
"annotation-xml",
|
||||
"foreignObject",
|
||||
"desc",
|
||||
"title",
|
||||
]);
|
||||
const foreignElements = new Set(["svg", "math"]);
|
||||
function renderTag(elem, opts) {
|
||||
var _a;
|
||||
// Handle SVG / MathML in HTML
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case element names */
|
||||
elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
|
||||
/* Exit foreign mode at integration points */
|
||||
if (elem.parent &&
|
||||
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
||||
opts = { ...opts, xmlMode: false };
|
||||
}
|
||||
}
|
||||
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
||||
opts = { ...opts, xmlMode: "foreign" };
|
||||
}
|
||||
let tag = `<${elem.name}`;
|
||||
const attribs = formatAttributes(elem.attribs, opts);
|
||||
if (attribs) {
|
||||
tag += ` ${attribs}`;
|
||||
}
|
||||
if (elem.children.length === 0 &&
|
||||
(opts.xmlMode
|
||||
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
||||
opts.selfClosingTags !== false
|
||||
: // User explicitly asked for self-closing tags, even in HTML mode
|
||||
opts.selfClosingTags && singleTag.has(elem.name))) {
|
||||
if (!opts.xmlMode)
|
||||
tag += " ";
|
||||
tag += "/>";
|
||||
}
|
||||
else {
|
||||
tag += ">";
|
||||
if (elem.children.length > 0) {
|
||||
tag += render(elem.children, opts);
|
||||
}
|
||||
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
||||
tag += `</${elem.name}>`;
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
function renderDirective(elem) {
|
||||
return `<${elem.data}>`;
|
||||
}
|
||||
function renderText(elem, opts) {
|
||||
var _a;
|
||||
let data = elem.data || "";
|
||||
// If entities weren't decoded, no need to encode them back
|
||||
if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&
|
||||
!(!opts.xmlMode &&
|
||||
elem.parent &&
|
||||
unencodedElements.has(elem.parent.name))) {
|
||||
data =
|
||||
opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? encodeXML(data)
|
||||
: escapeText(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function renderCdata(elem) {
|
||||
return `<![CDATA[${elem.children[0].data}]]>`;
|
||||
}
|
||||
function renderComment(elem) {
|
||||
return `<!--${elem.data}-->`;
|
||||
}
|
||||
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/package.json
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/esm/package.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"type":"module"}
|
||||
3
skills/imap-smtp-email/node_modules/dom-serializer/lib/foreignNames.d.ts
generated
vendored
Normal file
3
skills/imap-smtp-email/node_modules/dom-serializer/lib/foreignNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const elementNames: Map<string, string>;
|
||||
export declare const attributeNames: Map<string, string>;
|
||||
//# sourceMappingURL=foreignNames.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/foreignNames.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/foreignNames.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAwCxB,CAAC;AACF,eAAO,MAAM,cAAc,qBA8D1B,CAAC"}
|
||||
103
skills/imap-smtp-email/node_modules/dom-serializer/lib/foreignNames.js
generated
vendored
Normal file
103
skills/imap-smtp-email/node_modules/dom-serializer/lib/foreignNames.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.attributeNames = exports.elementNames = void 0;
|
||||
exports.elementNames = new Map([
|
||||
"altGlyph",
|
||||
"altGlyphDef",
|
||||
"altGlyphItem",
|
||||
"animateColor",
|
||||
"animateMotion",
|
||||
"animateTransform",
|
||||
"clipPath",
|
||||
"feBlend",
|
||||
"feColorMatrix",
|
||||
"feComponentTransfer",
|
||||
"feComposite",
|
||||
"feConvolveMatrix",
|
||||
"feDiffuseLighting",
|
||||
"feDisplacementMap",
|
||||
"feDistantLight",
|
||||
"feDropShadow",
|
||||
"feFlood",
|
||||
"feFuncA",
|
||||
"feFuncB",
|
||||
"feFuncG",
|
||||
"feFuncR",
|
||||
"feGaussianBlur",
|
||||
"feImage",
|
||||
"feMerge",
|
||||
"feMergeNode",
|
||||
"feMorphology",
|
||||
"feOffset",
|
||||
"fePointLight",
|
||||
"feSpecularLighting",
|
||||
"feSpotLight",
|
||||
"feTile",
|
||||
"feTurbulence",
|
||||
"foreignObject",
|
||||
"glyphRef",
|
||||
"linearGradient",
|
||||
"radialGradient",
|
||||
"textPath",
|
||||
].map(function (val) { return [val.toLowerCase(), val]; }));
|
||||
exports.attributeNames = new Map([
|
||||
"definitionURL",
|
||||
"attributeName",
|
||||
"attributeType",
|
||||
"baseFrequency",
|
||||
"baseProfile",
|
||||
"calcMode",
|
||||
"clipPathUnits",
|
||||
"diffuseConstant",
|
||||
"edgeMode",
|
||||
"filterUnits",
|
||||
"glyphRef",
|
||||
"gradientTransform",
|
||||
"gradientUnits",
|
||||
"kernelMatrix",
|
||||
"kernelUnitLength",
|
||||
"keyPoints",
|
||||
"keySplines",
|
||||
"keyTimes",
|
||||
"lengthAdjust",
|
||||
"limitingConeAngle",
|
||||
"markerHeight",
|
||||
"markerUnits",
|
||||
"markerWidth",
|
||||
"maskContentUnits",
|
||||
"maskUnits",
|
||||
"numOctaves",
|
||||
"pathLength",
|
||||
"patternContentUnits",
|
||||
"patternTransform",
|
||||
"patternUnits",
|
||||
"pointsAtX",
|
||||
"pointsAtY",
|
||||
"pointsAtZ",
|
||||
"preserveAlpha",
|
||||
"preserveAspectRatio",
|
||||
"primitiveUnits",
|
||||
"refX",
|
||||
"refY",
|
||||
"repeatCount",
|
||||
"repeatDur",
|
||||
"requiredExtensions",
|
||||
"requiredFeatures",
|
||||
"specularConstant",
|
||||
"specularExponent",
|
||||
"spreadMethod",
|
||||
"startOffset",
|
||||
"stdDeviation",
|
||||
"stitchTiles",
|
||||
"surfaceScale",
|
||||
"systemLanguage",
|
||||
"tableValues",
|
||||
"targetX",
|
||||
"targetY",
|
||||
"textLength",
|
||||
"viewBox",
|
||||
"viewTarget",
|
||||
"xChannelSelector",
|
||||
"yChannelSelector",
|
||||
"zoomAndPan",
|
||||
].map(function (val) { return [val.toLowerCase(), val]; }));
|
||||
52
skills/imap-smtp-email/node_modules/dom-serializer/lib/index.d.ts
generated
vendored
Normal file
52
skills/imap-smtp-email/node_modules/dom-serializer/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import type { AnyNode } from "domhandler";
|
||||
export interface DomSerializerOptions {
|
||||
/**
|
||||
* Print an empty attribute's value.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
*/
|
||||
emptyAttrs?: boolean;
|
||||
/**
|
||||
* Print self-closing tags for tags without contents.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
* @example With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
*
|
||||
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean | "foreign";
|
||||
/**
|
||||
* Encode characters that are either reserved in HTML or XML.
|
||||
*
|
||||
* If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
|
||||
*
|
||||
* @default `decodeEntities`
|
||||
*/
|
||||
encodeEntities?: boolean | "utf8";
|
||||
/**
|
||||
* Option inherited from parsing; will be used as the default value for `encodeEntities`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
decodeEntities?: boolean;
|
||||
}
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export declare function render(node: AnyNode | ArrayLike<AnyNode>, options?: DomSerializerOptions): string;
|
||||
export default render;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/index.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/dom-serializer/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA4ED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,EAClC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR;AAED,eAAe,MAAM,CAAC"}
|
||||
229
skills/imap-smtp-email/node_modules/dom-serializer/lib/index.js
generated
vendored
Normal file
229
skills/imap-smtp-email/node_modules/dom-serializer/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,229 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.render = void 0;
|
||||
/*
|
||||
* Module dependencies
|
||||
*/
|
||||
var ElementType = __importStar(require("domelementtype"));
|
||||
var entities_1 = require("entities");
|
||||
/**
|
||||
* Mixed-case SVG and MathML tags & attributes
|
||||
* recognized by the HTML parser.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
||||
*/
|
||||
var foreignNames_js_1 = require("./foreignNames.js");
|
||||
var unencodedElements = new Set([
|
||||
"style",
|
||||
"script",
|
||||
"xmp",
|
||||
"iframe",
|
||||
"noembed",
|
||||
"noframes",
|
||||
"plaintext",
|
||||
"noscript",
|
||||
]);
|
||||
function replaceQuotes(value) {
|
||||
return value.replace(/"/g, """);
|
||||
}
|
||||
/**
|
||||
* Format attributes
|
||||
*/
|
||||
function formatAttributes(attributes, opts) {
|
||||
var _a;
|
||||
if (!attributes)
|
||||
return;
|
||||
var encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false
|
||||
? replaceQuotes
|
||||
: opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? entities_1.encodeXML
|
||||
: entities_1.escapeAttribute;
|
||||
return Object.keys(attributes)
|
||||
.map(function (key) {
|
||||
var _a, _b;
|
||||
var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case attribute names */
|
||||
key = (_b = foreignNames_js_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
||||
}
|
||||
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
||||
return key;
|
||||
}
|
||||
return "".concat(key, "=\"").concat(encode(value), "\"");
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
/**
|
||||
* Self-enclosing tags
|
||||
*/
|
||||
var singleTag = new Set([
|
||||
"area",
|
||||
"base",
|
||||
"basefont",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"frame",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"isindex",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr",
|
||||
]);
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
function render(node, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var nodes = "length" in node ? node : [node];
|
||||
var output = "";
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
output += renderNode(nodes[i], options);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
exports.render = render;
|
||||
exports.default = render;
|
||||
function renderNode(node, options) {
|
||||
switch (node.type) {
|
||||
case ElementType.Root:
|
||||
return render(node.children, options);
|
||||
// @ts-expect-error We don't use `Doctype` yet
|
||||
case ElementType.Doctype:
|
||||
case ElementType.Directive:
|
||||
return renderDirective(node);
|
||||
case ElementType.Comment:
|
||||
return renderComment(node);
|
||||
case ElementType.CDATA:
|
||||
return renderCdata(node);
|
||||
case ElementType.Script:
|
||||
case ElementType.Style:
|
||||
case ElementType.Tag:
|
||||
return renderTag(node, options);
|
||||
case ElementType.Text:
|
||||
return renderText(node, options);
|
||||
}
|
||||
}
|
||||
var foreignModeIntegrationPoints = new Set([
|
||||
"mi",
|
||||
"mo",
|
||||
"mn",
|
||||
"ms",
|
||||
"mtext",
|
||||
"annotation-xml",
|
||||
"foreignObject",
|
||||
"desc",
|
||||
"title",
|
||||
]);
|
||||
var foreignElements = new Set(["svg", "math"]);
|
||||
function renderTag(elem, opts) {
|
||||
var _a;
|
||||
// Handle SVG / MathML in HTML
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case element names */
|
||||
elem.name = (_a = foreignNames_js_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
|
||||
/* Exit foreign mode at integration points */
|
||||
if (elem.parent &&
|
||||
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
||||
opts = __assign(__assign({}, opts), { xmlMode: false });
|
||||
}
|
||||
}
|
||||
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
||||
opts = __assign(__assign({}, opts), { xmlMode: "foreign" });
|
||||
}
|
||||
var tag = "<".concat(elem.name);
|
||||
var attribs = formatAttributes(elem.attribs, opts);
|
||||
if (attribs) {
|
||||
tag += " ".concat(attribs);
|
||||
}
|
||||
if (elem.children.length === 0 &&
|
||||
(opts.xmlMode
|
||||
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
||||
opts.selfClosingTags !== false
|
||||
: // User explicitly asked for self-closing tags, even in HTML mode
|
||||
opts.selfClosingTags && singleTag.has(elem.name))) {
|
||||
if (!opts.xmlMode)
|
||||
tag += " ";
|
||||
tag += "/>";
|
||||
}
|
||||
else {
|
||||
tag += ">";
|
||||
if (elem.children.length > 0) {
|
||||
tag += render(elem.children, opts);
|
||||
}
|
||||
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
||||
tag += "</".concat(elem.name, ">");
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
function renderDirective(elem) {
|
||||
return "<".concat(elem.data, ">");
|
||||
}
|
||||
function renderText(elem, opts) {
|
||||
var _a;
|
||||
var data = elem.data || "";
|
||||
// If entities weren't decoded, no need to encode them back
|
||||
if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&
|
||||
!(!opts.xmlMode &&
|
||||
elem.parent &&
|
||||
unencodedElements.has(elem.parent.name))) {
|
||||
data =
|
||||
opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? (0, entities_1.encodeXML)(data)
|
||||
: (0, entities_1.escapeText)(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function renderCdata(elem) {
|
||||
return "<![CDATA[".concat(elem.children[0].data, "]]>");
|
||||
}
|
||||
function renderComment(elem) {
|
||||
return "<!--".concat(elem.data, "-->");
|
||||
}
|
||||
69
skills/imap-smtp-email/node_modules/dom-serializer/package.json
generated
vendored
Normal file
69
skills/imap-smtp-email/node_modules/dom-serializer/package.json
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "dom-serializer",
|
||||
"version": "2.0.0",
|
||||
"description": "render domhandler DOM nodes to a string",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"html",
|
||||
"xml",
|
||||
"render"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/cheeriojs/dom-serializer.git"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"module": "lib/esm/index.js",
|
||||
"exports": {
|
||||
"require": "./lib/index.js",
|
||||
"import": "./lib/esm/index.js"
|
||||
},
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.2",
|
||||
"entities": "^4.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^17.0.23",
|
||||
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
||||
"@typescript-eslint/parser": "^5.18.0",
|
||||
"cheerio": "^1.0.0-rc.9",
|
||||
"eslint": "^8.12.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"htmlparser2": "^7.2.0",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.6.2",
|
||||
"ts-jest": "^27.1.4",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run test:jest && npm run lint",
|
||||
"test:jest": "jest",
|
||||
"lint": "npm run lint:es && npm run lint:prettier",
|
||||
"lint:es": "eslint --ignore-path .gitignore .",
|
||||
"lint:prettier": "npm run prettier -- --check",
|
||||
"format": "npm run format:es && npm run format:prettier",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:prettier": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.{ts,md,json,yml}\" --ignore-path .gitignore",
|
||||
"build": "npm run build:cjs && npm run build:esm",
|
||||
"build:cjs": "tsc",
|
||||
"build:esm": "tsc --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node",
|
||||
"moduleNameMapper": {
|
||||
"^(.*)\\.js$": "$1"
|
||||
}
|
||||
},
|
||||
"funding": "https://github.com/cheeriojs/dom-serializer?sponsor=1",
|
||||
"license": "MIT"
|
||||
}
|
||||
11
skills/imap-smtp-email/node_modules/domelementtype/LICENSE
generated
vendored
Normal file
11
skills/imap-smtp-email/node_modules/domelementtype/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
48
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/index.d.ts
generated
vendored
Normal file
48
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/** Types of elements found in htmlparser2's DOM */
|
||||
export declare enum ElementType {
|
||||
/** Type for the root element of a document */
|
||||
Root = "root",
|
||||
/** Type for Text */
|
||||
Text = "text",
|
||||
/** Type for <? ... ?> */
|
||||
Directive = "directive",
|
||||
/** Type for <!-- ... --> */
|
||||
Comment = "comment",
|
||||
/** Type for <script> tags */
|
||||
Script = "script",
|
||||
/** Type for <style> tags */
|
||||
Style = "style",
|
||||
/** Type for Any tag */
|
||||
Tag = "tag",
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
CDATA = "cdata",
|
||||
/** Type for <!doctype ...> */
|
||||
Doctype = "doctype"
|
||||
}
|
||||
/**
|
||||
* Tests whether an element is a tag or not.
|
||||
*
|
||||
* @param elem Element to test
|
||||
*/
|
||||
export declare function isTag(elem: {
|
||||
type: ElementType;
|
||||
}): boolean;
|
||||
/** Type for the root element of a document */
|
||||
export declare const Root = ElementType.Root;
|
||||
/** Type for Text */
|
||||
export declare const Text = ElementType.Text;
|
||||
/** Type for <? ... ?> */
|
||||
export declare const Directive = ElementType.Directive;
|
||||
/** Type for <!-- ... --> */
|
||||
export declare const Comment = ElementType.Comment;
|
||||
/** Type for <script> tags */
|
||||
export declare const Script = ElementType.Script;
|
||||
/** Type for <style> tags */
|
||||
export declare const Style = ElementType.Style;
|
||||
/** Type for Any tag */
|
||||
export declare const Tag = ElementType.Tag;
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
export declare const CDATA = ElementType.CDATA;
|
||||
/** Type for <!doctype ...> */
|
||||
export declare const Doctype = ElementType.Doctype;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/index.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,oBAAY,WAAW;IACnB,8CAA8C;IAC9C,IAAI,SAAS;IACb,oBAAoB;IACpB,IAAI,SAAS;IACb,yBAAyB;IACzB,SAAS,cAAc;IACvB,4BAA4B;IAC5B,OAAO,YAAY;IACnB,6BAA6B;IAC7B,MAAM,WAAW;IACjB,4BAA4B;IAC5B,KAAK,UAAU;IACf,uBAAuB;IACvB,GAAG,QAAQ;IACX,iCAAiC;IACjC,KAAK,UAAU;IACf,8BAA8B;IAC9B,OAAO,YAAY;CACtB;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAM1D;AAGD,8CAA8C;AAC9C,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,oBAAoB;AACpB,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,yBAAyB;AACzB,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAC/C,4BAA4B;AAC5B,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,6BAA6B;AAC7B,eAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,4BAA4B;AAC5B,eAAO,MAAM,KAAK,oBAAoB,CAAC;AACvC,uBAAuB;AACvB,eAAO,MAAM,GAAG,kBAAkB,CAAC;AACnC,iCAAiC;AACjC,eAAO,MAAM,KAAK,oBAAoB,CAAC;AACvC,8BAA8B;AAC9B,eAAO,MAAM,OAAO,sBAAsB,CAAC"}
|
||||
51
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/index.js
generated
vendored
Normal file
51
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
/** Types of elements found in htmlparser2's DOM */
|
||||
export var ElementType;
|
||||
(function (ElementType) {
|
||||
/** Type for the root element of a document */
|
||||
ElementType["Root"] = "root";
|
||||
/** Type for Text */
|
||||
ElementType["Text"] = "text";
|
||||
/** Type for <? ... ?> */
|
||||
ElementType["Directive"] = "directive";
|
||||
/** Type for <!-- ... --> */
|
||||
ElementType["Comment"] = "comment";
|
||||
/** Type for <script> tags */
|
||||
ElementType["Script"] = "script";
|
||||
/** Type for <style> tags */
|
||||
ElementType["Style"] = "style";
|
||||
/** Type for Any tag */
|
||||
ElementType["Tag"] = "tag";
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
ElementType["CDATA"] = "cdata";
|
||||
/** Type for <!doctype ...> */
|
||||
ElementType["Doctype"] = "doctype";
|
||||
})(ElementType || (ElementType = {}));
|
||||
/**
|
||||
* Tests whether an element is a tag or not.
|
||||
*
|
||||
* @param elem Element to test
|
||||
*/
|
||||
export function isTag(elem) {
|
||||
return (elem.type === ElementType.Tag ||
|
||||
elem.type === ElementType.Script ||
|
||||
elem.type === ElementType.Style);
|
||||
}
|
||||
// Exports for backwards compatibility
|
||||
/** Type for the root element of a document */
|
||||
export const Root = ElementType.Root;
|
||||
/** Type for Text */
|
||||
export const Text = ElementType.Text;
|
||||
/** Type for <? ... ?> */
|
||||
export const Directive = ElementType.Directive;
|
||||
/** Type for <!-- ... --> */
|
||||
export const Comment = ElementType.Comment;
|
||||
/** Type for <script> tags */
|
||||
export const Script = ElementType.Script;
|
||||
/** Type for <style> tags */
|
||||
export const Style = ElementType.Style;
|
||||
/** Type for Any tag */
|
||||
export const Tag = ElementType.Tag;
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
export const CDATA = ElementType.CDATA;
|
||||
/** Type for <!doctype ...> */
|
||||
export const Doctype = ElementType.Doctype;
|
||||
1
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/package.json
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domelementtype/lib/esm/package.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"type":"module"}
|
||||
48
skills/imap-smtp-email/node_modules/domelementtype/lib/index.d.ts
generated
vendored
Normal file
48
skills/imap-smtp-email/node_modules/domelementtype/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/** Types of elements found in htmlparser2's DOM */
|
||||
export declare enum ElementType {
|
||||
/** Type for the root element of a document */
|
||||
Root = "root",
|
||||
/** Type for Text */
|
||||
Text = "text",
|
||||
/** Type for <? ... ?> */
|
||||
Directive = "directive",
|
||||
/** Type for <!-- ... --> */
|
||||
Comment = "comment",
|
||||
/** Type for <script> tags */
|
||||
Script = "script",
|
||||
/** Type for <style> tags */
|
||||
Style = "style",
|
||||
/** Type for Any tag */
|
||||
Tag = "tag",
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
CDATA = "cdata",
|
||||
/** Type for <!doctype ...> */
|
||||
Doctype = "doctype"
|
||||
}
|
||||
/**
|
||||
* Tests whether an element is a tag or not.
|
||||
*
|
||||
* @param elem Element to test
|
||||
*/
|
||||
export declare function isTag(elem: {
|
||||
type: ElementType;
|
||||
}): boolean;
|
||||
/** Type for the root element of a document */
|
||||
export declare const Root = ElementType.Root;
|
||||
/** Type for Text */
|
||||
export declare const Text = ElementType.Text;
|
||||
/** Type for <? ... ?> */
|
||||
export declare const Directive = ElementType.Directive;
|
||||
/** Type for <!-- ... --> */
|
||||
export declare const Comment = ElementType.Comment;
|
||||
/** Type for <script> tags */
|
||||
export declare const Script = ElementType.Script;
|
||||
/** Type for <style> tags */
|
||||
export declare const Style = ElementType.Style;
|
||||
/** Type for Any tag */
|
||||
export declare const Tag = ElementType.Tag;
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
export declare const CDATA = ElementType.CDATA;
|
||||
/** Type for <!doctype ...> */
|
||||
export declare const Doctype = ElementType.Doctype;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domelementtype/lib/index.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domelementtype/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,oBAAY,WAAW;IACnB,8CAA8C;IAC9C,IAAI,SAAS;IACb,oBAAoB;IACpB,IAAI,SAAS;IACb,yBAAyB;IACzB,SAAS,cAAc;IACvB,4BAA4B;IAC5B,OAAO,YAAY;IACnB,6BAA6B;IAC7B,MAAM,WAAW;IACjB,4BAA4B;IAC5B,KAAK,UAAU;IACf,uBAAuB;IACvB,GAAG,QAAQ;IACX,iCAAiC;IACjC,KAAK,UAAU;IACf,8BAA8B;IAC9B,OAAO,YAAY;CACtB;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAM1D;AAGD,8CAA8C;AAC9C,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,oBAAoB;AACpB,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,yBAAyB;AACzB,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAC/C,4BAA4B;AAC5B,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,6BAA6B;AAC7B,eAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,4BAA4B;AAC5B,eAAO,MAAM,KAAK,oBAAoB,CAAC;AACvC,uBAAuB;AACvB,eAAO,MAAM,GAAG,kBAAkB,CAAC;AACnC,iCAAiC;AACjC,eAAO,MAAM,KAAK,oBAAoB,CAAC;AACvC,8BAA8B;AAC9B,eAAO,MAAM,OAAO,sBAAsB,CAAC"}
|
||||
55
skills/imap-smtp-email/node_modules/domelementtype/lib/index.js
generated
vendored
Normal file
55
skills/imap-smtp-email/node_modules/domelementtype/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
||||
/** Types of elements found in htmlparser2's DOM */
|
||||
var ElementType;
|
||||
(function (ElementType) {
|
||||
/** Type for the root element of a document */
|
||||
ElementType["Root"] = "root";
|
||||
/** Type for Text */
|
||||
ElementType["Text"] = "text";
|
||||
/** Type for <? ... ?> */
|
||||
ElementType["Directive"] = "directive";
|
||||
/** Type for <!-- ... --> */
|
||||
ElementType["Comment"] = "comment";
|
||||
/** Type for <script> tags */
|
||||
ElementType["Script"] = "script";
|
||||
/** Type for <style> tags */
|
||||
ElementType["Style"] = "style";
|
||||
/** Type for Any tag */
|
||||
ElementType["Tag"] = "tag";
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
ElementType["CDATA"] = "cdata";
|
||||
/** Type for <!doctype ...> */
|
||||
ElementType["Doctype"] = "doctype";
|
||||
})(ElementType = exports.ElementType || (exports.ElementType = {}));
|
||||
/**
|
||||
* Tests whether an element is a tag or not.
|
||||
*
|
||||
* @param elem Element to test
|
||||
*/
|
||||
function isTag(elem) {
|
||||
return (elem.type === ElementType.Tag ||
|
||||
elem.type === ElementType.Script ||
|
||||
elem.type === ElementType.Style);
|
||||
}
|
||||
exports.isTag = isTag;
|
||||
// Exports for backwards compatibility
|
||||
/** Type for the root element of a document */
|
||||
exports.Root = ElementType.Root;
|
||||
/** Type for Text */
|
||||
exports.Text = ElementType.Text;
|
||||
/** Type for <? ... ?> */
|
||||
exports.Directive = ElementType.Directive;
|
||||
/** Type for <!-- ... --> */
|
||||
exports.Comment = ElementType.Comment;
|
||||
/** Type for <script> tags */
|
||||
exports.Script = ElementType.Script;
|
||||
/** Type for <style> tags */
|
||||
exports.Style = ElementType.Style;
|
||||
/** Type for Any tag */
|
||||
exports.Tag = ElementType.Tag;
|
||||
/** Type for <![CDATA[ ... ]]> */
|
||||
exports.CDATA = ElementType.CDATA;
|
||||
/** Type for <!doctype ...> */
|
||||
exports.Doctype = ElementType.Doctype;
|
||||
54
skills/imap-smtp-email/node_modules/domelementtype/package.json
generated
vendored
Normal file
54
skills/imap-smtp-email/node_modules/domelementtype/package.json
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "domelementtype",
|
||||
"version": "2.3.0",
|
||||
"description": "all the types of nodes in htmlparser2's dom",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"license": "BSD-2-Clause",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/fb55"
|
||||
}
|
||||
],
|
||||
"sideEffects": false,
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"module": "lib/esm/index.js",
|
||||
"exports": {
|
||||
"require": "./lib/index.js",
|
||||
"import": "./lib/esm/index.js"
|
||||
},
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/domelementtype.git"
|
||||
},
|
||||
"keywords": [
|
||||
"dom",
|
||||
"element",
|
||||
"types",
|
||||
"htmlparser2"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run lint && prettier --check **/*.{ts,json,md}",
|
||||
"lint": "eslint src",
|
||||
"format": "prettier --write **/*.{ts,json,md}",
|
||||
"build": "npm run build:cjs && npm run build:esm",
|
||||
"build:cjs": "tsc",
|
||||
"build:esm": "tsc --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 4
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
||||
"@typescript-eslint/parser": "^5.18.0",
|
||||
"eslint": "^8.12.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"prettier": "^2.6.2",
|
||||
"typescript": "^4.6.3"
|
||||
}
|
||||
}
|
||||
1
skills/imap-smtp-email/node_modules/domelementtype/readme.md
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domelementtype/readme.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
All the types of nodes in htmlparser2's DOM.
|
||||
11
skills/imap-smtp-email/node_modules/domhandler/LICENSE
generated
vendored
Normal file
11
skills/imap-smtp-email/node_modules/domhandler/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
76
skills/imap-smtp-email/node_modules/domhandler/lib/esm/index.d.ts
generated
vendored
Normal file
76
skills/imap-smtp-email/node_modules/domhandler/lib/esm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import { ChildNode, Element, DataNode, Document, ParentNode } from "./node.js";
|
||||
export * from "./node.js";
|
||||
export interface DomHandlerOptions {
|
||||
/**
|
||||
* Add a `startIndex` property to nodes.
|
||||
* When the parser is used in a non-streaming fashion, `startIndex` is an integer
|
||||
* indicating the position of the start of the node in the document.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
withStartIndices?: boolean;
|
||||
/**
|
||||
* Add an `endIndex` property to nodes.
|
||||
* When the parser is used in a non-streaming fashion, `endIndex` is an integer
|
||||
* indicating the position of the end of the node in the document.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
withEndIndices?: boolean;
|
||||
/**
|
||||
* Treat the markup as XML.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean;
|
||||
}
|
||||
interface ParserInterface {
|
||||
startIndex: number | null;
|
||||
endIndex: number | null;
|
||||
}
|
||||
declare type Callback = (error: Error | null, dom: ChildNode[]) => void;
|
||||
declare type ElementCallback = (element: Element) => void;
|
||||
export declare class DomHandler {
|
||||
/** The elements of the DOM */
|
||||
dom: ChildNode[];
|
||||
/** The root element for the DOM */
|
||||
root: Document;
|
||||
/** Called once parsing has completed. */
|
||||
private readonly callback;
|
||||
/** Settings for the handler. */
|
||||
private readonly options;
|
||||
/** Callback whenever a tag is closed. */
|
||||
private readonly elementCB;
|
||||
/** Indicated whether parsing has been completed. */
|
||||
private done;
|
||||
/** Stack of open tags. */
|
||||
protected tagStack: ParentNode[];
|
||||
/** A data node that is still being written to. */
|
||||
protected lastNode: DataNode | null;
|
||||
/** Reference to the parser instance. Used for location information. */
|
||||
private parser;
|
||||
/**
|
||||
* @param callback Called once parsing has completed.
|
||||
* @param options Settings for the handler.
|
||||
* @param elementCB Callback whenever a tag is closed.
|
||||
*/
|
||||
constructor(callback?: Callback | null, options?: DomHandlerOptions | null, elementCB?: ElementCallback);
|
||||
onparserinit(parser: ParserInterface): void;
|
||||
onreset(): void;
|
||||
onend(): void;
|
||||
onerror(error: Error): void;
|
||||
onclosetag(): void;
|
||||
onopentag(name: string, attribs: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
ontext(data: string): void;
|
||||
oncomment(data: string): void;
|
||||
oncommentend(): void;
|
||||
oncdatastart(): void;
|
||||
oncdataend(): void;
|
||||
onprocessinginstruction(name: string, data: string): void;
|
||||
protected handleCallback(error: Error | null): void;
|
||||
protected addNode(node: ChildNode): void;
|
||||
}
|
||||
export default DomHandler;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domhandler/lib/esm/index.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domhandler/lib/esm/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,SAAS,EACT,OAAO,EACP,QAAQ,EAIR,QAAQ,EAER,UAAU,EACb,MAAM,WAAW,CAAC;AAEnB,cAAc,WAAW,CAAC;AAE1B,MAAM,WAAW,iBAAiB;IAC9B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AASD,UAAU,eAAe;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,aAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;AAChE,aAAK,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAElD,qBAAa,UAAU;IACnB,8BAA8B;IACvB,GAAG,EAAE,SAAS,EAAE,CAAM;IAE7B,mCAAmC;IAC5B,IAAI,WAA0B;IAErC,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAE5C,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAEnD,oDAAoD;IACpD,OAAO,CAAC,IAAI,CAAS;IAErB,0BAA0B;IAC1B,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAe;IAE/C,kDAAkD;IAClD,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE3C,uEAAuE;IACvE,OAAO,CAAC,MAAM,CAAgC;IAE9C;;;;OAIG;gBAEC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,EAClC,SAAS,CAAC,EAAE,eAAe;IAiBxB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAK3C,OAAO,IAAI,IAAI;IAUf,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI3B,UAAU,IAAI,IAAI;IAYlB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAOjE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAe1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAW7B,YAAY,IAAI,IAAI;IAIpB,YAAY,IAAI,IAAI;IAUpB,UAAU,IAAI,IAAI;IAIlB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAKhE,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI;IAQnD,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;CAwB3C;AAED,eAAe,UAAU,CAAC"}
|
||||
146
skills/imap-smtp-email/node_modules/domhandler/lib/esm/index.js
generated
vendored
Normal file
146
skills/imap-smtp-email/node_modules/domhandler/lib/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
import { ElementType } from "domelementtype";
|
||||
import { Element, Text, Comment, CDATA, Document, ProcessingInstruction, } from "./node.js";
|
||||
export * from "./node.js";
|
||||
// Default options
|
||||
const defaultOpts = {
|
||||
withStartIndices: false,
|
||||
withEndIndices: false,
|
||||
xmlMode: false,
|
||||
};
|
||||
export class DomHandler {
|
||||
/**
|
||||
* @param callback Called once parsing has completed.
|
||||
* @param options Settings for the handler.
|
||||
* @param elementCB Callback whenever a tag is closed.
|
||||
*/
|
||||
constructor(callback, options, elementCB) {
|
||||
/** The elements of the DOM */
|
||||
this.dom = [];
|
||||
/** The root element for the DOM */
|
||||
this.root = new Document(this.dom);
|
||||
/** Indicated whether parsing has been completed. */
|
||||
this.done = false;
|
||||
/** Stack of open tags. */
|
||||
this.tagStack = [this.root];
|
||||
/** A data node that is still being written to. */
|
||||
this.lastNode = null;
|
||||
/** Reference to the parser instance. Used for location information. */
|
||||
this.parser = null;
|
||||
// Make it possible to skip arguments, for backwards-compatibility
|
||||
if (typeof options === "function") {
|
||||
elementCB = options;
|
||||
options = defaultOpts;
|
||||
}
|
||||
if (typeof callback === "object") {
|
||||
options = callback;
|
||||
callback = undefined;
|
||||
}
|
||||
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
||||
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
||||
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
||||
}
|
||||
onparserinit(parser) {
|
||||
this.parser = parser;
|
||||
}
|
||||
// Resets the handler back to starting state
|
||||
onreset() {
|
||||
this.dom = [];
|
||||
this.root = new Document(this.dom);
|
||||
this.done = false;
|
||||
this.tagStack = [this.root];
|
||||
this.lastNode = null;
|
||||
this.parser = null;
|
||||
}
|
||||
// Signals the handler that parsing is done
|
||||
onend() {
|
||||
if (this.done)
|
||||
return;
|
||||
this.done = true;
|
||||
this.parser = null;
|
||||
this.handleCallback(null);
|
||||
}
|
||||
onerror(error) {
|
||||
this.handleCallback(error);
|
||||
}
|
||||
onclosetag() {
|
||||
this.lastNode = null;
|
||||
const elem = this.tagStack.pop();
|
||||
if (this.options.withEndIndices) {
|
||||
elem.endIndex = this.parser.endIndex;
|
||||
}
|
||||
if (this.elementCB)
|
||||
this.elementCB(elem);
|
||||
}
|
||||
onopentag(name, attribs) {
|
||||
const type = this.options.xmlMode ? ElementType.Tag : undefined;
|
||||
const element = new Element(name, attribs, undefined, type);
|
||||
this.addNode(element);
|
||||
this.tagStack.push(element);
|
||||
}
|
||||
ontext(data) {
|
||||
const { lastNode } = this;
|
||||
if (lastNode && lastNode.type === ElementType.Text) {
|
||||
lastNode.data += data;
|
||||
if (this.options.withEndIndices) {
|
||||
lastNode.endIndex = this.parser.endIndex;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const node = new Text(data);
|
||||
this.addNode(node);
|
||||
this.lastNode = node;
|
||||
}
|
||||
}
|
||||
oncomment(data) {
|
||||
if (this.lastNode && this.lastNode.type === ElementType.Comment) {
|
||||
this.lastNode.data += data;
|
||||
return;
|
||||
}
|
||||
const node = new Comment(data);
|
||||
this.addNode(node);
|
||||
this.lastNode = node;
|
||||
}
|
||||
oncommentend() {
|
||||
this.lastNode = null;
|
||||
}
|
||||
oncdatastart() {
|
||||
const text = new Text("");
|
||||
const node = new CDATA([text]);
|
||||
this.addNode(node);
|
||||
text.parent = node;
|
||||
this.lastNode = text;
|
||||
}
|
||||
oncdataend() {
|
||||
this.lastNode = null;
|
||||
}
|
||||
onprocessinginstruction(name, data) {
|
||||
const node = new ProcessingInstruction(name, data);
|
||||
this.addNode(node);
|
||||
}
|
||||
handleCallback(error) {
|
||||
if (typeof this.callback === "function") {
|
||||
this.callback(error, this.dom);
|
||||
}
|
||||
else if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
addNode(node) {
|
||||
const parent = this.tagStack[this.tagStack.length - 1];
|
||||
const previousSibling = parent.children[parent.children.length - 1];
|
||||
if (this.options.withStartIndices) {
|
||||
node.startIndex = this.parser.startIndex;
|
||||
}
|
||||
if (this.options.withEndIndices) {
|
||||
node.endIndex = this.parser.endIndex;
|
||||
}
|
||||
parent.children.push(node);
|
||||
if (previousSibling) {
|
||||
node.prev = previousSibling;
|
||||
previousSibling.next = node;
|
||||
}
|
||||
node.parent = parent;
|
||||
this.lastNode = null;
|
||||
}
|
||||
}
|
||||
export default DomHandler;
|
||||
245
skills/imap-smtp-email/node_modules/domhandler/lib/esm/node.d.ts
generated
vendored
Normal file
245
skills/imap-smtp-email/node_modules/domhandler/lib/esm/node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
import { ElementType } from "domelementtype";
|
||||
interface SourceCodeLocation {
|
||||
/** One-based line index of the first character. */
|
||||
startLine: number;
|
||||
/** One-based column index of the first character. */
|
||||
startCol: number;
|
||||
/** Zero-based first character index. */
|
||||
startOffset: number;
|
||||
/** One-based line index of the last character. */
|
||||
endLine: number;
|
||||
/** One-based column index of the last character. Points directly *after* the last character. */
|
||||
endCol: number;
|
||||
/** Zero-based last character index. Points directly *after* the last character. */
|
||||
endOffset: number;
|
||||
}
|
||||
interface TagSourceCodeLocation extends SourceCodeLocation {
|
||||
startTag?: SourceCodeLocation;
|
||||
endTag?: SourceCodeLocation;
|
||||
}
|
||||
export declare type ParentNode = Document | Element | CDATA;
|
||||
export declare type ChildNode = Text | Comment | ProcessingInstruction | Element | CDATA | Document;
|
||||
export declare type AnyNode = ParentNode | ChildNode;
|
||||
/**
|
||||
* This object will be used as the prototype for Nodes when creating a
|
||||
* DOM-Level-1-compliant structure.
|
||||
*/
|
||||
export declare abstract class Node {
|
||||
/** The type of the node. */
|
||||
abstract readonly type: ElementType;
|
||||
/** Parent of the node */
|
||||
parent: ParentNode | null;
|
||||
/** Previous sibling */
|
||||
prev: ChildNode | null;
|
||||
/** Next sibling */
|
||||
next: ChildNode | null;
|
||||
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
||||
startIndex: number | null;
|
||||
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
||||
endIndex: number | null;
|
||||
/**
|
||||
* `parse5` source code location info.
|
||||
*
|
||||
* Available if parsing with parse5 and location info is enabled.
|
||||
*/
|
||||
sourceCodeLocation?: SourceCodeLocation | null;
|
||||
/**
|
||||
* [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
|
||||
* node {@link type}.
|
||||
*/
|
||||
abstract readonly nodeType: number;
|
||||
/**
|
||||
* Same as {@link parent}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get parentNode(): ParentNode | null;
|
||||
set parentNode(parent: ParentNode | null);
|
||||
/**
|
||||
* Same as {@link prev}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get previousSibling(): ChildNode | null;
|
||||
set previousSibling(prev: ChildNode | null);
|
||||
/**
|
||||
* Same as {@link next}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nextSibling(): ChildNode | null;
|
||||
set nextSibling(next: ChildNode | null);
|
||||
/**
|
||||
* Clone this node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
cloneNode<T extends Node>(this: T, recursive?: boolean): T;
|
||||
}
|
||||
/**
|
||||
* A node that contains some data.
|
||||
*/
|
||||
export declare abstract class DataNode extends Node {
|
||||
data: string;
|
||||
/**
|
||||
* @param data The content of the data node
|
||||
*/
|
||||
constructor(data: string);
|
||||
/**
|
||||
* Same as {@link data}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nodeValue(): string;
|
||||
set nodeValue(data: string);
|
||||
}
|
||||
/**
|
||||
* Text within the document.
|
||||
*/
|
||||
export declare class Text extends DataNode {
|
||||
type: ElementType.Text;
|
||||
get nodeType(): 3;
|
||||
}
|
||||
/**
|
||||
* Comments within the document.
|
||||
*/
|
||||
export declare class Comment extends DataNode {
|
||||
type: ElementType.Comment;
|
||||
get nodeType(): 8;
|
||||
}
|
||||
/**
|
||||
* Processing instructions, including doc types.
|
||||
*/
|
||||
export declare class ProcessingInstruction extends DataNode {
|
||||
name: string;
|
||||
type: ElementType.Directive;
|
||||
constructor(name: string, data: string);
|
||||
get nodeType(): 1;
|
||||
/** If this is a doctype, the document type name (parse5 only). */
|
||||
"x-name"?: string;
|
||||
/** If this is a doctype, the document type public identifier (parse5 only). */
|
||||
"x-publicId"?: string;
|
||||
/** If this is a doctype, the document type system identifier (parse5 only). */
|
||||
"x-systemId"?: string;
|
||||
}
|
||||
/**
|
||||
* A `Node` that can have children.
|
||||
*/
|
||||
export declare abstract class NodeWithChildren extends Node {
|
||||
children: ChildNode[];
|
||||
/**
|
||||
* @param children Children of the node. Only certain node types can have children.
|
||||
*/
|
||||
constructor(children: ChildNode[]);
|
||||
/** First child of the node. */
|
||||
get firstChild(): ChildNode | null;
|
||||
/** Last child of the node. */
|
||||
get lastChild(): ChildNode | null;
|
||||
/**
|
||||
* Same as {@link children}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get childNodes(): ChildNode[];
|
||||
set childNodes(children: ChildNode[]);
|
||||
}
|
||||
export declare class CDATA extends NodeWithChildren {
|
||||
type: ElementType.CDATA;
|
||||
get nodeType(): 4;
|
||||
}
|
||||
/**
|
||||
* The root node of the document.
|
||||
*/
|
||||
export declare class Document extends NodeWithChildren {
|
||||
type: ElementType.Root;
|
||||
get nodeType(): 9;
|
||||
/** [Document mode](https://dom.spec.whatwg.org/#concept-document-limited-quirks) (parse5 only). */
|
||||
"x-mode"?: "no-quirks" | "quirks" | "limited-quirks";
|
||||
}
|
||||
/**
|
||||
* The description of an individual attribute.
|
||||
*/
|
||||
interface Attribute {
|
||||
name: string;
|
||||
value: string;
|
||||
namespace?: string;
|
||||
prefix?: string;
|
||||
}
|
||||
/**
|
||||
* An element within the DOM.
|
||||
*/
|
||||
export declare class Element extends NodeWithChildren {
|
||||
name: string;
|
||||
attribs: {
|
||||
[name: string]: string;
|
||||
};
|
||||
type: ElementType.Tag | ElementType.Script | ElementType.Style;
|
||||
/**
|
||||
* @param name Name of the tag, eg. `div`, `span`.
|
||||
* @param attribs Object mapping attribute names to attribute values.
|
||||
* @param children Children of the node.
|
||||
*/
|
||||
constructor(name: string, attribs: {
|
||||
[name: string]: string;
|
||||
}, children?: ChildNode[], type?: ElementType.Tag | ElementType.Script | ElementType.Style);
|
||||
get nodeType(): 1;
|
||||
/**
|
||||
* `parse5` source code location info, with start & end tags.
|
||||
*
|
||||
* Available if parsing with parse5 and location info is enabled.
|
||||
*/
|
||||
sourceCodeLocation?: TagSourceCodeLocation | null;
|
||||
/**
|
||||
* Same as {@link name}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get tagName(): string;
|
||||
set tagName(name: string);
|
||||
get attributes(): Attribute[];
|
||||
/** Element namespace (parse5 only). */
|
||||
namespace?: string;
|
||||
/** Element attribute namespaces (parse5 only). */
|
||||
"x-attribsNamespace"?: Record<string, string>;
|
||||
/** Element attribute namespace-related prefixes (parse5 only). */
|
||||
"x-attribsPrefix"?: Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `Element`, `false` otherwise.
|
||||
*/
|
||||
export declare function isTag(node: Node): node is Element;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
||||
*/
|
||||
export declare function isCDATA(node: Node): node is CDATA;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
||||
*/
|
||||
export declare function isText(node: Node): node is Text;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
||||
*/
|
||||
export declare function isComment(node: Node): node is Comment;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export declare function isDirective(node: Node): node is ProcessingInstruction;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export declare function isDocument(node: Node): node is Document;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has children, `false` otherwise.
|
||||
*/
|
||||
export declare function hasChildren(node: Node): node is ParentNode;
|
||||
/**
|
||||
* Clone a node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
export declare function cloneNode<T extends Node>(node: T, recursive?: boolean): T;
|
||||
export {};
|
||||
//# sourceMappingURL=node.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domhandler/lib/esm/node.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domhandler/lib/esm/node.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAEhE,UAAU,kBAAkB;IACxB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,qBAAsB,SAAQ,kBAAkB;IACtD,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED,oBAAY,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AACpD,oBAAY,SAAS,GACf,IAAI,GACJ,OAAO,GACP,qBAAqB,GACrB,OAAO,GACP,KAAK,GAEL,QAAQ,CAAC;AACf,oBAAY,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7C;;;GAGG;AACH,8BAAsB,IAAI;IACtB,4BAA4B;IAC5B,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAEpC,yBAAyB;IACzB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAQ;IAEjC,uBAAuB;IACvB,IAAI,EAAE,SAAS,GAAG,IAAI,CAAQ;IAE9B,mBAAmB;IACnB,IAAI,EAAE,SAAS,GAAG,IAAI,CAAQ;IAE9B,2FAA2F;IAC3F,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,uFAAuF;IACvF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAI/C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAInC;;;OAGG;IACH,IAAI,UAAU,IAAI,UAAU,GAAG,IAAI,CAElC;IAED,IAAI,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,EAEvC;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,SAAS,GAAG,IAAI,CAEtC;IAED,IAAI,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,EAEzC;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,SAAS,GAAG,IAAI,CAElC;IAED,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,EAErC;IAED;;;;;OAKG;IACH,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,UAAQ,GAAG,CAAC;CAG3D;AAED;;GAEG;AACH,8BAAsB,QAAS,SAAQ,IAAI;IAIpB,IAAI,EAAE,MAAM;IAH/B;;OAEG;gBACgB,IAAI,EAAE,MAAM;IAI/B;;;OAGG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,EAEzB;CACJ;AAED;;GAEG;AACH,qBAAa,IAAK,SAAQ,QAAQ;IAC9B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAoB;IAE1C,IAAI,QAAQ,IAAI,CAAC,CAEhB;CACJ;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,QAAQ;IACjC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAuB;IAEhD,IAAI,QAAQ,IAAI,CAAC,CAEhB;CACJ;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;IAG5B,IAAI,EAAE,MAAM;IAF/B,IAAI,EAAE,WAAW,CAAC,SAAS,CAAyB;gBAEjC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAI7C,IAAa,QAAQ,IAAI,CAAC,CAEzB;IAED,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,8BAAsB,gBAAiB,SAAQ,IAAI;IAI5B,QAAQ,EAAE,SAAS,EAAE;IAHxC;;OAEG;gBACgB,QAAQ,EAAE,SAAS,EAAE;IAKxC,+BAA+B;IAC/B,IAAI,UAAU,IAAI,SAAS,GAAG,IAAI,CAEjC;IAED,8BAA8B;IAC9B,IAAI,SAAS,IAAI,SAAS,GAAG,IAAI,CAIhC;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,SAAS,EAAE,CAE5B;IAED,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAEnC;CACJ;AAED,qBAAa,KAAM,SAAQ,gBAAgB;IACvC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAqB;IAE5C,IAAI,QAAQ,IAAI,CAAC,CAEhB;CACJ;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,gBAAgB;IAC1C,IAAI,EAAE,WAAW,CAAC,IAAI,CAAoB;IAE1C,IAAI,QAAQ,IAAI,CAAC,CAEhB;IAED,mGAAmG;IACnG,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,gBAAgB,CAAC;CACxD;AAED;;GAEG;AACH,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,gBAAgB;IAO9B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAEnC,IAAI,EACL,WAAW,CAAC,GAAG,GACf,WAAW,CAAC,MAAM,GAClB,WAAW,CAAC,KAAK;IAZ3B;;;;OAIG;gBAEQ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAC1C,QAAQ,GAAE,SAAS,EAAO,EACnB,IAAI,GACL,WAAW,CAAC,GAAG,GACf,WAAW,CAAC,MAAM,GAClB,WAAW,CAAC,KAIG;IAKzB,IAAI,QAAQ,IAAI,CAAC,CAEhB;IAED;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAIlD;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,EAEvB;IAED,IAAI,UAAU,IAAI,SAAS,EAAE,CAO5B;IAED,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,OAAO,CAEjD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,KAAK,CAEjD;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,IAAI,CAE/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,qBAAqB,CAErE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,CAEvD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,UAAU,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,UAAQ,GAAG,CAAC,CA4DvE"}
|
||||
338
skills/imap-smtp-email/node_modules/domhandler/lib/esm/node.js
generated
vendored
Normal file
338
skills/imap-smtp-email/node_modules/domhandler/lib/esm/node.js
generated
vendored
Normal file
@@ -0,0 +1,338 @@
|
||||
import { ElementType, isTag as isTagRaw } from "domelementtype";
|
||||
/**
|
||||
* This object will be used as the prototype for Nodes when creating a
|
||||
* DOM-Level-1-compliant structure.
|
||||
*/
|
||||
export class Node {
|
||||
constructor() {
|
||||
/** Parent of the node */
|
||||
this.parent = null;
|
||||
/** Previous sibling */
|
||||
this.prev = null;
|
||||
/** Next sibling */
|
||||
this.next = null;
|
||||
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
||||
this.startIndex = null;
|
||||
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
||||
this.endIndex = null;
|
||||
}
|
||||
// Read-write aliases for properties
|
||||
/**
|
||||
* Same as {@link parent}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get parentNode() {
|
||||
return this.parent;
|
||||
}
|
||||
set parentNode(parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
/**
|
||||
* Same as {@link prev}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get previousSibling() {
|
||||
return this.prev;
|
||||
}
|
||||
set previousSibling(prev) {
|
||||
this.prev = prev;
|
||||
}
|
||||
/**
|
||||
* Same as {@link next}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nextSibling() {
|
||||
return this.next;
|
||||
}
|
||||
set nextSibling(next) {
|
||||
this.next = next;
|
||||
}
|
||||
/**
|
||||
* Clone this node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
cloneNode(recursive = false) {
|
||||
return cloneNode(this, recursive);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A node that contains some data.
|
||||
*/
|
||||
export class DataNode extends Node {
|
||||
/**
|
||||
* @param data The content of the data node
|
||||
*/
|
||||
constructor(data) {
|
||||
super();
|
||||
this.data = data;
|
||||
}
|
||||
/**
|
||||
* Same as {@link data}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nodeValue() {
|
||||
return this.data;
|
||||
}
|
||||
set nodeValue(data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Text within the document.
|
||||
*/
|
||||
export class Text extends DataNode {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.type = ElementType.Text;
|
||||
}
|
||||
get nodeType() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Comments within the document.
|
||||
*/
|
||||
export class Comment extends DataNode {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.type = ElementType.Comment;
|
||||
}
|
||||
get nodeType() {
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Processing instructions, including doc types.
|
||||
*/
|
||||
export class ProcessingInstruction extends DataNode {
|
||||
constructor(name, data) {
|
||||
super(data);
|
||||
this.name = name;
|
||||
this.type = ElementType.Directive;
|
||||
}
|
||||
get nodeType() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A `Node` that can have children.
|
||||
*/
|
||||
export class NodeWithChildren extends Node {
|
||||
/**
|
||||
* @param children Children of the node. Only certain node types can have children.
|
||||
*/
|
||||
constructor(children) {
|
||||
super();
|
||||
this.children = children;
|
||||
}
|
||||
// Aliases
|
||||
/** First child of the node. */
|
||||
get firstChild() {
|
||||
var _a;
|
||||
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
||||
}
|
||||
/** Last child of the node. */
|
||||
get lastChild() {
|
||||
return this.children.length > 0
|
||||
? this.children[this.children.length - 1]
|
||||
: null;
|
||||
}
|
||||
/**
|
||||
* Same as {@link children}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get childNodes() {
|
||||
return this.children;
|
||||
}
|
||||
set childNodes(children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
export class CDATA extends NodeWithChildren {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.type = ElementType.CDATA;
|
||||
}
|
||||
get nodeType() {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The root node of the document.
|
||||
*/
|
||||
export class Document extends NodeWithChildren {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.type = ElementType.Root;
|
||||
}
|
||||
get nodeType() {
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* An element within the DOM.
|
||||
*/
|
||||
export class Element extends NodeWithChildren {
|
||||
/**
|
||||
* @param name Name of the tag, eg. `div`, `span`.
|
||||
* @param attribs Object mapping attribute names to attribute values.
|
||||
* @param children Children of the node.
|
||||
*/
|
||||
constructor(name, attribs, children = [], type = name === "script"
|
||||
? ElementType.Script
|
||||
: name === "style"
|
||||
? ElementType.Style
|
||||
: ElementType.Tag) {
|
||||
super(children);
|
||||
this.name = name;
|
||||
this.attribs = attribs;
|
||||
this.type = type;
|
||||
}
|
||||
get nodeType() {
|
||||
return 1;
|
||||
}
|
||||
// DOM Level 1 aliases
|
||||
/**
|
||||
* Same as {@link name}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get tagName() {
|
||||
return this.name;
|
||||
}
|
||||
set tagName(name) {
|
||||
this.name = name;
|
||||
}
|
||||
get attributes() {
|
||||
return Object.keys(this.attribs).map((name) => {
|
||||
var _a, _b;
|
||||
return ({
|
||||
name,
|
||||
value: this.attribs[name],
|
||||
namespace: (_a = this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
||||
prefix: (_b = this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `Element`, `false` otherwise.
|
||||
*/
|
||||
export function isTag(node) {
|
||||
return isTagRaw(node);
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
||||
*/
|
||||
export function isCDATA(node) {
|
||||
return node.type === ElementType.CDATA;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
||||
*/
|
||||
export function isText(node) {
|
||||
return node.type === ElementType.Text;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
||||
*/
|
||||
export function isComment(node) {
|
||||
return node.type === ElementType.Comment;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export function isDirective(node) {
|
||||
return node.type === ElementType.Directive;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export function isDocument(node) {
|
||||
return node.type === ElementType.Root;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has children, `false` otherwise.
|
||||
*/
|
||||
export function hasChildren(node) {
|
||||
return Object.prototype.hasOwnProperty.call(node, "children");
|
||||
}
|
||||
/**
|
||||
* Clone a node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
export function cloneNode(node, recursive = false) {
|
||||
let result;
|
||||
if (isText(node)) {
|
||||
result = new Text(node.data);
|
||||
}
|
||||
else if (isComment(node)) {
|
||||
result = new Comment(node.data);
|
||||
}
|
||||
else if (isTag(node)) {
|
||||
const children = recursive ? cloneChildren(node.children) : [];
|
||||
const clone = new Element(node.name, { ...node.attribs }, children);
|
||||
children.forEach((child) => (child.parent = clone));
|
||||
if (node.namespace != null) {
|
||||
clone.namespace = node.namespace;
|
||||
}
|
||||
if (node["x-attribsNamespace"]) {
|
||||
clone["x-attribsNamespace"] = { ...node["x-attribsNamespace"] };
|
||||
}
|
||||
if (node["x-attribsPrefix"]) {
|
||||
clone["x-attribsPrefix"] = { ...node["x-attribsPrefix"] };
|
||||
}
|
||||
result = clone;
|
||||
}
|
||||
else if (isCDATA(node)) {
|
||||
const children = recursive ? cloneChildren(node.children) : [];
|
||||
const clone = new CDATA(children);
|
||||
children.forEach((child) => (child.parent = clone));
|
||||
result = clone;
|
||||
}
|
||||
else if (isDocument(node)) {
|
||||
const children = recursive ? cloneChildren(node.children) : [];
|
||||
const clone = new Document(children);
|
||||
children.forEach((child) => (child.parent = clone));
|
||||
if (node["x-mode"]) {
|
||||
clone["x-mode"] = node["x-mode"];
|
||||
}
|
||||
result = clone;
|
||||
}
|
||||
else if (isDirective(node)) {
|
||||
const instruction = new ProcessingInstruction(node.name, node.data);
|
||||
if (node["x-name"] != null) {
|
||||
instruction["x-name"] = node["x-name"];
|
||||
instruction["x-publicId"] = node["x-publicId"];
|
||||
instruction["x-systemId"] = node["x-systemId"];
|
||||
}
|
||||
result = instruction;
|
||||
}
|
||||
else {
|
||||
throw new Error(`Not implemented yet: ${node.type}`);
|
||||
}
|
||||
result.startIndex = node.startIndex;
|
||||
result.endIndex = node.endIndex;
|
||||
if (node.sourceCodeLocation != null) {
|
||||
result.sourceCodeLocation = node.sourceCodeLocation;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function cloneChildren(childs) {
|
||||
const children = childs.map((child) => cloneNode(child, true));
|
||||
for (let i = 1; i < children.length; i++) {
|
||||
children[i].prev = children[i - 1];
|
||||
children[i - 1].next = children[i];
|
||||
}
|
||||
return children;
|
||||
}
|
||||
1
skills/imap-smtp-email/node_modules/domhandler/lib/esm/package.json
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domhandler/lib/esm/package.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"type":"module"}
|
||||
76
skills/imap-smtp-email/node_modules/domhandler/lib/index.d.ts
generated
vendored
Normal file
76
skills/imap-smtp-email/node_modules/domhandler/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import { ChildNode, Element, DataNode, Document, ParentNode } from "./node.js";
|
||||
export * from "./node.js";
|
||||
export interface DomHandlerOptions {
|
||||
/**
|
||||
* Add a `startIndex` property to nodes.
|
||||
* When the parser is used in a non-streaming fashion, `startIndex` is an integer
|
||||
* indicating the position of the start of the node in the document.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
withStartIndices?: boolean;
|
||||
/**
|
||||
* Add an `endIndex` property to nodes.
|
||||
* When the parser is used in a non-streaming fashion, `endIndex` is an integer
|
||||
* indicating the position of the end of the node in the document.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
withEndIndices?: boolean;
|
||||
/**
|
||||
* Treat the markup as XML.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean;
|
||||
}
|
||||
interface ParserInterface {
|
||||
startIndex: number | null;
|
||||
endIndex: number | null;
|
||||
}
|
||||
declare type Callback = (error: Error | null, dom: ChildNode[]) => void;
|
||||
declare type ElementCallback = (element: Element) => void;
|
||||
export declare class DomHandler {
|
||||
/** The elements of the DOM */
|
||||
dom: ChildNode[];
|
||||
/** The root element for the DOM */
|
||||
root: Document;
|
||||
/** Called once parsing has completed. */
|
||||
private readonly callback;
|
||||
/** Settings for the handler. */
|
||||
private readonly options;
|
||||
/** Callback whenever a tag is closed. */
|
||||
private readonly elementCB;
|
||||
/** Indicated whether parsing has been completed. */
|
||||
private done;
|
||||
/** Stack of open tags. */
|
||||
protected tagStack: ParentNode[];
|
||||
/** A data node that is still being written to. */
|
||||
protected lastNode: DataNode | null;
|
||||
/** Reference to the parser instance. Used for location information. */
|
||||
private parser;
|
||||
/**
|
||||
* @param callback Called once parsing has completed.
|
||||
* @param options Settings for the handler.
|
||||
* @param elementCB Callback whenever a tag is closed.
|
||||
*/
|
||||
constructor(callback?: Callback | null, options?: DomHandlerOptions | null, elementCB?: ElementCallback);
|
||||
onparserinit(parser: ParserInterface): void;
|
||||
onreset(): void;
|
||||
onend(): void;
|
||||
onerror(error: Error): void;
|
||||
onclosetag(): void;
|
||||
onopentag(name: string, attribs: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
ontext(data: string): void;
|
||||
oncomment(data: string): void;
|
||||
oncommentend(): void;
|
||||
oncdatastart(): void;
|
||||
oncdataend(): void;
|
||||
onprocessinginstruction(name: string, data: string): void;
|
||||
protected handleCallback(error: Error | null): void;
|
||||
protected addNode(node: ChildNode): void;
|
||||
}
|
||||
export default DomHandler;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domhandler/lib/index.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domhandler/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,SAAS,EACT,OAAO,EACP,QAAQ,EAIR,QAAQ,EAER,UAAU,EACb,MAAM,WAAW,CAAC;AAEnB,cAAc,WAAW,CAAC;AAE1B,MAAM,WAAW,iBAAiB;IAC9B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AASD,UAAU,eAAe;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,aAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;AAChE,aAAK,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAElD,qBAAa,UAAU;IACnB,8BAA8B;IACvB,GAAG,EAAE,SAAS,EAAE,CAAM;IAE7B,mCAAmC;IAC5B,IAAI,WAA0B;IAErC,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAE5C,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAEnD,oDAAoD;IACpD,OAAO,CAAC,IAAI,CAAS;IAErB,0BAA0B;IAC1B,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAe;IAE/C,kDAAkD;IAClD,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE3C,uEAAuE;IACvE,OAAO,CAAC,MAAM,CAAgC;IAE9C;;;;OAIG;gBAEC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,EAClC,SAAS,CAAC,EAAE,eAAe;IAiBxB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAK3C,OAAO,IAAI,IAAI;IAUf,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI3B,UAAU,IAAI,IAAI;IAYlB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAOjE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAe1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAW7B,YAAY,IAAI,IAAI;IAIpB,YAAY,IAAI,IAAI;IAUpB,UAAU,IAAI,IAAI;IAIlB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAKhE,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI;IAQnD,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;CAwB3C;AAED,eAAe,UAAU,CAAC"}
|
||||
165
skills/imap-smtp-email/node_modules/domhandler/lib/index.js
generated
vendored
Normal file
165
skills/imap-smtp-email/node_modules/domhandler/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DomHandler = void 0;
|
||||
var domelementtype_1 = require("domelementtype");
|
||||
var node_js_1 = require("./node.js");
|
||||
__exportStar(require("./node.js"), exports);
|
||||
// Default options
|
||||
var defaultOpts = {
|
||||
withStartIndices: false,
|
||||
withEndIndices: false,
|
||||
xmlMode: false,
|
||||
};
|
||||
var DomHandler = /** @class */ (function () {
|
||||
/**
|
||||
* @param callback Called once parsing has completed.
|
||||
* @param options Settings for the handler.
|
||||
* @param elementCB Callback whenever a tag is closed.
|
||||
*/
|
||||
function DomHandler(callback, options, elementCB) {
|
||||
/** The elements of the DOM */
|
||||
this.dom = [];
|
||||
/** The root element for the DOM */
|
||||
this.root = new node_js_1.Document(this.dom);
|
||||
/** Indicated whether parsing has been completed. */
|
||||
this.done = false;
|
||||
/** Stack of open tags. */
|
||||
this.tagStack = [this.root];
|
||||
/** A data node that is still being written to. */
|
||||
this.lastNode = null;
|
||||
/** Reference to the parser instance. Used for location information. */
|
||||
this.parser = null;
|
||||
// Make it possible to skip arguments, for backwards-compatibility
|
||||
if (typeof options === "function") {
|
||||
elementCB = options;
|
||||
options = defaultOpts;
|
||||
}
|
||||
if (typeof callback === "object") {
|
||||
options = callback;
|
||||
callback = undefined;
|
||||
}
|
||||
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
||||
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
||||
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
||||
}
|
||||
DomHandler.prototype.onparserinit = function (parser) {
|
||||
this.parser = parser;
|
||||
};
|
||||
// Resets the handler back to starting state
|
||||
DomHandler.prototype.onreset = function () {
|
||||
this.dom = [];
|
||||
this.root = new node_js_1.Document(this.dom);
|
||||
this.done = false;
|
||||
this.tagStack = [this.root];
|
||||
this.lastNode = null;
|
||||
this.parser = null;
|
||||
};
|
||||
// Signals the handler that parsing is done
|
||||
DomHandler.prototype.onend = function () {
|
||||
if (this.done)
|
||||
return;
|
||||
this.done = true;
|
||||
this.parser = null;
|
||||
this.handleCallback(null);
|
||||
};
|
||||
DomHandler.prototype.onerror = function (error) {
|
||||
this.handleCallback(error);
|
||||
};
|
||||
DomHandler.prototype.onclosetag = function () {
|
||||
this.lastNode = null;
|
||||
var elem = this.tagStack.pop();
|
||||
if (this.options.withEndIndices) {
|
||||
elem.endIndex = this.parser.endIndex;
|
||||
}
|
||||
if (this.elementCB)
|
||||
this.elementCB(elem);
|
||||
};
|
||||
DomHandler.prototype.onopentag = function (name, attribs) {
|
||||
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;
|
||||
var element = new node_js_1.Element(name, attribs, undefined, type);
|
||||
this.addNode(element);
|
||||
this.tagStack.push(element);
|
||||
};
|
||||
DomHandler.prototype.ontext = function (data) {
|
||||
var lastNode = this.lastNode;
|
||||
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
|
||||
lastNode.data += data;
|
||||
if (this.options.withEndIndices) {
|
||||
lastNode.endIndex = this.parser.endIndex;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var node = new node_js_1.Text(data);
|
||||
this.addNode(node);
|
||||
this.lastNode = node;
|
||||
}
|
||||
};
|
||||
DomHandler.prototype.oncomment = function (data) {
|
||||
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
|
||||
this.lastNode.data += data;
|
||||
return;
|
||||
}
|
||||
var node = new node_js_1.Comment(data);
|
||||
this.addNode(node);
|
||||
this.lastNode = node;
|
||||
};
|
||||
DomHandler.prototype.oncommentend = function () {
|
||||
this.lastNode = null;
|
||||
};
|
||||
DomHandler.prototype.oncdatastart = function () {
|
||||
var text = new node_js_1.Text("");
|
||||
var node = new node_js_1.CDATA([text]);
|
||||
this.addNode(node);
|
||||
text.parent = node;
|
||||
this.lastNode = text;
|
||||
};
|
||||
DomHandler.prototype.oncdataend = function () {
|
||||
this.lastNode = null;
|
||||
};
|
||||
DomHandler.prototype.onprocessinginstruction = function (name, data) {
|
||||
var node = new node_js_1.ProcessingInstruction(name, data);
|
||||
this.addNode(node);
|
||||
};
|
||||
DomHandler.prototype.handleCallback = function (error) {
|
||||
if (typeof this.callback === "function") {
|
||||
this.callback(error, this.dom);
|
||||
}
|
||||
else if (error) {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
DomHandler.prototype.addNode = function (node) {
|
||||
var parent = this.tagStack[this.tagStack.length - 1];
|
||||
var previousSibling = parent.children[parent.children.length - 1];
|
||||
if (this.options.withStartIndices) {
|
||||
node.startIndex = this.parser.startIndex;
|
||||
}
|
||||
if (this.options.withEndIndices) {
|
||||
node.endIndex = this.parser.endIndex;
|
||||
}
|
||||
parent.children.push(node);
|
||||
if (previousSibling) {
|
||||
node.prev = previousSibling;
|
||||
previousSibling.next = node;
|
||||
}
|
||||
node.parent = parent;
|
||||
this.lastNode = null;
|
||||
};
|
||||
return DomHandler;
|
||||
}());
|
||||
exports.DomHandler = DomHandler;
|
||||
exports.default = DomHandler;
|
||||
245
skills/imap-smtp-email/node_modules/domhandler/lib/node.d.ts
generated
vendored
Normal file
245
skills/imap-smtp-email/node_modules/domhandler/lib/node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
import { ElementType } from "domelementtype";
|
||||
interface SourceCodeLocation {
|
||||
/** One-based line index of the first character. */
|
||||
startLine: number;
|
||||
/** One-based column index of the first character. */
|
||||
startCol: number;
|
||||
/** Zero-based first character index. */
|
||||
startOffset: number;
|
||||
/** One-based line index of the last character. */
|
||||
endLine: number;
|
||||
/** One-based column index of the last character. Points directly *after* the last character. */
|
||||
endCol: number;
|
||||
/** Zero-based last character index. Points directly *after* the last character. */
|
||||
endOffset: number;
|
||||
}
|
||||
interface TagSourceCodeLocation extends SourceCodeLocation {
|
||||
startTag?: SourceCodeLocation;
|
||||
endTag?: SourceCodeLocation;
|
||||
}
|
||||
export declare type ParentNode = Document | Element | CDATA;
|
||||
export declare type ChildNode = Text | Comment | ProcessingInstruction | Element | CDATA | Document;
|
||||
export declare type AnyNode = ParentNode | ChildNode;
|
||||
/**
|
||||
* This object will be used as the prototype for Nodes when creating a
|
||||
* DOM-Level-1-compliant structure.
|
||||
*/
|
||||
export declare abstract class Node {
|
||||
/** The type of the node. */
|
||||
abstract readonly type: ElementType;
|
||||
/** Parent of the node */
|
||||
parent: ParentNode | null;
|
||||
/** Previous sibling */
|
||||
prev: ChildNode | null;
|
||||
/** Next sibling */
|
||||
next: ChildNode | null;
|
||||
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
||||
startIndex: number | null;
|
||||
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
||||
endIndex: number | null;
|
||||
/**
|
||||
* `parse5` source code location info.
|
||||
*
|
||||
* Available if parsing with parse5 and location info is enabled.
|
||||
*/
|
||||
sourceCodeLocation?: SourceCodeLocation | null;
|
||||
/**
|
||||
* [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
|
||||
* node {@link type}.
|
||||
*/
|
||||
abstract readonly nodeType: number;
|
||||
/**
|
||||
* Same as {@link parent}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get parentNode(): ParentNode | null;
|
||||
set parentNode(parent: ParentNode | null);
|
||||
/**
|
||||
* Same as {@link prev}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get previousSibling(): ChildNode | null;
|
||||
set previousSibling(prev: ChildNode | null);
|
||||
/**
|
||||
* Same as {@link next}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nextSibling(): ChildNode | null;
|
||||
set nextSibling(next: ChildNode | null);
|
||||
/**
|
||||
* Clone this node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
cloneNode<T extends Node>(this: T, recursive?: boolean): T;
|
||||
}
|
||||
/**
|
||||
* A node that contains some data.
|
||||
*/
|
||||
export declare abstract class DataNode extends Node {
|
||||
data: string;
|
||||
/**
|
||||
* @param data The content of the data node
|
||||
*/
|
||||
constructor(data: string);
|
||||
/**
|
||||
* Same as {@link data}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nodeValue(): string;
|
||||
set nodeValue(data: string);
|
||||
}
|
||||
/**
|
||||
* Text within the document.
|
||||
*/
|
||||
export declare class Text extends DataNode {
|
||||
type: ElementType.Text;
|
||||
get nodeType(): 3;
|
||||
}
|
||||
/**
|
||||
* Comments within the document.
|
||||
*/
|
||||
export declare class Comment extends DataNode {
|
||||
type: ElementType.Comment;
|
||||
get nodeType(): 8;
|
||||
}
|
||||
/**
|
||||
* Processing instructions, including doc types.
|
||||
*/
|
||||
export declare class ProcessingInstruction extends DataNode {
|
||||
name: string;
|
||||
type: ElementType.Directive;
|
||||
constructor(name: string, data: string);
|
||||
get nodeType(): 1;
|
||||
/** If this is a doctype, the document type name (parse5 only). */
|
||||
"x-name"?: string;
|
||||
/** If this is a doctype, the document type public identifier (parse5 only). */
|
||||
"x-publicId"?: string;
|
||||
/** If this is a doctype, the document type system identifier (parse5 only). */
|
||||
"x-systemId"?: string;
|
||||
}
|
||||
/**
|
||||
* A `Node` that can have children.
|
||||
*/
|
||||
export declare abstract class NodeWithChildren extends Node {
|
||||
children: ChildNode[];
|
||||
/**
|
||||
* @param children Children of the node. Only certain node types can have children.
|
||||
*/
|
||||
constructor(children: ChildNode[]);
|
||||
/** First child of the node. */
|
||||
get firstChild(): ChildNode | null;
|
||||
/** Last child of the node. */
|
||||
get lastChild(): ChildNode | null;
|
||||
/**
|
||||
* Same as {@link children}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get childNodes(): ChildNode[];
|
||||
set childNodes(children: ChildNode[]);
|
||||
}
|
||||
export declare class CDATA extends NodeWithChildren {
|
||||
type: ElementType.CDATA;
|
||||
get nodeType(): 4;
|
||||
}
|
||||
/**
|
||||
* The root node of the document.
|
||||
*/
|
||||
export declare class Document extends NodeWithChildren {
|
||||
type: ElementType.Root;
|
||||
get nodeType(): 9;
|
||||
/** [Document mode](https://dom.spec.whatwg.org/#concept-document-limited-quirks) (parse5 only). */
|
||||
"x-mode"?: "no-quirks" | "quirks" | "limited-quirks";
|
||||
}
|
||||
/**
|
||||
* The description of an individual attribute.
|
||||
*/
|
||||
interface Attribute {
|
||||
name: string;
|
||||
value: string;
|
||||
namespace?: string;
|
||||
prefix?: string;
|
||||
}
|
||||
/**
|
||||
* An element within the DOM.
|
||||
*/
|
||||
export declare class Element extends NodeWithChildren {
|
||||
name: string;
|
||||
attribs: {
|
||||
[name: string]: string;
|
||||
};
|
||||
type: ElementType.Tag | ElementType.Script | ElementType.Style;
|
||||
/**
|
||||
* @param name Name of the tag, eg. `div`, `span`.
|
||||
* @param attribs Object mapping attribute names to attribute values.
|
||||
* @param children Children of the node.
|
||||
*/
|
||||
constructor(name: string, attribs: {
|
||||
[name: string]: string;
|
||||
}, children?: ChildNode[], type?: ElementType.Tag | ElementType.Script | ElementType.Style);
|
||||
get nodeType(): 1;
|
||||
/**
|
||||
* `parse5` source code location info, with start & end tags.
|
||||
*
|
||||
* Available if parsing with parse5 and location info is enabled.
|
||||
*/
|
||||
sourceCodeLocation?: TagSourceCodeLocation | null;
|
||||
/**
|
||||
* Same as {@link name}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get tagName(): string;
|
||||
set tagName(name: string);
|
||||
get attributes(): Attribute[];
|
||||
/** Element namespace (parse5 only). */
|
||||
namespace?: string;
|
||||
/** Element attribute namespaces (parse5 only). */
|
||||
"x-attribsNamespace"?: Record<string, string>;
|
||||
/** Element attribute namespace-related prefixes (parse5 only). */
|
||||
"x-attribsPrefix"?: Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `Element`, `false` otherwise.
|
||||
*/
|
||||
export declare function isTag(node: Node): node is Element;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
||||
*/
|
||||
export declare function isCDATA(node: Node): node is CDATA;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
||||
*/
|
||||
export declare function isText(node: Node): node is Text;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
||||
*/
|
||||
export declare function isComment(node: Node): node is Comment;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export declare function isDirective(node: Node): node is ProcessingInstruction;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export declare function isDocument(node: Node): node is Document;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has children, `false` otherwise.
|
||||
*/
|
||||
export declare function hasChildren(node: Node): node is ParentNode;
|
||||
/**
|
||||
* Clone a node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
export declare function cloneNode<T extends Node>(node: T, recursive?: boolean): T;
|
||||
export {};
|
||||
//# sourceMappingURL=node.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domhandler/lib/node.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domhandler/lib/node.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAEhE,UAAU,kBAAkB;IACxB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,qBAAsB,SAAQ,kBAAkB;IACtD,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED,oBAAY,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AACpD,oBAAY,SAAS,GACf,IAAI,GACJ,OAAO,GACP,qBAAqB,GACrB,OAAO,GACP,KAAK,GAEL,QAAQ,CAAC;AACf,oBAAY,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7C;;;GAGG;AACH,8BAAsB,IAAI;IACtB,4BAA4B;IAC5B,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAEpC,yBAAyB;IACzB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAQ;IAEjC,uBAAuB;IACvB,IAAI,EAAE,SAAS,GAAG,IAAI,CAAQ;IAE9B,mBAAmB;IACnB,IAAI,EAAE,SAAS,GAAG,IAAI,CAAQ;IAE9B,2FAA2F;IAC3F,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,uFAAuF;IACvF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAI/C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAInC;;;OAGG;IACH,IAAI,UAAU,IAAI,UAAU,GAAG,IAAI,CAElC;IAED,IAAI,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,EAEvC;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,SAAS,GAAG,IAAI,CAEtC;IAED,IAAI,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,EAEzC;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,SAAS,GAAG,IAAI,CAElC;IAED,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,EAErC;IAED;;;;;OAKG;IACH,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,UAAQ,GAAG,CAAC;CAG3D;AAED;;GAEG;AACH,8BAAsB,QAAS,SAAQ,IAAI;IAIpB,IAAI,EAAE,MAAM;IAH/B;;OAEG;gBACgB,IAAI,EAAE,MAAM;IAI/B;;;OAGG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,EAEzB;CACJ;AAED;;GAEG;AACH,qBAAa,IAAK,SAAQ,QAAQ;IAC9B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAoB;IAE1C,IAAI,QAAQ,IAAI,CAAC,CAEhB;CACJ;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,QAAQ;IACjC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAuB;IAEhD,IAAI,QAAQ,IAAI,CAAC,CAEhB;CACJ;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;IAG5B,IAAI,EAAE,MAAM;IAF/B,IAAI,EAAE,WAAW,CAAC,SAAS,CAAyB;gBAEjC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAI7C,IAAa,QAAQ,IAAI,CAAC,CAEzB;IAED,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,8BAAsB,gBAAiB,SAAQ,IAAI;IAI5B,QAAQ,EAAE,SAAS,EAAE;IAHxC;;OAEG;gBACgB,QAAQ,EAAE,SAAS,EAAE;IAKxC,+BAA+B;IAC/B,IAAI,UAAU,IAAI,SAAS,GAAG,IAAI,CAEjC;IAED,8BAA8B;IAC9B,IAAI,SAAS,IAAI,SAAS,GAAG,IAAI,CAIhC;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,SAAS,EAAE,CAE5B;IAED,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAEnC;CACJ;AAED,qBAAa,KAAM,SAAQ,gBAAgB;IACvC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAqB;IAE5C,IAAI,QAAQ,IAAI,CAAC,CAEhB;CACJ;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,gBAAgB;IAC1C,IAAI,EAAE,WAAW,CAAC,IAAI,CAAoB;IAE1C,IAAI,QAAQ,IAAI,CAAC,CAEhB;IAED,mGAAmG;IACnG,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,gBAAgB,CAAC;CACxD;AAED;;GAEG;AACH,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,gBAAgB;IAO9B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAEnC,IAAI,EACL,WAAW,CAAC,GAAG,GACf,WAAW,CAAC,MAAM,GAClB,WAAW,CAAC,KAAK;IAZ3B;;;;OAIG;gBAEQ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAC1C,QAAQ,GAAE,SAAS,EAAO,EACnB,IAAI,GACL,WAAW,CAAC,GAAG,GACf,WAAW,CAAC,MAAM,GAClB,WAAW,CAAC,KAIG;IAKzB,IAAI,QAAQ,IAAI,CAAC,CAEhB;IAED;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAIlD;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,EAEvB;IAED,IAAI,UAAU,IAAI,SAAS,EAAE,CAO5B;IAED,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,OAAO,CAEjD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,KAAK,CAEjD;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,IAAI,CAE/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,qBAAqB,CAErE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,CAEvD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,UAAU,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,UAAQ,GAAG,CAAC,CA4DvE"}
|
||||
474
skills/imap-smtp-email/node_modules/domhandler/lib/node.js
generated
vendored
Normal file
474
skills/imap-smtp-email/node_modules/domhandler/lib/node.js
generated
vendored
Normal file
@@ -0,0 +1,474 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;
|
||||
var domelementtype_1 = require("domelementtype");
|
||||
/**
|
||||
* This object will be used as the prototype for Nodes when creating a
|
||||
* DOM-Level-1-compliant structure.
|
||||
*/
|
||||
var Node = /** @class */ (function () {
|
||||
function Node() {
|
||||
/** Parent of the node */
|
||||
this.parent = null;
|
||||
/** Previous sibling */
|
||||
this.prev = null;
|
||||
/** Next sibling */
|
||||
this.next = null;
|
||||
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
||||
this.startIndex = null;
|
||||
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
||||
this.endIndex = null;
|
||||
}
|
||||
Object.defineProperty(Node.prototype, "parentNode", {
|
||||
// Read-write aliases for properties
|
||||
/**
|
||||
* Same as {@link parent}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.parent;
|
||||
},
|
||||
set: function (parent) {
|
||||
this.parent = parent;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Node.prototype, "previousSibling", {
|
||||
/**
|
||||
* Same as {@link prev}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.prev;
|
||||
},
|
||||
set: function (prev) {
|
||||
this.prev = prev;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Node.prototype, "nextSibling", {
|
||||
/**
|
||||
* Same as {@link next}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.next;
|
||||
},
|
||||
set: function (next) {
|
||||
this.next = next;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
/**
|
||||
* Clone this node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
Node.prototype.cloneNode = function (recursive) {
|
||||
if (recursive === void 0) { recursive = false; }
|
||||
return cloneNode(this, recursive);
|
||||
};
|
||||
return Node;
|
||||
}());
|
||||
exports.Node = Node;
|
||||
/**
|
||||
* A node that contains some data.
|
||||
*/
|
||||
var DataNode = /** @class */ (function (_super) {
|
||||
__extends(DataNode, _super);
|
||||
/**
|
||||
* @param data The content of the data node
|
||||
*/
|
||||
function DataNode(data) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.data = data;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(DataNode.prototype, "nodeValue", {
|
||||
/**
|
||||
* Same as {@link data}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.data;
|
||||
},
|
||||
set: function (data) {
|
||||
this.data = data;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return DataNode;
|
||||
}(Node));
|
||||
exports.DataNode = DataNode;
|
||||
/**
|
||||
* Text within the document.
|
||||
*/
|
||||
var Text = /** @class */ (function (_super) {
|
||||
__extends(Text, _super);
|
||||
function Text() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.type = domelementtype_1.ElementType.Text;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(Text.prototype, "nodeType", {
|
||||
get: function () {
|
||||
return 3;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return Text;
|
||||
}(DataNode));
|
||||
exports.Text = Text;
|
||||
/**
|
||||
* Comments within the document.
|
||||
*/
|
||||
var Comment = /** @class */ (function (_super) {
|
||||
__extends(Comment, _super);
|
||||
function Comment() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.type = domelementtype_1.ElementType.Comment;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(Comment.prototype, "nodeType", {
|
||||
get: function () {
|
||||
return 8;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return Comment;
|
||||
}(DataNode));
|
||||
exports.Comment = Comment;
|
||||
/**
|
||||
* Processing instructions, including doc types.
|
||||
*/
|
||||
var ProcessingInstruction = /** @class */ (function (_super) {
|
||||
__extends(ProcessingInstruction, _super);
|
||||
function ProcessingInstruction(name, data) {
|
||||
var _this = _super.call(this, data) || this;
|
||||
_this.name = name;
|
||||
_this.type = domelementtype_1.ElementType.Directive;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(ProcessingInstruction.prototype, "nodeType", {
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return ProcessingInstruction;
|
||||
}(DataNode));
|
||||
exports.ProcessingInstruction = ProcessingInstruction;
|
||||
/**
|
||||
* A `Node` that can have children.
|
||||
*/
|
||||
var NodeWithChildren = /** @class */ (function (_super) {
|
||||
__extends(NodeWithChildren, _super);
|
||||
/**
|
||||
* @param children Children of the node. Only certain node types can have children.
|
||||
*/
|
||||
function NodeWithChildren(children) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.children = children;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
|
||||
// Aliases
|
||||
/** First child of the node. */
|
||||
get: function () {
|
||||
var _a;
|
||||
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
|
||||
/** Last child of the node. */
|
||||
get: function () {
|
||||
return this.children.length > 0
|
||||
? this.children[this.children.length - 1]
|
||||
: null;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
|
||||
/**
|
||||
* Same as {@link children}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.children;
|
||||
},
|
||||
set: function (children) {
|
||||
this.children = children;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return NodeWithChildren;
|
||||
}(Node));
|
||||
exports.NodeWithChildren = NodeWithChildren;
|
||||
var CDATA = /** @class */ (function (_super) {
|
||||
__extends(CDATA, _super);
|
||||
function CDATA() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.type = domelementtype_1.ElementType.CDATA;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(CDATA.prototype, "nodeType", {
|
||||
get: function () {
|
||||
return 4;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return CDATA;
|
||||
}(NodeWithChildren));
|
||||
exports.CDATA = CDATA;
|
||||
/**
|
||||
* The root node of the document.
|
||||
*/
|
||||
var Document = /** @class */ (function (_super) {
|
||||
__extends(Document, _super);
|
||||
function Document() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.type = domelementtype_1.ElementType.Root;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(Document.prototype, "nodeType", {
|
||||
get: function () {
|
||||
return 9;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return Document;
|
||||
}(NodeWithChildren));
|
||||
exports.Document = Document;
|
||||
/**
|
||||
* An element within the DOM.
|
||||
*/
|
||||
var Element = /** @class */ (function (_super) {
|
||||
__extends(Element, _super);
|
||||
/**
|
||||
* @param name Name of the tag, eg. `div`, `span`.
|
||||
* @param attribs Object mapping attribute names to attribute values.
|
||||
* @param children Children of the node.
|
||||
*/
|
||||
function Element(name, attribs, children, type) {
|
||||
if (children === void 0) { children = []; }
|
||||
if (type === void 0) { type = name === "script"
|
||||
? domelementtype_1.ElementType.Script
|
||||
: name === "style"
|
||||
? domelementtype_1.ElementType.Style
|
||||
: domelementtype_1.ElementType.Tag; }
|
||||
var _this = _super.call(this, children) || this;
|
||||
_this.name = name;
|
||||
_this.attribs = attribs;
|
||||
_this.type = type;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(Element.prototype, "nodeType", {
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Element.prototype, "tagName", {
|
||||
// DOM Level 1 aliases
|
||||
/**
|
||||
* Same as {@link name}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.name;
|
||||
},
|
||||
set: function (name) {
|
||||
this.name = name;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Element.prototype, "attributes", {
|
||||
get: function () {
|
||||
var _this = this;
|
||||
return Object.keys(this.attribs).map(function (name) {
|
||||
var _a, _b;
|
||||
return ({
|
||||
name: name,
|
||||
value: _this.attribs[name],
|
||||
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
||||
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
|
||||
});
|
||||
});
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return Element;
|
||||
}(NodeWithChildren));
|
||||
exports.Element = Element;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `Element`, `false` otherwise.
|
||||
*/
|
||||
function isTag(node) {
|
||||
return (0, domelementtype_1.isTag)(node);
|
||||
}
|
||||
exports.isTag = isTag;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
||||
*/
|
||||
function isCDATA(node) {
|
||||
return node.type === domelementtype_1.ElementType.CDATA;
|
||||
}
|
||||
exports.isCDATA = isCDATA;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
||||
*/
|
||||
function isText(node) {
|
||||
return node.type === domelementtype_1.ElementType.Text;
|
||||
}
|
||||
exports.isText = isText;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
||||
*/
|
||||
function isComment(node) {
|
||||
return node.type === domelementtype_1.ElementType.Comment;
|
||||
}
|
||||
exports.isComment = isComment;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
function isDirective(node) {
|
||||
return node.type === domelementtype_1.ElementType.Directive;
|
||||
}
|
||||
exports.isDirective = isDirective;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
function isDocument(node) {
|
||||
return node.type === domelementtype_1.ElementType.Root;
|
||||
}
|
||||
exports.isDocument = isDocument;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has children, `false` otherwise.
|
||||
*/
|
||||
function hasChildren(node) {
|
||||
return Object.prototype.hasOwnProperty.call(node, "children");
|
||||
}
|
||||
exports.hasChildren = hasChildren;
|
||||
/**
|
||||
* Clone a node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
function cloneNode(node, recursive) {
|
||||
if (recursive === void 0) { recursive = false; }
|
||||
var result;
|
||||
if (isText(node)) {
|
||||
result = new Text(node.data);
|
||||
}
|
||||
else if (isComment(node)) {
|
||||
result = new Comment(node.data);
|
||||
}
|
||||
else if (isTag(node)) {
|
||||
var children = recursive ? cloneChildren(node.children) : [];
|
||||
var clone_1 = new Element(node.name, __assign({}, node.attribs), children);
|
||||
children.forEach(function (child) { return (child.parent = clone_1); });
|
||||
if (node.namespace != null) {
|
||||
clone_1.namespace = node.namespace;
|
||||
}
|
||||
if (node["x-attribsNamespace"]) {
|
||||
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
|
||||
}
|
||||
if (node["x-attribsPrefix"]) {
|
||||
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
|
||||
}
|
||||
result = clone_1;
|
||||
}
|
||||
else if (isCDATA(node)) {
|
||||
var children = recursive ? cloneChildren(node.children) : [];
|
||||
var clone_2 = new CDATA(children);
|
||||
children.forEach(function (child) { return (child.parent = clone_2); });
|
||||
result = clone_2;
|
||||
}
|
||||
else if (isDocument(node)) {
|
||||
var children = recursive ? cloneChildren(node.children) : [];
|
||||
var clone_3 = new Document(children);
|
||||
children.forEach(function (child) { return (child.parent = clone_3); });
|
||||
if (node["x-mode"]) {
|
||||
clone_3["x-mode"] = node["x-mode"];
|
||||
}
|
||||
result = clone_3;
|
||||
}
|
||||
else if (isDirective(node)) {
|
||||
var instruction = new ProcessingInstruction(node.name, node.data);
|
||||
if (node["x-name"] != null) {
|
||||
instruction["x-name"] = node["x-name"];
|
||||
instruction["x-publicId"] = node["x-publicId"];
|
||||
instruction["x-systemId"] = node["x-systemId"];
|
||||
}
|
||||
result = instruction;
|
||||
}
|
||||
else {
|
||||
throw new Error("Not implemented yet: ".concat(node.type));
|
||||
}
|
||||
result.startIndex = node.startIndex;
|
||||
result.endIndex = node.endIndex;
|
||||
if (node.sourceCodeLocation != null) {
|
||||
result.sourceCodeLocation = node.sourceCodeLocation;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.cloneNode = cloneNode;
|
||||
function cloneChildren(childs) {
|
||||
var children = childs.map(function (child) { return cloneNode(child, true); });
|
||||
for (var i = 1; i < children.length; i++) {
|
||||
children[i].prev = children[i - 1];
|
||||
children[i - 1].next = children[i];
|
||||
}
|
||||
return children;
|
||||
}
|
||||
73
skills/imap-smtp-email/node_modules/domhandler/package.json
generated
vendored
Normal file
73
skills/imap-smtp-email/node_modules/domhandler/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "domhandler",
|
||||
"version": "5.0.3",
|
||||
"description": "Handler for htmlparser2 that turns pages into a dom",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domhandler?sponsor=1"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"module": "lib/esm/index.js",
|
||||
"exports": {
|
||||
"require": "./lib/index.js",
|
||||
"import": "./lib/esm/index.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run test:jest && npm run lint",
|
||||
"test:jest": "jest",
|
||||
"lint": "npm run lint:es && npm run lint:prettier",
|
||||
"lint:es": "eslint --ignore-path .gitignore .",
|
||||
"lint:prettier": "npm run prettier -- --check",
|
||||
"format": "npm run format:es && npm run format:prettier",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:prettier": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.{ts,md,json,yml}\" --ignore-path .gitignore",
|
||||
"build": "npm run build:cjs && npm run build:esm",
|
||||
"build:cjs": "tsc",
|
||||
"build:esm": "tsc --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/domhandler.git"
|
||||
},
|
||||
"keywords": [
|
||||
"dom",
|
||||
"htmlparser2"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^17.0.30",
|
||||
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
||||
"@typescript-eslint/parser": "^5.21.0",
|
||||
"eslint": "^8.14.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"htmlparser2": "^8.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.6.2",
|
||||
"ts-jest": "^27.1.4",
|
||||
"typescript": "^4.6.4"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node",
|
||||
"moduleNameMapper": {
|
||||
"^(.*)\\.js$": "$1"
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 4
|
||||
}
|
||||
}
|
||||
92
skills/imap-smtp-email/node_modules/domhandler/readme.md
generated
vendored
Normal file
92
skills/imap-smtp-email/node_modules/domhandler/readme.md
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
# domhandler [](https://travis-ci.com/fb55/domhandler)
|
||||
|
||||
The DOM handler creates a tree containing all nodes of a page.
|
||||
The tree can be manipulated using the [domutils](https://github.com/fb55/domutils)
|
||||
or [cheerio](https://github.com/cheeriojs/cheerio) libraries and
|
||||
rendered using [dom-serializer](https://github.com/cheeriojs/dom-serializer) .
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
const handler = new DomHandler([ <func> callback(err, dom), ] [ <obj> options ]);
|
||||
// const parser = new Parser(handler[, options]);
|
||||
```
|
||||
|
||||
Available options are described below.
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
const { Parser } = require("htmlparser2");
|
||||
const { DomHandler } = require("domhandler");
|
||||
const rawHtml =
|
||||
"Xyz <script language= javascript>var foo = '<<bar>>';</script><!--<!-- Waah! -- -->";
|
||||
const handler = new DomHandler((error, dom) => {
|
||||
if (error) {
|
||||
// Handle error
|
||||
} else {
|
||||
// Parsing completed, do something
|
||||
console.log(dom);
|
||||
}
|
||||
});
|
||||
const parser = new Parser(handler);
|
||||
parser.write(rawHtml);
|
||||
parser.end();
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
data: "Xyz ",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
type: "script",
|
||||
name: "script",
|
||||
attribs: {
|
||||
language: "javascript",
|
||||
},
|
||||
children: [
|
||||
{
|
||||
data: "var foo = '<bar>';<",
|
||||
type: "text",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
data: "<!-- Waah! -- ",
|
||||
type: "comment",
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
## Option: `withStartIndices`
|
||||
|
||||
Add a `startIndex` property to nodes.
|
||||
When the parser is used in a non-streaming fashion, `startIndex` is an integer
|
||||
indicating the position of the start of the node in the document.
|
||||
The default value is `false`.
|
||||
|
||||
## Option: `withEndIndices`
|
||||
|
||||
Add an `endIndex` property to nodes.
|
||||
When the parser is used in a non-streaming fashion, `endIndex` is an integer
|
||||
indicating the position of the end of the node in the document.
|
||||
The default value is `false`.
|
||||
|
||||
---
|
||||
|
||||
License: BSD-2-Clause
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## `domhandler` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of `domhandler` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-domhandler?utm_source=npm-domhandler&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
11
skills/imap-smtp-email/node_modules/domutils/LICENSE
generated
vendored
Normal file
11
skills/imap-smtp-email/node_modules/domutils/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
71
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.d.ts
generated
vendored
Normal file
71
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.d.ts
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { AnyNode } from "domhandler";
|
||||
/**
|
||||
* The medium of a media item.
|
||||
*
|
||||
* @category Feeds
|
||||
*/
|
||||
export type FeedItemMediaMedium = "image" | "audio" | "video" | "document" | "executable";
|
||||
/**
|
||||
* The type of a media item.
|
||||
*
|
||||
* @category Feeds
|
||||
*/
|
||||
export type FeedItemMediaExpression = "sample" | "full" | "nonstop";
|
||||
/**
|
||||
* A media item of a feed entry.
|
||||
*
|
||||
* @category Feeds
|
||||
*/
|
||||
export interface FeedItemMedia {
|
||||
medium: FeedItemMediaMedium | undefined;
|
||||
isDefault: boolean;
|
||||
url?: string;
|
||||
fileSize?: number;
|
||||
type?: string;
|
||||
expression?: FeedItemMediaExpression;
|
||||
bitrate?: number;
|
||||
framerate?: number;
|
||||
samplingrate?: number;
|
||||
channels?: number;
|
||||
duration?: number;
|
||||
height?: number;
|
||||
width?: number;
|
||||
lang?: string;
|
||||
}
|
||||
/**
|
||||
* An entry of a feed.
|
||||
*
|
||||
* @category Feeds
|
||||
*/
|
||||
export interface FeedItem {
|
||||
id?: string;
|
||||
title?: string;
|
||||
link?: string;
|
||||
description?: string;
|
||||
pubDate?: Date;
|
||||
media: FeedItemMedia[];
|
||||
}
|
||||
/**
|
||||
* The root of a feed.
|
||||
*
|
||||
* @category Feeds
|
||||
*/
|
||||
export interface Feed {
|
||||
type: string;
|
||||
id?: string;
|
||||
title?: string;
|
||||
link?: string;
|
||||
description?: string;
|
||||
updated?: Date;
|
||||
author?: string;
|
||||
items: FeedItem[];
|
||||
}
|
||||
/**
|
||||
* Get the feed object from the root of a DOM tree.
|
||||
*
|
||||
* @category Feeds
|
||||
* @param doc - The DOM to to extract the feed from.
|
||||
* @returns The feed.
|
||||
*/
|
||||
export declare function getFeed(doc: AnyNode[]): Feed | null;
|
||||
//# sourceMappingURL=feeds.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"feeds.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["feeds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,YAAY,CAAC;AAInD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GACzB,OAAO,GACP,OAAO,GACP,OAAO,GACP,UAAU,GACV,YAAY,CAAC;AAEnB;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAQnD"}
|
||||
183
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.js
generated
vendored
Normal file
183
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.js
generated
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
import { textContent } from "./stringify.js";
|
||||
import { getElementsByTagName } from "./legacy.js";
|
||||
/**
|
||||
* Get the feed object from the root of a DOM tree.
|
||||
*
|
||||
* @category Feeds
|
||||
* @param doc - The DOM to to extract the feed from.
|
||||
* @returns The feed.
|
||||
*/
|
||||
export function getFeed(doc) {
|
||||
const feedRoot = getOneElement(isValidFeed, doc);
|
||||
return !feedRoot
|
||||
? null
|
||||
: feedRoot.name === "feed"
|
||||
? getAtomFeed(feedRoot)
|
||||
: getRssFeed(feedRoot);
|
||||
}
|
||||
/**
|
||||
* Parse an Atom feed.
|
||||
*
|
||||
* @param feedRoot The root of the feed.
|
||||
* @returns The parsed feed.
|
||||
*/
|
||||
function getAtomFeed(feedRoot) {
|
||||
var _a;
|
||||
const childs = feedRoot.children;
|
||||
const feed = {
|
||||
type: "atom",
|
||||
items: getElementsByTagName("entry", childs).map((item) => {
|
||||
var _a;
|
||||
const { children } = item;
|
||||
const entry = { media: getMediaElements(children) };
|
||||
addConditionally(entry, "id", "id", children);
|
||||
addConditionally(entry, "title", "title", children);
|
||||
const href = (_a = getOneElement("link", children)) === null || _a === void 0 ? void 0 : _a.attribs["href"];
|
||||
if (href) {
|
||||
entry.link = href;
|
||||
}
|
||||
const description = fetch("summary", children) || fetch("content", children);
|
||||
if (description) {
|
||||
entry.description = description;
|
||||
}
|
||||
const pubDate = fetch("updated", children);
|
||||
if (pubDate) {
|
||||
entry.pubDate = new Date(pubDate);
|
||||
}
|
||||
return entry;
|
||||
}),
|
||||
};
|
||||
addConditionally(feed, "id", "id", childs);
|
||||
addConditionally(feed, "title", "title", childs);
|
||||
const href = (_a = getOneElement("link", childs)) === null || _a === void 0 ? void 0 : _a.attribs["href"];
|
||||
if (href) {
|
||||
feed.link = href;
|
||||
}
|
||||
addConditionally(feed, "description", "subtitle", childs);
|
||||
const updated = fetch("updated", childs);
|
||||
if (updated) {
|
||||
feed.updated = new Date(updated);
|
||||
}
|
||||
addConditionally(feed, "author", "email", childs, true);
|
||||
return feed;
|
||||
}
|
||||
/**
|
||||
* Parse a RSS feed.
|
||||
*
|
||||
* @param feedRoot The root of the feed.
|
||||
* @returns The parsed feed.
|
||||
*/
|
||||
function getRssFeed(feedRoot) {
|
||||
var _a, _b;
|
||||
const childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
|
||||
const feed = {
|
||||
type: feedRoot.name.substr(0, 3),
|
||||
id: "",
|
||||
items: getElementsByTagName("item", feedRoot.children).map((item) => {
|
||||
const { children } = item;
|
||||
const entry = { media: getMediaElements(children) };
|
||||
addConditionally(entry, "id", "guid", children);
|
||||
addConditionally(entry, "title", "title", children);
|
||||
addConditionally(entry, "link", "link", children);
|
||||
addConditionally(entry, "description", "description", children);
|
||||
const pubDate = fetch("pubDate", children) || fetch("dc:date", children);
|
||||
if (pubDate)
|
||||
entry.pubDate = new Date(pubDate);
|
||||
return entry;
|
||||
}),
|
||||
};
|
||||
addConditionally(feed, "title", "title", childs);
|
||||
addConditionally(feed, "link", "link", childs);
|
||||
addConditionally(feed, "description", "description", childs);
|
||||
const updated = fetch("lastBuildDate", childs);
|
||||
if (updated) {
|
||||
feed.updated = new Date(updated);
|
||||
}
|
||||
addConditionally(feed, "author", "managingEditor", childs, true);
|
||||
return feed;
|
||||
}
|
||||
const MEDIA_KEYS_STRING = ["url", "type", "lang"];
|
||||
const MEDIA_KEYS_INT = [
|
||||
"fileSize",
|
||||
"bitrate",
|
||||
"framerate",
|
||||
"samplingrate",
|
||||
"channels",
|
||||
"duration",
|
||||
"height",
|
||||
"width",
|
||||
];
|
||||
/**
|
||||
* Get all media elements of a feed item.
|
||||
*
|
||||
* @param where Nodes to search in.
|
||||
* @returns Media elements.
|
||||
*/
|
||||
function getMediaElements(where) {
|
||||
return getElementsByTagName("media:content", where).map((elem) => {
|
||||
const { attribs } = elem;
|
||||
const media = {
|
||||
medium: attribs["medium"],
|
||||
isDefault: !!attribs["isDefault"],
|
||||
};
|
||||
for (const attrib of MEDIA_KEYS_STRING) {
|
||||
if (attribs[attrib]) {
|
||||
media[attrib] = attribs[attrib];
|
||||
}
|
||||
}
|
||||
for (const attrib of MEDIA_KEYS_INT) {
|
||||
if (attribs[attrib]) {
|
||||
media[attrib] = parseInt(attribs[attrib], 10);
|
||||
}
|
||||
}
|
||||
if (attribs["expression"]) {
|
||||
media.expression = attribs["expression"];
|
||||
}
|
||||
return media;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get one element by tag name.
|
||||
*
|
||||
* @param tagName Tag name to look for
|
||||
* @param node Node to search in
|
||||
* @returns The element or null
|
||||
*/
|
||||
function getOneElement(tagName, node) {
|
||||
return getElementsByTagName(tagName, node, true, 1)[0];
|
||||
}
|
||||
/**
|
||||
* Get the text content of an element with a certain tag name.
|
||||
*
|
||||
* @param tagName Tag name to look for.
|
||||
* @param where Node to search in.
|
||||
* @param recurse Whether to recurse into child nodes.
|
||||
* @returns The text content of the element.
|
||||
*/
|
||||
function fetch(tagName, where, recurse = false) {
|
||||
return textContent(getElementsByTagName(tagName, where, recurse, 1)).trim();
|
||||
}
|
||||
/**
|
||||
* Adds a property to an object if it has a value.
|
||||
*
|
||||
* @param obj Object to be extended
|
||||
* @param prop Property name
|
||||
* @param tagName Tag name that contains the conditionally added property
|
||||
* @param where Element to search for the property
|
||||
* @param recurse Whether to recurse into child nodes.
|
||||
*/
|
||||
function addConditionally(obj, prop, tagName, where, recurse = false) {
|
||||
const val = fetch(tagName, where, recurse);
|
||||
if (val)
|
||||
obj[prop] = val;
|
||||
}
|
||||
/**
|
||||
* Checks if an element is a feed root node.
|
||||
*
|
||||
* @param value The name of the element to check.
|
||||
* @returns Whether an element is a feed root node.
|
||||
*/
|
||||
function isValidFeed(value) {
|
||||
return value === "rss" || value === "feed" || value === "rdf:RDF";
|
||||
}
|
||||
//# sourceMappingURL=feeds.js.map
|
||||
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.js.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/feeds.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.d.ts
generated
vendored
Normal file
59
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { AnyNode } from "domhandler";
|
||||
/**
|
||||
* Given an array of nodes, remove any member that is contained by another
|
||||
* member.
|
||||
*
|
||||
* @category Helpers
|
||||
* @param nodes Nodes to filter.
|
||||
* @returns Remaining nodes that aren't contained by other nodes.
|
||||
*/
|
||||
export declare function removeSubsets(nodes: AnyNode[]): AnyNode[];
|
||||
/**
|
||||
* @category Helpers
|
||||
* @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}
|
||||
*/
|
||||
export declare const enum DocumentPosition {
|
||||
DISCONNECTED = 1,
|
||||
PRECEDING = 2,
|
||||
FOLLOWING = 4,
|
||||
CONTAINS = 8,
|
||||
CONTAINED_BY = 16
|
||||
}
|
||||
/**
|
||||
* Compare the position of one node against another node in any other document,
|
||||
* returning a bitmask with the values from {@link DocumentPosition}.
|
||||
*
|
||||
* Document order:
|
||||
* > There is an ordering, document order, defined on all the nodes in the
|
||||
* > document corresponding to the order in which the first character of the
|
||||
* > XML representation of each node occurs in the XML representation of the
|
||||
* > document after expansion of general entities. Thus, the document element
|
||||
* > node will be the first node. Element nodes occur before their children.
|
||||
* > Thus, document order orders element nodes in order of the occurrence of
|
||||
* > their start-tag in the XML (after expansion of entities). The attribute
|
||||
* > nodes of an element occur after the element and before its children. The
|
||||
* > relative order of attribute nodes is implementation-dependent.
|
||||
*
|
||||
* Source:
|
||||
* http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
|
||||
*
|
||||
* @category Helpers
|
||||
* @param nodeA The first node to use in the comparison
|
||||
* @param nodeB The second node to use in the comparison
|
||||
* @returns A bitmask describing the input nodes' relative position.
|
||||
*
|
||||
* See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
|
||||
* a description of these values.
|
||||
*/
|
||||
export declare function compareDocumentPosition(nodeA: AnyNode, nodeB: AnyNode): number;
|
||||
/**
|
||||
* Sort an array of nodes based on their relative position in the document,
|
||||
* removing any duplicate nodes. If the array contains nodes that do not belong
|
||||
* to the same document, sort order is unspecified.
|
||||
*
|
||||
* @category Helpers
|
||||
* @param nodes Array of DOM nodes.
|
||||
* @returns Collection of unique nodes, sorted in document order.
|
||||
*/
|
||||
export declare function uniqueSort<T extends AnyNode>(nodes: T[]): T[];
|
||||
//# sourceMappingURL=helpers.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"helpers.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,OAAO,EAAc,MAAM,YAAY,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CA6BzD;AACD;;;GAGG;AACH,0BAAkB,gBAAgB;IAC9B,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,YAAY,KAAK;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,OAAO,GACf,MAAM,CA4CR;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAc7D"}
|
||||
136
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.js
generated
vendored
Normal file
136
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
import { hasChildren } from "domhandler";
|
||||
/**
|
||||
* Given an array of nodes, remove any member that is contained by another
|
||||
* member.
|
||||
*
|
||||
* @category Helpers
|
||||
* @param nodes Nodes to filter.
|
||||
* @returns Remaining nodes that aren't contained by other nodes.
|
||||
*/
|
||||
export function removeSubsets(nodes) {
|
||||
let idx = nodes.length;
|
||||
/*
|
||||
* Check if each node (or one of its ancestors) is already contained in the
|
||||
* array.
|
||||
*/
|
||||
while (--idx >= 0) {
|
||||
const node = nodes[idx];
|
||||
/*
|
||||
* Remove the node if it is not unique.
|
||||
* We are going through the array from the end, so we only
|
||||
* have to check nodes that preceed the node under consideration in the array.
|
||||
*/
|
||||
if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
|
||||
nodes.splice(idx, 1);
|
||||
continue;
|
||||
}
|
||||
for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
|
||||
if (nodes.includes(ancestor)) {
|
||||
nodes.splice(idx, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
/**
|
||||
* @category Helpers
|
||||
* @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}
|
||||
*/
|
||||
export var DocumentPosition;
|
||||
(function (DocumentPosition) {
|
||||
DocumentPosition[DocumentPosition["DISCONNECTED"] = 1] = "DISCONNECTED";
|
||||
DocumentPosition[DocumentPosition["PRECEDING"] = 2] = "PRECEDING";
|
||||
DocumentPosition[DocumentPosition["FOLLOWING"] = 4] = "FOLLOWING";
|
||||
DocumentPosition[DocumentPosition["CONTAINS"] = 8] = "CONTAINS";
|
||||
DocumentPosition[DocumentPosition["CONTAINED_BY"] = 16] = "CONTAINED_BY";
|
||||
})(DocumentPosition || (DocumentPosition = {}));
|
||||
/**
|
||||
* Compare the position of one node against another node in any other document,
|
||||
* returning a bitmask with the values from {@link DocumentPosition}.
|
||||
*
|
||||
* Document order:
|
||||
* > There is an ordering, document order, defined on all the nodes in the
|
||||
* > document corresponding to the order in which the first character of the
|
||||
* > XML representation of each node occurs in the XML representation of the
|
||||
* > document after expansion of general entities. Thus, the document element
|
||||
* > node will be the first node. Element nodes occur before their children.
|
||||
* > Thus, document order orders element nodes in order of the occurrence of
|
||||
* > their start-tag in the XML (after expansion of entities). The attribute
|
||||
* > nodes of an element occur after the element and before its children. The
|
||||
* > relative order of attribute nodes is implementation-dependent.
|
||||
*
|
||||
* Source:
|
||||
* http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
|
||||
*
|
||||
* @category Helpers
|
||||
* @param nodeA The first node to use in the comparison
|
||||
* @param nodeB The second node to use in the comparison
|
||||
* @returns A bitmask describing the input nodes' relative position.
|
||||
*
|
||||
* See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
|
||||
* a description of these values.
|
||||
*/
|
||||
export function compareDocumentPosition(nodeA, nodeB) {
|
||||
const aParents = [];
|
||||
const bParents = [];
|
||||
if (nodeA === nodeB) {
|
||||
return 0;
|
||||
}
|
||||
let current = hasChildren(nodeA) ? nodeA : nodeA.parent;
|
||||
while (current) {
|
||||
aParents.unshift(current);
|
||||
current = current.parent;
|
||||
}
|
||||
current = hasChildren(nodeB) ? nodeB : nodeB.parent;
|
||||
while (current) {
|
||||
bParents.unshift(current);
|
||||
current = current.parent;
|
||||
}
|
||||
const maxIdx = Math.min(aParents.length, bParents.length);
|
||||
let idx = 0;
|
||||
while (idx < maxIdx && aParents[idx] === bParents[idx]) {
|
||||
idx++;
|
||||
}
|
||||
if (idx === 0) {
|
||||
return DocumentPosition.DISCONNECTED;
|
||||
}
|
||||
const sharedParent = aParents[idx - 1];
|
||||
const siblings = sharedParent.children;
|
||||
const aSibling = aParents[idx];
|
||||
const bSibling = bParents[idx];
|
||||
if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
|
||||
if (sharedParent === nodeB) {
|
||||
return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;
|
||||
}
|
||||
return DocumentPosition.FOLLOWING;
|
||||
}
|
||||
if (sharedParent === nodeA) {
|
||||
return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;
|
||||
}
|
||||
return DocumentPosition.PRECEDING;
|
||||
}
|
||||
/**
|
||||
* Sort an array of nodes based on their relative position in the document,
|
||||
* removing any duplicate nodes. If the array contains nodes that do not belong
|
||||
* to the same document, sort order is unspecified.
|
||||
*
|
||||
* @category Helpers
|
||||
* @param nodes Array of DOM nodes.
|
||||
* @returns Collection of unique nodes, sorted in document order.
|
||||
*/
|
||||
export function uniqueSort(nodes) {
|
||||
nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
|
||||
nodes.sort((a, b) => {
|
||||
const relative = compareDocumentPosition(a, b);
|
||||
if (relative & DocumentPosition.PRECEDING) {
|
||||
return -1;
|
||||
}
|
||||
else if (relative & DocumentPosition.FOLLOWING) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
return nodes;
|
||||
}
|
||||
//# sourceMappingURL=helpers.js.map
|
||||
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.js.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/helpers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"helpers.js","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,YAAY,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAgB;IAC1C,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IAEvB;;;OAGG;IACH,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAChB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAExB;;;;WAIG;QACH,IAAI,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACrB,SAAS;QACb,CAAC;QAED,KAAK,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpE,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC3B,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBACrB,MAAM;YACV,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;;;GAGG;AACH,MAAM,CAAN,IAAkB,gBAMjB;AAND,WAAkB,gBAAgB;IAC9B,uEAAgB,CAAA;IAChB,iEAAa,CAAA;IACb,iEAAa,CAAA;IACb,+DAAY,CAAA;IACZ,wEAAiB,CAAA;AACrB,CAAC,EANiB,gBAAgB,KAAhB,gBAAgB,QAMjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,uBAAuB,CACnC,KAAc,EACd,KAAc;IAEd,MAAM,QAAQ,GAAiB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAiB,EAAE,CAAC;IAElC,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC;IACb,CAAC;IAED,IAAI,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;IACxD,OAAO,OAAO,EAAE,CAAC;QACb,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;IACpD,OAAO,OAAO,EAAE,CAAC;QACb,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,GAAG,MAAM,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrD,GAAG,EAAE,CAAC;IACV,CAAC;IAED,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,gBAAgB,CAAC,YAAY,CAAC;IACzC,CAAC;IAED,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAc,YAAY,CAAC,QAAQ,CAAC;IAClD,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE/B,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;YACzB,OAAO,gBAAgB,CAAC,SAAS,GAAG,gBAAgB,CAAC,YAAY,CAAC;QACtE,CAAC;QACD,OAAO,gBAAgB,CAAC,SAAS,CAAC;IACtC,CAAC;IACD,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;QACzB,OAAO,gBAAgB,CAAC,SAAS,GAAG,gBAAgB,CAAC,QAAQ,CAAC;IAClE,CAAC;IACD,OAAO,gBAAgB,CAAC,SAAS,CAAC;AACtC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAoB,KAAU;IACpD,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEnE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChB,MAAM,QAAQ,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/C,IAAI,QAAQ,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;YACxC,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,QAAQ,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;YAC/C,OAAO,CAAC,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
||||
10
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.d.ts
generated
vendored
Normal file
10
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export * from "./stringify.js";
|
||||
export * from "./traversal.js";
|
||||
export * from "./manipulation.js";
|
||||
export * from "./querying.js";
|
||||
export * from "./legacy.js";
|
||||
export * from "./helpers.js";
|
||||
export * from "./feeds.js";
|
||||
/** @deprecated Use these methods from `domhandler` directly. */
|
||||
export { isTag, isCDATA, isText, isComment, isDocument, hasChildren, } from "domhandler";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.d.ts.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,gEAAgE;AAChE,OAAO,EACH,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,GACd,MAAM,YAAY,CAAC"}
|
||||
10
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.js
generated
vendored
Normal file
10
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export * from "./stringify.js";
|
||||
export * from "./traversal.js";
|
||||
export * from "./manipulation.js";
|
||||
export * from "./querying.js";
|
||||
export * from "./legacy.js";
|
||||
export * from "./helpers.js";
|
||||
export * from "./feeds.js";
|
||||
/** @deprecated Use these methods from `domhandler` directly. */
|
||||
export { isTag, isCDATA, isText, isComment, isDocument, hasChildren, } from "domhandler";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.js.map
generated
vendored
Normal file
1
skills/imap-smtp-email/node_modules/domutils/lib/esm/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,gEAAgE;AAChE,OAAO,EACH,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,GACd,MAAM,YAAY,CAAC"}
|
||||
79
skills/imap-smtp-email/node_modules/domutils/lib/esm/legacy.d.ts
generated
vendored
Normal file
79
skills/imap-smtp-email/node_modules/domutils/lib/esm/legacy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
import { AnyNode, Element } from "domhandler";
|
||||
import type { ElementType } from "domelementtype";
|
||||
/**
|
||||
* An object with keys to check elements against. If a key is `tag_name`,
|
||||
* `tag_type` or `tag_contains`, it will check the value against that specific
|
||||
* value. Otherwise, it will check an attribute with the key's name.
|
||||
*
|
||||
* @category Legacy Query Functions
|
||||
*/
|
||||
export interface TestElementOpts {
|
||||
tag_name?: string | ((name: string) => boolean);
|
||||
tag_type?: string | ((name: string) => boolean);
|
||||
tag_contains?: string | ((data?: string) => boolean);
|
||||
[attributeName: string]: undefined | string | ((attributeValue: string) => boolean);
|
||||
}
|
||||
/**
|
||||
* Checks whether a node matches the description in `options`.
|
||||
*
|
||||
* @category Legacy Query Functions
|
||||
* @param options An object describing nodes to look for.
|
||||
* @param node The element to test.
|
||||
* @returns Whether the element matches the description in `options`.
|
||||
*/
|
||||
export declare function testElement(options: TestElementOpts, node: AnyNode): boolean;
|
||||
/**
|
||||
* Returns all nodes that match `options`.
|
||||
*
|
||||
* @category Legacy Query Functions
|
||||
* @param options An object describing nodes to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes that match `options`.
|
||||
*/
|
||||
export declare function getElements(options: TestElementOpts, nodes: AnyNode | AnyNode[], recurse: boolean, limit?: number): AnyNode[];
|
||||
/**
|
||||
* Returns the node with the supplied ID.
|
||||
*
|
||||
* @category Legacy Query Functions
|
||||
* @param id The unique ID attribute value to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @returns The node with the supplied ID.
|
||||
*/
|
||||
export declare function getElementById(id: string | ((id: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean): Element | null;
|
||||
/**
|
||||
* Returns all nodes with the supplied `tagName`.
|
||||
*
|
||||
* @category Legacy Query Functions
|
||||
* @param tagName Tag name to search for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes with the supplied `tagName`.
|
||||
*/
|
||||
export declare function getElementsByTagName(tagName: string | ((name: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): Element[];
|
||||
/**
|
||||
* Returns all nodes with the supplied `className`.
|
||||
*
|
||||
* @category Legacy Query Functions
|
||||
* @param className Class name to search for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes with the supplied `className`.
|
||||
*/
|
||||
export declare function getElementsByClassName(className: string | ((name: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): Element[];
|
||||
/**
|
||||
* Returns all nodes with the supplied `type`.
|
||||
*
|
||||
* @category Legacy Query Functions
|
||||
* @param type Element type to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes with the supplied `type`.
|
||||
*/
|
||||
export declare function getElementsByTagType(type: ElementType | ((type: ElementType) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): AnyNode[];
|
||||
//# sourceMappingURL=legacy.d.ts.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user