@objectql/create 1.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/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/bin.js +125 -0
- package/package.json +27 -0
- package/templates/enterprise/CHANGELOG.md +140 -0
- package/templates/enterprise/README.md +352 -0
- package/templates/enterprise/__tests__/data-api.test.ts +546 -0
- package/templates/enterprise/__tests__/data-api.test.ts.backup +526 -0
- package/templates/enterprise/__tests__/metadata-api.test.ts +307 -0
- package/templates/enterprise/__tests__/metadata-loading.test.ts +250 -0
- package/templates/enterprise/jest.config.js +22 -0
- package/templates/enterprise/package.json +51 -0
- package/templates/enterprise/src/apps/erp.app.yml +4 -0
- package/templates/enterprise/src/core/attachment.object.yml +57 -0
- package/templates/enterprise/src/core/i18n/en/core.json +60 -0
- package/templates/enterprise/src/core/i18n/zh-CN/core.json +60 -0
- package/templates/enterprise/src/core/index.ts +24 -0
- package/templates/enterprise/src/core/organization.object.yml +78 -0
- package/templates/enterprise/src/core/user.object.yml +80 -0
- package/templates/enterprise/src/extensions/README.md +56 -0
- package/templates/enterprise/src/extensions/user.extension.object.yml +42 -0
- package/templates/enterprise/src/extensions/user.ts +26 -0
- package/templates/enterprise/src/index.ts +47 -0
- package/templates/enterprise/src/modules/crm/README.md +99 -0
- package/templates/enterprise/src/modules/crm/crm_account.object.yml +105 -0
- package/templates/enterprise/src/modules/crm/crm_contact.object.yml +103 -0
- package/templates/enterprise/src/modules/crm/crm_lead.object.yml +148 -0
- package/templates/enterprise/src/modules/crm/crm_opportunity.object.yml +128 -0
- package/templates/enterprise/src/modules/crm/i18n/en/crm.json +61 -0
- package/templates/enterprise/src/modules/crm/i18n/zh-CN/crm.json +61 -0
- package/templates/enterprise/src/modules/crm/index.ts +29 -0
- package/templates/enterprise/src/modules/finance/README.md +112 -0
- package/templates/enterprise/src/modules/finance/finance_budget.object.yml +108 -0
- package/templates/enterprise/src/modules/finance/finance_expense.object.yml +151 -0
- package/templates/enterprise/src/modules/finance/finance_invoice.object.yml +143 -0
- package/templates/enterprise/src/modules/finance/finance_payment.object.yml +96 -0
- package/templates/enterprise/src/modules/finance/index.ts +26 -0
- package/templates/enterprise/src/modules/hr/README.md +95 -0
- package/templates/enterprise/src/modules/hr/hr_department.object.yml +59 -0
- package/templates/enterprise/src/modules/hr/hr_employee.object.yml +137 -0
- package/templates/enterprise/src/modules/hr/hr_position.object.yml +79 -0
- package/templates/enterprise/src/modules/hr/hr_timesheet.object.yml +114 -0
- package/templates/enterprise/src/modules/hr/index.ts +26 -0
- package/templates/enterprise/src/modules/project/README.md +132 -0
- package/templates/enterprise/src/modules/project/index.ts +26 -0
- package/templates/enterprise/src/modules/project/project_milestone.object.yml +70 -0
- package/templates/enterprise/src/modules/project/project_project.object.yml +135 -0
- package/templates/enterprise/src/modules/project/project_task.object.yml +121 -0
- package/templates/enterprise/src/modules/project/project_timesheet_entry.object.yml +95 -0
- package/templates/enterprise/src/plugins/audit/audit.plugin.ts +23 -0
- package/templates/enterprise/src/plugins/audit/index.ts +6 -0
- package/templates/enterprise/src/plugins/audit/note.object.yml +3 -0
- package/templates/enterprise/src/shared/constants.ts +30 -0
- package/templates/enterprise/src/shared/utils.ts +54 -0
- package/templates/enterprise/src/shared/validators.ts +47 -0
- package/templates/enterprise/src/types/attachment.ts +41 -0
- package/templates/enterprise/src/types/crm_account.ts +61 -0
- package/templates/enterprise/src/types/crm_contact.ts +61 -0
- package/templates/enterprise/src/types/crm_lead.ts +77 -0
- package/templates/enterprise/src/types/crm_opportunity.ts +53 -0
- package/templates/enterprise/src/types/finance_budget.ts +61 -0
- package/templates/enterprise/src/types/finance_expense.ts +65 -0
- package/templates/enterprise/src/types/finance_invoice.ts +69 -0
- package/templates/enterprise/src/types/finance_payment.ts +49 -0
- package/templates/enterprise/src/types/hr_department.ts +37 -0
- package/templates/enterprise/src/types/hr_employee.ts +85 -0
- package/templates/enterprise/src/types/hr_position.ts +49 -0
- package/templates/enterprise/src/types/hr_timesheet.ts +57 -0
- package/templates/enterprise/src/types/index.ts +20 -0
- package/templates/enterprise/src/types/note.ts +9 -0
- package/templates/enterprise/src/types/organization.ts +53 -0
- package/templates/enterprise/src/types/project_milestone.ts +41 -0
- package/templates/enterprise/src/types/project_project.ts +69 -0
- package/templates/enterprise/src/types/project_task.ts +57 -0
- package/templates/enterprise/src/types/project_timesheet_entry.ts +45 -0
- package/templates/enterprise/src/types/user.ts +65 -0
- package/templates/enterprise/tsconfig.json +10 -0
- package/templates/enterprise/tsconfig.tsbuildinfo +1 -0
- package/templates/hello-world/CHANGELOG.md +33 -0
- package/templates/hello-world/README.md +29 -0
- package/templates/hello-world/package.json +24 -0
- package/templates/hello-world/src/index.ts +58 -0
- package/templates/hello-world/tsconfig.json +10 -0
- package/templates/starter/CHANGELOG.md +191 -0
- package/templates/starter/README.md +17 -0
- package/templates/starter/__tests__/projects-hooks-actions.test.ts +490 -0
- package/templates/starter/jest.config.js +22 -0
- package/templates/starter/package.json +51 -0
- package/templates/starter/src/README.pages.md +110 -0
- package/templates/starter/src/demo.app.yml +4 -0
- package/templates/starter/src/i18n/zh-CN/projects.json +22 -0
- package/templates/starter/src/index.ts +55 -0
- package/templates/starter/src/modules/kitchen-sink/kitchen_sink.data.yml +18 -0
- package/templates/starter/src/modules/kitchen-sink/kitchen_sink.object.yml +156 -0
- package/templates/starter/src/modules/projects/project_approval.workflow.yml +51 -0
- package/templates/starter/src/modules/projects/projects.action.ts +472 -0
- package/templates/starter/src/modules/projects/projects.data.yml +13 -0
- package/templates/starter/src/modules/projects/projects.hook.ts +339 -0
- package/templates/starter/src/modules/projects/projects.object.yml +148 -0
- package/templates/starter/src/modules/projects/projects.permission.yml +141 -0
- package/templates/starter/src/modules/projects/projects.validation.yml +37 -0
- package/templates/starter/src/modules/tasks/tasks.data.yml +23 -0
- package/templates/starter/src/modules/tasks/tasks.object.yml +34 -0
- package/templates/starter/src/modules/tasks/tasks.permission.yml +167 -0
- package/templates/starter/src/types/index.ts +3 -0
- package/templates/starter/src/types/kitchen_sink.ts +101 -0
- package/templates/starter/src/types/projects.ts +49 -0
- package/templates/starter/src/types/tasks.ts +33 -0
- package/templates/starter/tsconfig.json +11 -0
- package/templates/starter/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ObjectQL } from '@objectql/core';
|
|
2
|
+
import { SqlDriver } from '@objectql/driver-sql';
|
|
3
|
+
|
|
4
|
+
async function main() {
|
|
5
|
+
console.log("🚀 Starting ObjectQL Hello World...");
|
|
6
|
+
|
|
7
|
+
// 1. Initialize Driver
|
|
8
|
+
const driver = new SqlDriver({
|
|
9
|
+
client: 'sqlite3',
|
|
10
|
+
connection: { filename: ':memory:' },
|
|
11
|
+
useNullAsDefault: true
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// 2. Initialize Engine (Pass driver in config)
|
|
15
|
+
const app = new ObjectQL({
|
|
16
|
+
datasources: {
|
|
17
|
+
default: driver
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// 3. Define Metadata Inline
|
|
22
|
+
app.registerObject({
|
|
23
|
+
name: 'deal',
|
|
24
|
+
fields: {
|
|
25
|
+
title: { type: 'text', required: true },
|
|
26
|
+
amount: { type: 'currency' },
|
|
27
|
+
stage: {
|
|
28
|
+
type: 'select',
|
|
29
|
+
options: [
|
|
30
|
+
{ label: 'New', value: 'new' },
|
|
31
|
+
{ label: 'Negotiation', value: 'negotiation' },
|
|
32
|
+
{ label: 'Closed', value: 'closed' }
|
|
33
|
+
],
|
|
34
|
+
defaultValue: 'new'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
await app.init(); // Boot the engine
|
|
40
|
+
|
|
41
|
+
// 4. Run Business Logic
|
|
42
|
+
const ctx = app.createContext({ isSystem: true });
|
|
43
|
+
const repo = ctx.object('deal');
|
|
44
|
+
|
|
45
|
+
console.log("Creating a new Deal...");
|
|
46
|
+
await repo.create({
|
|
47
|
+
title: 'Enterprise Contract',
|
|
48
|
+
amount: 50000,
|
|
49
|
+
stage: 'new'
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const results = await repo.find({});
|
|
53
|
+
console.log('✅ Deals found in database:', results);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (require.main === module) {
|
|
57
|
+
main().catch(console.error);
|
|
58
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# @objectql/starter-basic
|
|
2
|
+
|
|
3
|
+
## 1.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Release version 1.8.4 with latest improvements and bug fixes
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @objectql/types@1.8.4
|
|
10
|
+
- @objectql/core@1.8.4
|
|
11
|
+
- @objectql/platform-node@1.8.4
|
|
12
|
+
- @objectql/driver-sql@1.8.4
|
|
13
|
+
|
|
14
|
+
## 1.8.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Release patch version 1.8.3
|
|
19
|
+
|
|
20
|
+
Small version update with latest improvements and bug fixes.
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @objectql/core@1.8.3
|
|
24
|
+
- @objectql/driver-sql@1.8.3
|
|
25
|
+
- @objectql/types@1.8.3
|
|
26
|
+
- @objectql/platform-node@1.8.3
|
|
27
|
+
|
|
28
|
+
## 1.8.2
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Patch release v1.8.2 - Small version update with latest improvements
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
- @objectql/core@1.8.2
|
|
35
|
+
- @objectql/driver-sql@1.8.2
|
|
36
|
+
- @objectql/types@1.8.2
|
|
37
|
+
- @objectql/platform-node@1.8.2
|
|
38
|
+
|
|
39
|
+
## 1.8.1
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Patch release with documentation updates and bug fixes
|
|
44
|
+
- Updated dependencies
|
|
45
|
+
- @objectql/core@1.8.1
|
|
46
|
+
- @objectql/driver-sql@1.8.1
|
|
47
|
+
- @objectql/types@1.8.1
|
|
48
|
+
- @objectql/platform-node@1.8.1
|
|
49
|
+
|
|
50
|
+
## 1.8.0
|
|
51
|
+
|
|
52
|
+
### Minor Changes
|
|
53
|
+
|
|
54
|
+
- Release minor version 1.8.0
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- Updated dependencies
|
|
59
|
+
- @objectql/core@1.8.0
|
|
60
|
+
- @objectql/driver-sql@2.0.0
|
|
61
|
+
- @objectql/types@1.8.0
|
|
62
|
+
- @objectql/platform-node@2.0.0
|
|
63
|
+
|
|
64
|
+
## 1.7.3
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Release patch version 1.7.3 with latest improvements and bug fixes
|
|
69
|
+
- Updated dependencies
|
|
70
|
+
- @objectql/core@1.7.3
|
|
71
|
+
- @objectql/driver-sql@1.7.3
|
|
72
|
+
- @objectql/types@1.7.3
|
|
73
|
+
- @objectql/platform-node@1.7.3
|
|
74
|
+
|
|
75
|
+
## 1.7.2
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- Release patch version 1.7.2
|
|
80
|
+
- Updated dependencies
|
|
81
|
+
- @objectql/driver-sql@1.7.2
|
|
82
|
+
- @objectql/core@1.7.2
|
|
83
|
+
- @objectql/platform-node@1.7.2
|
|
84
|
+
- @objectql/types@1.7.2
|
|
85
|
+
|
|
86
|
+
## 1.7.1
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Release small version update with latest improvements
|
|
91
|
+
- Updated dependencies
|
|
92
|
+
- @objectql/core@1.7.1
|
|
93
|
+
- @objectql/driver-sql@1.7.1
|
|
94
|
+
- @objectql/types@1.7.1
|
|
95
|
+
- @objectql/platform-node@1.7.1
|
|
96
|
+
|
|
97
|
+
## 1.7.0
|
|
98
|
+
|
|
99
|
+
### Minor Changes
|
|
100
|
+
|
|
101
|
+
- Release version 1.7.0 with improvements and bug fixes:
|
|
102
|
+
- Updated default port for ObjectQL Studio to 5555
|
|
103
|
+
- Improved port listening logic in Studio
|
|
104
|
+
- Enhanced stability and performance
|
|
105
|
+
|
|
106
|
+
## 1.6.1
|
|
107
|
+
|
|
108
|
+
### Patch Changes
|
|
109
|
+
|
|
110
|
+
- Updated dependencies
|
|
111
|
+
- @objectql/core@1.6.1
|
|
112
|
+
- @objectql/platform-node@1.6.1
|
|
113
|
+
- @objectql/driver-sql@1.6.1
|
|
114
|
+
- @objectql/types@1.6.1
|
|
115
|
+
|
|
116
|
+
## 7.0.0
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies
|
|
121
|
+
- @objectql/core@1.6.0
|
|
122
|
+
- @objectql/driver-sql@1.6.0
|
|
123
|
+
- @objectql/types@1.6.0
|
|
124
|
+
- @objectql/platform-node@1.6.0
|
|
125
|
+
|
|
126
|
+
## 6.0.0
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- Updated dependencies
|
|
131
|
+
- @objectql/core@1.5.0
|
|
132
|
+
- @objectql/driver-sql@1.5.0
|
|
133
|
+
- @objectql/types@1.5.0
|
|
134
|
+
|
|
135
|
+
## 5.0.0
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- Updated dependencies
|
|
140
|
+
- @objectql/core@1.4.0
|
|
141
|
+
- @objectql/driver-sql@1.4.0
|
|
142
|
+
- @objectql/types@1.4.0
|
|
143
|
+
|
|
144
|
+
## 4.0.1
|
|
145
|
+
|
|
146
|
+
### Patch Changes
|
|
147
|
+
|
|
148
|
+
- Updated dependencies
|
|
149
|
+
- @objectql/core@1.3.1
|
|
150
|
+
- @objectql/driver-sql@1.3.1
|
|
151
|
+
- @objectql/types@1.3.1
|
|
152
|
+
|
|
153
|
+
## 4.0.0
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- Updated dependencies
|
|
158
|
+
- @objectql/core@1.3.0
|
|
159
|
+
- @objectql/types@1.3.0
|
|
160
|
+
- @objectql/driver-sql@1.2.1
|
|
161
|
+
|
|
162
|
+
## 3.0.0
|
|
163
|
+
|
|
164
|
+
### Minor Changes
|
|
165
|
+
|
|
166
|
+
- 7df2977: 拆分 objectos
|
|
167
|
+
|
|
168
|
+
### Patch Changes
|
|
169
|
+
|
|
170
|
+
- Updated dependencies [7df2977]
|
|
171
|
+
- @objectql/core@1.2.0
|
|
172
|
+
- @objectql/driver-sql@1.2.0
|
|
173
|
+
- @objectql/types@1.2.0
|
|
174
|
+
|
|
175
|
+
## 1.8.0
|
|
176
|
+
|
|
177
|
+
### Minor Changes
|
|
178
|
+
|
|
179
|
+
- add metadata loader
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- Updated dependencies
|
|
184
|
+
- @objectql/core@1.1.0
|
|
185
|
+
|
|
186
|
+
## 1.0.0
|
|
187
|
+
|
|
188
|
+
### Patch Changes
|
|
189
|
+
|
|
190
|
+
- Updated dependencies
|
|
191
|
+
- @objectql/core@1.0.0
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Basic Script Example
|
|
2
|
+
|
|
3
|
+
This is a minimal example demonstrating how to use ObjectQL as a library in a simple Node.js/TypeScript script.
|
|
4
|
+
|
|
5
|
+
It demonstrates:
|
|
6
|
+
1. How to initialize ObjectQL (`new ObjectQL(...)`)
|
|
7
|
+
2. How to connect to a SQLite database
|
|
8
|
+
3. How to define objects (`projects.object.yml`)
|
|
9
|
+
4. How to perform CRUD operations in a script
|
|
10
|
+
|
|
11
|
+
## Run
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm install
|
|
15
|
+
pnpm run build
|
|
16
|
+
node dist/index.js
|
|
17
|
+
```
|