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
package/build/projectsGeneration/generators/fileTemplates/back/environment/docs/spec/titleMd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.titleMd3 = exports.titleMd2 = exports.titleMd1 = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const titleMd = (title, level) => `${'#'.repeat(level)} ${title}\n\n`;
|
|
5
|
+
const titleMd1 = (title) => titleMd(title, 1);
|
|
6
6
|
exports.titleMd1 = titleMd1;
|
|
7
|
-
|
|
7
|
+
const titleMd2 = (title) => titleMd(title, 2);
|
|
8
8
|
exports.titleMd2 = titleMd2;
|
|
9
|
-
|
|
9
|
+
const titleMd3 = (title) => titleMd(title, 3);
|
|
10
10
|
exports.titleMd3 = titleMd3;
|
|
11
11
|
exports.default = titleMd;
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGl0bGVNZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9wcm9qZWN0c0dlbmVyYXRpb24vZ2VuZXJhdG9ycy9maWxlVGVtcGxhdGVzL2JhY2svZW52aXJvbm1lbnQvZG9jcy9zcGVjL3RpdGxlTWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsTUFBTSxPQUFPLEdBQUcsQ0FBQyxLQUFhLEVBQUUsS0FBYSxFQUFFLEVBQUUsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLElBQUksS0FBSyxNQUFNLENBQUM7QUFFL0UsTUFBTSxRQUFRLEdBQUcsQ0FBQyxLQUFhLEVBQUUsRUFBRSxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFBaEQsUUFBQSxRQUFRLFlBQXdDO0FBQ3RELE1BQU0sUUFBUSxHQUFHLENBQUMsS0FBYSxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQWhELFFBQUEsUUFBUSxZQUF3QztBQUN0RCxNQUFNLFFBQVEsR0FBRyxDQUFDLEtBQWEsRUFBRSxFQUFFLENBQUMsT0FBTyxDQUFDLEtBQUssRUFBRSxDQUFDLENBQUMsQ0FBQztBQUFoRCxRQUFBLFFBQVEsWUFBd0M7QUFFN0Qsa0JBQWUsT0FBTyxDQUFDIn0=
|
|
@@ -1,41 +1,276 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.gitlabCiTmpl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
4
|
+
const change_case_1 = require("change-case");
|
|
5
|
+
const utils_1 = require("../../../../utils");
|
|
6
|
+
const gitlabCiTmpl = ({ system: { prefix }, system, options, }) => `image: node:20
|
|
7
|
+
${options.skipWarningThisIsGenerated
|
|
8
|
+
? ''
|
|
9
|
+
: `
|
|
10
|
+
# ${utils_1.generatedWarning}
|
|
11
|
+
`}
|
|
12
|
+
stages:
|
|
13
|
+
- check
|
|
14
|
+
- previous-image
|
|
15
|
+
- build
|
|
16
|
+
- latest-image
|
|
17
|
+
- deploy
|
|
18
|
+
|
|
19
|
+
cache:
|
|
20
|
+
paths:
|
|
21
|
+
- .cache
|
|
22
|
+
- .cache_images
|
|
23
|
+
# - node_modules
|
|
24
|
+
|
|
25
|
+
variables:
|
|
26
|
+
REPO_NAME: $CI_PROJECT_NAME
|
|
27
|
+
VERBOSE: 'true'
|
|
28
|
+
RELEASE: $CI_COMMIT_SHORT_SHA
|
|
29
|
+
KUBECONFIG: /etc/deploy/config
|
|
30
|
+
PROJECT_NAME: ${system.name}
|
|
31
|
+
|
|
32
|
+
check:
|
|
33
|
+
stage: check
|
|
34
|
+
image: registry.gitlab.com/making.ventures/images/node-with-tools
|
|
35
|
+
before_script:
|
|
36
|
+
- yarn install --frozen-lockfile
|
|
37
|
+
script:
|
|
38
|
+
- ./check.sh
|
|
39
|
+
${options.genBackCiNotify
|
|
40
|
+
? ` after_script:
|
|
41
|
+
- chmod +x ci-notify.sh
|
|
42
|
+
- >
|
|
43
|
+
if [ $CI_JOB_STATUS != 'success' ]; then
|
|
44
|
+
sh ci-notify.sh "🆘 $CI_JOB_NAME failed"
|
|
45
|
+
else
|
|
46
|
+
sh ci-notify.sh "✅ $CI_JOB_NAME success"
|
|
47
|
+
fi`
|
|
48
|
+
: ''}
|
|
49
|
+
variables:
|
|
50
|
+
DATABASE_MAIN_WRITE_URI: $TEST_DATABASE_MAIN_WRITE_URI
|
|
51
|
+
|
|
52
|
+
tag-previous-with-sha:
|
|
53
|
+
extends: .tag-image
|
|
54
|
+
stage: previous-image
|
|
55
|
+
only:${system.deployEnvironments
|
|
56
|
+
.map((e) => `\n - ${e.branchName}\n - /^${e.branchName}-.*$/`).join('')}
|
|
57
|
+
allow_failure: true # First run won't be able to create previous image
|
|
58
|
+
variables:
|
|
59
|
+
TAG_ORIGIN: :\${CI_COMMIT_REF_SLUG}
|
|
60
|
+
TAG_DESTINATION: :\${CI_COMMIT_REF_SLUG}-previous-for-\${CI_COMMIT_SHA}
|
|
61
|
+
|
|
62
|
+
build:
|
|
63
|
+
stage: build
|
|
64
|
+
image:
|
|
65
|
+
name: gcr.io/kaniko-project/executor:debug
|
|
66
|
+
entrypoint: ['']
|
|
67
|
+
before_script:
|
|
68
|
+
- mkdir -p /kaniko/.docker
|
|
69
|
+
- echo "{\\"auths\\":{\\"$CI_REGISTRY\\":{\\"username\\":\\"$CI_REGISTRY_USER\\",\\"password\\":\\"$CI_REGISTRY_PASSWORD\\"}}}" > /kaniko/.docker/config.json
|
|
70
|
+
# - /kaniko/warmer --cache-dir=$CI_PROJECT_DIR/.cache_images --image=browserless/chrome
|
|
71
|
+
- echo TAG1 "\${CI_COMMIT_REF_SLUG}"
|
|
72
|
+
- echo TAG2 "\${CI_COMMIT_REF_SLUG}-\${CI_COMMIT_SHA}"
|
|
73
|
+
script:
|
|
74
|
+
- /kaniko/executor
|
|
75
|
+
--cache-dir=$CI_PROJECT_DIR/.cache_images
|
|
76
|
+
--context \${CI_PROJECT_DIR}
|
|
77
|
+
--dockerfile \${CI_PROJECT_DIR}/Dockerfile
|
|
78
|
+
--build-arg GIT_COMMIT=\${CI_COMMIT_SHA}
|
|
79
|
+
--destination \${CI_REGISTRY_IMAGE}:\${CI_COMMIT_REF_SLUG}
|
|
80
|
+
--destination \${CI_REGISTRY_IMAGE}:\${CI_COMMIT_REF_SLUG}-\${CI_COMMIT_SHA}
|
|
81
|
+
--single-snapshot
|
|
82
|
+
only:${system.deployEnvironments
|
|
83
|
+
.map((e) => `\n - ${e.branchName}\n - /^${e.branchName}-.*$/`).join('')}
|
|
84
|
+
|
|
85
|
+
tag-latest:
|
|
86
|
+
extends: .tag-image
|
|
87
|
+
stage: latest-image
|
|
88
|
+
only:
|
|
89
|
+
- master
|
|
90
|
+
variables:
|
|
91
|
+
TAG_ORIGIN: master
|
|
92
|
+
TAG_DESTINATION: latest
|
|
93
|
+
|
|
94
|
+
.tag-image:
|
|
95
|
+
image:
|
|
96
|
+
name: gcr.io/go-containerregistry/crane:debug
|
|
97
|
+
entrypoint: ['']
|
|
98
|
+
script:
|
|
99
|
+
- echo TAG_DESTINATION \${TAG_DESTINATION}
|
|
100
|
+
- crane auth login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
101
|
+
- crane cp \${CI_REGISTRY_IMAGE}:\${TAG_ORIGIN} \${CI_REGISTRY_IMAGE}:\${TAG_DESTINATION}
|
|
102
|
+
variables:
|
|
103
|
+
GIT_STRATEGY: none
|
|
104
|
+
|
|
105
|
+
${system.deployEnvironments
|
|
106
|
+
.map((e) => `deploy-${e.name}-back:
|
|
107
|
+
extends: .deploy-${e.name}-back
|
|
108
|
+
stage: deploy
|
|
109
|
+
variables:
|
|
110
|
+
ENV: "${e.name}"
|
|
111
|
+
CLUSTER_NAME: "${e.clusterName}"
|
|
112
|
+
TAG: ":\${CI_COMMIT_REF_SLUG}-\${CI_COMMIT_SHA}"
|
|
113
|
+
only:
|
|
114
|
+
- ${e.branchName}
|
|
115
|
+
- /^${e.branchName}-.*$/`)
|
|
116
|
+
.join('\n\n')
|
|
117
|
+
.trim()}${system.workers.length > 0
|
|
118
|
+
? '\n\n' +
|
|
119
|
+
system.deployEnvironments
|
|
120
|
+
.map((e) => `deploy-${e.name}-workers:
|
|
121
|
+
extends: .deploy-${e.name}-workers
|
|
122
|
+
stage: deploy
|
|
123
|
+
variables:
|
|
124
|
+
ENV: "${e.name}"
|
|
125
|
+
CLUSTER_NAME: "workers-${e.clusterName}"
|
|
126
|
+
TAG: ":\${CI_COMMIT_REF_SLUG}-\${CI_COMMIT_SHA}"
|
|
127
|
+
only:
|
|
128
|
+
- ${e.branchName}
|
|
129
|
+
- /^${e.branchName}-.*$/
|
|
130
|
+
|
|
131
|
+
deploy-${e.name}-bots:
|
|
132
|
+
extends: .deploy-${e.name}-bots
|
|
133
|
+
stage: deploy
|
|
134
|
+
variables:
|
|
135
|
+
ENV: "${e.name}"
|
|
136
|
+
CLUSTER_NAME: "${e.clusterName}"
|
|
137
|
+
TAG: ":\${CI_COMMIT_REF_SLUG}-\${CI_COMMIT_SHA}"
|
|
138
|
+
only:
|
|
139
|
+
- ${e.branchName}
|
|
140
|
+
- /^${e.branchName}-.*$/`)
|
|
141
|
+
.join('\n\n')
|
|
142
|
+
.trim()
|
|
143
|
+
: ''}
|
|
144
|
+
|
|
145
|
+
${system.deployEnvironments
|
|
146
|
+
.map((e) => `.deploy-${e.name}-back:
|
|
147
|
+
extends:
|
|
148
|
+
- .deploy-${e.name}
|
|
149
|
+
- .deploy-back
|
|
150
|
+
variables:
|
|
151
|
+
KUBE_CONFIG: \${KUBE_${e.clusterName.toUpperCase()}_CONFIG}
|
|
152
|
+
BACK_ENABLED: "true"
|
|
153
|
+
INGRESS_ENABLED: "true"
|
|
154
|
+
METRICS_ENABLED: "${e.metricsEnabled.toString()}"
|
|
155
|
+
WORKER_ENABLED: "false"
|
|
156
|
+
BOT_ENABLED: "false"
|
|
157
|
+
ROOT_ENABLED: "${e.main}"
|
|
158
|
+
|
|
159
|
+
.deploy-${e.name}-workers:
|
|
160
|
+
extends:
|
|
161
|
+
- .deploy-${e.name}
|
|
162
|
+
- .deploy-worker
|
|
163
|
+
variables:
|
|
164
|
+
KUBE_CONFIG: \${KUBE_${e.clusterName.toUpperCase()}_CONFIG}
|
|
165
|
+
BACK_ENABLED: "false"
|
|
166
|
+
INGRESS_ENABLED: "false"
|
|
167
|
+
METRICS_ENABLED: "false"
|
|
168
|
+
WORKER_ENABLED: "true"
|
|
169
|
+
BOT_ENABLED: "false"
|
|
170
|
+
ROOT_ENABLED: "false"
|
|
171
|
+
|
|
172
|
+
.deploy-${e.name}-bots:
|
|
173
|
+
extends:
|
|
174
|
+
- .deploy-${e.name}
|
|
175
|
+
- .deploy-bot
|
|
176
|
+
variables:
|
|
177
|
+
KUBE_CONFIG: \${KUBE_${e.clusterName.toUpperCase()}_CONFIG}
|
|
178
|
+
BACK_ENABLED: "false"
|
|
179
|
+
INGRESS_ENABLED: "false"
|
|
180
|
+
METRICS_ENABLED: "false"
|
|
181
|
+
WORKER_ENABLED: "false"
|
|
182
|
+
BOT_ENABLED: "true"
|
|
183
|
+
ROOT_ENABLED: "false"`).join('\n\n')}
|
|
184
|
+
|
|
185
|
+
${system.deployEnvironments
|
|
186
|
+
.map((e) => `.deploy-${e.name}:
|
|
187
|
+
extends: .deploy
|
|
188
|
+
stage: deploy
|
|
189
|
+
when: ${e.manualDeploy ? 'manual' : 'on_success'}
|
|
190
|
+
only:
|
|
191
|
+
- ${e.branchName}
|
|
192
|
+
- /^${e.branchName}-.*$/
|
|
193
|
+
tags:
|
|
194
|
+
- ${e.runnerTag}
|
|
195
|
+
variables:
|
|
196
|
+
ENV: "${e.name}"
|
|
197
|
+
DEV: "false"
|
|
198
|
+
HOST: "${e.host}"
|
|
199
|
+
ROOT_ENABLED: "${e.main}"
|
|
200
|
+
TAG: ":\${CI_COMMIT_REF_SLUG}-\${CI_COMMIT_SHA}"${system.configVars
|
|
201
|
+
.filter((v) => v.scopes.includes('back') || v.scopes.includes('ci'))
|
|
202
|
+
.map((v) => `\n ${(0, change_case_1.constantCase)(v.name)}: \${${e.gitlabEnvPrefix.toUpperCase()}_${(0, change_case_1.constantCase)(v.name)}}`)
|
|
203
|
+
.join('')}`).join('\n\n')}
|
|
204
|
+
|
|
205
|
+
.deploy-back:
|
|
206
|
+
variables:
|
|
207
|
+
DEPLOY_KIND: "back"
|
|
208
|
+
FLUENTD_ENABLED: "true"
|
|
209
|
+
PROMETHEUS_RULES_ENABLED: "true"
|
|
210
|
+
HELM_ENV: ""
|
|
211
|
+
|
|
212
|
+
.deploy-worker:
|
|
213
|
+
variables:
|
|
214
|
+
DEPLOY_KIND: "worker"
|
|
215
|
+
FLUENTD_ENABLED: "false"
|
|
216
|
+
PROMETHEUS_RULES_ENABLED: "false"
|
|
217
|
+
HELM_ENV: "--set mountebank.enabled=${options.mountebankEnabled} --set exportHtml.enabled=${options.exportHtmlEnabled}"
|
|
218
|
+
|
|
219
|
+
.deploy-bot:
|
|
220
|
+
variables:
|
|
221
|
+
DEPLOY_KIND: "bot"
|
|
222
|
+
FLUENTD_ENABLED: "false"
|
|
223
|
+
PROMETHEUS_RULES_ENABLED: "false"
|
|
224
|
+
HELM_ENV: ""
|
|
225
|
+
|
|
226
|
+
.deploy:
|
|
227
|
+
image:
|
|
228
|
+
name: alpine/helm:3.13.1
|
|
229
|
+
entrypoint: [""]
|
|
230
|
+
before_script:
|
|
231
|
+
- mkdir -p /etc/deploy
|
|
232
|
+
- cp $KUBE_CONFIG $KUBECONFIG
|
|
233
|
+
script:
|
|
234
|
+
- NAMESPACE=\${NAMESPACE:-"${options.k8sNamespacePrefix || prefix}-\${ENV}"}
|
|
235
|
+
- echo TAG \${TAG}
|
|
236
|
+
- echo NAMESPACE \${NAMESPACE}
|
|
237
|
+
- echo chart \${NAMESPACE}-\${DEPLOY_KIND}
|
|
238
|
+
|
|
239
|
+
- helm upgrade
|
|
240
|
+
--install
|
|
241
|
+
--wait \${NAMESPACE}-\${DEPLOY_KIND} chart
|
|
242
|
+
--timeout 3600s
|
|
243
|
+
-f chart/values_\${ENV}.yaml
|
|
244
|
+
\${HELM_ENV}
|
|
245
|
+
--namespace \${NAMESPACE}
|
|
246
|
+
--create-namespace
|
|
247
|
+
--set "global.projectName=\${PROJECT_NAME}"
|
|
248
|
+
--set "global.clusterName=\${CLUSTER_NAME}"
|
|
249
|
+
--set "global.env=\${ENV}"
|
|
250
|
+
--set "global.deployKind=\${DEPLOY_KIND}"
|
|
251
|
+
--set "app.tag=\${TAG}"
|
|
252
|
+
--set "ingress.host=\${HOST}"
|
|
253
|
+
--set "style=\${STYLE}"
|
|
254
|
+
--set "back.enabled=\${BACK_ENABLED}"
|
|
255
|
+
--set "ingress.enabled=\${INGRESS_ENABLED}"
|
|
256
|
+
--set "metrics.enabled=\${METRICS_ENABLED}"
|
|
257
|
+
--set "worker.enabled=\${WORKER_ENABLED}"
|
|
258
|
+
--set "bot.enabled=\${BOT_ENABLED}"
|
|
259
|
+
--set "fluentd.enabled=\${FLUENTD_ENABLED}"
|
|
260
|
+
--set "prometheus.rules.enabled=\${PROMETHEUS_RULES_ENABLED}"
|
|
261
|
+
--set "ingress.rootEnabled=\${ROOT_ENABLED}"${system.configVars
|
|
262
|
+
.filter((v) => v.scopes.includes('back') || v.scopes.includes('ci'))
|
|
263
|
+
.map((v) => `\n --set "${v.name}=\${${(0, change_case_1.constantCase)(v.name)}}"`)
|
|
264
|
+
.join('')}
|
|
265
|
+
${options.genBackCiNotify
|
|
266
|
+
? ` after_script:
|
|
267
|
+
- >
|
|
268
|
+
if [ $CI_JOB_STATUS != 'success' ]; then
|
|
269
|
+
sh ci-notify.sh "🆘 $CI_JOB_NAME failed"
|
|
270
|
+
else
|
|
271
|
+
sh ci-notify.sh "✅ $CI_JOB_NAME success"
|
|
272
|
+
fi`
|
|
273
|
+
: ''}
|
|
274
|
+
`;
|
|
40
275
|
exports.gitlabCiTmpl = gitlabCiTmpl;
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
276
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2l0bGFiQ2kuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvcHJvamVjdHNHZW5lcmF0aW9uL2dlbmVyYXRvcnMvZmlsZVRlbXBsYXRlcy9iYWNrL2Vudmlyb25tZW50L2dpdGxhYkNpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDZDQUEwQztBQUUxQyw2Q0FBb0Q7QUFFN0MsTUFBTSxZQUFZLEdBQUcsQ0FBQyxFQUMzQixNQUFNLEVBQUUsRUFBRSxNQUFNLEVBQUUsRUFDbEIsTUFBTSxFQUNOLE9BQU8sR0FDbUIsRUFBRSxFQUFFLENBQUM7RUFFL0IsT0FBTyxDQUFDLDBCQUEwQjtJQUNoQyxDQUFDLENBQUMsRUFBRTtJQUNKLENBQUMsQ0FBQztJQUNGLHdCQUFnQjtDQUVwQjs7Ozs7Ozs7Ozs7Ozs7Ozs7OztrQkFtQmtCLE1BQU0sQ0FBQyxJQUFJOzs7Ozs7Ozs7RUFVM0IsT0FBTyxDQUFDLGVBQWU7SUFDekIsQ0FBQyxDQUFDOzs7Ozs7O1NBT087SU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FFLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDbkUsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDLElBQUksT0FBTyxJQUFBLDBCQUFZLEVBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUM7S0FDbkUsSUFBSSxDQUFDLEVBQUUsQ0FBQztFQUVmLE9BQU8sQ0FBQyxlQUFlO0lBQ3pCLENBQUMsQ0FBQzs7Ozs7O1NBTU87SUFDVCxDQUFDLENBQUMsRUFDRjtDQUNDLENBQUE7QUE3UlksUUFBQSxZQUFZLGdCQTZSeEIifQ==
|
package/build/projectsGeneration/generators/fileTemplates/back/environment/src/clients/getPrisma.js
CHANGED
|
@@ -1,13 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prismaGetterTmpl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const types_1 = require("../../../../../../types");
|
|
5
|
+
const utils_1 = require("../../../../../../utils");
|
|
6
|
+
const prismaGetterTmpl = (options = types_1.defaultBootstrapEntityOptions) => `import {PrismaClient} from '@prisma/client';
|
|
7
|
+
import {getConfig} from '../config';
|
|
8
|
+
import log from '../log';
|
|
9
|
+
import {addParamsToDatabaseUri} from '../utils/addParamsToPgUri';
|
|
10
|
+
${options.skipWarningThisIsGenerated
|
|
11
|
+
? ''
|
|
12
|
+
: `
|
|
13
|
+
// ${utils_1.generatedWarning}
|
|
14
|
+
`}
|
|
15
|
+
let prisma: PrismaClient | null = null;
|
|
16
|
+
|
|
17
|
+
export const getPrisma = async (connectionType: 'write' | 'readOnly') => {
|
|
18
|
+
const {
|
|
19
|
+
databaseMainWriteUri,
|
|
20
|
+
databaseMainReadOnlyUri,
|
|
21
|
+
databaseMainReadOnlyEnabled,
|
|
22
|
+
} = await getConfig();
|
|
23
|
+
|
|
24
|
+
let uri: string;
|
|
25
|
+
|
|
26
|
+
if (connectionType === 'write') {
|
|
27
|
+
uri = databaseMainWriteUri;
|
|
28
|
+
} else {
|
|
29
|
+
if (!databaseMainReadOnlyEnabled) {
|
|
30
|
+
const msg = 'Read only database connection cannot be used with the database.main.readOnly.enabled is not true';
|
|
31
|
+
return new Proxy({} as any, {
|
|
32
|
+
get(_target: PrismaClient, property: string | symbol) {
|
|
33
|
+
if (property === 'then') {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (property === '$disconnect') {
|
|
38
|
+
return () => log.info('noop $disconnect');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
log.error(\`get: \${property.toString()}\`);
|
|
42
|
+
|
|
43
|
+
log.error(msg);
|
|
44
|
+
throw new Error(msg);
|
|
45
|
+
},
|
|
46
|
+
apply: () => {
|
|
47
|
+
log.error('apply');
|
|
48
|
+
log.error(msg);
|
|
49
|
+
throw new Error(msg);
|
|
50
|
+
},
|
|
51
|
+
}) as PrismaClient;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!databaseMainReadOnlyUri) {
|
|
55
|
+
throw new Error('database.main.readOnly.uri must be set');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
uri = databaseMainReadOnlyUri;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
log.info(typeof addParamsToDatabaseUri);
|
|
62
|
+
|
|
63
|
+
// const url = addParamsToDatabaseUri(databaseMainWriteUri, {
|
|
64
|
+
// application_name: appName,
|
|
65
|
+
// ...(process.env.NODE_ENV === 'production' ? {} : {connection_limit: '1'}),
|
|
66
|
+
// });
|
|
67
|
+
|
|
68
|
+
if (!prisma) {
|
|
69
|
+
prisma = new PrismaClient({
|
|
70
|
+
datasources: {
|
|
71
|
+
db: {
|
|
72
|
+
url: uri,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return prisma;
|
|
79
|
+
};
|
|
80
|
+
`;
|
|
12
81
|
exports.prismaGetterTmpl = prismaGetterTmpl;
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
82
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0UHJpc21hLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL3Byb2plY3RzR2VuZXJhdGlvbi9nZW5lcmF0b3JzL2ZpbGVUZW1wbGF0ZXMvYmFjay9lbnZpcm9ubWVudC9zcmMvY2xpZW50cy9nZXRQcmlzbWEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbURBR2dDO0FBQ2hDLG1EQUEwRDtBQUVuRCxNQUFNLGdCQUFnQixHQUFHLENBQzlCLFVBQWtDLHFDQUE2QixFQUMvRCxFQUFFLENBQUM7Ozs7RUFLSCxPQUFPLENBQUMsMEJBQTBCO0lBQ2hDLENBQUMsQ0FBQyxFQUFFO0lBQ0osQ0FBQyxDQUFDO0tBQ0Qsd0JBQWdCO0NBRXJCOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FrRUMsQ0FBQTtBQTlFWSxRQUFBLGdCQUFnQixvQkE4RTVCIn0=
|
|
@@ -1,13 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getQueueTmpl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const types_1 = require("../../../../../../../types");
|
|
5
|
+
const utils_1 = require("../../../../../../../utils");
|
|
6
|
+
const getQueueTmpl = (options = types_1.defaultBootstrapEntityOptions) => `import {getConfig} from '../../config';
|
|
7
|
+
import {makeWorkerUtils, WorkerUtils} from 'graphile-worker';
|
|
8
|
+
import log from '../../log';
|
|
9
|
+
import {addParamsToDatabaseUri} from '../../utils/addParamsToPgUri';
|
|
10
|
+
${options.skipWarningThisIsGenerated
|
|
11
|
+
? ''
|
|
12
|
+
: `
|
|
13
|
+
// ${utils_1.generatedWarning}
|
|
14
|
+
`}
|
|
15
|
+
let queue: WorkerUtils | null = null;
|
|
16
|
+
|
|
17
|
+
const getQueue = async () => {
|
|
18
|
+
if (!queue) {
|
|
19
|
+
const {databaseMainWriteUri} = await getConfig();
|
|
20
|
+
|
|
21
|
+
log.info(typeof addParamsToDatabaseUri);
|
|
22
|
+
|
|
23
|
+
// const url = addParamsToDatabaseUri(databaseMainWriteUri, {
|
|
24
|
+
// application_name: appName,
|
|
25
|
+
// ...(process.env.NODE_ENV === 'production' ? {} : {connection_limit: '1'}),
|
|
26
|
+
// });
|
|
27
|
+
|
|
28
|
+
const workerUtils = await makeWorkerUtils({
|
|
29
|
+
connectionString: databaseMainWriteUri,
|
|
30
|
+
noPreparedStatements: true,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (queue) {
|
|
34
|
+
workerUtils.release();
|
|
35
|
+
} else {
|
|
36
|
+
queue = workerUtils;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return queue;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default getQueue;
|
|
44
|
+
`;
|
|
12
45
|
exports.getQueueTmpl = getQueueTmpl;
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0UXVldWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvcHJvamVjdHNHZW5lcmF0aW9uL2dlbmVyYXRvcnMvZmlsZVRlbXBsYXRlcy9iYWNrL2Vudmlyb25tZW50L3NyYy9jbGllbnRzL3F1ZXVlL2dldFF1ZXVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHNEQUdtQztBQUNuQyxzREFBNkQ7QUFFdEQsTUFBTSxZQUFZLEdBQUcsQ0FDMUIsVUFBa0MscUNBQTZCLEVBQy9ELEVBQUUsQ0FBQzs7OztFQUtILE9BQU8sQ0FBQywwQkFBMEI7SUFDaEMsQ0FBQyxDQUFDLEVBQUU7SUFDSixDQUFDLENBQUM7S0FDRCx3QkFBZ0I7Q0FFckI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztDQThCQyxDQUFBO0FBMUNZLFFBQUEsWUFBWSxnQkEwQ3hCIn0=
|
|
@@ -1,13 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.environmentIndexTmpl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const types_1 = require("../../../../../types");
|
|
5
|
+
const utils_1 = require("../../../../../utils");
|
|
6
|
+
const environmentIndexTmpl = (options = types_1.defaultBootstrapEntityOptions) => `import log from './log';
|
|
7
|
+
import {createContext} from './adm/services/context';
|
|
8
|
+
import express from 'express';
|
|
9
|
+
import defaultContainer from './adm/services/defaultContainer';
|
|
10
|
+
import initEndpoints from './initEndpoints';
|
|
11
|
+
${options.skipWarningThisIsGenerated
|
|
12
|
+
? ''
|
|
13
|
+
: `
|
|
14
|
+
// ${utils_1.generatedWarning}
|
|
15
|
+
`}
|
|
16
|
+
const app = express();
|
|
17
|
+
|
|
18
|
+
const start = async () => {
|
|
19
|
+
const ctx = await createContext(defaultContainer);
|
|
20
|
+
const port = 3000;
|
|
21
|
+
|
|
22
|
+
const production = process.env.NODE_ENV === 'production';
|
|
23
|
+
log.info(\`production: \${production}\`);
|
|
24
|
+
|
|
25
|
+
const endpoints = await initEndpoints(app, ctx, port, production);
|
|
26
|
+
|
|
27
|
+
app.listen({port}, () => {
|
|
28
|
+
log.info('\\n' + endpoints.map(e => \`🚀 Server ready at \${e}\`).join('\\n'));
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
start().catch(error => {
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
console.error(error);
|
|
35
|
+
|
|
36
|
+
throw error;
|
|
37
|
+
});
|
|
38
|
+
`;
|
|
12
39
|
exports.environmentIndexTmpl = environmentIndexTmpl;
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvcHJvamVjdHNHZW5lcmF0aW9uL2dlbmVyYXRvcnMvZmlsZVRlbXBsYXRlcy9iYWNrL2Vudmlyb25tZW50L3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxnREFHNkI7QUFDN0IsZ0RBQXVEO0FBRWhELE1BQU0sb0JBQW9CLEdBQUcsQ0FDbEMsVUFBa0MscUNBQTZCLEVBQy9ELEVBQUUsQ0FBQzs7Ozs7RUFNSCxPQUFPLENBQUMsMEJBQTBCO0lBQ2hDLENBQUMsQ0FBQyxFQUFFO0lBQ0osQ0FBQyxDQUFDO0tBQ0Qsd0JBQWdCO0NBRXJCOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztDQXVCQyxDQUFBO0FBcENZLFFBQUEsb0JBQW9CLHdCQW9DaEMifQ==
|
|
@@ -1,9 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const change_case_1 = require("change-case");
|
|
4
|
+
const backIntegrationClientTmpl = (_, client) => {
|
|
5
|
+
return `import axios, {AxiosInstance} from 'axios';
|
|
6
|
+
import log from '../../log';
|
|
7
|
+
import {
|
|
8
|
+
${client.queryMethods.map(m => ` ${(0, change_case_1.pascalCase)(m.name)}Args,
|
|
9
|
+
${(0, change_case_1.pascalCase)(m.name)}Result,`).join('\n')}
|
|
10
|
+
I${(0, change_case_1.pascalCase)(client.name)}Client,
|
|
11
|
+
} from './types';
|
|
12
|
+
import {
|
|
13
|
+
ClientAfterRequestArgs,
|
|
14
|
+
ClientBeforeRequestArgs,
|
|
15
|
+
ClientOnErrorArgs,
|
|
16
|
+
} from '../hooksTypes';
|
|
17
|
+
import {Context} from '../../adm/services/types';
|
|
18
|
+
import IntegrationClient from '../IntegrationClient';
|
|
19
|
+
|
|
20
|
+
class ${(0, change_case_1.pascalCase)(client.name)}Client extends IntegrationClient implements I${(0, change_case_1.pascalCase)(client.name)}Client {
|
|
21
|
+
protected ax: AxiosInstance;
|
|
22
|
+
|
|
23
|
+
constructor(ctx: Context) {
|
|
24
|
+
super(ctx);
|
|
25
|
+
|
|
26
|
+
this.ax = axios.create();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
protected async beforeRequest(_args: ClientBeforeRequestArgs) {
|
|
30
|
+
log.info(\`!!!!!! beforeRequest, managers count: \${await this.ctx.service('managers').count()}\`);
|
|
31
|
+
// log.info(args);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
protected async afterRequest(_args: ClientAfterRequestArgs) {
|
|
35
|
+
log.info(\`!!!!!! afterRequest, managers count: \${await this.ctx.service('managers').count()}\`);
|
|
36
|
+
// log.info(args);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected async onError(_args: ClientOnErrorArgs) {
|
|
40
|
+
log.info(\`!!!!!! onError, managers count: \${await this.ctx.service('managers').count()}\`);
|
|
41
|
+
// log.info(args);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
${client.queryMethods.map(m => ` async ${m.name}(args: ${(0, change_case_1.pascalCase)(m.name)}Args): Promise<${(0, change_case_1.pascalCase)(m.name)}Result> {
|
|
45
|
+
log.info(args);
|
|
46
|
+
|
|
47
|
+
if (Math.random() < 0.5) {
|
|
48
|
+
throw new Error('Some error');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return this.ax.get('https://jsonplaceholder.typicode.com/users')
|
|
52
|
+
.then(result => result.data as ${(0, change_case_1.pascalCase)(m.name)}Result);
|
|
53
|
+
}`).join('\n\n')}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default ${(0, change_case_1.pascalCase)(client.name)}Client;
|
|
57
|
+
`;
|
|
7
58
|
};
|
|
8
59
|
exports.default = backIntegrationClientTmpl;
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW50ZWdyYXRpb25DbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvcHJvamVjdHNHZW5lcmF0aW9uL2dlbmVyYXRvcnMvZmlsZVRlbXBsYXRlcy9iYWNrL2Vudmlyb25tZW50L3NyYy9pbnRlZ3JhdGlvbkNsaWVudHMvSW50ZWdyYXRpb25DbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw2Q0FBc0M7QUFJdEMsTUFBTSx5QkFB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