@chill-sharp/ui-core 1.1.12

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 (204) hide show
  1. package/.agents/skills/chillsharp-current-user-preferences/SKILL.md +70 -0
  2. package/.agents/skills/chillsharp-ui-template/SKILL.md +18 -0
  3. package/README.md +103 -0
  4. package/chill-sharp-ui-core.d.ts.map +1 -0
  5. package/doc/AIAssistedDevelopment/README.md +185 -0
  6. package/doc/AttachmentModel/README.md +173 -0
  7. package/doc/AuthenticationModel/README.md +213 -0
  8. package/doc/AuthenticationModel/how-to-integreate-auth-minimal-api.md +293 -0
  9. package/doc/ChillSharpClient.md +464 -0
  10. package/doc/ClientGeneration/README.md +172 -0
  11. package/doc/ComplianceGuide/README.md +178 -0
  12. package/doc/Configuration/README.md +94 -0
  13. package/doc/CurrentUserPreferences.md +114 -0
  14. package/doc/DateTimePolicy/README.md +154 -0
  15. package/doc/DateTimeSerialization.md +423 -0
  16. package/doc/Endpoints.md +260 -0
  17. package/doc/HowTo/01-simple-blog-sqlite.md +153 -0
  18. package/doc/HowTo/02-blog-schema-labels.md +140 -0
  19. package/doc/HowTo/03-authentication.md +218 -0
  20. package/doc/HowTo/04-blog-posts-one-to-many.md +194 -0
  21. package/doc/HowTo/05-docker-env-variables.md +274 -0
  22. package/doc/HowTo/06-chunk-transactions-autocomplete.md +196 -0
  23. package/doc/Mcp/ChatGPT.md +291 -0
  24. package/doc/Mcp/README.md +799 -0
  25. package/doc/MenuGuide/README.md +49 -0
  26. package/doc/ModelPreparation.md +255 -0
  27. package/doc/PermissionModel/README.md +277 -0
  28. package/doc/README.md +228 -0
  29. package/doc/ReferenceExistence.md +130 -0
  30. package/doc/RegisterContext.md +217 -0
  31. package/doc/UiCore/CRUD.md +170 -0
  32. package/doc/UiCore/README.md +13 -0
  33. package/doc/ValidationModel/README.md +117 -0
  34. package/doc/it/AIAssistedDevelopment/README.md +185 -0
  35. package/doc/it/AttachmentModel/README.md +173 -0
  36. package/doc/it/AuthenticationModel/README.md +171 -0
  37. package/doc/it/AuthenticationModel/how-to-integreate-auth-minimal-api.md +292 -0
  38. package/doc/it/ChillSharpClient.md +464 -0
  39. package/doc/it/ClientGeneration/README.md +152 -0
  40. package/doc/it/ComplianceGuide/README.md +178 -0
  41. package/doc/it/Configuration/README.md +94 -0
  42. package/doc/it/CurrentUserPreferences.md +114 -0
  43. package/doc/it/DateTimePolicy/README.md +154 -0
  44. package/doc/it/DateTimeSerialization.md +423 -0
  45. package/doc/it/Endpoints.md +260 -0
  46. package/doc/it/HowTo/01-simple-blog-sqlite.md +152 -0
  47. package/doc/it/HowTo/02-blog-schema-labels.md +139 -0
  48. package/doc/it/HowTo/03-authentication.md +221 -0
  49. package/doc/it/HowTo/04-blog-posts-one-to-many.md +193 -0
  50. package/doc/it/HowTo/05-docker-env-variables.md +268 -0
  51. package/doc/it/HowTo/06-chunk-transactions-autocomplete.md +196 -0
  52. package/doc/it/Mcp/ChatGPT.md +291 -0
  53. package/doc/it/Mcp/README.md +799 -0
  54. package/doc/it/MenuGuide/README.md +49 -0
  55. package/doc/it/ModelPreparation.md +254 -0
  56. package/doc/it/PermissionModel/README.md +190 -0
  57. package/doc/it/README.md +172 -0
  58. package/doc/it/ReferenceExistence.md +130 -0
  59. package/doc/it/RegisterContext.md +218 -0
  60. package/doc/it/UiCore/CRUD.md +170 -0
  61. package/doc/it/UiCore/README.md +13 -0
  62. package/doc/it/ValidationModel/README.md +117 -0
  63. package/fesm2022/chill-sharp-ui-core.mjs +16725 -0
  64. package/fesm2022/chill-sharp-ui-core.mjs.map +1 -0
  65. package/index.d.ts +6 -0
  66. package/lib/chill-sharp-ui-root.component.d.ts +6 -0
  67. package/lib/chill-sharp-ui-root.component.d.ts.map +1 -0
  68. package/lib/chill-sharp-ui.routes.d.ts +3 -0
  69. package/lib/chill-sharp-ui.routes.d.ts.map +1 -0
  70. package/lib/chill.config.d.ts +5 -0
  71. package/lib/chill.config.d.ts.map +1 -0
  72. package/lib/layouts/auth-shell.component.d.ts +8 -0
  73. package/lib/layouts/auth-shell.component.d.ts.map +1 -0
  74. package/lib/layouts/workspace-page.component.d.ts +49 -0
  75. package/lib/layouts/workspace-page.component.d.ts.map +1 -0
  76. package/lib/lib/chill-form.component.d.ts +151 -0
  77. package/lib/lib/chill-form.component.d.ts.map +1 -0
  78. package/lib/lib/chill-i18n-button-label.component.d.ts +27 -0
  79. package/lib/lib/chill-i18n-button-label.component.d.ts.map +1 -0
  80. package/lib/lib/chill-i18n-label.component.d.ts +30 -0
  81. package/lib/lib/chill-i18n-label.component.d.ts.map +1 -0
  82. package/lib/lib/chill-json-input.component.d.ts +31 -0
  83. package/lib/lib/chill-json-input.component.d.ts.map +1 -0
  84. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-boolean-control.component.d.ts +12 -0
  85. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-boolean-control.component.d.ts.map +1 -0
  86. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-editor-control.component.d.ts +17 -0
  87. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-editor-control.component.d.ts.map +1 -0
  88. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-lookup-control.component.d.ts +45 -0
  89. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-lookup-control.component.d.ts.map +1 -0
  90. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-scalar-control.component.d.ts +19 -0
  91. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-scalar-control.component.d.ts.map +1 -0
  92. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-select-control.component.d.ts +12 -0
  93. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-select-control.component.d.ts.map +1 -0
  94. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-textarea-control.component.d.ts +13 -0
  95. package/lib/lib/chill-polymorphic-input-controls/chill-polymorphic-textarea-control.component.d.ts.map +1 -0
  96. package/lib/lib/chill-polymorphic-input.component.d.ts +452 -0
  97. package/lib/lib/chill-polymorphic-input.component.d.ts.map +1 -0
  98. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-boolean-control.component.d.ts +7 -0
  99. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-boolean-control.component.d.ts.map +1 -0
  100. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-lookup-control.component.d.ts +7 -0
  101. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-lookup-control.component.d.ts.map +1 -0
  102. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-number-control.component.d.ts +7 -0
  103. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-number-control.component.d.ts.map +1 -0
  104. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-temporal-control.component.d.ts +8 -0
  105. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-temporal-control.component.d.ts.map +1 -0
  106. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-value-control.component.d.ts +7 -0
  107. package/lib/lib/chill-polymorphic-output-controls/chill-polymorphic-output-value-control.component.d.ts.map +1 -0
  108. package/lib/lib/chill-polymorphic-output.component.d.ts +75 -0
  109. package/lib/lib/chill-polymorphic-output.component.d.ts.map +1 -0
  110. package/lib/lib/chill-table.component.d.ts +434 -0
  111. package/lib/lib/chill-table.component.d.ts.map +1 -0
  112. package/lib/lib/chill-text-editor-dialog.component.d.ts +14 -0
  113. package/lib/lib/chill-text-editor-dialog.component.d.ts.map +1 -0
  114. package/lib/lib/crud-configuration.utils.d.ts +4 -0
  115. package/lib/lib/crud-configuration.utils.d.ts.map +1 -0
  116. package/lib/lib/culture-name-options.d.ts +3 -0
  117. package/lib/lib/culture-name-options.d.ts.map +1 -0
  118. package/lib/lib/date-format-options.d.ts +3 -0
  119. package/lib/lib/date-format-options.d.ts.map +1 -0
  120. package/lib/lib/iana-time-zone-options.d.ts +3 -0
  121. package/lib/lib/iana-time-zone-options.d.ts.map +1 -0
  122. package/lib/lib/notice-transition.directive.d.ts +17 -0
  123. package/lib/lib/notice-transition.directive.d.ts.map +1 -0
  124. package/lib/lib/schema-property-dialog.component.d.ts +74 -0
  125. package/lib/lib/schema-property-dialog.component.d.ts.map +1 -0
  126. package/lib/models/chill-auth.models.d.ts +176 -0
  127. package/lib/models/chill-auth.models.d.ts.map +1 -0
  128. package/lib/models/chill-menu.models.d.ts +12 -0
  129. package/lib/models/chill-menu.models.d.ts.map +1 -0
  130. package/lib/models/chill-schema.models.d.ts +141 -0
  131. package/lib/models/chill-schema.models.d.ts.map +1 -0
  132. package/lib/models/workspace-dialog.models.d.ts +16 -0
  133. package/lib/models/workspace-dialog.models.d.ts.map +1 -0
  134. package/lib/models/workspace-task.models.d.ts +36 -0
  135. package/lib/models/workspace-task.models.d.ts.map +1 -0
  136. package/lib/pages/confirm-reset-page.component.d.ts +21 -0
  137. package/lib/pages/confirm-reset-page.component.d.ts.map +1 -0
  138. package/lib/pages/crud/attachment-upload-dialog.component.d.ts +24 -0
  139. package/lib/pages/crud/attachment-upload-dialog.component.d.ts.map +1 -0
  140. package/lib/pages/crud/crud-page.component.d.ts +244 -0
  141. package/lib/pages/crud/crud-page.component.d.ts.map +1 -0
  142. package/lib/pages/login-page.component.d.ts +21 -0
  143. package/lib/pages/login-page.component.d.ts.map +1 -0
  144. package/lib/pages/permissions/auth-role-dialog.component.d.ts +29 -0
  145. package/lib/pages/permissions/auth-role-dialog.component.d.ts.map +1 -0
  146. package/lib/pages/permissions/auth-search-select.component.d.ts +28 -0
  147. package/lib/pages/permissions/auth-search-select.component.d.ts.map +1 -0
  148. package/lib/pages/permissions/auth-user-dialog.component.d.ts +35 -0
  149. package/lib/pages/permissions/auth-user-dialog.component.d.ts.map +1 -0
  150. package/lib/pages/permissions/permission-editor.component.d.ts +55 -0
  151. package/lib/pages/permissions/permission-editor.component.d.ts.map +1 -0
  152. package/lib/pages/permissions/permissions-page.component.d.ts +38 -0
  153. package/lib/pages/permissions/permissions-page.component.d.ts.map +1 -0
  154. package/lib/pages/permissions/role-permission.component.d.ts +43 -0
  155. package/lib/pages/permissions/role-permission.component.d.ts.map +1 -0
  156. package/lib/pages/permissions/user-permission.component.d.ts +43 -0
  157. package/lib/pages/permissions/user-permission.component.d.ts.map +1 -0
  158. package/lib/pages/register-page.component.d.ts +24 -0
  159. package/lib/pages/register-page.component.d.ts.map +1 -0
  160. package/lib/pages/reset-password-page.component.d.ts +18 -0
  161. package/lib/pages/reset-password-page.component.d.ts.map +1 -0
  162. package/lib/provide-chill-sharp-ui-core.d.ts +8 -0
  163. package/lib/provide-chill-sharp-ui-core.d.ts.map +1 -0
  164. package/lib/services/chill.service.d.ts +249 -0
  165. package/lib/services/chill.service.d.ts.map +1 -0
  166. package/lib/services/workspace-dialog.service.d.ts +22 -0
  167. package/lib/services/workspace-dialog.service.d.ts.map +1 -0
  168. package/lib/services/workspace-layout.service.d.ts +13 -0
  169. package/lib/services/workspace-layout.service.d.ts.map +1 -0
  170. package/lib/services/workspace-task-registry.service.d.ts +35 -0
  171. package/lib/services/workspace-task-registry.service.d.ts.map +1 -0
  172. package/lib/services/workspace-toolbar.service.d.ts +23 -0
  173. package/lib/services/workspace-toolbar.service.d.ts.map +1 -0
  174. package/lib/services/workspace.service.d.ts +114 -0
  175. package/lib/services/workspace.service.d.ts.map +1 -0
  176. package/lib/storage-keys.d.ts +5 -0
  177. package/lib/storage-keys.d.ts.map +1 -0
  178. package/lib/tasks/crud-task/crud-task.component.d.ts +33 -0
  179. package/lib/tasks/crud-task/crud-task.component.d.ts.map +1 -0
  180. package/lib/tasks/goto-url-task/goto-url-task.component.d.ts +31 -0
  181. package/lib/tasks/goto-url-task/goto-url-task.component.d.ts.map +1 -0
  182. package/lib/workspace/confirm-message-dialog.component.d.ts +16 -0
  183. package/lib/workspace/confirm-message-dialog.component.d.ts.map +1 -0
  184. package/lib/workspace/entity-options-dialog.component.d.ts +29 -0
  185. package/lib/workspace/entity-options-dialog.component.d.ts.map +1 -0
  186. package/lib/workspace/external-task-api.d.ts +2 -0
  187. package/lib/workspace/external-task-api.d.ts.map +1 -0
  188. package/lib/workspace/user-profile-dialog.component.d.ts +30 -0
  189. package/lib/workspace/user-profile-dialog.component.d.ts.map +1 -0
  190. package/lib/workspace/workspace-dialog-host.component.d.ts +26 -0
  191. package/lib/workspace/workspace-dialog-host.component.d.ts.map +1 -0
  192. package/lib/workspace/workspace-menu-item-dialog.component.d.ts +61 -0
  193. package/lib/workspace/workspace-menu-item-dialog.component.d.ts.map +1 -0
  194. package/lib/workspace/workspace-menu.component.d.ts +104 -0
  195. package/lib/workspace/workspace-menu.component.d.ts.map +1 -0
  196. package/lib/workspace/workspace-taskbar.component.d.ts +14 -0
  197. package/lib/workspace/workspace-taskbar.component.d.ts.map +1 -0
  198. package/package.json +54 -0
  199. package/public-api.d.ts +56 -0
  200. package/public-api.d.ts.map +1 -0
  201. package/service-worker/chill-sharp-service-worker.js +166 -0
  202. package/styles/core-theme.scss +1268 -0
  203. package/template-customization/upgrade.ps1.template +342 -0
  204. package/template-customization/upgrade.sh.template +271 -0
@@ -0,0 +1,170 @@
1
+ # CRUD Menu Configuration
2
+
3
+ Versione italiana: [Italiano](../it/UiCore/CRUD.md)
4
+
5
+ Create a menu item with `ComponentName` set to `CRUD`. Its `ComponentConfigurationJson` must be a JSON object; keys are case-insensitive. `chillType` is required. Normally it is the entity Chill type and `chillQuery` is the query Chill type that returns that entity.
6
+
7
+ ```json
8
+ {
9
+ "chillType": "Model.Post",
10
+ "chillQuery": "Query.PostQuery",
11
+ "viewCode": "default",
12
+ "disableAdd": false,
13
+ "disableCreate": false,
14
+ "disableEdit": false,
15
+ "disableInlineEdit": false,
16
+ "disableDelete": false,
17
+ "defaultValues": {},
18
+ "fixedValues": {},
19
+ "fixedQueryValues": {},
20
+ "defaultQueryValues": {},
21
+ "relations": []
22
+ }
23
+ ```
24
+
25
+ ## Options
26
+
27
+ | Key | Type | Default | Effect |
28
+ | --- | --- | --- | --- |
29
+ | `chillType` | string | required | Entity Chill type displayed and edited by the task. |
30
+ | `chillQuery` | string or `null` | `null` | Query Chill type. Configure it when the entity needs a dedicated query. |
31
+ | `viewCode` | string | `default` | Schema view code used for the task. |
32
+ | `disableAdd` | boolean | `false` | Hides the Add command. |
33
+ | `disableCreate` | boolean | `false` | Prevents creating new records. |
34
+ | `disableEdit` | boolean | `false` | Prevents dialog editing. |
35
+ | `disableInlineEdit` | boolean | `false` | Prevents inline table editing. |
36
+ | `disableDelete` | boolean | `false` | Prevents deletion. |
37
+ | `defaultValues` | object | `{}` | Initial values for the create form; users may change them. |
38
+ | `fixedValues` | object | `{}` | Create values made read-only in the form and inline editor. |
39
+ | `fixedQueryValues` | object | `{}` | Mandatory query filters that the user cannot change. |
40
+ | `defaultQueryValues` | object | `{}` | Initial query values the user may change. |
41
+ | `relationLabel` | string or object | omitted | Label for this CRUD when it is opened as a relation. The object form is `{ "labelGuid", "primaryDefaultText", "secondaryDefaultText" }`. |
42
+ | `relations` | array | `[]` | Child CRUD definitions available from each row's action menu. |
43
+
44
+ Unknown JSON properties are retained by the menu editor but are not standard CRUD options.
45
+
46
+ ## Values and relation placeholders
47
+
48
+ Values in the four value objects are JSON values. In a nested relation, a string `@{FieldName}` reads that property from the selected parent row, and `@{mock}` supplies a lightweight entity object for that parent row.
49
+
50
+ ### Which bag is applied, and when
51
+
52
+ There are two independent flows:
53
+
54
+ | Flow | Editable starting values | Values that take precedence |
55
+ | --- | --- | --- |
56
+ | Search/query | `defaultQueryValues` | `fixedQueryValues` |
57
+ | Create entity | `defaultValues` | `fixedValues` |
58
+
59
+ UI Core merges each flow in that order. Therefore, when the same property occurs in both bags, the value in the `fixed...` bag wins. Use only the fixed bag when a value must never be changed; use only the default bag when it is merely a useful starting value.
60
+
61
+ `fixedQueryValues` constrains the records returned by the child CRUD. `fixedValues` constrains the entity sent by the create flow and marks those entity properties read-only in the form and inline editor. The fixed bags are configuration, not a replacement for server-side authorization or validation: the API must still enforce tenant, ownership, and authorization rules.
62
+
63
+ ### Static CLR-compatible values
64
+
65
+ The JSON literal is passed as the property value; UI Core does not evaluate or convert it before normal entity/query serialization. Use the JSON representation that the ChillSharp API expects for the CLR property.
66
+
67
+ ```json
68
+ {
69
+ "defaultQueryValues": {
70
+ "IsPublished": true,
71
+ "MinimumScore": 50,
72
+ "Category": "News",
73
+ "From": "2026-01-01T00:00:00+01:00"
74
+ },
75
+ "fixedValues": {
76
+ "TenantCode": "acme",
77
+ "Priority": 10,
78
+ "IsInternal": false,
79
+ "ArchivedAt": null
80
+ }
81
+ }
82
+ ```
83
+
84
+ Use JSON strings for CLR `string`, `Guid`, `DateTime`, `DateTimeOffset`, `DateOnly`, and enum values when the server exposes those enums as strings. Use JSON numbers for numeric CLR values and JSON booleans for `bool`. Dates and GUIDs must be JSON strings, not JavaScript expressions: `"2026-01-01"` and `"8d0946dc-fc2b-4d95-b5ca-6f12d9618a5b"`, not `new Date(...)` or `Guid.NewGuid()`.
85
+
86
+ ### Static entity-reference values
87
+
88
+ Yes—an entity reference can be static because a JSON object is a permitted value. Supply the same reference shape accepted by the target property, normally at least the referenced entity identifier and type:
89
+
90
+ ```json
91
+ {
92
+ "fixedQueryValues": {
93
+ "Customer": {
94
+ "guid": "8d0946dc-fc2b-4d95-b5ca-6f12d9618a5b",
95
+ "chillType": "Model.Customer"
96
+ }
97
+ },
98
+ "fixedValues": {
99
+ "Status": {
100
+ "guid": "7d8af0dd-d20d-4bb7-9a4d-f3b9d2f9c2b4",
101
+ "chillType": "Model.OrderStatus",
102
+ "label": "Approved"
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ `label` is optional UI metadata. Do not rely on it for identity: `guid` identifies the entity. Include `chillType` when the reference can be polymorphic or when the server/client needs explicit type information. The exact property name and object shape must match the target query or entity schema; a scalar foreign-key property instead needs the scalar GUID string, for example `"CustomerGuid": "8d0946dc-fc2b-4d95-b5ca-6f12d9618a5b"`.
109
+
110
+ ### Dynamic values: `@{FieldName}` and `@{mock}`
111
+
112
+ Placeholders are resolved only while opening a relation from a selected parent row. They are not expressions and are not evaluated in a root menu CRUD, because no parent entity exists there. In that case the original placeholder string remains unchanged.
113
+
114
+ - `@{Guid}` copies the selected row's `Guid`/`guid` value.
115
+ - `@{CustomerCode}` copies a field from the selected row's `properties` object or direct object properties. A camel-case token also falls back to the Pascal-case property name.
116
+ - A missing field resolves to `null`.
117
+ - `@{mock}` creates a lightweight copy of the selected parent entity. It carries its `guid`, `chillType`, `label`, and a copy of its `properties`; it does not fetch the entity again.
118
+
119
+ Use `@{mock}` for a child reference property such as `Order`, and use `@{Guid}` for a scalar foreign key such as `OrderGuid`:
120
+
121
+ ```json
122
+ {
123
+ "relations": [
124
+ {
125
+ "chillType": "Model.OrderRow",
126
+ "chillQuery": "Query.OrderRowQuery",
127
+ "fixedQueryValues": { "Order": "@{mock}" },
128
+ "defaultQueryValues": { "Order": "@{mock}" },
129
+ "fixedValues": { "Order": "@{mock}" },
130
+ "defaultValues": { "Order": "@{mock}" }
131
+ },
132
+ {
133
+ "chillType": "Model.OrderRow",
134
+ "chillQuery": "Query.OrderRowQuery",
135
+ "fixedQueryValues": { "OrderGuid": "@{Guid}" },
136
+ "fixedValues": { "OrderGuid": "@{Guid}" }
137
+ }
138
+ ]
139
+ }
140
+ ```
141
+
142
+ Use the first form only when the query/entity schema exposes an `Order` entity-reference property. Use the second form only when it exposes an `OrderGuid` scalar property. Do not send `@{mock}` to a scalar GUID property.
143
+
144
+ ```json
145
+ {
146
+ "chillType": "Model.Order",
147
+ "chillQuery": "Query.OrderQuery",
148
+ "relations": [
149
+ {
150
+ "chillType": "Model.OrderRow",
151
+ "chillQuery": "Query.OrderRowQuery",
152
+ "relationLabel": {
153
+ "labelGuid": "ORDER-ROWS-LABEL",
154
+ "primaryDefaultText": "Rows",
155
+ "secondaryDefaultText": "Righe"
156
+ },
157
+ "fixedQueryValues": { "Order": "@{mock}" },
158
+ "defaultQueryValues": { "Order": "@{mock}" },
159
+ "defaultValues": { "Order": "@{mock}" },
160
+ "fixedValues": { "Order": "@{mock}" }
161
+ }
162
+ ]
163
+ }
164
+ ```
165
+
166
+ Use `fixedQueryValues` for an unchangeable parent filter and `defaultQueryValues` for an initial editable filter. Use `fixedValues` for a read-only create value and `defaultValues` for an editable create default. Relations can contain further `relations` arrays.
167
+
168
+ ## Persisting the menu entry
169
+
170
+ The menu API stores the JSON as a string. For example, use `ComponentName: "CRUD"` and serialize the object into `ComponentConfigurationJson` when calling `set-menu`. Invalid JSON, or a JSON array instead of an object, cannot configure the task.
@@ -0,0 +1,13 @@
1
+ # ChillSharp UI Core
2
+
3
+ Versione italiana: [Italiano](../it/UiCore/README.md)
4
+
5
+ `@chill-sharp/ui-core` is the shared Angular workspace UI for ChillSharp applications. It supplies the workspace shell, authenticated navigation, schema-driven forms and tables, CRUD tasks, permissions screens, and the menu-task registry. Application repositories keep their tenant branding, routes, runtime configuration, and client-owned extensions outside this package.
6
+
7
+ The package reads schema and menu metadata from the ChillSharp API. The server controls entity metadata and persisted menu entries; the UI Core renders the standard experience from that metadata. Use configuration JSON to tailor an individual menu task without copying shared UI code.
8
+
9
+ ## Guides
10
+
11
+ - [CRUD menu configuration](./CRUD.md): configure a `CRUD` menu item and its JSON options.
12
+ - [Menu guide](../MenuGuide/README.md): persisted menu items and `MenuHierarchy` visibility.
13
+ - [Relation configuration](../MenuGuide/Relations.md): schema relations that UI Core can turn into nested CRUD tasks.
@@ -0,0 +1,117 @@
1
+ # Validation Model
2
+
3
+ Versione italiana: [Italiano](../it/ValidationModel/README.md)
4
+
5
+
6
+ ChillSharp supports the standard ASP.NET Core / .NET validation attributes on entity and query properties, as long as those properties are also marked with `[ChillProperty]`.
7
+
8
+ ## Standard validation on Chill properties
9
+
10
+ Decorate your `ChillEntity` or `ChillQuery` properties with both `[ChillProperty]` and the usual DataAnnotations attributes such as `[Required]`, `[StringLength]`, `[Range]`, `[EmailAddress]`, and so on.
11
+
12
+ ```csharp
13
+ using ChillSharp.Annotations;
14
+ using ChillSharp.EF;
15
+ using System.ComponentModel.DataAnnotations;
16
+
17
+ public class Customer : ChillEntity
18
+ {
19
+ [Key]
20
+ public override Guid Guid { get; set; }
21
+
22
+ [ChillProperty(
23
+ UniquePropertyKeyString: "2F262D7E-F676-4857-B41D-D31C766AA38F",
24
+ PrimaryLanguageLabel: "Name",
25
+ SecondaryLanguageLabel: "Nome")]
26
+ [Required(ErrorMessage = "Customer name is required.")]
27
+ [StringLength(80, ErrorMessage = "Customer name must be 80 characters or less.")]
28
+ public string Name { get; set; } = string.Empty;
29
+ }
30
+ ```
31
+
32
+ At runtime ChillSharp validates only the properties decorated with `[ChillProperty]`.
33
+
34
+ If a property has DataAnnotations attributes but is not a Chill property, ChillSharp ignores it in the Chill validation pipeline.
35
+
36
+ ## Combining DataAnnotations with `OnValidation()`
37
+
38
+ You can still add custom ChillSharp validation by overriding `OnValidation()`.
39
+
40
+ ```csharp
41
+ public override IEnumerable<ChillValidationError> OnValidation(IChillContext context)
42
+ {
43
+ if (Name == "admin")
44
+ {
45
+ return
46
+ [
47
+ new ChillValidationError
48
+ {
49
+ FieldName = nameof(Name),
50
+ Message = "The name 'admin' is reserved."
51
+ }
52
+ ];
53
+ }
54
+
55
+ return [];
56
+ }
57
+ ```
58
+
59
+ Runtime behavior is:
60
+
61
+ 1. ChillSharp runs standard DataAnnotations validation on `[ChillProperty]` members.
62
+ 2. ChillSharp then runs your custom `OnValidation()` logic.
63
+ 3. The returned errors are exposed as `ChillValidationError` using the human-readable DataAnnotations `ErrorMessage`.
64
+
65
+ ## Update behavior
66
+
67
+ The same validation pipeline also runs automatically at the beginning of the internal post-update runtime hook used by ChillSharp.
68
+
69
+ This means:
70
+
71
+ - If the client calls validation explicitly, it receives `ChillValidationError` entries for annotation-based and custom validation errors.
72
+ - If the client skips explicit validation and goes directly to create or update, ChillSharp still validates the entity during the update lifecycle and throws a `ChillValidationException` with the same human-readable messages.
73
+
74
+ ## Notes
75
+
76
+ - Use standard DataAnnotations for simple field rules.
77
+ - Use `OnValidation()` for rules that depend on multiple fields, business logic, or database lookups.
78
+ - To make a property part of ChillSharp validation, always add `[ChillProperty]`.
79
+
80
+ ## Appendix: GUID-based validation messages
81
+
82
+ As an optional flexibility hack, a DataAnnotations `ErrorMessage` can contain a GUID string instead of final user text.
83
+
84
+ Then you can provide the actual primary and secondary texts by overriding `GetValidationMessageDefinitions()`.
85
+
86
+ ```csharp
87
+ public class Customer : ChillEntity
88
+ {
89
+ [ChillProperty(
90
+ UniquePropertyKeyString: "B2AB35A8-6A89-4D39-8F1D-183F686811A9",
91
+ PrimaryLanguageLabel: "Code",
92
+ SecondaryLanguageLabel: "Codice")]
93
+ [Required(ErrorMessage = "4F880CC1-5C7A-4E23-982A-5F0C490B44DE")]
94
+ public string Code { get; set; } = string.Empty;
95
+
96
+ public override IEnumerable<ChillValidationMessageDefinition> GetValidationMessageDefinitions(IChillContext context)
97
+ {
98
+ return
99
+ [
100
+ new ChillValidationMessageDefinition
101
+ {
102
+ MessageGuid = Guid.Parse("4F880CC1-5C7A-4E23-982A-5F0C490B44DE"),
103
+ PrimaryLanguageMessage = "Code is required.",
104
+ SecondaryLanguageMessage = "Il codice e obbligatorio."
105
+ }
106
+ ];
107
+ }
108
+ }
109
+ ```
110
+
111
+ When ChillSharp sees that GUID in `ErrorMessage`, it resolves the final message through the same primary/secondary language convention used elsewhere in ChillSharp metadata.
112
+
113
+ Notes:
114
+
115
+ - This is optional. Plain human-readable `ErrorMessage` values still work normally.
116
+ - Use this only when you want a stable identifier for a validation text.
117
+ - If the GUID is not found in `GetValidationMessageDefinitions()`, ChillSharp falls back to the raw `ErrorMessage` string.
@@ -0,0 +1,185 @@
1
+ # Guida allo sviluppo assistito dall'intelligenza artificiale
2
+
3
+ Versione originale in inglese: [English](../../AIAssistedDevelopment/README.md)
4
+
5
+
6
+ Questo documento spiega come ChillSharp può aiutarti quando crei software con l'assistenza dell'intelligenza artificiale e desideri comunque che la base di codice rimanga strutturata, stabile e rivedibile.
7
+
8
+ L’idea chiave è semplice: gli strumenti di intelligenza artificiale sono molto più affidabili quando funzionano all’interno di un’architettura vincolata, ripetitiva e ben definita rispetto a quando viene chiesto loro di mantenere manualmente sincronizzati molti controller, DTO, endpoint e percorsi di convalida.
9
+
10
+ ChillSharp non corregge automaticamente il codice generato dall'intelligenza artificiale. Ciò che fa è ridurre la quantità di superficie che l’intelligenza artificiale deve generare e mantenere.
11
+
12
+ ## Perché è importante
13
+
14
+ Una modalità di errore comune nello sviluppo backend assistito dall'intelligenza artificiale è che il modello tocca troppe parti mobili contemporaneamente:
15
+
16
+ - controllori
17
+ - Mappature DTO
18
+ - contratti di richiesta/risposta
19
+ - logica di validazione
20
+ - controlli autorizzativi
21
+ - comportamenti CRUD duplicati
22
+
23
+ Maggiore è il numero di file ed endpoint personalizzati di cui disponi, più facile sarà per l'intelligenza artificiale introdurre derive accidentali dell'interfaccia, comportamenti incoerenti o refactoring ampi che non erano mai stati previsti.
24
+
25
+ ChillSharp riduce tale rischio spostando gran parte della superficie backend in un runtime uniforme basato su modello.
26
+
27
+ ## In che modo ChillSharp aiuta
28
+
29
+ ### 1. La logica aziendale cresce all'interno di un ambiente strutturato
30
+
31
+ Con ChillSharp, i principali punti di estensione sono espliciti e prevedibili:
32
+
33
+ -
34
+ -
35
+ -
36
+ - Hook del ciclo di vita come `OnCreate()`, `OnUpdate()`, `OnAfterUpdate()`, `OnDelete()` e `OnSelect()`
37
+ - metadati tramite `[ChillProperty]` e relative annotazioni
38
+
39
+ Ciò offre all’intelligenza artificiale uno spazio più ristretto e strutturato per apportare modifiche.
40
+
41
+ Invece di chiedere a un modello di intelligenza artificiale di inventare ancora un altro controller, richiedere DTO, risposta DTO, mappatore, validatore e contratto di instradamento, spesso puoi chiedergli di:
42
+
43
+ - aggiungi una proprietà
44
+ - aggiungere la convalida
45
+ - aggiungi un filtro di query
46
+ - aggiungere la logica del ciclo di vita
47
+ - modificare le regole di autorizzazione
48
+
49
+ Questo di solito produce modifiche più piccole e più sicure.
50
+
51
+ ### 2. Riduzione del rischio di refactoring accidentale degli endpoint
52
+
53
+ ChillSharp espone una superficie API standard tramite `app.MapChillApi()`, con operazioni stabili come:
54
+
55
+ -
56
+ -
57
+ -
58
+ -
59
+ -
60
+ -
61
+
62
+ Poiché la superficie di trasporto è centralizzata, l’aggiunta o l’evoluzione delle entità aziendali non richiede che l’intelligenza artificiale continui a riscrivere un insieme crescente di controller per entità e definizioni di percorso.
63
+
64
+ Ciò riduce un rischio specifico dell’IA:
65
+
66
+ - modifica accidentale dei nomi degli endpoint
67
+ - modifica delle forme del carico utile in modo incoerente
68
+ - implementare un endpoint in modo diverso dagli altri
69
+ - interrompere i client attraverso refactoring API non necessari
70
+
71
+ L'interfaccia continua ad evolversi insieme al modello, ma il CRUD e i meccanismi di query non devono essere riprodotti ogni volta.
72
+
73
+ ### 3. Gli endpoint crescono in modo uniforme
74
+
75
+ In un backend tradizionale scritto a mano, ogni nuova entità tende a creare codice API più duplicato. Nel tempo si accumulano piccole differenze:
76
+
77
+ - Un controller convalida in modo diverso
78
+ - un altro controller restituisce payload leggermente diversi
79
+ - Un altro endpoint dimentica un controllo di autorizzazione
80
+ - Un altro mappatore DTO omette un campo
81
+
82
+ Gli strumenti di intelligenza artificiale amplificano questo problema perché continuano il modello locale che vedono, anche quando il modello locale è già incoerente.
83
+
84
+ ChillSharp spinge il sistema nella direzione opposta: entità e query si collegano allo stesso modello di runtime, quindi la crescita è più uniforme per impostazione predefinita.
85
+
86
+ Questa uniformità aiuta entrambi:
87
+
88
+ - manutentori umani che esaminano i cambiamenti prodotti dall'intelligenza artificiale
89
+ - Strumenti di intelligenza artificiale che ragionano sulla base di codice con meno ambiguità
90
+
91
+ ### 4. Carico utile del programma ridotto per gli strumenti di intelligenza artificiale
92
+
93
+ Quando un progetto si basa su molti controller CRUD personalizzati, classi DTO, livelli di mappatura e definizioni di endpoint ripetitive, l'intelligenza artificiale ha bisogno di più contesto di repository per apportare una modifica sicura.
94
+
95
+ Ciò aumenta:
96
+
97
+ - utilizzo dei gettoni
98
+ - latenza
99
+ - costo
100
+ - la possibilità che il modello manchi uno dei livelli duplicati
101
+
102
+ ChillSharp riduce questo onere poiché gran parte della logica di trasporto ripetitiva è già gestita dal runtime del framework.
103
+
104
+ In pratica ciò significa che un compito dell’intelligenza artificiale può spesso essere risolto leggendo e modificando:
105
+
106
+ - un'entità
107
+ - una domanda
108
+ - una regola di convalida
109
+ - una definizione di autorizzazione
110
+
111
+ invece di una lunga catena di file correlati.
112
+
113
+ ### 5. Abbassare la pressione per il refactoring continuo su larga scala
114
+
115
+ Senza una struttura basata su modelli, i team spesso chiedono all'IA di continuare a eseguire il refactoring di un elenco crescente di:
116
+
117
+ - endpoint
118
+ - controllori
119
+ - DTO
120
+ - validatori
121
+ - mappatori
122
+ - controlli dei permessi
123
+
124
+ Questo è costoso e fragile. Incoraggia inoltre ampie riscritture automatizzate che potrebbero non fornire valore aziendale.
125
+
126
+ ChillSharp riduce la necessità di questo stile di manutenzione perché la superficie CRUD/query generica è già centralizzata.
127
+
128
+ Ciò ha vantaggi pratici:
129
+
130
+ - minor consumo di token AI
131
+ - Meno refactoring ampi su file ripetitivi
132
+ - minore sforzo di revisione per il codice generato
133
+ - minore utilizzo del calcolo per la stessa funzionalità
134
+
135
+ Se ti interessano sia l'efficienza ingegneristica che l'efficienza energetica, questo è uno degli argomenti più forti per l'utilizzo di un runtime uniforme invece di una grande quantità di standard endpoint ripetuti.
136
+
137
+ ## In cosa è bravo ChillSharp nei flussi di lavoro AI
138
+
139
+ ChillSharp è una buona soluzione quando vuoi che l'intelligenza artificiale ti aiuti con:
140
+
141
+ - estensione delle entità di dominio
142
+ - aggiunta di regole di convalida
143
+ - aggiunta di funzionalità di query
144
+ - esposizione delle modifiche al modello attraverso una superficie API generica esistente
145
+ - mantenere autorizzazioni e metadati più vicini al modello
146
+
147
+ Questo di solito è una soluzione migliore rispetto a chiedere all’IA di generare ripetutamente grandi set di codice dell’infrastruttura CRUD.
148
+
149
+ ## Cosa ChillSharp non risolve
150
+
151
+ ChillSharp non elimina la necessità di revisione tecnica. In particolare è necessario ancora verificare:
152
+
153
+ - Le regole aziendali sono corrette
154
+ - le regole di autorizzazione sono corrette
155
+ - le proprietà esposte sono intenzionali
156
+ - I cambiamenti di modello non distruggono i consumatori
157
+ - La logica del ciclo di vita generata dall'intelligenza artificiale è effettivamente sicura
158
+
159
+ ChillSharp riduce la duplicazione e la deriva. Non elimina la necessità del giudizio.
160
+
161
+ ## Posizionamento consigliato
162
+
163
+ Se desideri un modo breve e difendibile per descriverlo nella documentazione o nelle note sull'architettura, usa qualcosa come:
164
+
165
+ "ChillSharp aiuta lo sviluppo assistito dall'intelligenza artificiale centralizzando i meccanismi API ripetitivi in ​​un runtime basato su modello. Ciò riduce la deviazione accidentale dell'interfaccia, mantiene il comportamento degli endpoint più uniforme e riduce la quantità di codice e contesto del repository che gli strumenti di intelligenza artificiale devono generare e mantenere."
166
+
167
+ ## Lista di controllo pratica
168
+
169
+ Se desideri utilizzare ChillSharp come architettura backend compatibile con l'intelligenza artificiale, la linea di base è:
170
+
171
+ 1. mantenere le entità aziendali e le query come il luogo principale in cui viene definito il comportamento delle funzionalità
172
+ 2. utilizzare `[ChillProperty]` in modo coerente in modo che il DTO e la superficie di convalida rimangano intenzionali
173
+ 3. preferire `OnValidation()` e gli hook del ciclo di vita rispetto alla logica del controller ad hoc
174
+ 4. evitare di reintrodurre endpoint CRUD personalizzati ripetitivi a meno che non ce ne sia una reale necessità
175
+ 5. esaminare attentamente le modifiche al modello poiché una superficie basata su modello può influire su più operazioni client contemporaneamente
176
+ 6. mantenere le autorizzazioni e l'autenticazione allineate con lo stesso approccio basato sul modello
177
+
178
+ ## Documenti correlati
179
+
180
+ - [../README.md](../README.md)
181
+ - [../RegisterContext.md](../RegisterContext.md)
182
+ - [../ValidationModel/README.md](../ValidationModel/README.md)
183
+ - [../PermissionModel/README.md](../PermissionModel/README.md)
184
+ - [../AuthenticationModel/README.md](../AuthenticationModel/README.md)
185
+ - [../ClientGeneration/README.md](../ClientGeneration/README.md)
@@ -0,0 +1,173 @@
1
+ # Modulo allegati
2
+
3
+ Versione originale in inglese: [English](../../AttachmentModel/README.md)
4
+
5
+
6
+ `ChillSharp.Attachment` aggiunge un'entità di allegato incorporata oltre a endpoint di caricamento e download supportati da un archivio di file system.
7
+
8
+ ## Cosa aggiunge
9
+
10
+ - L'entità `Attachment` è persistita nella tabella `attachment`
11
+ - supporto generico Chill CRUD per i metadati degli allegati
12
+ -
13
+ -
14
+
15
+ Poiché `Attachment` è un vero `ChillEntity`, viene esposto anche tramite il rilevamento dello schema e può essere gestito tramite gli endpoint Chill CRUD standard una volta che l'host `DbContext` implementa `IChillAttachmentDbContext`.
16
+
17
+ Il modulo espone anche un tipo di query `AttachmentQuery` Chill, che gli helper client possono utilizzare per elencare gli allegati collegati a un'entità di destinazione.
18
+
19
+ ## Registra il modulo
20
+
21
+ Aggiungi il modello del modulo al tuo contesto ed esponi `DbSet`:
22
+
23
+ ```csharp
24
+ using ChillSharp.Attachment;
25
+ using ChillSharp.Attachment.Model;
26
+
27
+ public class AppDbContext : DbContext, IChillContext, IChillAttachmentDbContext
28
+ {
29
+ public DbSet<Attachment> Attachments => Set<Attachment>();
30
+
31
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
32
+ {
33
+ base.OnModelCreating(modelBuilder);
34
+ modelBuilder.AddChillAttachmentModel();
35
+ }
36
+
37
+ public string GetChillTypePrefix() => "MyApp.Data";
38
+ }
39
+ ```
40
+
41
+ Quando il contesto implementa `IChillAttachmentDbContext`, `services.AddChillApi<AppDbContext>()` registra automaticamente gli endpoint dell'allegato.
42
+
43
+ ## Configurazione della radice dell'archivio
44
+
45
+ Il modulo legge la radice dell'archivio da:
46
+
47
+ - opzioni di avvio tramite `services.Configure<ChillAttachmentOptions>(...)`
48
+ - variabile d'ambiente `CHILLSHARP_ATTACHMENT_ARCHIVE_ROOT`
49
+
50
+ Esempio:
51
+
52
+ ```csharp
53
+ builder.Services.Configure<ChillAttachmentOptions>(options =>
54
+ {
55
+ options.ArchiveRoot = "/srv/chill/attachments";
56
+ });
57
+ ```
58
+
59
+ O attraverso l'ambiente:
60
+
61
+ ```env
62
+ CHILLSHARP_ATTACHMENT_ARCHIVE_ROOT=/srv/chill/attachments
63
+ ```
64
+
65
+ ## Disposizione dell'archivio
66
+
67
+ I file vengono archiviati nella root dell'archivio configurata utilizzando:
68
+
69
+ ```csharp
70
+ public static string BuildAttachmentPath(
71
+ string archiveRoot,
72
+ string attachToChillType,
73
+ Guid id,
74
+ string extension,
75
+ DateTime createdAtUtc)
76
+ ```
77
+
78
+ La disposizione risultante è:
79
+
80
+ ```text
81
+ {archiveRoot}/{attachToChillType}/{year}/{guid[0..2]}/{guid[2..4]}/{guid}{extension}
82
+ ```
83
+
84
+ Esempio:
85
+
86
+ ```text
87
+ /srv/chill/attachments/Post/2026/ab/cd/abcd1234....pdf
88
+ ```
89
+
90
+ ## Carica endpoint
91
+
92
+
93
+
94
+ Campi modulo multiparte:
95
+
96
+ -
97
+ -
98
+ -
99
+ -
100
+ -
101
+ - una o più parti `file`
102
+
103
+ Per ogni file caricato il modulo:
104
+
105
+ 1. crea un'entità Chill `Attachment` tramite `ChillEngine`
106
+ 2. memorizza il file fisico nell'archivio
107
+ 3. restituisce il payload DTO dell'allegato creato
108
+
109
+ ## Scarica l'endpoint
110
+
111
+
112
+
113
+ Comportamento:
114
+
115
+ - carica l'entità `Attachment` dal database
116
+ - risolve il percorso del file archiviato
117
+ - restituisce il file utilizzando il nome file originale memorizzato e il tipo MIME
118
+ - consente il download anonimo quando `Public == true`
119
+ - richiede un utente autenticato quando `Public == false`
120
+
121
+ ## Aiutanti del cliente
122
+
123
+ ### `.NET`
124
+
125
+ `ChillSharp.Client` ora include gli aiutanti per gli allegati:
126
+
127
+ ```csharp
128
+ var post = new ChillDtoEntity
129
+ {
130
+ Guid = postGuid,
131
+ ChillType = "Model.Post"
132
+ };
133
+
134
+ var uploaded = await client.UploadAttachmentAsync(
135
+ post,
136
+ File.ReadAllBytes("contract.pdf"),
137
+ "contract.pdf",
138
+ "application/pdf",
139
+ title: "Signed contract",
140
+ description: "Customer-facing version",
141
+ isPublic: false);
142
+
143
+ var attachments = await client.GetAttachmentsAsync(post);
144
+ var fileBytes = await client.DownloadAttachmentAsync(uploaded[0]);
145
+ ```
146
+
147
+ I sovraccarichi disponibili coprono:
148
+
149
+ - caricare dal percorso del file
150
+ - caricamento da `byte[]`
151
+ - caricamento da `Stream`
152
+ - scaricabile tramite allegato `Guid`
153
+ - scaricabile tramite allegato `ChillDtoEntity`
154
+
155
+ ### TypeScript / Angular / React / Vue / Python
156
+
157
+ Le librerie client generiche in `extra-libs/` espongono gli helper corrispondenti:
158
+
159
+ - TypeScript: `uploadAttachment()`, `uploadAttachments()`, `getAttachments()`, `downloadAttachment()`
160
+ - Angolare: stessi helper tramite `ChillSharpNgClient` dei wrapper `Observable`
161
+ - React e Vue: stessi helper tramite il client raw restituito da `useChillSharpClient()`
162
+ - Python: `upload_attachment()`, `upload_attachments()`, `get_attachments()`, `download_attachment()`
163
+
164
+ ##CRUD generico
165
+
166
+ I metadati degli allegati rimangono disponibili tramite gli endpoint Chill standard:
167
+
168
+ -
169
+ -
170
+ -
171
+ -
172
+
173
+ L'eliminazione di un allegato tramite ChillSharp rimuove anche il file archiviato dal disco.