webext-schema 2.0.2 → 2.0.6

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/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  [![build](https://github.com/asamuzaK/webext-schema/workflows/build/badge.svg)](https://github.com/asamuzaK/webext-schema/actions?query=workflow%3Abuild)
2
2
  [![CodeQL](https://github.com/asamuzaK/webext-schema/workflows/CodeQL/badge.svg)](https://github.com/asamuzaK/webext-schema/actions?query=workflow%3ACodeQL)
3
+ <!--
3
4
  [![dependencies Status](https://david-dm.org/asamuzaK/webext-schema/status.svg)](https://david-dm.org/asamuzaK/webext-schema)
4
5
  [![devDependencies Status](https://david-dm.org/asamuzaK/webext-schema/dev-status.svg)](https://david-dm.org/asamuzaK/webext-schema?type=dev)
6
+ -->
5
7
  [![npm version](https://badge.fury.io/js/webext-schema.svg)](https://badge.fury.io/js/webext-schema)
6
8
 
7
9
  # webext-schema
package/modules/update.js CHANGED
@@ -7,7 +7,7 @@ import { CHAR, INDENT } from './constant.js';
7
7
  import { URL } from 'url';
8
8
  import JSON5 from 'json5';
9
9
  import { createFile } from './file-util.js';
10
- import { getType, isString, throwErr } from './common.js';
10
+ import { getType, isString } from './common.js';
11
11
  import commander from 'commander';
12
12
  import fetch from 'node-fetch';
13
13
  import path from 'path';
@@ -248,9 +248,9 @@ export const saveSchemaFile = async (channel, info) => {
248
248
  * update schemas files
249
249
  *
250
250
  * @param {object} cmdOpts - command options
251
- * @returns {Promise.<Array|Error>} - promise chain
251
+ * @returns {void}
252
252
  */
253
- export const updateSchemas = (cmdOpts = {}) => {
253
+ export const updateSchemas = async (cmdOpts = {}) => {
254
254
  const { channel, info } = cmdOpts;
255
255
  const func = [];
256
256
  if (channel) {
@@ -264,7 +264,13 @@ export const updateSchemas = (cmdOpts = {}) => {
264
264
  saveSchemaFile('mail', info)
265
265
  );
266
266
  }
267
- return Promise.all(func).catch(throwErr);
267
+ const arr = await Promise.allSettled(func);
268
+ for (const i of arr) {
269
+ const { reason, status } = i;
270
+ if (status === 'rejected' && reason) {
271
+ console.trace(reason);
272
+ }
273
+ }
268
274
  };
269
275
 
270
276
  /**
package/package.json CHANGED
@@ -27,20 +27,20 @@
27
27
  "commander": "^8.3.0",
28
28
  "decamelize": "^6.0.0",
29
29
  "json5": "^2.2.0",
30
- "node-fetch": "^3.0.0",
31
- "sinon": "^11.1.2"
30
+ "node-fetch": "^3.1.0",
31
+ "sinon": "^12.0.1"
32
32
  },
33
33
  "devDependencies": {
34
- "c8": "^7.10.0",
34
+ "c8": "^7.11.0",
35
35
  "chai": "^4.3.4",
36
36
  "eslint": "^7.32.0",
37
37
  "eslint-config-standard": "^16.0.3",
38
- "eslint-plugin-import": "^2.25.2",
39
- "eslint-plugin-jsdoc": "^37.0.3",
38
+ "eslint-plugin-import": "^2.25.4",
39
+ "eslint-plugin-jsdoc": "^37.6.1",
40
40
  "eslint-plugin-node": "^11.1.0",
41
- "eslint-plugin-promise": "^5.1.1",
41
+ "eslint-plugin-promise": "^5.2.0",
42
42
  "mocha": "^9.1.3",
43
- "nock": "^13.1.4"
43
+ "nock": "^13.2.1"
44
44
  },
45
- "version": "2.0.2"
45
+ "version": "2.0.6"
46
46
  }
@@ -5165,7 +5165,17 @@
5165
5165
  "description": "The position of the tabs within their windows."
5166
5166
  },
5167
5167
  "cookieStoreId": {
5168
- "type": "string",
5168
+ "choices": [
5169
+ {
5170
+ "type": "array",
5171
+ "items": {
5172
+ "type": "string"
5173
+ }
5174
+ },
5175
+ {
5176
+ "type": "string"
5177
+ }
5178
+ ],
5169
5179
  "optional": true,
5170
5180
  "description": "The CookieStoreId used for the tab."
5171
5181
  },
@@ -9033,6 +9043,22 @@
9033
9043
  "$ref": "extensionTypes.RunAt",
9034
9044
  "optional": true,
9035
9045
  "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
9046
+ },
9047
+ "cookieStoreId": {
9048
+ "choices": [
9049
+ {
9050
+ "type": "array",
9051
+ "minItems": 1,
9052
+ "items": {
9053
+ "type": "string"
9054
+ }
9055
+ },
9056
+ {
9057
+ "type": "string"
9058
+ }
9059
+ ],
9060
+ "optional": true,
9061
+ "description": "limit the set of matched tabs to those that belong to the given cookie store id"
9036
9062
  }
9037
9063
  }
9038
9064
  },
@@ -11731,23 +11757,26 @@
11731
11757
  "js",
11732
11758
  "leaf",
11733
11759
  "mainthreadio",
11734
- "responsiveness",
11760
+ "fileio",
11761
+ "fileioall",
11762
+ "noiostacks",
11735
11763
  "screenshots",
11736
11764
  "seqstyle",
11737
11765
  "stackwalk",
11738
- "threads",
11739
11766
  "jstracer",
11740
11767
  "jsallocations",
11741
11768
  "nostacksampling",
11742
- "nativeallocations",
11743
11769
  "preferencereads",
11770
+ "nativeallocations",
11744
11771
  "ipcmessages",
11745
- "fileio",
11746
- "fileioall",
11747
- "noiostacks",
11748
11772
  "audiocallbacktracing",
11749
11773
  "cpu",
11750
- "notimerresolutionchange"
11774
+ "notimerresolutionchange",
11775
+ "cpuallthreads",
11776
+ "samplingallthreads",
11777
+ "markersallthreads",
11778
+ "unregisteredthreads",
11779
+ "responsiveness"
11751
11780
  ]
11752
11781
  },
11753
11782
  {
@@ -12757,34 +12786,13 @@
12757
12786
  "postprocess": "manifestVersionCheck"
12758
12787
  },
12759
12788
  "applications": {
12760
- "type": "object",
12761
- "optional": true,
12762
- "properties": {
12763
- "gecko": {
12764
- "$ref": "FirefoxSpecificProperties",
12765
- "optional": true
12766
- }
12767
- }
12789
+ "$ref": "BrowserSpecificSettings",
12790
+ "description": "The applications property is deprecated, please use 'browser_specific_settings'",
12791
+ "optional": true
12768
12792
  },
12769
12793
  "browser_specific_settings": {
12770
- "type": "object",
12771
- "optional": true,
12772
- "properties": {
12773
- "gecko": {
12774
- "$ref": "FirefoxSpecificProperties",
12775
- "optional": true
12776
- },
12777
- "edge": {
12778
- "type": "object",
12779
- "additionalProperties": {
12780
- "type": "any"
12781
- },
12782
- "optional": true
12783
- }
12784
- },
12785
- "additionalProperties": {
12786
- "$ref": "UnrecognizedProperty"
12787
- }
12794
+ "$ref": "BrowserSpecificSettings",
12795
+ "optional": true
12788
12796
  },
12789
12797
  "name": {
12790
12798
  "type": "string",
@@ -12816,6 +12824,32 @@
12816
12824
  "format": "url",
12817
12825
  "optional": true,
12818
12826
  "preprocess": "localize"
12827
+ },
12828
+ "install_origins": {
12829
+ "type": "array",
12830
+ "optional": true,
12831
+ "items": {
12832
+ "type": "string",
12833
+ "format": "origin"
12834
+ }
12835
+ },
12836
+ "developer": {
12837
+ "type": "object",
12838
+ "optional": true,
12839
+ "properties": {
12840
+ "name": {
12841
+ "type": "string",
12842
+ "optional": true,
12843
+ "preprocess": "localize"
12844
+ },
12845
+ "url": {
12846
+ "type": "string",
12847
+ "format": "url",
12848
+ "optional": true,
12849
+ "preprocess": "localize",
12850
+ "onError": "warn"
12851
+ }
12852
+ }
12819
12853
  }
12820
12854
  }
12821
12855
  },
@@ -13031,22 +13065,6 @@
13031
13065
  }
13032
13066
  ]
13033
13067
  },
13034
- "developer": {
13035
- "type": "object",
13036
- "optional": true,
13037
- "properties": {
13038
- "name": {
13039
- "type": "string",
13040
- "optional": true,
13041
- "preprocess": "localize"
13042
- },
13043
- "url": {
13044
- "type": "string",
13045
- "optional": true,
13046
- "preprocess": "localize"
13047
- }
13048
- }
13049
- },
13050
13068
  "hidden": {
13051
13069
  "type": "boolean",
13052
13070
  "optional": true,
@@ -13154,6 +13172,30 @@
13154
13172
  }
13155
13173
  }
13156
13174
  },
13175
+ {
13176
+ "id": "WebExtensionSitePermissionsManifest",
13177
+ "type": "object",
13178
+ "description": "Represents a WebExtension site permissions manifest.json file",
13179
+ "$import": "ManifestBase",
13180
+ "properties": {
13181
+ "site_permissions": {
13182
+ "type": "array",
13183
+ "minItems": 1,
13184
+ "items": {
13185
+ "$ref": "SitePermission"
13186
+ }
13187
+ },
13188
+ "install_origins": {
13189
+ "type": "array",
13190
+ "minItems": 1,
13191
+ "maxItems": 1,
13192
+ "items": {
13193
+ "type": "string",
13194
+ "format": "origin"
13195
+ }
13196
+ }
13197
+ }
13198
+ },
13157
13199
  {
13158
13200
  "id": "ThemeIcons",
13159
13201
  "type": "object",
@@ -13253,6 +13295,18 @@
13253
13295
  }
13254
13296
  ]
13255
13297
  },
13298
+ {
13299
+ "id": "SitePermission",
13300
+ "choices": [
13301
+ {
13302
+ "type": "string",
13303
+ "enum": [
13304
+ "midi",
13305
+ "midi-sysex"
13306
+ ]
13307
+ }
13308
+ ]
13309
+ },
13256
13310
  {
13257
13311
  "id": "HttpURL",
13258
13312
  "type": "string",
@@ -13312,6 +13366,19 @@
13312
13366
  }
13313
13367
  }
13314
13368
  },
13369
+ {
13370
+ "id": "BrowserSpecificSettings",
13371
+ "type": "object",
13372
+ "properties": {
13373
+ "gecko": {
13374
+ "$ref": "FirefoxSpecificProperties",
13375
+ "optional": true
13376
+ }
13377
+ },
13378
+ "additionalProperties": {
13379
+ "type": "any"
13380
+ }
13381
+ },
13315
13382
  {
13316
13383
  "id": "MatchPattern",
13317
13384
  "choices": [
@@ -14927,6 +14994,10 @@
14927
14994
  "httpsOnlyMode": {
14928
14995
  "$ref": "types.Setting",
14929
14996
  "description": "Allow users to query the mode for 'HTTPS-Only Mode'. This setting's value is of type HTTPSOnlyModeOption, defaulting to <code>never</code>."
14997
+ },
14998
+ "globalPrivacyControl": {
14999
+ "$ref": "types.Setting",
15000
+ "description": "Allow users to query the status of 'Global Privacy Control'. This setting's value is of type boolean, defaulting to <code>false</code>."
14930
15001
  }
14931
15002
  }
14932
15003
  },
@@ -15353,6 +15424,27 @@
15353
15424
  "description": "The fully-qualified URL to the resource."
15354
15425
  }
15355
15426
  },
15427
+ {
15428
+ "name": "getFrameId",
15429
+ "type": "function",
15430
+ "allowedContexts": [
15431
+ "content",
15432
+ "devtools"
15433
+ ],
15434
+ "description": "Get the frameId of any window global or frame element.",
15435
+ "parameters": [
15436
+ {
15437
+ "type": "any",
15438
+ "name": "target",
15439
+ "description": "A WindowProxy or a Browsing Context container element (IFrame, Frame, Embed, Object) for the target frame."
15440
+ }
15441
+ ],
15442
+ "allowCrossOriginArguments": true,
15443
+ "returns": {
15444
+ "type": "number",
15445
+ "description": "The frameId of the target frame, or -1 if it doesn't exist."
15446
+ }
15447
+ },
15356
15448
  {
15357
15449
  "name": "setUninstallURL",
15358
15450
  "type": "function",
@@ -15807,6 +15899,131 @@
15807
15899
  ]
15808
15900
  }
15809
15901
  ],
15902
+ "scripting.json": [
15903
+ {
15904
+ "namespace": "manifest",
15905
+ "types": [
15906
+ {
15907
+ "$extend": "OptionalPermissionNoPrompt",
15908
+ "choices": [
15909
+ {
15910
+ "type": "string",
15911
+ "enum": [
15912
+ "scripting"
15913
+ ],
15914
+ "min_manifest_version": 3
15915
+ }
15916
+ ]
15917
+ }
15918
+ ]
15919
+ },
15920
+ {
15921
+ "namespace": "scripting",
15922
+ "description": "Use the scripting API to execute script in different contexts.",
15923
+ "permissions": [
15924
+ "scripting"
15925
+ ],
15926
+ "min_manifest_version": 3,
15927
+ "types": [
15928
+ {
15929
+ "id": "ScriptInjection",
15930
+ "type": "object",
15931
+ "description": "Details of a script injection",
15932
+ "properties": {
15933
+ "args": {
15934
+ "type": "array",
15935
+ "optional": true,
15936
+ "description": "The arguments to curry into a provided function. This is only valid if the <code>func</code> parameter is specified. These arguments must be JSON-serializable.",
15937
+ "items": {
15938
+ "type": "any"
15939
+ }
15940
+ },
15941
+ "files": {
15942
+ "type": "array",
15943
+ "optional": true,
15944
+ "description": "The path of the JS or CSS files to inject, relative to the extension's root directory. Exactly one of <code>files</code> and <code>func</code> must be specified.",
15945
+ "minItems": 1,
15946
+ "items": {
15947
+ "type": "string"
15948
+ }
15949
+ },
15950
+ "func": {
15951
+ "type": "function",
15952
+ "optional": true,
15953
+ "description": "A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of <code>files</code> and <code>func</code> must be specified."
15954
+ },
15955
+ "target": {
15956
+ "$ref": "InjectionTarget",
15957
+ "description": "Details specifying the target into which to inject the script."
15958
+ }
15959
+ }
15960
+ },
15961
+ {
15962
+ "id": "InjectionResult",
15963
+ "type": "object",
15964
+ "description": "Result of a script injection.",
15965
+ "properties": {
15966
+ "frameId": {
15967
+ "type": "number",
15968
+ "description": "The frame ID associated with the injection."
15969
+ },
15970
+ "result": {
15971
+ "type": "any",
15972
+ "optional": true,
15973
+ "description": "The result of the script execution."
15974
+ }
15975
+ }
15976
+ },
15977
+ {
15978
+ "id": "InjectionTarget",
15979
+ "type": "object",
15980
+ "properties": {
15981
+ "frameIds": {
15982
+ "type": "array",
15983
+ "optional": true,
15984
+ "description": "The IDs of specific frames to inject into.",
15985
+ "items": {
15986
+ "type": "number"
15987
+ }
15988
+ },
15989
+ "tabId": {
15990
+ "type": "number",
15991
+ "description": "The ID of the tab into which to inject."
15992
+ }
15993
+ }
15994
+ }
15995
+ ],
15996
+ "functions": [
15997
+ {
15998
+ "name": "executeScript",
15999
+ "type": "function",
16000
+ "description": "Injects a script into a target context. The script will be run at <code>document_idle</code>.",
16001
+ "async": "callback",
16002
+ "parameters": [
16003
+ {
16004
+ "name": "injection",
16005
+ "$ref": "ScriptInjection",
16006
+ "description": "The details of the script which to inject."
16007
+ },
16008
+ {
16009
+ "name": "callback",
16010
+ "type": "function",
16011
+ "description": "Invoked upon completion of the injection. The resulting array contains the result of execution for each frame where the injection succeeded.",
16012
+ "parameters": [
16013
+ {
16014
+ "name": "results",
16015
+ "type": "array",
16016
+ "items": {
16017
+ "$ref": "InjectionResult"
16018
+ }
16019
+ }
16020
+ ]
16021
+ }
16022
+ ]
16023
+ }
16024
+ ]
16025
+ }
16026
+ ],
15810
16027
  "storage.json": [
15811
16028
  {
15812
16029
  "namespace": "storage",