@objectql/create 4.0.1 → 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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/templates/enterprise/CHANGELOG.md +10 -0
  3. package/templates/enterprise/README.md +2 -2
  4. package/templates/enterprise/package.json +2 -2
  5. package/templates/enterprise/src/core/attachment.object.yml +10 -1
  6. package/templates/enterprise/src/core/organization.object.yml +41 -6
  7. package/templates/enterprise/src/core/user.object.yml +37 -12
  8. package/templates/enterprise/src/extensions/README.md +4 -4
  9. package/templates/enterprise/src/extensions/user_extension.object.yml +65 -0
  10. package/templates/enterprise/src/modules/crm/crm_account.object.yml +57 -13
  11. package/templates/enterprise/src/modules/crm/crm_contact.object.yml +42 -8
  12. package/templates/enterprise/src/modules/crm/crm_lead.object.yml +82 -21
  13. package/templates/enterprise/src/modules/crm/crm_opportunity.object.yml +65 -15
  14. package/templates/enterprise/src/modules/finance/finance_budget.object.yml +67 -16
  15. package/templates/enterprise/src/modules/finance/finance_expense.object.yml +75 -19
  16. package/templates/enterprise/src/modules/finance/finance_invoice.object.yml +61 -16
  17. package/templates/enterprise/src/modules/finance/finance_payment.object.yml +65 -16
  18. package/templates/enterprise/src/modules/hr/hr_department.object.yml +29 -2
  19. package/templates/enterprise/src/modules/hr/hr_employee.object.yml +50 -8
  20. package/templates/enterprise/src/modules/hr/hr_position.object.yml +46 -10
  21. package/templates/enterprise/src/modules/hr/hr_timesheet.object.yml +44 -8
  22. package/templates/enterprise/src/modules/project/project_milestone.object.yml +36 -4
  23. package/templates/enterprise/src/modules/project/project_project.object.yml +64 -13
  24. package/templates/enterprise/src/modules/project/project_task.object.yml +70 -9
  25. package/templates/enterprise/src/modules/project/project_timesheet_entry.object.yml +39 -4
  26. package/templates/enterprise/src/plugins/audit/note.object.yml +17 -0
  27. package/templates/enterprise/tsconfig.tsbuildinfo +1 -1
  28. package/templates/hello-world/CHANGELOG.md +8 -0
  29. package/templates/hello-world/README.md +73 -10
  30. package/templates/hello-world/package.json +1 -1
  31. package/templates/hello-world/src/index.ts +17 -5
  32. package/templates/starter/CHANGELOG.md +10 -0
  33. package/templates/starter/package.json +1 -1
  34. package/templates/starter/src/modules/projects/projects.object.yml +65 -6
  35. package/templates/starter/src/modules/projects/projects.validation.yml +13 -4
  36. package/templates/starter/src/seed.ts +1 -1
  37. package/templates/starter/tsconfig.tsbuildinfo +1 -1
  38. package/templates/enterprise/src/extensions/user.extension.object.yml +0 -42
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/create",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Create ObjectQL apps with one command",
5
5
  "bin": {
6
6
  "create-objectql": "./dist/bin.js"
@@ -1,5 +1,15 @@
1
1
  # @objectql/starter-enterprise
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
+
3
13
  ## 4.0.1
4
14
 
5
15
  ### Patch Changes
@@ -81,7 +81,7 @@ src/
81
81
  │ └── index.ts
82
82
 
83
83
  ├── extensions/ # Custom Extensions/Overrides
84
- │ ├── user.extension.object.yml
84
+ │ ├── user_extension.object.yml
85
85
  │ └── README.md
86
86
 
87
87
  ├── shared/ # Shared Utilities
@@ -251,7 +251,7 @@ fields:
251
251
  email: { type: text }
252
252
  ```
253
253
 
254
- **Extension** (`extensions/user.extension.object.yml`):
254
+ **Extension** (`extensions/user_extension.object.yml`):
255
255
  ```yaml
256
256
  name: user # Same name triggers merge
257
257
  fields:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/example-enterprise-erp",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "ObjectQL Enterprise Example - CRM & HR Demo",
5
5
  "private": true,
6
6
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  "@objectql/cli": "workspace:*",
44
44
  "@objectql/driver-sql": "workspace:*",
45
45
  "@objectql/platform-node": "workspace:*",
46
- "@objectstack/spec": "^0.3.1",
46
+ "@objectstack/spec": "^0.3.3",
47
47
  "@types/jest": "^30.0.0",
48
48
  "@types/node": "^20.0.0",
49
49
  "jest": "^30.2.0",
@@ -1,8 +1,17 @@
1
- name: attachment
1
+ # File: attachment.object.yml
2
+ # Object name is inferred from filename as 'attachment'
2
3
  label: Attachment
3
4
  description: File attachment for any object
4
5
  icon: attachment-line
5
6
 
7
+ ai_context:
8
+ intent: "Manage file attachments linked to any record type"
9
+ domain: file_management
10
+ common_queries:
11
+ - "Find attachments for a specific record"
12
+ - "List recent uploads by user"
13
+ - "Filter by file type"
14
+
6
15
  fields:
7
16
  name:
8
17
  type: text
@@ -1,40 +1,67 @@
1
- name: organization
1
+ # File: organization.object.yml
2
+ # Object name is inferred from filename as 'organization'
2
3
  label: Organization
3
4
  description: Company or organization entity
4
5
  icon: building-line
5
6
 
7
+ ai_context:
8
+ intent: "Define organizational hierarchy and structure"
9
+ domain: organizational_management
10
+ aliases: [company, org, department, team]
11
+ common_queries:
12
+ - "Show organization hierarchy"
13
+ - "Find active departments"
14
+ - "List teams under a parent org"
15
+
6
16
  fields:
7
17
  name:
8
18
  type: text
9
19
  required: true
10
20
  label: Organization Name
11
21
  index: true
22
+ ai_context:
23
+ intent: "Primary identifier for the organization"
12
24
 
13
25
  code:
14
26
  type: text
15
27
  label: Organization Code
16
28
  unique: true
17
29
  index: true
30
+ ai_context:
31
+ intent: "Unique code for system identification"
18
32
 
19
33
  type:
20
34
  type: select
35
+ label: Organization Type
21
36
  options:
22
- - enterprise
23
- - department
24
- - team
37
+ - label: Enterprise
38
+ value: enterprise
39
+ - label: Department
40
+ value: department
41
+ - label: Team
42
+ value: team
25
43
  defaultValue: enterprise
26
44
  index: true
45
+ ai_context:
46
+ intent: "Classify organizational unit level"
47
+ is_state_machine: false
27
48
 
28
49
  parent:
29
50
  type: lookup
30
51
  reference_to: organization
31
52
  label: Parent Organization
32
53
  index: true
54
+ ai_context:
55
+ intent: "Define hierarchical organization structure"
56
+ semantic_type: hierarchy
33
57
 
34
58
  manager:
35
59
  type: lookup
36
60
  reference_to: user
37
61
  label: Manager
62
+ ai_context:
63
+ intent: "Organization leader or manager"
64
+ semantic_type: ownership
38
65
 
39
66
  description:
40
67
  type: textarea
@@ -62,11 +89,19 @@ fields:
62
89
 
63
90
  status:
64
91
  type: select
92
+ label: Status
65
93
  options:
66
- - active
67
- - inactive
94
+ - label: Active
95
+ value: active
96
+ - label: Inactive
97
+ value: inactive
68
98
  defaultValue: active
69
99
  index: true
100
+ ai_context:
101
+ intent: "Track organization operational status"
102
+ transitions:
103
+ active: [inactive]
104
+ inactive: [active]
70
105
 
71
106
  indexes:
72
107
  # For org tree queries
@@ -1,4 +1,5 @@
1
- name: user
1
+ # File: user.object.yml
2
+ # Object name is inferred from filename as 'user'
2
3
  label: User
3
4
  description: System user with authentication and profile
4
5
  icon: user-line
@@ -35,21 +36,39 @@ fields:
35
36
 
36
37
  status:
37
38
  type: select
39
+ label: User Status
38
40
  options:
39
- - active
40
- - inactive
41
- - suspended
41
+ - label: Active
42
+ value: active
43
+ - label: Inactive
44
+ value: inactive
45
+ - label: Suspended
46
+ value: suspended
42
47
  defaultValue: active
43
48
  index: true
49
+ ai_context:
50
+ intent: "Track user account status"
51
+ is_state_machine: true
52
+ transitions:
53
+ active: [inactive, suspended]
54
+ inactive: [active]
55
+ suspended: [active, inactive]
44
56
 
45
57
  role:
46
58
  type: select
59
+ label: User Role
47
60
  options:
48
- - admin
49
- - user
50
- - guest
61
+ - label: Administrator
62
+ value: admin
63
+ - label: User
64
+ value: user
65
+ - label: Guest
66
+ value: guest
51
67
  defaultValue: user
52
68
  index: true
69
+ ai_context:
70
+ intent: "Define user permissions level"
71
+ selection_guidance: "Admin for full access; User for standard access; Guest for read-only"
53
72
 
54
73
  last_login_at:
55
74
  type: datetime
@@ -57,13 +76,19 @@ fields:
57
76
 
58
77
  locale:
59
78
  type: select
79
+ label: Preferred Language
60
80
  options:
61
- - en
62
- - zh-CN
63
- - ja
64
- - es
81
+ - label: English
82
+ value: en
83
+ - label: Chinese (Simplified)
84
+ value: zh-CN
85
+ - label: Japanese
86
+ value: ja
87
+ - label: Spanish
88
+ value: es
65
89
  defaultValue: en
66
- label: Preferred Language
90
+ ai_context:
91
+ intent: "User interface language preference"
67
92
 
68
93
  timezone:
69
94
  type: text
@@ -8,7 +8,7 @@ Extensions use ObjectQL's **Schema Merging** feature. When you define an object
8
8
 
9
9
  ## Example: Extending the User Object
10
10
 
11
- The `user.extension.object.yml` file extends the core `user` object with company-specific customizations:
11
+ The `user_extension.object.yml` file extends the core `user` object with company-specific customizations:
12
12
 
13
13
  1. **Adding fields** - Links to employee record, office location
14
14
  2. **Overriding properties** - Making email required and unique
@@ -30,12 +30,12 @@ The `user.extension.object.yml` file extends the core `user` object with company
30
30
  ## File Naming Convention
31
31
 
32
32
  ```
33
- [object_name].extension.object.yml
33
+ [object_name]_extension.object.yml
34
34
  ```
35
35
 
36
36
  Examples:
37
- - `user.extension.object.yml` - Extends the `user` object
38
- - `organization.extension.object.yml` - Extends the `organization` object
37
+ - `user_extension.object.yml` - Extends the `user` object
38
+ - `organization_extension.object.yml` - Extends the `organization` object
39
39
 
40
40
  ## Loading Order
41
41
 
@@ -0,0 +1,65 @@
1
+ # File: user_extension.object.yml
2
+ # Explicitly set name to 'user' to extend the core user object
3
+ # This extends the core user object with company-specific fields
4
+ name: user
5
+ label: System User (Extended)
6
+
7
+ ai_context:
8
+ intent: "Extend base user with enterprise-specific fields"
9
+ extends: user
10
+ domain: hr_management
11
+
12
+ fields:
13
+ # Add employee link
14
+ employee:
15
+ type: lookup
16
+ reference_to: hr_employee
17
+ label: Employee Record
18
+ unique: true
19
+ ai_context:
20
+ intent: "Link user account to HR employee record"
21
+ semantic_type: association
22
+
23
+ # Override email to make it required and unique
24
+ email:
25
+ required: true
26
+ unique: true
27
+
28
+ # Add custom fields
29
+ employee_id:
30
+ type: text
31
+ label: Employee ID
32
+ unique: true
33
+ index: true
34
+ ai_context:
35
+ intent: "Corporate employee identifier"
36
+
37
+ department:
38
+ type: lookup
39
+ reference_to: hr_department
40
+ label: Department
41
+ ai_context:
42
+ intent: "User's organizational department"
43
+ semantic_type: hierarchy
44
+
45
+ office_location:
46
+ type: select
47
+ label: Office Location
48
+ options:
49
+ - label: Headquarters
50
+ value: headquarters
51
+ - label: Branch Office A
52
+ value: branch_office_a
53
+ - label: Branch Office B
54
+ value: branch_office_b
55
+ - label: Remote
56
+ value: remote
57
+ ai_context:
58
+ intent: "Physical or remote work location"
59
+
60
+ two_factor_enabled:
61
+ type: boolean
62
+ defaultValue: false
63
+ label: Two-Factor Auth Enabled
64
+ ai_context:
65
+ intent: "Security enhancement status"
@@ -1,13 +1,26 @@
1
+ # File: crm_account.object.yml
2
+ # Object name is inferred from filename as 'crm_account'
1
3
  label: Account
2
4
  description: Customer company or organization
3
5
  icon: briefcase-line
4
6
 
7
+ ai_context:
8
+ intent: "Manage customer and prospect organizations"
9
+ domain: customer_relationship_management
10
+ aliases: [account, organization, company, customer]
11
+ common_queries:
12
+ - "Show active accounts by revenue"
13
+ - "Find accounts by industry"
14
+ - "List customer accounts with opportunities"
15
+
5
16
  fields:
6
17
  name:
7
18
  type: text
8
19
  required: true
9
20
  label: Account Name
10
21
  index: true
22
+ ai_context:
23
+ intent: "Company or organization name"
11
24
 
12
25
  account_number:
13
26
  type: text
@@ -17,26 +30,43 @@ fields:
17
30
 
18
31
  type:
19
32
  type: select
33
+ label: Account Type
20
34
  options:
21
- - customer
22
- - prospect
23
- - partner
24
- - competitor
35
+ - label: Customer
36
+ value: customer
37
+ - label: Prospect
38
+ value: prospect
39
+ - label: Partner
40
+ value: partner
41
+ - label: Competitor
42
+ value: competitor
25
43
  defaultValue: prospect
26
44
  index: true
45
+ ai_context:
46
+ intent: "Categorize relationship type with the organization"
47
+ selection_guidance: "Customer for active clients; Prospect for potential customers"
27
48
 
28
49
  industry:
29
50
  type: select
30
51
  options:
31
- - technology
32
- - finance
33
- - healthcare
34
- - manufacturing
35
- - retail
36
- - education
37
- - other
52
+ - label: Technology
53
+ value: technology
54
+ - label: Finance
55
+ value: finance
56
+ - label: Healthcare
57
+ value: healthcare
58
+ - label: Manufacturing
59
+ value: manufacturing
60
+ - label: Retail
61
+ value: retail
62
+ - label: Education
63
+ value: education
64
+ - label: Other
65
+ value: other
38
66
  label: Industry
39
67
  index: true
68
+ ai_context:
69
+ intent: "Primary industry sector for segmentation and analysis"
40
70
 
41
71
  annual_revenue:
42
72
  type: currency
@@ -67,11 +97,17 @@ fields:
67
97
  reference_to: user
68
98
  label: Account Owner
69
99
  index: true
100
+ ai_context:
101
+ intent: "Primary sales representative managing this account"
102
+ semantic_type: ownership
70
103
 
71
104
  parent_account:
72
105
  type: lookup
73
106
  reference_to: crm_account
74
107
  label: Parent Account
108
+ ai_context:
109
+ intent: "Parent organization for corporate hierarchies"
110
+ semantic_type: hierarchy
75
111
 
76
112
  description:
77
113
  type: textarea
@@ -80,10 +116,18 @@ fields:
80
116
  status:
81
117
  type: select
82
118
  options:
83
- - active
84
- - inactive
119
+ - label: Active
120
+ value: active
121
+ - label: Inactive
122
+ value: inactive
85
123
  defaultValue: active
86
124
  index: true
125
+ ai_context:
126
+ intent: "Current operational status of the account"
127
+ is_state_machine: true
128
+ transitions:
129
+ active: [inactive]
130
+ inactive: [active]
87
131
 
88
132
  indexes:
89
133
  # For account owner queries
@@ -1,7 +1,18 @@
1
+ # File: crm_contact.object.yml
2
+ # Object name is inferred from filename as 'crm_contact'
1
3
  label: Contact
2
4
  description: Individual contact person
3
5
  icon: user-line
4
6
 
7
+ ai_context:
8
+ intent: "Manage individual contacts and decision-makers at accounts"
9
+ domain: customer_relationship_management
10
+ aliases: [contact, person, decision maker]
11
+ common_queries:
12
+ - "Find contacts by account"
13
+ - "Show contacts by job title"
14
+ - "List active contacts with email"
15
+
5
16
  fields:
6
17
  first_name:
7
18
  type: text
@@ -17,8 +28,10 @@ fields:
17
28
 
18
29
  full_name:
19
30
  type: formula
20
- formula: "CONCAT(first_name, ' ', last_name)"
31
+ expression: "first_name + ' ' + last_name"
32
+ data_type: text
21
33
  label: Full Name
34
+ description: "Automatically calculated from first and last name"
22
35
 
23
36
  email:
24
37
  type: text
@@ -49,23 +62,36 @@ fields:
49
62
  label: Account
50
63
  required: true
51
64
  index: true
65
+ ai_context:
66
+ intent: "Company or organization this contact belongs to"
67
+ semantic_type: hierarchy
52
68
 
53
69
  owner:
54
70
  type: lookup
55
71
  reference_to: user
56
72
  label: Contact Owner
57
73
  index: true
74
+ ai_context:
75
+ intent: "Sales representative managing this contact"
76
+ semantic_type: ownership
58
77
 
59
78
  lead_source:
60
79
  type: select
61
80
  options:
62
- - web
63
- - referral
64
- - trade_show
65
- - partner
66
- - other
81
+ - label: Web
82
+ value: web
83
+ - label: Referral
84
+ value: referral
85
+ - label: Trade Show
86
+ value: trade_show
87
+ - label: Partner
88
+ value: partner
89
+ - label: Other
90
+ value: other
67
91
  label: Lead Source
68
92
  index: true
93
+ ai_context:
94
+ intent: "Original source of the contact for attribution"
69
95
 
70
96
  linkedin_url:
71
97
  type: url
@@ -78,10 +104,18 @@ fields:
78
104
  status:
79
105
  type: select
80
106
  options:
81
- - active
82
- - inactive
107
+ - label: Active
108
+ value: active
109
+ - label: Inactive
110
+ value: inactive
83
111
  defaultValue: active
84
112
  index: true
113
+ ai_context:
114
+ intent: "Current status of contact engagement"
115
+ is_state_machine: true
116
+ transitions:
117
+ active: [inactive]
118
+ inactive: [active]
85
119
 
86
120
  indexes:
87
121
  # For account contact lookup