Skip to content

Commit

Permalink
resolves #1391 rouble not found net.minidev:json-smart:jar:2.3-SNAPSHOT
Browse files Browse the repository at this point in the history
resolves #1400 use JDK11 as minimal jvm version and update old jvm dependencies
  • Loading branch information
vsct-jburet committed Oct 4, 2022
1 parent d2bfcad commit e966251
Show file tree
Hide file tree
Showing 70 changed files with 23,975 additions and 983 deletions.
2 changes: 1 addition & 1 deletion bot/admin/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
288 changes: 9 additions & 279 deletions bot/admin/web/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bot/admin/web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script mavenbuild --loglevel warn</arguments>
<arguments>run-script mavenbuild --loglevel warn --force</arguments>
</configuration>
</execution>
</executions>
Expand Down
4 changes: 2 additions & 2 deletions bot/admin/web/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

export const environment = {
production: false,
autologin: true,
ssologin: false,
autologin: false,
ssologin: true,
default_user: 'admin@app.com',
default_password: 'password',
serverUrl: 'http://localhost:7999/rest'
Expand Down
2 changes: 1 addition & 1 deletion bot/api/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bot/chatbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bot/connector-alcmeon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion bot/connector-alexa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<!-- workaround for mockk issue see https://github.com/mockk/mockk/issues/199 -->
Expand Down
3 changes: 1 addition & 2 deletions bot/connector-ga/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<name>Tock Bot Google Assistant Connector</name>
<description>Bot Connector for Google Assistant</description>


<dependencies>
<dependency>
<groupId>ai.tock</groupId>
Expand Down Expand Up @@ -86,7 +85,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion bot/connector-google-chat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions bot/connector-iadvize/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -91,4 +91,4 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
5 changes: 3 additions & 2 deletions bot/connector-iadvize/src/main/kotlin/IadvizeConnector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import ai.tock.bot.connector.media.MediaMessage
import ai.tock.bot.engine.BotBus
import ai.tock.bot.engine.action.Action
import ai.tock.shared.jackson.mapper
import io.vertx.core.Future
import io.vertx.core.http.HttpServerResponse
import io.vertx.ext.web.Route
import io.vertx.ext.web.RoutingContext
Expand Down Expand Up @@ -202,7 +203,7 @@ class IadvizeConnector internal constructor(
}
}

private fun <T> HttpServerResponse.endWithJson(response: T) {
private fun <T> HttpServerResponse.endWithJson(response: T) : Future<Void> {
val response: String = mapper.writeValueAsString(response)
logger.info { "response : $response" }
return putHeader("Content-Type", "application/json").end(response)
Expand Down Expand Up @@ -261,4 +262,4 @@ class IadvizeConnector internal constructor(
logRequest(verb, uri)
logger.info { "body : $body" }
}
}
}
45 changes: 25 additions & 20 deletions bot/connector-iadvize/src/main/kotlin/IadvizeConnectorCallback.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import ai.tock.bot.connector.iadvize.model.request.UnsupportedRequest
import ai.tock.bot.connector.iadvize.model.response.conversation.Duration
import ai.tock.bot.connector.iadvize.model.response.conversation.MessageResponse
import ai.tock.bot.connector.iadvize.model.response.conversation.payload.TextPayload
import ai.tock.bot.connector.iadvize.model.response.conversation.reply.IadvizeAwait
import ai.tock.bot.connector.iadvize.model.response.conversation.reply.IadvizeMessage
import ai.tock.bot.connector.iadvize.model.response.conversation.reply.IadvizeReply
import ai.tock.bot.connector.iadvize.model.response.conversation.reply.IadvizeTransfer
import ai.tock.bot.connector.iadvize.model.response.conversation.reply.IadvizeAwait
import ai.tock.bot.engine.ConnectorController
import ai.tock.bot.engine.I18nTranslator
import ai.tock.bot.engine.action.Action
Expand All @@ -39,20 +39,23 @@ import ai.tock.shared.error
import ai.tock.shared.jackson.mapper
import ai.tock.shared.loadProperties
import ai.tock.shared.vertx.RestException
import io.vertx.core.Future
import io.vertx.core.http.HttpServerResponse
import io.vertx.ext.web.RoutingContext
import mu.KotlinLogging
import java.time.LocalDateTime
import java.util.*
import java.util.Locale
import java.util.Properties
import mu.KotlinLogging

private const val UNSUPPORTED_MESSAGE_REQUEST = "tock_iadvize_unsupported_message_request"

class IadvizeConnectorCallback(override val applicationId: String,
val controller: ConnectorController,
val context: RoutingContext,
val request: IadvizeRequest,
val distributionRule: String?,
val actions: MutableList<ActionWithDelay> = mutableListOf()
class IadvizeConnectorCallback(
override val applicationId: String,
val controller: ConnectorController,
val context: RoutingContext,
val request: IadvizeRequest,
val distributionRule: String?,
val actions: MutableList<ActionWithDelay> = mutableListOf()
) : ConnectorCallbackBase(applicationId, iadvizeConnectorType) {

companion object {
Expand Down Expand Up @@ -106,9 +109,10 @@ class IadvizeConnectorCallback(override val applicationId: String,
request.idConversation,
request.idOperator,
LocalDateTime.now(),
LocalDateTime.now())
LocalDateTime.now()
)

return when(request) {
return when (request) {
is ConversationsRequest -> response

is MessageRequest -> {
Expand All @@ -119,7 +123,8 @@ class IadvizeConnectorCallback(override val applicationId: String,
is UnsupportedRequest -> {
logger.error("Request type ${request.type} is not supported by connector")
//TODO: to be replaced by a transfer to a human when this type of message is supported
val configuredMessage: String = properties.getProperty(UNSUPPORTED_MESSAGE_REQUEST, UNSUPPORTED_MESSAGE_REQUEST)
val configuredMessage: String =
properties.getProperty(UNSUPPORTED_MESSAGE_REQUEST, UNSUPPORTED_MESSAGE_REQUEST)
val message: String = translator.translate(configuredMessage).toString()
response.replies.add(IadvizeMessage(TextPayload(message)))
return response
Expand All @@ -132,7 +137,7 @@ class IadvizeConnectorCallback(override val applicationId: String,
private fun toListIadvizeReply(actions: List<ActionWithDelay>): List<IadvizeReply> {
return actions.map {
if (it.action is SendSentence) {
try{
try {
val listIadvizeReply: List<IadvizeReply> = it.action.messages.filterAndEnhanceIadvizeReply()

if (it.action.text != null) {
Expand All @@ -144,7 +149,7 @@ class IadvizeConnectorCallback(override val applicationId: String,
listIadvizeReply
}
} catch (exception: RestException) {
listOf()
listOf()
}
} else {
emptyList()
Expand All @@ -155,7 +160,7 @@ class IadvizeConnectorCallback(override val applicationId: String,
private fun List<ConnectorMessage>.filterAndEnhanceIadvizeReply(): List<IadvizeReply> {
// Filter Message not IadvizeConnectorMessage for other connector
return filterIsInstance<IadvizeConnectorMessage>()
.map{ connectorMessage -> connectorMessage.replies }
.map { connectorMessage -> connectorMessage.replies }
.flatten()
.map(addDistributionRulesOnTransfer)
}
Expand All @@ -165,8 +170,8 @@ class IadvizeConnectorCallback(override val applicationId: String,
* return new IadvizeTransfer with distribution rule configured on connector
*/
private val addDistributionRulesOnTransfer: (IadvizeReply) -> IadvizeReply = {
if(it is IadvizeTransfer) {
if(distributionRule == null) {
if (it is IadvizeTransfer) {
if (distributionRule == null) {
IadvizeAwait(Duration(3, seconds))
} else {
IadvizeTransfer(distributionRule, it.transferOptions)
Expand All @@ -192,8 +197,8 @@ class IadvizeConnectorCallback(override val applicationId: String,
context.fail(throwable)
}

private fun <T> HttpServerResponse.endWithJson(response: T?) {
if(response != null) {
private fun <T> HttpServerResponse.endWithJson(response: T?): Future<Void> {
if (response != null) {
logger.debug { "iAdvize response : $response" }

val writeValueAsString = mapper.writeValueAsString(response)
Expand All @@ -205,4 +210,4 @@ class IadvizeConnectorCallback(override val applicationId: String,
return end()
}
}
}
}
2 changes: 1 addition & 1 deletion bot/connector-messenger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
12 changes: 11 additions & 1 deletion bot/connector-rocketchat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,22 @@
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jre7</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.litote.chat.rocket.sdk</groupId>
<artifactId>common</artifactId>
<version>${rocket}</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.json</groupId>
Expand Down Expand Up @@ -81,7 +91,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion bot/connector-slack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
11 changes: 8 additions & 3 deletions bot/connector-teams/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@

<properties>
<microsoft.bot>4.14.2</microsoft.bot>
<nimbus-jose-jwt>9.23</nimbus-jose-jwt>
<nimbus-jose-jwt>9.25.4</nimbus-jose-jwt>
<gson>2.9.1</gson>
<minidev>2.4.8</minidev>
</properties>

<dependencies>
Expand All @@ -58,7 +59,11 @@
<artifactId>gson</artifactId>
<version>${gson}</version>
</dependency>

<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>${minidev}</version>
</dependency>

<!-- force jackson dependencies -->
<dependency>
Expand Down Expand Up @@ -112,7 +117,7 @@
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<artifactId>mockk-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit e966251

Please sign in to comment.