adula 2.1.0 → 2.3.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.
Files changed (269) hide show
  1. package/README.md +149 -18
  2. package/build/agent/AGENTS.template.md +4 -4
  3. package/build/agent/capabilities.md +22 -12
  4. package/build/agent/skills/adula-frontend-design/SKILL.md +6 -4
  5. package/build/agent/skills/idea-review/SKILL.md +2 -2
  6. package/build/commands/adula_assistant_prune.d.ts +10 -0
  7. package/build/commands/adula_assistant_prune.js +12 -0
  8. package/build/commands/adula_outbox.d.ts +10 -0
  9. package/build/commands/adula_outbox.js +11 -0
  10. package/build/commands/adula_restore_reconcile.d.ts +10 -0
  11. package/build/commands/adula_restore_reconcile.js +34 -0
  12. package/build/commands/adula_runtime_health.d.ts +10 -0
  13. package/build/commands/adula_runtime_health.js +27 -0
  14. package/build/commands/adula_uploads_prune.d.ts +10 -0
  15. package/build/commands/adula_uploads_prune.js +16 -0
  16. package/build/commands/app.d.ts +10 -0
  17. package/build/commands/app.js +64 -0
  18. package/build/commands/backup_create.d.ts +11 -0
  19. package/build/commands/backup_create.js +99 -0
  20. package/build/commands/backup_open.d.ts +16 -0
  21. package/build/commands/backup_open.js +48 -0
  22. package/build/commands/backup_restore_files.d.ts +11 -0
  23. package/build/commands/backup_restore_files.js +44 -0
  24. package/build/commands/backup_restore_test.d.ts +12 -0
  25. package/build/commands/backup_restore_test.js +188 -0
  26. package/build/commands/backup_seal.d.ts +12 -0
  27. package/build/commands/backup_seal.js +36 -0
  28. package/build/commands/backup_services.d.ts +33 -0
  29. package/build/commands/backup_services.js +6 -0
  30. package/build/commands/backup_verify.d.ts +9 -0
  31. package/build/commands/backup_verify.js +59 -0
  32. package/build/commands/backup_verify_snapshot.d.ts +10 -0
  33. package/build/commands/backup_verify_snapshot.js +37 -0
  34. package/build/commands/client.d.ts +16 -0
  35. package/build/commands/client.js +71 -0
  36. package/build/commands/doctor.js +21 -1
  37. package/build/commands/install.d.ts +8 -0
  38. package/build/commands/install.js +69 -45
  39. package/build/commands/main.d.ts +3 -2
  40. package/build/commands/main.js +32 -0
  41. package/build/commands/module_add.js +4 -20
  42. package/build/commands/resource.d.ts +2 -0
  43. package/build/commands/resource.js +12 -3
  44. package/build/commands/resource_migration.d.ts +15 -0
  45. package/build/commands/resource_migration.js +81 -0
  46. package/build/commands/resource_snapshot.d.ts +2 -0
  47. package/build/commands/resource_snapshot.js +21 -4
  48. package/build/commands/sla_evaluate.d.ts +14 -0
  49. package/build/commands/sla_evaluate.js +16 -0
  50. package/build/commands/ui.js +4 -2
  51. package/build/commands/ui_css.d.ts +9 -0
  52. package/build/commands/ui_css.js +19 -0
  53. package/build/commands/upgrade.d.ts +1 -1
  54. package/build/commands/upgrade.js +1 -1
  55. package/build/configure.js +1 -1
  56. package/build/database/migrations/1770000000020_two_factor.d.ts +5 -0
  57. package/build/database/migrations/1770000000020_two_factor.js +10 -0
  58. package/build/database/migrations/1770000000041_import_modes.d.ts +5 -0
  59. package/build/database/migrations/1770000000041_import_modes.js +10 -0
  60. package/build/database/migrations/1770000000042_sync_jobs.d.ts +5 -0
  61. package/build/database/migrations/1770000000042_sync_jobs.js +10 -0
  62. package/build/database/migrations/1770000000043_notification_channels.d.ts +5 -0
  63. package/build/database/migrations/1770000000043_notification_channels.js +10 -0
  64. package/build/database/migrations/1770000000044_channel_confirmations.d.ts +5 -0
  65. package/build/database/migrations/1770000000044_channel_confirmations.js +10 -0
  66. package/build/database/migrations/1770000000045_import_leases.d.ts +5 -0
  67. package/build/database/migrations/1770000000045_import_leases.js +10 -0
  68. package/build/database/migrations/1770000000046_workflow_delegation_sla.d.ts +5 -0
  69. package/build/database/migrations/1770000000046_workflow_delegation_sla.js +10 -0
  70. package/build/database/migrations/1770000000049_print_templates.d.ts +5 -0
  71. package/build/database/migrations/1770000000049_print_templates.js +10 -0
  72. package/build/database/migrations/1770000000051_comment_notifications.d.ts +5 -0
  73. package/build/database/migrations/1770000000051_comment_notifications.js +10 -0
  74. package/build/database/migrations/1770000000054_cloud_backups.d.ts +5 -0
  75. package/build/database/migrations/1770000000054_cloud_backups.js +10 -0
  76. package/build/database/migrations/1770000000055_ai_assistant.d.ts +5 -0
  77. package/build/database/migrations/1770000000055_ai_assistant.js +10 -0
  78. package/build/database/migrations/1770000000056_appearance.d.ts +5 -0
  79. package/build/database/migrations/1770000000056_appearance.js +10 -0
  80. package/build/index.d.ts +87 -11
  81. package/build/index.js +50 -7
  82. package/build/providers/adula_provider.d.ts +2 -0
  83. package/build/providers/adula_provider.js +7 -0
  84. package/build/src/admin/contracts.js +1 -1
  85. package/build/src/admin/controller.d.ts +14 -1
  86. package/build/src/admin/controller.js +91 -13
  87. package/build/src/admin/errors.d.ts +32 -0
  88. package/build/src/admin/errors.js +63 -1
  89. package/build/src/admin/presentation.d.ts +21 -2
  90. package/build/src/admin/resource/editor.d.ts +60 -0
  91. package/build/src/admin/resource/editor.js +345 -0
  92. package/build/src/admin/resource/export.d.ts +54 -0
  93. package/build/src/admin/resource/export.js +262 -0
  94. package/build/src/admin/resource/lifecycle.d.ts +23 -0
  95. package/build/src/admin/resource/lifecycle.js +91 -0
  96. package/build/src/admin/resource/query.d.ts +111 -0
  97. package/build/src/admin/resource/query.js +595 -0
  98. package/build/src/admin/resource/read.d.ts +109 -0
  99. package/build/src/admin/resource/read.js +388 -0
  100. package/build/src/admin/resource/shared.d.ts +93 -0
  101. package/build/src/admin/resource/shared.js +265 -0
  102. package/build/src/admin/resource/trash.d.ts +10 -0
  103. package/build/src/admin/resource/trash.js +56 -0
  104. package/build/src/admin/resource/write.d.ts +57 -0
  105. package/build/src/admin/resource/write.js +603 -0
  106. package/build/src/admin/resource_service.d.ts +80 -193
  107. package/build/src/admin/resource_service.js +81 -1343
  108. package/build/src/admin/resource_tools.d.ts +111 -0
  109. package/build/src/admin/resource_tools.js +139 -0
  110. package/build/src/ai/assistant.d.ts +100 -0
  111. package/build/src/ai/assistant.js +487 -0
  112. package/build/src/ai/client.d.ts +49 -0
  113. package/build/src/ai/client.js +85 -0
  114. package/build/src/ai/prompt.d.ts +23 -0
  115. package/build/src/ai/prompt.js +83 -0
  116. package/build/src/ai/settings.d.ts +56 -0
  117. package/build/src/ai/settings.js +214 -0
  118. package/build/src/ai/usage.d.ts +16 -0
  119. package/build/src/ai/usage.js +33 -0
  120. package/build/src/appearance/appearance.d.ts +134 -0
  121. package/build/src/appearance/appearance.js +461 -0
  122. package/build/src/appearance/colors.d.ts +43 -0
  123. package/build/src/appearance/colors.js +99 -0
  124. package/build/src/appearance/logo.d.ts +32 -0
  125. package/build/src/appearance/logo.js +112 -0
  126. package/build/src/attachments/attachment_service.d.ts +46 -2
  127. package/build/src/attachments/attachment_service.js +96 -4
  128. package/build/src/auth/actor_store.d.ts +5 -1
  129. package/build/src/auth/actor_store.js +8 -4
  130. package/build/src/auth/conditions.d.ts +5 -0
  131. package/build/src/auth/conditions.js +26 -3
  132. package/build/src/auth/sql.js +17 -5
  133. package/build/src/auth/two_factor.d.ts +96 -0
  134. package/build/src/auth/two_factor.js +259 -0
  135. package/build/src/backups/archive.d.ts +52 -0
  136. package/build/src/backups/archive.js +362 -0
  137. package/build/src/backups/cloud_backups.d.ts +133 -0
  138. package/build/src/backups/cloud_backups.js +650 -0
  139. package/build/src/backups/doctor.d.ts +7 -0
  140. package/build/src/backups/doctor.js +55 -0
  141. package/build/src/backups/providers.d.ts +81 -0
  142. package/build/src/backups/providers.js +470 -0
  143. package/build/src/collaboration/assignments.d.ts +59 -2
  144. package/build/src/collaboration/assignments.js +196 -74
  145. package/build/src/collaboration/record_collaboration.d.ts +21 -4
  146. package/build/src/collaboration/record_collaboration.js +126 -51
  147. package/build/src/collaboration/shared.d.ts +24 -0
  148. package/build/src/collaboration/shared.js +34 -0
  149. package/build/src/commands/app_scaffold.d.ts +72 -0
  150. package/build/src/commands/app_scaffold.js +285 -0
  151. package/build/src/commands/capabilities.js +35 -9
  152. package/build/src/commands/doctor.d.ts +24 -2
  153. package/build/src/commands/doctor.js +81 -6
  154. package/build/src/commands/gap_report.d.ts +1 -1
  155. package/build/src/commands/gap_report.js +2 -2
  156. package/build/src/commands/generator.d.ts +37 -1
  157. package/build/src/commands/generator.js +61 -18
  158. package/build/src/commands/snapshot.d.ts +24 -13
  159. package/build/src/commands/snapshot.js +54 -14
  160. package/build/src/commands/source_markers.d.ts +10 -0
  161. package/build/src/commands/source_markers.js +29 -0
  162. package/build/src/core/activity.d.ts +2 -0
  163. package/build/src/core/activity.js +7 -1
  164. package/build/src/core/administrators.d.ts +38 -0
  165. package/build/src/core/administrators.js +145 -0
  166. package/build/src/core/avatar_image.d.ts +33 -0
  167. package/build/src/core/avatar_image.js +278 -0
  168. package/build/src/core/html_sanitizer.d.ts +20 -0
  169. package/build/src/core/html_sanitizer.js +261 -0
  170. package/build/src/core/like.d.ts +5 -0
  171. package/build/src/core/like.js +5 -0
  172. package/build/src/core/lookups.d.ts +80 -0
  173. package/build/src/core/lookups.js +319 -0
  174. package/build/src/core/mail_settings.d.ts +83 -0
  175. package/build/src/core/mail_settings.js +274 -0
  176. package/build/src/core/mail_test.d.ts +16 -0
  177. package/build/src/core/mail_test.js +81 -6
  178. package/build/src/core/message_templates.d.ts +15 -2
  179. package/build/src/core/message_templates.js +81 -11
  180. package/build/src/core/module_seed.js +2 -1
  181. package/build/src/core/notification_channels.d.ts +235 -0
  182. package/build/src/core/notification_channels.js +660 -0
  183. package/build/src/core/roles.js +26 -9
  184. package/build/src/core/saved_views.d.ts +8 -1
  185. package/build/src/core/saved_views.js +91 -26
  186. package/build/src/core/sequences.d.ts +32 -0
  187. package/build/src/core/sequences.js +97 -0
  188. package/build/src/core/settings.d.ts +5 -0
  189. package/build/src/core/settings.js +31 -3
  190. package/build/src/core/template_language.d.ts +61 -0
  191. package/build/src/core/template_language.js +141 -0
  192. package/build/src/core/ui_preferences.d.ts +10 -0
  193. package/build/src/core/ui_preferences.js +15 -1
  194. package/build/src/core/user_avatars.d.ts +79 -0
  195. package/build/src/core/user_avatars.js +186 -0
  196. package/build/src/core/user_invitations.d.ts +5 -1
  197. package/build/src/core/user_invitations.js +7 -1
  198. package/build/src/core/user_preferences.d.ts +36 -0
  199. package/build/src/core/user_preferences.js +125 -0
  200. package/build/src/core/users.d.ts +2 -0
  201. package/build/src/core/users.js +5 -3
  202. package/build/src/database/calendar_days.d.ts +19 -0
  203. package/build/src/database/calendar_days.js +36 -0
  204. package/build/src/database/schema.d.ts +201 -2
  205. package/build/src/database/schema.js +713 -59
  206. package/build/src/database/schema_diff.d.ts +70 -0
  207. package/build/src/database/schema_diff.js +190 -0
  208. package/build/src/events/record_mutation.d.ts +2 -1
  209. package/build/src/events/record_mutation.js +1 -0
  210. package/build/src/integrations/api_client.d.ts +37 -0
  211. package/build/src/integrations/api_client.js +567 -0
  212. package/build/src/integrations/import_adapters.d.ts +37 -0
  213. package/build/src/integrations/import_adapters.js +35 -0
  214. package/build/src/integrations/imports.d.ts +130 -16
  215. package/build/src/integrations/imports.js +434 -73
  216. package/build/src/integrations/openapi.d.ts +3 -1
  217. package/build/src/integrations/openapi.js +465 -31
  218. package/build/src/integrations/outbound.d.ts +94 -0
  219. package/build/src/integrations/outbound.js +276 -0
  220. package/build/src/integrations/print.d.ts +22 -1
  221. package/build/src/integrations/print.js +68 -22
  222. package/build/src/integrations/print_templates.d.ts +216 -0
  223. package/build/src/integrations/print_templates.js +1017 -0
  224. package/build/src/integrations/sync_jobs.d.ts +139 -0
  225. package/build/src/integrations/sync_jobs.js +416 -0
  226. package/build/src/integrations/webhooks.d.ts +12 -12
  227. package/build/src/integrations/webhooks.js +34 -43
  228. package/build/src/integrations/xlsx.d.ts +41 -0
  229. package/build/src/integrations/xlsx.js +519 -0
  230. package/build/src/languages/ar.d.ts +11 -0
  231. package/build/src/languages/ar.js +358 -0
  232. package/build/src/languages/ar_ui.d.ts +461 -0
  233. package/build/src/languages/ar_ui.js +464 -0
  234. package/build/src/languages/catalog.d.ts +66 -0
  235. package/build/src/languages/catalog.js +152 -0
  236. package/build/src/languages/en.d.ts +7 -0
  237. package/build/src/languages/en.js +352 -0
  238. package/build/src/languages/en_ui.d.ts +3 -0
  239. package/build/src/languages/en_ui.js +458 -0
  240. package/build/src/languages/validation.d.ts +26 -0
  241. package/build/src/languages/validation.js +60 -0
  242. package/build/src/lists/bulk_actions.d.ts +89 -0
  243. package/build/src/lists/bulk_actions.js +268 -0
  244. package/build/src/lists/dashboards.d.ts +138 -0
  245. package/build/src/lists/dashboards.js +290 -0
  246. package/build/src/mcp/tools.js +9 -104
  247. package/build/src/resource/define_resource.d.ts +18 -1
  248. package/build/src/resource/define_resource.js +212 -18
  249. package/build/src/resource/definition.d.ts +44 -0
  250. package/build/src/resource/definition.js +171 -0
  251. package/build/src/resource/registry.js +15 -4
  252. package/build/src/resource/types.d.ts +313 -16
  253. package/build/src/resource/values.d.ts +56 -1
  254. package/build/src/resource/values.js +237 -5
  255. package/build/src/services/settings.d.ts +2 -0
  256. package/build/src/services/settings.js +5 -1
  257. package/build/src/upgrade/legacy.js +2 -2
  258. package/build/src/workflows/calendar.d.ts +9 -0
  259. package/build/src/workflows/calendar.js +44 -0
  260. package/build/src/workflows/define_workflow.d.ts +48 -3
  261. package/build/src/workflows/define_workflow.js +57 -13
  262. package/build/src/workflows/delegations.d.ts +107 -0
  263. package/build/src/workflows/delegations.js +326 -0
  264. package/build/src/workflows/engine.d.ts +80 -4
  265. package/build/src/workflows/engine.js +466 -86
  266. package/build/src/workflows/sla.d.ts +15 -0
  267. package/build/src/workflows/sla.js +8 -0
  268. package/build/stubs/resource_contract.txt +12 -1
  269. package/package.json +9 -2
@@ -0,0 +1,458 @@
1
+ /** English interface strings; see ar_ui.ts. */
2
+ export const englishInterfaceMessages = {
3
+ 'ui.language.title': 'Interface language',
4
+ 'ui.language.description': 'Arabic is the base language of the system. Choose another language for your interface when the administrator enables one.',
5
+ 'ui.language.save': 'Save language',
6
+ 'ui.record.detailsTitle': 'Details · {resource}',
7
+ 'ui.record.addNamed': 'Add {record}',
8
+ 'ui.record.editNamed': 'Edit {record}',
9
+ 'ui.record.addTitle': 'Add · {resource}',
10
+ 'ui.record.editTitle': 'Edit · {resource}',
11
+ 'ui.record.add': 'Add record',
12
+ 'ui.resource.subtitle': 'Your records and daily follow-up in one place.',
13
+ 'ui.record.formDescription': 'Complete the required fields, then save the record.',
14
+ 'ui.record.showDescription': 'Review the details available to you and continue your work.',
15
+ 'ui.form.reviewFields': 'Review the highlighted fields and try again.',
16
+ 'ui.form.addedNamed': '{record} added',
17
+ 'ui.form.added': 'Record added',
18
+ 'ui.form.saved': 'Changes saved',
19
+ 'ui.form.conflictMessage': 'The record changed since you opened it. Keep your edits, then reload the page.',
20
+ 'ui.form.saveFailedMessage': 'Could not save. Check the data and try again.',
21
+ 'ui.form.conflictTitle': 'Version conflict',
22
+ 'ui.form.saveFailed': 'Could not save',
23
+ 'ui.common.reload': 'Reload',
24
+ 'ui.form.details': 'Record details',
25
+ 'ui.form.requiredHint': 'Fields shown depend on your permissions · fields marked {mark} are required',
26
+ 'ui.form.orgUnit': 'Organizational unit',
27
+ 'ui.common.cancel': 'Cancel',
28
+ 'ui.form.saving': 'Saving...',
29
+ 'ui.form.save': 'Save record',
30
+ 'ui.validation.required': 'This field is required',
31
+ 'ui.validation.money': 'Enter an amount with at most two decimal places',
32
+ 'ui.validation.integer': 'Enter a whole number',
33
+ 'ui.validation.json': 'Enter valid JSON',
34
+ 'ui.validation.datetime': 'Enter a valid date and time',
35
+ 'ui.validation.decimal': 'Enter a valid decimal number',
36
+ 'ui.validation.decimalScale': 'Too many decimal places',
37
+ 'ui.validation.dateFormat': 'Enter the date as year-month-day',
38
+ 'ui.validation.gregorianDate': 'The Gregorian date is not valid',
39
+ 'ui.validation.hijriRange': 'Choose an Umm al-Qura date between 1300 and 1600 AH',
40
+ 'ui.validation.hijriDay': 'This day does not exist in the Umm al-Qura calendar',
41
+ 'ui.actions.delete': 'Delete record',
42
+ 'ui.actions.submit': 'Submit document',
43
+ 'ui.actions.cancel': 'Cancel document',
44
+ 'ui.actions.amend': 'Amend as copy',
45
+ 'ui.actions.deleteRecord': 'Delete {record}',
46
+ 'ui.actions.submitRecord': 'Submit {record}',
47
+ 'ui.actions.cancelRecord': 'Cancel {record}',
48
+ 'ui.actions.amendRecord': 'Amend {record} as a copy',
49
+ 'ui.actions.deleteDescription': 'The record moves to Deleted records, where it can be restored.',
50
+ 'ui.actions.submitDescription': 'Once submitted, the document and its lines can no longer be edited.',
51
+ 'ui.actions.cancelDescription': 'The document will be marked as cancelled and will no longer count.',
52
+ 'ui.actions.amendDescription': 'A new draft is copied from this cancelled document with its lines; the original stays unchanged.',
53
+ 'ui.actions.deleted': 'Record deleted',
54
+ 'ui.actions.undoFailed': 'The deletion could not be undone. Restore the record from Deleted records.',
55
+ 'ui.actions.submitted': 'Document submitted',
56
+ 'ui.actions.cancelled': 'Document cancelled',
57
+ 'ui.actions.amended': 'Amended copy created',
58
+ 'ui.actions.connectionFailed': 'Could not reach the server. Try again.',
59
+ 'ui.actions.conflict': 'The record changed since you opened it. Reload the page before continuing.',
60
+ 'ui.actions.failed': 'Could not complete the action. Check your permissions and try again.',
61
+ 'ui.common.back': 'Back',
62
+ 'ui.actions.running': 'Working...',
63
+ 'ui.common.confirm': 'Confirm',
64
+ 'ui.confirm.title': 'Confirm action',
65
+ 'ui.confirm.change': 'Confirm change',
66
+ 'ui.pagination.label': 'Pagination',
67
+ 'ui.pagination.previousPage': 'Previous page',
68
+ 'ui.pagination.previous': 'Previous',
69
+ 'ui.pagination.nextPage': 'Next page',
70
+ 'ui.pagination.next': 'Next',
71
+ 'ui.pagination.more': 'More pages',
72
+ 'ui.dialog.closeFormTitle': 'Close the form?',
73
+ 'ui.dialog.closeFormDescription': 'You may lose unsaved changes. You can keep editing or close the form.',
74
+ 'ui.dialog.keepEditing': 'Keep editing',
75
+ 'ui.dialog.closeWithoutSaving': 'Close without saving',
76
+ 'ui.common.close': 'Close',
77
+ 'ui.surface.backToList': 'Back to list',
78
+ 'ui.activity.create': 'Record created',
79
+ 'ui.record.edit': 'Edit record',
80
+ 'ui.activity.amend': 'Amended after submission',
81
+ 'ui.activity.assignmentClosed': 'Task closed with the record',
82
+ 'ui.status.submitted': 'Submitted',
83
+ 'ui.status.cancelled': 'Cancelled',
84
+ 'ui.status.draft': 'Draft',
85
+ 'ui.show.print': 'Print',
86
+ 'ui.show.lines': 'Lines',
87
+ 'ui.show.lineCount': '{count} lines',
88
+ 'ui.show.linesTruncated': 'Showing the first 100 available lines',
89
+ 'ui.show.noLines': 'No lines available.',
90
+ 'ui.show.activity': 'Activity log',
91
+ 'ui.show.activityCount': 'Last {count} actions',
92
+ 'ui.show.userNumber': 'User #{id}',
93
+ 'ui.show.activityFields': 'Fields: {fields}',
94
+ 'ui.common.listSeparator': ', ',
95
+ 'ui.show.noActivity': 'No activity recorded yet.',
96
+ 'ui.common.loadingSection': 'Loading {section}',
97
+ 'ui.field.chooseValue': 'Choose a value',
98
+ 'ui.field.datePlaceholder': 'Type the date or pick it',
99
+ 'ui.field.hijriDatePlaceholder': 'Type the Hijri date or pick it',
100
+ 'ui.common.yes': 'Yes',
101
+ 'ui.common.no': 'No',
102
+ 'ui.field.entryCalendar': 'Entry calendar: {field}',
103
+ 'ui.field.gregorianEntry': 'Gregorian entry',
104
+ 'ui.field.hijriEntry': 'Hijri entry',
105
+ 'ui.field.calendar': 'Calendar: {field}',
106
+ 'ui.field.hijriUmmAlQura': 'Hijri · Umm al-Qura',
107
+ 'ui.field.gregorianEquivalent': '({date} Gregorian)',
108
+ 'ui.field.hijriEquivalent': 'Hijri equivalent:',
109
+ 'ui.field.hijriSuffix': 'AH',
110
+ 'ui.field.time': 'Time: {field}',
111
+ 'ui.field.formatJson': 'Format JSON',
112
+ 'ui.field.uploadFailed': 'Could not upload the file. Try again.',
113
+ 'ui.field.connectionFailed': 'Could not reach the server.',
114
+ 'ui.field.replace': 'Replace',
115
+ 'ui.field.remove': 'Remove',
116
+ 'ui.field.chooseFile': 'Choose file',
117
+ 'ui.field.changeFile': 'Change file',
118
+ 'ui.field.noFileChosen': 'No file chosen',
119
+ 'ui.field.uploading': 'Uploading {progress}%',
120
+ 'ui.field.upload': 'Upload {field}',
121
+ 'ui.field.optionsFailed': 'Could not load the options',
122
+ 'ui.field.chooseUser': 'Choose a user',
123
+ 'ui.field.chooseRecord': 'Choose a record',
124
+ 'ui.field.searchByName': 'Search by name',
125
+ 'ui.field.searchRelated': 'Search related records',
126
+ 'ui.field.filterOptions': 'Filter options',
127
+ 'ui.field.searchIn': 'Search {field}',
128
+ 'ui.common.searching': 'Searching...',
129
+ 'ui.field.noMatches': 'No matching records',
130
+ 'ui.field.noSelection': 'No selection',
131
+ 'ui.field.decimalPlaces': 'Decimal places: at most {scale}',
132
+ 'ui.field.noDecimalPlaces': 'Whole number, no decimal places',
133
+ 'ui.field.selectedCount': '{count} selected',
134
+ 'ui.field.chooseRecords': 'Choose one or more records',
135
+ 'ui.field.selectedIn': 'Selected in {field}',
136
+ 'ui.field.removeRecord': 'Remove {record}',
137
+ 'ui.field.required': 'Required',
138
+ 'ui.common.loading': 'Loading...',
139
+ 'ui.common.more': 'More',
140
+ 'ui.inline.empty': 'No lines yet',
141
+ 'ui.inline.truncated': 'Only the first 100 lines are shown',
142
+ 'ui.inline.add': 'Add line',
143
+ 'ui.inline.actions': 'Action',
144
+ 'ui.inline.row': 'Line {number}',
145
+ 'ui.inline.fieldForRow': '{field} for line {number}',
146
+ 'ui.inline.removeRow': 'Remove line {number}',
147
+ 'ui.inline.undoDelete': 'Undo deleting line {number}',
148
+ 'ui.inline.deleteRow': 'Delete line {number}',
149
+ 'ui.value.bytes': '{size} B',
150
+ 'ui.value.kilobytes': '{size} KB',
151
+ 'ui.value.megabytes': '{size} MB',
152
+ 'ui.value.attachment': 'Attachment',
153
+ 'ui.value.currency': 'SAR',
154
+ 'ui.value.percent': '%',
155
+ 'ui.table.listOf': '{resource} list',
156
+ 'ui.table.records': 'Records',
157
+ 'ui.table.shown': 'Shown: {count}',
158
+ 'ui.table.estimate': 'In your scope: about {records}',
159
+ 'ui.table.exact': 'In your scope: {records}',
160
+ 'ui.table.scope': 'Within your permission scope',
161
+ 'ui.count.recordOne': '1 record',
162
+ 'ui.count.recordTwo': '2 records',
163
+ 'ui.count.recordFew': '{count} records',
164
+ 'ui.count.recordMany': '{count} records',
165
+ 'ui.count.recordOther': '{count} records',
166
+ 'ui.count.documentOne': '1 document',
167
+ 'ui.count.documentTwo': '2 documents',
168
+ 'ui.count.documentFew': '{count} documents',
169
+ 'ui.count.documentMany': '{count} documents',
170
+ 'ui.count.documentOther': '{count} documents',
171
+ 'ui.count.tokenOne': '1 token',
172
+ 'ui.count.tokenTwo': '2 tokens',
173
+ 'ui.count.tokenFew': '{count} tokens',
174
+ 'ui.count.tokenMany': '{count} tokens',
175
+ 'ui.count.tokenOther': '{count} tokens',
176
+ 'ui.table.export': 'Export shown',
177
+ 'ui.table.searchPlaceholder': 'Search records...',
178
+ 'ui.table.filter': 'Filter',
179
+ 'ui.table.clearFilters': 'Clear filters',
180
+ 'ui.table.nextFailed': 'Could not load more records. Try again.',
181
+ 'ui.table.networkFailed': 'Could not reach the server. Check your connection and try again.',
182
+ 'ui.table.loadingMore': 'Loading more...',
183
+ 'ui.table.loadMore': 'Load more',
184
+ 'ui.table.end': 'End of records',
185
+ 'ui.table.actions': 'Actions',
186
+ 'ui.table.viewRecord': 'View record {id}',
187
+ 'ui.table.view': 'View',
188
+ 'ui.table.editRecord': 'Edit record {id}',
189
+ 'ui.table.edit': 'Edit',
190
+ 'ui.table.record': 'record {id}',
191
+ 'ui.table.emptyFiltered': 'Change the search or filters to see other records.',
192
+ 'ui.table.empty': 'No records have been added in your scope yet.',
193
+ 'ui.views.saveFailed': 'Could not save the view.',
194
+ 'ui.views.deleteFailed': 'Could not delete the view.',
195
+ 'ui.views.title': 'Saved views',
196
+ 'ui.views.empty': 'No views yet',
197
+ 'ui.views.shared': 'Shared',
198
+ 'ui.views.delete': 'Delete view {name}',
199
+ 'ui.views.name': 'View name',
200
+ 'ui.common.save': 'Save',
201
+ 'ui.views.saveCurrent': 'Save current view',
202
+ 'ui.table.all': 'All',
203
+ 'ui.table.filterField': 'Filter {field}',
204
+ 'ui.table.pressEnter': 'Press Enter to apply',
205
+ 'ui.admin.peopleAndPermissions': 'People and permissions',
206
+ 'ui.admin.users': 'Users',
207
+ 'ui.admin.roles': 'Roles and permissions',
208
+ 'ui.admin.orgUnits': 'Organization structure',
209
+ 'ui.admin.sessions': 'Sessions',
210
+ 'ui.admin.settings': 'Settings',
211
+ 'ui.admin.templates': 'Message templates',
212
+ 'ui.admin.webhooks': 'Integrations',
213
+ 'ui.admin.monitoring': 'Monitoring and operations',
214
+ 'ui.admin.jobs': 'System jobs',
215
+ 'ui.admin.workflows': 'Failed workflows',
216
+ 'ui.admin.setup': 'Initial setup',
217
+ 'ui.admin.title': 'Administration',
218
+ 'ui.admin.alerts': '{count} admin alerts',
219
+ 'ui.admin.navigation': 'Administration navigation',
220
+ 'ui.admin.impersonating': 'You are browsing as {name}',
221
+ 'ui.admin.stopImpersonating': 'Stop impersonating',
222
+ 'ui.workspace.overview': 'Overview',
223
+ 'ui.workspace.myTasks': 'My tasks',
224
+ 'ui.workspace.imports': 'Imports',
225
+ 'ui.workspace.tagline': 'Your business workspace, clearly',
226
+ 'ui.workspace.dailyWork': 'Daily work',
227
+ 'ui.workspace.mainNavigation': 'Main navigation',
228
+ 'ui.workspace.open': '{count} open',
229
+ 'ui.workspace.inviteUser': 'Invite user',
230
+ 'ui.workspace.title': 'Workspace',
231
+ 'ui.workspace.trial': 'Trial environment',
232
+ 'ui.workspace.mobileNavigation': 'Mobile navigation',
233
+ 'ui.errors.notFound': 'Page not found',
234
+ 'ui.errors.serverError': 'Something went wrong',
235
+ 'ui.auth.login': 'Sign in',
236
+ 'ui.auth.loginDescription': 'Enter your account details to continue to the workspace',
237
+ 'ui.auth.email': 'Email',
238
+ 'ui.auth.password': 'Password',
239
+ 'ui.auth.forgotPassword': 'Forgot your password?',
240
+ 'ui.auth.submit': 'Sign in',
241
+ 'ui.auth.socialProviders': 'Sign in with an external provider',
242
+ 'ui.auth.orContinueWith': 'Or continue with',
243
+ 'ui.auth.signInWith': 'Sign in with {provider}',
244
+ 'ui.auth.noAccount': "Don't have an account?",
245
+ 'ui.auth.createAccount': 'Create account',
246
+ 'ui.home.title': 'Workspace · {app}',
247
+ 'ui.home.description': 'Your business modules and account settings in one place.',
248
+ 'ui.home.account': 'My account',
249
+ 'ui.home.notifications': 'Notifications',
250
+ 'ui.home.startSetup': 'Start initial setup',
251
+ 'ui.home.manageSystem': 'Manage the system',
252
+ 'ui.home.open': 'Open {resource}',
253
+ 'ui.home.empty': 'The business modules available to your account will appear here.',
254
+ 'ui.list.filterFailed': 'Could not apply the filter. Review the values and try again.',
255
+ 'ui.list.exportResults': 'Export results',
256
+ 'ui.list.exporting': 'Exporting...',
257
+ 'ui.list.exportFailed': 'Could not export the results. Try again.',
258
+ 'ui.list.exportXlsx': 'Excel file (xlsx)',
259
+ 'ui.list.exportCsv': 'CSV file',
260
+ 'ui.list.activeFilters': 'Applied filters',
261
+ 'ui.list.removeFilter': 'Remove the {field} filter',
262
+ 'ui.list.rangeBoth': 'From {from} to {to}',
263
+ 'ui.list.rangeFrom': 'From {from}',
264
+ 'ui.list.rangeTo': 'To {to}',
265
+ 'ui.list.empty': 'Empty',
266
+ 'ui.list.notEmpty': 'Not empty',
267
+ 'ui.list.inLimit': 'You can choose at most {count} values.',
268
+ 'ui.list.valueOf': '{field} value',
269
+ 'ui.list.emptyValues': 'Empty values',
270
+ 'ui.list.removeFilters': 'Remove filter',
271
+ 'ui.list.apply': 'Apply',
272
+ 'ui.list.invalidValue': 'Invalid value',
273
+ 'ui.list.from': 'From',
274
+ 'ui.list.to': 'To',
275
+ 'ui.list.boundOf': '{bound} · {field}',
276
+ 'ui.list.anyOf': 'Any of',
277
+ 'ui.list.contains': 'Contains',
278
+ 'ui.list.unsupportedFilter': 'This field does not support this kind of filter.',
279
+ 'ui.list.searchOptions': 'Search options',
280
+ 'ui.list.noOptions': 'No matching options',
281
+ 'ui.list.typeValue': 'Type a value, then press Enter',
282
+ 'ui.list.removeValue': 'Remove {value}',
283
+ 'ui.list.selectAll': 'Select all shown records',
284
+ 'ui.list.selectRecord': 'Select record {id}',
285
+ 'ui.bulk.title': 'Bulk actions',
286
+ 'ui.bulk.selected': '{count} selected',
287
+ 'ui.bulk.clear': 'Clear selection',
288
+ 'ui.bulk.limit': 'At most {records} at a time.',
289
+ 'ui.bulk.perRow': 'Your permission is checked for each record separately.',
290
+ 'ui.bulk.succeeded': 'Done: {records}',
291
+ 'ui.bulk.failed': 'Could not run: {records}',
292
+ 'ui.bulk.defined': 'The action “{action}” will run. Selected: {records}.',
293
+ 'ui.bulk.delete': 'Delete',
294
+ 'ui.bulk.restore': 'Restore',
295
+ 'ui.bulk.submit': 'Submit',
296
+ 'ui.bulk.cancel': 'Cancel document',
297
+ 'ui.bulk.deleteDescription': '{records} will be removed from lists; they can be restored from Deleted records.',
298
+ 'ui.bulk.restoreDescription': '{records} will be restored from Deleted records to the active records.',
299
+ 'ui.bulk.submitDescription': '{documents} will be submitted and can no longer be edited.',
300
+ 'ui.bulk.cancelDescription': 'Submission will be cancelled. Selected: {documents}. A cancelled document is not counted.',
301
+ 'ui.trash.title': 'Deleted records',
302
+ 'ui.trash.titleOf': 'Deleted records · {resource}',
303
+ 'ui.trash.subtitle': 'Deleted records within your scope; restore what you need to the active records.',
304
+ 'ui.trash.active': 'Active records',
305
+ 'ui.trash.empty': 'No deleted records',
306
+ 'ui.trash.emptyHint': 'Deleted records within your scope appear here for restoring.',
307
+ 'ui.trash.restoreRecord': 'Restore {record}',
308
+ 'ui.trash.restoreTitle': 'Restore record',
309
+ 'ui.trash.restoreDescription': '{record} will return to the active records and appear in lists.',
310
+ 'ui.trash.restored': 'Record restored',
311
+ 'ui.trash.restoreFailed': 'Could not restore the record. Check your permissions and try again.',
312
+ 'ui.dashboard.scope': 'Figures are computed within your permission scope',
313
+ 'ui.dashboard.switcher': 'Dashboards',
314
+ 'ui.dashboard.none': 'No indicators are available to you on this dashboard',
315
+ 'ui.dashboard.noneHint': 'Indicators appear when your permissions allow reading their records.',
316
+ 'ui.dashboard.totals': 'Totals',
317
+ 'ui.dashboard.grouped': 'Indicators by category',
318
+ 'ui.dashboard.noData': 'No data within your scope',
319
+ 'ui.dashboard.noValue': 'No value',
320
+ 'ui.dashboard.meter': '{label}: {value}',
321
+ 'ui.dashboard.truncated': 'Only the highest categories are shown.',
322
+ 'ui.dashboard.openRecords': 'Open the list: {label}',
323
+ 'ui.attachment.preview': 'Preview',
324
+ 'ui.attachment.previewNamed': 'Preview {name}',
325
+ 'ui.attachment.previewDescription': 'Attachment preview. You can download it with the button below.',
326
+ 'ui.attachment.download': 'Download',
327
+ 'ui.attachment.previewLoading': 'Loading the preview…',
328
+ 'ui.attachment.previewFailed': 'The preview could not be loaded. You can download the file.',
329
+ 'ui.attachment.previewTruncated': 'The preview shows the start of the file only. Download it to read all of it.',
330
+ 'ui.attachment.tooMany': 'You can attach at most {max} files',
331
+ 'ui.attachment.moveUp': 'Move {name} up',
332
+ 'ui.attachment.moveDown': 'Move {name} down',
333
+ 'ui.attachment.removeNamed': 'Remove {name}',
334
+ 'ui.attachment.uploadingNamed': 'Uploading {name} {progress}%',
335
+ 'ui.attachment.addFiles': 'Add files',
336
+ 'ui.attachment.count': '{count} of {max} files',
337
+ 'ui.attachment.unknownFile': 'File {id}',
338
+ 'ui.attachment.added': 'Added {name}',
339
+ 'ui.attachment.removed': 'Removed {name}',
340
+ 'ui.attachment.moved': 'Moved {name} to position {position}',
341
+ // Print templates (ADR 048).
342
+ 'ui.print.title': 'Print record',
343
+ 'ui.print.description': 'Choose a print template and a document format.',
344
+ 'ui.print.loadFailed': 'Could not load the print templates.',
345
+ 'ui.print.retry': 'Try again',
346
+ 'ui.print.loading': 'Loading templates…',
347
+ 'ui.print.template': 'Print template',
348
+ 'ui.print.format': 'Document format',
349
+ 'ui.print.html': 'Printable page',
350
+ 'ui.print.pdfUnavailable': 'PDF conversion is not enabled; print from the browser.',
351
+ 'ui.print.open': 'Open for printing',
352
+ 'ui.activity.printed': 'Printed with a template',
353
+ 'ui.admin.printTemplates': 'Print templates',
354
+ 'ui.relation.unavailable': 'Record not available',
355
+ 'ui.show.orgUnitUnavailable': 'Unit not available',
356
+ 'ui.copy.action': 'Copy',
357
+ 'ui.copy.done': 'Copied',
358
+ 'ui.copy.failed': 'Copying failed; select the text and copy it manually.',
359
+ // Workspace shell, account menu and navigation order (ADR 049).
360
+ 'ui.shell.apps': 'Applications',
361
+ 'ui.shell.adminSections': 'Administration sections',
362
+ 'ui.shell.sidebar': 'Sidebar',
363
+ 'ui.shell.showSidebar': 'Show the sidebar',
364
+ 'ui.shell.collapseSidebar': 'Collapse the sidebar',
365
+ 'ui.shell.expandSidebar': 'Expand the sidebar',
366
+ 'ui.shell.hideSidebar': 'Hide the sidebar',
367
+ 'ui.shell.sectionPages': 'Section pages: {section}',
368
+ 'ui.shell.myTasksCount': 'My tasks, {count} open',
369
+ 'ui.account.menu': 'Account menu',
370
+ 'ui.account.profile': 'Profile',
371
+ 'ui.account.tokens': 'API tokens',
372
+ 'ui.account.delegation': 'Delegation while away',
373
+ 'ui.account.logout': 'Sign out',
374
+ 'ui.account.theme': 'Appearance',
375
+ 'ui.account.themeLight': 'Light',
376
+ 'ui.account.themeDark': 'Dark',
377
+ 'ui.account.themeSystem': 'Match device',
378
+ 'ui.account.layout': 'Navigation layout',
379
+ 'ui.account.layoutDefault': 'System default',
380
+ 'ui.account.layoutSidebar': 'Sidebar menu',
381
+ 'ui.account.layoutTop': 'Top menu',
382
+ 'ui.account.sidebarCollapse': 'When the menu collapses',
383
+ 'ui.account.sidebarCollapseIcons': 'Icons',
384
+ 'ui.account.sidebarCollapseHidden': 'Hide completely',
385
+ 'ui.account.arrange': 'Arrange the menu…',
386
+ 'ui.navOrder.title': 'Arrange the menu',
387
+ 'ui.navOrder.description': 'Order the menu entries to suit your work. The same order applies to the side and top menus.',
388
+ 'ui.navOrder.position': '{name} at position {position}',
389
+ 'ui.navOrder.up': 'Move {name} up',
390
+ 'ui.navOrder.down': 'Move {name} down',
391
+ 'ui.navOrder.reset': 'Restore the default order',
392
+ 'ui.navOrder.save': 'Save the order',
393
+ 'ui.preferences.saveFailed': 'Could not save the preference.',
394
+ 'ui.notifications.unread': 'Notifications, {count} unread',
395
+ 'ui.admin.delegations': 'Approval delegations',
396
+ 'ui.admin.general': 'General settings',
397
+ 'ui.admin.lookups': 'Reference lists',
398
+ 'ui.admin.sequences': 'Sequential numbering',
399
+ 'ui.overview.description': 'Your work and indicators in one place, in the order you choose.',
400
+ 'ui.overview.customize': 'Customize',
401
+ 'ui.overview.customizeTitle': 'Customize the overview',
402
+ 'ui.overview.customizeDescription': 'Choose the items to show and order them by dragging or with the keyboard.',
403
+ 'ui.overview.widgets': 'Overview items',
404
+ 'ui.overview.show': 'Show {widget}',
405
+ 'ui.overview.reset': 'Restore default',
406
+ 'ui.overview.resetTitle': 'Restore the default order?',
407
+ 'ui.overview.resetDescription': 'The items return to their default order and visibility.',
408
+ 'ui.overview.empty': 'No items are shown. Show one from “Customize”.',
409
+ 'ui.overview.welcome': 'My account and settings',
410
+ 'ui.overview.tasks': 'My open tasks',
411
+ 'ui.overview.notifications': 'Unread notifications',
412
+ 'ui.overview.modules': 'Work modules',
413
+ 'ui.overview.unavailable': 'Unavailable',
414
+ 'ui.overview.countFailed': 'Could not load the count',
415
+ 'ui.sortable.handle': 'Move handle for {item}',
416
+ 'ui.sortable.moveUp': 'Move {item} up',
417
+ 'ui.sortable.moveDown': 'Move {item} down',
418
+ 'ui.sortable.picked': 'Picked up {item}, position {position} of {total}. Use the arrow keys to move it, then Space to drop it.',
419
+ 'ui.sortable.moved': 'Moved {item} to position {position} of {total}.',
420
+ 'ui.sortable.dropped': 'Dropped {item} at position {position} of {total}.',
421
+ 'ui.sortable.cancelled': 'Move cancelled; {item} is back at position {position}.',
422
+ 'ui.sortable.hint': 'Press Space to pick up the item, the arrow keys to move it, Space to drop it, or Escape to cancel.',
423
+ 'ui.assistant.title': 'AI assistant',
424
+ 'ui.assistant.description': 'Answers your questions and reads records with your own permissions only.',
425
+ 'ui.assistant.accept': 'I understand and agree',
426
+ 'ui.assistant.acceptFailed': 'Could not save your agreement.',
427
+ 'ui.assistant.empty': 'Ask about your records, for example: how many open orders are in my unit?',
428
+ 'ui.assistant.pending': 'Proposal awaiting your review',
429
+ 'ui.assistant.review': 'Review',
430
+ 'ui.assistant.typing': 'The assistant is typing…',
431
+ 'ui.assistant.question': 'Your question',
432
+ 'ui.assistant.placeholder': 'Type your question…',
433
+ 'ui.assistant.remaining': 'Remaining today: {count}',
434
+ 'ui.assistant.send': 'Send',
435
+ 'ui.assistant.failed': 'Could not get a reply. Try again.',
436
+ 'ui.assistant.confirmed': 'The proposal was carried out.',
437
+ 'ui.assistant.rejected': 'The proposal was rejected and not carried out.',
438
+ 'ui.assistant.confirmFailed': 'Could not carry out the proposal.',
439
+ 'ui.assistant.reviewTitle': "Review the assistant's proposal",
440
+ 'ui.assistant.reviewDescription': 'The assistant proposed this change; nothing has run yet. Review it, then carry it out or reject it.',
441
+ 'ui.assistant.resource': 'Resource',
442
+ 'ui.assistant.record': 'Record',
443
+ 'ui.assistant.field': 'Field',
444
+ 'ui.assistant.current': 'Current value',
445
+ 'ui.assistant.proposed': 'Proposed value',
446
+ 'ui.assistant.reject': 'Reject',
447
+ 'ui.assistant.execute': 'Carry out',
448
+ 'ui.assistant.create': 'Create a record',
449
+ 'ui.assistant.update': 'Update a record',
450
+ 'ui.assistant.delete': 'Delete a record',
451
+ 'ui.assistant.submit': 'Submit a record',
452
+ 'ui.assistant.cancel': 'Cancel a record',
453
+ 'ui.assistant.noticeTitle': 'What is sent to an external provider?',
454
+ 'ui.assistant.noticeQuestion': 'The text of your question and the current conversation.',
455
+ 'ui.assistant.noticeRecords': 'What the assistant reads from records on your behalf: only what your permissions let you see, without hidden or restricted fields.',
456
+ 'ui.assistant.noticeResources': 'The names of the resources you may view.',
457
+ 'ui.assistant.noticeNever': 'Passwords, settings, attachments and your name or e-mail are never sent. The provider (OpenRouter) processes this data under its own policy, and no change to records runs without your approval.',
458
+ };
@@ -0,0 +1,26 @@
1
+ /** The part of VineJS's FieldContext the provider reads. */
2
+ type ValidationField = {
3
+ name: string | number;
4
+ };
5
+ /**
6
+ * A VineJS messages provider that answers in the current language (see
7
+ * runWithLanguage): Arabic by default, the user's language when it is enabled and
8
+ * translates the rule. Assign it to `vine.messagesProvider` before validators are
9
+ * created. A rule without a catalog entry keeps its own message, interpolated the way
10
+ * VineJS does and translated when it matches a catalog text exactly.
11
+ */
12
+ export declare class CatalogMessagesProvider {
13
+ getMessage(rawMessage: string, rule: string, field: ValidationField, args?: Record<string, unknown>): string;
14
+ }
15
+ /**
16
+ * Makes `vine` answer through the catalog: new validators get a CatalogMessagesProvider,
17
+ * and the validators of `resources` created earlier with VineJS's default provider are
18
+ * switched to it (applications load modules while reading their configuration, before
19
+ * any preload runs). A validator with its own messages provider keeps it.
20
+ */
21
+ export declare function installCatalogMessages(vine: {
22
+ messagesProvider: unknown;
23
+ }, resources?: readonly {
24
+ validator?: unknown;
25
+ }[]): CatalogMessagesProvider;
26
+ export {};
@@ -0,0 +1,60 @@
1
+ import { arabicMessages } from './ar.js';
2
+ import { currentLanguage, localizeText, translate } from './catalog.js';
3
+ /** VineJS's own `{{ name }}` interpolation, for messages the catalog does not translate. */
4
+ function vineTemplate(message, field, args) {
5
+ if (!message.includes('{{'))
6
+ return message;
7
+ const data = { field: field.name, ...args };
8
+ return message.replace(/(\\)?{{(.*?)}}/g, (match, escaped, path) => {
9
+ if (escaped)
10
+ return match.slice(1);
11
+ let value = data;
12
+ for (const token of path.trim().split('.')) {
13
+ if (value === null || typeof value !== 'object' || !Object.hasOwn(value, token))
14
+ return '';
15
+ value = value[token];
16
+ }
17
+ return Array.isArray(value) ? value.join('، ') : String(value ?? '');
18
+ });
19
+ }
20
+ function params(args) {
21
+ const values = {};
22
+ for (const [key, value] of Object.entries(args ?? {}))
23
+ if (typeof value === 'string' || typeof value === 'number')
24
+ values[key] = value;
25
+ else if (Array.isArray(value))
26
+ values[key] = value.join('، ');
27
+ return values;
28
+ }
29
+ /**
30
+ * A VineJS messages provider that answers in the current language (see
31
+ * runWithLanguage): Arabic by default, the user's language when it is enabled and
32
+ * translates the rule. Assign it to `vine.messagesProvider` before validators are
33
+ * created. A rule without a catalog entry keeps its own message, interpolated the way
34
+ * VineJS does and translated when it matches a catalog text exactly.
35
+ */
36
+ export class CatalogMessagesProvider {
37
+ getMessage(rawMessage, rule, field, args) {
38
+ const key = `validation.${rule}`;
39
+ if (Object.hasOwn(arabicMessages, key))
40
+ return translate(key, currentLanguage(), params(args));
41
+ return localizeText(vineTemplate(rawMessage, field, args));
42
+ }
43
+ }
44
+ /**
45
+ * Makes `vine` answer through the catalog: new validators get a CatalogMessagesProvider,
46
+ * and the validators of `resources` created earlier with VineJS's default provider are
47
+ * switched to it (applications load modules while reading their configuration, before
48
+ * any preload runs). A validator with its own messages provider keeps it.
49
+ */
50
+ export function installCatalogMessages(vine, resources = []) {
51
+ const previous = vine.messagesProvider;
52
+ const provider = new CatalogMessagesProvider();
53
+ vine.messagesProvider = provider;
54
+ for (const { validator } of resources) {
55
+ const candidate = validator;
56
+ if (candidate && candidate.messagesProvider === previous)
57
+ candidate.messagesProvider = provider;
58
+ }
59
+ return provider;
60
+ }
@@ -0,0 +1,89 @@
1
+ import type { ResourceRegistry } from '../resource/registry.js';
2
+ import type { Label, RecordData } from '../resource/types.js';
3
+ import { type Actor } from '../auth/ability.js';
4
+ import type { ResourceService } from '../admin/resource_service.js';
5
+ /** A resource-defined bulk action: an ordinary update that writes fixed values (ADR 046). */
6
+ export type BulkActionDefinition = {
7
+ /** camelCase key, unique per resource and never a built-in action name. */
8
+ key: string;
9
+ label: Label;
10
+ /** Field values written to every selected record, through ResourceService.save. */
11
+ values: RecordData;
12
+ /** Confirmation question shown before the action runs. */
13
+ confirm?: Label;
14
+ destructive?: boolean;
15
+ };
16
+ export type BulkActionSet = {
17
+ resource: string;
18
+ actions: readonly BulkActionDefinition[];
19
+ };
20
+ /** One action the list may offer the actor; per-row refusal is still decided per row. */
21
+ export type BulkActionOption = {
22
+ key: string;
23
+ label: string;
24
+ /** delete, restore, submit and cancel are built in; others come from defineBulkActions. */
25
+ builtIn: boolean;
26
+ /** `trash` actions apply to the trashed list (restore); `records` to the live list. */
27
+ scope: 'records' | 'trash';
28
+ confirm: string | null;
29
+ destructive: boolean;
30
+ };
31
+ export type BulkRequest = {
32
+ action: unknown;
33
+ ids: unknown;
34
+ /** Versioned resources: the version of each selected record, by id. */
35
+ versions?: unknown;
36
+ };
37
+ export type BulkFailure = {
38
+ id: number;
39
+ code: string;
40
+ message: string;
41
+ };
42
+ export type BulkActionsOptions = {
43
+ /**
44
+ * Receives an unexpected row failure (not an AdulaError, validation or constraint
45
+ * error); pass the application logger. Defaults to console.error with no record data.
46
+ */
47
+ report?: (error: unknown, context: {
48
+ resource: string;
49
+ action: string;
50
+ id: number;
51
+ }) => void;
52
+ };
53
+ export type BulkResult = {
54
+ succeeded: number[];
55
+ failed: BulkFailure[];
56
+ };
57
+ /** Most records one bulk request may change. */
58
+ export declare const BULK_ID_LIMIT = 100;
59
+ /**
60
+ * Declares bulk actions for one resource. Register the result on the BulkActions service.
61
+ * Definitions are checked here for shape and against the resource when registered.
62
+ */
63
+ export declare function defineBulkActions(resource: string, actions: BulkActionDefinition[]): BulkActionSet;
64
+ /**
65
+ * Runs one action over selected records. Every record runs in its own transaction
66
+ * through the ordinary paths (transition, restore, save), with the actor's per-row
67
+ * policy check and audit, so one refused row does not undo the others.
68
+ */
69
+ export declare class BulkActions {
70
+ private registry;
71
+ private resources;
72
+ private options;
73
+ private defined;
74
+ constructor(registry: ResourceRegistry, resources: ResourceService, definitions?: readonly BulkActionSet[], options?: BulkActionsOptions);
75
+ /**
76
+ * Checks bulk action sets against the registered resources: each set names a resource,
77
+ * keys are unique per resource and every value is a writable form field value. Call it
78
+ * when the application loads its definitions, so a bad definition fails at boot.
79
+ */
80
+ static validate(registry: ResourceRegistry, definitions: readonly BulkActionSet[]): Map<string, Map<string, BulkActionDefinition>>;
81
+ /**
82
+ * The actions the actor may offer on this resource's list (resource-level permission).
83
+ * 403 E_FORBIDDEN when the actor may not view the resource at all.
84
+ */
85
+ available(name: string, actor: Actor): BulkActionOption[];
86
+ run(name: string, actor: Actor, request: BulkRequest): Promise<BulkResult>;
87
+ private one;
88
+ private report;
89
+ }