webext-schema 2.3.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modules/file-util.js +14 -12
- package/package.json +3 -3
- package/schemas/central/webext.json +3 -4
- package/schemas/mail/mailext.json +156 -6
package/modules/file-util.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/* api */
|
|
6
|
-
import { IS_WIN } from './constant.js';
|
|
7
6
|
import { fileURLToPath } from 'url';
|
|
8
7
|
import { getType, isString } from './common.js';
|
|
9
8
|
import fs, { promises as fsPromise } from 'fs';
|
|
10
9
|
import path from 'path';
|
|
10
|
+
import { IS_WIN } from './constant.js';
|
|
11
11
|
|
|
12
12
|
/* constants */
|
|
13
13
|
const MASK_BIT = 0o111;
|
|
@@ -135,7 +135,7 @@ export const getFileNameFromFilePath = (file, subst = SUBST) => {
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
* remove the directory and it's files
|
|
138
|
+
* remove the directory and it's files synchronously
|
|
139
139
|
*
|
|
140
140
|
* @param {string} dir - directory path
|
|
141
141
|
* @param {string} baseDir - base directory path
|
|
@@ -146,16 +146,10 @@ export const removeDir = (dir, baseDir) => {
|
|
|
146
146
|
if (!isSubDir(dir, baseDir)) {
|
|
147
147
|
throw new Error(`${dir} is not a subdirectory of ${baseDir}.`);
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (fs.lstatSync(cur).isDirectory()) {
|
|
153
|
-
removeDir(cur, baseDir);
|
|
154
|
-
} else {
|
|
155
|
-
fs.unlinkSync(cur);
|
|
156
|
-
}
|
|
149
|
+
fs.rmSync(dir, {
|
|
150
|
+
force: true,
|
|
151
|
+
recursive: true
|
|
157
152
|
});
|
|
158
|
-
fs.rmdirSync(dir);
|
|
159
153
|
}
|
|
160
154
|
};
|
|
161
155
|
|
|
@@ -167,7 +161,15 @@ export const removeDir = (dir, baseDir) => {
|
|
|
167
161
|
* @returns {void}
|
|
168
162
|
*/
|
|
169
163
|
export const removeDirectory = async (dir, baseDir) => {
|
|
170
|
-
|
|
164
|
+
if (isDir(dir)) {
|
|
165
|
+
if (!isSubDir(dir, baseDir)) {
|
|
166
|
+
throw new Error(`${dir} is not a subdirectory of ${baseDir}.`);
|
|
167
|
+
}
|
|
168
|
+
await fsPromise.rm(dir, {
|
|
169
|
+
force: true,
|
|
170
|
+
recursive: true
|
|
171
|
+
});
|
|
172
|
+
}
|
|
171
173
|
};
|
|
172
174
|
|
|
173
175
|
/**
|
package/package.json
CHANGED
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"decamelize": "^6.0.0",
|
|
34
34
|
"json5": "^2.2.1",
|
|
35
35
|
"node-fetch": "^3.2.4",
|
|
36
|
-
"sinon": "^
|
|
36
|
+
"sinon": "^14.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"c8": "^7.11.2",
|
|
40
40
|
"chai": "^4.3.6",
|
|
41
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.15.0",
|
|
42
42
|
"eslint-config-standard": "^17.0.0",
|
|
43
43
|
"eslint-plugin-import": "^2.26.0",
|
|
44
44
|
"eslint-plugin-jsdoc": "^39.2.9",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"nock": "^13.2.4",
|
|
49
49
|
"npm-run-all": "^4.1.5"
|
|
50
50
|
},
|
|
51
|
-
"version": "
|
|
51
|
+
"version": "3.0.0"
|
|
52
52
|
}
|
|
@@ -14865,7 +14865,8 @@
|
|
|
14865
14865
|
"type": "boolean",
|
|
14866
14866
|
"optional": true,
|
|
14867
14867
|
"default": false,
|
|
14868
|
-
"description": "Whether to create all cookies as nonPersistent (i.e., session) cookies."
|
|
14868
|
+
"description": "Whether to create all cookies as nonPersistent (i.e., session) cookies.",
|
|
14869
|
+
"deprecated": "This property has no effect anymore and its value is always <code>false<code>."
|
|
14869
14870
|
}
|
|
14870
14871
|
}
|
|
14871
14872
|
}
|
|
@@ -15720,8 +15721,7 @@
|
|
|
15720
15721
|
"type": "string",
|
|
15721
15722
|
"enum": [
|
|
15722
15723
|
"scripting"
|
|
15723
|
-
]
|
|
15724
|
-
"min_manifest_version": 3
|
|
15724
|
+
]
|
|
15725
15725
|
}
|
|
15726
15726
|
]
|
|
15727
15727
|
}
|
|
@@ -15733,7 +15733,6 @@
|
|
|
15733
15733
|
"permissions": [
|
|
15734
15734
|
"scripting"
|
|
15735
15735
|
],
|
|
15736
|
-
"min_manifest_version": 3,
|
|
15737
15736
|
"types": [
|
|
15738
15737
|
{
|
|
15739
15738
|
"id": "ScriptInjection",
|
|
@@ -2873,7 +2873,7 @@
|
|
|
2873
2873
|
{
|
|
2874
2874
|
"name": "list",
|
|
2875
2875
|
"type": "function",
|
|
2876
|
-
"description": "Returns all mail accounts.",
|
|
2876
|
+
"description": "Returns all mail accounts. They will be returned in the same order as used in Thunderbird's folder pane.",
|
|
2877
2877
|
"async": "callback",
|
|
2878
2878
|
"parameters": [
|
|
2879
2879
|
{
|
|
@@ -5359,6 +5359,41 @@
|
|
|
5359
5359
|
"$ref": "ComposeRecipientList",
|
|
5360
5360
|
"optional": true
|
|
5361
5361
|
},
|
|
5362
|
+
"overrideDefaultFcc": {
|
|
5363
|
+
"type": "boolean",
|
|
5364
|
+
"optional": true,
|
|
5365
|
+
"description": "Indicates whether the default fcc setting (defined by the used identity) is being overridden for this message. Setting ``false`` will clear the override. Setting ``true`` will throw an exception, if ``overrideDefaultFccFolder`` is not set as well."
|
|
5366
|
+
},
|
|
5367
|
+
"overrideDefaultFccFolder": {
|
|
5368
|
+
"choices": [
|
|
5369
|
+
{
|
|
5370
|
+
"$ref": "folders.MailFolder"
|
|
5371
|
+
},
|
|
5372
|
+
{
|
|
5373
|
+
"type": "string",
|
|
5374
|
+
"enum": [
|
|
5375
|
+
""
|
|
5376
|
+
]
|
|
5377
|
+
}
|
|
5378
|
+
],
|
|
5379
|
+
"optional": true,
|
|
5380
|
+
"description": " This value overrides the default fcc setting (defined by the used identity) for this message only. Either a :ref:`folders.MailFolder` specifying the folder for the copy of the sent message, or ``\"\"`` to not save a copy at all."
|
|
5381
|
+
},
|
|
5382
|
+
"additionalFccFolder": {
|
|
5383
|
+
"choices": [
|
|
5384
|
+
{
|
|
5385
|
+
"$ref": "folders.MailFolder"
|
|
5386
|
+
},
|
|
5387
|
+
{
|
|
5388
|
+
"type": "string",
|
|
5389
|
+
"enum": [
|
|
5390
|
+
""
|
|
5391
|
+
]
|
|
5392
|
+
}
|
|
5393
|
+
],
|
|
5394
|
+
"description": "An additional fcc folder which can be selected while composing the message, ``\"\"`` if not used.",
|
|
5395
|
+
"optional": true
|
|
5396
|
+
},
|
|
5362
5397
|
"replyTo": {
|
|
5363
5398
|
"$ref": "ComposeRecipientList",
|
|
5364
5399
|
"optional": true
|
|
@@ -5419,14 +5454,52 @@
|
|
|
5419
5454
|
"description": "Whether the message is an HTML message or a plain text message.",
|
|
5420
5455
|
"optional": true
|
|
5421
5456
|
},
|
|
5457
|
+
"deliveryFormat": {
|
|
5458
|
+
"type": "string",
|
|
5459
|
+
"enum": [
|
|
5460
|
+
"auto",
|
|
5461
|
+
"plaintext",
|
|
5462
|
+
"html",
|
|
5463
|
+
"both"
|
|
5464
|
+
],
|
|
5465
|
+
"description": "Defines the mime format of the send message (ignored on plain text messages). Defaults to ``auto``, which will send html messages as plain text, if they do not include any formatting, and as ``both`` otherwise (a multipart/mixed message).",
|
|
5466
|
+
"optional": true
|
|
5467
|
+
},
|
|
5422
5468
|
"customHeaders": {
|
|
5423
5469
|
"type": "array",
|
|
5424
5470
|
"items": {
|
|
5425
5471
|
"$ref": "CustomHeader"
|
|
5426
5472
|
},
|
|
5427
|
-
"description": "Array of custom headers. Headers will be returned in ``Http-Header-Case`` (a.k.a. ``Train-Case``)",
|
|
5473
|
+
"description": "Array of custom headers. Headers will be returned in ``Http-Header-Case`` (a.k.a. ``Train-Case``). Set an empty array to clear all custom headers.",
|
|
5474
|
+
"optional": true
|
|
5475
|
+
},
|
|
5476
|
+
"priority": {
|
|
5477
|
+
"type": "string",
|
|
5478
|
+
"enum": [
|
|
5479
|
+
"lowest",
|
|
5480
|
+
"low",
|
|
5481
|
+
"normal",
|
|
5482
|
+
"high",
|
|
5483
|
+
"highest"
|
|
5484
|
+
],
|
|
5485
|
+
"description": "The priority of the message.",
|
|
5428
5486
|
"optional": true
|
|
5429
5487
|
},
|
|
5488
|
+
"returnReceipt": {
|
|
5489
|
+
"type": "boolean",
|
|
5490
|
+
"optional": true,
|
|
5491
|
+
"description": "Add the ``Disposition-Notification-To`` header to the message to requests the recipients email client to send a reply once the message has been received. Recipient server may strip the header and the recipient might ignore the request."
|
|
5492
|
+
},
|
|
5493
|
+
"deliveryStatusNotification": {
|
|
5494
|
+
"type": "boolean",
|
|
5495
|
+
"optional": true,
|
|
5496
|
+
"description": "Let the sender know when the recipient's server received the message. Not supported by all servers."
|
|
5497
|
+
},
|
|
5498
|
+
"attachVCard": {
|
|
5499
|
+
"type": "boolean",
|
|
5500
|
+
"optional": true,
|
|
5501
|
+
"description": "Wether or not the vCard of the used identity will be attached to the message during send. Note: If the value has not been modified, selecting a different identity will load the default value of the new identity."
|
|
5502
|
+
},
|
|
5430
5503
|
"attachments": {
|
|
5431
5504
|
"type": "array",
|
|
5432
5505
|
"items": {
|
|
@@ -6715,7 +6788,7 @@
|
|
|
6715
6788
|
},
|
|
6716
6789
|
"subFolders": {
|
|
6717
6790
|
"type": "array",
|
|
6718
|
-
"description": "Subfolders are only included if requested.",
|
|
6791
|
+
"description": "Subfolders are only included if requested. They will be returned in the same order as used in Thunderbird's folder pane.",
|
|
6719
6792
|
"items": {
|
|
6720
6793
|
"$ref": "MailFolder"
|
|
6721
6794
|
},
|
|
@@ -9285,7 +9358,8 @@
|
|
|
9285
9358
|
"enum": [
|
|
9286
9359
|
"messagesMove",
|
|
9287
9360
|
"messagesRead",
|
|
9288
|
-
"messagesDelete"
|
|
9361
|
+
"messagesDelete",
|
|
9362
|
+
"messagesTags"
|
|
9289
9363
|
]
|
|
9290
9364
|
}
|
|
9291
9365
|
]
|
|
@@ -9334,6 +9408,10 @@
|
|
|
9334
9408
|
"type": "string",
|
|
9335
9409
|
"description": "The message-id header of the message."
|
|
9336
9410
|
},
|
|
9411
|
+
"headersOnly": {
|
|
9412
|
+
"description": "Some account types (for example POP) allow to download only the headers of the message, but not its body. The body of such messages will not be available.",
|
|
9413
|
+
"type": "boolean"
|
|
9414
|
+
},
|
|
9337
9415
|
"id": {
|
|
9338
9416
|
"type": "integer",
|
|
9339
9417
|
"minimum": 1
|
|
@@ -9695,7 +9773,7 @@
|
|
|
9695
9773
|
{
|
|
9696
9774
|
"name": "getFull",
|
|
9697
9775
|
"type": "function",
|
|
9698
|
-
"description": "Returns a specified message, including all headers and MIME parts.",
|
|
9776
|
+
"description": "Returns a specified message, including all headers and MIME parts. Throws if the message could not be read, for example due to network issues.",
|
|
9699
9777
|
"async": "callback",
|
|
9700
9778
|
"parameters": [
|
|
9701
9779
|
{
|
|
@@ -9717,7 +9795,7 @@
|
|
|
9717
9795
|
{
|
|
9718
9796
|
"name": "getRaw",
|
|
9719
9797
|
"type": "function",
|
|
9720
|
-
"description": "Returns the unmodified source of a message as a `binary string <https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary>`__, which is a simple series of 8-bit values. If the message contains non-ASCII characters, the body parts in the binary string cannot be read directly and must be decoded according to their character sets. Use :ref:`messages.getFull` to get the correctly decoded parts. Manually decoding the raw message is probably too error-prone, especially if the message contains MIME parts with different character set encodings or attachments.\n\nTo get a readable version of the raw message as it appears in Thunderbird's message source view, it may be sufficient to decode the message according to the character set specified in its main ``content-type`` header (example: `text/html; charset=UTF-8`) using the following function (see MDN for `supported input encodings <https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings>`__): <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude>",
|
|
9798
|
+
"description": "Returns the unmodified source of a message as a `binary string <https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary>`__, which is a simple series of 8-bit values. Throws if the message could not be read, for example due to network issues. If the message contains non-ASCII characters, the body parts in the binary string cannot be read directly and must be decoded according to their character sets. Use :ref:`messages.getFull` to get the correctly decoded parts. Manually decoding the raw message is probably too error-prone, especially if the message contains MIME parts with different character set encodings or attachments.\n\nTo get a readable version of the raw message as it appears in Thunderbird's message source view, it may be sufficient to decode the message according to the character set specified in its main ``content-type`` header (example: `text/html; charset=UTF-8`) using the following function (see MDN for `supported input encodings <https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings>`__): <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude>",
|
|
9721
9799
|
"async": "callback",
|
|
9722
9800
|
"parameters": [
|
|
9723
9801
|
{
|
|
@@ -10029,6 +10107,78 @@
|
|
|
10029
10107
|
]
|
|
10030
10108
|
}
|
|
10031
10109
|
]
|
|
10110
|
+
},
|
|
10111
|
+
{
|
|
10112
|
+
"name": "createTag",
|
|
10113
|
+
"type": "function",
|
|
10114
|
+
"description": "Creates a new message tag. Tagging a message will store the tag's key in the user's message.",
|
|
10115
|
+
"async": true,
|
|
10116
|
+
"permissions": [
|
|
10117
|
+
"messagesTags"
|
|
10118
|
+
],
|
|
10119
|
+
"parameters": [
|
|
10120
|
+
{
|
|
10121
|
+
"type": "string",
|
|
10122
|
+
"name": "key",
|
|
10123
|
+
"pattern": "^[$a-zA-Z0-9]+$"
|
|
10124
|
+
},
|
|
10125
|
+
{
|
|
10126
|
+
"type": "string",
|
|
10127
|
+
"name": "tag"
|
|
10128
|
+
},
|
|
10129
|
+
{
|
|
10130
|
+
"type": "string",
|
|
10131
|
+
"name": "color",
|
|
10132
|
+
"pattern": "^#[0-9a-f]{6}"
|
|
10133
|
+
}
|
|
10134
|
+
]
|
|
10135
|
+
},
|
|
10136
|
+
{
|
|
10137
|
+
"name": "updateTag",
|
|
10138
|
+
"type": "function",
|
|
10139
|
+
"description": "Updates a message tag.",
|
|
10140
|
+
"async": true,
|
|
10141
|
+
"permissions": [
|
|
10142
|
+
"messagesTags"
|
|
10143
|
+
],
|
|
10144
|
+
"parameters": [
|
|
10145
|
+
{
|
|
10146
|
+
"type": "string",
|
|
10147
|
+
"name": "key",
|
|
10148
|
+
"pattern": "^[$a-zA-Z0-9]+$"
|
|
10149
|
+
},
|
|
10150
|
+
{
|
|
10151
|
+
"type": "object",
|
|
10152
|
+
"name": "updateProperties",
|
|
10153
|
+
"properties": {
|
|
10154
|
+
"tag": {
|
|
10155
|
+
"type": "string",
|
|
10156
|
+
"optional": "true"
|
|
10157
|
+
},
|
|
10158
|
+
"color": {
|
|
10159
|
+
"type": "string",
|
|
10160
|
+
"pattern": "^#[0-9a-f]{6}",
|
|
10161
|
+
"optional": "true"
|
|
10162
|
+
}
|
|
10163
|
+
}
|
|
10164
|
+
}
|
|
10165
|
+
]
|
|
10166
|
+
},
|
|
10167
|
+
{
|
|
10168
|
+
"name": "deleteTag",
|
|
10169
|
+
"type": "function",
|
|
10170
|
+
"description": "Deletes a message tag, removing it from the list of known tags. Its key will not be removed from tagged messages, but they will appear untagged. Recreating a deleted tag, will make all former tagged messages appear tagged again.",
|
|
10171
|
+
"async": true,
|
|
10172
|
+
"permissions": [
|
|
10173
|
+
"messagesTags"
|
|
10174
|
+
],
|
|
10175
|
+
"parameters": [
|
|
10176
|
+
{
|
|
10177
|
+
"type": "string",
|
|
10178
|
+
"name": "key",
|
|
10179
|
+
"pattern": "^[$a-zA-Z0-9]+$"
|
|
10180
|
+
}
|
|
10181
|
+
]
|
|
10032
10182
|
}
|
|
10033
10183
|
]
|
|
10034
10184
|
}
|