├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── Todo.md ├── docs ├── debug-tcwebhooks.xml ├── icons │ ├── FFFFFF-0.png │ ├── buildFailed@2x.png │ ├── buildSuccessful@2x.png │ ├── favicon32x32.png │ ├── jetbrains-teamcity-logo.png │ ├── redSign@2x.png │ ├── teamcity-logo-128x128.png │ ├── teamcity-logo-256x256.png │ ├── teamcity-logo-48x48.png │ ├── teamcity-logo-64x64.png │ └── teamcity.svg └── images │ ├── Screenshot_AddWebHook_01_ViewBuilds.png │ ├── Screenshot_AddWebHook_02_ChooseWhichProject.png │ ├── Screenshot_AddWebHook_03_ClickCreate.png │ ├── Screenshot_AddWebHook_04_ConfigureUrlFormatAndEvents.png │ ├── Screenshot_AddWebHook_05_SelectProjectsAndBuilds.png │ ├── Screenshot_AddWebHook_06_Authentication.png │ ├── Screenshot_AddWebHook_07_PreviewPayloadContent.png │ ├── Screenshot_AdminTab_StatsAndErrors.png │ ├── Screenshot_EditWebHook_01_ConfigureURLFormatandEvents.png │ ├── Screenshot_EditWebHook_02_SelectBuilds.png │ ├── Screenshot_EditWebHook_03_Authentication.png │ ├── Screenshot_EditWebHook_04_PreviewPayloadContent.png │ ├── Screenshot_Edit_Build_Event_Template.png │ ├── Screenshot_Edit_Project_Settings.png │ ├── Screenshot_EndPointViewer.png │ ├── Screenshot_REST_API_JAXB_01.png │ ├── Screenshot_REST_API_JAXB_02.png │ ├── Screenshot_REST_API_JAXB_03.png │ ├── Screenshot_Template_preview_and_execute.png │ ├── Screenshot_Templates_AddNewTemplate01.png │ ├── Screenshot_Templates_AddNewTemplate02.png │ ├── Screenshot_Templates_CopyTemplate.png │ ├── Screenshot_Templates_EditBuildEventTemplate.png │ ├── Screenshot_Templates_ListTemplates.png │ ├── Screenshot_Templates_TemplateMenu.png │ ├── Screenshot_Templates_ViewTemplate.png │ ├── Screenshot_project_webhook_history.png │ ├── Screenshot_webhook_admin_screen.png │ ├── Screenshot_webhook_editauth.png │ ├── Screenshot_webhook_history_errored.png │ ├── Screenshot_webhooks_rest_api_admin_page.png │ ├── Screenshot_webhooks_test_endpoint_viewer.png │ ├── WebHookBuildStatisticsTimeline.drawio │ └── WebHookBuildStatisticsTimeline.svg ├── pom.xml ├── readme.md ├── sonar-project.properties ├── tcwebhooks-core ├── .gitignore ├── local-mvn-repo │ ├── com │ │ └── riffpie │ │ │ ├── common │ │ │ └── testing │ │ │ │ └── jersey-test-support │ │ │ │ └── 1.0 │ │ │ │ ├── jersey-test-support-1.0-sources.jar │ │ │ │ ├── jersey-test-support-1.0.jar │ │ │ │ └── jersey-test-support-1.0.pom │ │ │ └── parent │ │ │ └── riffpie-parent │ │ │ └── 1.2 │ │ │ └── riffpie-parent-1.2.pom │ └── org │ │ └── jetbrains │ │ └── teamcity │ │ ├── common-impl │ │ ├── 10.0 │ │ │ ├── common-impl-10.0.jar │ │ │ └── common-impl-10.0.pom │ │ ├── 2018.2.1 │ │ │ ├── common-impl-2018.2.1.jar │ │ │ └── common-impl-2018.2.1.pom │ │ ├── 9.1.7 │ │ │ ├── common-impl-9.1.7.jar │ │ │ └── common-impl-9.1.7.pom │ │ └── 9.1 │ │ │ ├── common-impl-9.1.jar │ │ │ └── common-impl-9.1.pom │ │ └── server │ │ ├── 2018.2.1 │ │ ├── server-2018.2.1.jar │ │ └── server-2018.2.1.pom │ │ └── 2018.2 │ │ ├── server-2018.2.jar │ │ └── server-2018.2.pom ├── pom.xml └── src │ ├── docs │ ├── images │ │ ├── FFFFFF-0.png │ │ ├── TeamCity.png │ │ ├── buildFailed@2x.png │ │ ├── buildSuccessful@2x.png │ │ └── redSign@2x.png │ └── screenshots │ │ └── tcwebhooks-Flowdock_example_output.png │ ├── main │ ├── java │ │ └── webhook │ │ │ ├── CommonUtils.java │ │ │ ├── Constants.java │ │ │ ├── WebHook.java │ │ │ ├── WebHookExecutionStats.java │ │ │ ├── WebHookImpl.java │ │ │ ├── WebHookParameterReferenceException.java │ │ │ ├── WebHookProxyConfig.java │ │ │ └── teamcity │ │ │ ├── BuildState.java │ │ │ ├── BuildStateEnum.java │ │ │ ├── BuildStateInterface.java │ │ │ ├── BuildTypeIdResolver.java │ │ │ ├── DeferrableService.java │ │ │ ├── DeferrableServiceManager.java │ │ │ ├── DeferrableServiceManagerImpl.java │ │ │ ├── Loggers.java │ │ │ ├── ProbableJaxbJarConflictErrorException.java │ │ │ ├── ProjectAndBuildTypeResolverImpl.java │ │ │ ├── ProjectIdResolver.java │ │ │ ├── SimpleBuildState.java │ │ │ ├── TeamCityCoreFacade.java │ │ │ ├── TeamCityCoreFacadeImpl.java │ │ │ ├── TeamCityIdResolver.java │ │ │ ├── WebHookContentBuilder.java │ │ │ ├── WebHookContentResolutionException.java │ │ │ ├── WebHookExecutionException.java │ │ │ ├── WebHookFactory.java │ │ │ ├── WebHookFactoryImpl.java │ │ │ ├── WebHookHttpClientFactory.java │ │ │ ├── WebHookHttpClientFactoryImpl.java │ │ │ ├── WebHookHttpExecutionException.java │ │ │ ├── WebHookHttpResponseException.java │ │ │ ├── WebHookListener.java │ │ │ ├── WebHookPluginDataResolver.java │ │ │ ├── WebHookPluginDataResolverImpl.java │ │ │ ├── WebHookServiceMessageHandler.java │ │ │ ├── WebHookSettingsEventHandler.java │ │ │ ├── WebHookSettingsEventType.java │ │ │ ├── WebHookTemplateParsingException.java │ │ │ ├── auth │ │ │ ├── AbstractWebHookAuthenticator.java │ │ │ ├── AbstractWebHookAuthenticatorFactory.java │ │ │ ├── WebHookAuthConfig.java │ │ │ ├── WebHookAuthenticationParameter.java │ │ │ ├── WebHookAuthenticator.java │ │ │ ├── WebHookAuthenticatorFactory.java │ │ │ ├── WebHookAuthenticatorProvider.java │ │ │ ├── basic │ │ │ │ ├── UsernamePasswordAuthenticator.java │ │ │ │ └── UsernamePasswordAuthenticatorFactory.java │ │ │ ├── bearer │ │ │ │ ├── BearerAuthSchemeFactory.java │ │ │ │ ├── BearerAuthenticator.java │ │ │ │ ├── BearerAuthenticatorFactory.java │ │ │ │ └── TokenCredentials.java │ │ │ └── ntlm │ │ │ │ ├── NtlmAuthenticator.java │ │ │ │ └── NtlmAuthenticatorFactory.java │ │ │ ├── endpoint │ │ │ ├── WebHookEndPointContentStore.java │ │ │ └── WebHookEndPointPayload.java │ │ │ ├── exception │ │ │ ├── NonExistantProjectException.java │ │ │ ├── OperationUnsupportedException.java │ │ │ └── StatisticsFileOperationException.java │ │ │ ├── executor │ │ │ ├── AbstractWebHookExecutor.java │ │ │ ├── BuildEventWebHookRunner.java │ │ │ ├── QueuedBuildWebHookRunner.java │ │ │ ├── ResponsibilityChangedWebHookRunner.java │ │ │ ├── StatisticsReporterWebHookRunner.java │ │ │ ├── TestsMutingWebHookRunner.java │ │ │ ├── WebHookExecutor.java │ │ │ ├── WebHookExecutorManager.java │ │ │ ├── WebHookResponsibilityHolder.java │ │ │ ├── WebHookRunner.java │ │ │ ├── WebHookRunnerFactory.java │ │ │ ├── WebHookSerialExecutor.java │ │ │ ├── WebHookSerialExecutorImpl.java │ │ │ ├── WebHookStatisticsExecutor.java │ │ │ ├── WebHookThreadingExecutor.java │ │ │ ├── WebHookThreadingExecutorFactory.java │ │ │ ├── WebHookThreadingExecutorFactoryImpl.java │ │ │ └── WebHookThreadingExecutorImpl.java │ │ │ ├── history │ │ │ ├── GeneralisedWebAddress.java │ │ │ ├── GeneralisedWebAddressType.java │ │ │ ├── MaxSizeHashMap.java │ │ │ ├── PagedList.java │ │ │ ├── WebAddressTransformer.java │ │ │ ├── WebAddressTransformerImpl.java │ │ │ ├── WebHookHistoryItem.java │ │ │ ├── WebHookHistoryItemFactory.java │ │ │ ├── WebHookHistoryItemFactoryImpl.java │ │ │ ├── WebHookHistoryRepository.java │ │ │ └── WebHookHistoryRepositoryImpl.java │ │ │ ├── jaxb │ │ │ ├── DateMidnightAdapter.java │ │ │ ├── DateTimeAdapter.java │ │ │ ├── LocalDateAdapter.java │ │ │ ├── LocalDateTimeAdapter.java │ │ │ └── LocalTimeAdapter.java │ │ │ ├── payload │ │ │ ├── PayloadTemplateEngineType.java │ │ │ ├── UnsupportedWebHookFormatException.java │ │ │ ├── WebHookBuildProblemInfo.java │ │ │ ├── WebHookContentObjectSerialiser.java │ │ │ ├── WebHookPayload.java │ │ │ ├── WebHookPayloadDefaultTemplates.java │ │ │ ├── WebHookPayloadManager.java │ │ │ ├── WebHookPayloadRankingComparator.java │ │ │ ├── WebHookPayloadTemplate.java │ │ │ ├── WebHookResponsibility.java │ │ │ ├── WebHookTemplateContent.java │ │ │ ├── WebHookTemplateFileChangeHandler.java │ │ │ ├── WebHookTemplateManager.java │ │ │ ├── WebHookTemplateRankingComparator.java │ │ │ ├── WebHookTemplateResolver.java │ │ │ ├── content │ │ │ │ ├── ExtraParameters.java │ │ │ │ ├── WebHookPayloadContent.java │ │ │ │ ├── WebHookPayloadContentAssemblyException.java │ │ │ │ ├── WebHookResponsibilityEntry.java │ │ │ │ ├── WebHooksBranchImpl.java │ │ │ │ ├── WebHooksChange.java │ │ │ │ ├── WebHooksChangeBuilder.java │ │ │ │ ├── WebHooksChanges.java │ │ │ │ └── WebHooksComment.java │ │ │ ├── convertor │ │ │ │ ├── ExtraParametersMapToJsonConvertor.java │ │ │ │ ├── ExtraParametersMapToXmlConvertor.java │ │ │ │ ├── SuperclassExclusionStrategy.java │ │ │ │ └── UserSingleValueConverter.java │ │ │ ├── format │ │ │ │ ├── WebHookPayloadEmpty.java │ │ │ │ ├── WebHookPayloadGeneric.java │ │ │ │ ├── WebHookPayloadJson.java │ │ │ │ ├── WebHookPayloadJsonTemplate.java │ │ │ │ ├── WebHookPayloadJsonVelocityTemplate.java │ │ │ │ ├── WebHookPayloadNameValuePairs.java │ │ │ │ ├── WebHookPayloadNameValuePairsTemplate.java │ │ │ │ ├── WebHookPayloadNameValuePairsVelocityTemplate.java │ │ │ │ ├── WebHookPayloadTailoredJson.java │ │ │ │ ├── WebHookPayloadXml.java │ │ │ │ ├── WebHookPayloadXmlTemplate.java │ │ │ │ └── WebHookPayloadXmlVelocityTemplate.java │ │ │ ├── template │ │ │ │ ├── AbstractWebHookTemplate.java │ │ │ │ ├── AbstractXmlBasedWebHookTemplate.java │ │ │ │ ├── DiscordComXmlWebHookTemplate.java │ │ │ │ ├── ElasticSearchXmlWebHookTemplate.java │ │ │ │ ├── FlowdockXmlWebHookTemplate.java │ │ │ │ ├── LegacyDeprecatedFormatWebHookTemplate.java │ │ │ │ ├── LegacyEmptyWebHookTemplate.java │ │ │ │ ├── LegacyJsonWebHookTemplate.java │ │ │ │ ├── LegacyNameValuePairsWebHookTemplate.java │ │ │ │ ├── LegacyTailoredJsonWebHookTemplate.java │ │ │ │ ├── LegacyXmlWebHookTemplate.java │ │ │ │ ├── MicrosftTeams01XmlWebHookTemplate.java │ │ │ │ ├── MicrosftTeams02XmlWebHookTemplate.java │ │ │ │ ├── SlackComCompactXmlWebHookTemplate.java │ │ │ │ ├── SlackComXmlWebHookTemplate.java │ │ │ │ ├── StatisticsReportWebHookTemplate.java │ │ │ │ ├── TemplateNotFoundException.java │ │ │ │ ├── UnSupportedBuildStateException.java │ │ │ │ ├── WebHookTemplateFromXml.java │ │ │ │ └── render │ │ │ │ │ ├── HtmlRenderer.java │ │ │ │ │ ├── JsonToHtmlPrettyPrintingRenderer.java │ │ │ │ │ ├── WebHookStringRenderer.java │ │ │ │ │ ├── WwwFormUrlEncodedToHtmlPrettyPrintingRenderer.java │ │ │ │ │ └── XmlToHtmlPrettyPrintingRenderer.java │ │ │ ├── util │ │ │ │ ├── StringSanitiser.java │ │ │ │ └── StringUtils.java │ │ │ └── variableresolver │ │ │ │ ├── VariableMessageBuilder.java │ │ │ │ ├── VariableResolver.java │ │ │ │ ├── VariableResolverFactory.java │ │ │ │ ├── WebHookVariableResolverManager.java │ │ │ │ ├── WebHookVariableResolverManagerImpl.java │ │ │ │ ├── standard │ │ │ │ ├── TemplateMatcher.java │ │ │ │ ├── WebHookVariableMessageBuilder.java │ │ │ │ ├── WebHooksBeanUtilsLegacyVariableResolverFactory.java │ │ │ │ ├── WebHooksBeanUtilsVariableResolver.java │ │ │ │ └── WebHooksBeanUtilsVariableResolverFactory.java │ │ │ │ └── velocity │ │ │ │ ├── VelocityCapitaliseDirective.java │ │ │ │ ├── VelocityCapitalizeDirective.java │ │ │ │ ├── VelocityEscapeJsonDirective.java │ │ │ │ ├── VelocityHmacDirective.java │ │ │ │ ├── VelocityJsonTool.java │ │ │ │ ├── VelocityNowDirective.java │ │ │ │ ├── VelocityNullUtils.java │ │ │ │ ├── VelocitySanitiseDirective.java │ │ │ │ ├── VelocitySanitizeDirective.java │ │ │ │ ├── VelocitySecureDirective.java │ │ │ │ ├── VelocitySubStringDirective.java │ │ │ │ ├── VelocityToJsonDirective.java │ │ │ │ ├── WebHookVelocityVariableMessageBuilder.java │ │ │ │ ├── WebHooksBeanUtilsVelocityVariableResolver.java │ │ │ │ └── WebHooksBeanUtilsVelocityVariableResolverFactory.java │ │ │ ├── settings │ │ │ ├── CustomMessageTemplate.java │ │ │ ├── WebHookConfig.java │ │ │ ├── WebHookConfigChangeHandler.java │ │ │ ├── WebHookConfigEnhanced.java │ │ │ ├── WebHookFilterConfig.java │ │ │ ├── WebHookHeaderConfig.java │ │ │ ├── WebHookMainConfig.java │ │ │ ├── WebHookMainSettings.java │ │ │ ├── WebHookProjectSettings.java │ │ │ ├── WebHookProjectSettingsFactory.java │ │ │ ├── WebHookProjectSettingsReloadScheduler.java │ │ │ ├── WebHookSearchFilter.java │ │ │ ├── WebHookSearchResult.java │ │ │ ├── WebHookSecureValuesEnquirer.java │ │ │ ├── WebHookSettingsManager.java │ │ │ ├── WebHookSettingsManagerImpl.java │ │ │ ├── WebHookUpdateResult.java │ │ │ ├── config │ │ │ │ ├── WebHookTemplateConfig.java │ │ │ │ └── builder │ │ │ │ │ └── WebHookTemplateConfigBuilder.java │ │ │ ├── converter │ │ │ │ ├── OldStyleBuildState.java │ │ │ │ ├── PayloadToTemplateConverter.java │ │ │ │ └── WebHookBuildStateConverter.java │ │ │ ├── entity │ │ │ │ ├── WebHookTemplateEntity.java │ │ │ │ ├── WebHookTemplateJaxHelper.java │ │ │ │ ├── WebHookTemplateJaxHelperImpl.java │ │ │ │ └── WebHookTemplates.java │ │ │ ├── project │ │ │ │ ├── WebHookParameter.java │ │ │ │ ├── WebHookParameterFactory.java │ │ │ │ ├── WebHookParameterModel.java │ │ │ │ ├── WebHookParameterStore.java │ │ │ │ ├── WebHookParameterStoreFactory.java │ │ │ │ ├── WebHookParameterStoreFactoryImpl.java │ │ │ │ ├── WebHookParameterStoreImpl.java │ │ │ │ └── WebHookParameterStoreNoOpImpl.java │ │ │ └── secure │ │ │ │ ├── WebHookSecretResolver.java │ │ │ │ ├── WebHookSecretResolverFactory.java │ │ │ │ ├── WebHookSecretResolverImpl.java │ │ │ │ └── WebHookSecretResolverNoOpImpl.java │ │ │ ├── statistics │ │ │ ├── CryptValueHasher.java │ │ │ ├── JaxHelper.java │ │ │ ├── JaxHelperImpl.java │ │ │ ├── LocalDateTypeAdaptor.java │ │ │ ├── NoOpValueHasher.java │ │ │ ├── StatisticsEntity.java │ │ │ ├── StatisticsEntityBuilder.java │ │ │ ├── StatisticsJaxHelper.java │ │ │ ├── StatisticsManager.java │ │ │ ├── StatisticsManagerImpl.java │ │ │ ├── StatisticsReport.java │ │ │ ├── StatisticsReportAssembler.java │ │ │ ├── StatisticsReportAssemblerImpl.java │ │ │ ├── StatisticsSnapshot.java │ │ │ ├── StatisticsSnapshotScheduler.java │ │ │ ├── TeamCityInstanceInfo.java │ │ │ ├── ValueHasher.java │ │ │ ├── WebHookConfigurationStatistics.java │ │ │ ├── WebHooksPluginInfo.java │ │ │ ├── WebHooksStatisticsReportEventListener.java │ │ │ └── package-info.java │ │ │ └── testing │ │ │ ├── NoOpJaxHelper.java │ │ │ ├── TestingMockUser.java │ │ │ ├── TestingResponsibilityEntry.java │ │ │ ├── TestingSQueuedBuild.java │ │ │ ├── WebHookConfigFactory.java │ │ │ ├── WebHookConfigFactoryImpl.java │ │ │ ├── WebHookConfigNotFoundException.java │ │ │ ├── WebHookUserRequestedExecutor.java │ │ │ ├── WebHookUserRequestedExecutorImpl.java │ │ │ └── model │ │ │ ├── BuildStateEnumTypeAdaptor.java │ │ │ ├── WebHookExecutionRequest.java │ │ │ ├── WebHookExecutionRequestGsonBuilder.java │ │ │ ├── WebHookRenderResult.java │ │ │ └── WebHookTemplateExecutionRequest.java │ └── resources │ │ └── webhook │ │ └── teamcity │ │ └── payload │ │ └── template │ │ ├── DiscordComWebHookTemplate.xml │ │ ├── ElasticSearchWebHookTemplate.xml │ │ ├── FlowdockWebHookTemplate.xml │ │ ├── MicrosoftTeams01WebHookTemplate.xml │ │ ├── MicrosoftTeams02WebHookTemplate.xml │ │ ├── SlackComCompactWebHookTemplate.xml │ │ ├── SlackComWebHookTemplate.xml │ │ └── readme.md │ └── test │ ├── java │ └── webhook │ │ ├── ResponseCodeFilter.java │ │ ├── ResponseEvent.java │ │ ├── TestingServlet.java │ │ ├── TestingWebHookFactory.java │ │ ├── WebHookConfigWithFilterTest.java │ │ ├── WebHookImplFiltersTest.java │ │ ├── WebHookTest.java │ │ ├── WebHookTestProxyServer.java │ │ ├── WebHookTestServer.java │ │ ├── WebHookTestServerTestBase.java │ │ ├── teamcity │ │ ├── BuildStateTest.java │ │ ├── MockBranch.java │ │ ├── MockRunType.java │ │ ├── MockSBuildAgent.java │ │ ├── MockSBuildType.java │ │ ├── MockSProject.java │ │ ├── MockSRunningBuild.java │ │ ├── MockTriggeredBy.java │ │ ├── TestingWebHookHttpClientFactoryImpl.java │ │ ├── WebHookContentBuilderTest.java │ │ ├── WebHookListenerTest.java │ │ ├── WebHookPayloadTest.java │ │ ├── WebHookPluginDataResolverImplTest.java │ │ ├── WebHookServiceMessageHandlerTest.java │ │ ├── auth │ │ │ ├── AuthWithRealServerTestBase.java │ │ │ ├── basic │ │ │ │ ├── UserPassAuthWithRealServerTest.java │ │ │ │ └── UsernamePasswordAuthenticatorFactoryTest.java │ │ │ └── bearer │ │ │ │ └── BearerAuthenticatorWithRealServerTest.java │ │ ├── endpoint │ │ │ └── WebHookEndPointContentStoreTest.java │ │ ├── executor │ │ │ └── StatisticsReporterWebHookRunnerTest.java │ │ ├── history │ │ │ └── WebHookHistoryRepositoryImplTest.java │ │ ├── payload │ │ │ ├── WebHookPayloadManagerTest.java │ │ │ ├── content │ │ │ │ ├── ExtraParametersTest.java │ │ │ │ ├── WebHookPayloadContentChangesTest.java │ │ │ │ ├── WebHookPayloadContentPropertiesTest.java │ │ │ │ └── WebHookPayloadContentTest.java │ │ │ ├── format │ │ │ │ ├── WebHookPayloadJsonTest.java │ │ │ │ ├── WebHookPayloadJsonVelocityTemplateTest.java │ │ │ │ ├── WebHookPayloadTailoredJsonTest.java │ │ │ │ ├── WebHookPayloadTest.java │ │ │ │ ├── WebHookPayloadXmlVelocityTemplateTest.java │ │ │ │ └── convertor │ │ │ │ │ └── ConvertorTest.java │ │ │ ├── template │ │ │ │ ├── AbstractSpringTemplateTest.java │ │ │ │ ├── DiscordComWebHookTemplateTest.java │ │ │ │ ├── ElasticSearchWebHookTemplateTest.java │ │ │ │ ├── FlowdockWebHookTemplateTest.java │ │ │ │ ├── JsonTemplateRenderingTest.java │ │ │ │ ├── NameValuePairsTemplateRenderingTest.java │ │ │ │ ├── SlackComCompactTest.java │ │ │ │ ├── SlackComCompactWebHookTemplateTest.java │ │ │ │ ├── SlackComCompactXmlWebHookTemplateTest.java │ │ │ │ ├── StatisticsWebHookTemplateTest.java │ │ │ │ ├── TestNvPairsXmlTemplate.java │ │ │ │ ├── WebHookTemplateManagerTest.java │ │ │ │ ├── WebHookTemplateResolverAndLegacyTemplateTest.java │ │ │ │ ├── XMLTemplateLoadingTest.java │ │ │ │ ├── XMLTemplateWithIdsLoadingTest.java │ │ │ │ └── render │ │ │ │ │ ├── JsonToHtmlPrettyPrintingRendererTest.java │ │ │ │ │ └── WwwFormUrlEncodedToHtmlPrettyPrintingRendererTest.java │ │ │ ├── util │ │ │ │ ├── BeanUtilsTest.java │ │ │ │ ├── StringUtilsTest.java │ │ │ │ ├── TemplateMatcherTest.java │ │ │ │ ├── VariableMessageBuilderTest.java │ │ │ │ └── VariableMessageBuilderTestBase.java │ │ │ └── variableresolver │ │ │ │ ├── standard │ │ │ │ ├── WebHookVariableMessageBuilderTest.java │ │ │ │ └── WebHooksBeanUtilsVariableResolverTest.java │ │ │ │ └── velocity │ │ │ │ ├── VelocityJsonToolTest.java │ │ │ │ ├── WebHookVelocityVariableMessageBuilderTest.java │ │ │ │ └── WebHooksBeanUtilsVelocityVariableResolverTest.java │ │ ├── settings │ │ │ ├── WebHookConfigTest.java │ │ │ ├── WebHookConfigTestForBuildTypeSpecifics.java │ │ │ ├── WebHookMainSettingsTest.java │ │ │ ├── WebHookProjectSettingsTest.java │ │ │ ├── WebHookSettingsManagerImplTest.java │ │ │ ├── WebHookSettingsTest.java │ │ │ ├── converter │ │ │ │ ├── PayloadToTemplateConverterTest.java │ │ │ │ └── WebHookBuildStateConverterTest.java │ │ │ └── entity │ │ │ │ ├── WebHookTemplateEntityTest.java │ │ │ │ ├── WebHookTemplateFormatMigrationTest.java │ │ │ │ ├── WebHookTemplateJaxHelperTest.java │ │ │ │ └── WebHookTemplateJaxTestHelper.java │ │ ├── statistics │ │ │ ├── BaseStatisticsTest.java │ │ │ ├── StatisticsEntityBuilderTest.java │ │ │ ├── StatisticsManagerImplTest.java │ │ │ ├── StatisticsReportAssemblerTest.java │ │ │ ├── ValueHasherTest.java │ │ │ └── WebAddressTransformerImplTest.java │ │ └── testing │ │ │ ├── WebHookExecutionRequestSerialisationTest.java │ │ │ └── WebHookUserRequestedExecutorImplTest.java │ │ └── testframework │ │ ├── MockWebHook.java │ │ ├── Mocked.java │ │ ├── MockingWebHookFactory.java │ │ ├── WebHookMockingFramework.java │ │ ├── WebHookMockingFrameworkImpl.java │ │ ├── WebHookSemiMockingFrameworkImpl.java │ │ └── util │ │ └── ConfigLoaderUtil.java │ ├── resources │ ├── FileThatDoesExist.txt │ ├── log4j.properties │ ├── main-config-full.xml │ ├── old_project-settings-test-all-states-enabled.xml │ ├── old_project-settings-test-webhook-disabled.xml │ ├── project-settings-before-statistics.xml │ ├── project-settings-test-all-but-respchange-states-enabled.xml │ ├── project-settings-test-all-states-disabled.xml │ ├── project-settings-test-all-states-enabled-with-branch-and-auth.xml │ ├── project-settings-test-all-states-enabled-with-branch-and-bearer-auth.xml │ ├── project-settings-test-all-states-enabled-with-branch-and-custom-templates.xml │ ├── project-settings-test-all-states-enabled-with-branch-and-preemptive-bearer-auth-from-token.xml │ ├── project-settings-test-all-states-enabled-with-branch-and-preemptive-bearer-auth.xml │ ├── project-settings-test-all-states-enabled-with-branch-and-wrong-auth.xml │ ├── project-settings-test-all-states-enabled-with-branchNameAndBuildNameFilter.xml │ ├── project-settings-test-all-states-enabled-with-branchNameFilter.xml │ ├── project-settings-test-all-states-enabled-with-custom-templates.xml │ ├── project-settings-test-all-states-enabled-with-filters.xml │ ├── project-settings-test-all-states-enabled-with-incorrectFilterValue.xml │ ├── project-settings-test-all-states-enabled-with-specific-builds.xml │ ├── project-settings-test-all-states-enabled.xml │ ├── project-settings-test-discordcom.xml │ ├── project-settings-test-elastic.xml │ ├── project-settings-test-flowdock.xml │ ├── project-settings-test-slack.xml │ ├── project-settings-test-slackcompact-jsonTemplate-AllEnabled.xml │ ├── project-settings-test-slackcompact.xml │ ├── project-settings-test-webhook-disabled.xml │ ├── project-settings-test-with-build-types.xml │ ├── testCDataTemplate │ │ └── config │ │ │ └── webhook-templates.xml │ ├── testSlackCompactOverriden │ │ └── webhook-templates.xml │ ├── testWebHookRequest │ │ └── webhook-request-01.json │ ├── testXmlTemplate │ │ └── config │ │ │ └── webhook-templates.xml │ ├── testXmlTemplateWithCombinedTemplate │ │ └── config │ │ │ └── webhook-templates.xml │ ├── testXmlTemplateWithTemplateIds │ │ └── config │ │ │ └── webhook-templates.xml │ ├── testdoc1.xml │ ├── testdoc2.xml │ ├── testrealm.txt │ ├── webhook-templates-flowdock-example.xml │ ├── webhook-templates.xml │ └── webhook │ │ └── teamcity │ │ └── payload │ │ └── template │ │ └── TestNVPairsTemplate.xml │ └── webapp │ └── WEB-INF │ └── web.xml ├── tcwebhooks-rest-api-legacy ├── .gitignore ├── lib-compile │ └── jetbrains │ │ └── teamcity │ │ └── 9 │ │ └── rest-api │ │ ├── 9.0 │ │ ├── rest-api-9.0-sources.jar │ │ └── rest-api-9.0.jar │ │ └── 9.1 │ │ ├── rest-api-9.1.jar │ │ ├── rest-api-9.1.pom │ │ └── rest-api-9.1.zip ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── jetbrains │ │ │ └── buildServer │ │ │ │ └── server │ │ │ │ └── rest │ │ │ │ └── jersey │ │ │ │ └── ExceptionMapperUtil.java │ │ └── webhook │ │ │ └── teamcity │ │ │ └── server │ │ │ ├── RestApiCleanupRestartRequiredHealthReport.java │ │ │ ├── RestApiJarHealthReport.java │ │ │ ├── WebHookTeamCityRestApiZipPluginFixer.java │ │ │ ├── pluginfixer │ │ │ ├── FileStatus.java │ │ │ └── JarReport.java │ │ │ └── rest │ │ │ ├── RESTControllerExtensionInitializer.java │ │ │ ├── WebHookApiUrlBuilder.java │ │ │ ├── WebHookWebLinks.java │ │ │ ├── data │ │ │ ├── DataProvider.java │ │ │ ├── TemplateDataProvider.java │ │ │ ├── TemplateFinder.java │ │ │ ├── TemplateValidator.java │ │ │ ├── WebHookConfigurationValidator.java │ │ │ ├── WebHookDataProvider.java │ │ │ ├── WebHookFilterValidator.java │ │ │ ├── WebHookManager.java │ │ │ ├── WebHookParameterDataProvider.java │ │ │ ├── WebHookParameterFinder.java │ │ │ ├── WebHookParameterValidator.java │ │ │ ├── WebHookStatisticsDataProvider.java │ │ │ ├── WebHookTemplateConfigWrapper.java │ │ │ ├── WebHookTemplateItemConfigWrapper.java │ │ │ └── WebHookTemplateStates.java │ │ │ ├── errors │ │ │ ├── BadRequestException.java │ │ │ ├── BadRequestExceptionMapper.java │ │ │ ├── JaxbClassCastException.java │ │ │ ├── JaxbClassCastExceptionMapper.java │ │ │ ├── OperationUnsupportedExceptionMapper.java │ │ │ ├── TemplateInUseException.java │ │ │ ├── TemplateInUseExceptionMapper.java │ │ │ ├── TemplatePermissionException.java │ │ │ ├── TemplatePermissionExceptionMapper.java │ │ │ ├── UnprocessableEntityException.java │ │ │ ├── UnprocessableEntityExceptionMapper.java │ │ │ ├── WebHookPermissionException.java │ │ │ └── WebHookPermissionExceptionMapper.java │ │ │ ├── jersey │ │ │ ├── BeanContextProvider.java │ │ │ ├── HtmlErrorMessageBodyWriter.java │ │ │ ├── MainConfigManagerProvider.java │ │ │ ├── StatisticsDataProviderProvider.java │ │ │ ├── TemplateDataProviderProvider.java │ │ │ ├── TemplateManagerProvider.java │ │ │ ├── TemplateValidatorProvider.java │ │ │ ├── WebHookConfigurationValidatorProvider.java │ │ │ ├── WebHookDataProviderProvider.java │ │ │ ├── WebHookParameterDataProviderProvider.java │ │ │ ├── WebHookParameterStoreProvider.java │ │ │ ├── WebHookParameterValidatorProvider.java │ │ │ ├── WebHookPluginDataResolverProvider.java │ │ │ ├── WebHookSettingsManagerProvider.java │ │ │ └── WebHookUserRequestedExecutorProvider.java │ │ │ ├── model │ │ │ ├── mainconfig │ │ │ │ ├── Information.java │ │ │ │ ├── NoProxy.java │ │ │ │ ├── Proxy.java │ │ │ │ └── Webhooks.java │ │ │ ├── parameter │ │ │ │ ├── ProjectWebhookParameter.java │ │ │ │ └── ProjectWebhookParameters.java │ │ │ ├── template │ │ │ │ ├── ErrorResult.java │ │ │ │ ├── Format.java │ │ │ │ ├── Template.java │ │ │ │ ├── TemplateTestExecutionRequest.java │ │ │ │ ├── TemplateTestHistoryItem.java │ │ │ │ ├── TemplateText.java │ │ │ │ └── Templates.java │ │ │ └── webhook │ │ │ │ ├── CustomTemplate.java │ │ │ │ ├── ProjectWebHookAuthConfig.java │ │ │ │ ├── ProjectWebHookBuildType.java │ │ │ │ ├── ProjectWebHookFilter.java │ │ │ │ ├── ProjectWebHookFilters.java │ │ │ │ ├── ProjectWebHookHeader.java │ │ │ │ ├── ProjectWebHookHeaders.java │ │ │ │ ├── ProjectWebHookParameters.java │ │ │ │ ├── ProjectWebhook.java │ │ │ │ ├── ProjectWebhookState.java │ │ │ │ └── ProjectWebhooks.java │ │ │ ├── request │ │ │ ├── ApiRequest.java │ │ │ ├── Constants.java │ │ │ ├── StatisticsRequest.java │ │ │ ├── TemplateRequest.java │ │ │ ├── TemplateTestRequest.java │ │ │ ├── WebHookParametersRequest.java │ │ │ ├── WebHooksConfigRequest.java │ │ │ ├── WebHooksIndexRequest.java │ │ │ ├── WebHooksRequest.java │ │ │ └── validator │ │ │ │ ├── ExecuteWebHookTemplateRequestValidator.java │ │ │ │ └── PreviewWebHookTemplateRequestValidator.java │ │ │ ├── util │ │ │ ├── BeanContext.java │ │ │ └── mainconfig │ │ │ │ └── MainConfigManager.java │ │ │ └── web │ │ │ ├── WebHookRestApiActionController.java │ │ │ ├── WebHookRestApiAdminPage.java │ │ │ └── action │ │ │ ├── FixPluginZipFileAction.java │ │ │ └── WebHooksApiAction.java │ ├── resources │ │ ├── META-INF │ │ │ └── build-server-plugin-RESTListener.xml │ │ └── buildServerResources │ │ │ └── WebHookRestApi │ │ │ ├── adminTab.jsp │ │ │ ├── css │ │ │ └── tcWebHooksApi.css │ │ │ ├── restApiHealthRestartStatus.jsp │ │ │ ├── restApiHealthStatus.js │ │ │ ├── restApiHealthStatus.jsp │ │ │ └── serverNoRestart.js │ └── teamcity-plugin-resources │ │ └── teamcity-plugin.xml │ └── test │ ├── java │ └── webhook │ │ └── teamcity │ │ ├── server │ │ ├── WebHookTeamCityRestApiZipPluginFixerTest.java │ │ └── rest │ │ │ ├── data │ │ │ ├── TemplateFinderTest.java │ │ │ └── TemplateValidatorTest.java │ │ │ ├── model │ │ │ └── mainconfig │ │ │ │ ├── WebHookMainSettingsTest.java │ │ │ │ ├── WebhooksTest.java │ │ │ │ └── rest │ │ │ │ └── MainConfigTest.java │ │ │ └── request │ │ │ ├── AbstractJerseyTest.java │ │ │ ├── CreateNewTemplateTest.java │ │ │ ├── DeleteTemplateTest.java │ │ │ ├── DeleteWebHookParameterTest.java │ │ │ ├── EditExistingTemplateTest.java │ │ │ ├── EditExistingWebHookTest.java │ │ │ ├── ExecuteTestWebHookTemplateRequestTest.java │ │ │ ├── RelocateNewTemplateTest.java │ │ │ ├── ViewExistingTemplateTest.java │ │ │ ├── ViewExistingWebHookTest.java │ │ │ └── WebHookAbstractSpringAwareJerseyTest.java │ │ ├── settings │ │ └── entity │ │ │ ├── JaxHelper.java │ │ │ └── WebHookTemplateJaxTestHelper.java │ │ └── test │ │ ├── jerseyprovider │ │ ├── JacksonContextResolver.java │ │ ├── MainConfigBuilderTestContextProvider.java │ │ ├── MockingBeanContextProvider.java │ │ ├── MockingHttpServletRequestContextProvider.java │ │ ├── MockingWebHookUserRequestedExecutorProvider.java │ │ ├── PermissionCheckerTestContextProvider.java │ │ ├── ProjectIdResolverMock.java │ │ ├── RequestPathTransformInfoProvider.java │ │ ├── ServiceLocatorTestContextProvider.java │ │ ├── TemplateDataProviderTestContextProvider.java │ │ ├── TemplateValidatorTestContextProvider.java │ │ ├── WebHookApiUrlBuilderTestContextProvider.java │ │ ├── WebHookConfigurationValidatorTestContextProvider.java │ │ ├── WebHookDataProviderTestContextProvider.java │ │ ├── WebHookParameterDataProviderTestContextProvider.java │ │ ├── WebHookParameterStoreTestContextProvider.java │ │ ├── WebHookParameterValidatorTestContextProvider.java │ │ ├── WebHookPayloadManagerTestProvider.java │ │ ├── WebHookPluginDataResolverTestProvider.java │ │ ├── WebHookStatisticsDataProviderTestProvider.java │ │ └── WebHookTemplateManagerTestProvider.java │ │ └── springmock │ │ ├── MockConfigActionFactory.java │ │ ├── MockProjectManager.java │ │ ├── MockProjectSettingsManager.java │ │ ├── MockSBuildServer.java │ │ ├── MockSecurityContext.java │ │ └── MockingWebHookSettingsEventHandler.java │ └── resources │ ├── REST-examples │ ├── create-template-post.json │ ├── elasticsearch-templateItem-defaultTemplate.xml │ └── elasticsearch-templateItem-template1.xml │ ├── TestSpringContext.xml │ ├── build-server-plugin-WebHookListener.xml │ ├── catalina_home │ └── webapps │ │ └── ROOT │ │ └── WEB-INF │ │ └── plugins │ │ ├── rest-api.zip │ │ └── somefile.zip │ ├── log4j.properties │ ├── main-config-full.xml │ └── spring-test-config.xml ├── tcwebhooks-rest-api ├── .gitignore ├── lib-compile │ └── jetbrains │ │ └── teamcity │ │ ├── 9 │ │ └── rest-api │ │ │ ├── 9.0 │ │ │ ├── rest-api-9.0-sources.jar │ │ │ └── rest-api-9.0.jar │ │ │ └── 9.1 │ │ │ ├── rest-api-9.1.jar │ │ │ ├── rest-api-9.1.pom │ │ │ └── rest-api-9.1.zip │ │ └── 2024 │ │ └── rest-api │ │ └── 2024.03 │ │ ├── rest-api-2024.03.jar │ │ └── rest-api-2024.03.pom ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── jetbrains │ │ │ └── buildServer │ │ │ │ └── server │ │ │ │ └── rest │ │ │ │ └── jersey │ │ │ │ └── ExceptionMapperUtil.java │ │ └── webhook │ │ │ └── teamcity │ │ │ └── server │ │ │ ├── RestApiCleanupRestartRequiredHealthReport.java │ │ │ ├── RestApiJarHealthReport.java │ │ │ ├── WebHookTeamCityRestApiZipPluginFixer.java │ │ │ ├── pluginfixer │ │ │ ├── FileStatus.java │ │ │ └── JarReport.java │ │ │ └── rest │ │ │ ├── RESTControllerExtensionInitializer.java │ │ │ ├── WebHookApiUrlBuilder.java │ │ │ ├── WebHookWebLinks.java │ │ │ ├── data │ │ │ ├── DataProvider.java │ │ │ ├── TemplateDataProvider.java │ │ │ ├── TemplateFinder.java │ │ │ ├── TemplateValidator.java │ │ │ ├── WebHookConfigurationValidator.java │ │ │ ├── WebHookDataProvider.java │ │ │ ├── WebHookFilterValidator.java │ │ │ ├── WebHookManager.java │ │ │ ├── WebHookParameterDataProvider.java │ │ │ ├── WebHookParameterFinder.java │ │ │ ├── WebHookParameterValidator.java │ │ │ ├── WebHookStatisticsDataProvider.java │ │ │ ├── WebHookTemplateConfigWrapper.java │ │ │ ├── WebHookTemplateItemConfigWrapper.java │ │ │ └── WebHookTemplateStates.java │ │ │ ├── errors │ │ │ ├── BadRequestException.java │ │ │ ├── BadRequestExceptionMapper.java │ │ │ ├── JaxbClassCastException.java │ │ │ ├── JaxbClassCastExceptionMapper.java │ │ │ ├── OperationUnsupportedExceptionMapper.java │ │ │ ├── TemplateInUseException.java │ │ │ ├── TemplateInUseExceptionMapper.java │ │ │ ├── TemplatePermissionException.java │ │ │ ├── TemplatePermissionExceptionMapper.java │ │ │ ├── UnprocessableEntityException.java │ │ │ ├── UnprocessableEntityExceptionMapper.java │ │ │ ├── WebHookPermissionException.java │ │ │ └── WebHookPermissionExceptionMapper.java │ │ │ ├── jersey │ │ │ ├── HtmlErrorMessageBodyWriter.java │ │ │ ├── TemplateManagerProvider.java │ │ │ ├── WebHookApiUrlBuilderProvider.java │ │ │ ├── WebHookParameterStoreFactoryProvider.java │ │ │ ├── WebHookParameterStoreProvider.java │ │ │ ├── WebHookPluginDataResolverProvider.java │ │ │ ├── WebHookSettingsManagerProvider.java │ │ │ └── WebHookUserRequestedExecutorProvider.java │ │ │ ├── model │ │ │ ├── mainconfig │ │ │ │ ├── Information.java │ │ │ │ ├── NoProxy.java │ │ │ │ ├── Proxy.java │ │ │ │ └── Webhooks.java │ │ │ ├── parameter │ │ │ │ ├── ProjectWebhookParameter.java │ │ │ │ └── ProjectWebhookParameters.java │ │ │ ├── template │ │ │ │ ├── ErrorResult.java │ │ │ │ ├── Format.java │ │ │ │ ├── Template.java │ │ │ │ ├── TemplateTestExecutionRequest.java │ │ │ │ ├── TemplateTestHistoryItem.java │ │ │ │ ├── TemplateText.java │ │ │ │ └── Templates.java │ │ │ └── webhook │ │ │ │ ├── CustomTemplate.java │ │ │ │ ├── ProjectWebHookAuthConfig.java │ │ │ │ ├── ProjectWebHookBuildType.java │ │ │ │ ├── ProjectWebHookFilter.java │ │ │ │ ├── ProjectWebHookFilters.java │ │ │ │ ├── ProjectWebHookHeader.java │ │ │ │ ├── ProjectWebHookHeaders.java │ │ │ │ ├── ProjectWebHookParameters.java │ │ │ │ ├── ProjectWebhook.java │ │ │ │ ├── ProjectWebhookState.java │ │ │ │ └── ProjectWebhooks.java │ │ │ ├── request │ │ │ ├── ApiRequest.java │ │ │ ├── BaseRequest.java │ │ │ ├── Constants.java │ │ │ ├── StatisticsRequest.java │ │ │ ├── TemplateRequest.java │ │ │ ├── TemplateTestRequest.java │ │ │ ├── WebHookParametersRequest.java │ │ │ ├── WebHooksConfigRequest.java │ │ │ ├── WebHooksIndexRequest.java │ │ │ ├── WebHooksRequest.java │ │ │ └── validator │ │ │ │ ├── ExecuteWebHookTemplateRequestValidator.java │ │ │ │ └── PreviewWebHookTemplateRequestValidator.java │ │ │ ├── util │ │ │ ├── WebHookBeanContext.java │ │ │ └── mainconfig │ │ │ │ └── MainConfigManager.java │ │ │ └── web │ │ │ ├── WebHookRestApiActionController.java │ │ │ ├── WebHookRestApiAdminPage.java │ │ │ └── action │ │ │ ├── FixPluginZipFileAction.java │ │ │ └── WebHooksApiAction.java │ ├── resources │ │ ├── META-INF │ │ │ └── build-server-plugin-RESTListener.xml │ │ └── buildServerResources │ │ │ └── WebHookRestApi │ │ │ ├── adminTab.jsp │ │ │ ├── css │ │ │ └── tcWebHooksApi.css │ │ │ ├── restApiHealthRestartStatus.jsp │ │ │ ├── restApiHealthStatus.js │ │ │ ├── restApiHealthStatus.jsp │ │ │ └── serverNoRestart.js │ └── teamcity-plugin-resources │ │ └── teamcity-plugin.xml │ └── test │ ├── java │ └── webhook │ │ └── teamcity │ │ ├── server │ │ ├── WebHookTeamCityRestApiZipPluginFixerTest.java │ │ └── rest │ │ │ ├── data │ │ │ ├── TemplateFinderTest.java │ │ │ └── TemplateValidatorTest.java │ │ │ ├── model │ │ │ └── mainconfig │ │ │ │ ├── WebHookMainSettingsTest.java │ │ │ │ ├── WebhooksTest.java │ │ │ │ └── rest │ │ │ │ └── MainConfigTest.java │ │ │ └── request │ │ │ ├── AbstractJerseyTest.java │ │ │ ├── CreateNewTemplateTest.java │ │ │ ├── DeleteTemplateTest.java │ │ │ ├── DeleteWebHookParameterTest.java │ │ │ ├── EditExistingTemplateTest.java │ │ │ ├── EditExistingWebHookTest.java │ │ │ ├── ExecuteTestWebHookTemplateRequestTest.java │ │ │ ├── RelocateNewTemplateTest.java │ │ │ ├── ViewExistingTemplateTest.java │ │ │ ├── ViewExistingWebHookTest.java │ │ │ └── WebHookAbstractSpringAwareJerseyTest.java │ │ ├── settings │ │ └── entity │ │ │ ├── JaxHelper.java │ │ │ └── WebHookTemplateJaxTestHelper.java │ │ └── test │ │ ├── jerseyprovider │ │ ├── JacksonContextResolver.java │ │ ├── MainConfigBuilderTestContextProvider.java │ │ ├── MockingBeanContextProvider.java │ │ ├── MockingHttpServletRequestContextProvider.java │ │ ├── MockingWebHookUserRequestedExecutorProvider.java │ │ ├── PermissionCheckerTestContextProvider.java │ │ ├── ProjectIdResolverMock.java │ │ ├── ServiceLocatorTestContextProvider.java │ │ ├── TemplateDataProviderTestContextProvider.java │ │ ├── TemplateValidatorTestContextProvider.java │ │ ├── WebHookApiUrlBuilderTestContextProvider.java │ │ ├── WebHookConfigurationValidatorTestContextProvider.java │ │ ├── WebHookDataProviderTestContextProvider.java │ │ ├── WebHookParameterDataProviderTestContextProvider.java │ │ ├── WebHookParameterStoreTestContextProvider.java │ │ ├── WebHookParameterValidatorTestContextProvider.java │ │ ├── WebHookPayloadManagerTestProvider.java │ │ ├── WebHookPluginDataResolverTestProvider.java │ │ ├── WebHookStatisticsDataProviderTestProvider.java │ │ └── WebHookTemplateManagerTestProvider.java │ │ └── springmock │ │ ├── MockConfigActionFactory.java │ │ ├── MockProjectManager.java │ │ ├── MockProjectSettingsManager.java │ │ ├── MockSBuildServer.java │ │ └── MockSecurityContext.java │ └── resources │ ├── REST-examples │ ├── create-template-post.json │ ├── elasticsearch-templateItem-defaultTemplate.xml │ └── elasticsearch-templateItem-template1.xml │ ├── TestSpringContext.xml │ ├── build-server-plugin-WebHookListener.xml │ ├── catalina_home │ └── webapps │ │ └── ROOT │ │ └── WEB-INF │ │ └── plugins │ │ ├── rest-api.zip │ │ └── somefile.zip │ ├── log4j.properties │ ├── main-config-full.xml │ └── spring-test-config.xml └── tcwebhooks-web-ui ├── .gitignore ├── build.xml ├── local-mvn-repo └── org │ └── jetbrains │ └── teamcity │ └── server │ ├── 10.0 │ ├── server-10.0.jar │ └── server-10.0.pom │ └── 9.1 │ ├── server-9.1.jar │ └── server-9.1.pom ├── pom.xml └── src ├── main ├── java │ └── webhook │ │ └── teamcity │ │ ├── buildrunner │ │ ├── WebHookServiceMessagePropertiesProcessor.java │ │ └── WebHookServiceMessageRunType.java │ │ ├── endpoint │ │ ├── WebHookEndPointController.java │ │ └── WebHookEndPointViewerController.java │ │ ├── extension │ │ ├── WebHookAjaxEditPageController.java │ │ ├── WebHookAjaxSettingsListPageController.java │ │ ├── WebHookBuildTypeTabExtension.java │ │ ├── WebHookEditController.java │ │ ├── WebHookIndexPageController.java │ │ ├── WebHookJavascriptTestsController.java │ │ ├── WebHookPreviewAndExecuteController.java │ │ ├── WebHookProjectTabExtension.java │ │ ├── WebHookSearchController.java │ │ ├── WebHookTemplateBasePageController.java │ │ ├── WebHookTemplateDiffPageController.java │ │ ├── WebHookTemplateEditPageController.java │ │ ├── WebHookTemplateListPageController.java │ │ ├── WebhookTemplateEditPageActionController.java │ │ ├── admin │ │ │ ├── AbstractWebHookAdminAction.java │ │ │ ├── RefreshStatisticsAction.java │ │ │ ├── UpdateAnalyticsOptionAction.java │ │ │ ├── UpdateStatisticsOptionAction.java │ │ │ ├── WebHookAdminPage.java │ │ │ └── WebHookStatisticsConfigurationActionController.java │ │ ├── bean │ │ │ ├── BuildWebhooksBean.java │ │ │ ├── ErrorResult.java │ │ │ ├── ProjectAndBuildWebhooksBean.java │ │ │ ├── ProjectParametersBean.java │ │ │ ├── ProjectTemplatesBean.java │ │ │ ├── ProjectWebHookParameterBean.java │ │ │ ├── ProjectWebHooksBean.java │ │ │ ├── ProjectWebHooksBeanGsonSerialiser.java │ │ │ ├── RegisteredWebhookAuthenticationTypesBean.java │ │ │ ├── StateBean.java │ │ │ ├── StatisticsChartBean.java │ │ │ ├── TemplatesAndProjectWebHooksBean.java │ │ │ ├── WebHookTestHistoryItem.java │ │ │ ├── WebhookAuthenticationConfigBean.java │ │ │ ├── WebhookBuildTypeEnabledStatusBean.java │ │ │ ├── WebhookConfigAndBuildTypeListHolder.java │ │ │ └── template │ │ │ │ ├── EditTemplateRenderingBean.java │ │ │ │ ├── RegisteredWebHookTemplateBean.java │ │ │ │ ├── RegisteredWebHookTemplateBeanGsonSerialiser.java │ │ │ │ ├── TemplateRenderingBean.java │ │ │ │ └── TemplateRenderingBeanJsonSerialiser.java │ │ ├── project │ │ │ └── WebHookProjectSettingsTab.java │ │ └── util │ │ │ ├── EnabledBuildStateResolver.java │ │ │ ├── ProjectHistoryResolver.java │ │ │ ├── WebHookConfigurationValidator.java │ │ │ └── WebHookSecureValuesHelperService.java │ │ ├── history │ │ └── WebHookHistoryController.java │ │ └── json │ │ ├── BuildStateEnumTypeAdaptor.java │ │ ├── WebHookAuthenticationJson.java │ │ ├── WebHookBuildStateJson.java │ │ ├── WebHookBuildTypesJson.java │ │ ├── WebHookConfigurationGsonBuilder.java │ │ ├── WebHookConfigurationJson.java │ │ ├── WebHookConfigurationListWrapper.java │ │ ├── WebHookFilterJson.java │ │ ├── WebHookHeaderJson.java │ │ └── WebHookParameterJson.java ├── resources │ ├── META-INF │ │ └── build-server-plugin-WebHookListener.xml │ ├── ace-extras │ │ └── mode │ │ │ ├── jsonvelocity.js │ │ │ └── jsonvelocity_highlight_rules.js │ └── buildServerResources │ │ └── WebHook │ │ ├── 3rd-party │ │ ├── Chart.bundle.js │ │ ├── Chart.bundle.min.js │ │ ├── Chart.js │ │ ├── ace-editor │ │ │ └── src-min-noconflict │ │ │ │ ├── ace.js │ │ │ │ ├── ext-beautify.js │ │ │ │ ├── ext-chromevox.js │ │ │ │ ├── ext-elastic_tabstops_lite.js │ │ │ │ ├── ext-emmet.js │ │ │ │ ├── ext-error_marker.js │ │ │ │ ├── ext-keybinding_menu.js │ │ │ │ ├── ext-language_tools.js │ │ │ │ ├── ext-linking.js │ │ │ │ ├── ext-modelist.js │ │ │ │ ├── ext-old_ie.js │ │ │ │ ├── ext-searchbox.js │ │ │ │ ├── ext-settings_menu.js │ │ │ │ ├── ext-spellcheck.js │ │ │ │ ├── ext-split.js │ │ │ │ ├── ext-static_highlight.js │ │ │ │ ├── ext-statusbar.js │ │ │ │ ├── ext-textarea.js │ │ │ │ ├── ext-themelist.js │ │ │ │ ├── ext-whitespace.js │ │ │ │ ├── keybinding-emacs.js │ │ │ │ ├── keybinding-vim.js │ │ │ │ ├── mode-abap.js │ │ │ │ ├── mode-abc.js │ │ │ │ ├── mode-asciidoc.js │ │ │ │ ├── mode-autohotkey.js │ │ │ │ ├── mode-css.js │ │ │ │ ├── mode-diff.js │ │ │ │ ├── mode-groovy.js │ │ │ │ ├── mode-hjson.js │ │ │ │ ├── mode-html.js │ │ │ │ ├── mode-java.js │ │ │ │ ├── mode-javascript.js │ │ │ │ ├── mode-json.js │ │ │ │ ├── mode-jsoniq.js │ │ │ │ ├── mode-jsonvelocity.js │ │ │ │ ├── mode-less.js │ │ │ │ ├── mode-markdown.js │ │ │ │ ├── mode-perl.js │ │ │ │ ├── mode-plain_text.js │ │ │ │ ├── mode-properties.js │ │ │ │ ├── mode-sh.js │ │ │ │ ├── mode-snippets.js │ │ │ │ ├── mode-text.js │ │ │ │ ├── mode-velocity.js │ │ │ │ ├── mode-xml.js │ │ │ │ ├── mode-yaml.js │ │ │ │ ├── snippets │ │ │ │ ├── abap.js │ │ │ │ ├── abc.js │ │ │ │ ├── actionscript.js │ │ │ │ ├── ada.js │ │ │ │ ├── apache_conf.js │ │ │ │ ├── applescript.js │ │ │ │ ├── asciidoc.js │ │ │ │ ├── assembly_x86.js │ │ │ │ ├── autohotkey.js │ │ │ │ ├── batchfile.js │ │ │ │ ├── bro.js │ │ │ │ ├── c9search.js │ │ │ │ ├── c_cpp.js │ │ │ │ ├── cirru.js │ │ │ │ ├── clojure.js │ │ │ │ ├── cobol.js │ │ │ │ ├── coffee.js │ │ │ │ ├── coldfusion.js │ │ │ │ ├── csharp.js │ │ │ │ ├── css.js │ │ │ │ ├── curly.js │ │ │ │ ├── d.js │ │ │ │ ├── dart.js │ │ │ │ ├── diff.js │ │ │ │ ├── django.js │ │ │ │ ├── dockerfile.js │ │ │ │ ├── dot.js │ │ │ │ ├── drools.js │ │ │ │ ├── eiffel.js │ │ │ │ ├── ejs.js │ │ │ │ ├── elixir.js │ │ │ │ ├── elm.js │ │ │ │ ├── erlang.js │ │ │ │ ├── forth.js │ │ │ │ ├── fortran.js │ │ │ │ ├── ftl.js │ │ │ │ ├── gcode.js │ │ │ │ ├── gherkin.js │ │ │ │ ├── gitignore.js │ │ │ │ ├── glsl.js │ │ │ │ ├── gobstones.js │ │ │ │ ├── golang.js │ │ │ │ ├── groovy.js │ │ │ │ ├── haml.js │ │ │ │ ├── handlebars.js │ │ │ │ ├── haskell.js │ │ │ │ ├── haskell_cabal.js │ │ │ │ ├── haxe.js │ │ │ │ ├── hjson.js │ │ │ │ ├── html.js │ │ │ │ ├── html_elixir.js │ │ │ │ ├── html_ruby.js │ │ │ │ ├── ini.js │ │ │ │ ├── io.js │ │ │ │ ├── jack.js │ │ │ │ ├── jade.js │ │ │ │ ├── java.js │ │ │ │ ├── javascript.js │ │ │ │ ├── json.js │ │ │ │ ├── jsoniq.js │ │ │ │ ├── jsonvelocity.js │ │ │ │ ├── jsp.js │ │ │ │ ├── jsx.js │ │ │ │ ├── julia.js │ │ │ │ ├── kotlin.js │ │ │ │ ├── latex.js │ │ │ │ ├── lean.js │ │ │ │ ├── less.js │ │ │ │ ├── liquid.js │ │ │ │ ├── lisp.js │ │ │ │ ├── live_script.js │ │ │ │ ├── livescript.js │ │ │ │ ├── logiql.js │ │ │ │ ├── lsl.js │ │ │ │ ├── lua.js │ │ │ │ ├── luapage.js │ │ │ │ ├── lucene.js │ │ │ │ ├── makefile.js │ │ │ │ ├── markdown.js │ │ │ │ ├── mask.js │ │ │ │ ├── matlab.js │ │ │ │ ├── maze.js │ │ │ │ ├── mel.js │ │ │ │ ├── mips_assembler.js │ │ │ │ ├── mipsassembler.js │ │ │ │ ├── mushcode.js │ │ │ │ ├── mysql.js │ │ │ │ ├── nix.js │ │ │ │ ├── nsis.js │ │ │ │ ├── objectivec.js │ │ │ │ ├── ocaml.js │ │ │ │ ├── pascal.js │ │ │ │ ├── perl.js │ │ │ │ ├── pgsql.js │ │ │ │ ├── php.js │ │ │ │ ├── plain_text.js │ │ │ │ ├── powershell.js │ │ │ │ ├── praat.js │ │ │ │ ├── prolog.js │ │ │ │ ├── properties.js │ │ │ │ ├── protobuf.js │ │ │ │ ├── python.js │ │ │ │ ├── r.js │ │ │ │ ├── razor.js │ │ │ │ ├── rdoc.js │ │ │ │ ├── rhtml.js │ │ │ │ ├── rst.js │ │ │ │ ├── ruby.js │ │ │ │ ├── rust.js │ │ │ │ ├── sass.js │ │ │ │ ├── scad.js │ │ │ │ ├── scala.js │ │ │ │ ├── scheme.js │ │ │ │ ├── scss.js │ │ │ │ ├── sh.js │ │ │ │ ├── sjs.js │ │ │ │ ├── smarty.js │ │ │ │ ├── snippets.js │ │ │ │ ├── soy_template.js │ │ │ │ ├── space.js │ │ │ │ ├── sql.js │ │ │ │ ├── sqlserver.js │ │ │ │ ├── stylus.js │ │ │ │ ├── svg.js │ │ │ │ ├── swift.js │ │ │ │ ├── swig.js │ │ │ │ ├── tcl.js │ │ │ │ ├── tex.js │ │ │ │ ├── text.js │ │ │ │ ├── textile.js │ │ │ │ ├── toml.js │ │ │ │ ├── tsx.js │ │ │ │ ├── twig.js │ │ │ │ ├── typescript.js │ │ │ │ ├── vala.js │ │ │ │ ├── vbscript.js │ │ │ │ ├── velocity.js │ │ │ │ ├── verilog.js │ │ │ │ ├── vhdl.js │ │ │ │ ├── wollok.js │ │ │ │ ├── xml.js │ │ │ │ ├── xquery.js │ │ │ │ └── yaml.js │ │ │ │ ├── theme-eclipse.js │ │ │ │ ├── theme-github.js │ │ │ │ ├── theme-xcode.js │ │ │ │ ├── worker-coffee.js │ │ │ │ ├── worker-css.js │ │ │ │ ├── worker-html.js │ │ │ │ ├── worker-javascript.js │ │ │ │ ├── worker-json.js │ │ │ │ ├── worker-lua.js │ │ │ │ ├── worker-php.js │ │ │ │ ├── worker-xml.js │ │ │ │ └── worker-xquery.js │ │ ├── diff2html-2.11.2 │ │ │ ├── diff2html-ui.js │ │ │ ├── diff2html.css │ │ │ └── diff2html.js │ │ ├── highlight │ │ │ ├── highlight.pack.js │ │ │ └── styles │ │ │ │ └── tomorrow.css │ │ ├── jquery.color.js │ │ ├── jquery.easytabs.min.js │ │ ├── jquery.sweet-dropdown-1.0.0 │ │ │ ├── jquery.sweet-dropdown.css │ │ │ ├── jquery.sweet-dropdown.css.map │ │ │ ├── jquery.sweet-dropdown.js │ │ │ ├── jquery.sweet-dropdown.min.css │ │ │ └── jquery.sweet-dropdown.min.js │ │ ├── mocha@9.1.3 │ │ │ ├── chai.js │ │ │ ├── mocha.css │ │ │ ├── mocha.js │ │ │ ├── mocha.js.map │ │ │ └── sinon-9.2.4.js │ │ └── moment-2.22.2.min.js │ │ ├── adminTab.jsp │ │ ├── ajaxEdit.jsp │ │ ├── chart.html │ │ ├── css │ │ ├── graph-colours.css │ │ ├── mocha.css │ │ └── styles.css │ │ ├── editWebHook.jsp │ │ ├── editWebHookRunnerParams.jsp │ │ ├── endpointRequests.jsp │ │ ├── js │ │ ├── addWebhookTemplate.js │ │ ├── admin-chart.js │ │ ├── editWebhook.js │ │ ├── editWebhookCommon.js │ │ ├── editWebhookConfiguration-old.js │ │ ├── editWebhookConfiguration.js │ │ ├── editWebhookConfigurationWithoutRestApi.js │ │ ├── editWebhookFilter.js │ │ ├── editWebhookHeader.js │ │ ├── editWebhookParameter.js │ │ ├── editWebhookTemplate.js │ │ ├── noRestApi.js │ │ └── tests │ │ │ ├── code-paths.md │ │ │ ├── editWebhookConfiguration.tests.js │ │ │ └── test-data.js │ │ ├── jsconfig.json │ │ ├── jsp-includes │ │ ├── deleteWebHookDialog.jsp │ │ ├── deleteWebHookFilterDialog.jsp │ │ ├── deleteWebHookHeaderDialog.jsp │ │ ├── deleteWebHookParameterDialog.jsp │ │ ├── editWebHookDialog.jsp │ │ ├── editWebHookFilterDialog.jsp │ │ ├── editWebHookHeaderDialog.jsp │ │ ├── editWebHookParameterDialog.jsp │ │ ├── noRestApiDialog.jsp │ │ ├── projectParametersTable.jsp │ │ ├── projectParentItemsTable.jsp │ │ ├── projectTemplatesTable.jsp │ │ └── projectWebHooksTable.jsp │ │ ├── settingsList.jsp │ │ ├── templateDiff.jsp │ │ ├── templateEdit.jsp │ │ ├── templateEditListBuildEventTemplates.jsp │ │ ├── templateEditNotFound.jsp │ │ ├── templateList.jsp │ │ ├── templateRendering.jsp │ │ ├── viewHistory.jsp │ │ ├── viewWebHookRunnerParams.jsp │ │ ├── webHookInclude.jsp │ │ ├── webHookProjectSettingsTab.jsp │ │ ├── webHookSearch.jsp │ │ ├── webHookTab.jsp │ │ ├── webHookTabWithHistory.jsp │ │ ├── webhookEdit.jsp │ │ └── webhookJavascriptTests.jsp └── teamcity-plugin-resources │ └── teamcity-plugin.xml └── test ├── java └── webhook │ └── teamcity │ ├── endpoint │ └── WebHookEndPointViewerControllerTest.java │ ├── extension │ ├── WebHookAjaxEditPageControllerTest.java │ └── bean │ │ ├── ProjectWebHooksBeanTest.java │ │ └── StatisticsChartBeanTest.java │ └── json │ └── WebHookConfigurationGsonBuilderTest.java └── resources └── webhook └── webhook-configuration.json /.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | /.classpath 4 | /.project 5 | /.settings 6 | .DS_Store 7 | # Java annotation processor (APT) 8 | .factorypath 9 | -------------------------------------------------------------------------------- /Todo.md: -------------------------------------------------------------------------------- 1 | 2 | ## Todo List 3 | 4 | - Prevent template from being removed if it's in use by a webhook. 5 | - Display JSON (templated) for templates that are of type jsonTemplate 6 | - Support templates other than JSON 7 | - Convert complex payload fields to JSON for templates (or relevant payload if more than JSON supported). eg, changes, buildsteps 8 | - Add support for specifying templating engine (eg, velocity). 9 | - Find some way to be able to specify parts of complex objects. eg buildRunners. 10 | 11 | -------------------------------------------------------------------------------- /docs/icons/FFFFFF-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/FFFFFF-0.png -------------------------------------------------------------------------------- /docs/icons/buildFailed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/buildFailed@2x.png -------------------------------------------------------------------------------- /docs/icons/buildSuccessful@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/buildSuccessful@2x.png -------------------------------------------------------------------------------- /docs/icons/favicon32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/favicon32x32.png -------------------------------------------------------------------------------- /docs/icons/jetbrains-teamcity-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/jetbrains-teamcity-logo.png -------------------------------------------------------------------------------- /docs/icons/redSign@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/redSign@2x.png -------------------------------------------------------------------------------- /docs/icons/teamcity-logo-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/teamcity-logo-128x128.png -------------------------------------------------------------------------------- /docs/icons/teamcity-logo-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/teamcity-logo-256x256.png -------------------------------------------------------------------------------- /docs/icons/teamcity-logo-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/teamcity-logo-48x48.png -------------------------------------------------------------------------------- /docs/icons/teamcity-logo-64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/icons/teamcity-logo-64x64.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AddWebHook_01_ViewBuilds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AddWebHook_01_ViewBuilds.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AddWebHook_02_ChooseWhichProject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AddWebHook_02_ChooseWhichProject.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AddWebHook_03_ClickCreate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AddWebHook_03_ClickCreate.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AddWebHook_04_ConfigureUrlFormatAndEvents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AddWebHook_04_ConfigureUrlFormatAndEvents.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AddWebHook_05_SelectProjectsAndBuilds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AddWebHook_05_SelectProjectsAndBuilds.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AddWebHook_06_Authentication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AddWebHook_06_Authentication.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AddWebHook_07_PreviewPayloadContent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AddWebHook_07_PreviewPayloadContent.png -------------------------------------------------------------------------------- /docs/images/Screenshot_AdminTab_StatsAndErrors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_AdminTab_StatsAndErrors.png -------------------------------------------------------------------------------- /docs/images/Screenshot_EditWebHook_01_ConfigureURLFormatandEvents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_EditWebHook_01_ConfigureURLFormatandEvents.png -------------------------------------------------------------------------------- /docs/images/Screenshot_EditWebHook_02_SelectBuilds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_EditWebHook_02_SelectBuilds.png -------------------------------------------------------------------------------- /docs/images/Screenshot_EditWebHook_03_Authentication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_EditWebHook_03_Authentication.png -------------------------------------------------------------------------------- /docs/images/Screenshot_EditWebHook_04_PreviewPayloadContent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_EditWebHook_04_PreviewPayloadContent.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Edit_Build_Event_Template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Edit_Build_Event_Template.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Edit_Project_Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Edit_Project_Settings.png -------------------------------------------------------------------------------- /docs/images/Screenshot_EndPointViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_EndPointViewer.png -------------------------------------------------------------------------------- /docs/images/Screenshot_REST_API_JAXB_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_REST_API_JAXB_01.png -------------------------------------------------------------------------------- /docs/images/Screenshot_REST_API_JAXB_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_REST_API_JAXB_02.png -------------------------------------------------------------------------------- /docs/images/Screenshot_REST_API_JAXB_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_REST_API_JAXB_03.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Template_preview_and_execute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Template_preview_and_execute.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Templates_AddNewTemplate01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Templates_AddNewTemplate01.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Templates_AddNewTemplate02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Templates_AddNewTemplate02.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Templates_CopyTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Templates_CopyTemplate.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Templates_EditBuildEventTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Templates_EditBuildEventTemplate.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Templates_ListTemplates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Templates_ListTemplates.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Templates_TemplateMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Templates_TemplateMenu.png -------------------------------------------------------------------------------- /docs/images/Screenshot_Templates_ViewTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_Templates_ViewTemplate.png -------------------------------------------------------------------------------- /docs/images/Screenshot_project_webhook_history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_project_webhook_history.png -------------------------------------------------------------------------------- /docs/images/Screenshot_webhook_admin_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_webhook_admin_screen.png -------------------------------------------------------------------------------- /docs/images/Screenshot_webhook_editauth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_webhook_editauth.png -------------------------------------------------------------------------------- /docs/images/Screenshot_webhook_history_errored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_webhook_history_errored.png -------------------------------------------------------------------------------- /docs/images/Screenshot_webhooks_rest_api_admin_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_webhooks_rest_api_admin_page.png -------------------------------------------------------------------------------- /docs/images/Screenshot_webhooks_test_endpoint_viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/docs/images/Screenshot_webhooks_test_endpoint_viewer.png -------------------------------------------------------------------------------- /tcwebhooks-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.classpath 3 | /.project 4 | /.settings 5 | /.apt_generated_tests/ 6 | -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/com/riffpie/common/testing/jersey-test-support/1.0/jersey-test-support-1.0-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/com/riffpie/common/testing/jersey-test-support/1.0/jersey-test-support-1.0-sources.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/com/riffpie/common/testing/jersey-test-support/1.0/jersey-test-support-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/com/riffpie/common/testing/jersey-test-support/1.0/jersey-test-support-1.0.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/10.0/common-impl-10.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/10.0/common-impl-10.0.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/10.0/common-impl-10.0.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | common-impl 7 | 10.0 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/2018.2.1/common-impl-2018.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/2018.2.1/common-impl-2018.2.1.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/2018.2.1/common-impl-2018.2.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | common-impl 7 | 2018.2.1 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/9.1.7/common-impl-9.1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/9.1.7/common-impl-9.1.7.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/9.1.7/common-impl-9.1.7.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | common-impl 7 | 9.1.7 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/9.1/common-impl-9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/9.1/common-impl-9.1.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/common-impl/9.1/common-impl-9.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | common-impl 7 | 9.1 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/server/2018.2.1/server-2018.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/server/2018.2.1/server-2018.2.1.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/server/2018.2.1/server-2018.2.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | server 7 | 2018.2.1 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/server/2018.2/server-2018.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/server/2018.2/server-2018.2.jar -------------------------------------------------------------------------------- /tcwebhooks-core/local-mvn-repo/org/jetbrains/teamcity/server/2018.2/server-2018.2.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | server 7 | 2018.2 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/docs/images/FFFFFF-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/src/docs/images/FFFFFF-0.png -------------------------------------------------------------------------------- /tcwebhooks-core/src/docs/images/TeamCity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/src/docs/images/TeamCity.png -------------------------------------------------------------------------------- /tcwebhooks-core/src/docs/images/buildFailed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/src/docs/images/buildFailed@2x.png -------------------------------------------------------------------------------- /tcwebhooks-core/src/docs/images/buildSuccessful@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/src/docs/images/buildSuccessful@2x.png -------------------------------------------------------------------------------- /tcwebhooks-core/src/docs/images/redSign@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/src/docs/images/redSign@2x.png -------------------------------------------------------------------------------- /tcwebhooks-core/src/docs/screenshots/tcwebhooks-Flowdock_example_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/src/docs/screenshots/tcwebhooks-Flowdock_example_output.png -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/CommonUtils.java: -------------------------------------------------------------------------------- 1 | package webhook; 2 | 3 | import jetbrains.buildServer.serverSide.SProject; 4 | 5 | public class CommonUtils { 6 | 7 | private CommonUtils() {} 8 | 9 | public static String getSensibleProjectName(SProject project){ 10 | if (project.getProjectId().equals(Constants.ROOT_PROJECT_ID)) { 11 | return project.getProjectId(); 12 | } 13 | return project.getName(); 14 | } 15 | 16 | public static String getSensibleProjectFullName(SProject project){ 17 | if (project.getProjectId().equals(Constants.ROOT_PROJECT_ID)) { 18 | return project.getProjectId(); 19 | } 20 | return project.getFullName(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/Constants.java: -------------------------------------------------------------------------------- 1 | package webhook; 2 | 3 | public class Constants { 4 | 5 | private Constants() {} 6 | 7 | public static final String ROOT_PROJECT_ID = "_Root"; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/WebHookParameterReferenceException.java: -------------------------------------------------------------------------------- 1 | package webhook; 2 | 3 | public class WebHookParameterReferenceException extends Exception { 4 | private final String key; 5 | 6 | public WebHookParameterReferenceException(String key){ 7 | super(); 8 | this.key = key; 9 | } 10 | 11 | public String getKey(){ 12 | return this.key; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/BuildStateInterface.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | public interface BuildStateInterface { 4 | public boolean isEnabled(); 5 | public void enable(); 6 | public void disable(); 7 | public String getShortName(); 8 | public String getDescriptionSuffix(); 9 | } 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/BuildTypeIdResolver.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import java.util.Collection; 4 | import java.util.Set; 5 | 6 | public interface BuildTypeIdResolver { 7 | 8 | String getExternalBuildTypeId(String internalBuildTypeId); 9 | Set getExternalBuildTypeIds(Collection internalBuildTypeIds); 10 | String getInternalBuildTypeId(String externalBuildTypeId); 11 | Set getInternalBuildTypeIds(Collection externalBuildTypeIds); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/DeferrableService.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | public interface DeferrableService { 4 | 5 | /** 6 | * Register with the deferred startup service. 7 | * Later it will invoke the deferredStart method. 8 | */ 9 | public void requestDeferredRegistration(); 10 | 11 | /** 12 | * Run any initialisation code after TeamCity has started. 13 | */ 14 | public void register(); 15 | 16 | /** 17 | * Run any shutdown code when the plug-in is unloaded or TeamCity is shutting down. 18 | */ 19 | public void unregister(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/DeferrableServiceManager.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | public interface DeferrableServiceManager { 4 | 5 | public void registerService(DeferrableService deferrableService); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/Loggers.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import com.intellij.openapi.diagnostic.Logger; 4 | 5 | public final class Loggers { 6 | public static final Logger SERVER = Logger.getInstance("jetbrains.buildServer.SERVER.tcWebHooks"); 7 | 8 | private Loggers(){} 9 | } 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/ProbableJaxbJarConflictErrorException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import javax.xml.bind.JAXBException; 4 | 5 | public class ProbableJaxbJarConflictErrorException extends Exception { 6 | 7 | private static final long serialVersionUID = -640816951469652309L; 8 | 9 | public ProbableJaxbJarConflictErrorException(JAXBException jaxbException) { 10 | super(jaxbException); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/ProjectIdResolver.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | public interface ProjectIdResolver { 4 | 5 | String getExternalProjectId(String internalProjectId); 6 | String getInternalProjectId(String externalProjectId); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/TeamCityCoreFacade.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | import java.util.List; 3 | 4 | import org.jetbrains.annotations.NotNull; 5 | import org.jetbrains.annotations.Nullable; 6 | 7 | import jetbrains.buildServer.serverSide.SProject; 8 | 9 | public interface TeamCityCoreFacade { 10 | 11 | //PROJECTS 12 | @Nullable 13 | SProject findProjectByExtId(@Nullable String projectExtId); 14 | 15 | @Nullable 16 | SProject findProjectByIntId(String projectIntId); 17 | 18 | @NotNull 19 | List getActiveProjects(); 20 | 21 | void persist(@NotNull String project, @NotNull String description); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookContentResolutionException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class WebHookContentResolutionException extends WebHookExecutionException { 7 | 8 | private static final long serialVersionUID = 2327979470726268623L; 9 | public WebHookContentResolutionException(String message) { 10 | super(message, WEBHOOK_CONTENT_RESOLUTION_ERROR_CODE); 11 | } 12 | 13 | public WebHookContentResolutionException(String message, int errorCode) { 14 | super(message, errorCode); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import webhook.WebHook; 4 | import webhook.WebHookProxyConfig; 5 | import webhook.teamcity.settings.WebHookConfig; 6 | 7 | public interface WebHookFactory { 8 | public abstract WebHook getWebHook(WebHookConfig webhookConfig, WebHookProxyConfig pc); 9 | } 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookHttpClientFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import org.apache.http.client.HttpClient; 4 | 5 | public interface WebHookHttpClientFactory { 6 | public abstract HttpClient getHttpClient(); 7 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookHttpClientFactoryImpl.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import org.apache.http.client.HttpClient; 4 | import org.apache.http.impl.client.HttpClients; 5 | 6 | public class WebHookHttpClientFactoryImpl implements WebHookHttpClientFactory { 7 | 8 | @Override 9 | public HttpClient getHttpClient(){ 10 | return HttpClients.createDefault(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookHttpExecutionException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class WebHookHttpExecutionException extends WebHookExecutionException { 7 | 8 | private static final long serialVersionUID = 2824659645558904102L; 9 | public WebHookHttpExecutionException(String message) { 10 | super(message, WEBHOOK_EXECUTION_ERROR_CODE); 11 | } 12 | public WebHookHttpExecutionException(String message, Throwable throwable) { 13 | super(message, throwable, WEBHOOK_EXECUTION_ERROR_CODE); 14 | } 15 | public WebHookHttpExecutionException(String message, int errorCode) { 16 | super(message, errorCode); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookHttpResponseException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class WebHookHttpResponseException extends WebHookExecutionException { 7 | 8 | private static final long serialVersionUID = 2824659645558904102L; 9 | 10 | public WebHookHttpResponseException(String message, int errorCode) { 11 | super(message, errorCode); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookPluginDataResolver.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public interface WebHookPluginDataResolver { 7 | 8 | boolean isWebHooksRestApiInstalled(); 9 | @Nullable String getWebHooksRestApiVersion(); 10 | boolean isWebHooksCoreAndApiVersionTheSame(); 11 | @NotNull String getWebHooksCoreVersion(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookSettingsEventHandler.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | public interface WebHookSettingsEventHandler { 7 | public void handleEvent(WebHookSettingsEvent event); 8 | 9 | public interface WebHookSettingsEvent { 10 | WebHookSettingsEventType getEventType(); 11 | String getProjectInternalId(); 12 | String getBuildTypeInternalId(); 13 | Object getBaggage(); 14 | } 15 | 16 | @Data 17 | @AllArgsConstructor 18 | public static class WebHookSettingsEventImpl implements WebHookSettingsEvent { 19 | WebHookSettingsEventType eventType; 20 | String projectInternalId; 21 | String buildTypeInternalId; 22 | Object baggage; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookSettingsEventType.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | public enum WebHookSettingsEventType { 4 | PROJECT_CHANGED, BUILD_TYPE_DELETED, PROJECT_PERSISTED; 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/WebHookTemplateParsingException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class WebHookTemplateParsingException extends WebHookContentResolutionException { 7 | 8 | private static final long serialVersionUID = -3373028723068101280L; 9 | 10 | public WebHookTemplateParsingException(String message) { 11 | super(message, WEBHOOK_TEMPLATE_PARSING_EXCEPTION_ERROR_CODE); 12 | } 13 | 14 | public WebHookTemplateParsingException(String message, int errorCode) { 15 | super(message, errorCode); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/auth/AbstractWebHookAuthenticator.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.auth; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | public abstract class AbstractWebHookAuthenticator implements WebHookAuthenticator { 6 | 7 | protected WebHookAuthConfig config; 8 | 9 | @Override 10 | @NotNull 11 | public WebHookAuthConfig getWebHookAuthConfig() { 12 | return config; 13 | } 14 | 15 | @Override 16 | public void setWebHookAuthConfig(WebHookAuthConfig authenticationConfig) { 17 | this.config = authenticationConfig; 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/auth/WebHookAuthConfig.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.auth; 2 | 3 | import java.util.LinkedHashMap; 4 | import java.util.Map; 5 | 6 | import lombok.AllArgsConstructor; 7 | import lombok.Getter; 8 | import lombok.NoArgsConstructor; 9 | import lombok.Setter; 10 | 11 | @Getter @Setter @AllArgsConstructor @NoArgsConstructor 12 | public class WebHookAuthConfig { 13 | private String type = ""; 14 | private Boolean preemptive = true; 15 | 16 | private Map parameters = new LinkedHashMap<>(); 17 | 18 | public WebHookAuthConfig copy() { 19 | WebHookAuthConfig newConfig = new WebHookAuthConfig(); 20 | newConfig.setType(this.getType()); 21 | newConfig.setPreemptive(this.getPreemptive()); 22 | newConfig.getParameters().putAll(getParameters()); 23 | return newConfig; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/auth/WebHookAuthenticationParameter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.auth; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Getter; 6 | 7 | @Getter @AllArgsConstructor @Builder 8 | public class WebHookAuthenticationParameter { 9 | 10 | private String key; 11 | private boolean required; 12 | private boolean hidden; 13 | private String name; 14 | private String toolTip; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/auth/WebHookAuthenticator.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.auth; 2 | 3 | import org.apache.http.client.CredentialsProvider; 4 | import org.apache.http.client.protocol.HttpClientContext; 5 | 6 | public interface WebHookAuthenticator { 7 | public WebHookAuthConfig getWebHookAuthConfig(); 8 | public String getWwwAuthenticateChallengePrefix(); 9 | public void addAuthentication (CredentialsProvider credentialsProvider, HttpClientContext httpClientContext, String url); 10 | public void setWebHookAuthConfig(WebHookAuthConfig authenticationConfig); 11 | } 12 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/auth/WebHookAuthenticatorFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.auth; 2 | 3 | import java.util.List; 4 | 5 | public interface WebHookAuthenticatorFactory { 6 | public String getName(); 7 | public String getDescription(); 8 | public void register(); 9 | public WebHookAuthenticator getAuthenticatorInstance(); 10 | public List getParameterList(); 11 | public boolean areAllRequiredParametersPresent(WebHookAuthConfig webHookAuthConfig); 12 | } 13 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/auth/bearer/TokenCredentials.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.auth.bearer; 2 | import java.security.Principal; 3 | 4 | import org.apache.http.auth.BasicUserPrincipal; 5 | import org.apache.http.auth.Credentials; 6 | 7 | public class TokenCredentials implements Credentials { 8 | private Principal userPrincipal; 9 | 10 | public TokenCredentials(String token) { 11 | this.userPrincipal = new BasicUserPrincipal(token); 12 | } 13 | 14 | @Override 15 | public Principal getUserPrincipal() { 16 | return userPrincipal; 17 | } 18 | 19 | @Override 20 | public String getPassword() { 21 | return null; 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/exception/NonExistantProjectException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.exception; 2 | 3 | import lombok.Getter; 4 | 5 | public class NonExistantProjectException extends RuntimeException { 6 | private static final long serialVersionUID = 1L; 7 | 8 | @Getter 9 | private final String projectID; 10 | 11 | public NonExistantProjectException(String message, String projectId) { 12 | super(message); 13 | this.projectID = projectId; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/exception/OperationUnsupportedException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.exception; 2 | 3 | public class OperationUnsupportedException extends RuntimeException { 4 | 5 | public OperationUnsupportedException(String string) { 6 | super(string); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/exception/StatisticsFileOperationException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.exception; 2 | 3 | public class StatisticsFileOperationException extends Exception { 4 | 5 | public StatisticsFileOperationException(String message, Throwable e) { 6 | super(message, e); 7 | } 8 | 9 | public StatisticsFileOperationException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/executor/WebHookRunner.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.executor; 2 | 3 | import webhook.teamcity.history.WebHookHistoryItem; 4 | import webhook.teamcity.history.WebHookHistoryItem.WebHookErrorStatus; 5 | 6 | public interface WebHookRunner extends Runnable { 7 | 8 | public WebHookHistoryItem getWebHookHistoryItem(); 9 | public WebHookHistoryItem buildWebHookHistoryItem(WebHookErrorStatus webHookErrorStatus); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/executor/WebHookSerialExecutor.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.executor; 2 | 3 | public interface WebHookSerialExecutor extends WebHookExecutor, WebHookStatisticsExecutor { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/executor/WebHookStatisticsExecutor.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.executor; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import jetbrains.buildServer.serverSide.SProject; 6 | import webhook.WebHook; 7 | import webhook.teamcity.BuildStateEnum; 8 | import webhook.teamcity.settings.WebHookConfig; 9 | import webhook.teamcity.statistics.StatisticsReport; 10 | 11 | public interface WebHookStatisticsExecutor { 12 | 13 | public void execute( 14 | @NotNull WebHook webHook, 15 | @NotNull WebHookConfig whc, 16 | @NotNull BuildStateEnum state, 17 | @NotNull StatisticsReport report, 18 | @NotNull SProject rootProject, 19 | boolean isTest 20 | ); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/executor/WebHookThreadingExecutor.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.executor; 2 | 3 | public interface WebHookThreadingExecutor extends WebHookExecutor { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/executor/WebHookThreadingExecutorFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.executor; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | 5 | public interface WebHookThreadingExecutorFactory { 6 | 7 | public ExecutorService getExecutorService(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/history/GeneralisedWebAddress.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.history; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GeneralisedWebAddress { 7 | private GeneralisedWebAddressType addressType; 8 | private String generalisedAddress; 9 | 10 | public static GeneralisedWebAddress build(String generalisedAddress, GeneralisedWebAddressType type) { 11 | GeneralisedWebAddress generalisedWebAddress = new GeneralisedWebAddress(); 12 | generalisedWebAddress.setGeneralisedAddress(generalisedAddress); 13 | generalisedWebAddress.setAddressType(type); 14 | return generalisedWebAddress; 15 | } 16 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/history/GeneralisedWebAddressType.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.history; 2 | 3 | public enum GeneralisedWebAddressType { 4 | IPV4_ADDRESS, // Just the first 3 dotted quad and an x, eg 192.168.1.x 5 | IPV6_ADDRESS, // TODO: Need to only return enough here that it is not identifiable 6 | HOST_ADDRESS, // For things like "localhost" or "myserver" 7 | DOMAIN_NAME; // Domain name, like google.com, slack.com, etc. 8 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/history/MaxSizeHashMap.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.history; 2 | 3 | import java.util.LinkedHashMap; 4 | import java.util.Map; 5 | 6 | import lombok.EqualsAndHashCode; 7 | 8 | @EqualsAndHashCode(callSuper=true) 9 | public class MaxSizeHashMap extends LinkedHashMap { 10 | private static final long serialVersionUID = -8518874910030309391L; 11 | private final int maxSize; 12 | 13 | public MaxSizeHashMap(int maxSize) { 14 | this.maxSize = maxSize; 15 | } 16 | 17 | @Override 18 | protected boolean removeEldestEntry(Map.Entry eldest) { 19 | return size() > maxSize; 20 | } 21 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/history/WebAddressTransformer.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.history; 2 | 3 | import java.net.URL; 4 | 5 | public interface WebAddressTransformer { 6 | 7 | /** 8 | * Extracts the hostname from a URL, generalises it (eg, convert web.api.blah.google.com => google.com) 9 | * and returns the generalised version as a string; 10 | * Special cases like hostnames without a domain, ipv4 addresses, ipv6Addresses 11 | * @param uri 12 | * @return {@link GeneralisedWebAddress} 13 | */ 14 | public GeneralisedWebAddress getGeneralisedHostName(URL uri); 15 | public GeneralisedWebAddress getGeneralisedHostName(String url); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/jaxb/DateMidnightAdapter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.jaxb; 2 | import javax.xml.bind.annotation.adapters.XmlAdapter; 3 | import org.joda.time.DateMidnight; 4 | 5 | public class DateMidnightAdapter 6 | extends XmlAdapter { 7 | 8 | public DateMidnight unmarshal(String v) throws Exception { 9 | return new DateMidnight(v); 10 | } 11 | 12 | public String marshal(DateMidnight v) throws Exception { 13 | return v.toString(); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/jaxb/DateTimeAdapter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.jaxb; 2 | import javax.xml.bind.annotation.adapters.XmlAdapter; 3 | import org.joda.time.DateTime; 4 | 5 | public class DateTimeAdapter 6 | extends XmlAdapter{ 7 | 8 | public DateTime unmarshal(String v) throws Exception { 9 | return new DateTime(v); 10 | } 11 | 12 | public String marshal(DateTime v) throws Exception { 13 | return v.toString(); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/jaxb/LocalDateAdapter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.jaxb; 2 | import javax.xml.bind.annotation.adapters.XmlAdapter; 3 | import org.joda.time.LocalDate; 4 | 5 | public class LocalDateAdapter 6 | extends XmlAdapter{ 7 | 8 | public LocalDate unmarshal(String v) throws Exception { 9 | return new LocalDate(v); 10 | } 11 | 12 | public String marshal(LocalDate v) throws Exception { 13 | return v.toString(); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/jaxb/LocalDateTimeAdapter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.jaxb; 2 | import javax.xml.bind.annotation.adapters.XmlAdapter; 3 | import org.joda.time.LocalDateTime; 4 | 5 | public class LocalDateTimeAdapter 6 | extends XmlAdapter{ 7 | 8 | public LocalDateTime unmarshal(String v) throws Exception { 9 | return new LocalDateTime(v); 10 | } 11 | 12 | public String marshal(LocalDateTime v) throws Exception { 13 | return v.toString(); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/jaxb/LocalTimeAdapter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.jaxb; 2 | import javax.xml.bind.annotation.adapters.XmlAdapter; 3 | import org.joda.time.LocalTime; 4 | 5 | public class LocalTimeAdapter 6 | extends XmlAdapter { 7 | 8 | public LocalTime unmarshal(String v) throws Exception { 9 | return new LocalTime(v); 10 | } 11 | 12 | public String marshal(LocalTime v) throws Exception { 13 | return v.toString(); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/PayloadTemplateEngineType.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public enum PayloadTemplateEngineType { 7 | 8 | LEGACY ("${", "}", false), 9 | STANDARD ("${", "}", true), 10 | VELOCITY ("#", ")" , true); 11 | 12 | String variablePrefix; 13 | String variableSuffix; 14 | boolean isTemplated; 15 | 16 | PayloadTemplateEngineType(String prefix, String suffix, boolean isTemplated) { 17 | this.variablePrefix = prefix; 18 | this.variableSuffix = suffix; 19 | this.isTemplated = isTemplated; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/UnsupportedWebHookFormatException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload; 2 | 3 | import webhook.teamcity.WebHookContentResolutionException; 4 | 5 | public class UnsupportedWebHookFormatException extends WebHookContentResolutionException { 6 | 7 | private static final long serialVersionUID = -3763862515669344112L; 8 | 9 | public UnsupportedWebHookFormatException(String formatName) { 10 | super("No WebHook format '" + formatName + "' was found", UNSUPPORTED_WEBHOOK_FORMAT_EXCEPTION_ERROR_CODE); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/WebHookContentObjectSerialiser.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload; 2 | 3 | public interface WebHookContentObjectSerialiser { 4 | 5 | public abstract Object serialiseObject(Object object); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/WebHookPayloadRankingComparator.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload; 2 | 3 | import java.util.Comparator; 4 | 5 | public class WebHookPayloadRankingComparator implements Comparator { 6 | 7 | public int compare(WebHookPayload payload1, WebHookPayload payload2) { 8 | if (payload1.getRank() > payload2.getRank()){ 9 | return 1; 10 | } else if (payload1.getRank() < payload2.getRank()){ 11 | return -1; 12 | } else { 13 | return 0; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/WebHookTemplateRankingComparator.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload; 2 | 3 | import java.util.Comparator; 4 | 5 | public class WebHookTemplateRankingComparator implements Comparator { 6 | 7 | public int compare(WebHookPayloadTemplate template1, WebHookPayloadTemplate template2) { 8 | // First compare the rank of the template 9 | if (template1.getRank() > template2.getRank()){ 10 | return 1; 11 | } else if (template1.getRank() < template2.getRank()){ 12 | return -1; 13 | 14 | // If both templates have the same rank, compare the name and sort alphabetically 15 | } else { 16 | int res = String.CASE_INSENSITIVE_ORDER.compare(template1.getTemplateId(), template2.getTemplateId()); 17 | return (res != 0) ? res : template1.getTemplateId().compareTo(template2.getTemplateId()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/content/WebHookPayloadContentAssemblyException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.content; 2 | 3 | import webhook.teamcity.WebHookContentResolutionException; 4 | 5 | public class WebHookPayloadContentAssemblyException extends WebHookContentResolutionException { 6 | 7 | private static final long serialVersionUID = 5186986877713082013L; 8 | 9 | public WebHookPayloadContentAssemblyException(String message) { 10 | super(message, WEBHOOK_PAYLOAD_CONTENT_ASSEMBLY_EXCEPTION_ERROR_CODE); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/content/WebHooksBranchImpl.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.content; 2 | 3 | import jetbrains.buildServer.serverSide.Branch; 4 | 5 | public class WebHooksBranchImpl implements Branch { 6 | 7 | String displayName; 8 | String name; 9 | boolean isDefaultBranch; 10 | 11 | public WebHooksBranchImpl(Branch branch) { 12 | this.displayName = branch.getDisplayName(); 13 | this.name = branch.getName(); 14 | this.isDefaultBranch = branch.isDefaultBranch(); 15 | } 16 | 17 | @Override 18 | public String getDisplayName() { 19 | return this.displayName; 20 | } 21 | 22 | @Override 23 | public String getName() { 24 | return this.name; 25 | } 26 | 27 | @Override 28 | public boolean isDefaultBranch() { 29 | return this.isDefaultBranch; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/content/WebHooksChangeBuilder.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.content; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import jetbrains.buildServer.vcs.SVcsModification; 7 | 8 | public class WebHooksChangeBuilder{ 9 | private WebHooksChangeBuilder(){} 10 | 11 | public static List build (List mods, boolean includeVcsFileModifications){ 12 | List changes = new ArrayList<>(); 13 | 14 | for (SVcsModification modification: mods){ 15 | changes.add(new WebHooksChanges(modification.getDisplayVersion(), WebHooksChange.build(modification, includeVcsFileModifications))); 16 | } 17 | return changes; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/content/WebHooksChanges.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.content; 2 | 3 | public class WebHooksChanges { 4 | private String version; 5 | private WebHooksChange change; 6 | 7 | public WebHooksChanges(String version, WebHooksChange change) { 8 | this.version = version; 9 | this.change = change; 10 | } 11 | 12 | public String getVersion() { 13 | return version; 14 | } 15 | 16 | public WebHooksChange getChange() { 17 | return change; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/content/WebHooksComment.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.content; 2 | 3 | import jetbrains.buildServer.serverSide.comments.Comment; 4 | 5 | public class WebHooksComment { 6 | 7 | String name = ""; 8 | String comment = ""; 9 | 10 | public static WebHooksComment build (Comment comment){ 11 | if (comment != null){ 12 | WebHooksComment buildComment = new WebHooksComment(); 13 | if (comment.getUser() != null){ 14 | buildComment.name = comment.getUser().getDescriptiveName(); 15 | } 16 | buildComment.comment = comment.getComment(); 17 | return buildComment; 18 | } 19 | return null; 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public String getComment() { 27 | return comment; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return name + ": " + comment; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/convertor/UserSingleValueConverter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.convertor; 2 | 3 | import com.thoughtworks.xstream.converters.SingleValueConverter; 4 | 5 | import jetbrains.buildServer.users.User; 6 | 7 | public class UserSingleValueConverter implements SingleValueConverter { 8 | 9 | @Override 10 | @SuppressWarnings("rawtypes") 11 | public boolean canConvert(Class clazz) { 12 | return User.class.isAssignableFrom(clazz); 13 | } 14 | 15 | @Override 16 | public String toString(Object obj) { 17 | return ((User) obj).getUsername(); 18 | } 19 | 20 | /* 21 | * We don't support unmarshalling. One way only I'm afraid. 22 | */ 23 | 24 | @Override 25 | public Object fromString(String str) { 26 | return null; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/template/AbstractWebHookTemplate.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.template; 2 | 3 | import webhook.teamcity.payload.WebHookPayloadTemplate; 4 | import webhook.teamcity.payload.WebHookTemplateManager; 5 | 6 | public abstract class AbstractWebHookTemplate implements WebHookPayloadTemplate { 7 | 8 | protected WebHookTemplateManager manager; 9 | int rank = 10; // Default to 10. 10 | 11 | @Override 12 | public void setTemplateManager(WebHookTemplateManager webhookTemplateManager) { 13 | this.manager = webhookTemplateManager; 14 | } 15 | 16 | @Override 17 | public int getRank() { 18 | return rank; 19 | } 20 | 21 | @Override 22 | public void setRank(Integer rank) { 23 | this.rank = rank; 24 | } 25 | 26 | public void register(WebHookPayloadTemplate template){ 27 | this.manager.registerTemplateFormatFromSpring(template); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/template/render/HtmlRenderer.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.template.render; 2 | 3 | import java.util.Map; 4 | 5 | import org.apache.commons.lang3.StringEscapeUtils; 6 | 7 | public class HtmlRenderer implements WebHookStringRenderer { 8 | 9 | @Override 10 | public String render(String input) { 11 | return StringEscapeUtils.escapeHtml4(input); 12 | } 13 | 14 | 15 | @Override 16 | public String render(Map input) throws WebHookHtmlRendererException { 17 | throw new WebHookHtmlRendererException("Not expecting a Map."); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/template/render/WebHookStringRenderer.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.template.render; 2 | 3 | import java.util.Map; 4 | 5 | public interface WebHookStringRenderer { 6 | public abstract String render(String input) throws WebHookHtmlRendererException; 7 | public abstract String render(Map input) throws WebHookHtmlRendererException; 8 | 9 | public static class WebHookHtmlRendererException extends Exception { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | public WebHookHtmlRendererException(Exception ex) { 14 | super(ex); 15 | } 16 | 17 | public WebHookHtmlRendererException(String message) { 18 | super(message); 19 | } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/template/render/XmlToHtmlPrettyPrintingRenderer.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.template.render; 2 | 3 | import java.util.Map; 4 | 5 | public class XmlToHtmlPrettyPrintingRenderer implements WebHookStringRenderer { 6 | 7 | 8 | HtmlRenderer htmlr = new HtmlRenderer(); 9 | 10 | @Override 11 | public String render(String uglyXmlString) throws WebHookHtmlRendererException { 12 | return "
" + htmlr.render(uglyXmlString) + "
"; 13 | } 14 | 15 | @Override 16 | public String render(Map input) throws WebHookHtmlRendererException { 17 | throw new WebHookHtmlRendererException("Not expecting a Map."); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/util/StringSanitiser.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.util; 2 | 3 | public class StringSanitiser { 4 | 5 | private StringSanitiser(){} 6 | 7 | public static String sanitise(String dirtyString) { 8 | return dirtyString 9 | .replace("<", "_") 10 | .replace(">", "_") 11 | .replace("\\", "_") 12 | .replace("/", "_") 13 | .replace("$", "_") 14 | .replace("%", "_") 15 | .replace("#", "_") 16 | .replace("@", "_") 17 | .replace("!", "_") 18 | .replace("`", "_") 19 | .replace("~", "_") 20 | .replace("?", "_") 21 | .replace("|", "_") 22 | .replace("*", "_") 23 | .replace("(", "_") 24 | .replace(")", "_") 25 | .replace("^", "_") 26 | ; 27 | } 28 | 29 | public static String sanitize(String dirtyString){ 30 | return sanitise(dirtyString); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/variableresolver/VariableMessageBuilder.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.variableresolver; 2 | 3 | public interface VariableMessageBuilder { 4 | 5 | public abstract String build(String template); 6 | public abstract void addWebHookPayload(String webHookContent); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/variableresolver/VariableResolver.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.variableresolver; 2 | 3 | public interface VariableResolver { 4 | public String resolve(String variable); 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/variableresolver/WebHookVariableResolverManager.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.variableresolver; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import webhook.teamcity.payload.PayloadTemplateEngineType; 7 | 8 | public interface WebHookVariableResolverManager { 9 | 10 | void registerVariableResolverFactory(VariableResolverFactory factory); 11 | 12 | VariableResolverFactory getVariableResolverFactory(PayloadTemplateEngineType type); 13 | 14 | Map getAllVariableResolverFactoriesMap(); 15 | List getAllVariableResolverFactories(); 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/variableresolver/velocity/VelocityCapitalizeDirective.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.variableresolver.velocity; 2 | public class VelocityCapitalizeDirective extends VelocityCapitaliseDirective { 3 | 4 | @Override 5 | public String getName() { 6 | return "capitalize"; 7 | } 8 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/variableresolver/velocity/VelocityNullUtils.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.variableresolver.velocity; 2 | 3 | import java.util.Objects; 4 | 5 | public class VelocityNullUtils { 6 | 7 | private static final String UNRESOLVED = "UNRESOLVED"; 8 | 9 | public Object toUnResolved(Object value) { 10 | if (Objects.isNull(value)) { 11 | return UNRESOLVED; 12 | } 13 | return value; 14 | } 15 | 16 | public Object toUnResolved(Object value, boolean wrapWithQuotes) { 17 | if (Objects.isNull(value)) { 18 | return wrapWithQuotes ? "\"" + toUnResolved(value) + "\"" : toUnResolved(value); 19 | } 20 | return value; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/payload/variableresolver/velocity/VelocitySanitizeDirective.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.payload.variableresolver.velocity; 2 | public class VelocitySanitizeDirective extends VelocitySanitiseDirective { 3 | 4 | @Override 5 | public String getName() { 6 | return "sanitize"; 7 | } 8 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/WebHookConfigChangeHandler.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings; 2 | 3 | public interface WebHookConfigChangeHandler { 4 | public abstract void handleConfigFileChange(); 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/WebHookProjectSettingsFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings; 2 | 3 | import jetbrains.buildServer.serverSide.settings.ProjectSettingsFactory; 4 | import jetbrains.buildServer.serverSide.settings.ProjectSettingsManager; 5 | import webhook.teamcity.Loggers; 6 | 7 | public class WebHookProjectSettingsFactory implements ProjectSettingsFactory { 8 | 9 | public WebHookProjectSettingsFactory(ProjectSettingsManager projectSettingsManager){ 10 | Loggers.SERVER.debug("WebHookProjectSettingsFactory :: Registering"); 11 | projectSettingsManager.registerSettingsFactory("webhooks", this); 12 | } 13 | 14 | public WebHookProjectSettings createProjectSettings(String projectId) { 15 | Loggers.SERVER.info("WebHookProjectSettingsFactory: re-reading settings for " + projectId); 16 | return new WebHookProjectSettings(); 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/WebHookSearchResult.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter 10 | public class WebHookSearchResult { 11 | private List matches = new ArrayList<>(); 12 | @Setter 13 | private WebHookConfigEnhanced webHookConfigEnhanced; 14 | @Setter 15 | private boolean filteredResult = false; 16 | 17 | public void addMatch(Match match) { 18 | this.matches.add(match); 19 | } 20 | 21 | public enum Match { 22 | SHOW, TAG, URL, ID, TEMPLATE, PAYLOAD_FORMAT, PROJECT, BUILD_TYPE 23 | } 24 | 25 | public WebHookConfig getWebHookConfig() { 26 | return this.webHookConfigEnhanced.getWebHookConfig(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/WebHookSecureValuesEnquirer.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings; 2 | 3 | public interface WebHookSecureValuesEnquirer { 4 | 5 | public boolean isHideSecureValuesEnabled(String webhookId); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/WebHookUpdateResult.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class WebHookUpdateResult { 7 | boolean updated; 8 | WebHookConfig webHookConfig; 9 | 10 | public WebHookUpdateResult(Boolean updated, WebHookConfig webHookConfig) { 11 | this.updated = updated; 12 | this.webHookConfig = webHookConfig; 13 | } 14 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/project/WebHookParameter.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings.project; 2 | 3 | public interface WebHookParameter { 4 | 5 | public String getId(); 6 | public void setId(String id); 7 | 8 | public String getName(); 9 | public void setName(String name); 10 | 11 | public String getValue(); 12 | public void setValue(String value); 13 | 14 | public Boolean getSecure(); 15 | public void setSecure(Boolean isSecure); 16 | 17 | public Boolean getIncludedInLegacyPayloads(); 18 | public void setIncludedInLegacyPayloads(Boolean isIncluded); 19 | public Boolean getForceResolveTeamCityVariable(); 20 | public void setForceResolveTeamCityVariable(Boolean isForceResolved); 21 | 22 | public String getTemplateEngine(); 23 | 24 | public void setTemplateEngine(String payloadTemplateEngineType); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/project/WebHookParameterStoreFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings.project; 2 | 3 | public interface WebHookParameterStoreFactory { 4 | 5 | public WebHookParameterStore getWebHookParameterStore(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/secure/WebHookSecretResolver.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings.secure; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import jetbrains.buildServer.serverSide.SProject; 6 | 7 | public interface WebHookSecretResolver { 8 | 9 | public String getSecret(@NotNull SProject sProject, @NotNull String token); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/settings/secure/WebHookSecretResolverNoOpImpl.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings.secure; 2 | 3 | import jetbrains.buildServer.serverSide.SProject; 4 | import webhook.teamcity.Loggers; 5 | 6 | public class WebHookSecretResolverNoOpImpl implements WebHookSecretResolver { 7 | 8 | public WebHookSecretResolverNoOpImpl() { 9 | Loggers.SERVER.info("WebHookSecretResolverNoOpImpl :: Starting WebHookSecretResolver for verions older than 2017.1"); 10 | } 11 | 12 | 13 | @Override 14 | public String getSecret(SProject sProject, String token) { 15 | return null; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/statistics/NoOpValueHasher.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.statistics; 2 | 3 | public class NoOpValueHasher implements ValueHasher { 4 | 5 | @Override 6 | public String hash(String plain) { 7 | return plain; 8 | } 9 | @Override 10 | public String hash(String plain, String salt) { 11 | return plain; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/statistics/StatisticsJaxHelper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.statistics; 2 | 3 | public class StatisticsJaxHelper extends JaxHelperImpl implements JaxHelper{ 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/statistics/StatisticsReport.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.statistics; 2 | 3 | import java.util.List; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class StatisticsReport { 9 | 10 | WebHooksPluginInfo pluginInfo; 11 | TeamCityInstanceInfo instanceInfo; 12 | WebHookConfigurationStatistics configStatistics; 13 | List reports; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/statistics/TeamCityInstanceInfo.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.statistics; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter @Setter 7 | public class TeamCityInstanceInfo { 8 | 9 | String teamcityVersion; 10 | String teamcityBuild; 11 | String teamcityId; 12 | boolean webHookProxyConfigured; 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/statistics/ValueHasher.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.statistics; 2 | 3 | public interface ValueHasher { 4 | public String hash(String plain); 5 | public String hash(String plain, String salt); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/statistics/WebHooksPluginInfo.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.statistics; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class WebHooksPluginInfo { 7 | String tcWehooksVersion; 8 | String tcWebHooksRestApiVersion; 9 | } 10 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/statistics/WebHooksStatisticsReportEventListener.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.statistics; 2 | 3 | import webhook.teamcity.settings.WebHookConfig; 4 | 5 | public interface WebHooksStatisticsReportEventListener { 6 | 7 | /** 8 | * Send the {@link StatisticsReport} using the {@link WebHookConfig} 9 | * @param webHookConfig 10 | * @param statisticsReport 11 | */ 12 | public void reportStatistics(WebHookConfig whc, StatisticsReport statisticsReport); 13 | 14 | /** 15 | * Send the {@link StatisticsReport} 16 | * @param statisticsReport 17 | */ 18 | public void reportStatistics(StatisticsReport statisticsReport); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/testing/WebHookConfigFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.testing; 2 | 3 | import webhook.teamcity.settings.WebHookConfig; 4 | import webhook.teamcity.testing.model.WebHookExecutionRequest; 5 | import webhook.teamcity.testing.model.WebHookTemplateExecutionRequest; 6 | 7 | public interface WebHookConfigFactory { 8 | 9 | WebHookConfig build(WebHookExecutionRequest webHookExecutionRequest); 10 | WebHookConfig build(WebHookTemplateExecutionRequest webHookExecutionRequest) throws WebHookConfigNotFoundException; 11 | WebHookConfig buildSimple(WebHookTemplateExecutionRequest webHookTemplateExecutionRequest); 12 | 13 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/testing/WebHookConfigNotFoundException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.testing; 2 | 3 | public class WebHookConfigNotFoundException extends Exception { 4 | 5 | private static final long serialVersionUID = 1933172873766920599L; 6 | 7 | public WebHookConfigNotFoundException(String message, Exception ex) { 8 | super(message, ex); 9 | } 10 | 11 | public WebHookConfigNotFoundException(String message) { 12 | super(message); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/testing/model/WebHookExecutionRequestGsonBuilder.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.testing.model; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.GsonBuilder; 5 | 6 | import webhook.teamcity.BuildStateEnum; 7 | 8 | public class WebHookExecutionRequestGsonBuilder { 9 | 10 | private WebHookExecutionRequestGsonBuilder() {} 11 | 12 | public static Gson gsonBuilder() { 13 | return new GsonBuilder() 14 | .registerTypeAdapter(BuildStateEnum.class, new BuildStateEnumTypeAdaptor()) 15 | .enableComplexMapKeySerialization() 16 | .setPrettyPrinting() 17 | .create(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/main/java/webhook/teamcity/testing/model/WebHookRenderResult.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.testing.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class WebHookRenderResult { 7 | 8 | public WebHookRenderResult(String html, String format) { 9 | this.html = html; 10 | this.format = format; 11 | this.errored = false; 12 | } 13 | 14 | public WebHookRenderResult(String text, Exception exception) { 15 | this.html = text; 16 | this.exception = exception; 17 | this.errored = true; 18 | } 19 | 20 | String html; 21 | String format; 22 | Boolean errored; 23 | Exception exception; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/java/webhook/ResponseEvent.java: -------------------------------------------------------------------------------- 1 | package webhook; 2 | 3 | public interface ResponseEvent { 4 | public abstract int getReponseCode(); 5 | public abstract void updateResponseCode(int responseCode); 6 | public abstract String getRequestBody(); 7 | public abstract void updateRequestBody(String requsetBody); 8 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/java/webhook/WebHookTestServerTestBase.java: -------------------------------------------------------------------------------- 1 | package webhook; 2 | 3 | public abstract class WebHookTestServerTestBase { 4 | 5 | public abstract String getHost(); 6 | public abstract Integer getPort(); 7 | 8 | 9 | public WebHookTestServer startWebServer(){ 10 | try { 11 | WebHookTestServer s = new WebHookTestServer(getHost(), getPort()); 12 | s.getServer().start(); 13 | return s; 14 | } catch (Exception e) { 15 | e.printStackTrace(); 16 | } 17 | return null; 18 | } 19 | 20 | public void stopWebServer(WebHookTestServer s) throws InterruptedException { 21 | try { 22 | s.getServer().stop(); 23 | // Sleep to let the server shutdown cleanly. 24 | } catch (Exception e) { 25 | e.printStackTrace(); 26 | } finally { 27 | Thread.sleep(100); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/java/webhook/teamcity/MockBranch.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity; 2 | 3 | import jetbrains.buildServer.serverSide.Branch; 4 | 5 | public class MockBranch implements Branch { 6 | 7 | private String name = "refs/heads/master"; 8 | private String displayName = "master"; 9 | private boolean defaultBranch = false; 10 | 11 | @Override 12 | public String getDisplayName() { 13 | return displayName; 14 | } 15 | 16 | @Override 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | @Override 22 | public boolean isDefaultBranch() { 23 | return defaultBranch; 24 | } 25 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/java/webhook/teamcity/settings/entity/WebHookTemplateJaxTestHelper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings.entity; 2 | 3 | import javax.xml.bind.JAXBException; 4 | 5 | /** 6 | * A JAX helper that overrides the write methods with no-ops. Supports Read (from parent class) but does nothing for writes. 7 | * Useful for tests when writing is not required. 8 | */ 9 | public class WebHookTemplateJaxTestHelper extends WebHookTemplateJaxHelperImpl implements WebHookTemplateJaxHelper { 10 | 11 | 12 | @Override 13 | public void writeTemplate(WebHookTemplateEntity templates, String configFilePath) throws JAXBException { 14 | 15 | } 16 | 17 | @Override 18 | public void writeTemplates(WebHookTemplates templates, String configFilePath) throws JAXBException { 19 | 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/java/webhook/testframework/Mocked.java: -------------------------------------------------------------------------------- 1 | package webhook.testframework; 2 | 3 | public interface Mocked { 4 | 5 | public int getInvocationCount(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/java/webhook/testframework/MockingWebHookFactory.java: -------------------------------------------------------------------------------- 1 | package webhook.testframework; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import webhook.WebHook; 7 | import webhook.WebHookProxyConfig; 8 | import webhook.teamcity.WebHookFactory; 9 | import webhook.teamcity.settings.WebHookConfig; 10 | 11 | public class MockingWebHookFactory implements WebHookFactory { 12 | 13 | List webHookMocks = new ArrayList<>(); 14 | 15 | @Override 16 | public WebHook getWebHook(WebHookConfig webhookConfig, WebHookProxyConfig pc) { 17 | MockWebHook m = new MockWebHook(webhookConfig, pc); 18 | webHookMocks.add(m); 19 | return m; 20 | } 21 | 22 | public Mocked getMostRecentMock() { 23 | return webHookMocks.get(webHookMocks.size()-1); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/FileThatDoesExist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-core/src/test/resources/FileThatDoesExist.txt -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | #log4j.rootLogger=INFO, stdout 3 | log4j.rootLogger=DEBUG, stdout 4 | 5 | # Direct log messages to stdout 6 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 7 | log4j.appender.stdout.Target=System.out 8 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 9 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 10 | 11 | log4j.logger.org.eclipse.jetty=WARN -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/main-config-full.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/old_project-settings-test-webhook-disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/project-settings-test-webhook-disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/testWebHookRequest/webhook-request-01.json: -------------------------------------------------------------------------------- 1 | { 2 | "buildId" : 2834, 3 | "projectExternalId" : "TcPluginsLocal", 4 | "testBuildState" : "buildStarted", 5 | "url" : "http://localhost:8111/webhooks/endpoint.html", 6 | "templateId" : "slack.com-compact", 7 | "payloadFormat" : "jsontemplate", 8 | "authType" : null, 9 | "authEnabled" : false, 10 | "configBuildStates" : { 11 | "buildSuccessful" : true, 12 | "changesLoaded" : false, 13 | "buildFailed" : true, 14 | "buildBroken" : true, 15 | "buildStarted" : false, 16 | "beforeBuildFinish" : false, 17 | "responsibilityChanged" : false, 18 | "BUILD_FIXED" : true, 19 | "BUILD_INTERRUPTED" : false 20 | } 21 | } -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/testdoc1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/testdoc2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tcwebhooks-core/src/test/resources/testrealm.txt: -------------------------------------------------------------------------------- 1 | user1: user1pass,user -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.classpath 3 | /.project 4 | /.settings 5 | /.apt_generated_tests/ 6 | /bin 7 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0-sources.jar -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0.jar -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.jar -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | jetbrains.teamcity.9 6 | rest-api 7 | 9.1 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api-legacy/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.zip -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/pluginfixer/FileStatus.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.pluginfixer; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Setter @Getter 7 | public class FileStatus { 8 | String filename; 9 | boolean isFound = true; 10 | boolean isRemoved = false; 11 | boolean isErrored = false; 12 | String failureMessage; 13 | 14 | FileStatus(String filename) { 15 | this.filename = filename; 16 | } 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/data/WebHookTemplateConfigWrapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.data; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import webhook.teamcity.payload.WebHookTemplateManager; 6 | import webhook.teamcity.settings.config.WebHookTemplateConfig; 7 | 8 | @Getter @AllArgsConstructor 9 | public class WebHookTemplateConfigWrapper { 10 | 11 | private WebHookTemplateConfig templateConfig; 12 | 13 | private String externalProjectId; 14 | 15 | private WebHookTemplateManager.TemplateState status; 16 | 17 | private WebHookTemplateStates buildStatesWithTemplate; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/BadRequestException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class BadRequestException extends RuntimeException { 6 | private static final long serialVersionUID = 8664310771373654913L; 7 | private final ErrorResult result; 8 | 9 | public BadRequestException(String message) { 10 | super(message); 11 | this.result = null; 12 | } 13 | 14 | public BadRequestException(String message, ErrorResult result) { 15 | super(message); 16 | this.result = result; 17 | } 18 | 19 | public BadRequestException(String message, Throwable cause, ErrorResult result) { 20 | super(message, cause); 21 | this.result = result; 22 | } 23 | 24 | public ErrorResult getResult() { 25 | return result; 26 | } 27 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/JaxbClassCastException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class JaxbClassCastException extends RuntimeException { 6 | private static final long serialVersionUID = 8664310771373654913L; 7 | private final ErrorResult result; 8 | 9 | public JaxbClassCastException(String message, ErrorResult result) { 10 | super(message); 11 | this.result = result; 12 | } 13 | 14 | public JaxbClassCastException(String message, Throwable cause, ErrorResult result) { 15 | super(message, cause); 16 | this.result = result; 17 | } 18 | 19 | public ErrorResult getResult() { 20 | return result; 21 | } 22 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/JaxbClassCastExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class JaxbClassCastExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(JaxbClassCastException exception) { 12 | Response.ResponseBuilder builder = Response.status(422); 13 | builder.entity(exception.getResult()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/TemplateInUseException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class TemplateInUseException extends RuntimeException { 6 | 7 | private static final long serialVersionUID = 1062265324610559830L; 8 | private final ErrorResult result; 9 | 10 | public TemplateInUseException(String message, ErrorResult result) { 11 | super(message); 12 | this.result = result; 13 | } 14 | 15 | public TemplateInUseException(String message, Throwable cause, ErrorResult result) { 16 | super(message, cause); 17 | this.result = result; 18 | } 19 | 20 | public ErrorResult getResult() { 21 | return result; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/TemplateInUseExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import javax.ws.rs.core.Response; 4 | import javax.ws.rs.ext.ExceptionMapper; 5 | import javax.ws.rs.ext.Provider; 6 | 7 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 8 | 9 | @Provider 10 | public class TemplateInUseExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 11 | 12 | public Response toResponse(TemplateInUseException exception) { 13 | Response.ResponseBuilder builder = Response.status(409); 14 | builder.entity(exception.getResult()); 15 | return builder.build(); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/TemplatePermissionException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | @SuppressWarnings("serial") 4 | public class TemplatePermissionException extends RuntimeException { 5 | 6 | public TemplatePermissionException(String message) { 7 | super(message); 8 | } 9 | 10 | public TemplatePermissionException(String message, Throwable cause) { 11 | super(message, cause); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/TemplatePermissionExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class TemplatePermissionExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(TemplatePermissionException exception) { 12 | Response.ResponseBuilder builder = Response.status(403); 13 | builder.entity(exception.getMessage()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/UnprocessableEntityException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class UnprocessableEntityException extends RuntimeException { 6 | private static final long serialVersionUID = 8664310771373654913L; 7 | private final ErrorResult result; 8 | 9 | public UnprocessableEntityException(String message, ErrorResult result) { 10 | super(message); 11 | this.result = result; 12 | } 13 | 14 | public UnprocessableEntityException(String message, Throwable cause, ErrorResult result) { 15 | super(message, cause); 16 | this.result = result; 17 | } 18 | 19 | public ErrorResult getResult() { 20 | return result; 21 | } 22 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/UnprocessableEntityExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class UnprocessableEntityExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(UnprocessableEntityException exception) { 12 | Response.ResponseBuilder builder = Response.status(422); 13 | builder.entity(exception.getResult()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/WebHookPermissionException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | @SuppressWarnings("serial") 4 | public class WebHookPermissionException extends RuntimeException { 5 | 6 | public WebHookPermissionException(String message) { 7 | super(message); 8 | } 9 | 10 | public WebHookPermissionException(String message, Throwable cause) { 11 | super(message, cause); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/WebHookPermissionExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class WebHookPermissionExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(WebHookPermissionException exception) { 12 | Response.ResponseBuilder builder = Response.status(403); 13 | builder.entity(exception.getMessage()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/model/mainconfig/NoProxy.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.mainconfig; 2 | 3 | import javax.xml.bind.annotation.XmlAccessType; 4 | import javax.xml.bind.annotation.XmlAccessorType; 5 | import javax.xml.bind.annotation.XmlAttribute; 6 | import javax.xml.bind.annotation.XmlType; 7 | 8 | import lombok.Data; 9 | 10 | /* Use the XmlAttributes on the fields rather than the getters 11 | * and setters provided by Lombok */ 12 | @XmlAccessorType(XmlAccessType.FIELD) 13 | 14 | @Data // Let Lombok generate the getters and setters. 15 | 16 | @XmlType (name="noproxy") 17 | public class NoProxy { 18 | @XmlAttribute 19 | String url; 20 | 21 | /** 22 | * No Arg constructor for JAXB. 23 | */ 24 | public NoProxy () { 25 | } 26 | 27 | public NoProxy(String noProxyUrl) { 28 | this.url = noProxyUrl; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/model/template/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | import java.io.Serializable; 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | import javax.xml.bind.annotation.XmlRootElement; 8 | 9 | import lombok.Data; 10 | 11 | @Data @XmlRootElement 12 | public class ErrorResult implements Serializable { 13 | 14 | private static final long serialVersionUID = -8395102761842280396L; 15 | private Map errors = new LinkedHashMap<>(); 16 | 17 | public ErrorResult addError(String fieldname, String errorMessage) { 18 | this.errors.put(fieldname, errorMessage); 19 | return this; 20 | } 21 | 22 | public boolean isErrored() { 23 | return ! this.errors.isEmpty(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/model/template/Format.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | import javax.xml.bind.annotation.XmlAttribute; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | import javax.xml.bind.annotation.XmlType; 6 | 7 | 8 | 9 | @XmlRootElement(name = "format") 10 | @XmlType(name = "format", propOrder = {"name", "enabled"}) 11 | public class Format { 12 | 13 | @XmlAttribute 14 | public String name; 15 | 16 | 17 | @XmlAttribute 18 | public Boolean enabled; 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/model/template/TemplateTestExecutionRequest.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | import javax.xml.bind.annotation.XmlRootElement; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | @XmlRootElement 11 | @Getter 12 | @Setter 13 | @AllArgsConstructor @NoArgsConstructor 14 | public class TemplateTestExecutionRequest { 15 | 16 | String format; 17 | String templateText; 18 | String branchTemplateText; 19 | boolean useTemplateTextForBranch; 20 | String buildId; 21 | String projectExternalId; 22 | String url; 23 | String webhookId; 24 | String buildStateName; 25 | } 26 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/model/template/TemplateText.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | public class TemplateText { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/model/webhook/CustomTemplate.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.webhook; 2 | 3 | import javax.xml.bind.annotation.XmlAttribute; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | 6 | /* 7 | * 8 | */ 9 | 10 | @XmlRootElement(name="customTemplate") 11 | public class CustomTemplate { 12 | private String type; 13 | private String template; 14 | private Boolean enabled; 15 | 16 | @XmlAttribute 17 | public String getType() { 18 | return type; 19 | } 20 | 21 | @XmlAttribute 22 | public String getTemplate() { 23 | return template; 24 | } 25 | 26 | @XmlAttribute 27 | public Boolean getEnabled() { 28 | return enabled; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/model/webhook/ProjectWebhookState.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.webhook; 2 | 3 | import javax.xml.bind.annotation.XmlAttribute; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | import javax.xml.bind.annotation.XmlType; 6 | 7 | /* 8 | * 9 | */ 10 | 11 | @XmlRootElement (name="state") 12 | @XmlType (name = "state",propOrder = { "type", "enabled" }) 13 | public class ProjectWebhookState { 14 | 15 | @XmlAttribute 16 | public String type; 17 | 18 | @XmlAttribute 19 | Boolean enabled; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/request/ApiRequest.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.request; 2 | 3 | public interface ApiRequest { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/request/Constants.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.request; 2 | public class Constants { 3 | 4 | private Constants() {} 5 | 6 | public static final String DEFAULT_PAGE_ITEMS_COUNT = "100"; 7 | public static final int DEFAULT_PAGE_ITEMS_COUNT_INT = 100; 8 | 9 | public static final String API_URL = "/app/rest/webhooks"; 10 | 11 | public static final String BIND_PATH_PROPERTY_NAME = "api.path"; 12 | public static final String ORIGINAL_REQUEST_URI_HEADER_NAME = "original-request-uri"; 13 | 14 | public static final String EXTERNAL_APPLICATION_WADL_NAME = "/application.wadl"; //name that user requests will use 15 | public static final String JERSEY_APPLICATION_WADL_NAME = "/application.wadl"; 16 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/java/webhook/teamcity/server/rest/web/WebHookRestApiActionController.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.web; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import jetbrains.buildServer.controllers.BaseAjaxActionController; 6 | import jetbrains.buildServer.web.openapi.WebControllerManager; 7 | 8 | /** 9 | * This class simply holds the actions available at 10 | * "/admin/manageWebHooksRestApi.html" Actions need to inject this class and 11 | * register themselves. 12 | */ 13 | public class WebHookRestApiActionController extends BaseAjaxActionController { 14 | 15 | public static final String ACTION_TYPE = "action"; 16 | 17 | public WebHookRestApiActionController(@NotNull final WebControllerManager controllerManager) { 18 | super(controllerManager); 19 | controllerManager.registerController("/admin/manageWebHooksRestApi.html", this); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/resources/buildServerResources/WebHookRestApi/restApiHealthRestartStatus.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="jetbrains.buildServer.web.openapi.healthStatus.HealthStatusItemDisplayMode" %> 2 | <%@ include file="/include-internal.jsp" %> 3 | 4 | 5 | 6 | "/> 7 | 8 | WebHook REST API files have been cleaned. Please restart TeamCity. More info. -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/resources/buildServerResources/WebHookRestApi/restApiHealthStatus.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="jetbrains.buildServer.web.openapi.healthStatus.HealthStatusItemDisplayMode" %> 2 | <%@ include file="/include-internal.jsp" %> 3 | 4 | 5 | 6 | "/> 7 | "/> 8 | 9 | Editing of WebHook Templates via the WebUI or 10 | REST API may fail due to a jar conflict in TeamCity's 11 | bundled REST API jars. More info. -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/main/resources/buildServerResources/WebHookRestApi/serverNoRestart.js: -------------------------------------------------------------------------------- 1 | BS.ServerRestarter = { 2 | 3 | restartServer: function () { 4 | alert("Sorry. Restarting is only supported since TeamCity 2017.2") 5 | return false; 6 | } 7 | }; -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/java/webhook/teamcity/server/rest/model/mainconfig/WebhooksTest.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.mainconfig; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | public class WebhooksTest { 8 | 9 | @Test 10 | public void test() { 11 | Webhooks webhooks = new Webhooks(); 12 | Information info = new Information(); 13 | info.setUrl("http://example.com"); 14 | info.setText("Some blurb"); 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/java/webhook/teamcity/settings/entity/WebHookTemplateJaxTestHelper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings.entity; 2 | 3 | import javax.xml.bind.JAXBException; 4 | 5 | public class WebHookTemplateJaxTestHelper extends WebHookTemplateJaxHelperImpl implements WebHookTemplateJaxHelper { 6 | 7 | 8 | @Override 9 | public void writeTemplates(WebHookTemplates templates, String configFilePath) throws JAXBException { 10 | // No writes needed in test implementation 11 | } 12 | 13 | 14 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/java/webhook/teamcity/test/jerseyprovider/ProjectIdResolverMock.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.test.jerseyprovider; 2 | 3 | import webhook.teamcity.ProjectIdResolver; 4 | 5 | public class ProjectIdResolverMock implements ProjectIdResolver { 6 | 7 | @Override 8 | public String getExternalProjectId(String internalProjectId) { 9 | if (internalProjectId.equalsIgnoreCase("_Root")) { 10 | return "_Root"; 11 | } 12 | return "TestProject"; 13 | } 14 | 15 | @Override 16 | public String getInternalProjectId(String externalProjectId) { 17 | if (externalProjectId.equalsIgnoreCase("_Root")) { 18 | return "_Root"; 19 | } 20 | return "project1"; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/java/webhook/teamcity/test/jerseyprovider/RequestPathTransformInfoProvider.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.test.jerseyprovider; 2 | 3 | import javax.ws.rs.ext.Provider; 4 | 5 | import jetbrains.buildServer.server.rest.RequestPathTransformInfo; 6 | import jetbrains.buildServer.server.rest.jersey.AbstractSingletonBeanProvider; 7 | 8 | 9 | @Provider 10 | public class RequestPathTransformInfoProvider extends AbstractSingletonBeanProvider { 11 | public RequestPathTransformInfoProvider() { 12 | super(new RequestPathTransformInfo(), RequestPathTransformInfo.class); 13 | } 14 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/java/webhook/teamcity/test/springmock/MockingWebHookSettingsEventHandler.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.test.springmock; 2 | 3 | import webhook.teamcity.WebHookSettingsEventHandler; 4 | 5 | public class MockingWebHookSettingsEventHandler implements WebHookSettingsEventHandler { 6 | 7 | @Override 8 | public void handleEvent(WebHookSettingsEvent eventType) { 9 | // TODO Auto-generated method stub 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/resources/REST-examples/create-template-post.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "name" : "testJsonTemplate01", 4 | "description" : "A test template in JSON format (version 1).", 5 | "formats" : [ 6 | { 7 | "enabled" : true, 8 | "name" : "jsonTemplate" 9 | } 10 | ] 11 | 12 | } 13 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/rest-api.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api-legacy/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/rest-api.zip -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/somefile.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api-legacy/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/somefile.zip -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 9 | 10 | log4j.logger.org.eclipse.jetty=WARN -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/resources/main-config-full.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api-legacy/src/test/resources/spring-test-config.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.classpath 3 | /.project 4 | /.settings 5 | /.apt_generated_tests/ 6 | /bin 7 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/2024/rest-api/2024.03/rest-api-2024.03.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/2024/rest-api/2024.03/rest-api-2024.03.jar -------------------------------------------------------------------------------- /tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/2024/rest-api/2024.03/rest-api-2024.03.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | jetbrains.teamcity.2024 6 | rest-api 7 | 2024.03 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0-sources.jar -------------------------------------------------------------------------------- /tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.0/rest-api-9.0.jar -------------------------------------------------------------------------------- /tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.jar -------------------------------------------------------------------------------- /tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | jetbrains.teamcity.9 6 | rest-api 7 | 9.1 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api/lib-compile/jetbrains/teamcity/9/rest-api/9.1/rest-api-9.1.zip -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/pluginfixer/FileStatus.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.pluginfixer; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Setter @Getter 7 | public class FileStatus { 8 | String filename; 9 | boolean isFound = true; 10 | boolean isRemoved = false; 11 | boolean isErrored = false; 12 | String failureMessage; 13 | 14 | FileStatus(String filename) { 15 | this.filename = filename; 16 | } 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/data/WebHookTemplateConfigWrapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.data; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import webhook.teamcity.payload.WebHookTemplateManager; 6 | import webhook.teamcity.settings.config.WebHookTemplateConfig; 7 | 8 | @Getter @AllArgsConstructor 9 | public class WebHookTemplateConfigWrapper { 10 | 11 | private WebHookTemplateConfig templateConfig; 12 | 13 | private String externalProjectId; 14 | 15 | private WebHookTemplateManager.TemplateState status; 16 | 17 | private WebHookTemplateStates buildStatesWithTemplate; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/BadRequestException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class BadRequestException extends RuntimeException { 6 | private static final long serialVersionUID = 8664310771373654913L; 7 | private final ErrorResult result; 8 | 9 | public BadRequestException(String message) { 10 | super(message); 11 | this.result = null; 12 | } 13 | 14 | public BadRequestException(String message, ErrorResult result) { 15 | super(message); 16 | this.result = result; 17 | } 18 | 19 | public BadRequestException(String message, Throwable cause, ErrorResult result) { 20 | super(message, cause); 21 | this.result = result; 22 | } 23 | 24 | public ErrorResult getResult() { 25 | return result; 26 | } 27 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/JaxbClassCastException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class JaxbClassCastException extends RuntimeException { 6 | private static final long serialVersionUID = 8664310771373654913L; 7 | private final ErrorResult result; 8 | 9 | public JaxbClassCastException(String message, ErrorResult result) { 10 | super(message); 11 | this.result = result; 12 | } 13 | 14 | public JaxbClassCastException(String message, Throwable cause, ErrorResult result) { 15 | super(message, cause); 16 | this.result = result; 17 | } 18 | 19 | public ErrorResult getResult() { 20 | return result; 21 | } 22 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/JaxbClassCastExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class JaxbClassCastExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(JaxbClassCastException exception) { 12 | Response.ResponseBuilder builder = Response.status(422); 13 | builder.entity(exception.getResult()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/TemplateInUseException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class TemplateInUseException extends RuntimeException { 6 | 7 | private static final long serialVersionUID = 1062265324610559830L; 8 | private final ErrorResult result; 9 | 10 | public TemplateInUseException(String message, ErrorResult result) { 11 | super(message); 12 | this.result = result; 13 | } 14 | 15 | public TemplateInUseException(String message, Throwable cause, ErrorResult result) { 16 | super(message, cause); 17 | this.result = result; 18 | } 19 | 20 | public ErrorResult getResult() { 21 | return result; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/TemplateInUseExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import javax.ws.rs.core.Response; 4 | import javax.ws.rs.ext.ExceptionMapper; 5 | import javax.ws.rs.ext.Provider; 6 | 7 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 8 | 9 | @Provider 10 | public class TemplateInUseExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 11 | 12 | public Response toResponse(TemplateInUseException exception) { 13 | Response.ResponseBuilder builder = Response.status(409); 14 | builder.entity(exception.getResult()); 15 | return builder.build(); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/TemplatePermissionException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | @SuppressWarnings("serial") 4 | public class TemplatePermissionException extends RuntimeException { 5 | 6 | public TemplatePermissionException(String message) { 7 | super(message); 8 | } 9 | 10 | public TemplatePermissionException(String message, Throwable cause) { 11 | super(message, cause); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/TemplatePermissionExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class TemplatePermissionExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(TemplatePermissionException exception) { 12 | Response.ResponseBuilder builder = Response.status(403); 13 | builder.entity(exception.getMessage()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/UnprocessableEntityException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | import webhook.teamcity.server.rest.model.template.ErrorResult; 4 | 5 | public class UnprocessableEntityException extends RuntimeException { 6 | private static final long serialVersionUID = 8664310771373654913L; 7 | private final ErrorResult result; 8 | 9 | public UnprocessableEntityException(String message, ErrorResult result) { 10 | super(message); 11 | this.result = result; 12 | } 13 | 14 | public UnprocessableEntityException(String message, Throwable cause, ErrorResult result) { 15 | super(message, cause); 16 | this.result = result; 17 | } 18 | 19 | public ErrorResult getResult() { 20 | return result; 21 | } 22 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/UnprocessableEntityExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class UnprocessableEntityExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(UnprocessableEntityException exception) { 12 | Response.ResponseBuilder builder = Response.status(422); 13 | builder.entity(exception.getResult()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/WebHookPermissionException.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | 3 | @SuppressWarnings("serial") 4 | public class WebHookPermissionException extends RuntimeException { 5 | 6 | public WebHookPermissionException(String message) { 7 | super(message); 8 | } 9 | 10 | public WebHookPermissionException(String message, Throwable cause) { 11 | super(message, cause); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/errors/WebHookPermissionExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.errors; 2 | import javax.ws.rs.core.Response; 3 | import javax.ws.rs.ext.ExceptionMapper; 4 | import javax.ws.rs.ext.Provider; 5 | 6 | import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; 7 | 8 | @Provider 9 | public class WebHookPermissionExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper { 10 | 11 | public Response toResponse(WebHookPermissionException exception) { 12 | Response.ResponseBuilder builder = Response.status(403); 13 | builder.entity(exception.getMessage()); 14 | return builder.build(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/jersey/TemplateManagerProvider.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.jersey; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import jetbrains.buildServer.server.rest.jersey.provider.annotated.JerseyInjectableBeanProvider; 6 | import webhook.teamcity.payload.WebHookTemplateManager; 7 | 8 | 9 | @Service 10 | public class TemplateManagerProvider implements JerseyInjectableBeanProvider { 11 | @Override 12 | public Class getBeanClass() { 13 | return WebHookTemplateManager.class; 14 | } 15 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/jersey/WebHookParameterStoreFactoryProvider.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.jersey; 2 | 3 | import jetbrains.buildServer.server.rest.jersey.provider.annotated.JerseyInjectableBeanProvider; 4 | import org.springframework.stereotype.Service; 5 | import webhook.teamcity.settings.project.WebHookParameterStoreFactory; 6 | 7 | @Service 8 | public class WebHookParameterStoreFactoryProvider implements JerseyInjectableBeanProvider { 9 | @Override 10 | public Class getBeanClass() { 11 | return WebHookParameterStoreFactory.class; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/jersey/WebHookPluginDataResolverProvider.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.jersey; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import jetbrains.buildServer.server.rest.jersey.provider.annotated.JerseyInjectableBeanProvider; 6 | import webhook.teamcity.WebHookPluginDataResolver; 7 | 8 | @Service 9 | public class WebHookPluginDataResolverProvider implements JerseyInjectableBeanProvider { 10 | @Override 11 | public Class getBeanClass() { 12 | return WebHookPluginDataResolver.class; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/jersey/WebHookSettingsManagerProvider.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.jersey; 2 | 3 | import javax.ws.rs.ext.Provider; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import jetbrains.buildServer.server.rest.jersey.provider.annotated.JerseyInjectableBeanProvider; 8 | import webhook.teamcity.settings.WebHookSettingsManager; 9 | 10 | @Service 11 | public class WebHookSettingsManagerProvider implements JerseyInjectableBeanProvider { 12 | @Override 13 | public Class getBeanClass() { 14 | return WebHookSettingsManager.class; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/model/mainconfig/NoProxy.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.mainconfig; 2 | 3 | import javax.xml.bind.annotation.XmlAccessType; 4 | import javax.xml.bind.annotation.XmlAccessorType; 5 | import javax.xml.bind.annotation.XmlAttribute; 6 | import javax.xml.bind.annotation.XmlType; 7 | 8 | import lombok.Data; 9 | 10 | /* Use the XmlAttributes on the fields rather than the getters 11 | * and setters provided by Lombok */ 12 | @XmlAccessorType(XmlAccessType.FIELD) 13 | 14 | @Data // Let Lombok generate the getters and setters. 15 | 16 | @XmlType (name="noproxy") 17 | public class NoProxy { 18 | @XmlAttribute 19 | String url; 20 | 21 | /** 22 | * No Arg constructor for JAXB. 23 | */ 24 | public NoProxy () { 25 | } 26 | 27 | public NoProxy(String noProxyUrl) { 28 | this.url = noProxyUrl; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/model/template/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | import java.io.Serializable; 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | import javax.xml.bind.annotation.XmlRootElement; 8 | 9 | import lombok.Data; 10 | 11 | @Data @XmlRootElement 12 | public class ErrorResult implements Serializable { 13 | 14 | private static final long serialVersionUID = -8395102761842280396L; 15 | private Map errors = new LinkedHashMap<>(); 16 | 17 | public ErrorResult addError(String fieldname, String errorMessage) { 18 | this.errors.put(fieldname, errorMessage); 19 | return this; 20 | } 21 | 22 | public boolean isErrored() { 23 | return ! this.errors.isEmpty(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/model/template/Format.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | import javax.xml.bind.annotation.XmlAttribute; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | import javax.xml.bind.annotation.XmlType; 6 | 7 | 8 | 9 | @XmlRootElement(name = "format") 10 | @XmlType(name = "format", propOrder = {"name", "enabled"}) 11 | public class Format { 12 | 13 | @XmlAttribute 14 | public String name; 15 | 16 | 17 | @XmlAttribute 18 | public Boolean enabled; 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/model/template/TemplateTestExecutionRequest.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | import javax.xml.bind.annotation.XmlRootElement; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | @XmlRootElement 11 | @Getter 12 | @Setter 13 | @AllArgsConstructor @NoArgsConstructor 14 | public class TemplateTestExecutionRequest { 15 | 16 | String format; 17 | String templateText; 18 | String branchTemplateText; 19 | boolean useTemplateTextForBranch; 20 | String buildId; 21 | String projectExternalId; 22 | String url; 23 | String webhookId; 24 | String buildStateName; 25 | } 26 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/model/template/TemplateText.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.template; 2 | 3 | public class TemplateText { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/model/webhook/CustomTemplate.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.webhook; 2 | 3 | import javax.xml.bind.annotation.XmlAttribute; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | 6 | /* 7 | * 8 | */ 9 | 10 | @XmlRootElement(name="customTemplate") 11 | public class CustomTemplate { 12 | private String type; 13 | private String template; 14 | private Boolean enabled; 15 | 16 | @XmlAttribute 17 | public String getType() { 18 | return type; 19 | } 20 | 21 | @XmlAttribute 22 | public String getTemplate() { 23 | return template; 24 | } 25 | 26 | @XmlAttribute 27 | public Boolean getEnabled() { 28 | return enabled; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/model/webhook/ProjectWebhookState.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.webhook; 2 | 3 | import javax.xml.bind.annotation.XmlAttribute; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | import javax.xml.bind.annotation.XmlType; 6 | 7 | /* 8 | * 9 | */ 10 | 11 | @XmlRootElement (name="state") 12 | @XmlType (name = "state",propOrder = { "type", "enabled" }) 13 | public class ProjectWebhookState { 14 | 15 | @XmlAttribute 16 | public String type; 17 | 18 | @XmlAttribute 19 | Boolean enabled; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/request/ApiRequest.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.request; 2 | 3 | public interface ApiRequest { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/request/Constants.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.request; 2 | public class Constants { 3 | 4 | private Constants() {} 5 | 6 | public static final String DEFAULT_PAGE_ITEMS_COUNT = "100"; 7 | public static final int DEFAULT_PAGE_ITEMS_COUNT_INT = 100; 8 | 9 | public static final String API_URL = "/app/rest/webhooks"; 10 | 11 | public static final String BIND_PATH_PROPERTY_NAME = "api.path"; 12 | public static final String ORIGINAL_REQUEST_URI_HEADER_NAME = "original-request-uri"; 13 | 14 | public static final String EXTERNAL_APPLICATION_WADL_NAME = "/application.wadl"; //name that user requests will use 15 | public static final String JERSEY_APPLICATION_WADL_NAME = "/application.wadl"; 16 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/util/WebHookBeanContext.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.util; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import webhook.teamcity.server.rest.WebHookApiUrlBuilder; 6 | import webhook.teamcity.server.rest.WebHookWebLinks; 7 | 8 | public class WebHookBeanContext { 9 | private final @NotNull WebHookApiUrlBuilder myApiUrlBuilder; 10 | private final @NotNull WebHookWebLinks myWebHookWebLinks; 11 | 12 | public WebHookBeanContext(@NotNull final WebHookWebLinks webHookWebLinks, @NotNull WebHookApiUrlBuilder apiUrlBuilder) { 13 | myWebHookWebLinks = webHookWebLinks; 14 | myApiUrlBuilder = apiUrlBuilder; 15 | } 16 | 17 | @NotNull 18 | public WebHookApiUrlBuilder getApiUrlBuilder() { 19 | return myApiUrlBuilder; 20 | } 21 | 22 | public WebHookWebLinks getWebHookWebLinks() { 23 | return myWebHookWebLinks; 24 | } 25 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/java/webhook/teamcity/server/rest/web/WebHookRestApiActionController.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.web; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import jetbrains.buildServer.controllers.BaseAjaxActionController; 6 | import jetbrains.buildServer.web.openapi.WebControllerManager; 7 | 8 | /** 9 | * This class simply holds the actions available at 10 | * "/admin/manageWebHooksRestApi.html" Actions need to inject this class and 11 | * register themselves. 12 | */ 13 | public class WebHookRestApiActionController extends BaseAjaxActionController { 14 | 15 | public static final String ACTION_TYPE = "action"; 16 | 17 | public WebHookRestApiActionController(@NotNull final WebControllerManager controllerManager) { 18 | super(controllerManager); 19 | controllerManager.registerController("/admin/manageWebHooksRestApi.html", this); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/resources/buildServerResources/WebHookRestApi/restApiHealthRestartStatus.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="jetbrains.buildServer.web.openapi.healthStatus.HealthStatusItemDisplayMode" %> 2 | <%@ include file="/include-internal.jsp" %> 3 | 4 | 5 | 6 | "/> 7 | 8 | WebHook REST API files have been cleaned. Please restart TeamCity. More info. -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/resources/buildServerResources/WebHookRestApi/restApiHealthStatus.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="jetbrains.buildServer.web.openapi.healthStatus.HealthStatusItemDisplayMode" %> 2 | <%@ include file="/include-internal.jsp" %> 3 | 4 | 5 | 6 | "/> 7 | "/> 8 | 9 | Editing of WebHook Templates via the WebUI or 10 | REST API may fail due to a jar conflict in TeamCity's 11 | bundled REST API jars. More info. -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/main/resources/buildServerResources/WebHookRestApi/serverNoRestart.js: -------------------------------------------------------------------------------- 1 | BS.ServerRestarter = { 2 | 3 | restartServer: function () { 4 | alert("Sorry. Restarting is only supported since TeamCity 2017.2") 5 | return false; 6 | } 7 | }; -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/java/webhook/teamcity/server/rest/model/mainconfig/WebhooksTest.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.server.rest.model.mainconfig; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | public class WebhooksTest { 8 | 9 | @Test 10 | public void test() { 11 | Webhooks webhooks = new Webhooks(); 12 | Information info = new Information(); 13 | info.setUrl("http://example.com"); 14 | info.setText("Some blurb"); 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/java/webhook/teamcity/settings/entity/WebHookTemplateJaxTestHelper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.settings.entity; 2 | 3 | import javax.xml.bind.JAXBException; 4 | 5 | public class WebHookTemplateJaxTestHelper extends WebHookTemplateJaxHelperImpl implements WebHookTemplateJaxHelper { 6 | 7 | 8 | @Override 9 | public void writeTemplates(WebHookTemplates templates, String configFilePath) throws JAXBException { 10 | // No writes needed in test implementation 11 | } 12 | 13 | 14 | } -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/java/webhook/teamcity/test/jerseyprovider/ProjectIdResolverMock.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.test.jerseyprovider; 2 | 3 | import webhook.teamcity.ProjectIdResolver; 4 | 5 | public class ProjectIdResolverMock implements ProjectIdResolver { 6 | 7 | @Override 8 | public String getExternalProjectId(String internalProjectId) { 9 | if (internalProjectId.equalsIgnoreCase("_Root")) { 10 | return "_Root"; 11 | } 12 | return "TestProject"; 13 | } 14 | 15 | @Override 16 | public String getInternalProjectId(String externalProjectId) { 17 | if (externalProjectId.equalsIgnoreCase("_Root")) { 18 | return "_Root"; 19 | } 20 | return "project1"; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/resources/REST-examples/create-template-post.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "name" : "testJsonTemplate01", 4 | "description" : "A test template in JSON format (version 1).", 5 | "formats" : [ 6 | { 7 | "enabled" : true, 8 | "name" : "jsonTemplate" 9 | } 10 | ] 11 | 12 | } 13 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/rest-api.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/rest-api.zip -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/somefile.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-rest-api/src/test/resources/catalina_home/webapps/ROOT/WEB-INF/plugins/somefile.zip -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 9 | 10 | log4j.logger.org.eclipse.jetty=WARN -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/resources/main-config-full.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-rest-api/src/test/resources/spring-test-config.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.classpath 3 | /.project 4 | /.settings 5 | /.apt_generated_tests/ 6 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/local-mvn-repo/org/jetbrains/teamcity/server/10.0/server-10.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-web-ui/local-mvn-repo/org/jetbrains/teamcity/server/10.0/server-10.0.jar -------------------------------------------------------------------------------- /tcwebhooks-web-ui/local-mvn-repo/org/jetbrains/teamcity/server/10.0/server-10.0.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | server 7 | 10.0 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/local-mvn-repo/org/jetbrains/teamcity/server/9.1/server-9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-web-ui/local-mvn-repo/org/jetbrains/teamcity/server/9.1/server-9.1.jar -------------------------------------------------------------------------------- /tcwebhooks-web-ui/local-mvn-repo/org/jetbrains/teamcity/server/9.1/server-9.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.jetbrains.teamcity 6 | server 7 | 9.1 8 | POM was created from install:install-file 9 | 10 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/buildrunner/WebHookServiceMessagePropertiesProcessor.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.buildrunner; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.Map; 6 | 7 | import jetbrains.buildServer.serverSide.InvalidProperty; 8 | import jetbrains.buildServer.serverSide.PropertiesProcessor; 9 | 10 | public class WebHookServiceMessagePropertiesProcessor implements PropertiesProcessor { 11 | public Collection process(Map properties) { 12 | return new ArrayList<>(); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import java.io.Serializable; 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | import javax.xml.bind.annotation.XmlRootElement; 8 | 9 | import lombok.Data; 10 | 11 | @Data @XmlRootElement 12 | public class ErrorResult implements Serializable { 13 | 14 | private static final long serialVersionUID = -8395102761842280396L; 15 | private Map errors = new LinkedHashMap<>(); 16 | 17 | public ErrorResult addError(String fieldname, String errorMessage) { 18 | this.errors.put(fieldname, errorMessage); 19 | return this; 20 | } 21 | 22 | public boolean isErrored() { 23 | return ! this.errors.isEmpty(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/ProjectParametersBean.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import jetbrains.buildServer.serverSide.SProject; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Getter; 9 | import webhook.teamcity.settings.project.WebHookParameter; 10 | 11 | @Getter @AllArgsConstructor 12 | public class ProjectParametersBean { 13 | 14 | SProject project; 15 | List parameterList; 16 | 17 | public static ProjectParametersBean newInstance(SProject project, List parameters) { 18 | if (parameters != null) { 19 | return new ProjectParametersBean(project, parameters); 20 | } else { 21 | return new ProjectParametersBean(project, new ArrayList<>()); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/ProjectTemplatesBean.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import jetbrains.buildServer.serverSide.SProject; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Getter; 9 | import webhook.teamcity.payload.WebHookPayloadTemplate; 10 | 11 | @Getter @AllArgsConstructor 12 | public class ProjectTemplatesBean { 13 | 14 | SProject project; 15 | List templateList; 16 | 17 | public static ProjectTemplatesBean newInstance(SProject project, List templates) { 18 | if (templates != null) { 19 | return new ProjectTemplatesBean(project, templates); 20 | } else { 21 | return new ProjectTemplatesBean(project, new ArrayList<>()); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/ProjectWebHookParameterBean.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import jetbrains.buildServer.serverSide.SProject; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | import webhook.CommonUtils; 7 | import webhook.teamcity.settings.project.WebHookParameter; 8 | 9 | @Getter 10 | @AllArgsConstructor 11 | public class ProjectWebHookParameterBean { 12 | SProject sproject; 13 | WebHookParameter parameter; 14 | 15 | public String getSensibleProjectFullName() { 16 | return CommonUtils.getSensibleProjectFullName(getSproject()); 17 | } 18 | 19 | public String getSensibleProjectName() { 20 | return CommonUtils.getSensibleProjectName(getSproject()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/ProjectWebHooksBeanGsonSerialiser.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.GsonBuilder; 5 | 6 | import webhook.teamcity.extension.bean.TemplatesAndProjectWebHooksBean.TemplatesAndProjectWebHooksBeanResponseWrapper; 7 | import webhook.teamcity.extension.util.ProjectHistoryResolver.ProjectHistoryBean; 8 | 9 | public class ProjectWebHooksBeanGsonSerialiser { 10 | private ProjectWebHooksBeanGsonSerialiser(){} 11 | 12 | public static String serialise(TemplatesAndProjectWebHooksBeanResponseWrapper project){ 13 | Gson gson = new GsonBuilder().setPrettyPrinting().create(); 14 | return gson.toJson(project); 15 | } 16 | public static String serialise(ProjectHistoryBean project){ 17 | Gson gson = new GsonBuilder().setPrettyPrinting().create(); 18 | return gson.toJson(project); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/StateBean.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | @AllArgsConstructor @Getter 7 | public class StateBean{ 8 | private String buildStateName; 9 | private boolean enabled; 10 | } -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/WebHookTestHistoryItem.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Getter 9 | @Builder 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class WebHookTestHistoryItem { 13 | 14 | String dateTime; 15 | ErrorStatus error; 16 | String trackingId; 17 | String url; 18 | String executionTime; 19 | int statusCode; 20 | 21 | String statusReason; 22 | 23 | @Getter @NoArgsConstructor @AllArgsConstructor 24 | public static class ErrorStatus { 25 | String message; 26 | int errorCode; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/WebhookAuthenticationConfigBean.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean; 2 | 3 | import webhook.teamcity.auth.WebHookAuthConfig; 4 | 5 | public class WebhookAuthenticationConfigBean extends WebHookAuthConfig { 6 | 7 | public static WebhookAuthenticationConfigBean build(WebHookAuthConfig config){ 8 | WebhookAuthenticationConfigBean bean = new WebhookAuthenticationConfigBean(); 9 | bean.setType(config.getType()); 10 | bean.setPreemptive(config.getPreemptive()); 11 | bean.getParameters().putAll(config.getParameters()); 12 | return bean; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/extension/bean/template/RegisteredWebHookTemplateBeanGsonSerialiser.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.extension.bean.template; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.GsonBuilder; 5 | 6 | public class RegisteredWebHookTemplateBeanGsonSerialiser { 7 | 8 | private RegisteredWebHookTemplateBeanGsonSerialiser(){} 9 | 10 | public static String serialise(RegisteredWebHookTemplateBean templates){ 11 | Gson gson = new GsonBuilder().setPrettyPrinting().create(); 12 | return gson.toJson(templates); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/json/WebHookBuildStateJson.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.json; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import webhook.teamcity.BuildStateEnum; 7 | 8 | @Data @NoArgsConstructor @AllArgsConstructor 9 | public class WebHookBuildStateJson { 10 | 11 | private BuildStateEnum type; 12 | private boolean enabled; 13 | } 14 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/json/WebHookBuildTypesJson.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.json; 2 | 3 | import java.util.Set; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @Data @AllArgsConstructor @NoArgsConstructor 10 | public class WebHookBuildTypesJson { 11 | private boolean allEnabled; 12 | private boolean subProjectsEnabled; 13 | private Set id; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/json/WebHookConfigurationGsonBuilder.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.json; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.GsonBuilder; 5 | 6 | import webhook.teamcity.BuildStateEnum; 7 | 8 | public class WebHookConfigurationGsonBuilder { 9 | 10 | private WebHookConfigurationGsonBuilder() {} 11 | 12 | public static Gson gsonBuilder() { 13 | return new GsonBuilder() 14 | .registerTypeAdapter(BuildStateEnum.class, new BuildStateEnumTypeAdaptor()) 15 | .enableComplexMapKeySerialization() 16 | .setPrettyPrinting() 17 | .create(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/json/WebHookConfigurationListWrapper.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.json; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public abstract class WebHookConfigurationListWrapper { 7 | private int count; 8 | } 9 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/json/WebHookFilterJson.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.json; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.NoArgsConstructor; 9 | 10 | @Data @NoArgsConstructor 11 | @EqualsAndHashCode(callSuper = true) 12 | public class WebHookFilterJson extends WebHookConfigurationListWrapper { 13 | private List filter; 14 | 15 | @Data @AllArgsConstructor @NoArgsConstructor 16 | public static class Filter { 17 | private Integer id; 18 | private String value; 19 | private String regex; 20 | private Boolean enabled; 21 | } 22 | 23 | public static WebHookFilterJson create(List filters) { 24 | WebHookFilterJson webHookFilter = new WebHookFilterJson(); 25 | webHookFilter.setFilter(filters); 26 | webHookFilter.setCount(filters.size()); 27 | return webHookFilter; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/java/webhook/teamcity/json/WebHookHeaderJson.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.json; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.NoArgsConstructor; 9 | 10 | @Data @NoArgsConstructor 11 | @EqualsAndHashCode(callSuper = true) 12 | public class WebHookHeaderJson extends WebHookConfigurationListWrapper { 13 | private List
header; 14 | 15 | @Data @AllArgsConstructor @NoArgsConstructor 16 | public static class Header { 17 | private Integer id; 18 | private String name; 19 | private String value; 20 | } 21 | 22 | public static WebHookHeaderJson create(List
headers) { 23 | WebHookHeaderJson webHookFilter = new WebHookHeaderJson(); 24 | webHookFilter.setHeader(headers); 25 | webHookFilter.setCount(headers.size()); 26 | return webHookFilter; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/ace-extras/mode/jsonvelocity.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var JsonMode = require("./json").Mode; 6 | var JsonVelocityHighlightRules = require("./jsonvelocity_highlight_rules").JsonVelocityHighlightRules; 7 | var FoldMode = require("./folding/velocity").FoldMode; 8 | 9 | var Mode = function() { 10 | JsonMode.call(this); 11 | this.HighlightRules = JsonVelocityHighlightRules; 12 | this.foldingRules = new FoldMode(); 13 | }; 14 | oop.inherits(Mode, JsonMode); 15 | 16 | (function() { 17 | this.lineCommentStart = "##"; 18 | this.blockComment = {start: "#*", end: "*#"}; 19 | this.$id = "ace/mode/jsonvelocity"; 20 | }).call(Mode.prototype); 21 | 22 | exports.Mode = Mode; 23 | }); -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/ext-error_marker.js: -------------------------------------------------------------------------------- 1 | ; 2 | (function() { 3 | ace.require(["ace/ext/error_marker"], function() {}); 4 | })(); 5 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/ext-linking.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var t=e.editor,n=e.getAccelKey();if(n){var t=e.editor,r=e.getDocumentPosition(),i=t.session,s=i.getTokenAt(r.row,r.column);t._emit("linkHover",{position:r,token:s})}}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("ace/editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}})}); 2 | (function() { 3 | ace.require(["ace/ext/linking"], function() {}); 4 | })(); 5 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/mode-plain_text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/plain_text",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/behaviour"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./text_highlight_rules").TextHighlightRules,o=e("./behaviour").Behaviour,u=function(){this.HighlightRules=s,this.$behaviour=new o};r.inherits(u,i),function(){this.type="text",this.getNextLineIndent=function(e,t,n){return""},this.$id="ace/mode/plain_text"}.call(u.prototype),t.Mode=u}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/mode-text.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/mode-text.js -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/abap.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/abap",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="abap"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/ada.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ada",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="ada"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/apache_conf.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/apache_conf",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="apache_conf"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/applescript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/applescript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="applescript"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/asciidoc.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/asciidoc",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="asciidoc"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/assembly_x86.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/assembly_x86",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="assembly_x86"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/autohotkey.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/autohotkey",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="autohotkey"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/batchfile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/batchfile",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="batchfile"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/bro.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/bro",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope=""}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/c9search.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/c9search",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="c9search"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/cirru.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/cirru",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="cirru"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/cobol.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/cobol",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="cobol"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/coldfusion.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/coldfusion",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="coldfusion"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/csharp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/csharp",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="csharp"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/curly.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/curly",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="curly"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/d.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/d",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="d"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/diff.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/diff",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='# DEP-3 (http://dep.debian.net/deps/dep3/) style patch header\nsnippet header DEP-3 style header\n Description: ${1}\n Origin: ${2:vendor|upstream|other}, ${3:url of the original patch}\n Bug: ${4:url in upstream bugtracker}\n Forwarded: ${5:no|not-needed|url}\n Author: ${6:`g:snips_author`}\n Reviewed-by: ${7:name and email}\n Last-Update: ${8:`strftime("%Y-%m-%d")`}\n Applied-Upstream: ${9:upstream version|url|commit}\n\n',t.scope="diff"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/dockerfile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/dockerfile",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="dockerfile"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/dot.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/dot",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="dot"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/drools.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/drools",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='\nsnippet rule\n rule "${1?:rule_name}"\n when\n ${2:// when...} \n then\n ${3:// then...}\n end\n\nsnippet query\n query ${1?:query_name}\n ${2:// find} \n end\n \nsnippet declare\n declare ${1?:type_name}\n ${2:// attributes} \n end\n\n',t.scope="drools"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/eiffel.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/eiffel",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="eiffel"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/ejs.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ejs",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="ejs"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/elixir.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/elixir",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope=""}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/elm.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/elm",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="elm"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/forth.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/forth",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="forth"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/fortran.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/fortran",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="fortran"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/ftl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ftl",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="ftl"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/gcode.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gcode",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="gcode"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/gherkin.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gherkin",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="gherkin"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/gitignore.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gitignore",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="gitignore"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/glsl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/glsl",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="glsl"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/gobstones.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gobstones",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="# Procedure\nsnippet proc\n procedure ${1?:name}(${2:argument}) {\n ${3:// body...}\n }\n\n# Function\nsnippet fun\n function ${1?:name}(${2:argument}) {\n return ${3:// body...}\n }\n\n# Repeat\nsnippet rep\n repeat ${1?:times} {\n ${2:// body...}\n }\n\n# For\nsnippet for\n foreach ${1?:e} in ${2?:list} {\n ${3:// body...} \n }\n\n# If\nsnippet if\n if (${1?:condition}) {\n ${3:// body...} \n }\n\n# While\n while (${1?:condition}) {\n ${2:// body...} \n }\n",t.scope="gobstones"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/golang.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/golang",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="golang"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/groovy.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/groovy",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="groovy"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/haml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/haml",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="snippet t\n %table\n %tr\n %th\n ${1:headers}\n %tr\n %td\n ${2:headers}\nsnippet ul\n %ul\n %li\n ${1:item}\n %li\nsnippet =rp\n = render :partial => '${1:partial}'\nsnippet =rpl\n = render :partial => '${1:partial}', :locals => {}\nsnippet =rpc\n = render :partial => '${1:partial}', :collection => @$1\n\n",t.scope="haml"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/handlebars.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/handlebars",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="handlebars"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/haskell_cabal.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/haskell_cabal",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="haskell_cabal"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/haxe.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/haxe",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="haxe"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/hjson.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/hjson",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope=""}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/html_elixir.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/html_elixir",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="html_elixir"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/html_ruby.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/html_ruby",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="html_ruby"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/ini.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ini",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="ini"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/jack.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jack",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="jack"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/jade.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jade",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="jade"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/json.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/json",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="json"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/jsonvelocity.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jsonvelocity",["require","exports","module"], function(require, exports, module) { 2 | "use strict"; 3 | 4 | exports.snippetText =undefined; 5 | exports.scope = "jsonvelocity"; 6 | 7 | }); (function() { 8 | ace.require(["ace/snippets/jsonvelocity"], function(m) { 9 | if (typeof module == "object" && typeof exports == "object" && module) { 10 | module.exports = m; 11 | } 12 | }); 13 | })(); -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/jsx.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jsx",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="jsx"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/julia.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/julia",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="julia"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/kotlin.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/kotlin",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope=""}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/latex.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/latex",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="latex"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/lean.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/lean",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="lean"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/less.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/less",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="less"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/liquid.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/liquid",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="liquid"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/lisp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/lisp",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="lisp"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/live_script.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/live_script",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope=""}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/livescript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/livescript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="livescript"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/logiql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/logiql",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="logiql"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/lua.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/lua",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="snippet #!\n #!/usr/bin/env lua\n $1\nsnippet local\n local ${1:x} = ${2:1}\nsnippet fun\n function ${1:fname}(${2:...})\n ${3:-- body}\n end\nsnippet for\n for ${1:i}=${2:1},${3:10} do\n ${4:print(i)}\n end\nsnippet forp\n for ${1:i},${2:v} in pairs(${3:table_name}) do\n ${4:-- body}\n end\nsnippet fori\n for ${1:i},${2:v} in ipairs(${3:table_name}) do\n ${4:-- body}\n end\n",t.scope="lua"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/luapage.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/luapage",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="luapage"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/lucene.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/lucene",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="lucene"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/makefile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/makefile",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="snippet ifeq\n ifeq (${1:cond0},${2:cond1})\n ${3:code}\n endif\n",t.scope="makefile"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/mask.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mask",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="mask"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/matlab.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/matlab",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="matlab"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/maze.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/maze",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="snippet >\ndescription assignment\nscope maze\n -> ${1}= ${2}\n\nsnippet >\ndescription if\nscope maze\n -> IF ${2:**} THEN %${3:L} ELSE %${4:R}\n",t.scope="maze"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/mel.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mel",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="mel"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/mips_assembler.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mips_assembler",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="mips_assembler"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/mipsassembler.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mipsassembler",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope=""}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/mushcode.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mushcode",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="mushcode"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/mysql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mysql",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="mysql"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/nix.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/nix",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="nix"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/nsis.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/nsis",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope=""}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/objectivec.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/objectivec",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="objectivec"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/ocaml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ocaml",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="ocaml"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/pascal.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/pascal",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="pascal"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/pgsql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/pgsql",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="pgsql"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/plain_text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/plain_text",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="plain_text"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/powershell.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/powershell",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="powershell"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/praat.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/praat",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="praat"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/prolog.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/prolog",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="prolog"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/properties.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/properties",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="properties"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/protobuf.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/protobuf",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="",t.scope="protobuf"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/razor.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/razor",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="snippet if\n(${1} == ${2}) {\n ${3}\n}",t.scope="razor"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/rdoc.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/rdoc",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="rdoc"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/rhtml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/rhtml",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="rhtml"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/rst.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/rst",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="# rst\n\nsnippet :\n :${1:field name}: ${2:field body}\nsnippet *\n *${1:Emphasis}*\nsnippet **\n **${1:Strong emphasis}**\nsnippet _\n \\`${1:hyperlink-name}\\`_\n .. _\\`$1\\`: ${2:link-block}\nsnippet =\n ${1:Title}\n =====${2:=}\n ${3}\nsnippet -\n ${1:Title}\n -----${2:-}\n ${3}\nsnippet cont:\n .. contents::\n \n",t.scope="rst"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/rust.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/rust",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="rust"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/sass.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/sass",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="sass"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/scad.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scad",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="scad"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/scala.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scala",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="scala"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/scheme.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scheme",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="scheme"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/scss.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scss",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="scss"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/sjs.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/sjs",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="sjs"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/smarty.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/smarty",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="smarty"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/snippets.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/snippets",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="# snippets for making snippets :)\nsnippet snip\n snippet ${1:trigger}\n ${2}\nsnippet msnip\n snippet ${1:trigger} ${2:description}\n ${3}\nsnippet v\n {VISUAL}\n",t.scope="snippets"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/soy_template.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/soy_template",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="soy_template"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/space.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/space",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="space"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/stylus.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/stylus",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="stylus"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/svg.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/svg",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="svg"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/swift.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/swift",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="swift"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/swig.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/swig",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="swig"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/text",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="text"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/textile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/textile",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='# Jekyll post header\nsnippet header\n ---\n title: ${1:title}\n layout: post\n date: ${2:date} ${3:hour:minute:second} -05:00\n ---\n\n# Image\nsnippet img\n !${1:url}(${2:title}):${3:link}!\n\n# Table\nsnippet |\n |${1}|${2}\n\n# Link\nsnippet link\n "${1:link text}":${2:url}\n\n# Acronym\nsnippet (\n (${1:Expand acronym})${2}\n\n# Footnote\nsnippet fn\n [${1:ref number}] ${3}\n\n fn$1. ${2:footnote}\n \n',t.scope="textile"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/toml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/toml",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="toml"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/tsx.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/tsx",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="tsx"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/twig.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/twig",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="twig"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/typescript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/typescript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="typescript"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/vbscript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/vbscript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="vbscript"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/velocity.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/velocity",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='# macro\nsnippet #macro\n #macro ( ${1:macroName} ${2:\\$var1, [\\$var2, ...]} )\n ${3:## macro code}\n #end\n# foreach\nsnippet #foreach\n #foreach ( ${1:\\$item} in ${2:\\$collection} )\n ${3:## foreach code}\n #end\n# if\nsnippet #if\n #if ( ${1:true} )\n ${0}\n #end\n# if ... else\nsnippet #ife\n #if ( ${1:true} )\n ${2}\n #else\n ${0}\n #end\n#import\nsnippet #import\n #import ( "${1:path/to/velocity/format}" )\n# set\nsnippet #set\n #set ( $${1:var} = ${0} )\n',t.scope="velocity",t.includeScopes=["html","javascript","css"]}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/verilog.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/verilog",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="verilog"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/vhdl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/vhdl",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="vhdl"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/xml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/xml",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="xml"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/3rd-party/ace-editor/src-min-noconflict/snippets/yaml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/yaml",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="yaml"}) -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/ajaxEdit.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@page contentType="text/xml" %> 3 | ${messages} -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/css/mocha.css: -------------------------------------------------------------------------------- 1 | 2 | main#main-content-tag div#mocha ul#mocha-stats { 3 | position: relative; 4 | } 5 | 6 | main#main-content-tag div#mocha ul#mocha-stats li.progress canvas { 7 | display: none; 8 | } -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/editWebHook.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@page contentType="application/json" %> 3 | ${content} -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/editWebHookRunnerParams.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/editWebHookRunnerParams.jsp -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/js/admin-chart.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/js/admin-chart.js -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/js/noRestApi.js: -------------------------------------------------------------------------------- 1 | WebHooksPlugin.NoRestApi = { 2 | NoRestApiDialog: OO.extend(BS.AbstractWebForm, OO.extend(BS.AbstractModalDialog, { 3 | getContainer: function () { 4 | return $('noRestApiDialog'); 5 | }, 6 | 7 | formElement: function () { 8 | return $('noRestApiForm'); 9 | }, 10 | 11 | showDialog: function () { 12 | this.showCentered(); 13 | } 14 | 15 | })) 16 | }; -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6" 5 | }, 6 | "include": [ 7 | "js/*.js", 8 | "js/tests/*.js", 9 | "3rd-party/**/*.js" 10 | ], 11 | "exclude": [ 12 | "js/editWebHook.js", 13 | "js/editWebhookConfiguration-old.js" 14 | ] 15 | } -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/settingsList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="application/json;charset=UTF-8" language="java" session="true" errorPage="/runtimeError.jsp" 2 | %><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" 3 | %><%@ taglib prefix="bs" tagdir="/WEB-INF/tags" %> 4 | ${projectWebHooksAsJson} 5 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/templateRendering.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="application/json;charset=UTF-8" language="java" session="true" errorPage="/runtimeError.jsp" 2 | %><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" 3 | %><%@ taglib prefix="bs" tagdir="/WEB-INF/tags" %> 4 | ${templateRendering} 5 | -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/viewWebHookRunnerParams.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcplugins/tcWebHooks/a37a70c50554aa696f8f05540bc2c57510e37a3f/tcwebhooks-web-ui/src/main/resources/buildServerResources/WebHook/viewWebHookRunnerParams.jsp -------------------------------------------------------------------------------- /tcwebhooks-web-ui/src/test/java/webhook/teamcity/endpoint/WebHookEndPointViewerControllerTest.java: -------------------------------------------------------------------------------- 1 | package webhook.teamcity.endpoint; 2 | 3 | import static org.junit.Assert.*; 4 | import static webhook.teamcity.payload.util.StringUtils.stripTrailingSlash; 5 | import org.junit.Test; 6 | 7 | 8 | public class WebHookEndPointViewerControllerTest { 9 | 10 | @Test 11 | public void testStripTrailingSlash() { 12 | assertEquals("blah", stripTrailingSlash("blah/")); 13 | assertEquals("blah", stripTrailingSlash("blah")); 14 | assertEquals("blah/blah", stripTrailingSlash("blah/blah/")); 15 | assertEquals("blah/blah", stripTrailingSlash("blah/blah")); 16 | assertEquals("/blah/blah", stripTrailingSlash("/blah/blah/")); 17 | assertEquals("/blah/blah", stripTrailingSlash("/blah/blah")); 18 | } 19 | 20 | } 21 | --------------------------------------------------------------------------------