create-erxes 0.1.16 → 0.1.17
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/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { mkdir, readFile, readdir, symlink, writeFile } from "node:fs/promises";
|
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
// package.json
|
|
12
|
-
var version = "0.1.
|
|
12
|
+
var version = "0.1.17";
|
|
13
13
|
// src/existing-plugins.ts
|
|
14
14
|
/** The old erxes plugins a new-core plugin can be migrated from (`backend/plugins/<name>_api`). */
|
|
15
15
|
const OLD_PLUGINS = [
|
|
@@ -12,13 +12,13 @@ import { runJob } from '#/jobs.ts';
|
|
|
12
12
|
import { logger } from '#/logger.ts';
|
|
13
13
|
import { router } from '#/router.ts';
|
|
14
14
|
|
|
15
|
-
const logFailure =
|
|
15
|
+
const logFailure = (error: unknown) => {
|
|
16
16
|
if (!(error instanceof ORPCError) || error.status >= 500) logger.error(error);
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
|
|
19
19
|
// The same procedures twice: RPC for the plugin UI, REST (documented below) for scripts.
|
|
20
|
-
const rpc = new RPCHandler(router, { interceptors: [logFailure] });
|
|
21
|
-
const rest = new OpenAPIHandler(router, { interceptors: [logFailure] });
|
|
20
|
+
const rpc = new RPCHandler(router, { interceptors: [onError(logFailure)] });
|
|
21
|
+
const rest = new OpenAPIHandler(router, { interceptors: [onError(logFailure)] });
|
|
22
22
|
|
|
23
23
|
/** Settings › Developer › API reference shows it (the manifest's `api.openapi`). */
|
|
24
24
|
const openApi = pluginOpenApi(router, {
|