@saltcorn/server 1.1.2-beta.9 → 1.1.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/auth/admin.js +8 -1
- package/auth/routes.js +45 -4
- package/docs/.nojekyll +1 -0
- package/docs/assets/custom.css +6 -0
- package/docs/assets/highlight.css +85 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1367 -0
- package/docs/classes/_saltcorn_common_code.Relation.html +162 -0
- package/docs/classes/_saltcorn_common_code.RelationsFinder.html +182 -0
- package/docs/classes/_saltcorn_data.models.Crash-1.html +316 -0
- package/docs/classes/_saltcorn_data.models.EventLog-1.html +350 -0
- package/docs/classes/_saltcorn_data.models.Field.html +949 -0
- package/docs/classes/_saltcorn_data.models.FieldRepeat-1.html +293 -0
- package/docs/classes/_saltcorn_data.models.File-1.html +881 -0
- package/docs/classes/_saltcorn_data.models.Form-1.html +494 -0
- package/docs/classes/_saltcorn_data.models.Library.html +295 -0
- package/docs/classes/_saltcorn_data.models.Page.html +417 -0
- package/docs/classes/_saltcorn_data.models.PageGroup-1.html +500 -0
- package/docs/classes/_saltcorn_data.models.Plugin.html +414 -0
- package/docs/classes/_saltcorn_data.models.Role.html +254 -0
- package/docs/classes/_saltcorn_data.models.Table-1.html +1830 -0
- package/docs/classes/_saltcorn_data.models.TableConstraint-1.html +296 -0
- package/docs/classes/_saltcorn_data.models.Trigger.html +672 -0
- package/docs/classes/_saltcorn_data.models.User-1.html +813 -0
- package/docs/classes/_saltcorn_data.models.View-1.html +878 -0
- package/docs/classes/_saltcorn_data.models.Workflow-1.html +374 -0
- package/docs/classes/_saltcorn_data.models.WorkflowRun.html +529 -0
- package/docs/classes/_saltcorn_data.models.WorkflowStep.html +421 -0
- package/docs/classes/_saltcorn_data.models.WorkflowTrace.html +318 -0
- package/docs/classes/_saltcorn_mobile_builder.MobileBuilder.html +356 -0
- package/docs/enums/_saltcorn_common_code.RelationType.html +115 -0
- package/docs/enums/_saltcorn_common_code.ViewDisplayType.html +94 -0
- package/docs/functions/_saltcorn_admin_models.backup.create_backup.html +76 -0
- package/docs/functions/_saltcorn_admin_models.backup.create_csv_from_rows.html +77 -0
- package/docs/functions/_saltcorn_admin_models.backup.restore.html +93 -0
- package/docs/functions/_saltcorn_admin_models.pack.add_to_menu.html +100 -0
- package/docs/functions/_saltcorn_admin_models.pack.can_install_pack.html +89 -0
- package/docs/functions/_saltcorn_admin_models.pack.fetch_available_packs.html +83 -0
- package/docs/functions/_saltcorn_admin_models.pack.fetch_pack_by_name.html +90 -0
- package/docs/functions/_saltcorn_admin_models.pack.install_pack.html +107 -0
- package/docs/functions/_saltcorn_admin_models.pack.library_pack.html +90 -0
- package/docs/functions/_saltcorn_admin_models.pack.model_instance_pack.html +95 -0
- package/docs/functions/_saltcorn_admin_models.pack.model_pack.html +96 -0
- package/docs/functions/_saltcorn_admin_models.pack.page_group_pack.html +91 -0
- package/docs/functions/_saltcorn_admin_models.pack.page_pack.html +91 -0
- package/docs/functions/_saltcorn_admin_models.pack.plugin_pack.html +89 -0
- package/docs/functions/_saltcorn_admin_models.pack.role_pack.html +90 -0
- package/docs/functions/_saltcorn_admin_models.pack.table_pack.html +90 -0
- package/docs/functions/_saltcorn_admin_models.pack.trigger_pack.html +89 -0
- package/docs/functions/_saltcorn_admin_models.pack.uninstall_pack.html +92 -0
- package/docs/functions/_saltcorn_admin_models.pack.view_pack.html +89 -0
- package/docs/functions/_saltcorn_admin_models.tenant.copy_tenant_template.html +105 -0
- package/docs/functions/_saltcorn_admin_models.tenant.create_tenant.html +107 -0
- package/docs/functions/_saltcorn_admin_models.tenant.deleteTenant.html +88 -0
- package/docs/functions/_saltcorn_admin_models.tenant.domain_sanitize.html +87 -0
- package/docs/functions/_saltcorn_admin_models.tenant.eachTenant.html +91 -0
- package/docs/functions/_saltcorn_admin_models.tenant.getAllTenantRows.html +77 -0
- package/docs/functions/_saltcorn_admin_models.tenant.getAllTenants.html +77 -0
- package/docs/functions/_saltcorn_admin_models.tenant.insertTenant.html +103 -0
- package/docs/functions/_saltcorn_admin_models.tenant.switchToTenant.html +92 -0
- package/docs/functions/_saltcorn_common_code.buildTableCaches.html +81 -0
- package/docs/functions/_saltcorn_common_code.parseLegacyRelation.html +77 -0
- package/docs/functions/_saltcorn_common_code.parseRelationPath.html +76 -0
- package/docs/functions/_saltcorn_data.models.config.check_email_mask.html +131 -0
- package/docs/functions/_saltcorn_data.models.config.deleteConfig.html +131 -0
- package/docs/functions/_saltcorn_data.models.config.getAllConfig.html +125 -0
- package/docs/functions/_saltcorn_data.models.config.getConfig.html +134 -0
- package/docs/functions/_saltcorn_data.models.config.get_base_url.html +130 -0
- package/docs/functions/_saltcorn_data.models.config.get_latest_npm_version.html +132 -0
- package/docs/functions/_saltcorn_data.models.config.remove_from_menu.html +131 -0
- package/docs/functions/_saltcorn_data.models.config.save_menu_items.html +126 -0
- package/docs/functions/_saltcorn_data.models.config.setConfig.html +134 -0
- package/docs/functions/_saltcorn_data.models.discovery.discover_tables.html +131 -0
- package/docs/functions/_saltcorn_data.models.discovery.discoverable_tables.html +129 -0
- package/docs/functions/_saltcorn_data.models.discovery.findType.html +127 -0
- package/docs/functions/_saltcorn_data.models.discovery.get_existing_views.html +127 -0
- package/docs/functions/_saltcorn_data.models.discovery.implement_discovery.html +129 -0
- package/docs/functions/_saltcorn_data.models.email.getMailTransport.html +114 -0
- package/docs/functions/_saltcorn_data.models.email.send_verification_email.html +130 -0
- package/docs/functions/_saltcorn_data.models.email.viewToEmailHtml.html +130 -0
- package/docs/functions/_saltcorn_data.models.expression.apply_calculated_fields.html +131 -0
- package/docs/functions/_saltcorn_data.models.expression.apply_calculated_fields_stored.html +131 -0
- package/docs/functions/_saltcorn_data.models.expression.eval_expression.html +132 -0
- package/docs/functions/_saltcorn_data.models.expression.expressionValidator.html +126 -0
- package/docs/functions/_saltcorn_data.models.expression.get_async_expression_function.html +132 -0
- package/docs/functions/_saltcorn_data.models.expression.get_expression_function.html +129 -0
- package/docs/functions/_saltcorn_data.models.expression.jsexprToWhere.html +131 -0
- package/docs/functions/_saltcorn_data.models.expression.recalculate_for_stored.html +132 -0
- package/docs/functions/_saltcorn_data.models.expression.transform_for_async.html +134 -0
- package/docs/functions/_saltcorn_data.models.layout.eachView.html +128 -0
- package/docs/functions/_saltcorn_data.models.layout.getStringsForI18n.html +123 -0
- package/docs/functions/_saltcorn_data.models.layout.getViews.html +123 -0
- package/docs/functions/_saltcorn_data.models.layout.translateLayout.html +126 -0
- package/docs/functions/_saltcorn_data.models.layout.traverse.html +126 -0
- package/docs/functions/_saltcorn_data.models.layout.traverseSync.html +126 -0
- package/docs/functions/_saltcorn_data.models.random.all_views.html +123 -0
- package/docs/functions/_saltcorn_data.models.random.fill_table_row.html +123 -0
- package/docs/functions/_saltcorn_data.models.random.initial_view.html +126 -0
- package/docs/functions/_saltcorn_data.models.random.random_table.html +120 -0
- package/docs/functions/_saltcorn_db_common.buildInsertBulkSql.html +127 -0
- package/docs/functions/_saltcorn_db_common.buildInsertSql.html +128 -0
- package/docs/functions/_saltcorn_db_common.doCount.html +110 -0
- package/docs/functions/_saltcorn_db_common.doDeleteWhere.html +110 -0
- package/docs/functions/_saltcorn_db_common.doListScTables.html +104 -0
- package/docs/functions/_saltcorn_db_common.doListTables.html +104 -0
- package/docs/functions/_saltcorn_db_common.doListUserDefinedTables.html +104 -0
- package/docs/functions/_saltcorn_db_common.do_add_index.html +120 -0
- package/docs/functions/_saltcorn_db_common.do_drop_index.html +120 -0
- package/docs/functions/_saltcorn_db_common.ftsFieldsSqlExpr.html +106 -0
- package/docs/functions/_saltcorn_db_common.mkSelectOptions.html +108 -0
- package/docs/functions/_saltcorn_db_common.mkVal.html +105 -0
- package/docs/functions/_saltcorn_db_common.mkWhere.html +110 -0
- package/docs/functions/_saltcorn_db_common.multi_tenant.enable_multi_tenant.html +108 -0
- package/docs/functions/_saltcorn_db_common.multi_tenant.getTenantSchema.html +110 -0
- package/docs/functions/_saltcorn_db_common.multi_tenant.init.html +116 -0
- package/docs/functions/_saltcorn_db_common.multi_tenant.is_it_multi_tenant.html +110 -0
- package/docs/functions/_saltcorn_db_common.multi_tenant.runWithTenant.html +130 -0
- package/docs/functions/_saltcorn_db_common.orderByIsObject.html +102 -0
- package/docs/functions/_saltcorn_db_common.orderByIsOperator.html +102 -0
- package/docs/functions/_saltcorn_db_common.prefixFieldsInWhere.html +104 -0
- package/docs/functions/_saltcorn_db_common.reprAsJson.html +107 -0
- package/docs/functions/_saltcorn_db_common.single_tenant.enable_multi_tenant.html +107 -0
- package/docs/functions/_saltcorn_db_common.single_tenant.getTenantSchema.html +109 -0
- package/docs/functions/_saltcorn_db_common.single_tenant.init.html +115 -0
- package/docs/functions/_saltcorn_db_common.single_tenant.is_it_multi_tenant.html +109 -0
- package/docs/functions/_saltcorn_db_common.single_tenant.runWithTenant.html +129 -0
- package/docs/functions/_saltcorn_db_common.sqlBinOp.html +111 -0
- package/docs/functions/_saltcorn_db_common.sqlFun.html +111 -0
- package/docs/functions/_saltcorn_db_common.sqlsanitize.html +108 -0
- package/docs/functions/_saltcorn_db_common.sqlsanitizeAllowDots.html +110 -0
- package/docs/functions/_saltcorn_db_common.subSelectWhere.html +133 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.buildTablesFile.html +110 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyPrepopulatedDb.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyServerFiles.html +104 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyShareExtFiles.html +98 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copySiteLogo.html +102 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.copyTranslationFiles.html +104 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.createSqliteDb.html +105 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.decodeProvisioningProfile.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.extractDomain.html +98 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.generateAndroidVersionCode.html +98 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyAndroidManifest.html +102 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyConfigXml.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyGradleConfig.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyInfoPlist.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.modifyXcodeProjectFile.html +107 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepAppIcon.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareAppIcon.html +109 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareBuildDir.html +110 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareExportOptionsPlist.html +98 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareSplashIcon.html +110 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.prepareSplashPage.html +119 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeCapacitorConfig.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeCfgFile.html +102 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeDataExtractionRules.html +98 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writeNetworkSecurityConfig.html +100 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writePodfile.html +98 -0
- package/docs/functions/_saltcorn_mobile_builder.common_build_utils.writePrivacyInfo.html +98 -0
- package/docs/functions/_saltcorn_mobile_builder.package_bundle_utils.bundleMobileAppCode.html +73 -0
- package/docs/functions/_saltcorn_mobile_builder.package_bundle_utils.bundlePackagesAndPlugins.html +82 -0
- package/docs/functions/_saltcorn_mobile_builder.package_bundle_utils.copyPublicDirs.html +80 -0
- package/docs/functions/_saltcorn_sqlite.add_index.html +105 -0
- package/docs/functions/_saltcorn_sqlite.add_unique_constraint.html +105 -0
- package/docs/functions/_saltcorn_sqlite.begin.html +92 -0
- package/docs/functions/_saltcorn_sqlite.changeConnection.html +100 -0
- package/docs/functions/_saltcorn_sqlite.close.html +92 -0
- package/docs/functions/_saltcorn_sqlite.commit.html +92 -0
- package/docs/functions/_saltcorn_sqlite.count.html +106 -0
- package/docs/functions/_saltcorn_sqlite.deleteWhere.html +106 -0
- package/docs/functions/_saltcorn_sqlite.dropTable.html +95 -0
- package/docs/functions/_saltcorn_sqlite.dropTables.html +95 -0
- package/docs/functions/_saltcorn_sqlite.drop_index.html +105 -0
- package/docs/functions/_saltcorn_sqlite.drop_reset_schema.html +94 -0
- package/docs/functions/_saltcorn_sqlite.drop_unique_constraint.html +105 -0
- package/docs/functions/_saltcorn_sqlite.getVersion.html +93 -0
- package/docs/functions/_saltcorn_sqlite.get_db_filepath.html +92 -0
- package/docs/functions/_saltcorn_sqlite.get_sql_logging.html +92 -0
- package/docs/functions/_saltcorn_sqlite.init.html +105 -0
- package/docs/functions/_saltcorn_sqlite.insert.html +113 -0
- package/docs/functions/_saltcorn_sqlite.listScTables.html +89 -0
- package/docs/functions/_saltcorn_sqlite.listTables.html +89 -0
- package/docs/functions/_saltcorn_sqlite.listUserDefinedTables.html +89 -0
- package/docs/functions/_saltcorn_sqlite.query.html +98 -0
- package/docs/functions/_saltcorn_sqlite.rollback.html +92 -0
- package/docs/functions/_saltcorn_sqlite.select.html +108 -0
- package/docs/functions/_saltcorn_sqlite.selectMaybeOne.html +110 -0
- package/docs/functions/_saltcorn_sqlite.selectOne.html +109 -0
- package/docs/functions/_saltcorn_sqlite.set_sql_logging.html +96 -0
- package/docs/functions/_saltcorn_sqlite.slugify.html +93 -0
- package/docs/functions/_saltcorn_sqlite.sql_log.html +104 -0
- package/docs/functions/_saltcorn_sqlite.update.html +111 -0
- package/docs/functions/_saltcorn_sqlite.updateWhere.html +97 -0
- package/docs/functions/_saltcorn_sqlite_mobile.add_index.html +95 -0
- package/docs/functions/_saltcorn_sqlite_mobile.add_unique_constraint.html +95 -0
- package/docs/functions/_saltcorn_sqlite_mobile.count.html +88 -0
- package/docs/functions/_saltcorn_sqlite_mobile.deleteWhere.html +85 -0
- package/docs/functions/_saltcorn_sqlite_mobile.drop_index.html +95 -0
- package/docs/functions/_saltcorn_sqlite_mobile.drop_reset_schema.html +78 -0
- package/docs/functions/_saltcorn_sqlite_mobile.drop_unique_constraint.html +95 -0
- package/docs/functions/_saltcorn_sqlite_mobile.init.html +78 -0
- package/docs/functions/_saltcorn_sqlite_mobile.insert.html +96 -0
- package/docs/functions/_saltcorn_sqlite_mobile.insertRows.html +94 -0
- package/docs/functions/_saltcorn_sqlite_mobile.listScTables.html +79 -0
- package/docs/functions/_saltcorn_sqlite_mobile.listTables.html +79 -0
- package/docs/functions/_saltcorn_sqlite_mobile.listUserDefinedTables.html +79 -0
- package/docs/functions/_saltcorn_sqlite_mobile.query.html +85 -0
- package/docs/functions/_saltcorn_sqlite_mobile.select.html +87 -0
- package/docs/functions/_saltcorn_sqlite_mobile.selectMaybeOne.html +88 -0
- package/docs/functions/_saltcorn_sqlite_mobile.selectOne.html +88 -0
- package/docs/functions/_saltcorn_sqlite_mobile.setConnectionObject.html +85 -0
- package/docs/functions/_saltcorn_sqlite_mobile.tableExists.html +87 -0
- package/docs/functions/_saltcorn_sqlite_mobile.time.html +78 -0
- package/docs/functions/_saltcorn_sqlite_mobile.update.html +97 -0
- package/docs/functions/_saltcorn_types.ModelAbstracts.abstract_field.instanceOfField.html +88 -0
- package/docs/functions/_saltcorn_types.ModelAbstracts.abstract_page.instanceOfPage.html +87 -0
- package/docs/functions/_saltcorn_types.ModelAbstracts.abstract_view.instanceOfView.html +87 -0
- package/docs/functions/_saltcorn_types.Types.base_types.instanceOWithHtmlFile.html +107 -0
- package/docs/functions/_saltcorn_types.Types.common_types.instanceOfErrorMsg.html +84 -0
- package/docs/functions/_saltcorn_types.Types.common_types.instanceOfSuccessMsg.html +84 -0
- package/docs/functions/_saltcorn_types.Types.common_types.instanceOfType.html +84 -0
- package/docs/functions/_saltcorn_types.generators.generateBool.html +68 -0
- package/docs/functions/_saltcorn_types.generators.generateString.html +75 -0
- package/docs/functions/_saltcorn_types.generators.num_between.html +75 -0
- package/docs/functions/_saltcorn_types.generators.oneOf.html +73 -0
- package/docs/index.html +56 -0
- package/docs/interfaces/_saltcorn_mobile_builder.common_build_utils.ScCapacitorConfig.html +169 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_field.AbstractField.html +187 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_field.AbstractFieldRepeat.html +110 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_form.AbstractForm.html +268 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_page.AbstractPage.html +153 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_role.AbstractRole.html +108 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_table.AbstractTable.html +147 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_trigger.AbstractTrigger.html +224 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_view.AbstractView.html +174 -0
- package/docs/interfaces/_saltcorn_types.ModelAbstracts.abstract_workflow.AbstractWorkflow.html +264 -0
- package/docs/modules/_saltcorn_admin_models.backup.html +74 -0
- package/docs/modules/_saltcorn_admin_models.html +68 -0
- package/docs/modules/_saltcorn_admin_models.pack.html +100 -0
- package/docs/modules/_saltcorn_admin_models.tenant.html +86 -0
- package/docs/modules/_saltcorn_common_code.html +77 -0
- package/docs/modules/_saltcorn_data.html +476 -0
- package/docs/modules/_saltcorn_data.models.Crash.html +113 -0
- package/docs/modules/_saltcorn_data.models.EventLog.html +113 -0
- package/docs/modules/_saltcorn_data.models.FieldRepeat.html +113 -0
- package/docs/modules/_saltcorn_data.models.File.html +113 -0
- package/docs/modules/_saltcorn_data.models.Form.html +115 -0
- package/docs/modules/_saltcorn_data.models.PageGroup.html +113 -0
- package/docs/modules/_saltcorn_data.models.Table.html +117 -0
- package/docs/modules/_saltcorn_data.models.TableConstraint.html +113 -0
- package/docs/modules/_saltcorn_data.models.User.html +113 -0
- package/docs/modules/_saltcorn_data.models.View.html +113 -0
- package/docs/modules/_saltcorn_data.models.Workflow.html +113 -0
- package/docs/modules/_saltcorn_data.models.config.html +135 -0
- package/docs/modules/_saltcorn_data.models.discovery.html +120 -0
- package/docs/modules/_saltcorn_data.models.email.html +116 -0
- package/docs/modules/_saltcorn_data.models.expression.html +128 -0
- package/docs/modules/_saltcorn_data.models.html +150 -0
- package/docs/modules/_saltcorn_data.models.layout.html +122 -0
- package/docs/modules/_saltcorn_data.models.random.html +118 -0
- package/docs/modules/_saltcorn_data.models.scheduler.html +112 -0
- package/docs/modules/_saltcorn_data.plugin_helper.html +70 -0
- package/docs/modules/_saltcorn_data.utils.html +72 -0
- package/docs/modules/_saltcorn_db_common.html +181 -0
- package/docs/modules/_saltcorn_db_common.multi_tenant.html +120 -0
- package/docs/modules/_saltcorn_db_common.single_tenant.html +115 -0
- package/docs/modules/_saltcorn_markup.html +399 -0
- package/docs/modules/_saltcorn_mobile_builder.common_build_utils.html +124 -0
- package/docs/modules/_saltcorn_mobile_builder.html +75 -0
- package/docs/modules/_saltcorn_mobile_builder.package_bundle_utils.html +71 -0
- package/docs/modules/_saltcorn_sqlite.html +123 -0
- package/docs/modules/_saltcorn_sqlite_mobile.html +103 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_field.html +94 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_form.html +85 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_library.html +82 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_page.html +92 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_plugin.html +82 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_role.html +87 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_table.html +87 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_trigger.html +87 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_view.html +92 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.abstract_workflow.html +87 -0
- package/docs/modules/_saltcorn_types.ModelAbstracts.html +88 -0
- package/docs/modules/_saltcorn_types.Types.base_types.html +141 -0
- package/docs/modules/_saltcorn_types.Types.common_types.html +91 -0
- package/docs/modules/_saltcorn_types.Types.html +68 -0
- package/docs/modules/_saltcorn_types.generators.html +76 -0
- package/docs/modules/_saltcorn_types.html +67 -0
- package/docs/types/_saltcorn_data.models.Crash.CrashCfg.html +128 -0
- package/docs/types/_saltcorn_data.models.EventLog.EventLogCfg.html +122 -0
- package/docs/types/_saltcorn_data.models.FieldRepeat.FieldRepeatCfg.html +126 -0
- package/docs/types/_saltcorn_data.models.File.FileCfg.html +132 -0
- package/docs/types/_saltcorn_data.models.Form.AdditionalButton.html +108 -0
- package/docs/types/_saltcorn_data.models.Form.FormCfg.html +180 -0
- package/docs/types/_saltcorn_data.models.PageGroup.ScreenInfoParams.html +118 -0
- package/docs/types/_saltcorn_data.models.Table.ChildRelations.html +116 -0
- package/docs/types/_saltcorn_data.models.Table.ParentRelations.html +116 -0
- package/docs/types/_saltcorn_data.models.Table.RelationData.html +116 -0
- package/docs/types/_saltcorn_data.models.TableConstraint.TableConstraintCfg.html +120 -0
- package/docs/types/_saltcorn_data.models.User.UserCfg.html +138 -0
- package/docs/types/_saltcorn_data.models.View.FindViewsPred.html +127 -0
- package/docs/types/_saltcorn_data.models.Workflow.WorkflowCfg.html +161 -0
- package/docs/types/_saltcorn_db_common.AggregationOptions.html +114 -0
- package/docs/types/_saltcorn_db_common.CoordOpts.html +104 -0
- package/docs/types/_saltcorn_db_common.JoinField.html +106 -0
- package/docs/types/_saltcorn_db_common.JoinFields.html +98 -0
- package/docs/types/_saltcorn_db_common.JoinOptions.html +107 -0
- package/docs/types/_saltcorn_db_common.JsonPath.html +93 -0
- package/docs/types/_saltcorn_db_common.JsonPathElem.html +93 -0
- package/docs/types/_saltcorn_db_common.Operator.html +102 -0
- package/docs/types/_saltcorn_db_common.PrimaryKeyValue.html +93 -0
- package/docs/types/_saltcorn_db_common.Row.html +98 -0
- package/docs/types/_saltcorn_db_common.SelectOptions.html +132 -0
- package/docs/types/_saltcorn_db_common.SqlAndValues.html +104 -0
- package/docs/types/_saltcorn_db_common.SubselectOptions.html +104 -0
- package/docs/types/_saltcorn_db_common.Value.html +93 -0
- package/docs/types/_saltcorn_db_common.Where.html +115 -0
- package/docs/types/_saltcorn_mobile_builder.IosCfg.html +76 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_field.FieldCfg.html +168 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_field.InputType.html +79 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_form.AdditionalButton.html +87 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_library.LibraryCfg.html +87 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_library.LibraryPack.html +79 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_page.PageCfg.html +97 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_page.PagePack.html +85 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_plugin.PluginCfg.html +103 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_plugin.PluginPack.html +79 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_role.RoleCfg.html +84 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_role.RolePack.html +80 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_table.TableCfg.html +111 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_table.TablePack.html +86 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_trigger.TriggerCfg.html +104 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_trigger.TriggerPack.html +80 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_view.ViewCfg.html +109 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_view.ViewPack.html +89 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_workflow.ConfigWorkflowStep.html +97 -0
- package/docs/types/_saltcorn_types.ModelAbstracts.abstract_workflow.RunResult.html +100 -0
- package/docs/types/_saltcorn_types.Types.base_types.Action.html +189 -0
- package/docs/types/_saltcorn_types.Types.base_types.AuthenticationMethod.html +109 -0
- package/docs/types/_saltcorn_types.Types.base_types.CodePagePack.html +107 -0
- package/docs/types/_saltcorn_types.Types.base_types.Column.html +103 -0
- package/docs/types/_saltcorn_types.Types.base_types.ConnectedObjects.html +109 -0
- package/docs/types/_saltcorn_types.Types.base_types.CopilotSkill.html +149 -0
- package/docs/types/_saltcorn_types.Types.base_types.FieldLike.html +98 -0
- package/docs/types/_saltcorn_types.Types.base_types.FieldView.html +166 -0
- package/docs/types/_saltcorn_types.Types.base_types.Header.html +107 -0
- package/docs/types/_saltcorn_types.Types.base_types.JoinFieldOption.html +109 -0
- package/docs/types/_saltcorn_types.Types.base_types.Layout.html +98 -0
- package/docs/types/_saltcorn_types.Types.base_types.MobileConfig.html +133 -0
- package/docs/types/_saltcorn_types.Types.base_types.ModelPattern.html +261 -0
- package/docs/types/_saltcorn_types.Types.base_types.Pack.html +129 -0
- package/docs/types/_saltcorn_types.Types.base_types.Plugin.html +122 -0
- package/docs/types/_saltcorn_types.Types.base_types.PluginFunction.html +120 -0
- package/docs/types/_saltcorn_types.Types.base_types.PluginLayout.html +116 -0
- package/docs/types/_saltcorn_types.Types.base_types.PluginRoute.html +125 -0
- package/docs/types/_saltcorn_types.Types.base_types.PluginSourceType.html +98 -0
- package/docs/types/_saltcorn_types.Types.base_types.PluginType.html +183 -0
- package/docs/types/_saltcorn_types.Types.base_types.PluginWrap.html +111 -0
- package/docs/types/_saltcorn_types.Types.base_types.PluginWrapArg.html +122 -0
- package/docs/types/_saltcorn_types.Types.base_types.RelationOption.html +105 -0
- package/docs/types/_saltcorn_types.Types.base_types.Req.html +178 -0
- package/docs/types/_saltcorn_types.Types.base_types.Res.html +168 -0
- package/docs/types/_saltcorn_types.Types.base_types.RouteAction.html +121 -0
- package/docs/types/_saltcorn_types.Types.base_types.RunExtra.html +103 -0
- package/docs/types/_saltcorn_types.Types.base_types.TableProvider.html +140 -0
- package/docs/types/_saltcorn_types.Types.base_types.TableQuery.html +129 -0
- package/docs/types/_saltcorn_types.Types.base_types.Tablely.html +103 -0
- package/docs/types/_saltcorn_types.Types.base_types.ViewTemplate.html +471 -0
- package/docs/types/_saltcorn_types.Types.common_types.ErrorMessage.html +84 -0
- package/docs/types/_saltcorn_types.Types.common_types.GenObj.html +80 -0
- package/docs/types/_saltcorn_types.Types.common_types.ReqRes.html +82 -0
- package/docs/types/_saltcorn_types.Types.common_types.ResultMessage.html +75 -0
- package/docs/types/_saltcorn_types.Types.common_types.SuccessMessage.html +86 -0
- package/docs/types/_saltcorn_types.Types.common_types.Type.html +144 -0
- package/docs/variables/_saltcorn_data.db.html +60 -0
- package/docs/variables/_saltcorn_data.migrations.html +60 -0
- package/docs/variables/_saltcorn_data.models.config.available_languages.html +154 -0
- package/docs/variables/_saltcorn_data.models.config.configTypes.html +117 -0
- package/docs/variables/_saltcorn_data.models.scheduler.runScheduler.html +152 -0
- package/docs/variables/_saltcorn_data.plugin_helper.run_action_column.html +65 -0
- package/docs/variables/_saltcorn_data.utils.NotAuthorized.html +66 -0
- package/docs/variables/_saltcorn_data.utils.sleep.html +66 -0
- package/docs/variables/_saltcorn_db_common.multi_tenant.tenantNamespace.html +103 -0
- package/help/Extra state formula.tmd +1 -1
- package/help/JavaScript action code.tmd +1 -1
- package/locales/ar.json +1289 -4
- package/locales/da.json +355 -203
- package/locales/de.json +665 -149
- package/locales/en.json +16 -1
- package/locales/es.json +1567 -1271
- package/locales/fr.json +1562 -294
- package/locales/hi.json +1563 -0
- package/locales/pt.json +1300 -11
- package/locales/ru.json +1577 -1222
- package/locales/si.json +402 -4
- package/locales/uk.json +399 -3
- package/locales/zh.json +689 -7
- package/markup/admin.js +32 -14
- package/package.json +9 -9
- package/public/gridedit.js +4 -2
- package/public/saltcorn-common.js +45 -13
- package/public/saltcorn.js +17 -28
- package/routes/actions.js +4 -42
- package/routes/admin.js +78 -43
- package/routes/api.js +9 -9
- package/routes/delete.js +4 -2
- package/routes/eventlog.js +64 -27
- package/routes/fields.js +25 -14
- package/routes/files.js +9 -9
- package/routes/infoarch.js +57 -2
- package/routes/list.js +6 -4
- package/routes/pageedit.js +1 -1
- package/routes/plugins.js +36 -1
- package/routes/search.js +7 -3
- package/routes/tables.js +207 -28
- package/tests/admin.test.js +15 -0
- package/wrapper.js +14 -4
package/routes/api.js
CHANGED
|
@@ -78,8 +78,8 @@ function accessAllowedRead(req, user, table, allow_ownership) {
|
|
|
78
78
|
req.user && req.user.id
|
|
79
79
|
? req.user.role_id
|
|
80
80
|
: user && user.role_id
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
? user.role_id
|
|
82
|
+
: 100;
|
|
83
83
|
|
|
84
84
|
return (
|
|
85
85
|
role <= table.min_role_read ||
|
|
@@ -101,8 +101,8 @@ function accessAllowedWrite(req, user, table) {
|
|
|
101
101
|
req.user && req.user.id
|
|
102
102
|
? req.user.role_id
|
|
103
103
|
: user && user.role_id
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
? user.role_id
|
|
105
|
+
: 100;
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
108
|
role <= table.min_role_write ||
|
|
@@ -122,8 +122,8 @@ function accessAllowed(req, user, trigger) {
|
|
|
122
122
|
req.user && req.user.id
|
|
123
123
|
? req.user.role_id
|
|
124
124
|
: user && user.role_id
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
? user.role_id
|
|
126
|
+
: 100;
|
|
127
127
|
|
|
128
128
|
return role <= trigger.min_role;
|
|
129
129
|
}
|
|
@@ -397,8 +397,8 @@ router.get(
|
|
|
397
397
|
const derefs = Array.isArray(dereference)
|
|
398
398
|
? dereference
|
|
399
399
|
: !dereference
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
? []
|
|
401
|
+
: [dereference];
|
|
402
402
|
derefs.forEach((f) => {
|
|
403
403
|
const field = table.getField(f);
|
|
404
404
|
if (field?.attributes?.summary_field)
|
|
@@ -701,7 +701,7 @@ router.delete(
|
|
|
701
701
|
);
|
|
702
702
|
} else
|
|
703
703
|
await table.deleteRows(
|
|
704
|
-
{ id },
|
|
704
|
+
{ [table.pk_name]: id },
|
|
705
705
|
user || req.user || { role_id: 100 }
|
|
706
706
|
);
|
|
707
707
|
res.json({ success: true });
|
package/routes/delete.js
CHANGED
|
@@ -35,9 +35,11 @@ router.post(
|
|
|
35
35
|
// todo check that works after where change
|
|
36
36
|
const table = Table.findOne({ name: tableName });
|
|
37
37
|
const role = req.user && req.user.id ? req.user.role_id : 100;
|
|
38
|
+
const where = { [table.pk_name]: id };
|
|
39
|
+
|
|
38
40
|
try {
|
|
39
41
|
if (role <= table.min_role_write)
|
|
40
|
-
await table.deleteRows(
|
|
42
|
+
await table.deleteRows(where, req.user || { role_id: 100 });
|
|
41
43
|
else if (
|
|
42
44
|
(table.ownership_field_id || table.ownership_formula) &&
|
|
43
45
|
req.user
|
|
@@ -47,7 +49,7 @@ router.post(
|
|
|
47
49
|
{ forUser: req.user, forPublic: !req.user }
|
|
48
50
|
);
|
|
49
51
|
if (row && table.is_owner(req.user, row))
|
|
50
|
-
await table.deleteRows(
|
|
52
|
+
await table.deleteRows(where, req.user || { role_id: 100 });
|
|
51
53
|
else req.flash("error", req.__("Not authorized"));
|
|
52
54
|
} else
|
|
53
55
|
req.flash(
|
package/routes/eventlog.js
CHANGED
|
@@ -459,33 +459,70 @@ router.get(
|
|
|
459
459
|
isAdmin,
|
|
460
460
|
error_catcher(async (req, res) => {
|
|
461
461
|
const { id } = req.params;
|
|
462
|
-
const
|
|
462
|
+
const { or_less, or_more } = req.query;
|
|
463
463
|
const locale = getState().getConfig("default_locale", "en");
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
464
|
+
let ev = await EventLog.findOneWithUser(id);
|
|
465
|
+
if (!ev && (or_less || or_more)) {
|
|
466
|
+
const evFound = await EventLog.find(
|
|
467
|
+
{
|
|
468
|
+
id: or_less ? { lt: +id } : { gt: +id },
|
|
469
|
+
},
|
|
470
|
+
{ limit: 1, orderBy: "id", orderDesc: !!or_less }
|
|
471
|
+
);
|
|
472
|
+
if (evFound.length) ev = await EventLog.findOneWithUser(evFound[0].id);
|
|
473
|
+
}
|
|
474
|
+
if (!ev) {
|
|
475
|
+
req.flash("warning", "Event not found");
|
|
476
|
+
res.redirect("/eventlog");
|
|
477
|
+
} else
|
|
478
|
+
send_events_page({
|
|
479
|
+
res,
|
|
480
|
+
req,
|
|
481
|
+
active_sub: "Event log",
|
|
482
|
+
sub2_page: ev.id,
|
|
483
|
+
contents: {
|
|
484
|
+
type: "card",
|
|
485
|
+
contents:
|
|
486
|
+
table(
|
|
487
|
+
{ class: "table eventlog" },
|
|
488
|
+
tbody(
|
|
489
|
+
tr(
|
|
490
|
+
th(req.__("When")),
|
|
491
|
+
td(
|
|
492
|
+
div(
|
|
493
|
+
{ class: "d-flex justify-content-between" },
|
|
494
|
+
div(localeDateTime(ev.occur_at, {}, locale)),
|
|
495
|
+
div(
|
|
496
|
+
+id > 1
|
|
497
|
+
? a(
|
|
498
|
+
{
|
|
499
|
+
href: `/eventlog/${ev.id - 1}?or_less=1`,
|
|
500
|
+
class: "btn btn-sm btn-secondary me-1",
|
|
501
|
+
},
|
|
502
|
+
i({ class: "fas fa-chevron-left" })
|
|
503
|
+
)
|
|
504
|
+
: "",
|
|
505
|
+
a(
|
|
506
|
+
{
|
|
507
|
+
href: `/eventlog/${ev.id + 1}?or_more=1`,
|
|
508
|
+
class: "btn btn-sm btn-secondary",
|
|
509
|
+
},
|
|
510
|
+
i({ class: "fas fa-chevron-right" })
|
|
511
|
+
)
|
|
512
|
+
)
|
|
513
|
+
)
|
|
514
|
+
)
|
|
515
|
+
),
|
|
516
|
+
tr(th(req.__("Type")), td(ev.event_type)),
|
|
517
|
+
tr(th(req.__("Channel")), td(ev.channel)),
|
|
518
|
+
tr(th(req.__("User")), td(ev.email))
|
|
519
|
+
)
|
|
520
|
+
) +
|
|
521
|
+
div(
|
|
522
|
+
{ class: "eventpayload" },
|
|
523
|
+
ev.payload ? pre(text(JSON.stringify(ev.payload, null, 2))) : ""
|
|
524
|
+
),
|
|
525
|
+
},
|
|
526
|
+
});
|
|
490
527
|
})
|
|
491
528
|
);
|
package/routes/fields.js
CHANGED
|
@@ -303,6 +303,7 @@ const fieldFlow = (req) =>
|
|
|
303
303
|
fldRow.is_unique = false;
|
|
304
304
|
fldRow.required = false;
|
|
305
305
|
}
|
|
306
|
+
const table = Table.findOne({ id: table_id });
|
|
306
307
|
if (context.id) {
|
|
307
308
|
const field = await Field.findOne({ id: context.id });
|
|
308
309
|
try {
|
|
@@ -311,10 +312,15 @@ const fieldFlow = (req) =>
|
|
|
311
312
|
}
|
|
312
313
|
|
|
313
314
|
await field.update(fldRow);
|
|
314
|
-
Trigger.emitEvent(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
Trigger.emitEvent(
|
|
316
|
+
"AppChange",
|
|
317
|
+
`Field ${fldRow.name} on table ${table?.name}`,
|
|
318
|
+
req.user,
|
|
319
|
+
{
|
|
320
|
+
entity_type: "Field",
|
|
321
|
+
entity_name: fldRow.name || fldRow.label,
|
|
322
|
+
}
|
|
323
|
+
);
|
|
318
324
|
} catch (e) {
|
|
319
325
|
return {
|
|
320
326
|
redirect: `/table/${context.table_id}`,
|
|
@@ -324,10 +330,15 @@ const fieldFlow = (req) =>
|
|
|
324
330
|
} else {
|
|
325
331
|
try {
|
|
326
332
|
await Field.create(fldRow);
|
|
327
|
-
Trigger.emitEvent(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
333
|
+
Trigger.emitEvent(
|
|
334
|
+
"AppChange",
|
|
335
|
+
`Field ${fldRow.name} on table ${table?.name}`,
|
|
336
|
+
req.user,
|
|
337
|
+
{
|
|
338
|
+
entity_type: "Field",
|
|
339
|
+
entity_name: fldRow.name || fldRow.label,
|
|
340
|
+
}
|
|
341
|
+
);
|
|
331
342
|
} catch (e) {
|
|
332
343
|
return {
|
|
333
344
|
redirect: `/table/${context.table_id}`,
|
|
@@ -669,8 +680,8 @@ const fieldFlow = (req) =>
|
|
|
669
680
|
a.type?.name === "String" && b.type?.name !== "String"
|
|
670
681
|
? -1
|
|
671
682
|
: a.type?.name !== "String" && b.type?.name === "String"
|
|
672
|
-
|
|
673
|
-
|
|
683
|
+
? 1
|
|
684
|
+
: 0
|
|
674
685
|
)
|
|
675
686
|
.map((f) => ({
|
|
676
687
|
value: f.name,
|
|
@@ -1165,8 +1176,8 @@ router.post(
|
|
|
1165
1176
|
typeof value === "string"
|
|
1166
1177
|
? value
|
|
1167
1178
|
: value?.toString
|
|
1168
|
-
|
|
1169
|
-
|
|
1179
|
+
? value.toString()
|
|
1180
|
+
: `${value}`
|
|
1170
1181
|
);
|
|
1171
1182
|
return;
|
|
1172
1183
|
}
|
|
@@ -1289,8 +1300,8 @@ router.post(
|
|
|
1289
1300
|
field.type === "Key"
|
|
1290
1301
|
? state.keyFieldviews
|
|
1291
1302
|
: field.type === "File"
|
|
1292
|
-
|
|
1293
|
-
|
|
1303
|
+
? state.fileviews
|
|
1304
|
+
: field.type.fieldviews;
|
|
1294
1305
|
if (!field.type || !fieldviews) {
|
|
1295
1306
|
res.send("");
|
|
1296
1307
|
return;
|
package/routes/files.js
CHANGED
|
@@ -19,6 +19,7 @@ const {
|
|
|
19
19
|
error_catcher,
|
|
20
20
|
setTenant,
|
|
21
21
|
is_relative_url,
|
|
22
|
+
isAdminOrHasConfigMinRole,
|
|
22
23
|
} = require("./utils.js");
|
|
23
24
|
const {
|
|
24
25
|
h1,
|
|
@@ -156,7 +157,7 @@ router.get(
|
|
|
156
157
|
*/
|
|
157
158
|
router.get(
|
|
158
159
|
"/",
|
|
159
|
-
|
|
160
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
160
161
|
error_catcher(async (req, res) => {
|
|
161
162
|
// todo limit select from file by 10 or 20
|
|
162
163
|
const { dir, search } = req.query;
|
|
@@ -245,8 +246,7 @@ router.get(
|
|
|
245
246
|
|
|
246
247
|
router.post(
|
|
247
248
|
"/download-zip",
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
250
250
|
error_catcher(async (req, res) => {
|
|
251
251
|
const role = req.user && req.user.id ? req.user.role_id : 100;
|
|
252
252
|
const user_id = req.user && req.user.id;
|
|
@@ -377,7 +377,7 @@ router.get(
|
|
|
377
377
|
*/
|
|
378
378
|
router.post(
|
|
379
379
|
"/setrole/*serve_path",
|
|
380
|
-
|
|
380
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
381
381
|
error_catcher(async (req, res) => {
|
|
382
382
|
const serve_path = path.join(...req.params.serve_path);
|
|
383
383
|
const file = await File.findOne(serve_path);
|
|
@@ -397,7 +397,7 @@ router.post(
|
|
|
397
397
|
|
|
398
398
|
router.post(
|
|
399
399
|
"/move/*serve_path",
|
|
400
|
-
|
|
400
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
401
401
|
error_catcher(async (req, res) => {
|
|
402
402
|
const serve_path = path.join(...req.params.serve_path);
|
|
403
403
|
const file = await File.findOne(serve_path);
|
|
@@ -424,7 +424,7 @@ router.post(
|
|
|
424
424
|
*/
|
|
425
425
|
router.post(
|
|
426
426
|
"/setname/*serve_path",
|
|
427
|
-
|
|
427
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
428
428
|
error_catcher(async (req, res) => {
|
|
429
429
|
const serve_path = path.join(...req.params.serve_path);
|
|
430
430
|
const filename = (req.body || {}).value;
|
|
@@ -444,7 +444,7 @@ router.post(
|
|
|
444
444
|
*/
|
|
445
445
|
router.post(
|
|
446
446
|
"/unzip/*serve_path",
|
|
447
|
-
|
|
447
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
448
448
|
error_catcher(async (req, res) => {
|
|
449
449
|
const serve_path = path.join(...req.params.serve_path);
|
|
450
450
|
const filename = (req.body || {}).value;
|
|
@@ -458,7 +458,7 @@ router.post(
|
|
|
458
458
|
|
|
459
459
|
router.post(
|
|
460
460
|
"/new-folder",
|
|
461
|
-
|
|
461
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
462
462
|
error_catcher(async (req, res) => {
|
|
463
463
|
const { name, folder } = req.body || {};
|
|
464
464
|
await File.new_folder(name, folder);
|
|
@@ -535,7 +535,7 @@ router.post(
|
|
|
535
535
|
*/
|
|
536
536
|
router.post(
|
|
537
537
|
"/delete/*serve_path",
|
|
538
|
-
|
|
538
|
+
isAdminOrHasConfigMinRole("min_role_edit_files"),
|
|
539
539
|
error_catcher(async (req, res) => {
|
|
540
540
|
const serve_path = path.join(...req.params.serve_path);
|
|
541
541
|
const { redirect } = req.query;
|
package/routes/infoarch.js
CHANGED
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const Router = require("express-promise-router");
|
|
8
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
isAdmin,
|
|
10
|
+
setTenant,
|
|
11
|
+
error_catcher,
|
|
12
|
+
isAdminOrHasConfigMinRole,
|
|
13
|
+
} = require("./utils.js");
|
|
9
14
|
const {
|
|
10
15
|
send_infoarch_page,
|
|
11
16
|
send_admin_page,
|
|
@@ -13,9 +18,10 @@ const {
|
|
|
13
18
|
save_config_from_form,
|
|
14
19
|
} = require("../markup/admin.js");
|
|
15
20
|
const { getState } = require("@saltcorn/data/db/state");
|
|
16
|
-
const { div, a, i, text } = require("@saltcorn/markup/tags");
|
|
21
|
+
const { div, a, i, text, button } = require("@saltcorn/markup/tags");
|
|
17
22
|
const { mkTable, renderForm, post_delete_btn } = require("@saltcorn/markup");
|
|
18
23
|
const Form = require("@saltcorn/data/models/form");
|
|
24
|
+
const Snapshot = require("@saltcorn/admin-models/models/snapshot");
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
27
|
* @type {object}
|
|
@@ -41,6 +47,55 @@ router.get(
|
|
|
41
47
|
})
|
|
42
48
|
);
|
|
43
49
|
|
|
50
|
+
router.get(
|
|
51
|
+
"/create-snapshot",
|
|
52
|
+
isAdminOrHasConfigMinRole("min_role_create_snapshots"),
|
|
53
|
+
error_catcher(async (req, res) => {
|
|
54
|
+
send_infoarch_page({
|
|
55
|
+
res,
|
|
56
|
+
req,
|
|
57
|
+
active_sub: "Snapshots",
|
|
58
|
+
contents: {
|
|
59
|
+
type: "card",
|
|
60
|
+
contents: div(
|
|
61
|
+
button(
|
|
62
|
+
{
|
|
63
|
+
class: "btn btn-outline-secondary",
|
|
64
|
+
type: "button",
|
|
65
|
+
onclick:
|
|
66
|
+
"ajax_post('/site-structure/create-snapshot/'+prompt('Name of snapshot (optional)'))",
|
|
67
|
+
},
|
|
68
|
+
req.__("Snapshot now")
|
|
69
|
+
)
|
|
70
|
+
),
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
router.post(
|
|
77
|
+
"/create-snapshot/:snapshotname",
|
|
78
|
+
isAdminOrHasConfigMinRole("min_role_create_snapshots"),
|
|
79
|
+
error_catcher(async (req, res) => {
|
|
80
|
+
const { snapshotname } = req.params;
|
|
81
|
+
if (snapshotname == "null") {
|
|
82
|
+
//user clicked cancel on prompt
|
|
83
|
+
res.json({ success: true });
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
const taken = await Snapshot.take_if_changed(snapshotname);
|
|
89
|
+
if (taken) req.flash("success", req.__("Snapshot successful"));
|
|
90
|
+
else
|
|
91
|
+
req.flash("success", req.__("No changes detected, snapshot skipped"));
|
|
92
|
+
} catch (e) {
|
|
93
|
+
req.flash("error", e.message);
|
|
94
|
+
}
|
|
95
|
+
res.json({ reload_page: true });
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
|
|
44
99
|
/**
|
|
45
100
|
* @param {object} req
|
|
46
101
|
* @returns {Form}
|
package/routes/list.js
CHANGED
|
@@ -282,6 +282,7 @@ router.get(
|
|
|
282
282
|
cellClick: "__delete_tabulator_row",
|
|
283
283
|
});
|
|
284
284
|
const isDark = getState().getLightDarkMode(req.user) === "dark";
|
|
285
|
+
const pkNm = table.pk_name
|
|
285
286
|
res.sendWrap(
|
|
286
287
|
{
|
|
287
288
|
title: req.__(`%s data table`, table.name),
|
|
@@ -401,6 +402,7 @@ router.get(
|
|
|
401
402
|
col[k] = window[v.substring(2)];
|
|
402
403
|
})
|
|
403
404
|
})
|
|
405
|
+
window.tabulator_table_primary_key = "${table.pk_name}";
|
|
404
406
|
window.tabulator_table = new Tabulator("#jsGrid", {
|
|
405
407
|
ajaxURL:"/api/${encodeURIComponent(
|
|
406
408
|
table.name
|
|
@@ -420,7 +422,7 @@ router.get(
|
|
|
420
422
|
ajaxContentType:"json",
|
|
421
423
|
sortMode:"remote",
|
|
422
424
|
initialSort:[
|
|
423
|
-
{column:"
|
|
425
|
+
{column:"${table.pk_name}", dir:"asc"},
|
|
424
426
|
],
|
|
425
427
|
});
|
|
426
428
|
window.tabulator_table.on("cellEdited", function(cell){
|
|
@@ -428,7 +430,7 @@ router.get(
|
|
|
428
430
|
ajax_indicator(true);
|
|
429
431
|
$.ajax({
|
|
430
432
|
type: "POST",
|
|
431
|
-
url: "/api/${table.name}/" + (row
|
|
433
|
+
url: "/api/${table.name}/" + (row.${pkNm}||""),
|
|
432
434
|
data: row,
|
|
433
435
|
headers: {
|
|
434
436
|
"CSRF-Token": _sc_globalCsrf,
|
|
@@ -438,8 +440,8 @@ router.get(
|
|
|
438
440
|
ajax_indicator(false);
|
|
439
441
|
//if (item._versions) item._versions = +item._versions + 1;
|
|
440
442
|
//data.resolve(fixKeys(item));
|
|
441
|
-
if(resp.success &&(typeof resp.success ==="number" || typeof resp.success ==="string") && !row
|
|
442
|
-
window.tabulator_table.updateRow(cell.getRow(), {
|
|
443
|
+
if(resp.success &&(typeof resp.success ==="number" || typeof resp.success ==="string") && !row.${pkNm}) {
|
|
444
|
+
window.tabulator_table.updateRow(cell.getRow(), {${pkNm}: resp.success});
|
|
443
445
|
}
|
|
444
446
|
|
|
445
447
|
}).fail(function (resp) {
|
package/routes/pageedit.js
CHANGED
|
@@ -289,7 +289,7 @@ const getRootPageForm = (pages, pageGroups, roles, req) => {
|
|
|
289
289
|
input_type: "select",
|
|
290
290
|
options: [
|
|
291
291
|
"",
|
|
292
|
-
...pages.map((p) => p.name),
|
|
292
|
+
...pages.filter((p) => p.min_role >= r.id).map((p) => p.name),
|
|
293
293
|
...pageGroups.map((g) => ({
|
|
294
294
|
label: `${g.name} (group)`,
|
|
295
295
|
value: g.name,
|
package/routes/plugins.js
CHANGED
|
@@ -495,6 +495,17 @@ const store_actions_dropdown = (req) => {
|
|
|
495
495
|
'<i class="far fa-arrow-alt-circle-up"></i> ' +
|
|
496
496
|
req.__("Upgrade installed modules")
|
|
497
497
|
),
|
|
498
|
+
db.getTenantSchema() === db.connectObj.default_schema &&
|
|
499
|
+
a(
|
|
500
|
+
{
|
|
501
|
+
class: "dropdown-item",
|
|
502
|
+
href: `/plugins/reinstall-all`,
|
|
503
|
+
onClick: `notifyAlert('${req.__("Upgrading modules...")}', true)`,
|
|
504
|
+
},
|
|
505
|
+
'<i class="fas fa-pump-medical"></i> ' +
|
|
506
|
+
req.__("Clean modules and restart")
|
|
507
|
+
),
|
|
508
|
+
|
|
498
509
|
(db.getTenantSchema() === db.connectObj.default_schema ||
|
|
499
510
|
tenants_install_git) &&
|
|
500
511
|
a(
|
|
@@ -558,7 +569,7 @@ const plugin_store_html = (items, req) => {
|
|
|
558
569
|
},
|
|
559
570
|
{
|
|
560
571
|
besides: items.map(store_item_html(req)),
|
|
561
|
-
gy:3,
|
|
572
|
+
gy: 3,
|
|
562
573
|
widths: items.map(() => 4),
|
|
563
574
|
},
|
|
564
575
|
],
|
|
@@ -1397,6 +1408,30 @@ router.get(
|
|
|
1397
1408
|
})
|
|
1398
1409
|
);
|
|
1399
1410
|
|
|
1411
|
+
/**
|
|
1412
|
+
* @name get/upgrade
|
|
1413
|
+
* @function
|
|
1414
|
+
* @memberof module:routes/plugins~pluginsRouter
|
|
1415
|
+
* @function
|
|
1416
|
+
*/
|
|
1417
|
+
router.get(
|
|
1418
|
+
"/reinstall-all",
|
|
1419
|
+
isAdmin,
|
|
1420
|
+
error_catcher(async (req, res) => {
|
|
1421
|
+
//TODO make this post
|
|
1422
|
+
const schema = db.getTenantSchema();
|
|
1423
|
+
if (schema === db.connectObj.default_schema) {
|
|
1424
|
+
await PluginInstaller.cleanPluginsDirectory();
|
|
1425
|
+
req.flash("success", req.__(`Modules cleaned, server restarting...`));
|
|
1426
|
+
setTimeout(() => {
|
|
1427
|
+
if (process.send) getState().processSend("RestartServer");
|
|
1428
|
+
else process.exit(0);
|
|
1429
|
+
}, 1000);
|
|
1430
|
+
}
|
|
1431
|
+
res.redirect(`/plugins`);
|
|
1432
|
+
})
|
|
1433
|
+
);
|
|
1434
|
+
|
|
1400
1435
|
/**
|
|
1401
1436
|
* @name get/upgrade-plugin/:name
|
|
1402
1437
|
* @function
|
package/routes/search.js
CHANGED
|
@@ -10,7 +10,11 @@ const { span, h5, h4, nbsp, p, a, div } = require("@saltcorn/markup/tags");
|
|
|
10
10
|
const { getState } = require("@saltcorn/data/db/state");
|
|
11
11
|
const db = require("@saltcorn/data/db");
|
|
12
12
|
|
|
13
|
-
const {
|
|
13
|
+
const {
|
|
14
|
+
isAdmin,
|
|
15
|
+
error_catcher,
|
|
16
|
+
isAdminOrHasConfigMinRole,
|
|
17
|
+
} = require("./utils.js");
|
|
14
18
|
const Form = require("@saltcorn/data/models/form");
|
|
15
19
|
const Table = require("@saltcorn/data/models/table");
|
|
16
20
|
const View = require("@saltcorn/data/models/view");
|
|
@@ -94,7 +98,7 @@ const searchConfigForm = (tables, views, req) => {
|
|
|
94
98
|
*/
|
|
95
99
|
router.get(
|
|
96
100
|
"/config",
|
|
97
|
-
|
|
101
|
+
isAdminOrHasConfigMinRole("min_role_edit_search"),
|
|
98
102
|
error_catcher(async (req, res) => {
|
|
99
103
|
const views = await View.find({}, { orderBy: "name" });
|
|
100
104
|
const tables = await Table.find();
|
|
@@ -131,7 +135,7 @@ router.get(
|
|
|
131
135
|
*/
|
|
132
136
|
router.post(
|
|
133
137
|
"/config",
|
|
134
|
-
|
|
138
|
+
isAdminOrHasConfigMinRole("min_role_edit_search"),
|
|
135
139
|
error_catcher(async (req, res) => {
|
|
136
140
|
const views = await View.find({}, { orderBy: "name" });
|
|
137
141
|
const tables = await Table.find();
|