@saltcorn/server 1.1.2-beta.9 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (418) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/auth/admin.js +8 -1
  3. package/auth/routes.js +45 -4
  4. package/docs/.nojekyll +1 -0
  5. package/docs/assets/custom.css +6 -0
  6. package/docs/assets/highlight.css +85 -0
  7. package/docs/assets/main.js +58 -0
  8. package/docs/assets/search.js +1 -0
  9. package/docs/assets/style.css +1367 -0
  10. package/docs/classes/_saltcorn_common_code.Relation.html +162 -0
  11. package/docs/classes/_saltcorn_common_code.RelationsFinder.html +182 -0
  12. package/docs/classes/_saltcorn_data.models.Crash-1.html +316 -0
  13. package/docs/classes/_saltcorn_data.models.EventLog-1.html +350 -0
  14. package/docs/classes/_saltcorn_data.models.Field.html +949 -0
  15. package/docs/classes/_saltcorn_data.models.FieldRepeat-1.html +293 -0
  16. package/docs/classes/_saltcorn_data.models.File-1.html +881 -0
  17. package/docs/classes/_saltcorn_data.models.Form-1.html +494 -0
  18. package/docs/classes/_saltcorn_data.models.Library.html +295 -0
  19. package/docs/classes/_saltcorn_data.models.Page.html +417 -0
  20. package/docs/classes/_saltcorn_data.models.PageGroup-1.html +500 -0
  21. package/docs/classes/_saltcorn_data.models.Plugin.html +414 -0
  22. package/docs/classes/_saltcorn_data.models.Role.html +254 -0
  23. package/docs/classes/_saltcorn_data.models.Table-1.html +1830 -0
  24. package/docs/classes/_saltcorn_data.models.TableConstraint-1.html +296 -0
  25. package/docs/classes/_saltcorn_data.models.Trigger.html +672 -0
  26. package/docs/classes/_saltcorn_data.models.User-1.html +813 -0
  27. package/docs/classes/_saltcorn_data.models.View-1.html +878 -0
  28. package/docs/classes/_saltcorn_data.models.Workflow-1.html +374 -0
  29. package/docs/classes/_saltcorn_data.models.WorkflowRun.html +529 -0
  30. package/docs/classes/_saltcorn_data.models.WorkflowStep.html +421 -0
  31. package/docs/classes/_saltcorn_data.models.WorkflowTrace.html +318 -0
  32. package/docs/classes/_saltcorn_mobile_builder.MobileBuilder.html +356 -0
  33. package/docs/enums/_saltcorn_common_code.RelationType.html +115 -0
  34. package/docs/enums/_saltcorn_common_code.ViewDisplayType.html +94 -0
  35. package/docs/functions/_saltcorn_admin_models.backup.create_backup.html +76 -0
  36. package/docs/functions/_saltcorn_admin_models.backup.create_csv_from_rows.html +77 -0
  37. package/docs/functions/_saltcorn_admin_models.backup.restore.html +93 -0
  38. package/docs/functions/_saltcorn_admin_models.pack.add_to_menu.html +100 -0
  39. package/docs/functions/_saltcorn_admin_models.pack.can_install_pack.html +89 -0
  40. package/docs/functions/_saltcorn_admin_models.pack.fetch_available_packs.html +83 -0
  41. package/docs/functions/_saltcorn_admin_models.pack.fetch_pack_by_name.html +90 -0
  42. package/docs/functions/_saltcorn_admin_models.pack.install_pack.html +107 -0
  43. package/docs/functions/_saltcorn_admin_models.pack.library_pack.html +90 -0
  44. package/docs/functions/_saltcorn_admin_models.pack.model_instance_pack.html +95 -0
  45. package/docs/functions/_saltcorn_admin_models.pack.model_pack.html +96 -0
  46. package/docs/functions/_saltcorn_admin_models.pack.page_group_pack.html +91 -0
  47. package/docs/functions/_saltcorn_admin_models.pack.page_pack.html +91 -0
  48. package/docs/functions/_saltcorn_admin_models.pack.plugin_pack.html +89 -0
  49. package/docs/functions/_saltcorn_admin_models.pack.role_pack.html +90 -0
  50. package/docs/functions/_saltcorn_admin_models.pack.table_pack.html +90 -0
  51. package/docs/functions/_saltcorn_admin_models.pack.trigger_pack.html +89 -0
  52. package/docs/functions/_saltcorn_admin_models.pack.uninstall_pack.html +92 -0
  53. package/docs/functions/_saltcorn_admin_models.pack.view_pack.html +89 -0
  54. package/docs/functions/_saltcorn_admin_models.tenant.copy_tenant_template.html +105 -0
  55. package/docs/functions/_saltcorn_admin_models.tenant.create_tenant.html +107 -0
  56. package/docs/functions/_saltcorn_admin_models.tenant.deleteTenant.html +88 -0
  57. package/docs/functions/_saltcorn_admin_models.tenant.domain_sanitize.html +87 -0
  58. package/docs/functions/_saltcorn_admin_models.tenant.eachTenant.html +91 -0
  59. package/docs/functions/_saltcorn_admin_models.tenant.getAllTenantRows.html +77 -0
  60. package/docs/functions/_saltcorn_admin_models.tenant.getAllTenants.html +77 -0
  61. package/docs/functions/_saltcorn_admin_models.tenant.insertTenant.html +103 -0
  62. package/docs/functions/_saltcorn_admin_models.tenant.switchToTenant.html +92 -0
  63. package/docs/functions/_saltcorn_common_code.buildTableCaches.html +81 -0
  64. package/docs/functions/_saltcorn_common_code.parseLegacyRelation.html +77 -0
  65. package/docs/functions/_saltcorn_common_code.parseRelationPath.html +76 -0
  66. package/docs/functions/_saltcorn_data.models.config.check_email_mask.html +131 -0
  67. package/docs/functions/_saltcorn_data.models.config.deleteConfig.html +131 -0
  68. package/docs/functions/_saltcorn_data.models.config.getAllConfig.html +125 -0
  69. package/docs/functions/_saltcorn_data.models.config.getConfig.html +134 -0
  70. package/docs/functions/_saltcorn_data.models.config.get_base_url.html +130 -0
  71. package/docs/functions/_saltcorn_data.models.config.get_latest_npm_version.html +132 -0
  72. package/docs/functions/_saltcorn_data.models.config.remove_from_menu.html +131 -0
  73. package/docs/functions/_saltcorn_data.models.config.save_menu_items.html +126 -0
  74. package/docs/functions/_saltcorn_data.models.config.setConfig.html +134 -0
  75. package/docs/functions/_saltcorn_data.models.discovery.discover_tables.html +131 -0
  76. package/docs/functions/_saltcorn_data.models.discovery.discoverable_tables.html +129 -0
  77. package/docs/functions/_saltcorn_data.models.discovery.findType.html +127 -0
  78. package/docs/functions/_saltcorn_data.models.discovery.get_existing_views.html +127 -0
  79. package/docs/functions/_saltcorn_data.models.discovery.implement_discovery.html +129 -0
  80. package/docs/functions/_saltcorn_data.models.email.getMailTransport.html +114 -0
  81. package/docs/functions/_saltcorn_data.models.email.send_verification_email.html +130 -0
  82. package/docs/functions/_saltcorn_data.models.email.viewToEmailHtml.html +130 -0
  83. package/docs/functions/_saltcorn_data.models.expression.apply_calculated_fields.html +131 -0
  84. package/docs/functions/_saltcorn_data.models.expression.apply_calculated_fields_stored.html +131 -0
  85. package/docs/functions/_saltcorn_data.models.expression.eval_expression.html +132 -0
  86. package/docs/functions/_saltcorn_data.models.expression.expressionValidator.html +126 -0
  87. package/docs/functions/_saltcorn_data.models.expression.get_async_expression_function.html +132 -0
  88. package/docs/functions/_saltcorn_data.models.expression.get_expression_function.html +129 -0
  89. package/docs/functions/_saltcorn_data.models.expression.jsexprToWhere.html +131 -0
  90. package/docs/functions/_saltcorn_data.models.expression.recalculate_for_stored.html +132 -0
  91. package/docs/functions/_saltcorn_data.models.expression.transform_for_async.html +134 -0
  92. package/docs/functions/_saltcorn_data.models.layout.eachView.html +128 -0
  93. package/docs/functions/_saltcorn_data.models.layout.getStringsForI18n.html +123 -0
  94. package/docs/functions/_saltcorn_data.models.layout.getViews.html +123 -0
  95. package/docs/functions/_saltcorn_data.models.layout.translateLayout.html +126 -0
  96. package/docs/functions/_saltcorn_data.models.layout.traverse.html +126 -0
  97. package/docs/functions/_saltcorn_data.models.layout.traverseSync.html +126 -0
  98. package/docs/functions/_saltcorn_data.models.random.all_views.html +123 -0
  99. package/docs/functions/_saltcorn_data.models.random.fill_table_row.html +123 -0
  100. package/docs/functions/_saltcorn_data.models.random.initial_view.html +126 -0
  101. package/docs/functions/_saltcorn_data.models.random.random_table.html +120 -0
  102. package/docs/functions/_saltcorn_db_common.buildInsertBulkSql.html +127 -0
  103. package/docs/functions/_saltcorn_db_common.buildInsertSql.html +128 -0
  104. package/docs/functions/_saltcorn_db_common.doCount.html +110 -0
  105. package/docs/functions/_saltcorn_db_common.doDeleteWhere.html +110 -0
  106. package/docs/functions/_saltcorn_db_common.doListScTables.html +104 -0
  107. package/docs/functions/_saltcorn_db_common.doListTables.html +104 -0
  108. package/docs/functions/_saltcorn_db_common.doListUserDefinedTables.html +104 -0
  109. package/docs/functions/_saltcorn_db_common.do_add_index.html +120 -0
  110. package/docs/functions/_saltcorn_db_common.do_drop_index.html +120 -0
  111. package/docs/functions/_saltcorn_db_common.ftsFieldsSqlExpr.html +106 -0
  112. package/docs/functions/_saltcorn_db_common.mkSelectOptions.html +108 -0
  113. package/docs/functions/_saltcorn_db_common.mkVal.html +105 -0
  114. package/docs/functions/_saltcorn_db_common.mkWhere.html +110 -0
  115. package/docs/functions/_saltcorn_db_common.multi_tenant.enable_multi_tenant.html +108 -0
  116. package/docs/functions/_saltcorn_db_common.multi_tenant.getTenantSchema.html +110 -0
  117. package/docs/functions/_saltcorn_db_common.multi_tenant.init.html +116 -0
  118. package/docs/functions/_saltcorn_db_common.multi_tenant.is_it_multi_tenant.html +110 -0
  119. package/docs/functions/_saltcorn_db_common.multi_tenant.runWithTenant.html +130 -0
  120. package/docs/functions/_saltcorn_db_common.orderByIsObject.html +102 -0
  121. package/docs/functions/_saltcorn_db_common.orderByIsOperator.html +102 -0
  122. package/docs/functions/_saltcorn_db_common.prefixFieldsInWhere.html +104 -0
  123. package/docs/functions/_saltcorn_db_common.reprAsJson.html +107 -0
  124. package/docs/functions/_saltcorn_db_common.single_tenant.enable_multi_tenant.html +107 -0
  125. package/docs/functions/_saltcorn_db_common.single_tenant.getTenantSchema.html +109 -0
  126. package/docs/functions/_saltcorn_db_common.single_tenant.init.html +115 -0
  127. package/docs/functions/_saltcorn_db_common.single_tenant.is_it_multi_tenant.html +109 -0
  128. package/docs/functions/_saltcorn_db_common.single_tenant.runWithTenant.html +129 -0
  129. package/docs/functions/_saltcorn_db_common.sqlBinOp.html +111 -0
  130. package/docs/functions/_saltcorn_db_common.sqlFun.html +111 -0
  131. package/docs/functions/_saltcorn_db_common.sqlsanitize.html +108 -0
  132. package/docs/functions/_saltcorn_db_common.sqlsanitizeAllowDots.html +110 -0
  133. package/docs/functions/_saltcorn_db_common.subSelectWhere.html +133 -0
  134. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.buildTablesFile.html +110 -0
  135. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyPrepopulatedDb.html +100 -0
  136. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyServerFiles.html +104 -0
  137. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyShareExtFiles.html +98 -0
  138. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copySiteLogo.html +102 -0
  139. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyTranslationFiles.html +104 -0
  140. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.createSqliteDb.html +105 -0
  141. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.decodeProvisioningProfile.html +100 -0
  142. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.extractDomain.html +98 -0
  143. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.generateAndroidVersionCode.html +98 -0
  144. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyAndroidManifest.html +102 -0
  145. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyConfigXml.html +100 -0
  146. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyGradleConfig.html +100 -0
  147. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyInfoPlist.html +100 -0
  148. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyXcodeProjectFile.html +107 -0
  149. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepAppIcon.html +100 -0
  150. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareAppIcon.html +109 -0
  151. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareBuildDir.html +110 -0
  152. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareExportOptionsPlist.html +98 -0
  153. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareSplashIcon.html +110 -0
  154. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareSplashPage.html +119 -0
  155. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeCapacitorConfig.html +100 -0
  156. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeCfgFile.html +102 -0
  157. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeDataExtractionRules.html +98 -0
  158. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeNetworkSecurityConfig.html +100 -0
  159. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writePodfile.html +98 -0
  160. package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writePrivacyInfo.html +98 -0
  161. package/docs/functions/_saltcorn_mobile_builder.package_bundle_utils.bundleMobileAppCode.html +73 -0
  162. package/docs/functions/_saltcorn_mobile_builder.package_bundle_utils.bundlePackagesAndPlugins.html +82 -0
  163. package/docs/functions/_saltcorn_mobile_builder.package_bundle_utils.copyPublicDirs.html +80 -0
  164. package/docs/functions/_saltcorn_sqlite.add_index.html +105 -0
  165. package/docs/functions/_saltcorn_sqlite.add_unique_constraint.html +105 -0
  166. package/docs/functions/_saltcorn_sqlite.begin.html +92 -0
  167. package/docs/functions/_saltcorn_sqlite.changeConnection.html +100 -0
  168. package/docs/functions/_saltcorn_sqlite.close.html +92 -0
  169. package/docs/functions/_saltcorn_sqlite.commit.html +92 -0
  170. package/docs/functions/_saltcorn_sqlite.count.html +106 -0
  171. package/docs/functions/_saltcorn_sqlite.deleteWhere.html +106 -0
  172. package/docs/functions/_saltcorn_sqlite.dropTable.html +95 -0
  173. package/docs/functions/_saltcorn_sqlite.dropTables.html +95 -0
  174. package/docs/functions/_saltcorn_sqlite.drop_index.html +105 -0
  175. package/docs/functions/_saltcorn_sqlite.drop_reset_schema.html +94 -0
  176. package/docs/functions/_saltcorn_sqlite.drop_unique_constraint.html +105 -0
  177. package/docs/functions/_saltcorn_sqlite.getVersion.html +93 -0
  178. package/docs/functions/_saltcorn_sqlite.get_db_filepath.html +92 -0
  179. package/docs/functions/_saltcorn_sqlite.get_sql_logging.html +92 -0
  180. package/docs/functions/_saltcorn_sqlite.init.html +105 -0
  181. package/docs/functions/_saltcorn_sqlite.insert.html +113 -0
  182. package/docs/functions/_saltcorn_sqlite.listScTables.html +89 -0
  183. package/docs/functions/_saltcorn_sqlite.listTables.html +89 -0
  184. package/docs/functions/_saltcorn_sqlite.listUserDefinedTables.html +89 -0
  185. package/docs/functions/_saltcorn_sqlite.query.html +98 -0
  186. package/docs/functions/_saltcorn_sqlite.rollback.html +92 -0
  187. package/docs/functions/_saltcorn_sqlite.select.html +108 -0
  188. package/docs/functions/_saltcorn_sqlite.selectMaybeOne.html +110 -0
  189. package/docs/functions/_saltcorn_sqlite.selectOne.html +109 -0
  190. package/docs/functions/_saltcorn_sqlite.set_sql_logging.html +96 -0
  191. package/docs/functions/_saltcorn_sqlite.slugify.html +93 -0
  192. package/docs/functions/_saltcorn_sqlite.sql_log.html +104 -0
  193. package/docs/functions/_saltcorn_sqlite.update.html +111 -0
  194. package/docs/functions/_saltcorn_sqlite.updateWhere.html +97 -0
  195. package/docs/functions/_saltcorn_sqlite_mobile.add_index.html +95 -0
  196. package/docs/functions/_saltcorn_sqlite_mobile.add_unique_constraint.html +95 -0
  197. package/docs/functions/_saltcorn_sqlite_mobile.count.html +88 -0
  198. package/docs/functions/_saltcorn_sqlite_mobile.deleteWhere.html +85 -0
  199. package/docs/functions/_saltcorn_sqlite_mobile.drop_index.html +95 -0
  200. package/docs/functions/_saltcorn_sqlite_mobile.drop_reset_schema.html +78 -0
  201. package/docs/functions/_saltcorn_sqlite_mobile.drop_unique_constraint.html +95 -0
  202. package/docs/functions/_saltcorn_sqlite_mobile.init.html +78 -0
  203. package/docs/functions/_saltcorn_sqlite_mobile.insert.html +96 -0
  204. package/docs/functions/_saltcorn_sqlite_mobile.insertRows.html +94 -0
  205. package/docs/functions/_saltcorn_sqlite_mobile.listScTables.html +79 -0
  206. package/docs/functions/_saltcorn_sqlite_mobile.listTables.html +79 -0
  207. package/docs/functions/_saltcorn_sqlite_mobile.listUserDefinedTables.html +79 -0
  208. package/docs/functions/_saltcorn_sqlite_mobile.query.html +85 -0
  209. package/docs/functions/_saltcorn_sqlite_mobile.select.html +87 -0
  210. package/docs/functions/_saltcorn_sqlite_mobile.selectMaybeOne.html +88 -0
  211. package/docs/functions/_saltcorn_sqlite_mobile.selectOne.html +88 -0
  212. package/docs/functions/_saltcorn_sqlite_mobile.setConnectionObject.html +85 -0
  213. package/docs/functions/_saltcorn_sqlite_mobile.tableExists.html +87 -0
  214. package/docs/functions/_saltcorn_sqlite_mobile.time.html +78 -0
  215. package/docs/functions/_saltcorn_sqlite_mobile.update.html +97 -0
  216. package/docs/functions/_saltcorn_types.ModelAbstracts.abstract_field.instanceOfField.html +88 -0
  217. package/docs/functions/_saltcorn_types.ModelAbstracts.abstract_page.instanceOfPage.html +87 -0
  218. package/docs/functions/_saltcorn_types.ModelAbstracts.abstract_view.instanceOfView.html +87 -0
  219. package/docs/functions/_saltcorn_types.Types.base_types.instanceOWithHtmlFile.html +107 -0
  220. package/docs/functions/_saltcorn_types.Types.common_types.instanceOfErrorMsg.html +84 -0
  221. package/docs/functions/_saltcorn_types.Types.common_types.instanceOfSuccessMsg.html +84 -0
  222. package/docs/functions/_saltcorn_types.Types.common_types.instanceOfType.html +84 -0
  223. package/docs/functions/_saltcorn_types.generators.generateBool.html +68 -0
  224. package/docs/functions/_saltcorn_types.generators.generateString.html +75 -0
  225. package/docs/functions/_saltcorn_types.generators.num_between.html +75 -0
  226. package/docs/functions/_saltcorn_types.generators.oneOf.html +73 -0
  227. package/docs/index.html +56 -0
  228. package/docs/interfaces/_saltcorn_mobile_builder.common_build_utils.ScCapacitorConfig.html +169 -0
  229. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_field.AbstractField.html +187 -0
  230. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_field.AbstractFieldRepeat.html +110 -0
  231. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_form.AbstractForm.html +268 -0
  232. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_page.AbstractPage.html +153 -0
  233. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_role.AbstractRole.html +108 -0
  234. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_table.AbstractTable.html +147 -0
  235. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_trigger.AbstractTrigger.html +224 -0
  236. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_view.AbstractView.html +174 -0
  237. package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_workflow.AbstractWorkflow.html +264 -0
  238. package/docs/modules/_saltcorn_admin_models.backup.html +74 -0
  239. package/docs/modules/_saltcorn_admin_models.html +68 -0
  240. package/docs/modules/_saltcorn_admin_models.pack.html +100 -0
  241. package/docs/modules/_saltcorn_admin_models.tenant.html +86 -0
  242. package/docs/modules/_saltcorn_common_code.html +77 -0
  243. package/docs/modules/_saltcorn_data.html +476 -0
  244. package/docs/modules/_saltcorn_data.models.Crash.html +113 -0
  245. package/docs/modules/_saltcorn_data.models.EventLog.html +113 -0
  246. package/docs/modules/_saltcorn_data.models.FieldRepeat.html +113 -0
  247. package/docs/modules/_saltcorn_data.models.File.html +113 -0
  248. package/docs/modules/_saltcorn_data.models.Form.html +115 -0
  249. package/docs/modules/_saltcorn_data.models.PageGroup.html +113 -0
  250. package/docs/modules/_saltcorn_data.models.Table.html +117 -0
  251. package/docs/modules/_saltcorn_data.models.TableConstraint.html +113 -0
  252. package/docs/modules/_saltcorn_data.models.User.html +113 -0
  253. package/docs/modules/_saltcorn_data.models.View.html +113 -0
  254. package/docs/modules/_saltcorn_data.models.Workflow.html +113 -0
  255. package/docs/modules/_saltcorn_data.models.config.html +135 -0
  256. package/docs/modules/_saltcorn_data.models.discovery.html +120 -0
  257. package/docs/modules/_saltcorn_data.models.email.html +116 -0
  258. package/docs/modules/_saltcorn_data.models.expression.html +128 -0
  259. package/docs/modules/_saltcorn_data.models.html +150 -0
  260. package/docs/modules/_saltcorn_data.models.layout.html +122 -0
  261. package/docs/modules/_saltcorn_data.models.random.html +118 -0
  262. package/docs/modules/_saltcorn_data.models.scheduler.html +112 -0
  263. package/docs/modules/_saltcorn_data.plugin_helper.html +70 -0
  264. package/docs/modules/_saltcorn_data.utils.html +72 -0
  265. package/docs/modules/_saltcorn_db_common.html +181 -0
  266. package/docs/modules/_saltcorn_db_common.multi_tenant.html +120 -0
  267. package/docs/modules/_saltcorn_db_common.single_tenant.html +115 -0
  268. package/docs/modules/_saltcorn_markup.html +399 -0
  269. package/docs/modules/_saltcorn_mobile_builder.common_build_utils.html +124 -0
  270. package/docs/modules/_saltcorn_mobile_builder.html +75 -0
  271. package/docs/modules/_saltcorn_mobile_builder.package_bundle_utils.html +71 -0
  272. package/docs/modules/_saltcorn_sqlite.html +123 -0
  273. package/docs/modules/_saltcorn_sqlite_mobile.html +103 -0
  274. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_field.html +94 -0
  275. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_form.html +85 -0
  276. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_library.html +82 -0
  277. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_page.html +92 -0
  278. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_plugin.html +82 -0
  279. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_role.html +87 -0
  280. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_table.html +87 -0
  281. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_trigger.html +87 -0
  282. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_view.html +92 -0
  283. package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_workflow.html +87 -0
  284. package/docs/modules/_saltcorn_types.ModelAbstracts.html +88 -0
  285. package/docs/modules/_saltcorn_types.Types.base_types.html +141 -0
  286. package/docs/modules/_saltcorn_types.Types.common_types.html +91 -0
  287. package/docs/modules/_saltcorn_types.Types.html +68 -0
  288. package/docs/modules/_saltcorn_types.generators.html +76 -0
  289. package/docs/modules/_saltcorn_types.html +67 -0
  290. package/docs/types/_saltcorn_data.models.Crash.CrashCfg.html +128 -0
  291. package/docs/types/_saltcorn_data.models.EventLog.EventLogCfg.html +122 -0
  292. package/docs/types/_saltcorn_data.models.FieldRepeat.FieldRepeatCfg.html +126 -0
  293. package/docs/types/_saltcorn_data.models.File.FileCfg.html +132 -0
  294. package/docs/types/_saltcorn_data.models.Form.AdditionalButton.html +108 -0
  295. package/docs/types/_saltcorn_data.models.Form.FormCfg.html +180 -0
  296. package/docs/types/_saltcorn_data.models.PageGroup.ScreenInfoParams.html +118 -0
  297. package/docs/types/_saltcorn_data.models.Table.ChildRelations.html +116 -0
  298. package/docs/types/_saltcorn_data.models.Table.ParentRelations.html +116 -0
  299. package/docs/types/_saltcorn_data.models.Table.RelationData.html +116 -0
  300. package/docs/types/_saltcorn_data.models.TableConstraint.TableConstraintCfg.html +120 -0
  301. package/docs/types/_saltcorn_data.models.User.UserCfg.html +138 -0
  302. package/docs/types/_saltcorn_data.models.View.FindViewsPred.html +127 -0
  303. package/docs/types/_saltcorn_data.models.Workflow.WorkflowCfg.html +161 -0
  304. package/docs/types/_saltcorn_db_common.AggregationOptions.html +114 -0
  305. package/docs/types/_saltcorn_db_common.CoordOpts.html +104 -0
  306. package/docs/types/_saltcorn_db_common.JoinField.html +106 -0
  307. package/docs/types/_saltcorn_db_common.JoinFields.html +98 -0
  308. package/docs/types/_saltcorn_db_common.JoinOptions.html +107 -0
  309. package/docs/types/_saltcorn_db_common.JsonPath.html +93 -0
  310. package/docs/types/_saltcorn_db_common.JsonPathElem.html +93 -0
  311. package/docs/types/_saltcorn_db_common.Operator.html +102 -0
  312. package/docs/types/_saltcorn_db_common.PrimaryKeyValue.html +93 -0
  313. package/docs/types/_saltcorn_db_common.Row.html +98 -0
  314. package/docs/types/_saltcorn_db_common.SelectOptions.html +132 -0
  315. package/docs/types/_saltcorn_db_common.SqlAndValues.html +104 -0
  316. package/docs/types/_saltcorn_db_common.SubselectOptions.html +104 -0
  317. package/docs/types/_saltcorn_db_common.Value.html +93 -0
  318. package/docs/types/_saltcorn_db_common.Where.html +115 -0
  319. package/docs/types/_saltcorn_mobile_builder.IosCfg.html +76 -0
  320. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_field.FieldCfg.html +168 -0
  321. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_field.InputType.html +79 -0
  322. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_form.AdditionalButton.html +87 -0
  323. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_library.LibraryCfg.html +87 -0
  324. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_library.LibraryPack.html +79 -0
  325. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_page.PageCfg.html +97 -0
  326. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_page.PagePack.html +85 -0
  327. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_plugin.PluginCfg.html +103 -0
  328. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_plugin.PluginPack.html +79 -0
  329. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_role.RoleCfg.html +84 -0
  330. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_role.RolePack.html +80 -0
  331. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_table.TableCfg.html +111 -0
  332. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_table.TablePack.html +86 -0
  333. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_trigger.TriggerCfg.html +104 -0
  334. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_trigger.TriggerPack.html +80 -0
  335. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_view.ViewCfg.html +109 -0
  336. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_view.ViewPack.html +89 -0
  337. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_workflow.ConfigWorkflowStep.html +97 -0
  338. package/docs/types/_saltcorn_types.ModelAbstracts.abstract_workflow.RunResult.html +100 -0
  339. package/docs/types/_saltcorn_types.Types.base_types.Action.html +189 -0
  340. package/docs/types/_saltcorn_types.Types.base_types.AuthenticationMethod.html +109 -0
  341. package/docs/types/_saltcorn_types.Types.base_types.CodePagePack.html +107 -0
  342. package/docs/types/_saltcorn_types.Types.base_types.Column.html +103 -0
  343. package/docs/types/_saltcorn_types.Types.base_types.ConnectedObjects.html +109 -0
  344. package/docs/types/_saltcorn_types.Types.base_types.CopilotSkill.html +149 -0
  345. package/docs/types/_saltcorn_types.Types.base_types.FieldLike.html +98 -0
  346. package/docs/types/_saltcorn_types.Types.base_types.FieldView.html +166 -0
  347. package/docs/types/_saltcorn_types.Types.base_types.Header.html +107 -0
  348. package/docs/types/_saltcorn_types.Types.base_types.JoinFieldOption.html +109 -0
  349. package/docs/types/_saltcorn_types.Types.base_types.Layout.html +98 -0
  350. package/docs/types/_saltcorn_types.Types.base_types.MobileConfig.html +133 -0
  351. package/docs/types/_saltcorn_types.Types.base_types.ModelPattern.html +261 -0
  352. package/docs/types/_saltcorn_types.Types.base_types.Pack.html +129 -0
  353. package/docs/types/_saltcorn_types.Types.base_types.Plugin.html +122 -0
  354. package/docs/types/_saltcorn_types.Types.base_types.PluginFunction.html +120 -0
  355. package/docs/types/_saltcorn_types.Types.base_types.PluginLayout.html +116 -0
  356. package/docs/types/_saltcorn_types.Types.base_types.PluginRoute.html +125 -0
  357. package/docs/types/_saltcorn_types.Types.base_types.PluginSourceType.html +98 -0
  358. package/docs/types/_saltcorn_types.Types.base_types.PluginType.html +183 -0
  359. package/docs/types/_saltcorn_types.Types.base_types.PluginWrap.html +111 -0
  360. package/docs/types/_saltcorn_types.Types.base_types.PluginWrapArg.html +122 -0
  361. package/docs/types/_saltcorn_types.Types.base_types.RelationOption.html +105 -0
  362. package/docs/types/_saltcorn_types.Types.base_types.Req.html +178 -0
  363. package/docs/types/_saltcorn_types.Types.base_types.Res.html +168 -0
  364. package/docs/types/_saltcorn_types.Types.base_types.RouteAction.html +121 -0
  365. package/docs/types/_saltcorn_types.Types.base_types.RunExtra.html +103 -0
  366. package/docs/types/_saltcorn_types.Types.base_types.TableProvider.html +140 -0
  367. package/docs/types/_saltcorn_types.Types.base_types.TableQuery.html +129 -0
  368. package/docs/types/_saltcorn_types.Types.base_types.Tablely.html +103 -0
  369. package/docs/types/_saltcorn_types.Types.base_types.ViewTemplate.html +471 -0
  370. package/docs/types/_saltcorn_types.Types.common_types.ErrorMessage.html +84 -0
  371. package/docs/types/_saltcorn_types.Types.common_types.GenObj.html +80 -0
  372. package/docs/types/_saltcorn_types.Types.common_types.ReqRes.html +82 -0
  373. package/docs/types/_saltcorn_types.Types.common_types.ResultMessage.html +75 -0
  374. package/docs/types/_saltcorn_types.Types.common_types.SuccessMessage.html +86 -0
  375. package/docs/types/_saltcorn_types.Types.common_types.Type.html +144 -0
  376. package/docs/variables/_saltcorn_data.db.html +60 -0
  377. package/docs/variables/_saltcorn_data.migrations.html +60 -0
  378. package/docs/variables/_saltcorn_data.models.config.available_languages.html +154 -0
  379. package/docs/variables/_saltcorn_data.models.config.configTypes.html +117 -0
  380. package/docs/variables/_saltcorn_data.models.scheduler.runScheduler.html +152 -0
  381. package/docs/variables/_saltcorn_data.plugin_helper.run_action_column.html +65 -0
  382. package/docs/variables/_saltcorn_data.utils.NotAuthorized.html +66 -0
  383. package/docs/variables/_saltcorn_data.utils.sleep.html +66 -0
  384. package/docs/variables/_saltcorn_db_common.multi_tenant.tenantNamespace.html +103 -0
  385. package/help/Extra state formula.tmd +1 -1
  386. package/help/JavaScript action code.tmd +1 -1
  387. package/locales/ar.json +1289 -4
  388. package/locales/da.json +355 -203
  389. package/locales/de.json +665 -149
  390. package/locales/en.json +16 -1
  391. package/locales/es.json +1567 -1271
  392. package/locales/fr.json +1562 -294
  393. package/locales/hi.json +1563 -0
  394. package/locales/pt.json +1300 -11
  395. package/locales/ru.json +1577 -1222
  396. package/locales/si.json +402 -4
  397. package/locales/uk.json +399 -3
  398. package/locales/zh.json +689 -7
  399. package/markup/admin.js +32 -14
  400. package/package.json +9 -9
  401. package/public/gridedit.js +4 -2
  402. package/public/saltcorn-common.js +45 -13
  403. package/public/saltcorn.js +17 -28
  404. package/routes/actions.js +4 -42
  405. package/routes/admin.js +78 -43
  406. package/routes/api.js +9 -9
  407. package/routes/delete.js +4 -2
  408. package/routes/eventlog.js +64 -27
  409. package/routes/fields.js +25 -14
  410. package/routes/files.js +9 -9
  411. package/routes/infoarch.js +57 -2
  412. package/routes/list.js +6 -4
  413. package/routes/pageedit.js +1 -1
  414. package/routes/plugins.js +36 -1
  415. package/routes/search.js +7 -3
  416. package/routes/tables.js +207 -28
  417. package/tests/admin.test.js +15 -0
  418. package/wrapper.js +14 -4
package/markup/admin.js CHANGED
@@ -224,15 +224,25 @@ const send_infoarch_page = (args) => {
224
224
  const tenant_list =
225
225
  db.is_it_multi_tenant() &&
226
226
  db.getTenantSchema() === db.connectObj.default_schema;
227
- const isUserAdmin = args.req?.user.role_id === 1;
227
+ const role = args.req?.user.role_id || 100;
228
+ const isUserAdmin = role === 1;
229
+ const state = getState();
230
+ const canEditMenu = state.getConfig("min_role_edit_menu", 1) >= role;
231
+ const canEditSearch = state.getConfig("min_role_edit_search", 1) >= role;
232
+ const canCreateSnapshot =
233
+ state.getConfig("min_role_create_snapshots", 1) >= role && role > 1;
234
+
228
235
  return send_settings_page({
229
236
  main_section: "Site structure",
230
237
  main_section_href: "/site-structure",
231
238
  sub_sections: [
232
- { text: "Menu", href: "/menu" },
239
+ ...(canEditMenu ? [{ text: "Menu", href: "/menu" }] : []),
240
+ ...(canEditSearch ? [{ text: "Search", href: "/search/config" }] : []),
241
+ ...(canCreateSnapshot
242
+ ? [{ text: "Snapshots", href: "/site-structure/create-snapshot" }]
243
+ : []),
233
244
  ...(isUserAdmin
234
245
  ? [
235
- { text: "Search", href: "/search/config" },
236
246
  { text: "Library", href: "/library/list" },
237
247
  { text: "Languages", href: "/site-structure/localizer" },
238
248
  ...(tenant_list
@@ -281,14 +291,22 @@ const send_users_page = (args) => {
281
291
  * @returns {void}
282
292
  */
283
293
  const send_files_page = (args) => {
294
+ const isUserAdmin = args.req?.user.role_id === 1;
284
295
  return send_settings_page({
285
296
  main_section: "Files",
286
297
  main_section_href: "/files",
287
- sub_sections: [
288
- { text: "Files", href: "/files" },
289
- { text: "Storage", href: "/files/storage" },
290
- { text: "Settings", href: "/files/settings" },
291
- ],
298
+ no_nav_pills: !isUserAdmin,
299
+ sub_sections: isUserAdmin
300
+ ? [
301
+ { text: "Files", href: "/files" },
302
+ ...(isUserAdmin
303
+ ? [
304
+ { text: "Storage", href: "/files/storage" },
305
+ { text: "Settings", href: "/files/settings" },
306
+ ]
307
+ : []),
308
+ ]
309
+ : null,
292
310
  ...args,
293
311
  });
294
312
  };
@@ -482,8 +500,8 @@ const config_fields_form = async ({
482
500
  isView || isRole || isTenant
483
501
  ? "String"
484
502
  : configTypes[name].input_type
485
- ? undefined
486
- : configTypes[name].type,
503
+ ? undefined
504
+ : configTypes[name].type,
487
505
  input_type: configTypes[name].input_type,
488
506
  showIf,
489
507
  help: configTypes[name].helpTopic
@@ -492,10 +510,10 @@ const config_fields_form = async ({
492
510
  attributes: isView
493
511
  ? await viewAttributes(name)
494
512
  : isRole
495
- ? roleAttribs
496
- : isTenant
497
- ? await getTenants()
498
- : configTypes[name].attributes,
513
+ ? roleAttribs
514
+ : isTenant
515
+ ? await getTenants()
516
+ : configTypes[name].attributes,
499
517
  });
500
518
  }
501
519
  const form = new Form({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "1.1.2-beta.9",
3
+ "version": "1.1.2",
4
4
  "description": "Server app for Saltcorn, open-source no-code platform",
5
5
  "homepage": "https://saltcorn.com",
6
6
  "main": "index.js",
@@ -8,14 +8,14 @@
8
8
  "dependencies": {
9
9
  "@aws-sdk/client-s3": "^3.735.0",
10
10
  "@dr.pogodin/csurf": "^1.14.1",
11
- "@saltcorn/base-plugin": "1.1.2-beta.9",
12
- "@saltcorn/builder": "1.1.2-beta.9",
13
- "@saltcorn/data": "1.1.2-beta.9",
14
- "@saltcorn/admin-models": "1.1.2-beta.9",
15
- "@saltcorn/filemanager": "1.1.2-beta.9",
16
- "@saltcorn/markup": "1.1.2-beta.9",
17
- "@saltcorn/plugins-loader": "1.1.2-beta.9",
18
- "@saltcorn/sbadmin2": "1.1.2-beta.9",
11
+ "@saltcorn/base-plugin": "1.1.2",
12
+ "@saltcorn/builder": "1.1.2",
13
+ "@saltcorn/data": "1.1.2",
14
+ "@saltcorn/admin-models": "1.1.2",
15
+ "@saltcorn/filemanager": "1.1.2",
16
+ "@saltcorn/markup": "1.1.2",
17
+ "@saltcorn/plugins-loader": "1.1.2",
18
+ "@saltcorn/sbadmin2": "1.1.2",
19
19
  "@socket.io/cluster-adapter": "^0.2.1",
20
20
  "@socket.io/sticky": "^1.0.1",
21
21
  "adm-zip": "0.5.16",
@@ -164,13 +164,15 @@ function delete_tabulator_row(e, cell) {
164
164
  def?.formatterParams?.tableName || window.tabulator_table_name;
165
165
 
166
166
  const row = cell.getRow().getData();
167
- if (!row.id) {
167
+
168
+ const pk_name = window.tabulator_table_primary_key || "id";
169
+ if (!row[pk_name]) {
168
170
  cell.getRow().delete();
169
171
  return;
170
172
  }
171
173
  $.ajax({
172
174
  type: "DELETE",
173
- url: `/api/${tableName}/${row.id}`,
175
+ url: `/api/${tableName}/${row[pk_name]}`,
174
176
  data: row, // to process primary keys different from id
175
177
  headers: {
176
178
  "CSRF-Token": _sc_globalCsrf,
@@ -318,11 +318,11 @@ function apply_showif() {
318
318
  a.label === dynwhere.neutral_label
319
319
  ? -1
320
320
  : b.label === dynwhere.neutral_label
321
- ? 1
322
- : (a.label?.toLowerCase?.() || a.label) >
323
- (b.label?.toLowerCase?.() || b.label)
324
- ? 1
325
- : -1
321
+ ? 1
322
+ : (a.label?.toLowerCase?.() || a.label) >
323
+ (b.label?.toLowerCase?.() || b.label)
324
+ ? 1
325
+ : -1
326
326
  );
327
327
  if (!dynwhere.required)
328
328
  toAppend.unshift({ label: dynwhere.neutral_label || "", value: "" });
@@ -1120,8 +1120,8 @@ function initialize_page() {
1120
1120
  type === "Integer" || type === "Float"
1121
1121
  ? "number"
1122
1122
  : type === "Bool"
1123
- ? "checkbox"
1124
- : "text"
1123
+ ? "checkbox"
1124
+ : "text"
1125
1125
  }" ${
1126
1126
  type === "Float"
1127
1127
  ? `step="${
@@ -1490,10 +1490,10 @@ function buildToast(txt, type, spin) {
1490
1490
  realtype === "success"
1491
1491
  ? "fa-check-circle"
1492
1492
  : realtype === "danger"
1493
- ? "fa-times-circle"
1494
- : realtype === "warning"
1495
- ? "fa-exclamation-triangle"
1496
- : "";
1493
+ ? "fa-times-circle"
1494
+ : realtype === "warning"
1495
+ ? "fa-exclamation-triangle"
1496
+ : "";
1497
1497
  const isNode = getIsNode();
1498
1498
  const rndid = `tab${Math.floor(Math.random() * 16777215).toString(16)}`;
1499
1499
  return {
@@ -1587,7 +1587,11 @@ function press_store_button(clicked, keepOld, disable) {
1587
1587
  $(btn).data("old-text", oldText);
1588
1588
  }
1589
1589
  const width = $(btn).width();
1590
- $(btn).html('<i class="fas fa-spinner fa-spin"></i>').width(width);
1590
+ const height = $(btn).height();
1591
+ $(btn)
1592
+ .html('<i class="fas fa-spinner fa-spin"></i>')
1593
+ .width(width)
1594
+ .height(height);
1591
1595
  setTimeout(() => {
1592
1596
  $(btn).prop("disabled", true);
1593
1597
  }, 50);
@@ -1597,7 +1601,7 @@ function restore_old_button(btnId) {
1597
1601
  const btn = btnId instanceof jQuery ? btnId : $(`#${btnId}`);
1598
1602
  const oldText = $(btn).data("old-text");
1599
1603
  btn.html(oldText);
1600
- btn.css({ width: "" }).prop("disabled", false);
1604
+ btn.css({ width: "", height: "" }).prop("disabled", false);
1601
1605
  btn.removeData("old-text");
1602
1606
  }
1603
1607
 
@@ -2174,6 +2178,34 @@ function restrict_options(selector, restriction) {
2174
2178
  });
2175
2179
  }
2176
2180
 
2181
+ function handle_identical_fields(event) {
2182
+ let form = null;
2183
+ if (event.currentTarget.tagName === "FORM") form = event.currentTarget;
2184
+ else form = $(event.currentTarget).closest("form")[0];
2185
+ if (!form) {
2186
+ console.warn("No form found");
2187
+ } else {
2188
+ const name = event.target.name;
2189
+ const newValue = event.target.value;
2190
+ const tagName = event.target.tagName;
2191
+ const isRadio = event.target.type === "radio";
2192
+ if (tagName === "SELECT" || isRadio) {
2193
+ form.querySelectorAll(`select[name="${name}"]`).forEach((select) => {
2194
+ $(select).val(newValue); //.trigger("change");
2195
+ });
2196
+ form
2197
+ .querySelectorAll(`input[type="radio"][name="${name}"]`)
2198
+ .forEach((input) => {
2199
+ input.checked = input.value === newValue;
2200
+ });
2201
+ } else if (tagName === "INPUT") {
2202
+ form.querySelectorAll(`input[name="${name}"]`).forEach((input) => {
2203
+ input.value = newValue;
2204
+ });
2205
+ }
2206
+ }
2207
+ }
2208
+
2177
2209
  const observer = new IntersectionObserver(
2178
2210
  (entries, observer) => {
2179
2211
  entries.forEach((entry) => {
@@ -186,8 +186,8 @@ function pjax_to(href, e) {
186
186
  let $dest = localizer.length
187
187
  ? localizer
188
188
  : inModal
189
- ? $("#scmodal .modal-body")
190
- : $("#page-inner-content");
189
+ ? $("#scmodal .modal-body")
190
+ : $("#page-inner-content");
191
191
  if (!$dest.length) window.location.href = href;
192
192
  else {
193
193
  loadPage = false;
@@ -693,7 +693,7 @@ function ajax_post(url, args) {
693
693
  },
694
694
  ...(args || {}),
695
695
  })
696
- .done(ajax_done)
696
+ .done((res) => ajax_done(res))
697
697
  .fail((e, ...more) => {
698
698
  if (!checkNetworkError(e))
699
699
  return ajax_done(
@@ -1322,31 +1322,20 @@ function check_delete_unsaved(tablename, script_tag) {
1322
1322
  }
1323
1323
  }
1324
1324
 
1325
- function handle_identical_fields(event) {
1326
- let form = null;
1327
- if (event.currentTarget.tagName === "FORM") form = event.currentTarget;
1328
- else form = $(event.currentTarget).closest("form")[0];
1329
- if (!form) {
1330
- console.warn("No form found");
1331
- } else {
1332
- const name = event.target.name;
1333
- const newValue = event.target.value;
1334
- const tagName = event.target.tagName;
1335
- const isRadio = event.target.type === "radio";
1336
- if (tagName === "SELECT" || isRadio) {
1337
- form.querySelectorAll(`select[name="${name}"]`).forEach((select) => {
1338
- $(select).val(newValue); //.trigger("change");
1339
- });
1340
- form
1341
- .querySelectorAll(`input[type="radio"][name="${name}"]`)
1342
- .forEach((input) => {
1343
- input.checked = input.value === newValue;
1344
- });
1345
- } else if (tagName === "INPUT") {
1346
- form.querySelectorAll(`input[name="${name}"]`).forEach((input) => {
1347
- input.value = newValue;
1348
- });
1349
- }
1325
+ function cfu_translate(that) {
1326
+ const locale = that.value;
1327
+ const translations = window.cfu_translations[locale];
1328
+ if (translations) {
1329
+ $("button[type=submit]").text(translations.submitLabel);
1330
+ $("h1").text(translations.header);
1331
+ $('form[action="/auth/create_first_user"]')
1332
+ .parent()
1333
+ .find("p")
1334
+ .text(translations.blurb);
1335
+ $("label[for=upload_to_restore] span").text(translations.restore);
1336
+ $("label[for=inputdefault_language]").text(translations.language);
1337
+ $("label[for=inputemail]").text(translations.email);
1338
+ $("label[for=inputpassword]").text(translations.password);
1350
1339
  }
1351
1340
  }
1352
1341
 
package/routes/actions.js CHANGED
@@ -15,10 +15,6 @@ const {
15
15
  const { ppVal, jsIdentifierValidator } = require("@saltcorn/data/utils");
16
16
  const { getState } = require("@saltcorn/data/db/state");
17
17
  const Trigger = require("@saltcorn/data/models/trigger");
18
- const View = require("@saltcorn/data/models/view");
19
- const {
20
- getForm,
21
- } = require("@saltcorn/data/base-plugin/viewtemplates/viewable_fields");
22
18
  const FieldRepeat = require("@saltcorn/data/models/fieldrepeat");
23
19
  const { getTriggerList } = require("./common_lists");
24
20
  const TagEntry = require("@saltcorn/data/models/tag_entry");
@@ -29,6 +25,9 @@ const Tag = require("@saltcorn/data/models/tag");
29
25
  const db = require("@saltcorn/data/db");
30
26
  const MarkdownIt = require("markdown-it"),
31
27
  md = new MarkdownIt();
28
+ const {
29
+ getWorkflowStepUserForm,
30
+ } = require("@saltcorn/data/web-mobile-commons");
32
31
 
33
32
  /**
34
33
  * @type {object}
@@ -653,7 +652,7 @@ const getWorkflowStepForm = async (
653
652
  ...(field.showIf || {}),
654
653
  },
655
654
  };
656
- if (cfgFld.input_type === "code") cfgFld.input_type = "textarea";
655
+ //if (cfgFld.input_type === "code") cfgFld.input_type = "textarea";
657
656
  actionConfigFields.push(cfgFld);
658
657
  }
659
658
  } catch {}
@@ -1690,42 +1689,6 @@ router.post(
1690
1689
  })
1691
1690
  );
1692
1691
 
1693
- const getWorkflowStepUserForm = async (run, trigger, step, req) => {
1694
- if (step.action_name === "EditViewForm") {
1695
- const view = View.findOne({ name: step.configuration.edit_view });
1696
- const table = Table.findOne({ id: view.table_id });
1697
- const form = await getForm(
1698
- table,
1699
- view.name,
1700
- view.configuration.columns,
1701
- view.configuration.layout,
1702
- null,
1703
- req
1704
- );
1705
- await form.fill_fkey_options(false, undefined, req?.user);
1706
- form.action = `/actions/fill-workflow-form/${run.id}`;
1707
- if (run.context[step.configuration.response_variable])
1708
- Object.assign(
1709
- form.values,
1710
- run.context[step.configuration.response_variable]
1711
- );
1712
-
1713
- return form;
1714
- }
1715
-
1716
- let blurb = run.wait_info.output || step.configuration?.form_header || "";
1717
- if (run.wait_info.markdown && run.wait_info.output) blurb = md.render(blurb);
1718
- const form = new Form({
1719
- action: `/actions/fill-workflow-form/${run.id}`,
1720
- submitLabel: run.wait_info.output ? req.__("OK") : req.__("Submit"),
1721
- onSubmit: "press_store_button(this)",
1722
- blurb,
1723
- formStyle: run.wait_info.output || req.xhr ? "vert" : undefined,
1724
- fields: await run.userFormFields(step),
1725
- });
1726
- return form;
1727
- };
1728
-
1729
1692
  router.get(
1730
1693
  "/fill-workflow-form/:id",
1731
1694
  error_catcher(async (req, res) => {
@@ -1854,7 +1817,6 @@ interactive workflows for not logged in
1854
1817
  actions can declare which variables they inject into scope
1855
1818
 
1856
1819
  show unconnected steps
1857
- why is code not initialising
1858
1820
  drag and drop edges
1859
1821
 
1860
1822
  */
package/routes/admin.js CHANGED
@@ -117,6 +117,7 @@ const { get_help_markup } = require("../help/index.js");
117
117
  const Docker = require("dockerode");
118
118
  const npmFetch = require("npm-registry-fetch");
119
119
  const Tag = require("@saltcorn/data/models/tag");
120
+ const PluginInstaller = require("@saltcorn/plugins-loader/plugin_installer.js");
120
121
  const MarkdownIt = require("markdown-it"),
121
122
  md = new MarkdownIt();
122
123
 
@@ -236,6 +237,7 @@ admin_config_route({
236
237
  id: "testemail",
237
238
  href: "/admin/send-test-email",
238
239
  class: "btn btn-primary",
240
+ onclick: "spin_action_link(this)",
239
241
  },
240
242
  req.__("Send test email")
241
243
  ),
@@ -262,12 +264,14 @@ router.get(
262
264
  html: req.__("Hello from Saltcorn"),
263
265
  };
264
266
  try {
265
- await getMailTransport().sendMail(email);
267
+ const sendres = await getMailTransport().sendMail(email);
268
+ getState().log(6, sendres);
266
269
  req.flash(
267
270
  "success",
268
271
  req.__("Email sent to %s with no errors", req.user.email)
269
272
  );
270
273
  } catch (e) {
274
+ console.error(e);
271
275
  req.flash("error", e.message);
272
276
  }
273
277
 
@@ -291,6 +295,22 @@ router.get(
291
295
  })
292
296
  );
293
297
 
298
+ router.get(
299
+ "/jsdoc/*filepath",
300
+ isAdminOrHasConfigMinRole("min_role_edit_triggers"),
301
+ error_catcher(async (req, res) => {
302
+ const fullPath = File.normalise_in_base(
303
+ path.join(__dirname, "..", "docs"),
304
+ ...req.params.filepath
305
+ );
306
+ if (fs.existsSync(fullPath)) res.sendFile(fullPath);
307
+ else {
308
+ res.status(404);
309
+ res.sendWrap(`File not found`, { above: ["Help file not found"] });
310
+ }
311
+ })
312
+ );
313
+
294
314
  router.get(
295
315
  "/whatsnew",
296
316
  isAdmin,
@@ -384,6 +404,7 @@ router.get(
384
404
  req.csrfToken(),
385
405
  {
386
406
  btnClass: "btn-outline-primary",
407
+ spinner: true,
387
408
  }
388
409
  )
389
410
  ),
@@ -709,8 +730,8 @@ router.post(
709
730
  type === "trigger"
710
731
  ? `/actions`
711
732
  : /^[a-z]+$/g.test(type)
712
- ? `/${type}edit`
713
- : "/"
733
+ ? `/${type}edit`
734
+ : "/"
714
735
  );
715
736
  })
716
737
  );
@@ -837,7 +858,8 @@ const autoBackupForm = (req) => {
837
858
  label: req.__("Backup now"),
838
859
  id: "btnBackupNow",
839
860
  class: "btn btn-outline-secondary",
840
- onclick: "ajax_post('/admin/auto-backup-now')",
861
+ onclick:
862
+ "ajax_post('/admin/auto-backup-now');press_store_button(this);",
841
863
  },
842
864
  ],
843
865
  fields: [
@@ -1195,7 +1217,7 @@ router.get(
1195
1217
  th({ valign: "top" }, req.__("Saltcorn version")),
1196
1218
  td(
1197
1219
  packagejson.version,
1198
- isRoot
1220
+ isRoot && can_update
1199
1221
  ? post_btn(
1200
1222
  "/admin/upgrade",
1201
1223
  req.__("Upgrade") + " (latest)",
@@ -1206,21 +1228,22 @@ router.get(
1206
1228
  }
1207
1229
  )
1208
1230
  : isRoot && is_latest
1209
- ? span(
1210
- { class: "badge bg-primary ms-2" },
1211
- req.__("Latest")
1212
- ) +
1213
- post_btn(
1214
- "/admin/check-for-upgrade",
1215
- req.__("Check updates"),
1216
- req.csrfToken(),
1217
- {
1218
- btnClass: "btn-primary btn-sm px-1 py-0",
1219
- formClass: "d-inline",
1220
- }
1221
- )
1222
- : "",
1223
- !git_commit &&
1231
+ ? span(
1232
+ { class: "badge bg-primary ms-2" },
1233
+ req.__("Latest")
1234
+ ) +
1235
+ post_btn(
1236
+ "/admin/check-for-upgrade",
1237
+ req.__("Check updates"),
1238
+ req.csrfToken(),
1239
+ {
1240
+ btnClass: "btn-primary btn-sm px-1 py-0",
1241
+ formClass: "d-inline",
1242
+ }
1243
+ )
1244
+ : "",
1245
+ isRoot &&
1246
+ !git_commit &&
1224
1247
  a(
1225
1248
  {
1226
1249
  id: rndid,
@@ -1560,24 +1583,34 @@ const cleanNodeModules = async () => {
1560
1583
  throw new Error(
1561
1584
  `'${topSaltcornDir}' is not a Saltcorn installation directory`
1562
1585
  );
1586
+ await PluginInstaller.cleanPluginsDirectory();
1563
1587
  };
1564
1588
 
1565
1589
  const doInstall = async (req, res, version, deepClean, runPull) => {
1590
+ const state = getState();
1591
+ let res_write = (s) => {
1592
+ try {
1593
+ res.write(s);
1594
+ state.log(5, s);
1595
+ } catch (e) {
1596
+ console.error("Install write error: ", e?.message || e);
1597
+ }
1598
+ };
1566
1599
  if (db.getTenantSchema() !== db.connectObj.default_schema) {
1567
1600
  req.flash("error", req.__("Not possible for tenant"));
1568
1601
  res.redirect("/admin");
1569
1602
  } else {
1570
- res.write(
1603
+ res_write(
1571
1604
  version === "latest"
1572
1605
  ? req.__("Starting upgrade, please wait...\n")
1573
1606
  : req.__("Installing %s, please wait...\n", version)
1574
1607
  );
1575
1608
  if (deepClean) {
1576
- res.write(req.__("Cleaning node_modules...\n"));
1609
+ res_write(req.__("Cleaning node_modules...\n"));
1577
1610
  try {
1578
1611
  await cleanNodeModules();
1579
1612
  } catch (e) {
1580
- res.write(req.__("Error cleaning node_modules: %s\n", e.message));
1613
+ res_write(req.__("Error cleaning node_modules: %s\n", e.message));
1581
1614
  }
1582
1615
  }
1583
1616
  const child = spawn(
@@ -1588,33 +1621,37 @@ const doInstall = async (req, res, version, deepClean, runPull) => {
1588
1621
  }
1589
1622
  );
1590
1623
  child.stdout.on("data", (data) => {
1591
- res.write(data);
1624
+ res_write(data);
1592
1625
  });
1593
1626
  child.stderr?.on("data", (data) => {
1594
- res.write(data);
1627
+ res_write(data);
1595
1628
  });
1596
1629
  child.on("exit", async function (code, signal) {
1597
1630
  if (code === 0) {
1598
1631
  if (deepClean) {
1599
- res.write(req.__("Installing sd-notify") + "\n");
1632
+ res_write(req.__("Installing sd-notify") + "\n");
1600
1633
  const sdNotifyCode = await tryInstallSdNotify(req, res);
1601
- res.write(
1634
+ res_write(
1602
1635
  req.__("sd-notify install done with code %s", sdNotifyCode) + "\n"
1603
1636
  );
1604
1637
  }
1605
1638
  if (runPull) {
1606
- res.write(
1639
+ res_write(
1607
1640
  req.__("Pulling the capacitor-builder docker image...") + "\n"
1608
1641
  );
1609
1642
  const pullCode = await pullCapacitorBuilder(req, res, version);
1610
- res.write(req.__("Pull done with code %s", pullCode) + "\n");
1643
+ res_write(req.__("Pull done with code %s", pullCode) + "\n");
1611
1644
  if (pullCode === 0) {
1612
- res.write(req.__("Pruning docker...") + "\n");
1645
+ res_write(req.__("Pruning docker...") + "\n");
1613
1646
  const pruneCode = await pruneDocker(req, res);
1614
- res.write(req.__("Prune done with code %s", pruneCode) + "\n");
1647
+ res_write(req.__("Prune done with code %s", pruneCode) + "\n");
1615
1648
  }
1616
1649
  }
1617
1650
  }
1651
+ setTimeout(() => {
1652
+ getState().processSend("RestartServer");
1653
+ process.exit(0);
1654
+ }, 200);
1618
1655
  res.end(
1619
1656
  version === "latest"
1620
1657
  ? req.__(
@@ -1624,10 +1661,6 @@ const doInstall = async (req, res, version, deepClean, runPull) => {
1624
1661
  `Install done with code ${code}.\n\nPress the BACK button in your browser, then RELOAD the page.`
1625
1662
  )
1626
1663
  );
1627
- setTimeout(() => {
1628
- getState().processSend("RestartServer");
1629
- process.exit(0);
1630
- }, 100);
1631
1664
  });
1632
1665
  }
1633
1666
  };
@@ -1974,9 +2007,8 @@ router.get(
1974
2007
  const filename = `${moment(start).format("YYYYMMDDHHmm")}.html`;
1975
2008
  await File.new_folder("configuration_checks");
1976
2009
  const go = async () => {
1977
- const { passes, errors, pass, warnings } = await runConfigurationCheck(
1978
- req
1979
- );
2010
+ const { passes, errors, pass, warnings } =
2011
+ await runConfigurationCheck(req);
1980
2012
  const end = new Date();
1981
2013
  const secs = Math.round((end.getTime() - start.getTime()) / 1000);
1982
2014
 
@@ -3250,8 +3282,8 @@ router.get(
3250
3282
  mode === "prepare"
3251
3283
  ? "_prepare_step"
3252
3284
  : mode === "finish"
3253
- ? "_finish_step"
3254
- : "";
3285
+ ? "_finish_step"
3286
+ : "";
3255
3287
  res.json({
3256
3288
  finished: await checkFiles(out_dir_name, [
3257
3289
  `logs${stepDesc}.txt`,
@@ -3326,8 +3358,8 @@ router.get(
3326
3358
  mode === "prepare"
3327
3359
  ? "_prepare_step"
3328
3360
  : mode === "finish"
3329
- ? "_finish_step"
3330
- : "";
3361
+ ? "_finish_step"
3362
+ : "";
3331
3363
  const resultMsg = files.find(
3332
3364
  (file) => file.filename === `logs${stepDesc}.txt`
3333
3365
  )
@@ -3786,6 +3818,9 @@ router.post(
3786
3818
  }
3787
3819
  if (form.values.triggers) {
3788
3820
  await db.deleteWhere("_sc_tag_entries", { not: { trigger_id: null } });
3821
+ await db.deleteWhere("_sc_workflow_trace");
3822
+ await db.deleteWhere("_sc_workflow_runs");
3823
+ await db.deleteWhere("_sc_workflow_steps");
3789
3824
  await db.deleteWhere("_sc_triggers");
3790
3825
  await getState().refresh_triggers();
3791
3826
  }
@@ -4052,7 +4087,7 @@ router.get(
4052
4087
  "Only functions declared as <code>function name(...) {...}</code> or <code>async function name(...) {...}</code> will be available in formulae and code actions. Declare a constant <code>k</code> as <code>globalThis.k = ...</code> In scope: " +
4053
4088
  a(
4054
4089
  {
4055
- href: "https://saltcorn.github.io/saltcorn/classes/_saltcorn_data.models.Table-1.html",
4090
+ href: "/admin/jsdoc/classes/_saltcorn_data.models.Table-1.html",
4056
4091
  target: "_blank",
4057
4092
  },
4058
4093
  "Table"