runlify 0.0.159 → 0.0.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +53 -53
- package/bin/runlify +18 -18
- package/build/cli.js +68 -68
- package/build/commands/availableEnvironments.js +65 -65
- package/build/commands/generate.js +61 -61
- package/build/commands/init.js +183 -183
- package/build/commands/login.js +57 -57
- package/build/commands/logout.js +55 -55
- package/build/commands/pullEnvs.js +84 -84
- package/build/commands/readEnv.js +59 -59
- package/build/commands/regen.js +64 -64
- package/build/commands/runlify.js +50 -50
- package/build/commands/showToken.js +60 -60
- package/build/commands/start.js +128 -128
- package/build/commands/tryGetMeta.js +57 -57
- package/build/documentation/algorithm.js +2 -2
- package/build/documentation/algoritmToDoc.js +23 -23
- package/build/documentation/algoritmToDoc.spec.js +58 -58
- package/build/documentation/curlExampleToText.js +58 -58
- package/build/documentation/curlExampleToText.spec.js +61 -61
- package/build/documentation/doc.js +3 -3
- package/build/documentation/docToFlatDoc.js +53 -53
- package/build/documentation/docToFlatDoc.spec.js +221 -221
- package/build/documentation/flatDoc.js +3 -3
- package/build/documentation/flatDocToText.js +16 -16
- package/build/documentation/flatDocToText.spec.js +71 -71
- package/build/documentation/templateDoc.js +3 -3
- package/build/documentation/templateDocToDoc.js +8 -8
- package/build/extensions/auth.js +135 -135
- package/build/extensions/cli-extension.js +16 -16
- package/build/extensions/cloudEnv.js +154 -154
- package/build/extensions/cloudMeta.js +84 -84
- package/build/extensions/globalConfig.js +93 -93
- package/build/extensions/localConfig.js +57 -57
- package/build/extensions/preventRunningIfUpdateAvailable.js +62 -62
- package/build/index.js +23 -23
- package/build/log.js +37 -37
- package/build/projectsGeneration/args.js +101 -101
- package/build/projectsGeneration/builders/BaseBuilder.js +74 -74
- package/build/projectsGeneration/builders/BaseSavableEntityBuilder.js +253 -253
- package/build/projectsGeneration/builders/CatalogBuilder.js +90 -90
- package/build/projectsGeneration/builders/DocumentBuilder.js +110 -110
- package/build/projectsGeneration/builders/InfoRegistryBuilder.js +228 -228
- package/build/projectsGeneration/builders/ReportBuilder.js +42 -42
- package/build/projectsGeneration/builders/RestApiBuilder.js +55 -55
- package/build/projectsGeneration/builders/RestApiMethodBuilder.js +72 -72
- package/build/projectsGeneration/builders/RoleBuilder.js +40 -40
- package/build/projectsGeneration/builders/SumRegistryBuilder.js +218 -218
- package/build/projectsGeneration/builders/SystemMetaBuilder.js +365 -365
- package/build/projectsGeneration/builders/TelegramBotBuilder.js +38 -38
- package/build/projectsGeneration/builders/WorkerBuilder.js +62 -62
- package/build/projectsGeneration/builders/buildedTypes.js +11 -11
- package/build/projectsGeneration/builders/curlTypes.js +2 -2
- package/build/projectsGeneration/builders/docs/DocumentationOfDocument.js +2 -2
- package/build/projectsGeneration/builders/docs/DocumentationOfDocumentBuilder.js +19 -19
- package/build/projectsGeneration/builders/fields/BaseFieldBuilder.js +212 -212
- package/build/projectsGeneration/builders/fields/IdFieldBuilder.js +98 -98
- package/build/projectsGeneration/builders/fields/LinkFieldBuilder.js +91 -91
- package/build/projectsGeneration/builders/fields/ScalarFieldBuilder.js +70 -70
- package/build/projectsGeneration/builders/fields/ViewLinkFieldBuilder.js +90 -90
- package/build/projectsGeneration/builders/index.js +19 -19
- package/build/projectsGeneration/builders/materialUiIcons.js +8881 -8881
- package/build/projectsGeneration/builders/tsFilterFields.js +38 -38
- package/build/projectsGeneration/builders/tsFilterFields.spec.js +28 -28
- package/build/projectsGeneration/builders/types.js +2 -2
- package/build/projectsGeneration/builders/ui/Forms.js +2 -2
- package/build/projectsGeneration/builders/ui/FormsBuilder.js +20 -20
- package/build/projectsGeneration/builders/ui/ListFormBuilder.js +20 -20
- package/build/projectsGeneration/builders/ui/ListFormFilterBuilder.js +28 -28
- package/build/projectsGeneration/builders/ui/ListFormFilterFieldBuilder.js +24 -24
- package/build/projectsGeneration/builders/utils/accessFunctions.js +11 -11
- package/build/projectsGeneration/commonEntities/addAggregateTrackings.js +13 -13
- package/build/projectsGeneration/commonEntities/addAuditLogs.js +71 -71
- package/build/projectsGeneration/commonEntities/addAutogeneration.js +90 -90
- package/build/projectsGeneration/commonEntities/addCommonCommands.js +20 -20
- package/build/projectsGeneration/commonEntities/addCommonEntities.js +30 -30
- package/build/projectsGeneration/commonEntities/addExternalSearch.js +12 -12
- package/build/projectsGeneration/commonEntities/addLanguages.js +13 -13
- package/build/projectsGeneration/commonEntities/addManagers.js +48 -48
- package/build/projectsGeneration/commonEntities/addMessageTemplates.js +54 -54
- package/build/projectsGeneration/commonEntities/addRefreshTokens.js +15 -15
- package/build/projectsGeneration/commonEntities/addRoles.js +79 -79
- package/build/projectsGeneration/commonEntities/addTenants.js +12 -12
- package/build/projectsGeneration/commonEntities/addUsers.js +27 -27
- package/build/projectsGeneration/commonEntities/index.js +32 -32
- package/build/projectsGeneration/defaultCatalogs/files.js +23 -23
- package/build/projectsGeneration/defaultCatalogs/index.js +17 -17
- package/build/projectsGeneration/genGraphSchemesByLocalGenerator.js +107 -107
- package/build/projectsGeneration/generateEntity.js +341 -341
- package/build/projectsGeneration/generateEnvironment.js +237 -237
- package/build/projectsGeneration/generateProject.js +803 -803
- package/build/projectsGeneration/generators/fieldTypeToTsType.js +25 -25
- package/build/projectsGeneration/generators/fileTemplates/back/Entities.js +17 -17
- package/build/projectsGeneration/generators/fileTemplates/back/devEnum.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/back/enum.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/Chart.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/back.js +15 -15
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/ingress.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/values.js +19 -19
- package/build/projectsGeneration/generators/fileTemplates/back/environment/defaultEnv.js +35 -35
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsConfiguration.js +26 -26
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsEntity.js +8 -8
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsRestApi.js +35 -35
- package/build/projectsGeneration/generators/fileTemplates/back/environment/gitlabCi.js +45 -45
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/clients/getPrisma.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/clients/knex.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/clients/queue/getQueue.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/index.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/back/graph/additionalResolvers.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/back/graph/additionalTypes.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/back/graph/entityAdditionalPermissionToGraphqlTmpl.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/back/graph/entityBasePermissionToGraphql.js +13 -13
- package/build/projectsGeneration/generators/fileTemplates/back/graph/entityPermissionToGraphqlTmpl.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/back/graph/help/baseResolvers.js +4 -4
- package/build/projectsGeneration/generators/fileTemplates/back/graph/help/baseTypeDefs.js +7 -7
- package/build/projectsGeneration/generators/fileTemplates/back/graph/help/permissionsToGraphql.js +4 -4
- package/build/projectsGeneration/generators/fileTemplates/back/graph/meta/resolvers.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/back/graph/meta/typeDefs.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/back/graph/permissionsToGraphql.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/back/graph/resolvers.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/back/graph/types.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/back/initCommon.js +53 -53
- package/build/projectsGeneration/generators/fileTemplates/back/initDev.js +45 -45
- package/build/projectsGeneration/generators/fileTemplates/back/initEntities.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/back/root/config.js +14 -14
- package/build/projectsGeneration/generators/fileTemplates/back/root/restRouter.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/back/services/AdditionalServices.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/back/services/BaseServices.js +14 -14
- package/build/projectsGeneration/generators/fileTemplates/back/services/HelpService/HelpService.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/additionalMethods.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnCreate.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnDelete.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnUpdate.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterCreate.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterDelete.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterUpdate.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeCreate.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeDelete.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeUpdate.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeUpsert.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/changeListFilter.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/getPostOperations.js +50 -50
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/getRegistryEntries.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/getUnPostOperations.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/tenantIdRequiredHooks.js +17 -17
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/initBuiltInHooks.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/initUserHooks.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/service.js +143 -143
- package/build/projectsGeneration/generators/fileTemplates/back/services/serviceConstrictors.js +14 -14
- package/build/projectsGeneration/generators/fileTemplates/ui/Dashboard.js +4 -4
- package/build/projectsGeneration/generators/fileTemplates/ui/MetaPage.js +7 -7
- package/build/projectsGeneration/generators/fileTemplates/ui/ResourcesPage.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/ui/additionalRoutes.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/entityMapping.js +15 -15
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/Chart.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/front.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/ingress.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/values.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/docs/adminAppDocsConfiguration.js +28 -28
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/gitlabCi.js +32 -32
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/App.js +13 -13
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/contexts/SpacesContext.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/dataProvider/index.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/layout/AppBar.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/layout/Menu.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/routes.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/ui/functions/Functions.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/ui/getAdditionalMenu.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/getDefaultMenu.js +22 -22
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangCatalogsTmpl.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangDocsTmpl.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangInfoRegistriesTmpl.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangReportsTmpl.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangSumRegistriesTmpl.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiTranslationsForServicesOfSavablesTmpl.js +22 -22
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiTranslationsLangTmpl.js +16 -16
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityCreate/DefaultEntityCreate.js +102 -102
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityCreate/index.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityEdit/DefaultEntityEdit.js +149 -149
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityEdit/index.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/DefaultEntityFilter.js +77 -77
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/DefaultEntityList.js +89 -89
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/EntityFilter.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/index.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultActions.js +23 -23
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultEntityShow.js +38 -38
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultMainTab.js +63 -63
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DependencyTab.js +79 -79
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/MainTab.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/additionalTabs.js +7 -7
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/index.js +9 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/Icon.js +11 -11
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/getEntityValidation.js +56 -56
- package/build/projectsGeneration/generators/fileTemplates/ui/resources.js +10 -10
- package/build/projectsGeneration/generators/fileTemplates/ui/widgets/count/CountWidget.js +12 -12
- package/build/projectsGeneration/generators/fileTemplates/ui/widgets/list/ListWidget.js +19 -19
- package/build/projectsGeneration/generators/graph/fieldTypeToGraphScalar.js +26 -26
- package/build/projectsGeneration/generators/graph/fields/genGraphField.js +20 -20
- package/build/projectsGeneration/generators/graph/fields/genGraphIdField.js +15 -15
- package/build/projectsGeneration/generators/graph/fields/genGraphIdFieldType.js +19 -19
- package/build/projectsGeneration/generators/graph/fields/genGraphLinkField.js +34 -34
- package/build/projectsGeneration/generators/graph/fields/genGraphScalarField.js +27 -27
- package/build/projectsGeneration/generators/graph/filters/genGraphField.js +20 -20
- package/build/projectsGeneration/generators/graph/filters/genGraphIdFilter.js +24 -24
- package/build/projectsGeneration/generators/graph/filters/genGraphLinkFilter.js +17 -17
- package/build/projectsGeneration/generators/graph/filters/genGraphScalarFilter.js +41 -41
- package/build/projectsGeneration/generators/graph/genGraphCrudSchema.js +102 -102
- package/build/projectsGeneration/generators/graph/genGraphCrudSchema.spec.js +86 -86
- package/build/projectsGeneration/generators/graph/genGraphFilterType.js +28 -28
- package/build/projectsGeneration/generators/graph/genGraphFilterType.spec.js +34 -34
- package/build/projectsGeneration/generators/graph/genGraphType.js +26 -26
- package/build/projectsGeneration/generators/graph/genGraphType.spec.js +27 -27
- package/build/projectsGeneration/generators/graph/printGraphType.js +10 -10
- package/build/projectsGeneration/generators/graph/printGraphType.spec.js +17 -17
- package/build/projectsGeneration/generators/prisma/fieldIdTypeToPrismaType.js +16 -16
- package/build/projectsGeneration/generators/prisma/fieldTypeToPrismaType.js +24 -24
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaDefault.js +10 -10
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaDefault.spec.js +56 -56
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaField.js +20 -20
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaFieldFromExternalEntity.js +11 -11
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaFieldFromExternalEntity.spec.js +35 -35
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaIdField.js +18 -18
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaIdField.spec.js +44 -44
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaLinkFields.js +31 -31
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaLinkFields.spec.js +85 -85
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaScalarField.js +23 -23
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaScalarField.spec.js +116 -116
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaEntity.js +54 -54
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaEntity.spec.js +97 -97
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaSchemaForEntities.js +13 -13
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaSchemaForEntitiesWithClientAdnDb.js +10 -10
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNameToEditScalar.js +24 -24
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditField.js +20 -20
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditIdField.js +8 -8
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditLinkField.js +14 -14
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditLinkField.spec.js +23 -23
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditScalarField.js +8 -8
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNameToShowScalar.js +28 -28
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowField.js +20 -20
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowIdField.js +8 -8
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowLinkField.js +16 -16
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowLinkField.spec.js +166 -166
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowScalarField.js +8 -8
- package/build/projectsGeneration/generators/ui/componentNames/types.js +2 -2
- package/build/projectsGeneration/generators/ui/getLinkShowComponent.spec.js +41 -41
- package/build/projectsGeneration/generators/ui/getScalarShowComponent.spec.js +26 -26
- package/build/projectsGeneration/generators/ui/getShowComponent.js +44 -44
- package/build/projectsGeneration/index.js +27 -27
- package/build/projectsGeneration/links/getLinksFromExternalEntities.js +7 -7
- package/build/projectsGeneration/links/getLinksFromExternalEntities.spec.js +91 -91
- package/build/projectsGeneration/links/getLinksOfEntities.js +21 -21
- package/build/projectsGeneration/links/getLinksOfEntities.spec.js +200 -200
- package/build/projectsGeneration/links/getLinksToExternalEntities.js +7 -7
- package/build/projectsGeneration/links/getLinksToExternalEntities.spec.js +91 -91
- package/build/projectsGeneration/metaUtils.js +37 -37
- package/build/projectsGeneration/modelsGeneration.serialization.spec.js +95 -95
- package/build/projectsGeneration/modules/addEmailModuleEntities.js +67 -67
- package/build/projectsGeneration/modules/index.js +8 -8
- package/build/projectsGeneration/types.js +79 -79
- package/build/projectsGeneration/utils.js +84 -84
- package/build/templates/model.ts.ejs +3 -3
- package/build/templates/runlify.developer.example.json.ejs +2 -2
- package/build/templates/runlify.json.ejs +5 -5
- package/build/types/cli.d.ts +1 -1
- package/build/types/commands/availableEnvironments.d.ts +1 -1
- package/build/types/commands/generate.d.ts +1 -1
- package/build/types/commands/init.d.ts +1 -1
- package/build/types/commands/login.d.ts +1 -1
- package/build/types/commands/logout.d.ts +1 -1
- package/build/types/commands/pullEnvs.d.ts +1 -1
- package/build/types/commands/readEnv.d.ts +1 -1
- package/build/types/commands/regen.d.ts +1 -1
- package/build/types/commands/runlify.d.ts +1 -1
- package/build/types/commands/showToken.d.ts +1 -1
- package/build/types/commands/start.d.ts +1 -1
- package/build/types/commands/tryGetMeta.d.ts +1 -1
- package/build/types/documentation/algorithm.d.ts +8 -8
- package/build/types/documentation/algoritmToDoc.d.ts +4 -4
- package/build/types/documentation/algoritmToDoc.spec.d.ts +1 -1
- package/build/types/documentation/curlExampleToText.d.ts +3 -3
- package/build/types/documentation/curlExampleToText.spec.d.ts +1 -1
- package/build/types/documentation/doc.d.ts +21 -21
- package/build/types/documentation/docToFlatDoc.d.ts +4 -4
- package/build/types/documentation/docToFlatDoc.spec.d.ts +1 -1
- package/build/types/documentation/flatDoc.d.ts +20 -20
- package/build/types/documentation/flatDocToText.d.ts +3 -3
- package/build/types/documentation/flatDocToText.spec.d.ts +1 -1
- package/build/types/documentation/templateDoc.d.ts +9 -9
- package/build/types/documentation/templateDocToDoc.d.ts +4 -4
- package/build/types/extensions/auth.d.ts +1 -1
- package/build/types/extensions/cli-extension.d.ts +1 -1
- package/build/types/extensions/cloudEnv.d.ts +1 -1
- package/build/types/extensions/cloudMeta.d.ts +1 -1
- package/build/types/extensions/globalConfig.d.ts +1 -1
- package/build/types/extensions/localConfig.d.ts +1 -1
- package/build/types/extensions/preventRunningIfUpdateAvailable.d.ts +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/log.d.ts +3 -3
- package/build/types/projectsGeneration/args.d.ts +20 -20
- package/build/types/projectsGeneration/builders/BaseBuilder.d.ts +14 -14
- package/build/types/projectsGeneration/builders/BaseSavableEntityBuilder.d.ts +58 -58
- package/build/types/projectsGeneration/builders/CatalogBuilder.d.ts +8 -8
- package/build/types/projectsGeneration/builders/DocumentBuilder.d.ts +12 -12
- package/build/types/projectsGeneration/builders/InfoRegistryBuilder.d.ts +34 -34
- package/build/types/projectsGeneration/builders/ReportBuilder.d.ts +8 -8
- package/build/types/projectsGeneration/builders/RestApiBuilder.d.ts +12 -12
- package/build/types/projectsGeneration/builders/RestApiMethodBuilder.d.ts +20 -20
- package/build/types/projectsGeneration/builders/RoleBuilder.d.ts +8 -8
- package/build/types/projectsGeneration/builders/SumRegistryBuilder.d.ts +32 -32
- package/build/types/projectsGeneration/builders/SystemMetaBuilder.d.ts +64 -64
- package/build/types/projectsGeneration/builders/TelegramBotBuilder.d.ts +7 -7
- package/build/types/projectsGeneration/builders/WorkerBuilder.d.ts +11 -11
- package/build/types/projectsGeneration/builders/buildedTypes.d.ts +243 -243
- package/build/types/projectsGeneration/builders/curlTypes.d.ts +24 -24
- package/build/types/projectsGeneration/builders/docs/DocumentationOfDocument.d.ts +10 -10
- package/build/types/projectsGeneration/builders/docs/DocumentationOfDocumentBuilder.d.ts +9 -9
- package/build/types/projectsGeneration/builders/fields/BaseFieldBuilder.d.ts +46 -46
- package/build/types/projectsGeneration/builders/fields/IdFieldBuilder.d.ts +12 -12
- package/build/types/projectsGeneration/builders/fields/LinkFieldBuilder.d.ts +13 -13
- package/build/types/projectsGeneration/builders/fields/ScalarFieldBuilder.d.ts +5 -5
- package/build/types/projectsGeneration/builders/fields/ViewLinkFieldBuilder.d.ts +13 -13
- package/build/types/projectsGeneration/builders/index.d.ts +3 -3
- package/build/types/projectsGeneration/builders/materialUiIcons.d.ts +2 -2
- package/build/types/projectsGeneration/builders/tsFilterFields.d.ts +2 -2
- package/build/types/projectsGeneration/builders/tsFilterFields.spec.d.ts +1 -1
- package/build/types/projectsGeneration/builders/types.d.ts +5 -5
- package/build/types/projectsGeneration/builders/ui/Forms.d.ts +14 -14
- package/build/types/projectsGeneration/builders/ui/FormsBuilder.d.ts +10 -10
- package/build/types/projectsGeneration/builders/ui/ListFormBuilder.d.ts +10 -10
- package/build/types/projectsGeneration/builders/ui/ListFormFilterBuilder.d.ts +10 -10
- package/build/types/projectsGeneration/builders/ui/ListFormFilterFieldBuilder.d.ts +11 -11
- package/build/types/projectsGeneration/builders/utils/accessFunctions.d.ts +2 -2
- package/build/types/projectsGeneration/commonEntities/addAggregateTrackings.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addAuditLogs.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addAutogeneration.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addCommonCommands.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addCommonEntities.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addExternalSearch.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addLanguages.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addManagers.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addMessageTemplates.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addRefreshTokens.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addRoles.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addTenants.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/addUsers.d.ts +3 -3
- package/build/types/projectsGeneration/commonEntities/index.d.ts +13 -13
- package/build/types/projectsGeneration/defaultCatalogs/files.d.ts +4 -4
- package/build/types/projectsGeneration/defaultCatalogs/index.d.ts +1 -1
- package/build/types/projectsGeneration/genGraphSchemesByLocalGenerator.d.ts +2 -2
- package/build/types/projectsGeneration/generateEntity.d.ts +2 -2
- package/build/types/projectsGeneration/generateEnvironment.d.ts +2 -2
- package/build/types/projectsGeneration/generateProject.d.ts +34 -34
- package/build/types/projectsGeneration/generators/fieldTypeToTsType.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/Entities.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/devEnum.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/enum.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/chart/Chart.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/back.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/ingress.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/chart/values.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/defaultEnv.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsConfiguration.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsEntity.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsRestApi.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/gitlabCi.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/src/clients/getPrisma.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/src/clients/knex.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/src/clients/queue/getQueue.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/src/index.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/additionalResolvers.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/additionalTypes.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/entityAdditionalPermissionToGraphqlTmpl.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/entityBasePermissionToGraphql.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/entityPermissionToGraphqlTmpl.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/help/baseResolvers.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/help/baseTypeDefs.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/help/permissionsToGraphql.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/meta/resolvers.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/meta/typeDefs.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/permissionsToGraphql.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/resolvers.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/graph/types.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/initCommon.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/initDev.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/initEntities.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/root/config.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/root/restRouter.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/AdditionalServices.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/BaseServices.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/HelpService/HelpService.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/additionalMethods.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnCreate.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnDelete.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnUpdate.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterCreate.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterDelete.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterUpdate.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeCreate.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeDelete.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeUpdate.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeUpsert.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/changeListFilter.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/getPostOperations.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/getRegistryEntries.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/getUnPostOperations.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/tenantIdRequiredHooks.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/initBuiltInHooks.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/initUserHooks.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/service.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/serviceConstrictors.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/ui/Dashboard.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/MetaPage.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/ResourcesPage.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/additionalRoutes.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/entityMapping.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/chart/Chart.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/front.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/ingress.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/chart/values.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/docs/adminAppDocsConfiguration.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/gitlabCi.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/src/App.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/src/contexts/SpacesContext.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/src/dataProvider/index.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/src/layout/AppBar.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/src/layout/Menu.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/src/routes.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/ui/functions/Functions.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/getAdditionalMenu.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/getDefaultMenu.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangCatalogsTmpl.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangDocsTmpl.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangInfoRegistriesTmpl.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangReportsTmpl.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangSumRegistriesTmpl.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiTranslationsForServicesOfSavablesTmpl.d.ts +4 -4
- package/build/types/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiTranslationsLangTmpl.d.ts +6 -6
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityCreate/DefaultEntityCreate.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityCreate/index.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityEdit/DefaultEntityEdit.d.ts +6 -6
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityEdit/index.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/DefaultEntityFilter.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/DefaultEntityList.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/EntityFilter.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/index.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultActions.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultEntityShow.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultMainTab.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DependencyTab.d.ts +3 -3
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/MainTab.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/additionalTabs.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/index.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/Icon.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/pages/getEntityValidation.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/resources.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/widgets/count/CountWidget.d.ts +2 -2
- package/build/types/projectsGeneration/generators/fileTemplates/ui/widgets/list/ListWidget.d.ts +2 -2
- package/build/types/projectsGeneration/generators/graph/fieldTypeToGraphScalar.d.ts +2 -2
- package/build/types/projectsGeneration/generators/graph/fields/genGraphField.d.ts +7 -7
- package/build/types/projectsGeneration/generators/graph/fields/genGraphIdField.d.ts +8 -8
- package/build/types/projectsGeneration/generators/graph/fields/genGraphIdFieldType.d.ts +2 -2
- package/build/types/projectsGeneration/generators/graph/fields/genGraphLinkField.d.ts +8 -8
- package/build/types/projectsGeneration/generators/graph/fields/genGraphScalarField.d.ts +8 -8
- package/build/types/projectsGeneration/generators/graph/filters/genGraphField.d.ts +4 -4
- package/build/types/projectsGeneration/generators/graph/filters/genGraphIdFilter.d.ts +8 -8
- package/build/types/projectsGeneration/generators/graph/filters/genGraphLinkFilter.d.ts +5 -5
- package/build/types/projectsGeneration/generators/graph/filters/genGraphScalarFilter.d.ts +5 -5
- package/build/types/projectsGeneration/generators/graph/genGraphCrudSchema.d.ts +3 -3
- package/build/types/projectsGeneration/generators/graph/genGraphCrudSchema.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/graph/genGraphFilterType.d.ts +3 -3
- package/build/types/projectsGeneration/generators/graph/genGraphFilterType.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/graph/genGraphType.d.ts +3 -3
- package/build/types/projectsGeneration/generators/graph/genGraphType.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/graph/printGraphType.d.ts +2 -2
- package/build/types/projectsGeneration/generators/graph/printGraphType.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/prisma/fieldIdTypeToPrismaType.d.ts +2 -2
- package/build/types/projectsGeneration/generators/prisma/fieldTypeToPrismaType.d.ts +2 -2
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaDefault.d.ts +2 -2
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaDefault.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaField.d.ts +2 -2
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaFieldFromExternalEntity.d.ts +2 -2
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaFieldFromExternalEntity.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaIdField.d.ts +2 -2
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaIdField.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaLinkFields.d.ts +2 -2
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaLinkFields.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaScalarField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/prisma/scheme/fields/genPrismaScalarField.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/prisma/scheme/genPrismaEntity.d.ts +3 -3
- package/build/types/projectsGeneration/generators/prisma/scheme/genPrismaEntity.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/prisma/scheme/genPrismaSchemaForEntities.d.ts +3 -3
- package/build/types/projectsGeneration/generators/prisma/scheme/genPrismaSchemaForEntitiesWithClientAdnDb.d.ts +2 -2
- package/build/types/projectsGeneration/generators/ui/componentNames/edit/getCompNameToEditScalar.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditIdField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditLinkField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditLinkField.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditScalarField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/show/getCompNameToShowScalar.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowIdField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowLinkField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowLinkField.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowScalarField.d.ts +3 -3
- package/build/types/projectsGeneration/generators/ui/componentNames/types.d.ts +4 -4
- package/build/types/projectsGeneration/generators/ui/getLinkShowComponent.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/ui/getScalarShowComponent.spec.d.ts +1 -1
- package/build/types/projectsGeneration/generators/ui/getShowComponent.d.ts +6 -6
- package/build/types/projectsGeneration/index.d.ts +6 -6
- package/build/types/projectsGeneration/links/getLinksFromExternalEntities.d.ts +3 -3
- package/build/types/projectsGeneration/links/getLinksFromExternalEntities.spec.d.ts +1 -1
- package/build/types/projectsGeneration/links/getLinksOfEntities.d.ts +3 -3
- package/build/types/projectsGeneration/links/getLinksOfEntities.spec.d.ts +1 -1
- package/build/types/projectsGeneration/links/getLinksToExternalEntities.d.ts +3 -3
- package/build/types/projectsGeneration/links/getLinksToExternalEntities.spec.d.ts +1 -1
- package/build/types/projectsGeneration/metaUtils.d.ts +7 -7
- package/build/types/projectsGeneration/modelsGeneration.serialization.spec.d.ts +1 -1
- package/build/types/projectsGeneration/modules/addEmailModuleEntities.d.ts +3 -3
- package/build/types/projectsGeneration/modules/index.d.ts +1 -1
- package/build/types/projectsGeneration/types.d.ts +92 -92
- package/build/types/projectsGeneration/utils.d.ts +14 -14
- package/build/types/types.d.ts +1 -1
- package/build/types/utils/TermSignals.d.ts +29 -29
- package/build/types/utils/cases.d.ts +9 -9
- package/build/types/utils/getPkgManager.d.ts +3 -3
- package/build/types.js +17 -17
- package/build/utils/TermSignals.js +116 -116
- package/build/utils/cases.js +32 -32
- package/build/utils/getPkgManager.js +28 -28
- package/docs/commands.md +3 -3
- package/docs/plugins.md +47 -47
- package/package.json +81 -81
- package/readme.md +26 -26
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prismaServiceTmpl = void 0;
|
|
4
|
-
/* eslint-disable max-len */
|
|
5
|
-
var fieldTypeToTsType_1 = require("../../../../fieldTypeToTsType");
|
|
6
|
-
var cases_1 = require("../../../../../../utils/cases");
|
|
7
|
-
var utils_1 = require("../../../../../utils");
|
|
8
|
-
var metaUtils_1 = require("../../../../../metaUtils");
|
|
9
|
-
var change_case_1 = require("change-case");
|
|
10
|
-
var autogeneratedStringId = function (entity) {
|
|
11
|
-
return (0, metaUtils_1.getKeyField)(entity).autoGenerated && (0, metaUtils_1.getKeyField)(entity).type === 'string';
|
|
12
|
-
};
|
|
13
|
-
var prismaServiceTmpl = function (_a) {
|
|
14
|
-
var entity = _a.entity, options = _a.options;
|
|
15
|
-
var contextName = 'Context';
|
|
16
|
-
var forbiddenForUserFields = entity.fields.filter(function (f) { return !f.updatableByUser && f.name !== 'search'; });
|
|
17
|
-
var requiredForDbButNotForUserFields = entity.fields.filter(function (f) { return f.required && !f.requiredOnInput && f.name !== 'id'; });
|
|
18
|
-
// const notRequiredOnInputFields: ScalarField[] = entity.fields.filter(f => ['scalar', 'link'].includes(f.category) && !f.requiredOnInput && f.name !== 'search') as ScalarField[];
|
|
19
|
-
// const notRequiredOnInputFields: ScalarField[] = entity.fields.filter(f => f.category === 'scalar' && !f.updatableByUser) as ScalarField[];
|
|
20
|
-
var getDefaultableFields = function () {
|
|
21
|
-
return entity.fields
|
|
22
|
-
.filter(function (f) { return f.defaultBackendValueExpression; })
|
|
23
|
-
.filter(function (f) { return !f.hidden; });
|
|
24
|
-
};
|
|
25
|
-
var getDefaultValues = function () {
|
|
26
|
-
return getDefaultableFields().map(function (f) { return "".concat(f.name, ": ").concat(f.defaultBackendValueExpression); });
|
|
27
|
-
};
|
|
28
|
-
var searchableFields = entity.fields.filter(function (f) { return f.searchable; });
|
|
29
|
-
var dateFields = searchableFields.filter(function (f) {
|
|
30
|
-
return ['date', 'datetime'].includes(f.type);
|
|
31
|
-
});
|
|
32
|
-
var notDateFields = searchableFields.filter(function (f) { return !['date', 'datetime'].includes(f.type); });
|
|
33
|
-
var getDefaultValuesWithSearchJoined = function (initialObjectName) {
|
|
34
|
-
var defaultValues = getDefaultValues();
|
|
35
|
-
if (['catalog', 'document'].includes(entity.type)) {
|
|
36
|
-
defaultValues.push("search: getSearchString(".concat(initialObjectName, ")"));
|
|
37
|
-
}
|
|
38
|
-
return defaultValues.map(utils_1.addComma).join('\n');
|
|
39
|
-
};
|
|
40
|
-
return "import {\n ListMetadata,\n MutationCreate".concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args,\n Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs,\n ").concat((0, cases_1.pascalSingular)(entity.name), ",\n ").concat((0, cases_1.pascalSingular)(entity.name), "Filter,\n} from '../../../generated/graphql';\nimport {toPrismaRequest} from '../../../utils/prisma/toPrismaRequest';\nimport {").concat(contextName, "} from '../types';").concat(entity.type === 'document'
|
|
41
|
-
? "\nimport {Prisma, PrismaPromise} from '@prisma/client';"
|
|
42
|
-
: "\nimport {Prisma} from '@prisma/client';", "\nimport {Additional").concat((0, cases_1.pascalPlural)(entity.name), "Methods, getAdditionalMethods} from './additionalMethods';\nimport initUserHooks from './initUserHooks';\nimport initBuiltInHooks from './initBuiltInHooks';\nimport {getHooksUtils, HooksAddType} from '../getHooksUtils';\nimport * as R from 'ramda';").concat(autogeneratedStringId(entity)
|
|
43
|
-
? "\nimport {v4 as uuidv4} from 'uuid';"
|
|
44
|
-
: '').concat(entity.type === 'document'
|
|
45
|
-
? "\nimport {getUnPostOperations} from './hooks/getUnPostOperations';\nimport {".concat((0, cases_1.pascalSingular)(entity.name), "RegistryEntries, getPostOperations} from './hooks/getPostOperations';\nimport {getRegistryEntries} from './hooks/getRegistryEntries';")
|
|
46
|
-
: '').concat(entity.auditable
|
|
47
|
-
? "\nimport Entity from '../../../types/Entity';"
|
|
48
|
-
: '').concat(entity.externalSearch
|
|
49
|
-
? "\nimport {toElasticRequest} from '../../../utils/toElasticRequest';"
|
|
50
|
-
: "\nimport {toPrismaTotalRequest} from '../../../utils/prisma/toPrismaTotalRequest';", "\nimport {DefinedFieldsInRecord, DefinedRecord, PartialFieldsInRecord} from '../../../types/utils';\nimport getSearchStringCreator from '../utils/getSearchStringCreator';\n").concat(options.skipWarningThisIsGenerated
|
|
51
|
-
? ''
|
|
52
|
-
: "\n// ".concat(utils_1.generatedWarning, "\n"), "\nconst forbiddenForUserFields: string[] = ").concat(forbiddenForUserFields.length > 0
|
|
53
|
-
? "[\n".concat((0, utils_1.pad1)(forbiddenForUserFields.map(function (f) { return "'".concat(f.name, "',"); }).join('\n')), "\n];")
|
|
54
|
-
: '[];', "\n").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
55
|
-
? "\nexport type Slice".concat((0, cases_1.pascalPlural)(entity.name), "Filter = QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args['filter'];\n")
|
|
56
|
-
: '', "\nexport type Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys = ").concat(getDefaultableFields().length > 0
|
|
57
|
-
? "".concat(getDefaultableFields()
|
|
58
|
-
.map(function (f) { return "'".concat(f.name, "'"); })
|
|
59
|
-
.join(' | '))
|
|
60
|
-
: 'never', ";\nexport type ForbidenForUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys = ").concat(forbiddenForUserFields.length > 0
|
|
61
|
-
? "".concat(forbiddenForUserFields.map(function (f) { return "'".concat(f.name, "'"); }).join(' | '))
|
|
62
|
-
: 'never', ";\nexport type RequiredDbNotUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys = ").concat(requiredForDbButNotForUserFields.length > 0
|
|
63
|
-
? "".concat(requiredForDbButNotForUserFields
|
|
64
|
-
.map(function (f) { return "'".concat(f.name, "'"); })
|
|
65
|
-
.join(' | '))
|
|
66
|
-
: 'never', ";\n\nexport type Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part = DefinedRecord<Pick<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>>;\n\nexport type Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput =\n Omit<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, ForbidenForUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys>\n & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\n\nexport type Allowed").concat((0, cases_1.pascalSingular)(entity.name), "ForUserCreateInput = Omit<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, ForbidenForUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\n\nexport type StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args = DefinedFieldsInRecord<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, RequiredDbNotUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys> & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\nexport type StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args = DefinedFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args, RequiredDbNotUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys> & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\n\nexport type StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable = PartialFieldsInRecord<StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\nexport type MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable = PartialFieldsInRecord<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\nexport type MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable = PartialFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\n\nexport interface Base").concat((0, cases_1.pascalPlural)(entity.name), "Methods {\n get: (id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ") =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;\n getRequired: (id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ") =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n all: (params?: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), "[]>;\n findOne: (params?: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;\n findOneRequired: (params?: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
67
|
-
? "\n sliceOfTheLast: (date?: Date, filter?: Slice".concat((0, cases_1.pascalPlural)(entity.name), "Filter) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;\n sliceOfTheFirst: (date?: Date, filter?: Slice").concat((0, cases_1.pascalPlural)(entity.name), "Filter) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;")
|
|
68
|
-
: '', "\n count: (params?: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs) =>\n Promise<number>;\n meta: (params?: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs) =>\n Promise<ListMetadata>;\n create: (data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, byUser?: boolean) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n createMany: (data: StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable[], byUser?: boolean) =>\n Promise<Prisma.BatchPayload>;\n update: ({id, ...rest}: MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, byUser?: boolean) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n upsert: (\n data: PartialFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, 'id'>,\n byUser?: boolean,\n ) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n upsertAdvanced: (\n filter: ").concat((0, cases_1.pascalSingular)(entity.name), "Filter,\n data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser?: boolean,\n ) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n delete: (params: MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;").concat(entity.type === 'document'
|
|
69
|
-
? "\n\n rePost: (id: number) =>\n Promise<void>;\n getRegistryEntries: (data: ".concat((0, cases_1.pascalSingular)(entity.name), ") =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), "RegistryEntries>;\n getPostOperations: (data: ").concat((0, cases_1.pascalSingular)(entity.name), ") =>\n Promise<PrismaPromise<any>[]>;\n getUnPostOperations: (id: number) =>\n Promise<PrismaPromise<any>[]>;")
|
|
70
|
-
: '', "\n}\n\nexport type ").concat((0, cases_1.pascalPlural)(entity.name), "Service = Base").concat((0, cases_1.pascalPlural)(entity.name), "Methods\n & Additional").concat((0, cases_1.pascalPlural)(entity.name), "Methods\n & HooksAddType<\n ").concat((0, cases_1.pascalSingular)(entity.name), ",\n QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args,\n Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput,\n MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args\n >;\n\nconst dateFieldsForSearch: string[] = ").concat(dateFields.length
|
|
71
|
-
? "[\n".concat(dateFields
|
|
72
|
-
.map(function (f) { return "'".concat(f.name, "',"); })
|
|
73
|
-
.map(utils_1.pad1)
|
|
74
|
-
.join('\n'), "\n];")
|
|
75
|
-
: '[];', "\n\nconst otherFieldsForSearch: string[] = ").concat(notDateFields.length
|
|
76
|
-
? "[\n".concat(notDateFields
|
|
77
|
-
.map(function (f) { return "'".concat(f.name, "',"); })
|
|
78
|
-
.map(utils_1.pad1)
|
|
79
|
-
.join('\n'), "\n];")
|
|
80
|
-
: '[];', "\n\nexport const get").concat((0, cases_1.pascalPlural)(entity.name), "Service = (ctx: ").concat(contextName, ") => {\n const {hooksAdd, runHooks} = getHooksUtils<\n ").concat((0, cases_1.pascalSingular)(entity.name), ",\n QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args,\n Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput,\n MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args\n >();\n\n const getSearchString = getSearchStringCreator(dateFieldsForSearch, otherFieldsForSearch);\n\n const augmentByDefault = async <T>(\n currentData: Record<string, any>,\n ): Promise<T & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part> => ").concat(getDefaultableFields().length
|
|
81
|
-
? "{\n const defaultFieldConstructors = {\n".concat((0, utils_1.pad3)(getDefaultableFields()
|
|
82
|
-
.map(function (f) { return "".concat(f.name, ": async () => ").concat(f.defaultBackendValueExpression); })
|
|
83
|
-
.map(utils_1.addComma)
|
|
84
|
-
.join('\n')), "\n };\n\n const pairedConstructors = R.toPairs(defaultFieldConstructors);\n\n const resultedPairs: R.KeyValuePair<string, any>[] = [];\n for (const [key, constructor] of pairedConstructors) {\n resultedPairs.push([key, key in currentData && currentData[key] ? currentData[key] : await constructor()]);\n }\n\n return R.mergeLeft(currentData, R.fromPairs(resultedPairs)) as T & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\n }")
|
|
85
|
-
: "currentData as T & Autodefinable".concat((0, cases_1.pascalSingular)(entity.name), "Part"), ";\n\n const all = async (\n params: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args = {},\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "[]> => {").concat(entity.externalSearch
|
|
86
|
-
? "\n const elasticSearch = ctx.elastic.createSearcher('".concat((0, change_case_1.pathCase)(entity.name), "');\n\n const search = await elasticSearch(toElasticRequest(await runHooks.changeListFilter(ctx, params)));\n\n const ids = search.hits.hits.map(el => BigInt((el._source as ").concat((0, cases_1.pascalSingular)(entity.name), ").id));\n const prismaReq = toPrismaRequest(params, {noId: false});\n\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findMany(\n {\n where: {id: {in: ids}},\n orderBy: prismaReq.orderBy,\n },")
|
|
87
|
-
: "\n return ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".findMany(\n toPrismaRequest(await runHooks.changeListFilter(ctx, params), {noId: false}),"), "\n ) as unknown as Promise<").concat((0, cases_1.pascalSingular)(entity.name), "[]>;\n };\n\n const findOne = async (\n params: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args = {},\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findFirst(toPrismaRequest(\n await runHooks.changeListFilter(ctx, params),\n {noId: false},\n ));\n };\n\n const findOneRequired = async (\n params: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args = {},\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n const found = await findOne(params);\n\n if (!found) {\n throw new Error(`There is no entry with \"${JSON.stringify(params)}\" filter`);\n }\n\n return found;\n };\n\n const get = async (\n id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ",\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return findOne({filter: {id}});\n };\n\n const getRequired = async (\n id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ",\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n const found = await get(id);\n\n if (!found) {\n throw new Error(`There is no entry with \"${id}\" id`);\n }\n\n return found;\n };\n").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
88
|
-
? "\n const sliceOfTheLast = async (\n date?: Date,\n filter?: Slice".concat((0, cases_1.pascalPlural)(entity.name), "Filter,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findFirst(toPrismaRequest({\n sortField: 'date',\n sortOrder: 'desc',\n filter: {\n ...filter,\n date_lte: date ?? new Date(),\n },\n }, {noId: false}));\n };\n\n const sliceOfTheFirst = async (\n date?: Date,\n filter?: Slice").concat((0, cases_1.pascalPlural)(entity.name), "Filter,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findFirst(toPrismaRequest({\n sortField: 'date',\n sortOrder: 'asc',\n filter: {\n ...filter,\n date_gte: date ?? new Date(),\n },\n }, {noId: false}));\n };\n")
|
|
89
|
-
: '', "\n const count = async (\n params: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs = {},\n ): Promise<number> => {").concat(entity.externalSearch
|
|
90
|
-
? "\n const elasticCount = ctx.elastic.createCounter('".concat((0, change_case_1.pathCase)(entity.name), "');\n\n const reg = R.omit(['sortOrder', 'sortField'], toElasticRequest(await runHooks.changeListFilter(ctx, params)));\n\n const result = await elasticCount(reg);\n\n return result.count;\n };")
|
|
91
|
-
: "\n return ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".count(toPrismaTotalRequest(await runHooks.changeListFilter(ctx, params)));\n };"), "\n\n const meta = async (\n params: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs = {},\n ): Promise<ListMetadata> => {\n return count(params).then(count => ({count}));\n };").concat(options.readOnly
|
|
92
|
-
? ''
|
|
93
|
-
: "".concat(entity.type === 'document'
|
|
94
|
-
? "\n\n const post = async (\n data: ".concat((0, cases_1.pascalSingular)(entity.name), ",\n ): Promise<void> => {\n await ctx.prisma.$transaction(await getPostOperations(ctx, await augmentByDefault(data)));\n };")
|
|
95
|
-
: '', "\n\n const create = async (\n data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n // clear from fields forbidden for user\n const cleared = byUser ?\n R.omit(forbiddenForUserFields, data) as Allowed").concat((0, cases_1.pascalSingular)(entity.name), "ForUserCreateInput :\n data;\n\n // Augment with default field\n const augmentedByDefault: Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput = await augmentByDefault(cleared);\n\n const processedData = await runHooks.beforeCreate(ctx, augmentedByDefault);\n").concat(autogeneratedStringId(entity)
|
|
96
|
-
? "\n const createOperation = ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".create({\n data: {\n id: uuidv4(),\n ...R.mergeDeepLeft(\n processedData,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
97
|
-
? "{\n search: getSearchString(processedData),\n }"
|
|
98
|
-
: '{}', "\n ),\n },\n });")
|
|
99
|
-
: "\n const createOperation = ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".create({\n data: R.mergeDeepLeft(\n processedData,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
100
|
-
? "{\n search: getSearchString(processedData),\n }"
|
|
101
|
-
: '{}', ",\n ),\n });"), "\n\n const operations = [\n createOperation,\n ...(await runHooks.additionalOperationsOnCreate(ctx, processedData)),\n ];\n\n const [result] = await ctx.prisma.$transaction(operations as any);\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n await Promise.all([").concat(getDefaultValuesWithSearchJoined('processedData')
|
|
102
|
-
? "\n // update search. earlier we does not have id\n ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".update({\n where: {id: result.id},\n data: ").concat(['catalog', 'document'].includes(entity.type)
|
|
103
|
-
? "{\n search: getSearchString(result),\n }"
|
|
104
|
-
: '{}', ",\n }),")
|
|
105
|
-
: '').concat(entity.auditable
|
|
106
|
-
? "\n ctx.service('auditLogs').addCreateOperation({\n entityTypeId: Entity.".concat((0, cases_1.pascalSingular)(entity.name), ",\n entityId: result.id,\n actionData: data,\n }),")
|
|
107
|
-
: '').concat(entity.externalSearch
|
|
108
|
-
? "\n ctx.service('externalSearch').onEntityChange(Entity.".concat((0, cases_1.pascalSingular)(entity.name), ", result.id.toString()),")
|
|
109
|
-
: '').concat(entity.type === 'document'
|
|
110
|
-
? "\n await ctx.prisma.$transaction(await getPostOperations(ctx, result)),"
|
|
111
|
-
: '', "\n ]);\n\n await runHooks.afterCreate(ctx, result as ").concat((0, cases_1.pascalSingular)(entity.name), ");\n\n return result as ").concat((0, cases_1.pascalSingular)(entity.name), ";\n };\n\n const createMany = async (\n entries: StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable[],\n byUser = false,\n ): Promise<Prisma.BatchPayload> => {\n // clear from fields forbidden for user\n const clearedData = byUser ? entries.map(data => R.omit(forbiddenForUserFields, data)) : entries;\n\n // Augment with default field\n const augmentedByDefault = await Promise.all(\n clearedData.map(el => augmentByDefault(el)),\n ) as StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args[];\n").concat(autogeneratedStringId(entity)
|
|
112
|
-
? "\n const result = await ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".createMany({data: augmentedByDefault.map(data => ({\n id: uuidv4(),\n ...R.mergeDeepLeft(\n data,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
113
|
-
? "{\n search: getSearchString(data),\n }"
|
|
114
|
-
: '{}', ",\n ),\n })), skipDuplicates: true});")
|
|
115
|
-
: "\n const result = await ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".createMany({\n data: augmentedByDefault.map(data => R.mergeDeepLeft(\n data,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
116
|
-
? "{\n search: getSearchString(data),\n }"
|
|
117
|
-
: '{}', ",\n )),\n skipDuplicates: true,\n });"), "\n\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n return result;\n };\n\n const update = async (\n data: MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n // Get db version\n const dbVersion = await getRequired(data.id);\n\n // clear from fields forbidden for user\n const cleared = byUser ? R.omit(forbiddenForUserFields, data) : data;\n\n // Augment with default field\n const augmentedByDefault = await augmentByDefault(cleared);\n\n // augment data by fields from db\n const augmented: StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args = R.mergeLeft(augmentedByDefault, dbVersion);\n\n const processedData = await runHooks.beforeUpdate(ctx, augmented);\n\n const {id, ...rest} = processedData;\n\n const updateOperation = ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".update({\n data: R.mergeDeepLeft(\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
118
|
-
? "{\n search: getSearchString(processedData),\n }"
|
|
119
|
-
: '{}', ",\n rest,\n ),\n where: {id},\n });\n").concat(entity.auditable
|
|
120
|
-
? "\n const auditOperation = ctx.service('auditLogs').addUpdateOperation({\n entityTypeId: Entity.".concat((0, cases_1.pascalSingular)(entity.name), ",\n entityId: data.id,\n actionData: data,\n });\n")
|
|
121
|
-
: '', "\n const operations = [\n updateOperation,").concat(entity.auditable
|
|
122
|
-
? "\n auditOperation,"
|
|
123
|
-
: '', "\n ...(await runHooks.additionalOperationsOnUpdate(ctx, processedData)),").concat(entity.type === 'document'
|
|
124
|
-
? "\n ...(await getPostOperations(ctx, processedData)),"
|
|
125
|
-
: '', "\n ];\n\n const [result] = await ctx.prisma.$transaction(operations as any);\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n await Promise.all([").concat(entity.externalSearch
|
|
126
|
-
? "\n ctx.service('externalSearch').onEntityChange(Entity.".concat((0, cases_1.pascalSingular)(entity.name), ", data.id.toString()),")
|
|
127
|
-
: '', "\n runHooks.afterUpdate(ctx, result as ").concat((0, cases_1.pascalSingular)(entity.name), "),\n ]);\n\n return result as ").concat((0, cases_1.pascalSingular)(entity.name), ";\n };\n\n const upsert = async (\n data: PartialFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, 'id'>,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n // Get db version\n const dbVersion = data.id ? await get(data.id) : null;\n\n // clear from fields forbidden for user\n const cleared = byUser ? R.omit(forbiddenForUserFields, data) : data;\n\n // Augment with default field\n const augmentedByDefault = await augmentByDefault(cleared);\n\n // augment data by fields from db\n const augmented: StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args =\n R.mergeLeft(augmentedByDefault, dbVersion || {} as ").concat((0, cases_1.pascalSingular)(entity.name), ");\n\n const processedData = await runHooks.beforeUpsert(ctx, {createData: augmented, updateData: augmented});\n const createData = {\n ...processedData.createData,\n search: getSearchString(processedData.createData),\n };\n const updateData = {\n ...processedData.updateData,\n search: getSearchString(processedData.updateData),\n };\n\n const result = await ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".upsert({\n create: createData,\n update: updateData,\n where: {id: data.id},\n });\n\n if (!result) {\n throw new Error('There is no such entity');\n }\n").concat(entity.externalSearch
|
|
128
|
-
? "\n await ctx.service('externalSearch').onEntityChange(Entity.".concat((0, cases_1.pascalSingular)(entity.name), ", result.id.toString());\n")
|
|
129
|
-
: '', "\n return result;\n };\n\n const upsertAdvanced = async (\n filter: ").concat((0, cases_1.pascalSingular)(entity.name), "Filter,\n data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n const cnt = await count({filter});\n\n if (cnt > 1) {\n throw new Error(`There is more then one entity (${cnt}) that fits filter \"${JSON.stringify(filter)}\"`);\n } else if (cnt === 0) {\n return create(data, byUser);\n } else {\n const dbVersion = await findOneRequired({filter});\n return update({...data, id: dbVersion.id}, byUser);\n }\n };\n\n const del = async (\n params: MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n await runHooks.beforeDelete(ctx, params);\n\n const deleteOperation = ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".delete({where: {id: params.id}});\n").concat(entity.auditable
|
|
130
|
-
? "\n const auditOperation = ctx.service('auditLogs').addDeleteOperation({\n entityTypeId: Entity.".concat((0, cases_1.pascalSingular)(entity.name), ",\n entityId: params.id,\n });\n")
|
|
131
|
-
: '', "\n const operations = [\n deleteOperation,").concat(entity.auditable
|
|
132
|
-
? "\n auditOperation,"
|
|
133
|
-
: '', "\n ...(await runHooks.additionalOperationsOnDelete(ctx, params)),").concat(entity.type === 'document'
|
|
134
|
-
? "\n ...(await getUnPostOperations(ctx, params.id)),"
|
|
135
|
-
: '', "\n ];\n\n const entity = await get(params.id);\n\n if (!entity) {\n throw new Error(`There is no entity with \"${params.id}\" id`);\n }\n\n const [result] = await ctx.prisma.$transaction(operations as any);\n\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n await runHooks.afterDelete(ctx, entity);\n\n return entity;\n };").concat(entity.type === 'document'
|
|
136
|
-
? "\n\n const rePost = async (\n id: number,\n ): Promise<void> => {\n const data = await get(id);\n\n if (!data) {\n throw new Error(`There is no document with \"${id}\" id`);\n }\n\n await post(data);\n };"
|
|
137
|
-
: ''), "\n\n const baseMethods: Base").concat((0, cases_1.pascalPlural)(entity.name), "Methods = {\n get,\n getRequired,\n all,\n findOne,\n findOneRequired,").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
138
|
-
? "\n sliceOfTheLast,\n sliceOfTheFirst,"
|
|
139
|
-
: '', "\n count,\n meta,\n create,\n createMany,\n update,\n upsert,\n upsertAdvanced,\n delete: del,").concat(entity.type === 'document'
|
|
140
|
-
? "\n\n rePost,\n getRegistryEntries: async (data: ".concat((0, cases_1.pascalSingular)(entity.name), ") => getRegistryEntries(ctx, await augmentByDefault(data)),\n getPostOperations: async (data: ").concat((0, cases_1.pascalSingular)(entity.name), ") => getPostOperations(ctx, await augmentByDefault(data)),\n getUnPostOperations: (id: number) => getUnPostOperations(ctx, id),")
|
|
141
|
-
: '', "\n };\n\n const additionalMethods = getAdditionalMethods(ctx, baseMethods);\n\n const service: ").concat((0, cases_1.pascalPlural)(entity.name), "Service = {\n ...baseMethods,\n ...additionalMethods,\n hooksAdd,\n };\n\n initBuiltInHooks(service);\n initUserHooks(service);\n\n return service;\n};\n");
|
|
142
|
-
};
|
|
143
|
-
exports.prismaServiceTmpl = prismaServiceTmpl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prismaServiceTmpl = void 0;
|
|
4
|
+
/* eslint-disable max-len */
|
|
5
|
+
var fieldTypeToTsType_1 = require("../../../../fieldTypeToTsType");
|
|
6
|
+
var cases_1 = require("../../../../../../utils/cases");
|
|
7
|
+
var utils_1 = require("../../../../../utils");
|
|
8
|
+
var metaUtils_1 = require("../../../../../metaUtils");
|
|
9
|
+
var change_case_1 = require("change-case");
|
|
10
|
+
var autogeneratedStringId = function (entity) {
|
|
11
|
+
return (0, metaUtils_1.getKeyField)(entity).autoGenerated && (0, metaUtils_1.getKeyField)(entity).type === 'string';
|
|
12
|
+
};
|
|
13
|
+
var prismaServiceTmpl = function (_a) {
|
|
14
|
+
var entity = _a.entity, options = _a.options;
|
|
15
|
+
var contextName = 'Context';
|
|
16
|
+
var forbiddenForUserFields = entity.fields.filter(function (f) { return !f.updatableByUser && f.name !== 'search'; });
|
|
17
|
+
var requiredForDbButNotForUserFields = entity.fields.filter(function (f) { return f.required && !f.requiredOnInput && f.name !== 'id'; });
|
|
18
|
+
// const notRequiredOnInputFields: ScalarField[] = entity.fields.filter(f => ['scalar', 'link'].includes(f.category) && !f.requiredOnInput && f.name !== 'search') as ScalarField[];
|
|
19
|
+
// const notRequiredOnInputFields: ScalarField[] = entity.fields.filter(f => f.category === 'scalar' && !f.updatableByUser) as ScalarField[];
|
|
20
|
+
var getDefaultableFields = function () {
|
|
21
|
+
return entity.fields
|
|
22
|
+
.filter(function (f) { return f.defaultBackendValueExpression; })
|
|
23
|
+
.filter(function (f) { return !f.hidden; });
|
|
24
|
+
};
|
|
25
|
+
var getDefaultValues = function () {
|
|
26
|
+
return getDefaultableFields().map(function (f) { return "".concat(f.name, ": ").concat(f.defaultBackendValueExpression); });
|
|
27
|
+
};
|
|
28
|
+
var searchableFields = entity.fields.filter(function (f) { return f.searchable; });
|
|
29
|
+
var dateFields = searchableFields.filter(function (f) {
|
|
30
|
+
return ['date', 'datetime'].includes(f.type);
|
|
31
|
+
});
|
|
32
|
+
var notDateFields = searchableFields.filter(function (f) { return !['date', 'datetime'].includes(f.type); });
|
|
33
|
+
var getDefaultValuesWithSearchJoined = function (initialObjectName) {
|
|
34
|
+
var defaultValues = getDefaultValues();
|
|
35
|
+
if (['catalog', 'document'].includes(entity.type)) {
|
|
36
|
+
defaultValues.push("search: getSearchString(".concat(initialObjectName, ")"));
|
|
37
|
+
}
|
|
38
|
+
return defaultValues.map(utils_1.addComma).join('\n');
|
|
39
|
+
};
|
|
40
|
+
return "import {\n ListMetadata,\n MutationCreate".concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args,\n Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs,\n ").concat((0, cases_1.pascalSingular)(entity.name), ",\n ").concat((0, cases_1.pascalSingular)(entity.name), "Filter,\n} from '../../../generated/graphql';\nimport {toPrismaRequest} from '../../../utils/prisma/toPrismaRequest';\nimport {").concat(contextName, "} from '../types';").concat(entity.type === 'document'
|
|
41
|
+
? "\nimport {Prisma, PrismaPromise} from '@prisma/client';"
|
|
42
|
+
: "\nimport {Prisma} from '@prisma/client';", "\nimport {Additional").concat((0, cases_1.pascalPlural)(entity.name), "Methods, getAdditionalMethods} from './additionalMethods';\nimport initUserHooks from './initUserHooks';\nimport initBuiltInHooks from './initBuiltInHooks';\nimport {getHooksUtils, HooksAddType} from '../getHooksUtils';\nimport * as R from 'ramda';").concat(autogeneratedStringId(entity)
|
|
43
|
+
? "\nimport {v4 as uuidv4} from 'uuid';"
|
|
44
|
+
: '').concat(entity.type === 'document'
|
|
45
|
+
? "\nimport {getUnPostOperations} from './hooks/getUnPostOperations';\nimport {".concat((0, cases_1.pascalSingular)(entity.name), "RegistryEntries, getPostOperations} from './hooks/getPostOperations';\nimport {getRegistryEntries} from './hooks/getRegistryEntries';")
|
|
46
|
+
: '').concat(entity.auditable
|
|
47
|
+
? "\nimport Entity from '../../../types/Entity';"
|
|
48
|
+
: '').concat(entity.externalSearch
|
|
49
|
+
? "\nimport {toElasticRequest} from '../../../utils/toElasticRequest';"
|
|
50
|
+
: "\nimport {toPrismaTotalRequest} from '../../../utils/prisma/toPrismaTotalRequest';", "\nimport {DefinedFieldsInRecord, DefinedRecord, PartialFieldsInRecord} from '../../../types/utils';\nimport getSearchStringCreator from '../utils/getSearchStringCreator';\n").concat(options.skipWarningThisIsGenerated
|
|
51
|
+
? ''
|
|
52
|
+
: "\n// ".concat(utils_1.generatedWarning, "\n"), "\nconst forbiddenForUserFields: string[] = ").concat(forbiddenForUserFields.length > 0
|
|
53
|
+
? "[\n".concat((0, utils_1.pad1)(forbiddenForUserFields.map(function (f) { return "'".concat(f.name, "',"); }).join('\n')), "\n];")
|
|
54
|
+
: '[];', "\n").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
55
|
+
? "\nexport type Slice".concat((0, cases_1.pascalPlural)(entity.name), "Filter = QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args['filter'];\n")
|
|
56
|
+
: '', "\nexport type Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys = ").concat(getDefaultableFields().length > 0
|
|
57
|
+
? "".concat(getDefaultableFields()
|
|
58
|
+
.map(function (f) { return "'".concat(f.name, "'"); })
|
|
59
|
+
.join(' | '))
|
|
60
|
+
: 'never', ";\nexport type ForbidenForUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys = ").concat(forbiddenForUserFields.length > 0
|
|
61
|
+
? "".concat(forbiddenForUserFields.map(function (f) { return "'".concat(f.name, "'"); }).join(' | '))
|
|
62
|
+
: 'never', ";\nexport type RequiredDbNotUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys = ").concat(requiredForDbButNotForUserFields.length > 0
|
|
63
|
+
? "".concat(requiredForDbButNotForUserFields
|
|
64
|
+
.map(function (f) { return "'".concat(f.name, "'"); })
|
|
65
|
+
.join(' | '))
|
|
66
|
+
: 'never', ";\n\nexport type Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part = DefinedRecord<Pick<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>>;\n\nexport type Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput =\n Omit<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, ForbidenForUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys>\n & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\n\nexport type Allowed").concat((0, cases_1.pascalSingular)(entity.name), "ForUserCreateInput = Omit<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, ForbidenForUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\n\nexport type StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args = DefinedFieldsInRecord<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, RequiredDbNotUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys> & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\nexport type StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args = DefinedFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args, RequiredDbNotUser").concat((0, cases_1.pascalSingular)(entity.name), "Keys> & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\n\nexport type StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable = PartialFieldsInRecord<StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\nexport type MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable = PartialFieldsInRecord<MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\nexport type MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable = PartialFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args, Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Keys>;\n\nexport interface Base").concat((0, cases_1.pascalPlural)(entity.name), "Methods {\n get: (id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ") =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;\n getRequired: (id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ") =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n all: (params?: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), "[]>;\n findOne: (params?: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;\n findOneRequired: (params?: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
67
|
+
? "\n sliceOfTheLast: (date?: Date, filter?: Slice".concat((0, cases_1.pascalPlural)(entity.name), "Filter) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;\n sliceOfTheFirst: (date?: Date, filter?: Slice").concat((0, cases_1.pascalPlural)(entity.name), "Filter) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null>;")
|
|
68
|
+
: '', "\n count: (params?: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs) =>\n Promise<number>;\n meta: (params?: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs) =>\n Promise<ListMetadata>;\n create: (data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, byUser?: boolean) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n createMany: (data: StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable[], byUser?: boolean) =>\n Promise<Prisma.BatchPayload>;\n update: ({id, ...rest}: MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, byUser?: boolean) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n upsert: (\n data: PartialFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, 'id'>,\n byUser?: boolean,\n ) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n upsertAdvanced: (\n filter: ").concat((0, cases_1.pascalSingular)(entity.name), "Filter,\n data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser?: boolean,\n ) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;\n delete: (params: MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args) =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), ">;").concat(entity.type === 'document'
|
|
69
|
+
? "\n\n rePost: (id: number) =>\n Promise<void>;\n getRegistryEntries: (data: ".concat((0, cases_1.pascalSingular)(entity.name), ") =>\n Promise<").concat((0, cases_1.pascalSingular)(entity.name), "RegistryEntries>;\n getPostOperations: (data: ").concat((0, cases_1.pascalSingular)(entity.name), ") =>\n Promise<PrismaPromise<any>[]>;\n getUnPostOperations: (id: number) =>\n Promise<PrismaPromise<any>[]>;")
|
|
70
|
+
: '', "\n}\n\nexport type ").concat((0, cases_1.pascalPlural)(entity.name), "Service = Base").concat((0, cases_1.pascalPlural)(entity.name), "Methods\n & Additional").concat((0, cases_1.pascalPlural)(entity.name), "Methods\n & HooksAddType<\n ").concat((0, cases_1.pascalSingular)(entity.name), ",\n QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args,\n Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput,\n MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args\n >;\n\nconst dateFieldsForSearch: string[] = ").concat(dateFields.length
|
|
71
|
+
? "[\n".concat(dateFields
|
|
72
|
+
.map(function (f) { return "'".concat(f.name, "',"); })
|
|
73
|
+
.map(utils_1.pad1)
|
|
74
|
+
.join('\n'), "\n];")
|
|
75
|
+
: '[];', "\n\nconst otherFieldsForSearch: string[] = ").concat(notDateFields.length
|
|
76
|
+
? "[\n".concat(notDateFields
|
|
77
|
+
.map(function (f) { return "'".concat(f.name, "',"); })
|
|
78
|
+
.map(utils_1.pad1)
|
|
79
|
+
.join('\n'), "\n];")
|
|
80
|
+
: '[];', "\n\nexport const get").concat((0, cases_1.pascalPlural)(entity.name), "Service = (ctx: ").concat(contextName, ") => {\n const {hooksAdd, runHooks} = getHooksUtils<\n ").concat((0, cases_1.pascalSingular)(entity.name), ",\n QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args,\n Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput,\n MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args\n >();\n\n const getSearchString = getSearchStringCreator(dateFieldsForSearch, otherFieldsForSearch);\n\n const augmentByDefault = async <T>(\n currentData: Record<string, any>,\n ): Promise<T & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part> => ").concat(getDefaultableFields().length
|
|
81
|
+
? "{\n const defaultFieldConstructors = {\n".concat((0, utils_1.pad3)(getDefaultableFields()
|
|
82
|
+
.map(function (f) { return "".concat(f.name, ": async () => ").concat(f.defaultBackendValueExpression); })
|
|
83
|
+
.map(utils_1.addComma)
|
|
84
|
+
.join('\n')), "\n };\n\n const pairedConstructors = R.toPairs(defaultFieldConstructors);\n\n const resultedPairs: R.KeyValuePair<string, any>[] = [];\n for (const [key, constructor] of pairedConstructors) {\n resultedPairs.push([key, key in currentData && currentData[key] ? currentData[key] : await constructor()]);\n }\n\n return R.mergeLeft(currentData, R.fromPairs(resultedPairs)) as T & Autodefinable").concat((0, cases_1.pascalSingular)(entity.name), "Part;\n }")
|
|
85
|
+
: "currentData as T & Autodefinable".concat((0, cases_1.pascalSingular)(entity.name), "Part"), ";\n\n const all = async (\n params: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args = {},\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "[]> => {").concat(entity.externalSearch
|
|
86
|
+
? "\n const elasticSearch = ctx.elastic.createSearcher('".concat((0, change_case_1.pathCase)(entity.name), "');\n\n const search = await elasticSearch(toElasticRequest(await runHooks.changeListFilter(ctx, params)));\n\n const ids = search.hits.hits.map(el => BigInt((el._source as ").concat((0, cases_1.pascalSingular)(entity.name), ").id));\n const prismaReq = toPrismaRequest(params, {noId: false});\n\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findMany(\n {\n where: {id: {in: ids}},\n orderBy: prismaReq.orderBy,\n },")
|
|
87
|
+
: "\n return ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".findMany(\n toPrismaRequest(await runHooks.changeListFilter(ctx, params), {noId: false}),"), "\n ) as unknown as Promise<").concat((0, cases_1.pascalSingular)(entity.name), "[]>;\n };\n\n const findOne = async (\n params: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args = {},\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findFirst(toPrismaRequest(\n await runHooks.changeListFilter(ctx, params),\n {noId: false},\n ));\n };\n\n const findOneRequired = async (\n params: QueryAll").concat((0, cases_1.pascalPlural)(entity.name), "Args = {},\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n const found = await findOne(params);\n\n if (!found) {\n throw new Error(`There is no entry with \"${JSON.stringify(params)}\" filter`);\n }\n\n return found;\n };\n\n const get = async (\n id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ",\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return findOne({filter: {id}});\n };\n\n const getRequired = async (\n id: ").concat((0, fieldTypeToTsType_1.fieldTypeToTsType)((0, metaUtils_1.getKeyField)(entity).type), ",\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n const found = await get(id);\n\n if (!found) {\n throw new Error(`There is no entry with \"${id}\" id`);\n }\n\n return found;\n };\n").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
88
|
+
? "\n const sliceOfTheLast = async (\n date?: Date,\n filter?: Slice".concat((0, cases_1.pascalPlural)(entity.name), "Filter,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findFirst(toPrismaRequest({\n sortField: 'date',\n sortOrder: 'desc',\n filter: {\n ...filter,\n date_lte: date ?? new Date(),\n },\n }, {noId: false}));\n };\n\n const sliceOfTheFirst = async (\n date?: Date,\n filter?: Slice").concat((0, cases_1.pascalPlural)(entity.name), "Filter,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), " | null> => {\n return ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".findFirst(toPrismaRequest({\n sortField: 'date',\n sortOrder: 'asc',\n filter: {\n ...filter,\n date_gte: date ?? new Date(),\n },\n }, {noId: false}));\n };\n")
|
|
89
|
+
: '', "\n const count = async (\n params: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs = {},\n ): Promise<number> => {").concat(entity.externalSearch
|
|
90
|
+
? "\n const elasticCount = ctx.elastic.createCounter('".concat((0, change_case_1.pathCase)(entity.name), "');\n\n const reg = R.omit(['sortOrder', 'sortField'], toElasticRequest(await runHooks.changeListFilter(ctx, params)));\n\n const result = await elasticCount(reg);\n\n return result.count;\n };")
|
|
91
|
+
: "\n return ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".count(toPrismaTotalRequest(await runHooks.changeListFilter(ctx, params)));\n };"), "\n\n const meta = async (\n params: Query_All").concat((0, cases_1.pascalPlural)(entity.name), "MetaArgs = {},\n ): Promise<ListMetadata> => {\n return count(params).then(count => ({count}));\n };").concat(options.readOnly
|
|
92
|
+
? ''
|
|
93
|
+
: "".concat(entity.type === 'document'
|
|
94
|
+
? "\n\n const post = async (\n data: ".concat((0, cases_1.pascalSingular)(entity.name), ",\n ): Promise<void> => {\n await ctx.prisma.$transaction(await getPostOperations(ctx, await augmentByDefault(data)));\n };")
|
|
95
|
+
: '', "\n\n const create = async (\n data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n // clear from fields forbidden for user\n const cleared = byUser ?\n R.omit(forbiddenForUserFields, data) as Allowed").concat((0, cases_1.pascalSingular)(entity.name), "ForUserCreateInput :\n data;\n\n // Augment with default field\n const augmentedByDefault: Reliable").concat((0, cases_1.pascalSingular)(entity.name), "CreateUserInput = await augmentByDefault(cleared);\n\n const processedData = await runHooks.beforeCreate(ctx, augmentedByDefault);\n").concat(autogeneratedStringId(entity)
|
|
96
|
+
? "\n const createOperation = ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".create({\n data: {\n id: uuidv4(),\n ...R.mergeDeepLeft(\n processedData,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
97
|
+
? "{\n search: getSearchString(processedData),\n }"
|
|
98
|
+
: '{}', "\n ),\n },\n });")
|
|
99
|
+
: "\n const createOperation = ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".create({\n data: R.mergeDeepLeft(\n processedData,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
100
|
+
? "{\n search: getSearchString(processedData),\n }"
|
|
101
|
+
: '{}', ",\n ),\n });"), "\n\n const operations = [\n createOperation,\n ...(await runHooks.additionalOperationsOnCreate(ctx, processedData)),\n ];\n\n const [result] = await ctx.prisma.$transaction(operations as any);\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n await Promise.all([").concat(getDefaultValuesWithSearchJoined('processedData')
|
|
102
|
+
? "\n // update search. earlier we does not have id\n ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".update({\n where: {id: result.id},\n data: ").concat(['catalog', 'document'].includes(entity.type)
|
|
103
|
+
? "{\n search: getSearchString(result),\n }"
|
|
104
|
+
: '{}', ",\n }),")
|
|
105
|
+
: '').concat(entity.auditable
|
|
106
|
+
? "\n ctx.service('auditLogs').addCreateOperation({\n entityTypeId: Entity.".concat((0, cases_1.pascalSingular)(entity.name), ",\n entityId: result.id,\n actionData: data,\n }),")
|
|
107
|
+
: '').concat(entity.externalSearch
|
|
108
|
+
? "\n ctx.service('externalSearch').onEntityChange(Entity.".concat((0, cases_1.pascalSingular)(entity.name), ", result.id.toString()),")
|
|
109
|
+
: '').concat(entity.type === 'document'
|
|
110
|
+
? "\n await ctx.prisma.$transaction(await getPostOperations(ctx, result)),"
|
|
111
|
+
: '', "\n ]);\n\n await runHooks.afterCreate(ctx, result as ").concat((0, cases_1.pascalSingular)(entity.name), ");\n\n return result as ").concat((0, cases_1.pascalSingular)(entity.name), ";\n };\n\n const createMany = async (\n entries: StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable[],\n byUser = false,\n ): Promise<Prisma.BatchPayload> => {\n // clear from fields forbidden for user\n const clearedData = byUser ? entries.map(data => R.omit(forbiddenForUserFields, data)) : entries;\n\n // Augment with default field\n const augmentedByDefault = await Promise.all(\n clearedData.map(el => augmentByDefault(el)),\n ) as StrictCreate").concat((0, cases_1.pascalSingular)(entity.name), "Args[];\n").concat(autogeneratedStringId(entity)
|
|
112
|
+
? "\n const result = await ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".createMany({data: augmentedByDefault.map(data => ({\n id: uuidv4(),\n ...R.mergeDeepLeft(\n data,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
113
|
+
? "{\n search: getSearchString(data),\n }"
|
|
114
|
+
: '{}', ",\n ),\n })), skipDuplicates: true});")
|
|
115
|
+
: "\n const result = await ctx.prisma.".concat((0, cases_1.camelSingular)(entity.name), ".createMany({\n data: augmentedByDefault.map(data => R.mergeDeepLeft(\n data,\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
116
|
+
? "{\n search: getSearchString(data),\n }"
|
|
117
|
+
: '{}', ",\n )),\n skipDuplicates: true,\n });"), "\n\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n return result;\n };\n\n const update = async (\n data: MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n // Get db version\n const dbVersion = await getRequired(data.id);\n\n // clear from fields forbidden for user\n const cleared = byUser ? R.omit(forbiddenForUserFields, data) : data;\n\n // Augment with default field\n const augmentedByDefault = await augmentByDefault(cleared);\n\n // augment data by fields from db\n const augmented: StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args = R.mergeLeft(augmentedByDefault, dbVersion);\n\n const processedData = await runHooks.beforeUpdate(ctx, augmented);\n\n const {id, ...rest} = processedData;\n\n const updateOperation = ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".update({\n data: R.mergeDeepLeft(\n ").concat(['catalog', 'document'].includes(entity.type)
|
|
118
|
+
? "{\n search: getSearchString(processedData),\n }"
|
|
119
|
+
: '{}', ",\n rest,\n ),\n where: {id},\n });\n").concat(entity.auditable
|
|
120
|
+
? "\n const auditOperation = ctx.service('auditLogs').addUpdateOperation({\n entityTypeId: Entity.".concat((0, cases_1.pascalSingular)(entity.name), ",\n entityId: data.id,\n actionData: data,\n });\n")
|
|
121
|
+
: '', "\n const operations = [\n updateOperation,").concat(entity.auditable
|
|
122
|
+
? "\n auditOperation,"
|
|
123
|
+
: '', "\n ...(await runHooks.additionalOperationsOnUpdate(ctx, processedData)),").concat(entity.type === 'document'
|
|
124
|
+
? "\n ...(await getPostOperations(ctx, processedData)),"
|
|
125
|
+
: '', "\n ];\n\n const [result] = await ctx.prisma.$transaction(operations as any);\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n await Promise.all([").concat(entity.externalSearch
|
|
126
|
+
? "\n ctx.service('externalSearch').onEntityChange(Entity.".concat((0, cases_1.pascalSingular)(entity.name), ", data.id.toString()),")
|
|
127
|
+
: '', "\n runHooks.afterUpdate(ctx, result as ").concat((0, cases_1.pascalSingular)(entity.name), "),\n ]);\n\n return result as ").concat((0, cases_1.pascalSingular)(entity.name), ";\n };\n\n const upsert = async (\n data: PartialFieldsInRecord<MutationUpdate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable, 'id'>,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n // Get db version\n const dbVersion = data.id ? await get(data.id) : null;\n\n // clear from fields forbidden for user\n const cleared = byUser ? R.omit(forbiddenForUserFields, data) : data;\n\n // Augment with default field\n const augmentedByDefault = await augmentByDefault(cleared);\n\n // augment data by fields from db\n const augmented: StrictUpdate").concat((0, cases_1.pascalSingular)(entity.name), "Args =\n R.mergeLeft(augmentedByDefault, dbVersion || {} as ").concat((0, cases_1.pascalSingular)(entity.name), ");\n\n const processedData = await runHooks.beforeUpsert(ctx, {createData: augmented, updateData: augmented});\n const createData = {\n ...processedData.createData,\n search: getSearchString(processedData.createData),\n };\n const updateData = {\n ...processedData.updateData,\n search: getSearchString(processedData.updateData),\n };\n\n const result = await ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".upsert({\n create: createData,\n update: updateData,\n where: {id: data.id},\n });\n\n if (!result) {\n throw new Error('There is no such entity');\n }\n").concat(entity.externalSearch
|
|
128
|
+
? "\n await ctx.service('externalSearch').onEntityChange(Entity.".concat((0, cases_1.pascalSingular)(entity.name), ", result.id.toString());\n")
|
|
129
|
+
: '', "\n return result;\n };\n\n const upsertAdvanced = async (\n filter: ").concat((0, cases_1.pascalSingular)(entity.name), "Filter,\n data: MutationCreate").concat((0, cases_1.pascalSingular)(entity.name), "ArgsWithoutAutodefinable,\n byUser = false,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n const cnt = await count({filter});\n\n if (cnt > 1) {\n throw new Error(`There is more then one entity (${cnt}) that fits filter \"${JSON.stringify(filter)}\"`);\n } else if (cnt === 0) {\n return create(data, byUser);\n } else {\n const dbVersion = await findOneRequired({filter});\n return update({...data, id: dbVersion.id}, byUser);\n }\n };\n\n const del = async (\n params: MutationRemove").concat((0, cases_1.pascalSingular)(entity.name), "Args,\n ): Promise<").concat((0, cases_1.pascalSingular)(entity.name), "> => {\n await runHooks.beforeDelete(ctx, params);\n\n const deleteOperation = ctx.prisma.").concat((0, cases_1.camelSingular)(entity.name), ".delete({where: {id: params.id}});\n").concat(entity.auditable
|
|
130
|
+
? "\n const auditOperation = ctx.service('auditLogs').addDeleteOperation({\n entityTypeId: Entity.".concat((0, cases_1.pascalSingular)(entity.name), ",\n entityId: params.id,\n });\n")
|
|
131
|
+
: '', "\n const operations = [\n deleteOperation,").concat(entity.auditable
|
|
132
|
+
? "\n auditOperation,"
|
|
133
|
+
: '', "\n ...(await runHooks.additionalOperationsOnDelete(ctx, params)),").concat(entity.type === 'document'
|
|
134
|
+
? "\n ...(await getUnPostOperations(ctx, params.id)),"
|
|
135
|
+
: '', "\n ];\n\n const entity = await get(params.id);\n\n if (!entity) {\n throw new Error(`There is no entity with \"${params.id}\" id`);\n }\n\n const [result] = await ctx.prisma.$transaction(operations as any);\n\n if (!result) {\n throw new Error('There is no such entity');\n }\n\n await runHooks.afterDelete(ctx, entity);\n\n return entity;\n };").concat(entity.type === 'document'
|
|
136
|
+
? "\n\n const rePost = async (\n id: number,\n ): Promise<void> => {\n const data = await get(id);\n\n if (!data) {\n throw new Error(`There is no document with \"${id}\" id`);\n }\n\n await post(data);\n };"
|
|
137
|
+
: ''), "\n\n const baseMethods: Base").concat((0, cases_1.pascalPlural)(entity.name), "Methods = {\n get,\n getRequired,\n all,\n findOne,\n findOneRequired,").concat(entity.type === 'infoRegistry' && entity.period !== 'notPeriodic'
|
|
138
|
+
? "\n sliceOfTheLast,\n sliceOfTheFirst,"
|
|
139
|
+
: '', "\n count,\n meta,\n create,\n createMany,\n update,\n upsert,\n upsertAdvanced,\n delete: del,").concat(entity.type === 'document'
|
|
140
|
+
? "\n\n rePost,\n getRegistryEntries: async (data: ".concat((0, cases_1.pascalSingular)(entity.name), ") => getRegistryEntries(ctx, await augmentByDefault(data)),\n getPostOperations: async (data: ").concat((0, cases_1.pascalSingular)(entity.name), ") => getPostOperations(ctx, await augmentByDefault(data)),\n getUnPostOperations: (id: number) => getUnPostOperations(ctx, id),")
|
|
141
|
+
: '', "\n };\n\n const additionalMethods = getAdditionalMethods(ctx, baseMethods);\n\n const service: ").concat((0, cases_1.pascalPlural)(entity.name), "Service = {\n ...baseMethods,\n ...additionalMethods,\n hooksAdd,\n };\n\n initBuiltInHooks(service);\n initUserHooks(service);\n\n return service;\n};\n");
|
|
142
|
+
};
|
|
143
|
+
exports.prismaServiceTmpl = prismaServiceTmpl;
|
|
144
144
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9wcm9qZWN0c0dlbmVyYXRpb24vZ2VuZXJhdG9ycy9maWxlVGVtcGxhdGVzL2JhY2svc2VydmljZXMvZW50aXR5L3NlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNEJBQTRCO0FBQzVCLG1FQUFpRTtBQUNqRSx1REFJc0M7QUFHdEMsOENBQTZFO0FBQzdFLHNEQUFzRDtBQUN0RCwyQ0FBc0M7QUFFdEMsSUFBTSxxQkFBcUIsR0FBRyxVQUFDLE1BQWM7SUFDM0MsT0FB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xDQUFDLEVBQUUsbUZBR04sTUFBTSxDQUFDLElBQUksS0FBSyxVQUFVO1lBQ3hCLENBQUMsQ0FBQyx5REFDMEM7WUFDNUMsQ0FBQyxDQUFDLEVBQUUsMllBb0JWLE1BQU0sQ0FBQyxJQUFJLEtBQUssVUFBVTtZQUN4QixDQUFDLENBQUMscU9BWUg7WUFDQyxDQUFDLENBQUMsRUFBRSxDQUNOLDBDQUd1QixJQUFBLG9CQUFZLEVBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxrR0FNOUMsTUFBTSxDQUFDLElBQUksS0FBSyxjQUFjLElBQUksTUFBTSxDQUFDLE1BQU0sS0FBSyxhQUFhO1FBQy9ELENBQUMsQ0FBQyw2Q0FFVztRQUNiLENBQUMsQ0FBQyxFQUFFLG1JQVVOLE1BQU0sQ0FBQyxJQUFJLEtBQUssVUFBVTtRQUN4QixDQUFDLENBQUMsZ0VBRzZCLElBQUEsc0JBQWMsRUFDL0MsTUFBTSxDQUFDLElBQUksQ0FDWiw4R0FDaUMsSUFBQSxzQkFBYyxFQUM5QyxNQUFNLENBQUMsSUFBSSxDQUNaLHVJQUNrRTtRQUMvRCxDQUFDLENBQUMsRUFBRSwrR0FNTyxJQUFBLG9CQUFZLEVBQUMsTUFBTSxDQUFDLElBQUksQ0FBQywyS0FXM0MsQ0FBQTtBQUNELENBQUMsQ0FBQTtBQTUzQlksUUFBQSxpQkFBaUIscUJBNDNCN0IifQ==
|
package/build/projectsGeneration/generators/fileTemplates/back/services/serviceConstrictors.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* eslint-disable max-len */
|
|
4
|
-
var cases_1 = require("../../../../../utils/cases");
|
|
5
|
-
var utils_1 = require("../../../../utils");
|
|
6
|
-
var graphServiceConstrictorsTmpl = function (_a) {
|
|
7
|
-
var entities = _a.entities, options = _a.options;
|
|
8
|
-
return "".concat(entities.map(function (m) {
|
|
9
|
-
return "import {get".concat((0, cases_1.pascal)(m.name), "Service} from './").concat((0, cases_1.pascal)(m.name), "Service/").concat((0, cases_1.pascal)(m.name), "Service';");
|
|
10
|
-
}).join("\n"), "\nimport {getHelpService} from './HelpService/HelpService';\nimport {ServiceConstrictors, BaseServiceConstrictors} from './types';\nimport additionalServiceConstrictors from './additionalServiceConstrictors';\n").concat(options.skipWarningThisIsGenerated
|
|
11
|
-
? ''
|
|
12
|
-
: "\n// ".concat(utils_1.generatedWarning, "\n"), "\nexport const baseServiceConstrictors: BaseServiceConstrictors = {\n help: getHelpService,\n ").concat(entities.map(function (m) { return "".concat(m.name, ": get").concat((0, cases_1.pascal)(m.name), "Service,"); }).join("\n "), "\n};\n\nconst serviceConstrictors: ServiceConstrictors = {\n ...baseServiceConstrictors,\n ...additionalServiceConstrictors,\n};\n\nexport default serviceConstrictors;\n");
|
|
13
|
-
};
|
|
14
|
-
exports.default = graphServiceConstrictorsTmpl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable max-len */
|
|
4
|
+
var cases_1 = require("../../../../../utils/cases");
|
|
5
|
+
var utils_1 = require("../../../../utils");
|
|
6
|
+
var graphServiceConstrictorsTmpl = function (_a) {
|
|
7
|
+
var entities = _a.entities, options = _a.options;
|
|
8
|
+
return "".concat(entities.map(function (m) {
|
|
9
|
+
return "import {get".concat((0, cases_1.pascal)(m.name), "Service} from './").concat((0, cases_1.pascal)(m.name), "Service/").concat((0, cases_1.pascal)(m.name), "Service';");
|
|
10
|
+
}).join("\n"), "\nimport {getHelpService} from './HelpService/HelpService';\nimport {ServiceConstrictors, BaseServiceConstrictors} from './types';\nimport additionalServiceConstrictors from './additionalServiceConstrictors';\n").concat(options.skipWarningThisIsGenerated
|
|
11
|
+
? ''
|
|
12
|
+
: "\n// ".concat(utils_1.generatedWarning, "\n"), "\nexport const baseServiceConstrictors: BaseServiceConstrictors = {\n help: getHelpService,\n ").concat(entities.map(function (m) { return "".concat(m.name, ": get").concat((0, cases_1.pascal)(m.name), "Service,"); }).join("\n "), "\n};\n\nconst serviceConstrictors: ServiceConstrictors = {\n ...baseServiceConstrictors,\n ...additionalServiceConstrictors,\n};\n\nexport default serviceConstrictors;\n");
|
|
13
|
+
};
|
|
14
|
+
exports.default = graphServiceConstrictorsTmpl;
|
|
15
15
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZUNvbnN0cmljdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9wcm9qZWN0c0dlbmVyYXRpb24vZ2VuZXJhdG9ycy9maWxlVGVtcGxhdGVzL2JhY2svc2VydmljZXMvc2VydmljZUNvbnN0cmljdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDRCQUE0QjtBQUM1QixvREFBbUQ7QUFFbkQsMkNBQW9EO0FBRXBELElBQU0sNEJBQTRCLEdBQUcsVUFBQyxFQUdWO1FBRjFCLFFBQVEsY0FBQSxFQUNSLE9BQU8sYUFBQTtJQUN3QixPQUFBLFVBQUcsUUFBUSxDQUFDLEdBQUcsQ0FDOUMsVUFBQyxDQUFDO1FBQ0EsT0FBQSxxQkFBYyxJQUFBLGNBQU0sRUFBQyxDQUFDLENBQUMsSUFBSSxDQUFDLDhCQUFvQixJQUFBLGNBQU0sRUFDcEQsQ0FBQyxDQUFDLElBQUksQ0FDUCxxQkFBVyxJQUFBLGNBQU0sRUFBQyxDQUFDLENBQUMsSUFBSSxDQUFDLGNBQVc7SUFGckMsQ0FFcUMsQ0FDeEMsQ0FBQyxJQUFJLENBQUMsSUFDTixDQUFDLCtOQUtBLE9BQU8sQ0FBQywwQkFBMEI7UUFDaEMsQ0FBQyxDQUFDLEVBQUU7UUFDSixDQUFDLENBQUMsZUFDRCx3QkFBZ0IsT0FDcEIsNkdBSUcsUUFBUSxDQUFDLEdBQUcsQ0FBQyxVQUFDLENBQUMsSUFBSyxPQUFBLFVBQUcsQ0FBQyxDQUFDLElBQUksa0JBQVEsSUFBQSxjQUFNLEVBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxhQUFVLEVBQXpDLENBQXlDLENBQUMsQ0FBQyxJQUFJLENBQUMsTUFDckUsQ0FBQyxnTEFTSDtBQTdCZ0MsQ0E2QmhDLENBQUE7QUFFRCxrQkFBZSw0QkFBNEIsQ0FBQSJ9
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var uiDashboardTmpl = function () { return "import React, {\n FC,\n} from 'react';\nimport ResourcesPage from './ResourcesPage';\n\nconst Dashboard: FC = () => {\n return (\n <ResourcesPage />\n );\n};\n\nexport default Dashboard;\n"; };
|
|
4
|
-
exports.default = uiDashboardTmpl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var uiDashboardTmpl = function () { return "import React, {\n FC,\n} from 'react';\nimport ResourcesPage from './ResourcesPage';\n\nconst Dashboard: FC = () => {\n return (\n <ResourcesPage />\n );\n};\n\nexport default Dashboard;\n"; };
|
|
4
|
+
exports.default = uiDashboardTmpl;
|
|
5
5
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGFzaGJvYXJkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL3Byb2plY3RzR2VuZXJhdGlvbi9nZW5lcmF0b3JzL2ZpbGVUZW1wbGF0ZXMvdWkvRGFzaGJvYXJkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBTSxlQUFlLEdBQUcsY0FBTSxPQUFBLG9NQVk3QixFQVo2QixDQVk3QixDQUFBO0FBRUQsa0JBQWUsZUFBZSxDQUFBIn0=
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uiMetaPageTmpl = void 0;
|
|
4
|
-
var uiMetaPageTmpl = function () {
|
|
5
|
-
return "import React, {FC} from 'react';\nimport {\n gql,\n useQuery,\n} from '@apollo/client';\nimport {makeStyles, createStyles} from '@mui/styles';\n\nconst useStyles = makeStyles(() => createStyles({\n section: {\n margin: '10px auto',\n },\n catalog: {\n margin: '20px 10px',\n },\n field: {\n margin: '20px 10px',\n },\n}));\n\nconst META_REQUEST = gql`\n query {\n Meta\n }\n`;\n\nconst MetaPage: FC = () => {\n const classes = useStyles();\n const {data: result} = useQuery(META_REQUEST);\n\n return (\n <>\n {result && <div>\n <div className={classes.section}>\n name: {result.Meta.name}\n </div>\n <div className={classes.section}>\n prefix: {result.Meta.prefix}\n </div>\n <div className={classes.section}>\n needFor: {result.Meta.needFor}\n </div>\n <div className={classes.section}>\n deployEnvironments: {result.Meta.deployEnvironments.join(',')}\n </div>\n <div className={classes.section}>\n configVars: {result.Meta.configVars.join(',')}\n </div>\n <div className={classes.section}>\n Catalogs:\n </div>\n <div className={classes.section}>\n {result.Meta.catalogs.map(\n (catalog: any, index: number) => <Catalog catalog={catalog} key={index} />,\n )}\n </div>\n </div>}\n </>\n );\n};\n\nconst Catalog: FC<{catalog: any}> = ({catalog}) => {\n const classes = useStyles();\n\n return (\n <div className={classes.catalog}>\n <div className={classes.section}>\n name: {catalog.name}\n </div>\n <div className={classes.section}>\n needFor: {catalog.needFor}\n </div>\n <div className={classes.section}>\n Fields:\n </div>\n <div className={classes.section}>\n {catalog.fields.map(\n (field: any, index: number) => <Field field={field} key={index} />,\n )}\n </div>\n </div>\n );\n};\n\nconst Field: FC<{field: any}> = ({field}) => {\n const classes = useStyles();\n\n return (\n <div className={classes.field}>\n <div className={classes.section}>\n name: {field.name}\n </div>\n <div className={classes.section}>\n type: {field.type}\n </div>\n <div className={classes.section}>\n required: {field.required?.toString()}\n </div>\n <div className={classes.section}>\n needFor: {field.needFor}\n </div>\n <div className={classes.section}>\n requiredOnInput: {field.requiredOnInput?.toString()}\n </div>\n <div className={classes.section}>\n updatable: {field.updatable?.toString()}\n </div>\n <div className={classes.section}>\n autoGenerated: {field.autoGenerated?.toString()}\n </div>\n <div className={classes.section}>\n category: {field.category}\n </div>\n </div>\n );\n};\n\nexport default MetaPage;\n";
|
|
6
|
-
};
|
|
7
|
-
exports.uiMetaPageTmpl = uiMetaPageTmpl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiMetaPageTmpl = void 0;
|
|
4
|
+
var uiMetaPageTmpl = function () {
|
|
5
|
+
return "import React, {FC} from 'react';\nimport {\n gql,\n useQuery,\n} from '@apollo/client';\nimport {makeStyles, createStyles} from '@mui/styles';\n\nconst useStyles = makeStyles(() => createStyles({\n section: {\n margin: '10px auto',\n },\n catalog: {\n margin: '20px 10px',\n },\n field: {\n margin: '20px 10px',\n },\n}));\n\nconst META_REQUEST = gql`\n query {\n Meta\n }\n`;\n\nconst MetaPage: FC = () => {\n const classes = useStyles();\n const {data: result} = useQuery(META_REQUEST);\n\n return (\n <>\n {result && <div>\n <div className={classes.section}>\n name: {result.Meta.name}\n </div>\n <div className={classes.section}>\n prefix: {result.Meta.prefix}\n </div>\n <div className={classes.section}>\n needFor: {result.Meta.needFor}\n </div>\n <div className={classes.section}>\n deployEnvironments: {result.Meta.deployEnvironments.join(',')}\n </div>\n <div className={classes.section}>\n configVars: {result.Meta.configVars.join(',')}\n </div>\n <div className={classes.section}>\n Catalogs:\n </div>\n <div className={classes.section}>\n {result.Meta.catalogs.map(\n (catalog: any, index: number) => <Catalog catalog={catalog} key={index} />,\n )}\n </div>\n </div>}\n </>\n );\n};\n\nconst Catalog: FC<{catalog: any}> = ({catalog}) => {\n const classes = useStyles();\n\n return (\n <div className={classes.catalog}>\n <div className={classes.section}>\n name: {catalog.name}\n </div>\n <div className={classes.section}>\n needFor: {catalog.needFor}\n </div>\n <div className={classes.section}>\n Fields:\n </div>\n <div className={classes.section}>\n {catalog.fields.map(\n (field: any, index: number) => <Field field={field} key={index} />,\n )}\n </div>\n </div>\n );\n};\n\nconst Field: FC<{field: any}> = ({field}) => {\n const classes = useStyles();\n\n return (\n <div className={classes.field}>\n <div className={classes.section}>\n name: {field.name}\n </div>\n <div className={classes.section}>\n type: {field.type}\n </div>\n <div className={classes.section}>\n required: {field.required?.toString()}\n </div>\n <div className={classes.section}>\n needFor: {field.needFor}\n </div>\n <div className={classes.section}>\n requiredOnInput: {field.requiredOnInput?.toString()}\n </div>\n <div className={classes.section}>\n updatable: {field.updatable?.toString()}\n </div>\n <div className={classes.section}>\n autoGenerated: {field.autoGenerated?.toString()}\n </div>\n <div className={classes.section}>\n category: {field.category}\n </div>\n </div>\n );\n};\n\nexport default MetaPage;\n";
|
|
6
|
+
};
|
|
7
|
+
exports.uiMetaPageTmpl = uiMetaPageTmpl;
|
|
8
8
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWV0YVBhZ2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvcHJvamVjdHNHZW5lcmF0aW9uL2dlbmVyYXRvcnMvZmlsZVRlbXBsYXRlcy91aS9NZXRhUGFnZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBTyxJQUFNLGNBQWMsR0FBRztJQUM1QixPQUFPLCs1RkFxSFIsQ0FBQTtBQUNELENBQUMsQ0FBQTtBQXZIWSxRQUFBLGNBQWMsa0JBdUgxQiJ9
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uiResourcesPageTmpl = void 0;
|
|
4
|
-
var types_1 = require("../../../types");
|
|
5
|
-
var cases_1 = require("../../../../utils/cases");
|
|
6
|
-
var utils_1 = require("../../../utils");
|
|
7
|
-
var pluralize_1 = require("pluralize");
|
|
8
|
-
var uiResourcesPageTmpl = function (_a) {
|
|
9
|
-
var entities = _a.entities, _b = _a.options, options = _b === void 0 ? types_1.defaultBootstrapEntityOptions : _b;
|
|
10
|
-
return "import React, {\n FC,\n} from 'react';\nimport NumberWiget from '../widgets/NumberWiget';\nimport {\n gql,\n} from '@apollo/client';\nimport {useTranslate} from 'react-admin';\nimport Grid from '@mui/material/Grid';\n".concat(options.skipWarningThisIsGenerated
|
|
11
|
-
? ''
|
|
12
|
-
: "\n// ".concat(utils_1.generatedWarning, "\n"), "\nconst ResourcesPage: FC = () => {\n const translate = useTranslate();\n\n return (\n <Grid container>\n").concat(entities.map(function (entity) {
|
|
13
|
-
return " <NumberWiget\n request={gql`\n query {\n _all".concat((0, cases_1.pascalPlural)(entity.name), "Meta {\n count\n }\n }\n `}\n resultToValue={result => result?._all").concat((0, cases_1.pascalPlural)(entity.name), "Meta?.count}\n title={translate('").concat((0, pluralize_1.plural)(entity.type), ".").concat(entity.name, ".title')}\n to='/").concat(entity.name, "'\n />");
|
|
14
|
-
}).join("\n"), "\n </Grid>\n );\n};\n\nexport default ResourcesPage;\n");
|
|
15
|
-
};
|
|
16
|
-
exports.uiResourcesPageTmpl = uiResourcesPageTmpl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiResourcesPageTmpl = void 0;
|
|
4
|
+
var types_1 = require("../../../types");
|
|
5
|
+
var cases_1 = require("../../../../utils/cases");
|
|
6
|
+
var utils_1 = require("../../../utils");
|
|
7
|
+
var pluralize_1 = require("pluralize");
|
|
8
|
+
var uiResourcesPageTmpl = function (_a) {
|
|
9
|
+
var entities = _a.entities, _b = _a.options, options = _b === void 0 ? types_1.defaultBootstrapEntityOptions : _b;
|
|
10
|
+
return "import React, {\n FC,\n} from 'react';\nimport NumberWiget from '../widgets/NumberWiget';\nimport {\n gql,\n} from '@apollo/client';\nimport {useTranslate} from 'react-admin';\nimport Grid from '@mui/material/Grid';\n".concat(options.skipWarningThisIsGenerated
|
|
11
|
+
? ''
|
|
12
|
+
: "\n// ".concat(utils_1.generatedWarning, "\n"), "\nconst ResourcesPage: FC = () => {\n const translate = useTranslate();\n\n return (\n <Grid container>\n").concat(entities.map(function (entity) {
|
|
13
|
+
return " <NumberWiget\n request={gql`\n query {\n _all".concat((0, cases_1.pascalPlural)(entity.name), "Meta {\n count\n }\n }\n `}\n resultToValue={result => result?._all").concat((0, cases_1.pascalPlural)(entity.name), "Meta?.count}\n title={translate('").concat((0, pluralize_1.plural)(entity.type), ".").concat(entity.name, ".title')}\n to='/").concat(entity.name, "'\n />");
|
|
14
|
+
}).join("\n"), "\n </Grid>\n );\n};\n\nexport default ResourcesPage;\n");
|
|
15
|
+
};
|
|
16
|
+
exports.uiResourcesPageTmpl = uiResourcesPageTmpl;
|
|
17
17
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVzb3VyY2VzUGFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9wcm9qZWN0c0dlbmVyYXRpb24vZ2VuZXJhdG9ycy9maWxlVGVtcGxhdGVzL3VpL1Jlc291cmNlc1BhZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsd0NBQThEO0FBQzlELGlEQUFzRDtBQUV0RCx3Q0FBaUQ7QUFDakQsdUNBQWtDO0FBRTNCLElBQU0sbUJBQW1CLEdBQUcsVUFBQyxFQUdSO1FBRjFCLFFBQVEsY0FBQSxFQUNSLGVBQXVDLEVBQXZDLE9BQU8sbUJBQUcscUNBQTZCLEtBQUE7SUFFdkMsT0FBTyxxT0FVUCxPQUFPLENBQUMsMEJBQTBCO1FBQ2hDLENBQUMsQ0FBQyxFQUFFO1FBQ0osQ0FBQyxDQUFDLGVBQ0Qsd0JBQWdCLE9BQ3BCLDJIQU9DLFFBQVEsQ0FBQyxHQUFHLENBQUMsVUFBQyxNQUFNO1FBQ3BCLE9BQU8sd0ZBR1MsSUFBQSxvQkFBWSxFQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsK0hBS0ksSUFBQSxvQkFBWSxFQUNqRCxNQUFNLENBQUMsSUFBSSxDQUNaLHFEQUNtQixJQUFBLGtCQUFNLEVBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxjQUFJLE1BQU0sQ0FBQyxJQUFJLHFDQUMvQyxNQUFNLENBQUMsSUFBSSxnQkFDakIsQ0FBQTtJQUNULENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUNQLENBQUMsK0RBTUQsQ0FBQTtBQUNELENBQUMsQ0FBQTtBQWhEWSxRQUFBLG1CQUFtQix1QkFnRC9CIn0=
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uiAdditionalRoutesTmpl = void 0;
|
|
4
|
-
var uiAdditionalRoutesTmpl = function () { return "const additionalRoutes = [];\n\nexport default additionalRoutes;\n"; };
|
|
5
|
-
exports.uiAdditionalRoutesTmpl = uiAdditionalRoutesTmpl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiAdditionalRoutesTmpl = void 0;
|
|
4
|
+
var uiAdditionalRoutesTmpl = function () { return "const additionalRoutes = [];\n\nexport default additionalRoutes;\n"; };
|
|
5
|
+
exports.uiAdditionalRoutesTmpl = uiAdditionalRoutesTmpl;
|
|
6
6
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkaXRpb25hbFJvdXRlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9wcm9qZWN0c0dlbmVyYXRpb24vZ2VuZXJhdG9ycy9maWxlVGVtcGxhdGVzL3VpL2FkZGl0aW9uYWxSb3V0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQU8sSUFBTSxzQkFBc0IsR0FBRyxjQUFNLE9BQUEsb0VBRzNDLEVBSDJDLENBRzNDLENBQUE7QUFIWSxRQUFBLHNCQUFzQiwwQkFHbEMifQ==
|