@objectstack/core 1.0.5 → 1.0.7
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/.turbo/turbo-build.log +10 -46
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +20 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/api-registry-plugin.ts +1 -0
- package/src/logger.ts +2 -2
- package/src/security/plugin-signature-verifier.ts +12 -11
- package/src/types.ts +6 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/core@1.0.
|
|
2
|
+
> @objectstack/core@1.0.7 build /home/runner/work/spec/spec/packages/core
|
|
3
3
|
> tsup --config ../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,49 +10,13 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
You can read more about direct eval and bundling here: [4mhttps://esbuild.github.io/link/direct-eval[0m
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mUsing direct eval with a bundler is not recommended and may cause problems[0m [direct-eval]
|
|
23
|
-
|
|
24
|
-
src/security/plugin-signature-verifier.ts:10:19:
|
|
25
|
-
[37m 10 │ cryptoModule = [32meval[37m('require("crypto")');
|
|
26
|
-
╵ [32m~~~~[0m
|
|
27
|
-
|
|
28
|
-
You can read more about direct eval and bundling here: [4mhttps://esbuild.github.io/link/direct-eval[0m
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mUsing direct eval with a bundler is not recommended and may cause problems[0m [direct-eval]
|
|
32
|
-
|
|
33
|
-
src/logger.ts:60:38:
|
|
34
|
-
[37m 60 │ const { createRequire } = [32meval[37m('require("module")');
|
|
35
|
-
╵ [32m~~~~[0m
|
|
36
|
-
|
|
37
|
-
You can read more about direct eval and bundling here: [4mhttps://esbuild.github.io/link/direct-eval[0m
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mUsing direct eval with a bundler is not recommended and may cause problems[0m [direct-eval]
|
|
41
|
-
|
|
42
|
-
src/security/plugin-signature-verifier.ts:10:19:
|
|
43
|
-
[37m 10 │ cryptoModule = [32meval[37m('require("crypto")');
|
|
44
|
-
╵ [32m~~~~[0m
|
|
45
|
-
|
|
46
|
-
You can read more about direct eval and bundling here: [4mhttps://esbuild.github.io/link/direct-eval[0m
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m129.95 KB[39m
|
|
50
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m269.80 KB[39m
|
|
51
|
-
[32mCJS[39m ⚡️ Build success in 114ms
|
|
52
|
-
[32mESM[39m [1mdist/index.js [22m[32m127.91 KB[39m
|
|
53
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m268.56 KB[39m
|
|
54
|
-
[32mESM[39m ⚡️ Build success in 114ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m127.94 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m268.47 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 90ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m130.56 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m269.71 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 90ms
|
|
55
19
|
[34mDTS[39m Build start
|
|
56
|
-
[32mDTS[39m ⚡️ Build success in
|
|
57
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m52.
|
|
58
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m52.
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 3611ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m52.43 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m52.43 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -297,10 +307,10 @@ var ObjectLogger = class _ObjectLogger {
|
|
|
297
307
|
/**
|
|
298
308
|
* Initialize Pino logger for Node.js
|
|
299
309
|
*/
|
|
300
|
-
initPinoLogger() {
|
|
310
|
+
async initPinoLogger() {
|
|
301
311
|
if (!this.isNode) return;
|
|
302
312
|
try {
|
|
303
|
-
const { createRequire } =
|
|
313
|
+
const { createRequire } = await import("module");
|
|
304
314
|
this.require = createRequire(import_meta.url);
|
|
305
315
|
const pino = this.require("pino");
|
|
306
316
|
const pinoOptions = {
|
|
@@ -2011,6 +2021,7 @@ function createApiRegistryPlugin(config = {}) {
|
|
|
2011
2021
|
} = config;
|
|
2012
2022
|
return {
|
|
2013
2023
|
name: "com.objectstack.core.api-registry",
|
|
2024
|
+
type: "standard",
|
|
2014
2025
|
version: "1.0.0",
|
|
2015
2026
|
init: async (ctx) => {
|
|
2016
2027
|
const registry = new ApiRegistry(
|
|
@@ -2273,12 +2284,6 @@ var HttpTestAdapter = class {
|
|
|
2273
2284
|
|
|
2274
2285
|
// src/security/plugin-signature-verifier.ts
|
|
2275
2286
|
var cryptoModule = null;
|
|
2276
|
-
if (typeof globalThis.window === "undefined") {
|
|
2277
|
-
try {
|
|
2278
|
-
cryptoModule = eval('require("crypto")');
|
|
2279
|
-
} catch {
|
|
2280
|
-
}
|
|
2281
|
-
}
|
|
2282
2287
|
var PluginSignatureVerifier = class {
|
|
2283
2288
|
constructor(config, logger) {
|
|
2284
2289
|
this.config = config;
|
|
@@ -2434,7 +2439,13 @@ var PluginSignatureVerifier = class {
|
|
|
2434
2439
|
}
|
|
2435
2440
|
return this.verifyCryptoSignatureNode(data, signature, publicKey);
|
|
2436
2441
|
}
|
|
2437
|
-
verifyCryptoSignatureNode(data, signature, publicKey) {
|
|
2442
|
+
async verifyCryptoSignatureNode(data, signature, publicKey) {
|
|
2443
|
+
if (!cryptoModule) {
|
|
2444
|
+
try {
|
|
2445
|
+
cryptoModule = await import("crypto");
|
|
2446
|
+
} catch (e) {
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2438
2449
|
if (!cryptoModule) {
|
|
2439
2450
|
this.logger.error("Crypto module not available for signature verification");
|
|
2440
2451
|
return false;
|