runlify 0.0.714 → 0.0.715
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/build/cli.js +20 -52
- package/build/commands/availableEnvironments.js +16 -51
- package/build/commands/generate.js +10 -46
- package/build/commands/init.js +73 -140
- package/build/commands/login.js +6 -42
- package/build/commands/logout.js +5 -41
- package/build/commands/pullEnvs.js +23 -70
- package/build/commands/readEnv.js +16 -45
- package/build/commands/regen.js +17 -48
- package/build/commands/runlify.js +6 -37
- package/build/commands/showToken.js +14 -45
- package/build/commands/start.js +57 -84
- package/build/commands/tryGetMeta.js +7 -43
- package/build/documentation/algoritmToDoc.js +4 -4
- package/build/documentation/algoritmToDoc.spec.js +5 -5
- package/build/documentation/curlExampleToText.js +15 -16
- package/build/documentation/curlExampleToText.spec.js +32 -16
- package/build/documentation/doc.js +1 -2
- package/build/documentation/docToFlatDoc.js +13 -17
- package/build/documentation/docToFlatDoc.spec.js +9 -9
- package/build/documentation/flatDoc.js +1 -2
- package/build/documentation/flatDocToText.js +4 -6
- package/build/documentation/flatDocToText.spec.js +20 -8
- package/build/documentation/templateDoc.js +1 -2
- package/build/documentation/templateDocToDoc.js +2 -2
- package/build/extensions/auth.js +64 -124
- package/build/extensions/cli-extension.js +3 -3
- package/build/extensions/cloudEnv.js +76 -120
- package/build/extensions/cloudMeta.js +35 -73
- package/build/extensions/globalConfig.js +37 -80
- package/build/extensions/localConfig.js +15 -46
- package/build/extensions/preventRunningIfUpdateAvailable.js +18 -52
- package/build/log.js +6 -6
- package/build/projectsGeneration/args.js +33 -53
- package/build/projectsGeneration/builders/AdditionalServiceBuilder.js +62 -96
- package/build/projectsGeneration/builders/BaseBuilder.js +30 -34
- package/build/projectsGeneration/builders/BaseSavableEntityBuilder.js +272 -312
- package/build/projectsGeneration/builders/CatalogBuilder.js +17 -46
- package/build/projectsGeneration/builders/ConfigVarBuilder.js +25 -36
- package/build/projectsGeneration/builders/DeploymentBuilder.js +18 -47
- package/build/projectsGeneration/builders/DocumentBuilder.js +26 -56
- package/build/projectsGeneration/builders/InfoRegistryBuilder.js +106 -140
- package/build/projectsGeneration/builders/PageBuilder.js +22 -51
- package/build/projectsGeneration/builders/PermissionBuilder.js +12 -41
- package/build/projectsGeneration/builders/ReportBuilder.js +23 -52
- package/build/projectsGeneration/builders/RestApiBuilder.js +20 -50
- package/build/projectsGeneration/builders/RestApiMethodBuilder.js +25 -54
- package/build/projectsGeneration/builders/RoleBuilder.js +12 -41
- package/build/projectsGeneration/builders/SumRegistryBuilder.js +100 -133
- package/build/projectsGeneration/builders/SystemMetaBuilder.js +281 -324
- package/build/projectsGeneration/builders/TelegramBotBuilder.js +18 -47
- package/build/projectsGeneration/builders/docs/DocumentationOfDocumentBuilder.js +8 -9
- package/build/projectsGeneration/builders/fields/BaseFieldBuilder.js +89 -105
- package/build/projectsGeneration/builders/fields/IdFieldBuilder.js +24 -54
- package/build/projectsGeneration/builders/fields/LinkFieldBuilder.js +33 -62
- package/build/projectsGeneration/builders/fields/ModelFieldBuilder.js +18 -47
- package/build/projectsGeneration/builders/fields/ScalarFieldBuilder.js +11 -42
- package/build/projectsGeneration/builders/fields/ViewLinkFieldBuilder.js +26 -55
- package/build/projectsGeneration/builders/integrationClients/IntegrationClientArgsModelBuilder.js +6 -23
- package/build/projectsGeneration/builders/integrationClients/IntegrationClientBaseModelBuilder.js +28 -57
- package/build/projectsGeneration/builders/integrationClients/IntegrationClientBuilder.js +25 -54
- package/build/projectsGeneration/builders/integrationClients/IntegrationClientQueryMethodsBuilder.js +18 -47
- package/build/projectsGeneration/builders/integrationClients/IntegrationClientReturnModelBuilder.js +12 -41
- package/build/projectsGeneration/builders/materialUiIcons.js +2 -2
- package/build/projectsGeneration/builders/mehods/ArgsModelBuilder.js +6 -23
- package/build/projectsGeneration/builders/mehods/BaseModelBuilder.js +30 -59
- package/build/projectsGeneration/builders/mehods/MethodBuilder.js +36 -66
- package/build/projectsGeneration/builders/mehods/ReturnModelBuilder.js +12 -41
- package/build/projectsGeneration/builders/menu/BaseMenuItemBuilder.js +24 -54
- package/build/projectsGeneration/builders/menu/ExternalEnvMenuItemBuilder.js +11 -40
- package/build/projectsGeneration/builders/menu/ExternalMenuItemBuilder.js +11 -40
- package/build/projectsGeneration/builders/menu/GroupMenuItemBuilder.js +31 -66
- package/build/projectsGeneration/builders/menu/InternalMenuItemBuilder.js +16 -45
- package/build/projectsGeneration/builders/tsFilterFields.js +11 -12
- package/build/projectsGeneration/builders/tsFilterFields.spec.js +29 -11
- package/build/projectsGeneration/builders/ui/FormsBuilder.js +9 -10
- package/build/projectsGeneration/builders/ui/ListFormBuilder.js +9 -10
- package/build/projectsGeneration/builders/ui/ListFormFilterBuilder.js +14 -16
- package/build/projectsGeneration/builders/ui/ListFormFilterFieldBuilder.js +8 -9
- package/build/projectsGeneration/builders/utils/accessFunctions.js +4 -4
- package/build/projectsGeneration/builders/validation/baseValudationToYupAssertions.js +4 -4
- package/build/projectsGeneration/builders/validation/bigintValudationToYupAssertions.js +5 -5
- package/build/projectsGeneration/builders/validation/bigintValudationToYupAssertions.spec.js +7 -7
- package/build/projectsGeneration/builders/validation/floatValudationToYupAssertions.js +4 -4
- package/build/projectsGeneration/builders/validation/floatValudationToYupAssertions.spec.js +6 -6
- package/build/projectsGeneration/builders/validation/intValudationToYupAssertions.js +9 -9
- package/build/projectsGeneration/builders/validation/intValudationToYupAssertions.spec.js +9 -9
- package/build/projectsGeneration/builders/validation/numberValudationToYupAssertions.js +10 -10
- package/build/projectsGeneration/builders/validation/stringValudationToYupAssertions.js +6 -6
- package/build/projectsGeneration/builders/validation/stringValudationToYupAssertions.spec.js +6 -6
- package/build/projectsGeneration/commonEntities/addAggregateTrackings.js +3 -3
- package/build/projectsGeneration/commonEntities/addAuditLogs.js +6 -6
- package/build/projectsGeneration/commonEntities/addAutogeneration.js +4 -4
- package/build/projectsGeneration/commonEntities/addCommonCommands.js +2 -2
- package/build/projectsGeneration/commonEntities/addCommonEntities.js +14 -14
- package/build/projectsGeneration/commonEntities/addConfigurationVariables.js +4 -4
- package/build/projectsGeneration/commonEntities/addLanguages.js +3 -3
- package/build/projectsGeneration/commonEntities/addManagers.js +6 -6
- package/build/projectsGeneration/commonEntities/addRefreshTokens.js +4 -4
- package/build/projectsGeneration/commonEntities/addRoles.js +8 -8
- package/build/projectsGeneration/commonEntities/addTenants.js +3 -3
- package/build/projectsGeneration/commonEntities/addUserSettings.js +7 -7
- package/build/projectsGeneration/commonEntities/addUsers.js +4 -4
- package/build/projectsGeneration/defaultCatalogs/addElasticSearch.js +12 -13
- package/build/projectsGeneration/defaultCatalogs/files.js +6 -6
- package/build/projectsGeneration/fileCleaners/back/graphServices/cleanGraphServices.js +24 -59
- package/build/projectsGeneration/fileCleaners/back/services/cleanServices.js +32 -67
- package/build/projectsGeneration/fileCleaners/cleanFiles.js +7 -38
- package/build/projectsGeneration/fileCleaners/ui/cleanUi.js +7 -39
- package/build/projectsGeneration/fileCleaners/ui/pages/cleanPages.js +24 -59
- package/build/projectsGeneration/fileCleaners/ui/widgets/cleanWidgets.js +10 -40
- package/build/projectsGeneration/fileCleaners/ui/widgets/cleanWidgetsByType.js +29 -62
- package/build/projectsGeneration/genGraphSchemesByLocalGenerator.js +26 -68
- package/build/projectsGeneration/generateAdditionalService.js +41 -98
- package/build/projectsGeneration/generateEntity.js +215 -346
- package/build/projectsGeneration/generateEnvironment.js +157 -265
- package/build/projectsGeneration/generateProject.js +422 -724
- package/build/projectsGeneration/generators/fieldTypeToTsType.js +4 -4
- package/build/projectsGeneration/generators/fileTemplates/back/Entities.js +16 -14
- package/build/projectsGeneration/generators/fileTemplates/back/devEnum.js +17 -13
- package/build/projectsGeneration/generators/fileTemplates/back/elastic/elastic.js +8 -44
- package/build/projectsGeneration/generators/fileTemplates/back/elastic/jobs.js +36 -26
- package/build/projectsGeneration/generators/fileTemplates/back/enum.js +17 -13
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/Chart.js +12 -8
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/back.js +128 -12
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/ingress.js +54 -8
- package/build/projectsGeneration/generators/fileTemplates/back/environment/chart/values.js +149 -13
- package/build/projectsGeneration/generators/fileTemplates/back/environment/ciNotify.js +19 -8
- package/build/projectsGeneration/generators/fileTemplates/back/environment/defaultEnv.js +5 -9
- package/build/projectsGeneration/generators/fileTemplates/back/environment/dockerfileTmplBack.js +38 -8
- package/build/projectsGeneration/generators/fileTemplates/back/environment/dockerfileTmplUI.js +42 -8
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocSpec.js +3 -6
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsConfiguration.js +27 -19
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsEntity.js +7 -5
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsIntegrationClient.js +44 -29
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/backDocsRestApi.js +45 -18
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/spec/findLinksToEntities.js +2 -4
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/spec/getAllSavableEntities.js +7 -11
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/spec/getProjectSpec.js +206 -216
- package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/spec/titleMd.js +5 -5
- package/build/projectsGeneration/generators/fileTemplates/back/environment/gitlabCi.js +272 -37
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/clients/getPrisma.js +78 -9
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/clients/queue/getQueue.js +42 -9
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/index.js +36 -9
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/integrationClients/IntegrationClient.js +56 -5
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/integrationClients/IntegrationClients.js +12 -9
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/integrationClients/fieldsToTsTypeFields.js +4 -6
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/integrationClients/integrationClientConstrictors.js +13 -9
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/integrationClients/tsModelTmpl.js +6 -4
- package/build/projectsGeneration/generators/fileTemplates/back/environment/src/integrationClients/types.js +15 -7
- package/build/projectsGeneration/generators/fileTemplates/back/graph/additionalResolvers.js +9 -2
- package/build/projectsGeneration/generators/fileTemplates/back/graph/additionalService/permissionToGraphql.js +16 -9
- package/build/projectsGeneration/generators/fileTemplates/back/graph/additionalService/resolvers.js +32 -12
- package/build/projectsGeneration/generators/fileTemplates/back/graph/additionalService/typeDefs.js +18 -11
- package/build/projectsGeneration/generators/fileTemplates/back/graph/additionalTypes.js +7 -2
- package/build/projectsGeneration/generators/fileTemplates/back/graph/entityAdditionalPermissionToGraphqlTmpl.js +20 -9
- package/build/projectsGeneration/generators/fileTemplates/back/graph/entityBasePermissionToGraphql.js +22 -10
- package/build/projectsGeneration/generators/fileTemplates/back/graph/entityPermissionToGraphqlTmpl.js +18 -9
- package/build/projectsGeneration/generators/fileTemplates/back/graph/help/baseResolvers.js +17 -2
- package/build/projectsGeneration/generators/fileTemplates/back/graph/help/baseTypeDefs.js +15 -5
- package/build/projectsGeneration/generators/fileTemplates/back/graph/help/permissionsToGraphql.js +11 -2
- package/build/projectsGeneration/generators/fileTemplates/back/graph/meta/resolvers.js +26 -2
- package/build/projectsGeneration/generators/fileTemplates/back/graph/meta/typeDefs.js +17 -2
- package/build/projectsGeneration/generators/fileTemplates/back/graph/permissionsToGraphql.js +52 -13
- package/build/projectsGeneration/generators/fileTemplates/back/graph/resolvers.js +52 -13
- package/build/projectsGeneration/generators/fileTemplates/back/graph/types.js +18 -11
- package/build/projectsGeneration/generators/fileTemplates/back/initCommon.js +30 -16
- package/build/projectsGeneration/generators/fileTemplates/back/initDev.js +27 -15
- package/build/projectsGeneration/generators/fileTemplates/back/initEntities.js +24 -10
- package/build/projectsGeneration/generators/fileTemplates/back/root/config/config.js +30 -16
- package/build/projectsGeneration/generators/fileTemplates/back/root/restRouter.js +21 -2
- package/build/projectsGeneration/generators/fileTemplates/back/services/AdditionalServices.js +7 -2
- package/build/projectsGeneration/generators/fileTemplates/back/services/BaseServices.js +18 -22
- package/build/projectsGeneration/generators/fileTemplates/back/services/HelpService/HelpService.js +30 -7
- package/build/projectsGeneration/generators/fileTemplates/back/services/additionalService/types.js +18 -13
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/additionalClass.js +7 -5
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/class.js +126 -49
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/config.js +59 -40
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnCreate.js +13 -5
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnDelete.js +14 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/additionalOperationsOnUpdate.js +14 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterCreate.js +15 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterDelete.js +15 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/afterUpdate.js +15 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeCreate.js +15 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeDelete.js +15 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeUpdate.js +14 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/beforeUpsert.js +30 -7
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/changeListFilter.js +14 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/hooks/tenantIdRequiredHooks.js +81 -8
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/initBuiltInHooks.js +22 -10
- package/build/projectsGeneration/generators/fileTemplates/back/services/entity/initUserHooks.js +31 -6
- package/build/projectsGeneration/generators/fileTemplates/back/services/serviceConstrictors.js +26 -14
- package/build/projectsGeneration/generators/fileTemplates/ui/Dashboard.js +14 -2
- package/build/projectsGeneration/generators/fileTemplates/ui/MetaPage.js +120 -3
- package/build/projectsGeneration/generators/fileTemplates/ui/ResourcesPage.js +45 -10
- package/build/projectsGeneration/generators/fileTemplates/ui/additionalRoutes.js +5 -2
- package/build/projectsGeneration/generators/fileTemplates/ui/entityMapping.js +14 -12
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/Chart.js +12 -8
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/front.js +118 -13
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/ingress.js +51 -8
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/chart/values.js +79 -8
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/ciNotify.js +19 -8
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/docs/adminAppDocsConfiguration.js +27 -21
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/gitlabCi.js +179 -26
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/App.js +107 -10
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/contexts/SpacesContext.js +67 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/dataProvider/getAdditionalMethods.js +55 -18
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/dataProvider/index.js +93 -13
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/i18nProvider/index.js +51 -19
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/layout/AppBar.js +60 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/layout/Menu.js +52 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/environment/src/routes.js +38 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/functions/Functions.js +60 -7
- package/build/projectsGeneration/generators/fileTemplates/ui/getAdditionalMenu.js +11 -2
- package/build/projectsGeneration/generators/fileTemplates/ui/getDefaultMenu.js +136 -23
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangCatalogsTmpl.js +3 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangDocsTmpl.js +3 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangInfoRegistriesTmpl.js +3 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangReportsTmpl.js +3 -3
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiLangSumRegistriesTmpl.js +3 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiTranslationsForServicesOfSavablesTmpl.js +33 -21
- package/build/projectsGeneration/generators/fileTemplates/ui/i18n/lang/uiTranslationsLangTmpl.js +23 -15
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityCreate/DefaultEntityCreate.js +101 -62
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityCreate/index.js +15 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityEdit/DefaultEntityEdit.js +176 -77
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityEdit/index.js +15 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/DefaultEntityFilter.js +68 -50
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/DefaultEntityList.js +83 -47
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/EntityFilter.js +12 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityList/index.js +15 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultActions.js +54 -19
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultEntityShow.js +53 -30
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DefaultMainTab.js +45 -32
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/DependencyTab.js +57 -41
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/MainTab.js +3 -2
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/additionalTabs.js +7 -3
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/EntityShow/index.js +15 -5
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/Icon.js +8 -8
- package/build/projectsGeneration/generators/fileTemplates/ui/pages/getEntityValidation.js +45 -30
- package/build/projectsGeneration/generators/fileTemplates/ui/resources.js +46 -12
- package/build/projectsGeneration/generators/fileTemplates/ui/widgets/count/CountWidget.js +50 -9
- package/build/projectsGeneration/generators/fileTemplates/ui/widgets/list/ListWidget.js +109 -14
- package/build/projectsGeneration/generators/graph/fieldTypeToGraphScalar.js +8 -9
- package/build/projectsGeneration/generators/graph/fieldTypeToGraphScalarStringified.js +4 -6
- package/build/projectsGeneration/generators/graph/fields/genGraphField.js +8 -9
- package/build/projectsGeneration/generators/graph/fields/genGraphIdField.js +7 -8
- package/build/projectsGeneration/generators/graph/fields/genGraphIdFieldType.js +6 -6
- package/build/projectsGeneration/generators/graph/fields/genGraphLinkField.js +10 -11
- package/build/projectsGeneration/generators/graph/fields/genGraphModelField.js +10 -11
- package/build/projectsGeneration/generators/graph/fields/genGraphScalarField.js +10 -11
- package/build/projectsGeneration/generators/graph/filters/genGraphField.js +7 -7
- package/build/projectsGeneration/generators/graph/filters/genGraphIdFilter.js +12 -14
- package/build/projectsGeneration/generators/graph/filters/genGraphLinkFilter.js +12 -24
- package/build/projectsGeneration/generators/graph/filters/genGraphScalarFilter.js +25 -37
- package/build/projectsGeneration/generators/graph/genGraphAdditionalServiceSchema.js +35 -35
- package/build/projectsGeneration/generators/graph/genGraphAdditionalServiceSchema.spec.js +148 -65
- package/build/projectsGeneration/generators/graph/genGraphCrudSchema.js +38 -50
- package/build/projectsGeneration/generators/graph/genGraphCrudSchema.spec.js +393 -34
- package/build/projectsGeneration/generators/graph/genGraphFilterType.js +11 -22
- package/build/projectsGeneration/generators/graph/genGraphFilterType.spec.js +75 -13
- package/build/projectsGeneration/generators/graph/genGraphModelType.js +15 -27
- package/build/projectsGeneration/generators/graph/genGraphType.js +7 -18
- package/build/projectsGeneration/generators/graph/genGraphType.spec.js +27 -12
- package/build/projectsGeneration/generators/graph/printGraphType.js +5 -7
- package/build/projectsGeneration/generators/graph/printGraphType.spec.js +11 -6
- package/build/projectsGeneration/generators/graph/utils/mapUtils.js +11 -30
- package/build/projectsGeneration/generators/graph/utils/models/getModelInitOrder.js +14 -28
- package/build/projectsGeneration/generators/graph/utils/models/getModelInitOrder.spec.js +18 -18
- package/build/projectsGeneration/generators/graph/utils/models/getUniqModels.js +3 -3
- package/build/projectsGeneration/generators/graph/utils/models/getUniqModels.spec.js +17 -28
- package/build/projectsGeneration/generators/graph/utils/models/getUsedModels.js +14 -19
- package/build/projectsGeneration/generators/graph/utils/models/getUsedModels.spec.js +40 -51
- package/build/projectsGeneration/generators/graph/utils/serviceModels/augmentInputModelsByUsedAsInputGeneralModelsAndPostfixThemByInput.js +17 -26
- package/build/projectsGeneration/generators/graph/utils/serviceModels/augmentInputModelsByUsedAsInputGeneralModelsAndPostfixThemByInput.spec.js +68 -68
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getGraphTypesFromInputOutputModels.js +21 -42
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getGraphTypesFromInputOutputModels.spec.js +85 -62
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getPreparedModelsForGraph.js +20 -31
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getPreparedModelsForGraph.spec.js +48 -49
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getServiceModels.js +7 -7
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getUsedGraphModelsForService.js +6 -6
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getUsedGraphModelsForService.spec.js +13 -13
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getUsedModelsForService.js +18 -21
- package/build/projectsGeneration/generators/graph/utils/serviceModels/getUsedModelsForService.spec.js +153 -153
- package/build/projectsGeneration/generators/graph/utils/serviceModels/prefixServiceModelsWithServiceName.js +25 -26
- package/build/projectsGeneration/generators/graph/utils/serviceModels/prefixServiceModelsWithServiceName.spec.js +69 -69
- package/build/projectsGeneration/generators/graph/utils/serviceModels/removeDublicatesFromServiceModels.js +4 -4
- package/build/projectsGeneration/generators/graph/utils/serviceModels/removeUnusedInOutputGeneralModels.js +6 -17
- package/build/projectsGeneration/generators/graph/utils/serviceModels/removeVoidsInServiceModels.js +5 -5
- package/build/projectsGeneration/generators/prisma/fieldIdTypeToPrismaType.js +3 -3
- package/build/projectsGeneration/generators/prisma/fieldTypeToPrismaType.js +3 -3
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaDefault.js +3 -3
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaDefault.spec.js +20 -20
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaField.js +7 -8
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaFieldFromExternalEntity.js +6 -7
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaFieldFromExternalEntity.spec.js +7 -19
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaIdField.js +10 -11
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaIdField.spec.js +13 -13
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaLinkFields.js +15 -18
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaLinkFields.spec.js +27 -28
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaScalarField.js +12 -14
- package/build/projectsGeneration/generators/prisma/scheme/fields/genPrismaScalarField.spec.js +29 -30
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaEntity.js +23 -32
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaEntity.spec.js +104 -47
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaSchemaForEntities.js +5 -7
- package/build/projectsGeneration/generators/prisma/scheme/genPrismaSchemaForEntitiesWithClientAdnDb.js +19 -10
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNameToEditScalar.js +3 -3
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditField.js +7 -7
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditIdField.js +3 -3
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditLinkField.js +5 -5
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditLinkField.spec.js +10 -10
- package/build/projectsGeneration/generators/ui/componentNames/edit/getCompNamesToEditScalarField.js +3 -3
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNameToShowScalar.js +3 -3
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowField.js +7 -7
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowIdField.js +3 -3
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowLinkField.js +2 -14
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowLinkField.spec.js +17 -17
- package/build/projectsGeneration/generators/ui/componentNames/show/getCompNamesToShowScalarField.js +3 -3
- package/build/projectsGeneration/generators/ui/getLinkShowComponent.spec.js +18 -18
- package/build/projectsGeneration/generators/ui/getScalarShowComponent.spec.js +11 -11
- package/build/projectsGeneration/generators/ui/getShowComponent.js +19 -20
- package/build/projectsGeneration/links/getLinksFromExternalEntities.js +2 -4
- package/build/projectsGeneration/links/getLinksFromExternalEntities.spec.js +11 -22
- package/build/projectsGeneration/links/getLinksOfEntities.js +6 -8
- package/build/projectsGeneration/links/getLinksOfEntities.spec.js +20 -31
- package/build/projectsGeneration/links/getLinksToExternalEntities.js +2 -4
- package/build/projectsGeneration/links/getLinksToExternalEntities.spec.js +11 -22
- package/build/projectsGeneration/metaUtils.js +17 -23
- package/build/projectsGeneration/modelsGeneration.serialization.spec.js +8 -8
- package/build/projectsGeneration/modules/addEmailModuleEntities.js +11 -11
- package/build/projectsGeneration/types.js +6 -6
- package/build/projectsGeneration/utils.js +24 -61
- package/build/refs/yup.spec.js +7 -7
- package/build/types/projectsGeneration/builders/InfoRegistryBuilder.d.ts +0 -4
- package/build/types/projectsGeneration/builders/SumRegistryBuilder.d.ts +0 -3
- package/build/types/projectsGeneration/fileCleaners/cleanFiles.d.ts +1 -1
- package/build/types/projectsGeneration/generateProject.d.ts +0 -5
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/back.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/chart/templates/ingress.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/dockerfileTmplBack.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/dockerfileTmplUI.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/environment/src/integrationClients/IntegrationClient.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/back/services/entity/config.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/front.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/chart/templates/ingress.d.ts +1 -1
- package/build/types/projectsGeneration/generators/fileTemplates/ui/environment/src/App.d.ts +1 -1
- package/build/utils/TermSignals.js +35 -43
- package/build/utils/cases.js +12 -18
- package/build/utils/getPkgManager.js +4 -4
- package/package.json +12 -24
- package/build/projectsGeneration/fileCleaners/back/cleanBack.js +0 -50
- package/build/types/projectsGeneration/fileCleaners/back/cleanBack.d.ts +0 -3
|
@@ -3,77 +3,397 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var genGraphCrudSchema_1 = require("./genGraphCrudSchema");
|
|
6
|
+
const jest_without_globals_1 = require("jest-without-globals");
|
|
7
|
+
const graphql_1 = require("graphql");
|
|
8
|
+
const CatalogBuilder_1 = __importDefault(require("../../builders/CatalogBuilder"));
|
|
9
|
+
const genGraphCrudSchema_1 = require("./genGraphCrudSchema");
|
|
11
10
|
// yarn test --testPathPattern genGraphCrudSchema
|
|
12
|
-
describe('genGraphCrudSchema',
|
|
13
|
-
test('simple',
|
|
14
|
-
|
|
11
|
+
describe('genGraphCrudSchema', () => {
|
|
12
|
+
test('simple', () => {
|
|
13
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
15
14
|
cards.addField('name').setType('string').setRequired();
|
|
16
15
|
cards.addField('lastDigits').setType('int').setRequired();
|
|
17
16
|
cards.addField('registered').setType('datetime').setRequired();
|
|
18
17
|
cards.addField('active').setType('bool');
|
|
19
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
18
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
19
|
+
id: Int!
|
|
20
|
+
name: String!
|
|
21
|
+
lastDigits: Int!
|
|
22
|
+
registered: DateTime!
|
|
23
|
+
active: Boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the \`date-time\` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
|
|
28
|
+
"""
|
|
29
|
+
scalar DateTime
|
|
30
|
+
|
|
31
|
+
input CardFilter {
|
|
32
|
+
q: String
|
|
33
|
+
ids: [Int]
|
|
34
|
+
id: Int
|
|
35
|
+
name: String
|
|
36
|
+
name_in: [String]
|
|
37
|
+
name_not_in: [String]
|
|
38
|
+
lastDigits: Int
|
|
39
|
+
lastDigits_in: [Int]
|
|
40
|
+
lastDigits_not_in: [Int]
|
|
41
|
+
lastDigits_lte: Int
|
|
42
|
+
lastDigits_gte: Int
|
|
43
|
+
lastDigits_lt: Int
|
|
44
|
+
lastDigits_gt: Int
|
|
45
|
+
registered: DateTime
|
|
46
|
+
registered_lte: DateTime
|
|
47
|
+
registered_gte: DateTime
|
|
48
|
+
registered_lt: DateTime
|
|
49
|
+
registered_gt: DateTime
|
|
50
|
+
active: Boolean
|
|
51
|
+
active_defined: Boolean
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type ListMetadata {
|
|
55
|
+
count: Int
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type Query {
|
|
59
|
+
Card(id: Int!): Card
|
|
60
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
61
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type Mutation {
|
|
65
|
+
createCard(name: String!, lastDigits: Int!, registered: DateTime!, active: Boolean): Card
|
|
66
|
+
updateCard(id: Int!, name: String!, lastDigits: Int!, registered: DateTime!, active: Boolean): Card
|
|
67
|
+
removeCard(id: Int!): Card
|
|
68
|
+
}`);
|
|
20
69
|
});
|
|
21
|
-
test('bigInt id',
|
|
22
|
-
|
|
70
|
+
test('bigInt id', () => {
|
|
71
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
23
72
|
cards.getKey().setType('bigint');
|
|
24
73
|
cards.addField('name').setType('string').setRequired();
|
|
25
74
|
cards.addField('lastDigits').setType('int').setRequired();
|
|
26
75
|
cards.addField('registered').setType('datetime').setRequired();
|
|
27
76
|
cards.addField('active').setType('bool');
|
|
28
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
77
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
78
|
+
id: BigInt!
|
|
79
|
+
name: String!
|
|
80
|
+
lastDigits: Int!
|
|
81
|
+
registered: DateTime!
|
|
82
|
+
active: Boolean
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
"""
|
|
86
|
+
The \`BigInt\` scalar type represents non-fractional signed whole numeric values.
|
|
87
|
+
"""
|
|
88
|
+
scalar BigInt
|
|
89
|
+
|
|
90
|
+
"""
|
|
91
|
+
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the \`date-time\` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
|
|
92
|
+
"""
|
|
93
|
+
scalar DateTime
|
|
94
|
+
|
|
95
|
+
input CardFilter {
|
|
96
|
+
q: String
|
|
97
|
+
ids: [BigInt]
|
|
98
|
+
id: BigInt
|
|
99
|
+
name: String
|
|
100
|
+
name_in: [String]
|
|
101
|
+
name_not_in: [String]
|
|
102
|
+
lastDigits: Int
|
|
103
|
+
lastDigits_in: [Int]
|
|
104
|
+
lastDigits_not_in: [Int]
|
|
105
|
+
lastDigits_lte: Int
|
|
106
|
+
lastDigits_gte: Int
|
|
107
|
+
lastDigits_lt: Int
|
|
108
|
+
lastDigits_gt: Int
|
|
109
|
+
registered: DateTime
|
|
110
|
+
registered_lte: DateTime
|
|
111
|
+
registered_gte: DateTime
|
|
112
|
+
registered_lt: DateTime
|
|
113
|
+
registered_gt: DateTime
|
|
114
|
+
active: Boolean
|
|
115
|
+
active_defined: Boolean
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
type ListMetadata {
|
|
119
|
+
count: Int
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
type Query {
|
|
123
|
+
Card(id: BigInt!): Card
|
|
124
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
125
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type Mutation {
|
|
129
|
+
createCard(name: String!, lastDigits: Int!, registered: DateTime!, active: Boolean): Card
|
|
130
|
+
updateCard(id: BigInt!, name: String!, lastDigits: Int!, registered: DateTime!, active: Boolean): Card
|
|
131
|
+
removeCard(id: BigInt!): Card
|
|
132
|
+
}`);
|
|
29
133
|
});
|
|
30
|
-
test('int field',
|
|
31
|
-
|
|
134
|
+
test('int field', () => {
|
|
135
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
32
136
|
cards.addField('lastDigits').setType('int').setRequired();
|
|
33
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
137
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
138
|
+
id: Int!
|
|
139
|
+
lastDigits: Int!
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
input CardFilter {
|
|
143
|
+
q: String
|
|
144
|
+
ids: [Int]
|
|
145
|
+
id: Int
|
|
146
|
+
lastDigits: Int
|
|
147
|
+
lastDigits_in: [Int]
|
|
148
|
+
lastDigits_not_in: [Int]
|
|
149
|
+
lastDigits_lte: Int
|
|
150
|
+
lastDigits_gte: Int
|
|
151
|
+
lastDigits_lt: Int
|
|
152
|
+
lastDigits_gt: Int
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
type ListMetadata {
|
|
156
|
+
count: Int
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
type Query {
|
|
160
|
+
Card(id: Int!): Card
|
|
161
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
162
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
type Mutation {
|
|
166
|
+
createCard(lastDigits: Int!): Card
|
|
167
|
+
updateCard(id: Int!, lastDigits: Int!): Card
|
|
168
|
+
removeCard(id: Int!): Card
|
|
169
|
+
}`);
|
|
34
170
|
});
|
|
35
|
-
test('not autogenerated id key',
|
|
36
|
-
|
|
171
|
+
test('not autogenerated id key', () => {
|
|
172
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
37
173
|
cards.getKey().setAutoGenerated(false);
|
|
38
174
|
cards.addField('name').setType('string').setRequired();
|
|
39
175
|
cards.addField('lastDigits').setType('int').setRequired();
|
|
40
176
|
cards.addField('active').setType('bool');
|
|
41
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
177
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
178
|
+
id: Int!
|
|
179
|
+
name: String!
|
|
180
|
+
lastDigits: Int!
|
|
181
|
+
active: Boolean
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
input CardFilter {
|
|
185
|
+
q: String
|
|
186
|
+
ids: [Int]
|
|
187
|
+
id: Int
|
|
188
|
+
name: String
|
|
189
|
+
name_in: [String]
|
|
190
|
+
name_not_in: [String]
|
|
191
|
+
lastDigits: Int
|
|
192
|
+
lastDigits_in: [Int]
|
|
193
|
+
lastDigits_not_in: [Int]
|
|
194
|
+
lastDigits_lte: Int
|
|
195
|
+
lastDigits_gte: Int
|
|
196
|
+
lastDigits_lt: Int
|
|
197
|
+
lastDigits_gt: Int
|
|
198
|
+
active: Boolean
|
|
199
|
+
active_defined: Boolean
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
type ListMetadata {
|
|
203
|
+
count: Int
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
type Query {
|
|
207
|
+
Card(id: Int!): Card
|
|
208
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
209
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
type Mutation {
|
|
213
|
+
createCard(id: Int!, name: String!, lastDigits: Int!, active: Boolean): Card
|
|
214
|
+
updateCard(id: Int!, name: String!, lastDigits: Int!, active: Boolean): Card
|
|
215
|
+
removeCard(id: Int!): Card
|
|
216
|
+
}`);
|
|
42
217
|
});
|
|
43
|
-
test('with int link field',
|
|
44
|
-
|
|
218
|
+
test('with int link field', () => {
|
|
219
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
45
220
|
cards.getKey().setAutoGenerated(false);
|
|
46
221
|
cards.addField('name').setType('string').setRequired();
|
|
47
222
|
cards.addLinkField('boxes', 'boxId').setType('int').setRequired();
|
|
48
223
|
cards.addField('active').setType('bool');
|
|
49
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
224
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
225
|
+
id: Int!
|
|
226
|
+
name: String!
|
|
227
|
+
boxId: Int!
|
|
228
|
+
active: Boolean
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
input CardFilter {
|
|
232
|
+
q: String
|
|
233
|
+
ids: [Int]
|
|
234
|
+
id: Int
|
|
235
|
+
name: String
|
|
236
|
+
name_in: [String]
|
|
237
|
+
name_not_in: [String]
|
|
238
|
+
boxId: Int
|
|
239
|
+
boxId_in: [Int]
|
|
240
|
+
boxId_not_in: [Int]
|
|
241
|
+
active: Boolean
|
|
242
|
+
active_defined: Boolean
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
type ListMetadata {
|
|
246
|
+
count: Int
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
type Query {
|
|
250
|
+
Card(id: Int!): Card
|
|
251
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
252
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
type Mutation {
|
|
256
|
+
createCard(id: Int!, name: String!, boxId: Int!, active: Boolean): Card
|
|
257
|
+
updateCard(id: Int!, name: String!, boxId: Int!, active: Boolean): Card
|
|
258
|
+
removeCard(id: Int!): Card
|
|
259
|
+
}`);
|
|
50
260
|
});
|
|
51
|
-
test('with bigint link field',
|
|
52
|
-
|
|
261
|
+
test('with bigint link field', () => {
|
|
262
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
53
263
|
cards.getKey().setAutoGenerated(false);
|
|
54
264
|
cards.addField('name').setType('string').setRequired();
|
|
55
265
|
cards.addLinkField('boxes', 'boxId').setType('bigint').setRequired();
|
|
56
266
|
cards.addField('active').setType('bool');
|
|
57
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
267
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
268
|
+
id: Int!
|
|
269
|
+
name: String!
|
|
270
|
+
boxId: BigInt!
|
|
271
|
+
active: Boolean
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
"""
|
|
275
|
+
The \`BigInt\` scalar type represents non-fractional signed whole numeric values.
|
|
276
|
+
"""
|
|
277
|
+
scalar BigInt
|
|
278
|
+
|
|
279
|
+
input CardFilter {
|
|
280
|
+
q: String
|
|
281
|
+
ids: [Int]
|
|
282
|
+
id: Int
|
|
283
|
+
name: String
|
|
284
|
+
name_in: [String]
|
|
285
|
+
name_not_in: [String]
|
|
286
|
+
boxId: BigInt
|
|
287
|
+
boxId_in: [BigInt]
|
|
288
|
+
boxId_not_in: [BigInt]
|
|
289
|
+
active: Boolean
|
|
290
|
+
active_defined: Boolean
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
type ListMetadata {
|
|
294
|
+
count: Int
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
type Query {
|
|
298
|
+
Card(id: Int!): Card
|
|
299
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
300
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
type Mutation {
|
|
304
|
+
createCard(id: Int!, name: String!, boxId: BigInt!, active: Boolean): Card
|
|
305
|
+
updateCard(id: Int!, name: String!, boxId: BigInt!, active: Boolean): Card
|
|
306
|
+
removeCard(id: Int!): Card
|
|
307
|
+
}`);
|
|
58
308
|
});
|
|
59
|
-
test('with string link field',
|
|
60
|
-
|
|
309
|
+
test('with string link field', () => {
|
|
310
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
61
311
|
cards.getKey().setAutoGenerated(false);
|
|
62
312
|
cards.addField('name').setType('string').setRequired();
|
|
63
313
|
cards.addLinkField('boxes', 'boxId').setType('string').setRequired();
|
|
64
314
|
cards.addField('active').setType('bool');
|
|
65
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
315
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
316
|
+
id: Int!
|
|
317
|
+
name: String!
|
|
318
|
+
boxId: String!
|
|
319
|
+
active: Boolean
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
input CardFilter {
|
|
323
|
+
q: String
|
|
324
|
+
ids: [Int]
|
|
325
|
+
id: Int
|
|
326
|
+
name: String
|
|
327
|
+
name_in: [String]
|
|
328
|
+
name_not_in: [String]
|
|
329
|
+
boxId: String
|
|
330
|
+
boxId_in: [String]
|
|
331
|
+
boxId_not_in: [String]
|
|
332
|
+
active: Boolean
|
|
333
|
+
active_defined: Boolean
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
type ListMetadata {
|
|
337
|
+
count: Int
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
type Query {
|
|
341
|
+
Card(id: Int!): Card
|
|
342
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
343
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
type Mutation {
|
|
347
|
+
createCard(id: Int!, name: String!, boxId: String!, active: Boolean): Card
|
|
348
|
+
updateCard(id: Int!, name: String!, boxId: String!, active: Boolean): Card
|
|
349
|
+
removeCard(id: Int!): Card
|
|
350
|
+
}`);
|
|
66
351
|
});
|
|
67
|
-
test('no search in graph',
|
|
68
|
-
|
|
352
|
+
test('no search in graph', () => {
|
|
353
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
69
354
|
cards.getKey().setAutoGenerated(false);
|
|
70
355
|
cards.addField('name').setType('string').setRequired();
|
|
71
356
|
cards.addLinkField('boxes', 'boxId').setType('string').setRequired();
|
|
72
357
|
cards.addField('active').setType('bool');
|
|
73
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
358
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
359
|
+
id: Int!
|
|
360
|
+
name: String!
|
|
361
|
+
boxId: String!
|
|
362
|
+
active: Boolean
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
input CardFilter {
|
|
366
|
+
q: String
|
|
367
|
+
ids: [Int]
|
|
368
|
+
id: Int
|
|
369
|
+
name: String
|
|
370
|
+
name_in: [String]
|
|
371
|
+
name_not_in: [String]
|
|
372
|
+
boxId: String
|
|
373
|
+
boxId_in: [String]
|
|
374
|
+
boxId_not_in: [String]
|
|
375
|
+
active: Boolean
|
|
376
|
+
active_defined: Boolean
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
type ListMetadata {
|
|
380
|
+
count: Int
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
type Query {
|
|
384
|
+
Card(id: Int!): Card
|
|
385
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
386
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
type Mutation {
|
|
390
|
+
createCard(id: Int!, name: String!, boxId: String!, active: Boolean): Card
|
|
391
|
+
updateCard(id: Int!, name: String!, boxId: String!, active: Boolean): Card
|
|
392
|
+
removeCard(id: Int!): Card
|
|
393
|
+
}`);
|
|
74
394
|
});
|
|
75
|
-
test('with not required on input field',
|
|
76
|
-
|
|
395
|
+
test('with not required on input field', () => {
|
|
396
|
+
const cards = new CatalogBuilder_1.default('cards', 'ru');
|
|
77
397
|
cards
|
|
78
398
|
.addField('name')
|
|
79
399
|
.setType('string')
|
|
@@ -81,7 +401,46 @@ describe('genGraphCrudSchema', function () {
|
|
|
81
401
|
.setRequiredOnInput(false);
|
|
82
402
|
cards.addField('lastDigits').setType('int').setRequired();
|
|
83
403
|
cards.addField('active').setType('bool');
|
|
84
|
-
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(
|
|
404
|
+
(0, jest_without_globals_1.expect)((0, graphql_1.printSchema)((0, genGraphCrudSchema_1.genGraphCrudSchema)(cards.build()))).toBe(`type Card {
|
|
405
|
+
id: Int!
|
|
406
|
+
name: String
|
|
407
|
+
lastDigits: Int!
|
|
408
|
+
active: Boolean
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
input CardFilter {
|
|
412
|
+
q: String
|
|
413
|
+
ids: [Int]
|
|
414
|
+
id: Int
|
|
415
|
+
name: String
|
|
416
|
+
name_in: [String]
|
|
417
|
+
name_not_in: [String]
|
|
418
|
+
lastDigits: Int
|
|
419
|
+
lastDigits_in: [Int]
|
|
420
|
+
lastDigits_not_in: [Int]
|
|
421
|
+
lastDigits_lte: Int
|
|
422
|
+
lastDigits_gte: Int
|
|
423
|
+
lastDigits_lt: Int
|
|
424
|
+
lastDigits_gt: Int
|
|
425
|
+
active: Boolean
|
|
426
|
+
active_defined: Boolean
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
type ListMetadata {
|
|
430
|
+
count: Int
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
type Query {
|
|
434
|
+
Card(id: Int!): Card
|
|
435
|
+
allCards(page: Int, perPage: Int, sortField: String, sortOrder: String, filter: CardFilter): [Card]
|
|
436
|
+
_allCardsMeta(page: Int, perPage: Int, filter: CardFilter): ListMetadata
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
type Mutation {
|
|
440
|
+
createCard(name: String, lastDigits: Int!, active: Boolean): Card
|
|
441
|
+
updateCard(id: Int!, name: String, lastDigits: Int!, active: Boolean): Card
|
|
442
|
+
removeCard(id: Int!): Card
|
|
443
|
+
}`);
|
|
85
444
|
});
|
|
86
445
|
});
|
|
87
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
446
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuR3JhcGhDcnVkU2NoZW1hLnNwZWMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvcHJvamVjdHNHZW5lcmF0aW9uL2dlbmVyYXRvcnMvZ3JhcGgvZ2VuR3JhcGhDcnVkU2NoZW1hLnNwZWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7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BQWtDLEVBQUUsR0FBRyxFQUFFO1FBQzVDLE1BQU0sS0FBSyxHQUFHLElBQUksd0JBQWMsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUE7UUFDL0MsS0FBSzthQUNGLFFBQVEsQ0FBQyxNQUFNLENBQUM7YUFDaEIsT0FBTyxDQUFDLFFBQVEsQ0FBQzthQUNqQixXQUFXLEVBQUU7YUFDYixrQkFBa0IsQ0FBQyxLQUFLLENBQUMsQ0FBQTtRQUM1QixLQUFLLENBQUMsUUFBUSxDQUFDLFlBQVksQ0FBQyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxXQUFXLEVBQUUsQ0FBQTtRQUN6RCxLQUFLLENBQUMsUUFBUSxDQUFDLFFBQVEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQTtRQUV4QyxJQUFBLDZCQUFNLEVBQUMsSUFBQSxxQkFBVyxFQUFDLElBQUEsdUNBQWtCLEVBQUMsS0FBSyxDQUFDLEtBQUssRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0VBdUM5RCxDQUFDLENBQUE7SUFDRCxDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQyxDQUFBIn0=
|
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.genGraphFilterType = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
const cases_1 = require("../../../utils/cases");
|
|
6
|
+
const metaUtils_1 = require("../../metaUtils");
|
|
7
|
+
const genGraphField_1 = require("./filters/genGraphField");
|
|
8
|
+
const genGraphIdFilter_1 = require("./filters/genGraphIdFilter");
|
|
9
|
+
const genGraphFilterType = (entity) => {
|
|
21
10
|
return new graphql_1.GraphQLInputObjectType({
|
|
22
|
-
name:
|
|
23
|
-
fields:
|
|
24
|
-
.filter(
|
|
25
|
-
.reduce(
|
|
11
|
+
name: `${(0, cases_1.pascalSingular)(entity.name)}Filter`,
|
|
12
|
+
fields: Object.assign(Object.assign(Object.assign({}, (entity.searchEnabled ? { q: { type: graphql_1.GraphQLString } } : {})), (0, genGraphIdFilter_1.genGraphIdPluralFilter)((0, metaUtils_1.getKeyField)(entity))), entity.fields
|
|
13
|
+
.filter((f) => !f.hidden)
|
|
14
|
+
.reduce((acc, cur) => (Object.assign(Object.assign({}, acc), (0, genGraphField_1.genGraphFilter)(cur))), {})),
|
|
26
15
|
});
|
|
27
16
|
};
|
|
28
17
|
exports.genGraphFilterType = genGraphFilterType;
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuR3JhcGhGaWx0ZXJUeXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3Byb2plY3RzR2VuZXJhdGlvbi9nZW5lcmF0b3JzL2dyYXBoL2dlbkdyYXBoRmlsdGVyVHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxQ0FBK0Q7QUFDL0QsZ0RBQXF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