Skip to content

Commit 7092066

Browse files
committed
Release 1.7.0
2 parents 4924c02 + da2a446 commit 7092066

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1228
-88
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
<!-- Thanks for submitting a pull request! Please provide enough information
2-
so that others can review your pull request. -->
1+
| Q | A
2+
| ----------------- | ----------
3+
| Bug fix? | yes/no
4+
| New feature? | yes/no <!-- please update the /CHANGELOG.md file -->
5+
| BC breaks? | no
6+
| Related Issue | Fix #... <!-- will close issue automatically, if any -->
7+
| Need Doc update | yes/no
38

4-
# Summary
5-
<!-- Explain the **motivation** for making this change. What existing problem
6-
does the pull request solve? Are there any linked issues? -->
79

8-
# Result
9-
<!-- Demonstrate the code is solid.
10-
Example: The exact commands you ran and their output,
11-
screenshots / videos if the pull request changes UI. -->
10+
## Describe your change
11+
12+
<!--
13+
Please describe your change, add as much detail as
14+
necessary to understand your code.
15+
-->
16+
17+
## What problem is this fixing?
18+
19+
<!--
20+
Please include everything needed to understand the problem,
21+
its context and consequences, and, if possible, how to recreate it.
22+
-->

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
# 1.7.0
2+
3+
### Added
4+
- Query/Settings: `relevancyStrictness` and `decompoundQuery` parameters (#248)
5+
- ResponseSearch: `appliedRelevancyStrictness` and `nbSortedHits` parameters
6+
- Settings: `attributesToTransliterate` parameter (#249)
7+
- Custom dictionaries: stop words, plurals and compounds
8+
- Rules condition: `filters` parameter (#250)
9+
10+
### Changed
11+
- Update Kotlin to 1.4.30
12+
- Update Ktor 1.5.1
13+
114
# 1.6.2
215

316
### Added
417
- Settings: `attributeCriteriaComputedByMinProximity` parameter
518

619
### Changed
7-
- Update Kotlin to 1.4.2
20+
- Update Kotlin to 1.4.20
21+
- Update Ktor 1.5.0
822

923
### Experimental
1024
- AnswersQuery: `queryLanguages` required (non-nullable)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your Kotlin project</h4>
77

88
<p align="center">
9-
<a href="https://bintray.com/algolia/maven/algoliasearch-client-kotlin/_latestVersion"><img src="https://api.bintray.com/packages/algolia/maven/algoliasearch-client-kotlin/images/download.svg" alt="Latest version"></img></a>
9+
<a href="https://search.maven.org/search?q=a:algoliasearch-client-kotlin"><img src="https://img.shields.io/maven-central/v/com.algolia/algoliasearch-client-kotlin?label=Download" alt="Latest version"></img></a>
1010
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="Licence"></img></a>
1111
</p>
1212
</p>
@@ -38,7 +38,7 @@ Install the Kotlin client by adding the following dependency to your `gradle.bui
3838

3939
```gradle
4040
repositories {
41-
maven { url "https://dl.bintray.com/algolia/maven" }
41+
mavenCentral()
4242
}
4343
4444
dependencies {

build.gradle.kts

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import com.diffplug.gradle.spotless.SpotlessExtension
22
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
3-
import java.net.URI
43

54
buildscript {
65
repositories {
@@ -13,20 +12,17 @@ buildscript {
1312
}
1413

1514
plugins {
16-
kotlin("multiplatform") version "1.4.21"
17-
kotlin("plugin.serialization") version "1.4.21"
15+
kotlin("multiplatform") version "1.4.30"
16+
kotlin("plugin.serialization") version "1.4.30"
1817
id("maven-publish")
18+
id("signing")
1919
}
2020

2121
apply(plugin = "com.diffplug.spotless")
2222

2323
repositories {
24-
jcenter()
25-
google()
2624
mavenCentral()
27-
maven { url = URI("https://dl.bintray.com/kotlin/ktor") }
28-
maven { url = URI("https://kotlin.bintray.com/kotlinx") }
29-
maven { url = URI("https://oss.sonatype.org/content/repositories/snapshots") }
25+
google()
3026
}
3127

3228
version = Library.version
@@ -74,10 +70,6 @@ kotlin {
7470
}
7571
}
7672

77-
val javadocJar by tasks.creating(Jar::class) {
78-
archiveClassifier.value("javadoc")
79-
}
80-
8173
tasks {
8274

8375
withType<KotlinCompile<*>>().configureEach {
@@ -100,24 +92,29 @@ tasks {
10092
configure<SpotlessExtension> {
10193
kotlin {
10294
target("**/*.kt")
103-
ktlint("0.39.0")
95+
ktlint("0.40.0")
10496
trimTrailingWhitespace()
10597
endWithNewline()
10698
}
10799
}
108100

109101
//** Publish **//
102+
val emptyJar by tasks.creating(Jar::class) {
103+
archiveAppendix.set("empty")
104+
}
110105

111106
publishing {
112107
repositories {
113108
maven {
114-
url = uri("https://api.bintray.com/maven/algolia/maven/algoliasearch-client-kotlin/;publish=0")
109+
name = "MavenCentral"
110+
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
115111
credentials {
116-
username = System.getenv("BINTRAY_USER")
117-
password = System.getenv("BINTRAY_KEY")
112+
username = System.getenv("SONATYPE_USER")
113+
password = System.getenv("SONATYPE_KEY")
118114
}
119115
}
120116
}
117+
121118
publications.withType<MavenPublication>().all {
122119
groupId = Library.group
123120
version = Library.version
@@ -126,32 +123,45 @@ publishing {
126123
else -> "${Library.artifact}-$name"
127124
}
128125

126+
artifact(emptyJar) { classifier = "javadoc" }
127+
129128
pom.withXml {
130129
asNode().apply {
130+
appendNode("name", "Algolia Search API Client for Kotlin")
131131
appendNode("description",
132132
"Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries," +
133133
"and pre-built integrations. Algolia API Client for Kotlin lets you easily use the Algolia Search" +
134134
"REST API from your JVM project, such as Android or backend implementations.")
135135
appendNode("url", "https://github.com/algolia/algoliasearch-client-kotlin")
136-
appendNode("licenses").appendNode("license").apply {
137-
appendNode("name", "MIT")
138-
appendNode("url", "http://www.opensource.org/licenses/mit-license.php")
139-
appendNode("distribution", "repo")
140-
}
141-
appendNode("developers").appendNode("developer").apply {
142-
appendNode("id", "algolia")
143-
appendNode("name", "The Algolia Team")
144-
appendNode("email", "[email protected]")
145-
}
136+
appendNode("licenses")
137+
.appendNode("license").apply {
138+
appendNode("name", "MIT")
139+
appendNode("url", "http://www.opensource.org/licenses/mit-license.php")
140+
appendNode("distribution", "repo")
141+
}
142+
appendNode("developers")
143+
.appendNode("developer").apply {
144+
appendNode("id", "algolia")
145+
appendNode("name", "The Algolia Team")
146+
appendNode("email", "[email protected]")
147+
appendNode("organization", "Algolia")
148+
appendNode("organizationUrl", "https://algolia.com")
149+
}
146150
appendNode("scm").apply {
147-
appendNode("url", "https://github.com/algolia/algoliasearch-client-kotlin.git")
151+
appendNode("url", "https://github.com/algolia/algoliasearch-client-kotlin")
152+
appendNode("connection", "scm:git:git://github.com/algolia/algoliasearch-client-kotlin.git")
153+
appendNode("developerConnection",
154+
"scm:git:ssh://github.com:algolia/algoliasearch-client-kotlin.git")
148155
}
149156
}
150157
}
151158
}
159+
}
152160

153-
kotlin.targets.forEach { target ->
154-
val targetPublication = publications.withType<MavenPublication>().findByName(target.name)
155-
targetPublication?.artifact(javadocJar)
156-
}
161+
signing {
162+
val signingKeyId = System.getenv("SIGNING_KEY_ID")
163+
val signingKey = System.getenv("SIGNING_KEY")
164+
val signingPassword = System.getenv("SIGNING_PASSWORD")
165+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
166+
sign(publishing.publications)
157167
}

buildSrc/build.gradle.kts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2-
31
plugins {
42
`kotlin-dsl`
5-
kotlin("jvm") version "1.3.71"
63
}
74

85
repositories {
9-
jcenter()
10-
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
11-
}
12-
dependencies {
13-
implementation(kotlin("stdlib-jdk8"))
14-
}
15-
val compileKotlin: KotlinCompile by tasks
16-
compileKotlin.kotlinOptions {
17-
jvmTarget = "1.8"
18-
}
19-
val compileTestKotlin: KotlinCompile by tasks
20-
compileTestKotlin.kotlinOptions {
21-
jvmTarget = "1.8"
6+
mavenCentral()
227
}

buildSrc/src/main/kotlin/Ktor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ object Ktor : Dependency {
22

33
override val group = "io.ktor"
44
override val artifact = "ktor"
5-
override val version = "1.5.0"
5+
override val version = "1.5.1"
66
}

buildSrc/src/main/kotlin/Library.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ object Library : Dependency {
22

33
override val group = "com.algolia"
44
override val artifact = "algoliasearch-client-kotlin"
5-
override val version = "1.6.2"
5+
override val version = "1.7.0"
66
}

buildSrc/src/main/kotlin/plugin/Spotless.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ object Spotless : Dependency {
66

77
override val group = "com.diffplug.spotless"
88
override val artifact = "spotless-plugin-gradle"
9-
override val version = "5.1.1"
9+
override val version = "5.9.0"
1010
}

gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ org.gradle.parallel=true
33
android.useAndroidX=true
44

55
# Workaround for Bintray treating .sha512 files as artifacts
6-
# https://github.com/gradle/gradle/issues/11412
7-
systemProp.org.gradle.internal.publish.checksums.insecure=true
86
kotlin.mpp.enableGranularSourceSetsMetadata=true
97

108
# Kotlin MPP

src/commonMain/kotlin/com/algolia/search/client/ClientSearch.kt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.algolia.search.configuration.Credentials
99
import com.algolia.search.configuration.internal.Credentials
1010
import com.algolia.search.configuration.internal.DEFAULT_LOG_LEVEL
1111
import com.algolia.search.endpoint.EndpointAPIKey
12+
import com.algolia.search.endpoint.EndpointDictionary
1213
import com.algolia.search.endpoint.EndpointMultiCluster
1314
import com.algolia.search.endpoint.EndpointMultipleIndex
1415
import com.algolia.search.helper.internal.sha256
@@ -21,10 +22,13 @@ import com.algolia.search.model.apikey.SecuredAPIKeyRestriction
2122
import com.algolia.search.model.internal.Time
2223
import com.algolia.search.model.response.ResponseAPIKey
2324
import com.algolia.search.model.response.ResponseBatches
25+
import com.algolia.search.model.response.ResponseDictionary
2426
import com.algolia.search.model.response.ResponseLogs
2527
import com.algolia.search.model.response.creation.CreationAPIKey
2628
import com.algolia.search.model.response.deletion.DeletionAPIKey
29+
import com.algolia.search.model.task.AppTaskID
2730
import com.algolia.search.model.task.TaskIndex
31+
import com.algolia.search.model.task.TaskInfo
2832
import com.algolia.search.model.task.TaskStatus
2933
import com.algolia.search.transport.RequestOptions
3034
import com.algolia.search.transport.internal.Transport
@@ -39,6 +43,7 @@ public interface ClientSearch :
3943
EndpointMultipleIndex,
4044
EndpointAPIKey,
4145
EndpointMultiCluster,
46+
EndpointDictionary,
4247
Configuration,
4348
Credentials {
4449

@@ -76,6 +81,42 @@ public interface ClientSearch :
7681
*/
7782
public suspend fun DeletionAPIKey.wait(timeout: Long? = null): Boolean
7883

84+
/**
85+
* Wait on a [ResponseDictionary] operation.
86+
*
87+
* @param timeout If a value is specified, the method will throw [TimeoutCancellationException] after waiting for
88+
* the allotted time in milliseconds.
89+
*/
90+
public suspend fun ResponseDictionary.wait(
91+
timeout: Long? = null,
92+
requestOptions: RequestOptions? = null,
93+
): TaskStatus
94+
95+
/**
96+
* Wait for a task at application level to complete before executing the next line of code.
97+
*
98+
* @param taskID ID of the task to wait for.
99+
* @param timeout If a value is specified, the method will throw [TimeoutCancellationException] after waiting for
100+
* the allotted time in milliseconds.
101+
* @param requestOptions Configure request locally with [RequestOptions]
102+
*/
103+
public suspend fun waitTask(
104+
taskID: AppTaskID,
105+
timeout: Long? = null,
106+
requestOptions: RequestOptions? = null,
107+
): TaskStatus
108+
109+
/**
110+
* Check the current [TaskStatus] of a given application level task.
111+
*
112+
* @param taskID ID of the task to get its info.
113+
* @param requestOptions Configure request locally with [RequestOptions]
114+
*/
115+
public suspend fun getTask(
116+
taskID: AppTaskID,
117+
requestOptions: RequestOptions? = null,
118+
): TaskInfo
119+
79120
/**
80121
* Convenience methods to get the logs directly from the [ClientSearch] without instantiating an [Index].
81122
*

0 commit comments

Comments
 (0)