@appsemble/node-utils 0.20.11 → 0.20.14
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/AppsembleError.js +1 -5
- package/AppsembleError.js.map +1 -1
- package/AppsembleError.test.js +2 -4
- package/AppsembleError.test.js.map +1 -1
- package/AppsembleError.test.ts +1 -1
- package/README.md +4 -4
- package/basicAuth.js +1 -5
- package/basicAuth.js.map +1 -1
- package/basicAuth.test.js +2 -4
- package/basicAuth.test.js.map +1 -1
- package/basicAuth.test.ts +1 -1
- package/formData.js +5 -12
- package/formData.js.map +1 -1
- package/formData.test.js +9 -11
- package/formData.test.js.map +1 -1
- package/formData.test.ts +1 -1
- package/fs.d.ts +2 -1
- package/fs.js +35 -65
- package/fs.js.map +1 -1
- package/fs.test.js +32 -34
- package/fs.test.js.map +1 -1
- package/fs.test.ts +6 -6
- package/fs.ts +12 -9
- package/getWorkspaces.js +6 -13
- package/getWorkspaces.js.map +1 -1
- package/handleError.js +6 -10
- package/handleError.js.map +1 -1
- package/handleError.test.js +13 -15
- package/handleError.test.js.map +1 -1
- package/handleError.test.ts +7 -7
- package/handleError.ts +2 -2
- package/index.d.ts +11 -11
- package/index.js +11 -27
- package/index.js.map +1 -1
- package/index.ts +11 -11
- package/interceptors.js +17 -27
- package/interceptors.js.map +1 -1
- package/interceptors.test.js +30 -40
- package/interceptors.test.js.map +1 -1
- package/interceptors.test.ts +7 -13
- package/interceptors.ts +1 -1
- package/jest.config.js +3 -1
- package/jest.setup.js +4 -6
- package/jest.setup.js.map +1 -1
- package/jest.setup.ts +3 -3
- package/logger.js +27 -35
- package/logger.js.map +1 -1
- package/logger.test.js +15 -17
- package/logger.test.js.map +1 -1
- package/logger.test.ts +1 -1
- package/loggerMiddleware.js +18 -25
- package/loggerMiddleware.js.map +1 -1
- package/loggerMiddleware.test.js +42 -52
- package/loggerMiddleware.test.js.map +1 -1
- package/loggerMiddleware.test.ts +15 -21
- package/loggerMiddleware.ts +1 -1
- package/package.json +8 -9
- package/readFileOrString.js +5 -9
- package/readFileOrString.js.map +1 -1
- package/readFileOrString.test.js +4 -6
- package/readFileOrString.test.js.map +1 -1
- package/readFileOrString.test.ts +2 -2
- package/readFileOrString.ts +1 -1
- package/testFixtures.d.ts +5 -4
- package/testFixtures.js +13 -24
- package/testFixtures.js.map +1 -1
- package/testFixtures.ts +9 -9
- package/tsconfig.json +1 -1
- package/__mocks__/os.d.ts +0 -5
- package/__mocks__/os.js +0 -8
- package/__mocks__/os.js.map +0 -1
- package/__mocks__/os.ts +0 -10
package/fs.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppsembleError, isErrno, opendirSafe, readData, resolveFixture } from '.';
|
|
1
|
+
import { AppsembleError, isErrno, opendirSafe, readData, resolveFixture } from './index.js';
|
|
2
2
|
|
|
3
3
|
describe('isErrno', () => {
|
|
4
4
|
it('should return false for null', () => {
|
|
@@ -55,7 +55,7 @@ describe('readData', () => {
|
|
|
55
55
|
|
|
56
56
|
describe('opendirSafe', () => {
|
|
57
57
|
it('should read a directory', async () => {
|
|
58
|
-
const onFile = jest.fn();
|
|
58
|
+
const onFile = import.meta.jest.fn();
|
|
59
59
|
await opendirSafe(resolveFixture('test'), onFile);
|
|
60
60
|
expect(onFile).toHaveBeenCalledTimes(3);
|
|
61
61
|
expect(onFile).toHaveBeenCalledWith(
|
|
@@ -73,7 +73,7 @@ describe('opendirSafe', () => {
|
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
it('should read a directory recursively if specified', async () => {
|
|
76
|
-
const onFile = jest.fn();
|
|
76
|
+
const onFile = import.meta.jest.fn();
|
|
77
77
|
await opendirSafe(resolveFixture('test'), onFile, { recursive: true });
|
|
78
78
|
expect(onFile).toHaveBeenCalledTimes(5);
|
|
79
79
|
expect(onFile).toHaveBeenCalledWith(
|
|
@@ -100,21 +100,21 @@ describe('opendirSafe', () => {
|
|
|
100
100
|
|
|
101
101
|
it('should throw if the path is not a directory', async () => {
|
|
102
102
|
const path = resolveFixture('hello.txt');
|
|
103
|
-
await expect(opendirSafe(path, jest.fn())).rejects.toThrow(
|
|
103
|
+
await expect(opendirSafe(path, import.meta.jest.fn())).rejects.toThrow(
|
|
104
104
|
new AppsembleError(`Expected ${path} to be a directory`),
|
|
105
105
|
);
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
it('should throw if the path doesn’t exist', async () => {
|
|
109
109
|
const path = resolveFixture('non-existent');
|
|
110
|
-
await expect(opendirSafe(path, jest.fn())).rejects.toThrow(
|
|
110
|
+
await expect(opendirSafe(path, import.meta.jest.fn())).rejects.toThrow(
|
|
111
111
|
new AppsembleError(`Expected ${path} to be a directory`),
|
|
112
112
|
);
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
it('should not throw if the path doesn’t exist and allowMissing is true', async () => {
|
|
116
116
|
const path = resolveFixture('non-existent');
|
|
117
|
-
const result = await opendirSafe(path, jest.fn(), { allowMissing: true });
|
|
117
|
+
const result = await opendirSafe(path, import.meta.jest.fn(), { allowMissing: true });
|
|
118
118
|
expect(result).toBeUndefined();
|
|
119
119
|
});
|
|
120
120
|
});
|
package/fs.ts
CHANGED
|
@@ -8,7 +8,7 @@ import sortKeys from 'sort-keys';
|
|
|
8
8
|
import { Promisable } from 'type-fest';
|
|
9
9
|
import { parse, stringify } from 'yaml';
|
|
10
10
|
|
|
11
|
-
import { AppsembleError } from '.';
|
|
11
|
+
import { AppsembleError } from './index.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Test if the error is a NodeJS errno exception.
|
|
@@ -34,9 +34,9 @@ export function isErrno(error: unknown, code?: string): error is NodeJS.ErrnoExc
|
|
|
34
34
|
* @param path The path to the file to read.
|
|
35
35
|
* @returns A tuple of the parsed content and the content as a string.
|
|
36
36
|
*/
|
|
37
|
-
export async function readData<R>(path: string): Promise<[R, string]> {
|
|
37
|
+
export async function readData<R>(path: URL | string): Promise<[R, string]> {
|
|
38
38
|
let content: string;
|
|
39
|
-
const ext = extname(path);
|
|
39
|
+
const ext = extname(String(path));
|
|
40
40
|
try {
|
|
41
41
|
content = await readFile(path, 'utf8');
|
|
42
42
|
} catch {
|
|
@@ -87,16 +87,19 @@ export async function writeData(
|
|
|
87
87
|
const sorted = sort ? sortKeys(data, { deep: true, compare: compare || undefined }) : data;
|
|
88
88
|
let buffer: string;
|
|
89
89
|
try {
|
|
90
|
-
const {
|
|
91
|
-
const { inferredParser } = await getFileInfo(path, { resolveConfig: true });
|
|
92
|
-
const prettierOptions = await resolveConfig(path, { editorconfig: true });
|
|
90
|
+
const { default: prettier } = await import('prettier');
|
|
91
|
+
const { inferredParser } = await prettier.getFileInfo(path, { resolveConfig: true });
|
|
92
|
+
const prettierOptions = await prettier.resolveConfig(path, { editorconfig: true });
|
|
93
93
|
prettierOptions.parser = inferredParser;
|
|
94
|
-
buffer =
|
|
95
|
-
|
|
94
|
+
buffer =
|
|
95
|
+
inferredParser === 'yaml' ? stringify(sorted) : `${JSON.stringify(sorted, undefined, 2)}\n`;
|
|
96
|
+
buffer = prettier.format(buffer, prettierOptions);
|
|
96
97
|
} catch {
|
|
97
98
|
const ext = extname(path);
|
|
98
99
|
buffer =
|
|
99
|
-
ext === '.yml' || ext === '.yaml'
|
|
100
|
+
ext === '.yml' || ext === '.yaml'
|
|
101
|
+
? stringify(sorted)
|
|
102
|
+
: `${JSON.stringify(sorted, undefined, 2)}\n`;
|
|
100
103
|
}
|
|
101
104
|
await mkdir(dirname(path), { recursive: true });
|
|
102
105
|
await writeFile(path, buffer);
|
package/getWorkspaces.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getWorkspaces = void 0;
|
|
7
|
-
const promises_1 = require("fs/promises");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import fg from 'fast-glob';
|
|
10
4
|
/**
|
|
11
5
|
* Discover Appsemble blocks based on workspaces in a monorepo.
|
|
12
6
|
*
|
|
@@ -15,9 +9,9 @@ const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
|
15
9
|
* @param cwd The project root in which to find workspaces.
|
|
16
10
|
* @returns Discovered Appsemble blocks.
|
|
17
11
|
*/
|
|
18
|
-
async function getWorkspaces(cwd) {
|
|
19
|
-
const { workspaces = [] } = JSON.parse(await
|
|
20
|
-
const dirs = await (
|
|
12
|
+
export async function getWorkspaces(cwd) {
|
|
13
|
+
const { workspaces = [] } = JSON.parse(await readFile(join(cwd, 'package.json'), 'utf8'));
|
|
14
|
+
const dirs = await fg(workspaces, {
|
|
21
15
|
cwd,
|
|
22
16
|
absolute: true,
|
|
23
17
|
followSymbolicLinks: true,
|
|
@@ -25,5 +19,4 @@ async function getWorkspaces(cwd) {
|
|
|
25
19
|
});
|
|
26
20
|
return dirs.sort();
|
|
27
21
|
}
|
|
28
|
-
exports.getWorkspaces = getWorkspaces;
|
|
29
22
|
//# sourceMappingURL=getWorkspaces.js.map
|
package/getWorkspaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkspaces.js","sourceRoot":"","sources":["getWorkspaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getWorkspaces.js","sourceRoot":"","sources":["getWorkspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAW;IAC7C,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1F,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,UAAU,EAAE;QAChC,GAAG;QACH,QAAQ,EAAE,IAAI;QACd,mBAAmB,EAAE,IAAI;QACzB,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;AACrB,CAAC"}
|
package/handleError.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.handleError = void 0;
|
|
4
|
-
const AppsembleError_1 = require("./AppsembleError");
|
|
5
|
-
const logger_1 = require("./logger");
|
|
1
|
+
import { AppsembleError } from './AppsembleError.js';
|
|
2
|
+
import { logger } from './logger.js';
|
|
6
3
|
/**
|
|
7
4
|
* Handle a fatal error.
|
|
8
5
|
*
|
|
@@ -12,19 +9,18 @@ const logger_1 = require("./logger");
|
|
|
12
9
|
* @param error The error that was thrown.
|
|
13
10
|
* @param yargs The active yargs instance.
|
|
14
11
|
*/
|
|
15
|
-
function handleError(message, error, yargs) {
|
|
12
|
+
export function handleError(message, error, yargs) {
|
|
16
13
|
if (typeof message === 'string') {
|
|
17
14
|
yargs.showHelp();
|
|
18
15
|
// eslint-disable-next-line no-console
|
|
19
16
|
console.error(message);
|
|
20
17
|
}
|
|
21
|
-
else if (error instanceof
|
|
22
|
-
|
|
18
|
+
else if (error instanceof AppsembleError) {
|
|
19
|
+
logger.error(error.message);
|
|
23
20
|
}
|
|
24
21
|
else {
|
|
25
|
-
|
|
22
|
+
logger.error(error);
|
|
26
23
|
}
|
|
27
24
|
process.exit(1);
|
|
28
25
|
}
|
|
29
|
-
exports.handleError = handleError;
|
|
30
26
|
//# sourceMappingURL=handleError.js.map
|
package/handleError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleError.js","sourceRoot":"","sources":["handleError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handleError.js","sourceRoot":"","sources":["handleError.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,KAAY,EAAE,KAAW;IACpE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KACxB;SAAM,IAAI,KAAK,YAAY,cAAc,EAAE;QAC1C,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC7B;SAAM;QACL,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACrB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
package/handleError.test.js
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const handleError_1 = require("./handleError");
|
|
5
|
-
const logger_1 = require("./logger");
|
|
1
|
+
import { AppsembleError } from './AppsembleError.js';
|
|
2
|
+
import { handleError } from './handleError.js';
|
|
3
|
+
import { logger } from './logger.js';
|
|
6
4
|
let yargs;
|
|
7
5
|
beforeEach(() => {
|
|
8
|
-
yargs = { showHelp: jest.fn() };
|
|
9
|
-
jest.spyOn(console, 'error').mockImplementation();
|
|
10
|
-
jest.spyOn(process, 'exit').mockImplementation();
|
|
11
|
-
jest.spyOn(
|
|
6
|
+
yargs = { showHelp: import.meta.jest.fn() };
|
|
7
|
+
import.meta.jest.spyOn(console, 'error').mockImplementation();
|
|
8
|
+
import.meta.jest.spyOn(process, 'exit').mockImplementation();
|
|
9
|
+
import.meta.jest.spyOn(logger, 'error').mockImplementation();
|
|
12
10
|
});
|
|
13
11
|
it('should show the help message if it is passed a yargs message', () => {
|
|
14
|
-
|
|
12
|
+
handleError('Command foo not found', undefined, yargs);
|
|
15
13
|
// eslint-disable-next-line no-console
|
|
16
14
|
expect(console.error).toHaveBeenCalledWith('Command foo not found');
|
|
17
15
|
expect(yargs.showHelp).toHaveBeenCalledWith();
|
|
18
|
-
expect(
|
|
16
|
+
expect(logger.error).not.toHaveBeenCalled();
|
|
19
17
|
expect(process.exit).toHaveBeenCalledWith(1);
|
|
20
18
|
});
|
|
21
19
|
it('should log the message of an Appsemble error', () => {
|
|
22
|
-
|
|
20
|
+
handleError(undefined, new AppsembleError('Oh noez!'), yargs);
|
|
23
21
|
expect(yargs.showHelp).not.toHaveBeenCalled();
|
|
24
|
-
expect(
|
|
22
|
+
expect(logger.error).toHaveBeenCalledWith('Oh noez!');
|
|
25
23
|
expect(process.exit).toHaveBeenCalledWith(1);
|
|
26
24
|
});
|
|
27
25
|
it('should log unknown errors raw', () => {
|
|
28
26
|
const error = new Error('Oh noez!');
|
|
29
|
-
|
|
27
|
+
handleError(undefined, error, yargs);
|
|
30
28
|
expect(yargs.showHelp).not.toHaveBeenCalled();
|
|
31
|
-
expect(
|
|
29
|
+
expect(logger.error).toHaveBeenCalledWith(error);
|
|
32
30
|
expect(process.exit).toHaveBeenCalledWith(1);
|
|
33
31
|
});
|
|
34
32
|
//# sourceMappingURL=handleError.test.js.map
|
package/handleError.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleError.test.js","sourceRoot":"","sources":["handleError.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handleError.test.js","sourceRoot":"","sources":["handleError.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM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oBAAoB,CAAC,UAAU,CAAC,CAAC;IACtD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;IACvC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;IACpC,WAAW,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC"}
|
package/handleError.test.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Argv } from 'yargs';
|
|
2
2
|
|
|
3
|
-
import { AppsembleError } from './AppsembleError';
|
|
4
|
-
import { handleError } from './handleError';
|
|
5
|
-
import { logger } from './logger';
|
|
3
|
+
import { AppsembleError } from './AppsembleError.js';
|
|
4
|
+
import { handleError } from './handleError.js';
|
|
5
|
+
import { logger } from './logger.js';
|
|
6
6
|
|
|
7
7
|
let yargs: Argv;
|
|
8
8
|
|
|
9
9
|
beforeEach(() => {
|
|
10
|
-
yargs = { showHelp: jest.fn() } as Partial<Argv> as Argv;
|
|
11
|
-
jest.spyOn(console, 'error').mockImplementation();
|
|
12
|
-
jest.spyOn(process, 'exit').mockImplementation();
|
|
13
|
-
jest.spyOn(logger, 'error').mockImplementation();
|
|
10
|
+
yargs = { showHelp: import.meta.jest.fn() } as Partial<Argv> as Argv;
|
|
11
|
+
import.meta.jest.spyOn(console, 'error').mockImplementation();
|
|
12
|
+
import.meta.jest.spyOn(process, 'exit').mockImplementation();
|
|
13
|
+
import.meta.jest.spyOn(logger, 'error').mockImplementation();
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
it('should show the help message if it is passed a yargs message', () => {
|
package/handleError.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './getWorkspaces';
|
|
6
|
-
export * from './handleError';
|
|
7
|
-
export * from './interceptors';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './testFixtures';
|
|
1
|
+
export * from './AppsembleError.js';
|
|
2
|
+
export * from './basicAuth.js';
|
|
3
|
+
export * from './formData.js';
|
|
4
|
+
export * from './fs.js';
|
|
5
|
+
export * from './getWorkspaces.js';
|
|
6
|
+
export * from './handleError.js';
|
|
7
|
+
export * from './interceptors.js';
|
|
8
|
+
export * from './logger.js';
|
|
9
|
+
export * from './loggerMiddleware.js';
|
|
10
|
+
export * from './readFileOrString.js';
|
|
11
|
+
export * from './testFixtures.js';
|
package/index.js
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./logger"), exports);
|
|
18
|
-
__exportStar(require("./AppsembleError"), exports);
|
|
19
|
-
__exportStar(require("./basicAuth"), exports);
|
|
20
|
-
__exportStar(require("./formData"), exports);
|
|
21
|
-
__exportStar(require("./getWorkspaces"), exports);
|
|
22
|
-
__exportStar(require("./handleError"), exports);
|
|
23
|
-
__exportStar(require("./interceptors"), exports);
|
|
24
|
-
__exportStar(require("./loggerMiddleware"), exports);
|
|
25
|
-
__exportStar(require("./readFileOrString"), exports);
|
|
26
|
-
__exportStar(require("./fs"), exports);
|
|
27
|
-
__exportStar(require("./testFixtures"), exports);
|
|
1
|
+
export * from './AppsembleError.js';
|
|
2
|
+
export * from './basicAuth.js';
|
|
3
|
+
export * from './formData.js';
|
|
4
|
+
export * from './fs.js';
|
|
5
|
+
export * from './getWorkspaces.js';
|
|
6
|
+
export * from './handleError.js';
|
|
7
|
+
export * from './interceptors.js';
|
|
8
|
+
export * from './logger.js';
|
|
9
|
+
export * from './loggerMiddleware.js';
|
|
10
|
+
export * from './readFileOrString.js';
|
|
11
|
+
export * from './testFixtures.js';
|
|
28
12
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
package/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './getWorkspaces';
|
|
6
|
-
export * from './handleError';
|
|
7
|
-
export * from './interceptors';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './testFixtures';
|
|
1
|
+
export * from './AppsembleError.js';
|
|
2
|
+
export * from './basicAuth.js';
|
|
3
|
+
export * from './formData.js';
|
|
4
|
+
export * from './fs.js';
|
|
5
|
+
export * from './getWorkspaces.js';
|
|
6
|
+
export * from './handleError.js';
|
|
7
|
+
export * from './interceptors.js';
|
|
8
|
+
export * from './logger.js';
|
|
9
|
+
export * from './loggerMiddleware.js';
|
|
10
|
+
export * from './readFileOrString.js';
|
|
11
|
+
export * from './testFixtures.js';
|
package/interceptors.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.configureAxios = exports.responseLogger = exports.requestLogger = exports.formData = void 0;
|
|
7
|
-
const os_1 = require("os");
|
|
8
|
-
const axios_1 = __importDefault(require("axios"));
|
|
9
|
-
const cli_highlight_1 = require("cli-highlight");
|
|
10
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
11
|
-
const logger_1 = require("./logger");
|
|
1
|
+
import { arch, type } from 'os';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { highlight } from 'cli-highlight';
|
|
4
|
+
import FormData from 'form-data';
|
|
5
|
+
import { logger } from './logger.js';
|
|
12
6
|
/**
|
|
13
7
|
* This is used to set a request id, so the request and response can be matched in the logs.
|
|
14
8
|
*/
|
|
@@ -19,42 +13,39 @@ const id = Symbol('id');
|
|
|
19
13
|
* @param config The axios request configuration.
|
|
20
14
|
* @returns The config with additional `multipart/form-data` headers if appropriate.
|
|
21
15
|
*/
|
|
22
|
-
function formData(config) {
|
|
23
|
-
if (config.data instanceof
|
|
16
|
+
export function formData(config) {
|
|
17
|
+
if (config.data instanceof FormData) {
|
|
24
18
|
Object.assign(config.headers, config.data.getHeaders());
|
|
25
19
|
}
|
|
26
20
|
return config;
|
|
27
21
|
}
|
|
28
|
-
exports.formData = formData;
|
|
29
22
|
/**
|
|
30
23
|
* An {@link axios} request interceptor to log requests.
|
|
31
24
|
*
|
|
32
25
|
* @param config The axios request configuration.
|
|
33
26
|
* @returns The original config.
|
|
34
27
|
*/
|
|
35
|
-
function requestLogger(config) {
|
|
28
|
+
export function requestLogger(config) {
|
|
36
29
|
const time = Date.now();
|
|
37
|
-
|
|
30
|
+
logger.verbose(`> ${time} ${highlight(`${config.method.toUpperCase()} ${axios.getUri(config)} HTTP/1.1`, {
|
|
38
31
|
language: 'http',
|
|
39
32
|
})}`);
|
|
40
33
|
// eslint-disable-next-line no-param-reassign
|
|
41
34
|
config[id] = time;
|
|
42
35
|
return config;
|
|
43
36
|
}
|
|
44
|
-
exports.requestLogger = requestLogger;
|
|
45
37
|
/**
|
|
46
38
|
* An {@link axios} response interceptor to log responses.
|
|
47
39
|
*
|
|
48
40
|
* @param response The axios response.
|
|
49
41
|
* @returns The original response.
|
|
50
42
|
*/
|
|
51
|
-
function responseLogger(response) {
|
|
52
|
-
|
|
43
|
+
export function responseLogger(response) {
|
|
44
|
+
logger.verbose(`< ${response.config[id]} ${highlight(`HTTP/1.1 ${response.status} ${response.statusText}`, {
|
|
53
45
|
language: 'http',
|
|
54
46
|
})}`);
|
|
55
47
|
return response;
|
|
56
48
|
}
|
|
57
|
-
exports.responseLogger = responseLogger;
|
|
58
49
|
/**
|
|
59
50
|
* Configure the default Axios instance.
|
|
60
51
|
*
|
|
@@ -63,12 +54,11 @@ exports.responseLogger = responseLogger;
|
|
|
63
54
|
* @param name A PascalCase representation of the client.
|
|
64
55
|
* @param version The version of the client to represent.
|
|
65
56
|
*/
|
|
66
|
-
function configureAxios(name, version) {
|
|
67
|
-
const ua = `${name}/${version} (${
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
export function configureAxios(name, version) {
|
|
58
|
+
const ua = `${name}/${version} (${type()} ${arch()}; Node ${process.version})`;
|
|
59
|
+
axios.defaults.headers.common['user-agent'] = ua;
|
|
60
|
+
axios.interceptors.request.use(formData);
|
|
61
|
+
axios.interceptors.request.use(requestLogger);
|
|
62
|
+
axios.interceptors.response.use(responseLogger);
|
|
72
63
|
}
|
|
73
|
-
exports.configureAxios = configureAxios;
|
|
74
64
|
//# sourceMappingURL=interceptors.js.map
|
package/interceptors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptors.js","sourceRoot":"","sources":["interceptors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interceptors.js","sourceRoot":"","sources":["interceptors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAEhC,OAAO,KAA4C,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAQxB;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,MAA0B;IACjD,IAAI,MAAM,CAAC,IAAI,YAAY,QAAQ,EAAE;QACnC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;KACzD;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,MAA0B;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACxB,MAAM,CAAC,OAAO,CACZ,KAAK,IAAI,IAAI,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;QACxF,QAAQ,EAAE,MAAM;KACjB,CAAC,EAAE,CACL,CAAC;IACF,6CAA6C;IAC7C,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,QAAuB;IACpD,MAAM,CAAC,OAAO,CACZ,KAAK,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,YAAY,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,EAAE;QAC1F,QAAQ,EAAE,MAAM;KACjB,CAAC,EAAE,CACL,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,OAAe;IAC1D,MAAM,EAAE,GAAG,GAAG,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,IAAI,IAAI,EAAE,UAAU,OAAO,CAAC,OAAO,GAAG,CAAC;IAC/E,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;IAEjD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9C,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC"}
|
package/interceptors.test.js
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const fake_timers_1 = require("@sinonjs/fake-timers");
|
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const axios_mock_adapter_1 = __importDefault(require("axios-mock-adapter"));
|
|
9
|
-
const cli_highlight_1 = require("cli-highlight");
|
|
10
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
11
|
-
const _1 = require(".");
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
3
|
+
import { highlight } from 'cli-highlight';
|
|
4
|
+
import FormData from 'form-data';
|
|
5
|
+
import { configureAxios, formData, logger, requestLogger, responseLogger } from './index.js';
|
|
12
6
|
function h(content) {
|
|
13
|
-
return
|
|
7
|
+
return highlight(content, { language: 'http' });
|
|
14
8
|
}
|
|
15
9
|
let instance;
|
|
16
10
|
let mock;
|
|
17
|
-
|
|
18
|
-
jest.mock('os');
|
|
11
|
+
import.meta.jest.mock('os');
|
|
19
12
|
beforeEach(() => {
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
clock.uninstall();
|
|
13
|
+
import.meta.jest.useFakeTimers({ now: 0 });
|
|
24
14
|
});
|
|
25
15
|
describe('formData', () => {
|
|
26
16
|
beforeAll(() => {
|
|
27
|
-
instance =
|
|
28
|
-
instance.interceptors.request.use(
|
|
29
|
-
mock = new
|
|
17
|
+
instance = axios.create();
|
|
18
|
+
instance.interceptors.request.use(formData);
|
|
19
|
+
mock = new MockAdapter(instance);
|
|
30
20
|
});
|
|
31
21
|
it('should add headers for form-data requests', async () => {
|
|
32
22
|
let headers;
|
|
@@ -34,7 +24,7 @@ describe('formData', () => {
|
|
|
34
24
|
({ headers } = config);
|
|
35
25
|
return [200];
|
|
36
26
|
});
|
|
37
|
-
const form = new
|
|
27
|
+
const form = new FormData();
|
|
38
28
|
await instance.post('/', form);
|
|
39
29
|
expect(headers).toHaveProperty('Content-Type', expect.stringMatching(/^multipart\/form-data; boundary=/));
|
|
40
30
|
});
|
|
@@ -50,44 +40,44 @@ describe('formData', () => {
|
|
|
50
40
|
});
|
|
51
41
|
describe('requestLogger', () => {
|
|
52
42
|
beforeAll(() => {
|
|
53
|
-
instance =
|
|
54
|
-
instance.interceptors.request.use(
|
|
55
|
-
mock = new
|
|
43
|
+
instance = axios.create();
|
|
44
|
+
instance.interceptors.request.use(requestLogger);
|
|
45
|
+
mock = new MockAdapter(instance);
|
|
56
46
|
mock.onAny().reply(200);
|
|
57
47
|
});
|
|
58
48
|
it('should log requests', async () => {
|
|
59
|
-
jest.spyOn(
|
|
49
|
+
import.meta.jest.spyOn(logger, 'verbose');
|
|
60
50
|
await instance.get('/');
|
|
61
|
-
expect(
|
|
51
|
+
expect(logger.verbose).toHaveBeenCalledWith(`> 0 ${h('GET / HTTP/1.1')}`);
|
|
62
52
|
});
|
|
63
53
|
});
|
|
64
54
|
describe('responseLogger', () => {
|
|
65
55
|
beforeAll(() => {
|
|
66
|
-
instance =
|
|
67
|
-
instance.interceptors.response.use(
|
|
68
|
-
mock = new
|
|
56
|
+
instance = axios.create();
|
|
57
|
+
instance.interceptors.response.use(responseLogger);
|
|
58
|
+
mock = new MockAdapter(instance);
|
|
69
59
|
mock.onAny().reply(200);
|
|
70
60
|
});
|
|
71
61
|
it('should log responses', async () => {
|
|
72
|
-
jest.spyOn(
|
|
62
|
+
import.meta.jest.spyOn(logger, 'verbose');
|
|
73
63
|
await instance.get('/');
|
|
74
|
-
expect(
|
|
64
|
+
expect(logger.verbose).toHaveBeenCalledWith(expect.any(String));
|
|
75
65
|
});
|
|
76
66
|
});
|
|
77
67
|
describe('configureAxios', () => {
|
|
78
68
|
beforeEach(() => {
|
|
79
|
-
jest.spyOn(
|
|
80
|
-
jest.spyOn(
|
|
69
|
+
import.meta.jest.spyOn(axios.interceptors.request, 'use').mockImplementation();
|
|
70
|
+
import.meta.jest.spyOn(axios.interceptors.response, 'use').mockImplementation();
|
|
81
71
|
});
|
|
82
72
|
it('should set the correct user agent', () => {
|
|
83
|
-
|
|
84
|
-
expect(
|
|
73
|
+
configureAxios('TestClient', '1.2.3');
|
|
74
|
+
expect(axios.defaults.headers.common['user-agent']).toBe(`TestClient/1.2.3 (Linux x64; Node ${process.version})`);
|
|
85
75
|
});
|
|
86
76
|
it('should apply all interceptors', () => {
|
|
87
|
-
|
|
88
|
-
expect(
|
|
89
|
-
expect(
|
|
90
|
-
expect(
|
|
77
|
+
configureAxios('TestClient', '1.2.3');
|
|
78
|
+
expect(axios.interceptors.request.use).toHaveBeenCalledWith(formData);
|
|
79
|
+
expect(axios.interceptors.request.use).toHaveBeenCalledWith(requestLogger);
|
|
80
|
+
expect(axios.interceptors.response.use).toHaveBeenCalledWith(responseLogger);
|
|
91
81
|
});
|
|
92
82
|
});
|
|
93
83
|
//# sourceMappingURL=interceptors.test.js.map
|
package/interceptors.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptors.test.js","sourceRoot":"","sources":["interceptors.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interceptors.test.js","sourceRoot":"","sources":["interceptors.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7F,SAAS,CAAC,CAAC,OAAe;IACxB,OAAO,SAAS,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,IAAI,QAAuB,CAAC;AAC5B,IAAI,IAAiB,CAAC;AAEtB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE5B,UAAU,CAAC,GAAG,EAAE;IACd,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,SAAS,CAAC,GAAG,EAAE;QACb,QA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