@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,34 @@
|
|
|
1
|
+
label: Task
|
|
2
|
+
icon: checkbox-circle-line
|
|
3
|
+
fields:
|
|
4
|
+
name:
|
|
5
|
+
type: text
|
|
6
|
+
required: true
|
|
7
|
+
index: true # Simple index
|
|
8
|
+
|
|
9
|
+
project:
|
|
10
|
+
reference_to: projects
|
|
11
|
+
|
|
12
|
+
due_date:
|
|
13
|
+
type: date
|
|
14
|
+
|
|
15
|
+
completed:
|
|
16
|
+
type: boolean
|
|
17
|
+
defaultValue: false
|
|
18
|
+
index: true # Helpful for finding pending tasks
|
|
19
|
+
|
|
20
|
+
priority:
|
|
21
|
+
options:
|
|
22
|
+
- low
|
|
23
|
+
- medium
|
|
24
|
+
- high
|
|
25
|
+
defaultValue: medium
|
|
26
|
+
|
|
27
|
+
assigned_to:
|
|
28
|
+
type: text
|
|
29
|
+
label: Assignee
|
|
30
|
+
|
|
31
|
+
estimated_hours:
|
|
32
|
+
type: number
|
|
33
|
+
label: Estimated Hours
|
|
34
|
+
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
name: tasks_permission
|
|
2
|
+
object: tasks
|
|
3
|
+
description: "Advanced permission rules for Task object demonstrating complex scenarios"
|
|
4
|
+
|
|
5
|
+
# Roles (defined in demo.app.yml, referenced here)
|
|
6
|
+
# This list documents which system roles have permissions on this object
|
|
7
|
+
roles:
|
|
8
|
+
- admin
|
|
9
|
+
- project_manager
|
|
10
|
+
- team_lead
|
|
11
|
+
- developer
|
|
12
|
+
- viewer
|
|
13
|
+
|
|
14
|
+
# Object-level permissions (CRUD)
|
|
15
|
+
object_permissions:
|
|
16
|
+
create: [admin, project_manager, team_lead, developer]
|
|
17
|
+
read: [admin, project_manager, team_lead, developer, viewer]
|
|
18
|
+
update: [admin, project_manager, team_lead, developer]
|
|
19
|
+
delete: [admin, project_manager, team_lead]
|
|
20
|
+
view_all: [admin, project_manager]
|
|
21
|
+
modify_all: [admin]
|
|
22
|
+
|
|
23
|
+
# Field-level security
|
|
24
|
+
field_permissions:
|
|
25
|
+
estimated_hours:
|
|
26
|
+
read: [admin, project_manager, team_lead]
|
|
27
|
+
update: [admin, project_manager, team_lead]
|
|
28
|
+
|
|
29
|
+
priority:
|
|
30
|
+
read: [admin, project_manager, team_lead, developer, viewer]
|
|
31
|
+
update: [admin, project_manager, team_lead]
|
|
32
|
+
|
|
33
|
+
assigned_to:
|
|
34
|
+
read: [admin, project_manager, team_lead, developer, viewer]
|
|
35
|
+
update: [admin, project_manager, team_lead]
|
|
36
|
+
|
|
37
|
+
# Record-level rules with complex conditions
|
|
38
|
+
record_rules:
|
|
39
|
+
- name: assignee_full_access
|
|
40
|
+
priority: 100
|
|
41
|
+
description: Assignee has full access to assigned tasks
|
|
42
|
+
condition:
|
|
43
|
+
type: simple
|
|
44
|
+
field: assigned_to
|
|
45
|
+
operator: "="
|
|
46
|
+
value: $current_user.id
|
|
47
|
+
permissions:
|
|
48
|
+
read: true
|
|
49
|
+
update: true
|
|
50
|
+
delete: false
|
|
51
|
+
|
|
52
|
+
- name: team_lead_access
|
|
53
|
+
priority: 90
|
|
54
|
+
description: Team leads can access all tasks in their team's projects
|
|
55
|
+
condition:
|
|
56
|
+
type: lookup
|
|
57
|
+
object: projects
|
|
58
|
+
via: project
|
|
59
|
+
condition:
|
|
60
|
+
type: simple
|
|
61
|
+
field: owner
|
|
62
|
+
operator: "="
|
|
63
|
+
value: $current_user.id
|
|
64
|
+
permissions:
|
|
65
|
+
read: true
|
|
66
|
+
update: true
|
|
67
|
+
delete: true
|
|
68
|
+
|
|
69
|
+
- name: completed_tasks_readonly
|
|
70
|
+
priority: 50
|
|
71
|
+
description: Completed tasks are read-only for non-admins
|
|
72
|
+
condition:
|
|
73
|
+
type: simple
|
|
74
|
+
field: completed
|
|
75
|
+
operator: "="
|
|
76
|
+
value: true
|
|
77
|
+
permissions:
|
|
78
|
+
read: true
|
|
79
|
+
update: false
|
|
80
|
+
delete: false
|
|
81
|
+
|
|
82
|
+
- name: high_priority_manager_only
|
|
83
|
+
priority: 80
|
|
84
|
+
description: Only managers can edit high priority tasks
|
|
85
|
+
condition:
|
|
86
|
+
type: simple
|
|
87
|
+
field: priority
|
|
88
|
+
operator: "="
|
|
89
|
+
value: high
|
|
90
|
+
permissions:
|
|
91
|
+
read: true
|
|
92
|
+
update: false
|
|
93
|
+
delete: false
|
|
94
|
+
|
|
95
|
+
# Sharing rules
|
|
96
|
+
sharing_rules:
|
|
97
|
+
- name: manual_collaboration
|
|
98
|
+
type: manual
|
|
99
|
+
description: Users can share tasks with collaborators
|
|
100
|
+
enabled: true
|
|
101
|
+
permissions:
|
|
102
|
+
read: true
|
|
103
|
+
update: true
|
|
104
|
+
delete: false
|
|
105
|
+
|
|
106
|
+
- name: project_team_sharing
|
|
107
|
+
type: criteria
|
|
108
|
+
description: All project team members can see related tasks
|
|
109
|
+
condition:
|
|
110
|
+
type: simple
|
|
111
|
+
field: project
|
|
112
|
+
operator: "!="
|
|
113
|
+
value: null
|
|
114
|
+
shared_with:
|
|
115
|
+
type: role
|
|
116
|
+
roles: [developer, team_lead]
|
|
117
|
+
permissions:
|
|
118
|
+
read: true
|
|
119
|
+
update: false
|
|
120
|
+
|
|
121
|
+
# Row-level security
|
|
122
|
+
row_level_security:
|
|
123
|
+
enabled: true
|
|
124
|
+
default_rule:
|
|
125
|
+
field: assigned_to
|
|
126
|
+
operator: "="
|
|
127
|
+
value: $current_user.id
|
|
128
|
+
exceptions:
|
|
129
|
+
- role: admin
|
|
130
|
+
bypass: true
|
|
131
|
+
- role: project_manager
|
|
132
|
+
bypass: true
|
|
133
|
+
- role: team_lead
|
|
134
|
+
condition:
|
|
135
|
+
type: lookup
|
|
136
|
+
object: projects
|
|
137
|
+
via: project
|
|
138
|
+
condition:
|
|
139
|
+
type: simple
|
|
140
|
+
field: owner
|
|
141
|
+
operator: "="
|
|
142
|
+
value: $current_user.id
|
|
143
|
+
|
|
144
|
+
# Field masking for sensitive data
|
|
145
|
+
field_masking:
|
|
146
|
+
estimated_hours:
|
|
147
|
+
mask_format: "XX.X hours" # Mask numeric values appropriately
|
|
148
|
+
visible_to: [admin, project_manager, team_lead]
|
|
149
|
+
|
|
150
|
+
# Audit configuration
|
|
151
|
+
audit:
|
|
152
|
+
enabled: true
|
|
153
|
+
events:
|
|
154
|
+
- permission_grant
|
|
155
|
+
- permission_revoke
|
|
156
|
+
- access_denied
|
|
157
|
+
- sensitive_field_access
|
|
158
|
+
retention_days: 180
|
|
159
|
+
alerts:
|
|
160
|
+
- event: access_denied
|
|
161
|
+
threshold: 10
|
|
162
|
+
window_minutes: 15
|
|
163
|
+
notify: [admin, project_manager]
|
|
164
|
+
- event: sensitive_field_access
|
|
165
|
+
threshold: 50
|
|
166
|
+
window_minutes: 60
|
|
167
|
+
notify: [admin]
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Auto-generated by ObjectQL. DO NOT EDIT.
|
|
2
|
+
import { ObjectDoc } from '@objectql/types';
|
|
3
|
+
|
|
4
|
+
export interface KitchenSink extends ObjectDoc {
|
|
5
|
+
/**
|
|
6
|
+
* Simple Text
|
|
7
|
+
*/
|
|
8
|
+
simple_text: string;
|
|
9
|
+
/**
|
|
10
|
+
* Multi-line Text
|
|
11
|
+
*/
|
|
12
|
+
long_text?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Markdown Content
|
|
15
|
+
*/
|
|
16
|
+
rich_content?: string;
|
|
17
|
+
/**
|
|
18
|
+
* HTML Content
|
|
19
|
+
*/
|
|
20
|
+
raw_html?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Integer Count
|
|
23
|
+
*/
|
|
24
|
+
count?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Price
|
|
27
|
+
*/
|
|
28
|
+
price?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Progress
|
|
31
|
+
*/
|
|
32
|
+
progress?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Is Active
|
|
35
|
+
*/
|
|
36
|
+
is_active?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Due Date
|
|
39
|
+
*/
|
|
40
|
+
due_date?: Date | string;
|
|
41
|
+
/**
|
|
42
|
+
* Meeting (Date & Time)
|
|
43
|
+
*/
|
|
44
|
+
meeting_time?: Date | string;
|
|
45
|
+
/**
|
|
46
|
+
* Alarm Time
|
|
47
|
+
*/
|
|
48
|
+
alarm?: Date | string;
|
|
49
|
+
/**
|
|
50
|
+
* Status
|
|
51
|
+
*/
|
|
52
|
+
status?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Tags
|
|
55
|
+
*/
|
|
56
|
+
tags?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Email
|
|
59
|
+
*/
|
|
60
|
+
email_address?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Phone
|
|
63
|
+
*/
|
|
64
|
+
phone_number?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Website URL
|
|
67
|
+
*/
|
|
68
|
+
website?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Avatar
|
|
71
|
+
*/
|
|
72
|
+
profile_pic?: any;
|
|
73
|
+
/**
|
|
74
|
+
* Attachment document
|
|
75
|
+
*/
|
|
76
|
+
attachment?: any;
|
|
77
|
+
/**
|
|
78
|
+
* Image Gallery
|
|
79
|
+
*/
|
|
80
|
+
gallery?: any[];
|
|
81
|
+
/**
|
|
82
|
+
* Secret Code
|
|
83
|
+
*/
|
|
84
|
+
secret_code?: string;
|
|
85
|
+
/**
|
|
86
|
+
* GPS Coordinates
|
|
87
|
+
*/
|
|
88
|
+
coords?: any;
|
|
89
|
+
/**
|
|
90
|
+
* JSON Metadata
|
|
91
|
+
*/
|
|
92
|
+
metadata?: any;
|
|
93
|
+
/**
|
|
94
|
+
* Vector Embedding
|
|
95
|
+
*/
|
|
96
|
+
embedding?: number[];
|
|
97
|
+
/**
|
|
98
|
+
* Related Project
|
|
99
|
+
*/
|
|
100
|
+
related_project?: string | number;
|
|
101
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Auto-generated by ObjectQL. DO NOT EDIT.
|
|
2
|
+
import { ObjectDoc } from '@objectql/types';
|
|
3
|
+
|
|
4
|
+
export interface Projects extends ObjectDoc {
|
|
5
|
+
/**
|
|
6
|
+
* Name
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Status
|
|
11
|
+
*/
|
|
12
|
+
status?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Priority
|
|
15
|
+
*/
|
|
16
|
+
priority?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Description
|
|
19
|
+
*/
|
|
20
|
+
description?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Owner
|
|
23
|
+
*/
|
|
24
|
+
owner?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Budget
|
|
27
|
+
*/
|
|
28
|
+
budget?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Start Date
|
|
31
|
+
*/
|
|
32
|
+
start_date?: Date | string;
|
|
33
|
+
/**
|
|
34
|
+
* End Date
|
|
35
|
+
*/
|
|
36
|
+
end_date?: Date | string;
|
|
37
|
+
/**
|
|
38
|
+
* Approved By
|
|
39
|
+
*/
|
|
40
|
+
approved_by?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Approved At
|
|
43
|
+
*/
|
|
44
|
+
approved_at?: Date | string;
|
|
45
|
+
/**
|
|
46
|
+
* Approval Comment
|
|
47
|
+
*/
|
|
48
|
+
approval_comment?: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Auto-generated by ObjectQL. DO NOT EDIT.
|
|
2
|
+
import { ObjectDoc } from '@objectql/types';
|
|
3
|
+
|
|
4
|
+
export interface Tasks extends ObjectDoc {
|
|
5
|
+
/**
|
|
6
|
+
* Name
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Project
|
|
11
|
+
*/
|
|
12
|
+
project?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* Due Date
|
|
15
|
+
*/
|
|
16
|
+
due_date?: Date | string;
|
|
17
|
+
/**
|
|
18
|
+
* Completed
|
|
19
|
+
*/
|
|
20
|
+
completed?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Priority
|
|
23
|
+
*/
|
|
24
|
+
priority?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Assignee
|
|
27
|
+
*/
|
|
28
|
+
assigned_to?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Estimated Hours
|
|
31
|
+
*/
|
|
32
|
+
estimated_hours?: number;
|
|
33
|
+
}
|