@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectstack/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Microkernel Core for ObjectStack",
|
|
6
6
|
"type": "module",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"pino": "^10.3.0",
|
|
16
|
-
"pino-pretty": "^
|
|
16
|
+
"pino-pretty": "^13.1.3",
|
|
17
17
|
"zod": "^4.3.6",
|
|
18
|
-
"@objectstack/spec": "1.0.
|
|
18
|
+
"@objectstack/spec": "1.0.7"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"pino": "^8.0.0"
|
package/src/logger.ts
CHANGED
|
@@ -51,13 +51,13 @@ export class ObjectLogger implements Logger {
|
|
|
51
51
|
/**
|
|
52
52
|
* Initialize Pino logger for Node.js
|
|
53
53
|
*/
|
|
54
|
-
private initPinoLogger() {
|
|
54
|
+
private async initPinoLogger() {
|
|
55
55
|
if (!this.isNode) return;
|
|
56
56
|
|
|
57
57
|
try {
|
|
58
58
|
// Create require function dynamically for Node.js (avoids bundling issues in browser)
|
|
59
59
|
// @ts-ignore - dynamic import of Node.js module
|
|
60
|
-
const { createRequire } =
|
|
60
|
+
const { createRequire } = await import('module');
|
|
61
61
|
this.require = createRequire(import.meta.url);
|
|
62
62
|
|
|
63
63
|
// Synchronous import for Pino using createRequire (works in ESM)
|
|
@@ -3,15 +3,7 @@ import type { PluginMetadata } from '../plugin-loader.js';
|
|
|
3
3
|
|
|
4
4
|
// Conditionally import crypto for Node.js environments
|
|
5
5
|
let cryptoModule: typeof import('crypto') | null = null;
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
// Dynamic import for Node.js crypto module (using eval to avoid bundling issues)
|
|
9
|
-
// @ts-ignore - dynamic require for Node.js
|
|
10
|
-
cryptoModule = eval('require("crypto")');
|
|
11
|
-
} catch {
|
|
12
|
-
// Crypto module not available (e.g., browser environment)
|
|
13
|
-
}
|
|
14
|
-
}
|
|
6
|
+
|
|
15
7
|
|
|
16
8
|
/**
|
|
17
9
|
* Plugin Signature Configuration
|
|
@@ -295,11 +287,20 @@ export class PluginSignatureVerifier {
|
|
|
295
287
|
return this.verifyCryptoSignatureNode(data, signature, publicKey);
|
|
296
288
|
}
|
|
297
289
|
|
|
298
|
-
private verifyCryptoSignatureNode(
|
|
290
|
+
private async verifyCryptoSignatureNode(
|
|
299
291
|
data: string,
|
|
300
292
|
signature: string,
|
|
301
293
|
publicKey: string
|
|
302
|
-
): boolean {
|
|
294
|
+
): Promise<boolean> {
|
|
295
|
+
if (!cryptoModule) {
|
|
296
|
+
try {
|
|
297
|
+
// @ts-ignore
|
|
298
|
+
cryptoModule = await import('crypto');
|
|
299
|
+
} catch (e) {
|
|
300
|
+
// ignore
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
303
304
|
if (!cryptoModule) {
|
|
304
305
|
this.logger.error('Crypto module not available for signature verification');
|
|
305
306
|
return false;
|
package/src/types.ts
CHANGED
|
@@ -73,6 +73,12 @@ export interface Plugin {
|
|
|
73
73
|
*/
|
|
74
74
|
version?: string;
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Plugin type (standard, ui, driver, server, app, theme, agent)
|
|
78
|
+
* @default 'standard'
|
|
79
|
+
*/
|
|
80
|
+
type?: string;
|
|
81
|
+
|
|
76
82
|
/**
|
|
77
83
|
* List of other plugin names that this plugin depends on.
|
|
78
84
|
* The kernel ensures these plugins are initialized before this one.
|