@objectql/create 4.0.0 → 4.0.2
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/package.json +1 -1
- package/templates/enterprise/CHANGELOG.md +20 -0
- package/templates/enterprise/README.md +2 -2
- package/templates/enterprise/package.json +2 -2
- package/templates/enterprise/src/core/attachment.object.yml +10 -1
- package/templates/enterprise/src/core/organization.object.yml +41 -6
- package/templates/enterprise/src/core/user.object.yml +37 -12
- package/templates/enterprise/src/extensions/README.md +4 -4
- package/templates/enterprise/src/extensions/user_extension.object.yml +65 -0
- package/templates/enterprise/src/modules/crm/crm_account.object.yml +57 -13
- package/templates/enterprise/src/modules/crm/crm_contact.object.yml +42 -8
- package/templates/enterprise/src/modules/crm/crm_lead.object.yml +82 -21
- package/templates/enterprise/src/modules/crm/crm_opportunity.object.yml +65 -15
- package/templates/enterprise/src/modules/finance/finance_budget.object.yml +67 -16
- package/templates/enterprise/src/modules/finance/finance_expense.object.yml +75 -19
- package/templates/enterprise/src/modules/finance/finance_invoice.object.yml +61 -16
- package/templates/enterprise/src/modules/finance/finance_payment.object.yml +65 -16
- package/templates/enterprise/src/modules/hr/hr_department.object.yml +29 -2
- package/templates/enterprise/src/modules/hr/hr_employee.object.yml +50 -8
- package/templates/enterprise/src/modules/hr/hr_position.object.yml +46 -10
- package/templates/enterprise/src/modules/hr/hr_timesheet.object.yml +44 -8
- package/templates/enterprise/src/modules/project/project_milestone.object.yml +36 -4
- package/templates/enterprise/src/modules/project/project_project.object.yml +64 -13
- package/templates/enterprise/src/modules/project/project_task.object.yml +70 -9
- package/templates/enterprise/src/modules/project/project_timesheet_entry.object.yml +39 -4
- package/templates/enterprise/src/plugins/audit/audit.plugin.ts +1 -1
- package/templates/enterprise/src/plugins/audit/note.object.yml +17 -0
- package/templates/enterprise/tsconfig.tsbuildinfo +1 -1
- package/templates/hello-world/CHANGELOG.md +16 -0
- package/templates/hello-world/README.md +73 -10
- package/templates/hello-world/package.json +1 -1
- package/templates/hello-world/src/index.ts +17 -5
- package/templates/starter/CHANGELOG.md +20 -0
- package/templates/starter/package.json +1 -1
- package/templates/starter/src/modules/projects/projects.action.ts +195 -346
- package/templates/starter/src/modules/projects/projects.hook.ts +98 -263
- package/templates/starter/src/modules/projects/projects.object.yml +65 -6
- package/templates/starter/src/modules/projects/projects.validation.yml +13 -4
- package/templates/starter/src/seed.ts +1 -1
- package/templates/starter/tsconfig.tsbuildinfo +1 -1
- package/templates/enterprise/__tests__/data-api.test.ts +0 -554
- package/templates/enterprise/__tests__/data-api.test.ts.backup +0 -526
- package/templates/enterprise/__tests__/metadata-api.test.ts +0 -315
- package/templates/enterprise/__tests__/metadata-loading.test.ts +0 -258
- package/templates/enterprise/src/extensions/user.extension.object.yml +0 -42
- package/templates/starter/__tests__/projects-hooks-actions.test.ts +0 -498
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @example/hello-world
|
|
2
2
|
|
|
3
|
+
## 4.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @objectql/core@4.0.2
|
|
9
|
+
- @objectql/driver-sql@4.0.2
|
|
10
|
+
|
|
11
|
+
## 4.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @objectql/core@4.0.1
|
|
17
|
+
- @objectql/driver-sql@4.0.1
|
|
18
|
+
|
|
3
19
|
## 3.0.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,11 +1,51 @@
|
|
|
1
1
|
# Hello ObjectQL
|
|
2
2
|
|
|
3
|
-
This is the simplest possible example of **ObjectQL
|
|
3
|
+
This is the simplest possible example of **ObjectQL** following the **latest ObjectStack specification** (v4.0+).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
## What it demonstrates
|
|
6
|
+
|
|
7
|
+
1. **Zero Config:** No YAML files or server setup required
|
|
8
|
+
2. **In-Memory SQL:** Uses SQLite in memory, so no database installation is needed
|
|
9
|
+
3. **Inline Schema:** Defines the data model directly in code using programmatic API
|
|
10
|
+
4. **Latest Spec Compliance:**
|
|
11
|
+
- Label/value format for select options
|
|
12
|
+
- Explicit field labels for AI-friendly metadata
|
|
13
|
+
- Proper field type declarations
|
|
14
|
+
|
|
15
|
+
## Key Concepts
|
|
16
|
+
|
|
17
|
+
### Metadata Definition Approaches
|
|
18
|
+
|
|
19
|
+
**Programmatic (This Example):**
|
|
20
|
+
```typescript
|
|
21
|
+
app.registerObject({
|
|
22
|
+
name: 'deal', // Required when using code
|
|
23
|
+
fields: {
|
|
24
|
+
stage: {
|
|
25
|
+
type: 'select',
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'New', value: 'new' }, // ✅ Latest spec format
|
|
28
|
+
{ label: 'Negotiation', value: 'negotiation' }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**YAML-based (Recommended for Production):**
|
|
36
|
+
```yaml
|
|
37
|
+
# File: deal.object.yml
|
|
38
|
+
# NO 'name:' field needed - inferred from filename! ✅
|
|
39
|
+
label: Deal
|
|
40
|
+
fields:
|
|
41
|
+
stage:
|
|
42
|
+
type: select
|
|
43
|
+
options:
|
|
44
|
+
- label: New
|
|
45
|
+
value: new
|
|
46
|
+
- label: Negotiation
|
|
47
|
+
value: negotiation
|
|
48
|
+
```
|
|
9
49
|
|
|
10
50
|
## How to Run
|
|
11
51
|
|
|
@@ -16,14 +56,37 @@ Since you are in the monorepo, simply run:
|
|
|
16
56
|
pnpm install
|
|
17
57
|
|
|
18
58
|
# Run the script
|
|
19
|
-
cd examples/
|
|
59
|
+
cd examples/quickstart/hello-world
|
|
20
60
|
pnpm start
|
|
21
61
|
```
|
|
22
62
|
|
|
23
63
|
## What you see
|
|
24
64
|
|
|
25
65
|
The script will:
|
|
26
|
-
1. Initialize the ObjectQL engine
|
|
27
|
-
2. Create a `deal` object definition
|
|
28
|
-
3. Insert a record into the
|
|
29
|
-
4. Query it back and print the result
|
|
66
|
+
1. Initialize the ObjectQL engine with an in-memory SQLite driver
|
|
67
|
+
2. Create a `deal` object definition programmatically
|
|
68
|
+
3. Insert a record into the database
|
|
69
|
+
4. Query it back and print the result
|
|
70
|
+
|
|
71
|
+
## Expected Output
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
🚀 Starting ObjectQL Hello World...
|
|
75
|
+
Creating a new Deal...
|
|
76
|
+
✅ Deals found in database: [
|
|
77
|
+
{
|
|
78
|
+
_id: '...',
|
|
79
|
+
title: 'Enterprise Contract',
|
|
80
|
+
amount: 50000,
|
|
81
|
+
stage: 'new',
|
|
82
|
+
created_at: '...',
|
|
83
|
+
updated_at: '...'
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Next Steps
|
|
89
|
+
|
|
90
|
+
- See [Project Tracker Example](../../showcase/project-tracker/) for YAML-based metadata
|
|
91
|
+
- Read the [Metadata Standard Spec](https://protocol.objectstack.ai) from @objectstack/spec
|
|
92
|
+
- Explore the [ObjectQL Documentation](../../../content/docs/)
|
|
@@ -26,14 +26,26 @@ async function main() {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
// 3. Define Metadata Inline
|
|
29
|
+
// 3. Define Metadata Inline (Following Latest ObjectStack Specification)
|
|
30
|
+
// Note: When using registerObject(), the 'name' is required in code
|
|
31
|
+
// When using YAML files, the name is inferred from filename (e.g., deal.object.yml)
|
|
30
32
|
app.registerObject({
|
|
31
|
-
name: 'deal',
|
|
33
|
+
name: 'deal', // Required for programmatic registration
|
|
34
|
+
label: 'Deal', // Human-readable label
|
|
32
35
|
fields: {
|
|
33
|
-
title: {
|
|
34
|
-
|
|
36
|
+
title: {
|
|
37
|
+
type: 'text',
|
|
38
|
+
required: true,
|
|
39
|
+
label: 'Deal Title'
|
|
40
|
+
},
|
|
41
|
+
amount: {
|
|
42
|
+
type: 'currency',
|
|
43
|
+
label: 'Deal Amount'
|
|
44
|
+
},
|
|
35
45
|
stage: {
|
|
36
|
-
type: 'select',
|
|
46
|
+
type: 'select',
|
|
47
|
+
label: 'Deal Stage',
|
|
48
|
+
// Options use label/value format (ObjectStack spec v4.0+)
|
|
37
49
|
options: [
|
|
38
50
|
{ label: 'New', value: 'new' },
|
|
39
51
|
{ label: 'Negotiation', value: 'negotiation' },
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @objectql/starter-basic
|
|
2
2
|
|
|
3
|
+
## 4.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @objectql/core@4.0.2
|
|
9
|
+
- @objectql/driver-sql@4.0.2
|
|
10
|
+
- @objectql/platform-node@4.0.2
|
|
11
|
+
- @objectql/types@4.0.2
|
|
12
|
+
|
|
13
|
+
## 4.0.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @objectql/core@4.0.1
|
|
19
|
+
- @objectql/driver-sql@4.0.1
|
|
20
|
+
- @objectql/platform-node@4.0.1
|
|
21
|
+
- @objectql/types@4.0.1
|
|
22
|
+
|
|
3
23
|
## 3.0.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|