webext-schema
Advanced tools
Comparing version 5.1.4 to 5.1.5
@@ -11,4 +11,4 @@ /*! | ||
import process from 'node:process'; | ||
import { parseCommand } from './modules/commander.js'; | ||
import { logErr, throwErr } from './modules/common.js'; | ||
import { parseCommand } from './modules/update.js'; | ||
export { Schema } from './modules/schema.js'; | ||
@@ -15,0 +15,0 @@ |
@@ -15,3 +15,3 @@ /** | ||
* @param {object} perm - permissions.Permission | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -28,3 +28,3 @@ export const isPermissionGranted = async perm => { | ||
* @param {object} opt - bookmarks.CreateDetails | ||
* @returns {object} - bookmarks.BookmarkTreeNode | ||
* @returns {Promise.<object>} - bookmarks.BookmarkTreeNode | ||
*/ | ||
@@ -47,3 +47,3 @@ export const createBookmark = async opt => { | ||
* @param {string|Array} id - bookmark ID or array of bookmark IDs | ||
* @returns {?Array} - array of bookmarks.BookmarkTreeNode | ||
* @returns {Promise.<?Array>} - array of bookmarks.BookmarkTreeNode | ||
*/ | ||
@@ -72,3 +72,3 @@ export const getBookmarkTreeNode = async id => { | ||
* | ||
* @returns {object} - user value | ||
* @returns {Promise.<object>} - user value | ||
*/ | ||
@@ -90,3 +90,3 @@ export const getCloseTabsByDoubleClickValue = async () => { | ||
* | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -115,3 +115,3 @@ export const setContextMenuOnMouseup = async () => { | ||
* | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -133,3 +133,3 @@ export const clearContextMenuOnMouseup = async () => { | ||
* | ||
* @returns {object} - result | ||
* @returns {Promise.<object>} - result | ||
*/ | ||
@@ -152,3 +152,3 @@ export const getNewTabPositionValue = async () => { | ||
* | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -173,3 +173,3 @@ export const isCommandCustomizable = async () => { | ||
* @param {string} value - key value | ||
* @returns {?Function} - commands.update() | commands.reset() | ||
* @returns {Promise.<?void>} - commands.update() | commands.reset() | ||
*/ | ||
@@ -204,3 +204,3 @@ export const updateCommand = async (id, value = '') => { | ||
* | ||
* @returns {?Array} - array of contextualIdentities.ContextualIdentity | ||
* @returns {Promise.<?Array>} - array of contextualIdentities.ContextualIdentity | ||
*/ | ||
@@ -223,3 +223,3 @@ export const getAllContextualIdentities = async () => { | ||
* @param {string} cookieStoreId - cookie store ID | ||
* @returns {object} - contextualIdentities.ContextualIdentity | ||
* @returns {Promise.<object>} - contextualIdentities.ContextualIdentity | ||
*/ | ||
@@ -245,3 +245,3 @@ export const getContextualId = async cookieStoreId => { | ||
* | ||
* @returns {?Array} - array of management.ExtensionInfo | ||
* @returns {Promise.<?Array>} - array of management.ExtensionInfo | ||
*/ | ||
@@ -267,3 +267,3 @@ export const getEnabledTheme = async () => { | ||
* @param {string} id - extension ID | ||
* @returns {object} - management.extensionInfo | ||
* @returns {Promise.<object>} - management.extensionInfo | ||
*/ | ||
@@ -288,3 +288,3 @@ export const getExtensionInfo = async id => { | ||
* | ||
* @returns {?Array|boolean} - array of management.extensionInfo | ||
* @returns {Promise.<?Array|boolean>} - array of management.extensionInfo | ||
*/ | ||
@@ -311,3 +311,3 @@ export const getExternalExtensions = async () => { | ||
* @param {string} id - notification ID | ||
* @returns {?Function} - notifications.clear() | ||
* @returns {Promise.<?boolean>} - notifications.clear() | ||
*/ | ||
@@ -334,3 +334,3 @@ export const clearNotification = async id => { | ||
* @param {object} opt - options | ||
* @returns {?Function} - notifications.create() | ||
* @returns {Promise.<?string>} - notifications.create() | ||
*/ | ||
@@ -360,3 +360,3 @@ export const createNotification = async (id, opt) => { | ||
* @param {string|Array} perm - permission | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -384,3 +384,3 @@ export const removePermission = async perm => { | ||
* @param {string|Array} perm - permission | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -428,3 +428,3 @@ export const requestPermission = async perm => { | ||
* | ||
* @returns {string} - OS | ||
* @returns {Promise.<string>} - OS | ||
*/ | ||
@@ -441,3 +441,3 @@ export const getOs = async () => { | ||
* @param {object|boolean} [info] - connection info / connect to native app | ||
* @returns {object} - runtime.Port | ||
* @returns {Promise.<object>} - runtime.Port | ||
*/ | ||
@@ -476,3 +476,3 @@ export const makeConnection = async (id, info) => { | ||
* @param {object} opt - options | ||
* @returns {?Function} - tabs.sendMessage() | runtime.sendMessage() | ||
* @returns {Promise.<object>} - tabs.sendMessage() | runtime.sendMessage() | ||
*/ | ||
@@ -500,3 +500,3 @@ export const sendMessage = async (id, msg, opt) => { | ||
* | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -519,3 +519,3 @@ export const isScriptingAvailable = async () => { | ||
* @param {object} opt - options | ||
* @returns {?Array|boolean} - array of InjectionResult object | ||
* @returns {Promise.<?Array|boolean>} - array of InjectionResult object | ||
*/ | ||
@@ -552,3 +552,3 @@ export const executeScriptToTab = async (opt = {}) => { | ||
* @param {object} opt - options | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -573,4 +573,4 @@ export const searchWithSearchEngine = async (query, opt = {}) => { | ||
* | ||
* @param {number} windowId - window ID | ||
* @returns {object} - tabs.Tab | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<object>} - tabs.Tab | ||
*/ | ||
@@ -608,4 +608,4 @@ export const getRecentlyClosedTab = async windowId => { | ||
* @param {string} key - key | ||
* @param {number} windowId - window ID | ||
* @returns {string} - value | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<?string>} - value | ||
*/ | ||
@@ -634,3 +634,3 @@ export const getSessionWindowValue = async (key, windowId) => { | ||
* @param {string} sessionId - session ID | ||
* @returns {object} - sessions.Session | ||
* @returns {Promise.<object>} - sessions.Session | ||
*/ | ||
@@ -657,4 +657,4 @@ export const restoreSession = async sessionId => { | ||
* @param {string|object} value - value | ||
* @param {number} windowId - window ID | ||
* @returns {void} | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -682,3 +682,3 @@ export const setSessionWindowValue = async (key, value, windowId) => { | ||
* @param {string} area - storage area | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -700,3 +700,3 @@ export const clearStorage = async (area = 'local') => { | ||
* @param {string} area - storage area | ||
* @returns {object} - stored data | ||
* @returns {Promise.<object>} - stored data | ||
*/ | ||
@@ -721,3 +721,3 @@ export const getAllStorage = async (area = 'local') => { | ||
* @param {string} area - storage area | ||
* @returns {object} - stored data | ||
* @returns {Promise.<object>} - stored data | ||
*/ | ||
@@ -742,3 +742,3 @@ export const getStorage = async (key, area = 'local') => { | ||
* @param {string} area - storage area | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -761,3 +761,3 @@ export const removeStorage = async (key, area = 'local') => { | ||
* @param {string} area - storage area | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -780,3 +780,3 @@ export const setStorage = async (obj, area = 'local') => { | ||
* @param {object} opt - options | ||
* @returns {object} - tabs.Tab | ||
* @returns {Promise.<object>} - tabs.Tab | ||
*/ | ||
@@ -793,3 +793,3 @@ export const createTab = async (opt = {}) => { | ||
* @param {object} opt - options | ||
* @returns {object} - tabs.Tab | ||
* @returns {Promise.<object>} - tabs.Tab | ||
*/ | ||
@@ -808,3 +808,3 @@ export const duplicateTab = async (tabId, opt) => { | ||
* @param {object} opt - options | ||
* @returns {?Array} - result | ||
* @returns {Promise.<?Array>} - result | ||
*/ | ||
@@ -821,3 +821,3 @@ export const queryTabs = async opt => { | ||
* @param {object} opt - options | ||
* @returns {?Array|boolean} - result | ||
* @returns {Promise.<?Array|boolean>} - result | ||
*/ | ||
@@ -869,3 +869,3 @@ export const execScriptToTab = async (tabId, opt = {}) => { | ||
* @param {Array} opts - array of options | ||
* @returns {*} - result of the last executed script | ||
* @returns {Promise.<*>} - result of the last executed script | ||
*/ | ||
@@ -900,4 +900,4 @@ export const execScriptsToTabInOrder = async (tabId, opts = []) => { | ||
* | ||
* @param {number} windowId - window ID | ||
* @returns {object} - tabs.Tab | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<object>} - tabs.Tab | ||
*/ | ||
@@ -919,4 +919,4 @@ export const getActiveTab = async windowId => { | ||
* | ||
* @param {number} windowId - window ID | ||
* @returns {?number} - tab ID | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<?number>} - tab ID | ||
*/ | ||
@@ -938,4 +938,4 @@ export const getActiveTabId = async windowId => { | ||
* | ||
* @param {number} windowId - window ID | ||
* @returns {?Array} - array of tabs.Tab | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<?Array>} - array of tabs.Tab | ||
*/ | ||
@@ -956,4 +956,4 @@ export const getAllTabsInWindow = async windowId => { | ||
* | ||
* @param {number} windowId - window ID | ||
* @returns {?Array} - array of tabs.Tab | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<?Array>} - array of tabs.Tab | ||
*/ | ||
@@ -976,3 +976,3 @@ export const getHighlightedTab = async windowId => { | ||
* @param {number} tabId - tab ID | ||
* @returns {object} - tabs.Tab | ||
* @returns {Promise.<object>} - tabs.Tab | ||
*/ | ||
@@ -991,4 +991,4 @@ export const getTab = async tabId => { | ||
* @param {number|Array} index - tab index | ||
* @param {number} windowId - window ID | ||
* @returns {object} - windows.Window | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<object>} - windows.Window | ||
*/ | ||
@@ -1015,3 +1015,3 @@ export const highlightTab = async (index, windowId) => { | ||
* @param {object} opt - options | ||
* @returns {?Array} - array of tabs.Tab | ||
* @returns {Promise.<?Array>} - array of tabs.Tab | ||
*/ | ||
@@ -1034,3 +1034,3 @@ export const moveTab = async (tabId, opt) => { | ||
* @param {object} opt - options | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -1048,3 +1048,3 @@ export const reloadTab = async (tabId, opt) => { | ||
* @param {number|Array} arg - tab ID or array of tab ID | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -1066,3 +1066,3 @@ export const removeTab = async arg => { | ||
* @param {object} opt - options | ||
* @returns {object} - tabs.Tab | ||
* @returns {Promise.<object>} - tabs.Tab | ||
*/ | ||
@@ -1081,3 +1081,3 @@ export const updateTab = async (tabId, opt) => { | ||
* @param {number} tabId - tab ID | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -1097,3 +1097,3 @@ export const warmupTab = async tabId => { | ||
* @param {*} tabId - tab ID | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -1119,4 +1119,4 @@ export const isTab = async tabId => { | ||
* | ||
* @param {number} windowId - window ID | ||
* @returns {object} - theme.Theme | ||
* @param {number} [windowId] - window ID | ||
* @returns {Promise.<object>} - theme.Theme | ||
*/ | ||
@@ -1141,3 +1141,3 @@ export const getCurrentTheme = async windowId => { | ||
* @param {object} opt - options | ||
* @returns {object} - windows.Window | ||
* @returns {Promise.<object>} - windows.Window | ||
*/ | ||
@@ -1153,3 +1153,3 @@ export const createNewWindow = async opt => { | ||
* @param {boolean} populate - populate tabs | ||
* @returns {Array} - array of windows.Window | ||
* @returns {Promise.<Array>} - array of windows.Window | ||
*/ | ||
@@ -1168,3 +1168,3 @@ export const getAllNormalWindows = async (populate = false) => { | ||
* @param {object} opt - options | ||
* @returns {object} - windows.Window | ||
* @returns {Promise.<object>} - windows.Window | ||
*/ | ||
@@ -1181,3 +1181,3 @@ export const getCurrentWindow = async opt => { | ||
* @param {object} opt - options | ||
* @returns {object} - windows.Window | ||
* @returns {Promise.<object>} - windows.Window | ||
*/ | ||
@@ -1195,3 +1195,3 @@ export const getWindow = async (windowId, opt) => { | ||
* | ||
* @returns {boolean} - result | ||
* @returns {Promise.<boolean>} - result | ||
*/ | ||
@@ -1198,0 +1198,0 @@ export const checkIncognitoWindowExists = async () => { |
@@ -161,3 +161,3 @@ /** | ||
* @param {string} baseDir - base directory path | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -181,3 +181,3 @@ export const removeDirectory = async (dir, baseDir) => { | ||
* @param {number} [mode] - permission | ||
* @returns {string} - directory path | ||
* @returns {Promise.<string>} - directory path | ||
*/ | ||
@@ -209,3 +209,3 @@ export const createDirectory = async (dir, mode = PERM_DIR) => { | ||
* @param {number|string} [opt.mode] - file permission | ||
* @returns {string} - file path | ||
* @returns {Promise.<string>} - file path | ||
*/ | ||
@@ -236,3 +236,3 @@ export const createFile = async (file, value, opt = { | ||
* @param {string} [opt.flag] - flag | ||
* @returns {string|Buffer} - file content | ||
* @returns {Promise.<string|Buffer>} - file content | ||
*/ | ||
@@ -239,0 +239,0 @@ export const readFile = async (file, opt = { encoding: null, flag: 'r' }) => { |
@@ -9,3 +9,2 @@ /** | ||
import JSON5 from 'json5'; | ||
import { program as commander } from 'commander'; | ||
import { getType, isString } from './common.js'; | ||
@@ -24,3 +23,3 @@ import { createFile } from './file-util.js'; | ||
* @param {string} url - URL | ||
* @returns {string} - content text | ||
* @returns {Promise.<string>} - content text | ||
*/ | ||
@@ -72,3 +71,3 @@ export const fetchText = async url => { | ||
* @param {string} baseUrl - base URL | ||
* @returns {object} - schema data | ||
* @returns {Promise.<object>} - schema data | ||
*/ | ||
@@ -94,3 +93,3 @@ export const getSchemaData = async (file, baseUrl) => { | ||
* @param {string} baseUrl - base URL | ||
* @returns {Array} - schema file list | ||
* @returns {Promise.<Array.<string>>} - schema file list | ||
*/ | ||
@@ -183,3 +182,3 @@ export const getFileList = async baseUrl => { | ||
* @param {string} channel - release channel | ||
* @returns {object} - schema | ||
* @returns {Promise.<object>} - schema | ||
*/ | ||
@@ -228,3 +227,3 @@ export const createUnifiedSchema = async channel => { | ||
* @param {boolean} info - console info | ||
* @returns {string} - file path | ||
* @returns {Promise.<string>} - file path | ||
*/ | ||
@@ -253,3 +252,3 @@ export const saveSchemaFile = async (channel, info) => { | ||
* @param {object} cmdOpts - command options | ||
* @returns {void} | ||
* @returns {Promise.<void>} - void | ||
*/ | ||
@@ -278,24 +277,1 @@ export const updateSchemas = async (cmdOpts = {}) => { | ||
}; | ||
/** | ||
* parse command | ||
* | ||
* @param {Array} args - process.argv | ||
* @returns {void} | ||
*/ | ||
export const parseCommand = args => { | ||
const reg = /^(?:(?:--)?help|-[h|v]|--version|u(?:pdate)?)$/; | ||
if (Array.isArray(args) && args.some(arg => reg.test(arg))) { | ||
commander.exitOverride(); | ||
commander.version(process.env.npm_package_version, '-v, --version'); | ||
commander.command('update').alias('u').description('update schemas') | ||
.option('-c, --channel <name>', 'specify the release channel') | ||
.option('-i, --info', 'console info') | ||
.action(updateSchemas); | ||
commander.parse(args); | ||
} | ||
}; | ||
export { | ||
commander | ||
}; |
@@ -16,3 +16,4 @@ { | ||
"dependencies": { | ||
"@types/node": "^18.14.0", | ||
"@types/firefox-webext-browser": "^109.0.0", | ||
"@types/node": "^18.14.1", | ||
"@types/sinon": "^10.0.13", | ||
@@ -26,3 +27,3 @@ "camelize": "^1.0.1", | ||
"devDependencies": { | ||
"c8": "^7.12.0", | ||
"c8": "^7.13.0", | ||
"chai": "^4.3.7", | ||
@@ -39,3 +40,3 @@ "eslint": "^8.34.0", | ||
"typescript": "^4.9.5", | ||
"undici": "^5.19.1" | ||
"undici": "^5.20.0" | ||
}, | ||
@@ -52,3 +53,3 @@ "scripts": { | ||
"test_all": "npm-run-all -s test-*", | ||
"tsc": "node -e \"fs.rmSync('types',{recursive:true,force:true})\" && npx tsc", | ||
"tsc": "node index clean --dir=types -i && npx tsc", | ||
"update": "node index update -i", | ||
@@ -61,3 +62,3 @@ "update-beta": "node index update --channel=beta -i", | ||
}, | ||
"version": "5.1.4" | ||
"version": "5.1.5" | ||
} |
@@ -19,3 +19,3 @@ [![build](https://github.com/asamuzaK/webext-schema/workflows/build/badge.svg)](https://github.com/asamuzaK/webext-schema/actions?query=workflow%3Abuild) | ||
``` | ||
const {Schema} = require("webext-schema"); | ||
import { Schema } from 'webext-schema'; | ||
@@ -22,0 +22,0 @@ const schema = new Schema(); |
{ | ||
"include": ["index.js"], | ||
"compilerOptions": { | ||
@@ -9,5 +8,10 @@ "allowJs": true, | ||
"emitDeclarationOnly": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"newLine": "LF", | ||
"removeComments": true | ||
} | ||
"removeComments": true, | ||
"resolveJsonModule": true, | ||
"target": "esnext" | ||
}, | ||
"include": ["index.js", "modules/browser.js"] | ||
} |
@@ -11,4 +11,4 @@ export function convertUriToFilePath(uri: string): string | null; | ||
export function removeDir(dir: string, baseDir: string): void; | ||
export function removeDirectory(dir: string, baseDir: string): void; | ||
export function createDirectory(dir: string, mode?: number): string; | ||
export function removeDirectory(dir: string, baseDir: string): Promise<void>; | ||
export function createDirectory(dir: string, mode?: number): Promise<string>; | ||
export function createFile(file: string, value: string | Buffer | Uint8Array, opt?: { | ||
@@ -18,6 +18,6 @@ encoding?: string; | ||
mode?: number | string; | ||
}): string; | ||
}): Promise<string>; | ||
export function readFile(file: string, opt?: { | ||
encoding?: string; | ||
flag?: string; | ||
}): string | Buffer; | ||
}): Promise<string | Buffer>; |
export const ESR_VER: 102; | ||
export function fetchText(url: string): string; | ||
export function fetchText(url: string): Promise<string>; | ||
export function getChannelUrl(channel: string): string; | ||
export function getSchemaData(file: string, baseUrl: string): object; | ||
export function getFileList(baseUrl: string): any[]; | ||
export function getSchemaData(file: string, baseUrl: string): Promise<object>; | ||
export function getFileList(baseUrl: string): Promise<Array<string>>; | ||
export function getAllSchemaData(baseUrl: string): Promise<any[]>; | ||
export function getListedSchemaData(baseUrl: string, arr: any[]): Promise<any[]>; | ||
export function getMailExtSchemaData(baseUrl: string): Promise<any[]>; | ||
export function createUnifiedSchema(channel: string): object; | ||
export function saveSchemaFile(channel: string, info: boolean): string; | ||
export function updateSchemas(cmdOpts?: object): void; | ||
export function parseCommand(args: any[]): void; | ||
export { commander }; | ||
import { program as commander } from "commander"; | ||
export function createUnifiedSchema(channel: string): Promise<object>; | ||
export function saveSchemaFile(channel: string, info: boolean): Promise<string>; | ||
export function updateSchemas(cmdOpts?: object): Promise<void>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3546274
25
99628
8
+ Added@types/firefox-webext-browser@109.0.0(transitive)
Updated@types/node@^18.14.1