@objectql/create 3.0.1 → 4.0.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/dist/bin.js +7 -0
- package/package.json +1 -1
- package/templates/enterprise/__tests__/data-api.test.ts +8 -0
- package/templates/enterprise/__tests__/metadata-api.test.ts +8 -0
- package/templates/enterprise/__tests__/metadata-loading.test.ts +8 -0
- package/templates/enterprise/jest.config.js +8 -0
- package/templates/enterprise/package.json +4 -2
- package/templates/enterprise/src/core/index.ts +8 -0
- package/templates/enterprise/src/extensions/user.ts +8 -0
- package/templates/enterprise/src/index.ts +10 -2
- package/templates/enterprise/src/modules/crm/index.ts +8 -0
- package/templates/enterprise/src/modules/finance/index.ts +8 -0
- package/templates/enterprise/src/modules/hr/index.ts +8 -0
- package/templates/enterprise/src/modules/project/index.ts +8 -0
- package/templates/enterprise/src/plugins/audit/audit.plugin.ts +40 -19
- package/templates/enterprise/src/plugins/audit/index.ts +9 -4
- package/templates/enterprise/src/shared/constants.ts +8 -0
- package/templates/enterprise/src/shared/utils.ts +8 -0
- package/templates/enterprise/src/shared/validators.ts +8 -0
- package/templates/enterprise/tsconfig.json +5 -0
- package/templates/enterprise/tsconfig.tsbuildinfo +1 -1
- package/templates/hello-world/package.json +1 -1
- package/templates/hello-world/src/index.ts +8 -0
- package/templates/starter/__tests__/projects-hooks-actions.test.ts +8 -0
- package/templates/starter/jest.config.js +8 -0
- package/templates/starter/package.json +3 -2
- package/templates/starter/src/modules/projects/projects.action.ts +8 -0
- package/templates/starter/src/modules/projects/projects.hook.ts +8 -0
- package/templates/starter/src/seed.ts +8 -0
- package/templates/starter/tsconfig.tsbuildinfo +1 -1
package/dist/bin.js
CHANGED
|
@@ -37,6 +37,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
/**
|
|
41
|
+
* ObjectQL
|
|
42
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/
|
|
40
47
|
const commander_1 = require("commander");
|
|
41
48
|
const path = __importStar(require("path"));
|
|
42
49
|
const fs = __importStar(require("fs-extra"));
|
package/package.json
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* Metadata API Tests for Enterprise Starter
|
|
3
11
|
*
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* Metadata Loading Tests for Enterprise Starter
|
|
3
11
|
*
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
module.exports = {
|
|
2
10
|
preset: 'ts-jest',
|
|
3
11
|
testEnvironment: 'node',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectql/example-enterprise-erp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "ObjectQL Enterprise Example - CRM & HR Demo",
|
|
5
5
|
"private": true,
|
|
6
6
|
"keywords": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"start": "ts-node src/index.ts",
|
|
29
29
|
"codegen": "objectql types -s src -o src/types",
|
|
30
|
-
"build": "
|
|
30
|
+
"build": "tsc && rsync -a --include '*/' --include '*.yml' --exclude '*' src/ dist/",
|
|
31
31
|
"test": "jest"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
"@objectql/cli": "workspace:*",
|
|
44
44
|
"@objectql/driver-sql": "workspace:*",
|
|
45
45
|
"@objectql/platform-node": "workspace:*",
|
|
46
|
+
"@objectstack/spec": "^0.2.0",
|
|
46
47
|
"@types/jest": "^30.0.0",
|
|
48
|
+
"@types/node": "^20.0.0",
|
|
47
49
|
"jest": "^30.2.0",
|
|
48
50
|
"ts-jest": "^29.4.6",
|
|
49
51
|
"typescript": "^5.3.0"
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
// Auto-generated by ObjectQL. DO NOT EDIT.
|
|
2
10
|
import { ObjectDoc } from '@objectql/types';
|
|
3
11
|
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
import { ObjectQL } from '@objectql/core';
|
|
2
10
|
import { SqlDriver } from '@objectql/driver-sql';
|
|
3
11
|
import { ObjectLoader } from '@objectql/platform-node';
|
|
4
12
|
import * as path from 'path';
|
|
5
|
-
import
|
|
13
|
+
import AuditLogPlugin from './plugins/audit/audit.plugin';
|
|
6
14
|
|
|
7
15
|
async function main() {
|
|
8
16
|
console.log("🚀 Starting Enterprise ERP Showcase...");
|
|
@@ -18,7 +26,7 @@ async function main() {
|
|
|
18
26
|
});
|
|
19
27
|
|
|
20
28
|
// Register Plugin
|
|
21
|
-
app.use(
|
|
29
|
+
app.use(AuditLogPlugin);
|
|
22
30
|
|
|
23
31
|
const loader = new ObjectLoader(app.metadata);
|
|
24
32
|
await loader.load(path.join(__dirname));
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* CRM Module - Customer Relationship Management
|
|
3
11
|
*
|
|
@@ -1,23 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
// Import RuntimePlugin types from @objectql/core instead of @objectstack/runtime
|
|
10
|
+
// to avoid ESM/CJS compatibility issues
|
|
11
|
+
interface RuntimeContext {
|
|
12
|
+
engine: any; // ObjectStackKernel
|
|
13
|
+
}
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
console.log(`[Audit] Created ${mutationCtx.objectName} (ID: ${mutationCtx.id}) by User ${userId}`);
|
|
15
|
-
});
|
|
15
|
+
interface RuntimePlugin {
|
|
16
|
+
name: string;
|
|
17
|
+
install?: (ctx: RuntimeContext) => void | Promise<void>;
|
|
18
|
+
onStart?: (ctx: RuntimeContext) => void | Promise<void>;
|
|
19
|
+
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const AuditLogPlugin: RuntimePlugin = {
|
|
22
|
+
name: 'audit-log',
|
|
23
|
+
|
|
24
|
+
async install(ctx: RuntimeContext) {
|
|
25
|
+
console.log('[AuditLogPlugin] Installing...');
|
|
26
|
+
// Plugin installation logic here
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
async onStart(ctx: RuntimeContext) {
|
|
30
|
+
console.log('[AuditLogPlugin] Starting...');
|
|
31
|
+
|
|
32
|
+
// TODO: Register event handlers using the runtime context
|
|
33
|
+
// The RuntimeContext provides:
|
|
34
|
+
// - ctx.engine for accessing the kernel
|
|
35
|
+
|
|
36
|
+
// For now, we'll just log that the plugin is started
|
|
37
|
+
console.log('[AuditLogPlugin] Plugin started');
|
|
38
|
+
|
|
39
|
+
// Note: The new plugin system uses RuntimeContext instead of PluginContextData
|
|
40
|
+
// This will need to be enhanced when the full events API is available
|
|
22
41
|
}
|
|
23
|
-
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default AuditLogPlugin;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
3
8
|
|
|
4
|
-
//
|
|
5
|
-
import
|
|
9
|
+
// Export the plugin for external usage
|
|
10
|
+
import AuditLogPlugin from './audit.plugin';
|
|
6
11
|
export default AuditLogPlugin;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectQL
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* Shared constants used across the application
|
|
3
11
|
*/
|