Skip to content

Commit

Permalink
Add the fileName: String field to the Attachment model.
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD committed May 23, 2020
1 parent 48ce93f commit 5e33e00
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 11 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Changelog

## 2.1.0
Add the `fileName: String` field to the `Attachment` model.

## v2.0.1
Minor comment fix, and dependency updates
Minor comment fix, and dependency updates.

## v2.0.0
Migrated the project to Kotlin Multiplatform
Migrated the project to Kotlin Multiplatform:
- Removed Flow based client (was not really useful)
- Added a Callback based client (useful for Swift)
- Tweaked the API a bit to make it work well with Multiplatform
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repositories {
```groovy
dependencies {
/* ... */
implementation 'org.jraf:klibqonto:2.0.1'
implementation 'org.jraf:klibqonto:2.1.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {

allprojects {
group = 'org.jraf'
version = '2.0.1'
version = '2.1.0'

repositories.addRepos()

Expand Down
2 changes: 1 addition & 1 deletion gradle/misc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'com.github.ben-manes.versions'
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { selection ->
boolean rejected = ['alpha', 'beta', 'rc'].any { qualifier ->
boolean rejected = ['alpha', 'beta', 'rc', 'm1'].any { qualifier ->
selection.candidate.version.toLowerCase() ==~ /.*-${qualifier}.*/
}
if (rejected) {
Expand Down
8 changes: 4 additions & 4 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def plugins = [:]
plugins.with {
gradleVersions = '0.28.0'
dokka = '0.10.1'
android = '3.6.1'
android = '3.6.3'
}
versions.plugins = plugins

Expand All @@ -20,7 +20,7 @@ versions.buildLibs = buildLibs
// Build parameters
def build = [:]
build.with {
gradle = '6.2.2'
gradle = '6.4.1'
kotlinJvmTarget = '1.8'
}
versions.build = build
Expand All @@ -35,9 +35,9 @@ versions.testing = testing

// Other dependencies
versions.with {
kotlin = '1.3.70'
kotlin = '1.3.72'
ktor = '1.3.2'
coroutines = '1.3.3'
coroutines = '1.3.7'
retrofit = '2.6.1'
okHttp = '4.1.1'
gson = '2.8.5'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 3 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.70'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.72'
}

apply plugin: 'com.android.library'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.jraf.klibqonto.model.attachments.Attachment
internal object ApiAttachmentEnvelopeConverter : ApiConverter<ApiAttachmentEnvelope, Attachment>() {
override fun apiToModel(apiModel: ApiAttachmentEnvelope) = AttachmentImpl(
apiModel.attachment.id,
apiModel.attachment.file_name,
ApiDateConverter.apiToModel(apiModel.attachment.created_at)!!,
apiModel.attachment.file_size,
apiModel.attachment.file_content_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.jraf.klibqonto.model.dates.Date

internal data class AttachmentImpl(
override val id: String,
override val fileName: String,
override val createdDate: Date,
override val size: Long,
override val contentType: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ interface Attachment {
*/
val id: String

/**
* Name of the file
*/
val fileName: String

/**
* Timestamp of the file upload
*/
Expand Down

0 comments on commit 5e33e00

Please sign in to comment.