clean without courrier and calendar
This commit is contained in:
parent
9c1f814aca
commit
d80ccb60ea
6
node_modules/.package-lock.json
generated
vendored
6
node_modules/.package-lock.json
generated
vendored
@ -5916,6 +5916,12 @@
|
||||
"utf8": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/vcard-parser": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vcard-parser/-/vcard-parser-1.0.0.tgz",
|
||||
"integrity": "sha512-rSEjrjBK3of4VimMR5vBjLLcN5ZCSp9yuVzyx5i4Fwx74Yd0s+DnHtSit/wAAtj1a7/T/qQc0ykwXADoD0+fTQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/victory-vendor": {
|
||||
"version": "36.9.2",
|
||||
"resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz",
|
||||
|
||||
24
node_modules/vcard-parser/.editorconfig
generated
vendored
Normal file
24
node_modules/vcard-parser/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
|
||||
# Change these settings to your own preference
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.vcf]
|
||||
insert_final_newline = false
|
||||
|
||||
[package.json]
|
||||
indent_size = 2
|
||||
9
node_modules/vcard-parser/.travis.yml
generated
vendored
Normal file
9
node_modules/vcard-parser/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "5.10"
|
||||
|
||||
before_script:
|
||||
- yarn
|
||||
|
||||
script:
|
||||
- yarn test
|
||||
21
node_modules/vcard-parser/LICENSE
generated
vendored
Normal file
21
node_modules/vcard-parser/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Aleksandr Kitov
|
||||
|
||||
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.
|
||||
40
node_modules/vcard-parser/README.md
generated
vendored
Normal file
40
node_modules/vcard-parser/README.md
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
vcard
|
||||
===
|
||||
|
||||
## Introduction
|
||||
vcard allow you to parse vCard data into js object and convert js object into vCard data.
|
||||
It can work both in browser and in node.
|
||||
|
||||
## Installation
|
||||
|
||||
Using npm:
|
||||
```sh
|
||||
npm install vcard-parser
|
||||
```
|
||||
|
||||
## Example of usage:
|
||||
```javascript
|
||||
var vCard = require('vcard-parser');
|
||||
var raw = 'BEGIN:VCARD\r\n' +
|
||||
'FN:Forrest Gump\r\n' +
|
||||
'N:Gump;Forrest;;Mr.;\r\n' +
|
||||
'TEL;TYPE=HOME:78884545247\r\n' +
|
||||
'END:VCARD';
|
||||
var card = vCard.parse(raw);
|
||||
|
||||
expect(card.fn).toEqual([
|
||||
{value: 'Forrest Gump'}
|
||||
]);
|
||||
expect(card.n).toEqual([{
|
||||
value: [
|
||||
'Gump', 'Forrest', '', 'Mr.', ''
|
||||
]
|
||||
}]);
|
||||
expect(card.tel).toEqual([
|
||||
{value: '78884545247', meta: {type: ['HOME']}}
|
||||
]);
|
||||
|
||||
var generated = vCard.generate(card);
|
||||
|
||||
expect(generated).toEqual(raw);
|
||||
```
|
||||
302
node_modules/vcard-parser/lib/vcard.js
generated
vendored
Normal file
302
node_modules/vcard-parser/lib/vcard.js
generated
vendored
Normal file
@ -0,0 +1,302 @@
|
||||
var PREFIX = 'BEGIN:VCARD',
|
||||
POSTFIX = 'END:VCARD';
|
||||
|
||||
/**
|
||||
* Return json representation of vCard
|
||||
* @param {string} string raw vCard
|
||||
* @returns {*}
|
||||
*/
|
||||
function parse(string) {
|
||||
var result = {},
|
||||
lines = string.split(/\r\n|\r|\n/),
|
||||
count = lines.length,
|
||||
pieces,
|
||||
key,
|
||||
value,
|
||||
meta,
|
||||
namespace;
|
||||
|
||||
for (var i = 0; i < count; i++) {
|
||||
if (lines[i] === '') {
|
||||
continue;
|
||||
}
|
||||
if (lines[i].toUpperCase() === PREFIX || lines[i].toUpperCase() === POSTFIX) {
|
||||
continue;
|
||||
}
|
||||
var data = lines[i];
|
||||
|
||||
/**
|
||||
* Check that next line continues current
|
||||
* @param {number} i
|
||||
* @returns {boolean}
|
||||
*/
|
||||
var isValueContinued = function (i) {
|
||||
return i + 1 < count && (lines[i + 1][0] === ' ' || lines[i + 1][0] === '\t');
|
||||
};
|
||||
// handle multiline properties (i.e. photo).
|
||||
// next line should start with space or tab character
|
||||
if (isValueContinued(i)) {
|
||||
while (isValueContinued(i)) {
|
||||
data += lines[i + 1].trim();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
pieces = data.split(':');
|
||||
key = pieces.shift();
|
||||
value = pieces.join(':');
|
||||
namespace = false;
|
||||
meta = {};
|
||||
|
||||
// meta fields in property
|
||||
if (key.match(/;/)) {
|
||||
key = key
|
||||
.replace(/\\;/g, 'ΩΩΩ')
|
||||
.replace(/\\,/, ',');
|
||||
var metaArr = key.split(';').map(function (item) {
|
||||
return item.replace(/ΩΩΩ/g, ';');
|
||||
});
|
||||
key = metaArr.shift();
|
||||
metaArr.forEach(function (item) {
|
||||
var arr = item.split('=');
|
||||
arr[0] = arr[0].toLowerCase();
|
||||
if (arr[0].length === 0) {
|
||||
return;
|
||||
}
|
||||
if (meta[arr[0]]) {
|
||||
meta[arr[0]].push(arr[1]);
|
||||
} else {
|
||||
meta[arr[0]] = [arr[1]];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// values with \n
|
||||
value = value
|
||||
.replace(/\\n/g, '\n');
|
||||
|
||||
value = tryToSplit(value);
|
||||
|
||||
// Grouped properties
|
||||
if (key.match(/\./)) {
|
||||
var arr = key.split('.');
|
||||
key = arr[1];
|
||||
namespace = arr[0];
|
||||
}
|
||||
|
||||
var newValue = {
|
||||
value: value
|
||||
};
|
||||
if (Object.keys(meta).length) {
|
||||
newValue.meta = meta;
|
||||
}
|
||||
if (namespace) {
|
||||
newValue.namespace = namespace;
|
||||
}
|
||||
|
||||
if (key.indexOf('X-') !== 0) {
|
||||
key = key.toLowerCase();
|
||||
}
|
||||
|
||||
if (typeof result[key] === 'undefined') {
|
||||
result[key] = [newValue];
|
||||
} else {
|
||||
result[key].push(newValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
var HAS_SEMICOLON_SEPARATOR = /[^\\];|^;/,
|
||||
HAS_COMMA_SEPARATOR = /[^\\],|^,/;
|
||||
/**
|
||||
* Split value by "," or ";" and remove escape sequences for this separators
|
||||
* @param {string} value
|
||||
* @returns {string|string[]
|
||||
*/
|
||||
function tryToSplit(value) {
|
||||
if (value.match(HAS_SEMICOLON_SEPARATOR)) {
|
||||
value = value.replace(/\\,/g, ',');
|
||||
return splitValue(value, ';');
|
||||
} else if (value.match(HAS_COMMA_SEPARATOR)) {
|
||||
value = value.replace(/\\;/g, ';');
|
||||
return splitValue(value, ',');
|
||||
} else {
|
||||
return value
|
||||
.replace(/\\,/g, ',')
|
||||
.replace(/\\;/g, ';');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Split vcard field value by separator
|
||||
* @param {string|string[]} value
|
||||
* @param {string} separator
|
||||
* @returns {string|string[]}
|
||||
*/
|
||||
function splitValue(value, separator) {
|
||||
var separatorRegexp = new RegExp(separator);
|
||||
var escapedSeparatorRegexp = new RegExp('\\\\' + separator, 'g');
|
||||
// easiest way, replace it with really rare character sequence
|
||||
value = value.replace(escapedSeparatorRegexp, 'ΩΩΩ');
|
||||
if (value.match(separatorRegexp)) {
|
||||
value = value.split(separator);
|
||||
|
||||
value = value.map(function (item) {
|
||||
return item.replace(/ΩΩΩ/g, separator);
|
||||
});
|
||||
} else {
|
||||
value = value.replace(/ΩΩΩ/g, separator);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
var guid = (function() {
|
||||
function s4() {
|
||||
return Math.floor((1 + Math.random()) * 0x10000)
|
||||
.toString(16)
|
||||
.substring(1);
|
||||
}
|
||||
return function() {
|
||||
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
|
||||
s4() + '-' + s4() + s4() + s4();
|
||||
};
|
||||
})();
|
||||
|
||||
var COMMA_SEPARATED_FIELDS = ['nickname', 'related', 'categories', 'pid'];
|
||||
|
||||
var REQUIRED_FIELDS = ['fn'];
|
||||
|
||||
/**
|
||||
* Generate vCard representation af object
|
||||
* @param {*} data
|
||||
* @param {boolean=} addRequired determine if generator should add required properties (version and uid)
|
||||
* @returns {string}
|
||||
*/
|
||||
function generate(data, addRequired) {
|
||||
var lines = [PREFIX],
|
||||
line = '';
|
||||
|
||||
if (addRequired && !data.version) {
|
||||
data.version = [{value: '3.0'}];
|
||||
}
|
||||
if (addRequired && !data.uid) {
|
||||
data.uid = [{value: guid()}];
|
||||
}
|
||||
|
||||
var escapeCharacters = function (v) {
|
||||
if (typeof v === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
return v
|
||||
.replace(/\n/g, '\\n')
|
||||
.replace(/;/g, '\\;')
|
||||
.replace(/,/g, '\\,')
|
||||
};
|
||||
|
||||
var escapeTypeCharacters = function(v) {
|
||||
if (typeof v === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
return v
|
||||
.replace(/\n/g, '\\n')
|
||||
.replace(/;/g, '\\;')
|
||||
};
|
||||
|
||||
Object.keys(data).forEach(function (key) {
|
||||
if (!data[key] || typeof data[key].forEach !== 'function') {
|
||||
return;
|
||||
}
|
||||
data[key].forEach(function (value) {
|
||||
// ignore undefined values
|
||||
if (typeof value.value === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
// ignore empty values (unless it's a required field)
|
||||
if (value.value === '' && REQUIRED_FIELDS.indexOf(key) === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// ignore empty array values
|
||||
if (value.value instanceof Array) {
|
||||
var empty = true;
|
||||
for (var i = 0; i < value.value.length; i++) {
|
||||
if (typeof value.value[i] !== 'undefined' && value.value[i] !== '') {
|
||||
empty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
line = '';
|
||||
|
||||
// add namespace if exists
|
||||
if (value.namespace) {
|
||||
line += value.namespace + '.';
|
||||
}
|
||||
line += key.indexOf('X-') === 0 ? key : key.toUpperCase();
|
||||
|
||||
// add meta properties
|
||||
if (typeof value.meta === 'object') {
|
||||
Object.keys(value.meta).forEach(function (metaKey) {
|
||||
// values of meta tags must be an array
|
||||
if (typeof value.meta[metaKey].forEach !== 'function') {
|
||||
return;
|
||||
}
|
||||
value.meta[metaKey].forEach(function (metaValue) {
|
||||
if (metaKey.length > 0) {
|
||||
if (metaKey.toUpperCase() === 'TYPE') {
|
||||
// Do not escape the comma when it is the type property. This breaks a lot.
|
||||
line += ';' + escapeCharacters(metaKey.toUpperCase()) + '=' + escapeTypeCharacters(metaValue);
|
||||
} else {
|
||||
line += ';' + escapeCharacters(metaKey.toUpperCase()) + '=' + escapeCharacters(metaValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
line += ':';
|
||||
|
||||
|
||||
|
||||
if (typeof value.value === 'string') {
|
||||
line += escapeCharacters(value.value);
|
||||
} else {
|
||||
// list-values
|
||||
var separator = COMMA_SEPARATED_FIELDS.indexOf(key) !== -1
|
||||
? ','
|
||||
: ';';
|
||||
line += value.value.map(function (item) {
|
||||
return escapeCharacters(item);
|
||||
}).join(separator);
|
||||
}
|
||||
|
||||
// line-length limit. Content lines
|
||||
// SHOULD be folded to a maximum width of 75 octets, excluding the line break.
|
||||
if (line.length > 75) {
|
||||
var firstChunk = line.substr(0, 75),
|
||||
least = line.substr(75);
|
||||
var splitted = least.match(/.{1,74}/g);
|
||||
lines.push(firstChunk);
|
||||
splitted.forEach(function (chunk) {
|
||||
lines.push(' ' + chunk);
|
||||
});
|
||||
} else {
|
||||
lines.push(line);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
lines.push(POSTFIX);
|
||||
return lines.join('\r\n');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
parse: parse,
|
||||
generate: generate
|
||||
};
|
||||
27
node_modules/vcard-parser/package.json
generated
vendored
Normal file
27
node_modules/vcard-parser/package.json
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "vcard-parser",
|
||||
"version": "1.0.0",
|
||||
"description": "Simple vCard parser",
|
||||
"main": "lib/vcard.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:Heymdall/vcard.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^23.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
"release-patch": "npm version patch -m 'chore(*): patch version'",
|
||||
"release-minor": "npm version minor -m 'chore(*): minor version'",
|
||||
"release-major": "npm version major -m 'chore(*): major version'",
|
||||
"postversion": "git push origin master && git push --tags && npm run publish",
|
||||
"build": "gulp build"
|
||||
},
|
||||
"author": "Aleksandr Kitov <kitov.nn@gmail.com>",
|
||||
"license": "MIT"
|
||||
}
|
||||
3168
node_modules/vcard-parser/yarn.lock
generated
vendored
Normal file
3168
node_modules/vcard-parser/yarn.lock
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
9
package-lock.json
generated
9
package-lock.json
generated
@ -79,7 +79,8 @@
|
||||
"tailwind-merge": "^2.5.5",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"vaul": "^0.9.6",
|
||||
"vcard-js": "^1.2.2"
|
||||
"vcard-js": "^1.2.2",
|
||||
"vcard-parser": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/imapflow": "^1.0.20",
|
||||
@ -6541,6 +6542,12 @@
|
||||
"utf8": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/vcard-parser": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vcard-parser/-/vcard-parser-1.0.0.tgz",
|
||||
"integrity": "sha512-rSEjrjBK3of4VimMR5vBjLLcN5ZCSp9yuVzyx5i4Fwx74Yd0s+DnHtSit/wAAtj1a7/T/qQc0ykwXADoD0+fTQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/victory-vendor": {
|
||||
"version": "36.9.2",
|
||||
"resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz",
|
||||
|
||||
@ -80,7 +80,8 @@
|
||||
"tailwind-merge": "^2.5.5",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"vaul": "^0.9.6",
|
||||
"vcard-js": "^1.2.2"
|
||||
"vcard-js": "^1.2.2",
|
||||
"vcard-parser": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/imapflow": "^1.0.20",
|
||||
|
||||
@ -3191,6 +3191,11 @@ vcard-js@^1.2.2:
|
||||
quoted-printable "^1.0.0"
|
||||
utf8 "^2.1.1"
|
||||
|
||||
vcard-parser@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/vcard-parser/-/vcard-parser-1.0.0.tgz"
|
||||
integrity sha512-rSEjrjBK3of4VimMR5vBjLLcN5ZCSp9yuVzyx5i4Fwx74Yd0s+DnHtSit/wAAtj1a7/T/qQc0ykwXADoD0+fTQ==
|
||||
|
||||
victory-vendor@^36.6.8:
|
||||
version "36.9.2"
|
||||
resolved "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user