webext-schema 7.0.0 → 7.1.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/.github/workflows/node.js.yml +2 -2
- package/README.md +37 -6
- package/SECURITY.md +36 -0
- package/eslint.config.mjs +0 -6
- package/index.js +9 -3
- package/modules/browser.js +39 -3
- package/package.json +33 -23
- package/schemas/beta/webext.json +688 -11
- package/schemas/central/webext.json +688 -11
- package/schemas/mail/mailext.json +524 -12
- package/test/browser.test.js +0 -1
- package/test/index.test.js +47 -1
- package/test/update.test.js +33 -1
- package/types/index.d.ts +8 -1
- package/types/modules/browser.d.ts +61 -61
- package/types/modules/commander.d.ts +3 -3
- package/types/modules/common.d.ts +7 -7
- package/types/modules/constant.d.ts +3 -3
- package/types/modules/file-util.d.ts +16 -16
- package/types/modules/schema.d.ts +6 -6
- package/types/modules/update.d.ts +10 -10
package/test/browser.test.js
CHANGED
package/test/index.test.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* api */
|
|
2
2
|
import { strict as assert } from 'node:assert';
|
|
3
|
-
import
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
import { describe, it, beforeEach, afterEach } from 'mocha';
|
|
5
|
+
import sinon from 'sinon';
|
|
4
6
|
|
|
5
7
|
/* test */
|
|
6
8
|
import { Schema } from '../index.js';
|
|
@@ -11,3 +13,47 @@ describe('Schema', () => {
|
|
|
11
13
|
assert.strictEqual(schema instanceof Schema, true);
|
|
12
14
|
});
|
|
13
15
|
});
|
|
16
|
+
|
|
17
|
+
describe('Process Error Handlers', () => {
|
|
18
|
+
let sandbox;
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
sandbox = sinon.createSandbox();
|
|
21
|
+
sandbox.stub(console, 'error');
|
|
22
|
+
sandbox.stub(process, 'exit');
|
|
23
|
+
});
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
sandbox.restore();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should handle uncaughtException', () => {
|
|
29
|
+
const listeners = process.listeners('uncaughtException');
|
|
30
|
+
const targetListener = listeners.find(fn =>
|
|
31
|
+
fn.toString().includes('Fatal Error (Uncaught Exception)')
|
|
32
|
+
);
|
|
33
|
+
assert.ok(targetListener,
|
|
34
|
+
'Target listener for uncaughtException should be found');
|
|
35
|
+
const testError = new Error('Test Uncaught Exception');
|
|
36
|
+
targetListener(testError);
|
|
37
|
+
assert.strictEqual(console.error.calledOnce, true);
|
|
38
|
+
assert.strictEqual(console.error.firstCall.args[0],
|
|
39
|
+
'Fatal Error (Uncaught Exception):');
|
|
40
|
+
assert.strictEqual(console.error.firstCall.args[1], testError);
|
|
41
|
+
assert.strictEqual(process.exit.calledOnceWithExactly(1), true);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should handle unhandledRejection', () => {
|
|
45
|
+
const listeners = process.listeners('unhandledRejection');
|
|
46
|
+
const targetListener = listeners.find(fn =>
|
|
47
|
+
fn.toString().includes('Fatal Error (Unhandled Rejection)')
|
|
48
|
+
);
|
|
49
|
+
assert.ok(targetListener,
|
|
50
|
+
'Target listener for unhandledRejection should be found');
|
|
51
|
+
const testReason = 'Test Unhandled Rejection';
|
|
52
|
+
targetListener(testReason);
|
|
53
|
+
assert.strictEqual(console.error.calledOnce, true);
|
|
54
|
+
assert.strictEqual(console.error.firstCall.args[0],
|
|
55
|
+
'Fatal Error (Unhandled Rejection):');
|
|
56
|
+
assert.strictEqual(console.error.firstCall.args[1], testReason);
|
|
57
|
+
assert.strictEqual(process.exit.calledOnceWithExactly(1), true);
|
|
58
|
+
});
|
|
59
|
+
});
|
package/test/update.test.js
CHANGED
|
@@ -5,7 +5,12 @@ import path from 'node:path';
|
|
|
5
5
|
import process from 'node:process';
|
|
6
6
|
import sinon from 'sinon';
|
|
7
7
|
import { afterEach, beforeEach, describe, it } from 'mocha';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
fetch as undiciFetch,
|
|
10
|
+
getGlobalDispatcher,
|
|
11
|
+
MockAgent,
|
|
12
|
+
setGlobalDispatcher
|
|
13
|
+
} from 'undici';
|
|
9
14
|
|
|
10
15
|
/* test */
|
|
11
16
|
import {
|
|
@@ -15,15 +20,18 @@ import {
|
|
|
15
20
|
} from '../modules/update.js';
|
|
16
21
|
|
|
17
22
|
describe('fetch text', () => {
|
|
23
|
+
const originalFetch = globalThis.fetch;
|
|
18
24
|
const globalDispatcher = getGlobalDispatcher();
|
|
19
25
|
const mockAgent = new MockAgent();
|
|
20
26
|
beforeEach(() => {
|
|
21
27
|
setGlobalDispatcher(mockAgent);
|
|
22
28
|
mockAgent.disableNetConnect();
|
|
29
|
+
globalThis.fetch = undiciFetch;
|
|
23
30
|
});
|
|
24
31
|
afterEach(() => {
|
|
25
32
|
mockAgent.enableNetConnect();
|
|
26
33
|
setGlobalDispatcher(globalDispatcher);
|
|
34
|
+
globalThis.fetch = originalFetch;
|
|
27
35
|
});
|
|
28
36
|
|
|
29
37
|
it('should throw', async () => {
|
|
@@ -90,15 +98,18 @@ describe('get channel url', () => {
|
|
|
90
98
|
});
|
|
91
99
|
|
|
92
100
|
describe('get schema data', () => {
|
|
101
|
+
const originalFetch = globalThis.fetch;
|
|
93
102
|
const globalDispatcher = getGlobalDispatcher();
|
|
94
103
|
const mockAgent = new MockAgent();
|
|
95
104
|
beforeEach(() => {
|
|
96
105
|
setGlobalDispatcher(mockAgent);
|
|
97
106
|
mockAgent.disableNetConnect();
|
|
107
|
+
globalThis.fetch = undiciFetch;
|
|
98
108
|
});
|
|
99
109
|
afterEach(() => {
|
|
100
110
|
mockAgent.enableNetConnect();
|
|
101
111
|
setGlobalDispatcher(globalDispatcher);
|
|
112
|
+
globalThis.fetch = originalFetch;
|
|
102
113
|
});
|
|
103
114
|
|
|
104
115
|
it('should throw', async () => {
|
|
@@ -130,15 +141,18 @@ describe('get schema data', () => {
|
|
|
130
141
|
});
|
|
131
142
|
|
|
132
143
|
describe('get schema file list from jar manifest', () => {
|
|
144
|
+
const originalFetch = globalThis.fetch;
|
|
133
145
|
const globalDispatcher = getGlobalDispatcher();
|
|
134
146
|
const mockAgent = new MockAgent();
|
|
135
147
|
beforeEach(() => {
|
|
136
148
|
setGlobalDispatcher(mockAgent);
|
|
137
149
|
mockAgent.disableNetConnect();
|
|
150
|
+
globalThis.fetch = undiciFetch;
|
|
138
151
|
});
|
|
139
152
|
afterEach(() => {
|
|
140
153
|
mockAgent.enableNetConnect();
|
|
141
154
|
setGlobalDispatcher(globalDispatcher);
|
|
155
|
+
globalThis.fetch = originalFetch;
|
|
142
156
|
});
|
|
143
157
|
|
|
144
158
|
it('should throw', async () => {
|
|
@@ -163,15 +177,18 @@ describe('get schema file list from jar manifest', () => {
|
|
|
163
177
|
});
|
|
164
178
|
|
|
165
179
|
describe('get all schema data', () => {
|
|
180
|
+
const originalFetch = globalThis.fetch;
|
|
166
181
|
const globalDispatcher = getGlobalDispatcher();
|
|
167
182
|
const mockAgent = new MockAgent();
|
|
168
183
|
beforeEach(() => {
|
|
169
184
|
setGlobalDispatcher(mockAgent);
|
|
170
185
|
mockAgent.disableNetConnect();
|
|
186
|
+
globalThis.fetch = undiciFetch;
|
|
171
187
|
});
|
|
172
188
|
afterEach(() => {
|
|
173
189
|
mockAgent.enableNetConnect();
|
|
174
190
|
setGlobalDispatcher(globalDispatcher);
|
|
191
|
+
globalThis.fetch = originalFetch;
|
|
175
192
|
});
|
|
176
193
|
|
|
177
194
|
it('should throw', async () => {
|
|
@@ -241,15 +258,18 @@ describe('get all schema data', () => {
|
|
|
241
258
|
});
|
|
242
259
|
|
|
243
260
|
describe('get listed schema data', () => {
|
|
261
|
+
const originalFetch = globalThis.fetch;
|
|
244
262
|
const globalDispatcher = getGlobalDispatcher();
|
|
245
263
|
const mockAgent = new MockAgent();
|
|
246
264
|
beforeEach(() => {
|
|
247
265
|
setGlobalDispatcher(mockAgent);
|
|
248
266
|
mockAgent.disableNetConnect();
|
|
267
|
+
globalThis.fetch = undiciFetch;
|
|
249
268
|
});
|
|
250
269
|
afterEach(() => {
|
|
251
270
|
mockAgent.enableNetConnect();
|
|
252
271
|
setGlobalDispatcher(globalDispatcher);
|
|
272
|
+
globalThis.fetch = originalFetch;
|
|
253
273
|
});
|
|
254
274
|
|
|
255
275
|
it('should throw', async () => {
|
|
@@ -324,15 +344,18 @@ describe('get listed schema data', () => {
|
|
|
324
344
|
});
|
|
325
345
|
|
|
326
346
|
describe('get MailExtensions schema data', () => {
|
|
347
|
+
const originalFetch = globalThis.fetch;
|
|
327
348
|
const globalDispatcher = getGlobalDispatcher();
|
|
328
349
|
const mockAgent = new MockAgent();
|
|
329
350
|
beforeEach(() => {
|
|
330
351
|
setGlobalDispatcher(mockAgent);
|
|
331
352
|
mockAgent.disableNetConnect();
|
|
353
|
+
globalThis.fetch = undiciFetch;
|
|
332
354
|
});
|
|
333
355
|
afterEach(() => {
|
|
334
356
|
mockAgent.enableNetConnect();
|
|
335
357
|
setGlobalDispatcher(globalDispatcher);
|
|
358
|
+
globalThis.fetch = originalFetch;
|
|
336
359
|
});
|
|
337
360
|
|
|
338
361
|
it('should throw', async () => {
|
|
@@ -402,15 +425,18 @@ describe('get MailExtensions schema data', () => {
|
|
|
402
425
|
});
|
|
403
426
|
|
|
404
427
|
describe('create unified schema', () => {
|
|
428
|
+
const originalFetch = globalThis.fetch;
|
|
405
429
|
const globalDispatcher = getGlobalDispatcher();
|
|
406
430
|
const mockAgent = new MockAgent();
|
|
407
431
|
beforeEach(() => {
|
|
408
432
|
setGlobalDispatcher(mockAgent);
|
|
409
433
|
mockAgent.disableNetConnect();
|
|
434
|
+
globalThis.fetch = undiciFetch;
|
|
410
435
|
});
|
|
411
436
|
afterEach(() => {
|
|
412
437
|
mockAgent.enableNetConnect();
|
|
413
438
|
setGlobalDispatcher(globalDispatcher);
|
|
439
|
+
globalThis.fetch = originalFetch;
|
|
414
440
|
});
|
|
415
441
|
|
|
416
442
|
it('should get object', async () => {
|
|
@@ -579,15 +605,18 @@ describe('create unified schema', () => {
|
|
|
579
605
|
});
|
|
580
606
|
|
|
581
607
|
describe('save schema file', () => {
|
|
608
|
+
const originalFetch = globalThis.fetch;
|
|
582
609
|
const globalDispatcher = getGlobalDispatcher();
|
|
583
610
|
const mockAgent = new MockAgent();
|
|
584
611
|
beforeEach(() => {
|
|
585
612
|
setGlobalDispatcher(mockAgent);
|
|
586
613
|
mockAgent.disableNetConnect();
|
|
614
|
+
globalThis.fetch = undiciFetch;
|
|
587
615
|
});
|
|
588
616
|
afterEach(() => {
|
|
589
617
|
mockAgent.enableNetConnect();
|
|
590
618
|
setGlobalDispatcher(globalDispatcher);
|
|
619
|
+
globalThis.fetch = originalFetch;
|
|
591
620
|
});
|
|
592
621
|
|
|
593
622
|
it('should throw', async () => {
|
|
@@ -781,15 +810,18 @@ describe('save schema file', () => {
|
|
|
781
810
|
});
|
|
782
811
|
|
|
783
812
|
describe('update schemas files', () => {
|
|
813
|
+
const originalFetch = globalThis.fetch;
|
|
784
814
|
const globalDispatcher = getGlobalDispatcher();
|
|
785
815
|
const mockAgent = new MockAgent();
|
|
786
816
|
beforeEach(() => {
|
|
787
817
|
setGlobalDispatcher(mockAgent);
|
|
788
818
|
mockAgent.disableNetConnect();
|
|
819
|
+
globalThis.fetch = undiciFetch;
|
|
789
820
|
});
|
|
790
821
|
afterEach(() => {
|
|
791
822
|
mockAgent.enableNetConnect();
|
|
792
823
|
setGlobalDispatcher(globalDispatcher);
|
|
824
|
+
globalThis.fetch = originalFetch;
|
|
793
825
|
});
|
|
794
826
|
|
|
795
827
|
it('should not call function', async () => {
|
package/types/index.d.ts
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
export
|
|
49
|
-
export
|
|
50
|
-
export
|
|
51
|
-
export
|
|
52
|
-
export
|
|
53
|
-
export
|
|
54
|
-
export
|
|
55
|
-
export
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
export
|
|
59
|
-
export
|
|
60
|
-
export
|
|
61
|
-
export
|
|
1
|
+
export declare const isPermissionGranted: (perm: object) => Promise<boolean>;
|
|
2
|
+
export declare const createBookmark: (opt: object) => Promise<object>;
|
|
3
|
+
export declare const getBookmarkTreeNode: (id?: string | any[]) => Promise<Array<object> | null>;
|
|
4
|
+
export declare const getCloseTabsByDoubleClickValue: () => Promise<object>;
|
|
5
|
+
export declare const setContextMenuOnMouseup: () => Promise<boolean>;
|
|
6
|
+
export declare const clearContextMenuOnMouseup: () => Promise<boolean>;
|
|
7
|
+
export declare const getNewTabPositionValue: () => Promise<object>;
|
|
8
|
+
export declare const isCommandCustomizable: () => Promise<boolean>;
|
|
9
|
+
export declare const updateCommand: (id: string, value?: string) => Promise<void | null>;
|
|
10
|
+
export declare const getAllContextualIdentities: () => Promise<Array<object> | null>;
|
|
11
|
+
export declare const getContextualId: (cookieStoreId: string) => Promise<object>;
|
|
12
|
+
export declare const getEnabledTheme: () => Promise<Array<object> | null>;
|
|
13
|
+
export declare const getExtensionInfo: (id: string) => Promise<object>;
|
|
14
|
+
export declare const getExternalExtensions: () => Promise<Array<object> | null>;
|
|
15
|
+
export declare const clearNotification: (id: string) => Promise<boolean | null>;
|
|
16
|
+
export declare const createNotification: (id: string, opt: object) => Promise<string | null>;
|
|
17
|
+
export declare const removePermission: (perm: string | any[]) => Promise<boolean>;
|
|
18
|
+
export declare const requestPermission: (perm: string | any[]) => Promise<boolean>;
|
|
19
|
+
export declare const getManifestIcons: () => object | string;
|
|
20
|
+
export declare const getManifestVersion: () => number;
|
|
21
|
+
export declare const getOs: () => Promise<string>;
|
|
22
|
+
export declare const makeConnection: (id?: number | string, info?: object | boolean) => Promise<object>;
|
|
23
|
+
export declare const sendMessage: (id: number | string, msg: string | any[] | object, opt: object) => Promise<object>;
|
|
24
|
+
export declare const isScriptingAvailable: () => Promise<boolean>;
|
|
25
|
+
export declare const executeScriptToTab: (opt?: object) => Promise<Array<object> | null>;
|
|
26
|
+
export declare const searchInNewTab: (text: string, opt: object) => Promise<object>;
|
|
27
|
+
export declare const searchWithSearchEngine: (query: string, opt?: object) => Promise<void>;
|
|
28
|
+
export declare const getRecentlyClosedTab: (windowId?: number) => Promise<object>;
|
|
29
|
+
export declare const getSessionWindowValue: (key: string, windowId?: number) => Promise<string | null>;
|
|
30
|
+
export declare const restoreSession: (sessionId: string) => Promise<object>;
|
|
31
|
+
export declare const setSessionWindowValue: (key: string, value: string | object, windowId?: number) => Promise<void>;
|
|
32
|
+
export declare const clearStorage: (area?: string) => Promise<void>;
|
|
33
|
+
export declare const getAllStorage: (area?: string) => Promise<object>;
|
|
34
|
+
export declare const getStorage: (key: string | any[] | object, area?: string) => Promise<object>;
|
|
35
|
+
export declare const removeStorage: (key: string | any[] | object, area?: string) => Promise<void>;
|
|
36
|
+
export declare const setStorage: (obj: object, area?: string) => Promise<void>;
|
|
37
|
+
export declare const createTab: (opt?: object) => Promise<object>;
|
|
38
|
+
export declare const duplicateTab: (tabId: number, opt: object) => Promise<object>;
|
|
39
|
+
export declare const queryTabs: (opt: object) => Promise<Array<object>>;
|
|
40
|
+
export declare const execScriptToTab: (tabId: number | object, opt?: object) => Promise<(any[] | null) | boolean>;
|
|
41
|
+
export declare const execScriptToTabs: (opt?: object) => Promise<any[]>;
|
|
42
|
+
export declare const execScriptsToTabInOrder: (tabId: number | any[], opts?: any[]) => Promise<(any[] | null) | boolean>;
|
|
43
|
+
export declare const getActiveTab: (windowId?: number) => Promise<object>;
|
|
44
|
+
export declare const getActiveTabId: (windowId?: number) => Promise<number | null>;
|
|
45
|
+
export declare const getAllTabsInWindow: (windowId?: number) => Promise<Array<object>>;
|
|
46
|
+
export declare const getHighlightedTab: (windowId?: number) => Promise<Array<object>>;
|
|
47
|
+
export declare const getTab: (tabId: number) => Promise<object>;
|
|
48
|
+
export declare const highlightTab: (index: number | any[], windowId?: number) => Promise<object>;
|
|
49
|
+
export declare const moveTab: (tabId: number | any[], opt?: object) => Promise<Array<object> | null>;
|
|
50
|
+
export declare const reloadTab: (tabId: number, opt: object) => Promise<void>;
|
|
51
|
+
export declare const removeTab: (arg: number | any[]) => Promise<void>;
|
|
52
|
+
export declare const updateTab: (tabId: number, opt: object) => Promise<object>;
|
|
53
|
+
export declare const warmupTab: (tabId: number) => Promise<void>;
|
|
54
|
+
export declare const captureVisibleTab: (windowId: number, opt: object) => Promise<string | null>;
|
|
55
|
+
export declare const isTab: (tabId: number) => Promise<boolean>;
|
|
56
|
+
export declare const getCurrentTheme: (windowId?: number) => Promise<object>;
|
|
57
|
+
export declare const createNewWindow: (opt: object) => Promise<object>;
|
|
58
|
+
export declare const getAllNormalWindows: (populate?: boolean) => Promise<Array<object>>;
|
|
59
|
+
export declare const getCurrentWindow: (opt: object) => Promise<object>;
|
|
60
|
+
export declare const getWindow: (windowId: number, opt: object) => Promise<object>;
|
|
61
|
+
export declare const checkIncognitoWindowExists: () => Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function cleanDirectory(cmdOpts?: object): void;
|
|
2
|
-
export function parseCommand(args: any[]): void;
|
|
3
|
-
export { commander };
|
|
4
1
|
import { program as commander } from 'commander';
|
|
2
|
+
export declare const cleanDirectory: (cmdOpts?: object) => void;
|
|
3
|
+
export declare const parseCommand: (args: any[]) => void;
|
|
4
|
+
export { commander };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
1
|
+
export declare const throwErr: (e: object) => never;
|
|
2
|
+
export declare const logErr: (e: object) => boolean;
|
|
3
|
+
export declare const logWarn: (msg: string | object) => boolean;
|
|
4
|
+
export declare const logMsg: (msg: string | object) => string | object;
|
|
5
|
+
export declare const getType: (o: object) => string;
|
|
6
|
+
export declare const isObjectNotEmpty: (o: object) => boolean;
|
|
7
|
+
export declare const isString: (o: object) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const CHAR
|
|
2
|
-
export const INDENT
|
|
3
|
-
export const IS_WIN: boolean;
|
|
1
|
+
export declare const CHAR = "utf8";
|
|
2
|
+
export declare const INDENT = 2;
|
|
3
|
+
export declare const IS_WIN: boolean;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
1
|
+
export declare const convertUriToFilePath: (uri: string) => string | null;
|
|
2
|
+
export declare const getAbsPath: (file: string) => string | null;
|
|
3
|
+
export declare const getStat: (file: string) => object;
|
|
4
|
+
export declare const isDir: (dir: string) => boolean;
|
|
5
|
+
export declare const isSubDir: (dir: string, baseDir: string) => boolean;
|
|
6
|
+
export declare const isFile: (file: string) => boolean;
|
|
7
|
+
export declare const isExecutable: (file: string, mask?: number) => boolean;
|
|
8
|
+
export declare const getFileTimestamp: (file: string) => number;
|
|
9
|
+
export declare const getFileNameFromFilePath: (file: string, subst?: string) => string;
|
|
10
|
+
export declare const removeDir: (dir: string, baseDir: string) => void;
|
|
11
|
+
export declare const removeDirectory: (dir: string, baseDir: string) => Promise<void>;
|
|
12
|
+
export declare const createDirectory: (dir: string, mode?: number) => Promise<string>;
|
|
13
|
+
export declare const createFile: (file: string, value: string | Buffer | Uint8Array, opt?: {
|
|
14
14
|
encoding?: string;
|
|
15
15
|
flag?: string;
|
|
16
16
|
mode?: number | string;
|
|
17
|
-
})
|
|
18
|
-
export
|
|
17
|
+
}) => Promise<string>;
|
|
18
|
+
export declare const readFile: (file: string, opt?: {
|
|
19
19
|
encoding?: string;
|
|
20
20
|
flag?: string;
|
|
21
|
-
})
|
|
21
|
+
}) => Promise<string | Buffer>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
export declare class Schema {
|
|
3
|
+
#private;
|
|
3
4
|
_sandbox: sinon.SinonSandbox;
|
|
4
5
|
_importMap: Map<any, any>;
|
|
5
6
|
_refMap: Map<any, any>;
|
|
6
7
|
_browser: {
|
|
7
8
|
_sandbox: sinon.SinonSandbox;
|
|
8
|
-
};
|
|
9
|
+
} | null;
|
|
9
10
|
_schema: any;
|
|
10
|
-
|
|
11
|
+
constructor(...args?: (string | object)[]);
|
|
11
12
|
get channel(): any;
|
|
13
|
+
set channel(ch: any);
|
|
12
14
|
private _getTargetFromNamespace;
|
|
13
15
|
private _assignImportMap;
|
|
14
16
|
private _assignRefMap;
|
|
@@ -21,6 +23,4 @@ export class Schema {
|
|
|
21
23
|
getAll(): object;
|
|
22
24
|
list(): Array<string>;
|
|
23
25
|
mock(): object;
|
|
24
|
-
#private;
|
|
25
26
|
}
|
|
26
|
-
import sinon from 'sinon';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
1
|
+
export declare const fetchText: (url: string) => Promise<string>;
|
|
2
|
+
export declare const getChannelUrl: (channel: string) => string;
|
|
3
|
+
export declare const getSchemaData: (file: string, baseUrl: string) => Promise<object>;
|
|
4
|
+
export declare const getFileList: (baseUrl: string) => Promise<Array<string>>;
|
|
5
|
+
export declare const getAllSchemaData: (baseUrl: string, info: boolean) => Promise<Array<object>>;
|
|
6
|
+
export declare const getListedSchemaData: (baseUrl: string, arr: any[], info: boolean) => Promise<Array<object>>;
|
|
7
|
+
export declare const getMailExtSchemaData: (baseUrl: string, info: boolean) => Promise<Array<object>>;
|
|
8
|
+
export declare const createUnifiedSchema: (channel: string, info: boolean) => Promise<object>;
|
|
9
|
+
export declare const saveSchemaFile: (channel: string, info: boolean) => Promise<string>;
|
|
10
|
+
export declare const updateSchemas: (cmdOpts?: object) => Promise<void>;
|