From 0f13644a585b2e74879b179e27420a1b32a77f63 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Fri, 30 Jun 2023 16:34:30 +0300 Subject: [PATCH 01/42] updated openapi for user validation support --- api/api-ktor/meetacy-api.yml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index 2bf57576..3ae15f75 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -998,6 +998,30 @@ paths: $ref: '#/components/examples/InvalidFileId' InvalidNickname: $ref: '#/components/examples/InvalidNickname' + /validate: + parameters: + - name: Api-Version + in: header + description: The version of API to invoke request with + required: true + schema: + type: string + post: + summary: Validating a username + tags: + - user + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ValidateUsernameRequest" + responses: + "200": + description: An example of a passed validation + content: + application/json: + schema: + $ref: "#/components/schemas/ValidateUsernameResponse" components: examples: ExpiredLink: @@ -1772,3 +1796,27 @@ components: - "id" - "isNew" - "date" + ValidateUsernameRequest: + type: object + properties: + username: + type: string + required: + - username + ValidateUsernameResponse: + type: object + properties: + status: + type: boolean + example: true + result: + type: object + properties: + username: + type: string + example: bpavuk + required: + - username + required: + - result + - status From 47ff05fef34fbcbf8e2074d85166ad096005aab8 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Fri, 30 Jun 2023 16:34:44 +0300 Subject: [PATCH 02/42] added new request --- .../sdk/engine/requests/ValidateUsernameRequest.kt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ValidateUsernameRequest.kt diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ValidateUsernameRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ValidateUsernameRequest.kt new file mode 100644 index 00000000..067bba70 --- /dev/null +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ValidateUsernameRequest.kt @@ -0,0 +1,9 @@ +package app.meetacy.sdk.engine.requests + +import app.meetacy.sdk.types.user.Username + +public data class ValidateUsernameRequest( + val username: Username +) : MeetacyRequest { + public data class Response(val username: Username) +} From f1e2b5822a3d35aaf36ec9bb11870deedccd8572 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Fri, 30 Jun 2023 16:35:04 +0300 Subject: [PATCH 03/42] added new engine function --- .../engine/ktor/requests/users/UsersEngine.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index b4acb289..4d1e19c7 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -5,10 +5,13 @@ import app.meetacy.sdk.engine.ktor.mapToUser import app.meetacy.sdk.engine.requests.EditUserRequest import app.meetacy.sdk.engine.requests.GetMeRequest import app.meetacy.sdk.engine.requests.GetUserRequest +import app.meetacy.sdk.engine.requests.ValidateUsernameRequest import app.meetacy.sdk.exception.meetacyApiError +import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.optional.ifPresent import app.meetacy.sdk.types.url.Url import app.meetacy.sdk.types.user.SelfUser +import app.meetacy.sdk.types.user.Username import dev.icerock.moko.network.generated.apis.UserApi import dev.icerock.moko.network.generated.apis.UserApiImpl import dev.icerock.moko.network.generated.models.EditUserResponse @@ -21,6 +24,7 @@ import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import dev.icerock.moko.network.generated.models.GetUserRequest as GeneratedGetUserRequest +import dev.icerock.moko.network.generated.models.ValidateUsernameRequest as GeneratedValidateUsernameRequest internal class UsersEngine( private val baseUrl: Url, @@ -87,4 +91,16 @@ internal class UsersEngine( return EditUserRequest.Response(user = user.mapToSelfUser()) } + + @OptIn(UnsafeConstructor::class) + suspend fun validateUsername(request: ValidateUsernameRequest): ValidateUsernameRequest.Response { + val response = base.validatePost( + validateUsernameRequest = GeneratedValidateUsernameRequest( + username = request.username.string + ), + apiVersion = request.apiVersion.int.toString() + ) + + return ValidateUsernameRequest.Response(username = Username(response.result.username)) + } } From e6128b6c10bdcd9fa5f4133a18eed926bde63152 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Fri, 30 Jun 2023 16:35:20 +0300 Subject: [PATCH 04/42] linked request to engine function --- .../kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt index 048d5679..89c62b8f 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt @@ -71,6 +71,7 @@ public class KtorMeetacyEngine( is GetMeRequest -> users.getMe(request) as T is GetUserRequest -> users.getUser(request) as T is EditUserRequest -> users.editUser(request) as T + is ValidateUsernameRequest -> users.validateUsername(request) as T // meetings is ListMeetingsHistoryRequest -> meetings.listMeetingsHistory(request) as T is ListActiveMeetingsRequest -> meetings.listActiveMeetings(request) as T From 3416b2fa22be35762c8bb0d2785118394a4c282b Mon Sep 17 00:00:00 2001 From: bpavuk Date: Fri, 30 Jun 2023 16:36:09 +0300 Subject: [PATCH 05/42] added validation function to users api --- .../kotlin/app/meetacy/sdk/users/UsersApi.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt index b80e3d81..b1bb356b 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt @@ -3,10 +3,11 @@ package app.meetacy.sdk.users import app.meetacy.sdk.MeetacyApi import app.meetacy.sdk.engine.requests.EditUserRequest import app.meetacy.sdk.engine.requests.GetUserRequest +import app.meetacy.sdk.engine.requests.ValidateUsernameRequest +import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.file.FileId import app.meetacy.sdk.types.optional.Optional -import app.meetacy.sdk.types.user.SelfUser import app.meetacy.sdk.types.user.User import app.meetacy.sdk.types.user.UserId import app.meetacy.sdk.types.user.Username @@ -47,4 +48,13 @@ public class UsersApi(private val api: MeetacyApi) { api = api ) } + + @OptIn(UnsafeConstructor::class) + public suspend fun validateUsername( + username: String + ): Username { + val result = api.engine.execute(ValidateUsernameRequest(username = Username(username))) + + return result.username + } } From d96b8d33a00429adaca8d205d8daf32d814f2e82 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Fri, 30 Jun 2023 16:36:20 +0300 Subject: [PATCH 06/42] altered needed classes --- .../kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt | 6 ++++++ .../kotlin/app/meetacy/sdk/users/RegularUserRepository.kt | 6 ++++++ .../kotlin/app/meetacy/sdk/users/SelfUserRepository.kt | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt index 938244dd..1350b67d 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt @@ -40,4 +40,10 @@ public class AuthorizedUsersApi(private val api: AuthorizedMeetacyApi) { api = api ) } + + public suspend fun validateUsername( + username: String + ): Username { + return base.validateUsername(username) + } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt index 52a12354..d9399f28 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt @@ -25,4 +25,10 @@ public class RegularUserRepository( public suspend fun deleteFriend(token: Token) { api.friends.delete(token, data.id) } + + public suspend fun validateUsername( + username: String + ): Username { + return api.users.validateUsername(username) + } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt index 5e963605..5e660102 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt @@ -50,4 +50,10 @@ public class SelfUserRepository( username: Optional = Optional.Undefined, avatarId: Optional = Optional.Undefined ): SelfUserRepository = api.users.edit(token, nickname, username, avatarId) + + public suspend fun validateUsername( + username: String + ): Username { + return api.users.validateUsername(username) + } } From e47c33533fb6c8f172f9179e3ea492941000bcbc Mon Sep 17 00:00:00 2001 From: bpavuk Date: Fri, 30 Jun 2023 16:50:14 +0300 Subject: [PATCH 07/42] added username validation to auth api --- api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt index df69b3fa..7ce5b2e9 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt @@ -5,15 +5,20 @@ import app.meetacy.sdk.MeetacyApi import app.meetacy.sdk.auth.email.EmailApi import app.meetacy.sdk.engine.requests.GenerateAuthRequest import app.meetacy.sdk.types.auth.Token +import app.meetacy.sdk.types.user.Username public class AuthApi(private val api: MeetacyApi) { public val email: EmailApi = EmailApi(api) public suspend fun generate(nickname: String): Token { + validateUsername(nickname) return api.engine.execute(GenerateAuthRequest(nickname)).token } public suspend fun generateAuthorizedApi(nickname: String): AuthorizedMeetacyApi { return api.authorized(generate(nickname)) } + + public suspend fun validateUsername(username: String): Username = + api.users.validateUsername(username) } From cacf2953b2d797602b58976fad1c4bb07ac364a8 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Tue, 11 Jul 2023 22:03:42 +0300 Subject: [PATCH 08/42] fix(#68): meetacy-api.yml have been synced with the backend --- api/api-ktor/meetacy-api.yml | 41 ++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index 3ae15f75..0ef2f642 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -951,8 +951,8 @@ paths: schema: $ref: '#/components/schemas/InvalidResponse' examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' + InvalidUtf8String: + $ref: '#/components/examples/InvalidUtf8String' UserNotFound: $ref: '#/components/examples/UserNotFound' /users/edit: @@ -998,7 +998,7 @@ paths: $ref: '#/components/examples/InvalidFileId' InvalidNickname: $ref: '#/components/examples/InvalidNickname' - /validate: + /users/validate: parameters: - name: Api-Version in: header @@ -1022,6 +1022,20 @@ paths: application/json: schema: $ref: "#/components/schemas/ValidateUsernameResponse" + "400": + description: Failed verification example + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidResponse' + examples: + InvalidAccessIdentity: + $ref: '#/components/examples/InvalidToken' + InvalidAvatarIdentity: + $ref: '#/components/examples/InvalidFileId' + InvalidNickname: + $ref: '#/components/examples/InvalidNickname' + components: examples: ExpiredLink: @@ -1047,18 +1061,17 @@ components: InvalidNickname: value: status: false - errorCode: 6 + errorCode: 16 errorMessage: "Please provide a valid nickname" - NullEditParameters: + UsernameAlreadyOccupied: value: status: false - errorCode: 14 - errorMessage: "Specify at least one meeting edit parameter" - InvalidTitleOrDescription: + errorCode: 6 + NullEditParameters: value: status: false - errorCode: 7 - errorMessage: "Please provide a valid title or description" + errorCode: 10 + errorMessage: "Specify at least one meeting edit parameter" InvalidFileId: value: status: false @@ -1072,7 +1085,7 @@ components: FriendNotFound: value: status: false - errorCode: 8 + errorCode: 7 errorMessage: "Friend was not found" FriendAlreadyAdded: value: @@ -1087,7 +1100,7 @@ components: MeetingAlreadyParticipate: value: status: false - errorCode: 10 + errorCode: 9 errorMessage: "You are already participating in this meeting" LastNotificationIdInvalid: value: @@ -1097,12 +1110,12 @@ components: UserNotFound: value: status: false - errorCode: 9 + errorCode: 8 errorMessage: "FullUser not found" InvalidUtf8String: value: status: false - errorCode: 9 + errorCode: 16 errorMessage: "Please provide a valid string" schemas: GenerateIdentityRequest: From 121db00f4381085050f8aca9fa617f3770a8a6cd Mon Sep 17 00:00:00 2001 From: y9Kap Date: Wed, 12 Jul 2023 01:03:02 +0300 Subject: [PATCH 09/42] feat(#68): api documentation was updated --- api/api-ktor/meetacy-api.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index 0ef2f642..9429f9d1 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -1029,12 +1029,10 @@ paths: schema: $ref: '#/components/schemas/InvalidResponse' examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - InvalidAvatarIdentity: - $ref: '#/components/examples/InvalidFileId' - InvalidNickname: - $ref: '#/components/examples/InvalidNickname' + InvalidUtf8String: + $ref: '#/components/examples/InvalidUtf8String' + UsernameAlreadyOccupied: + $ref: '#/components/examples/UsernameAlreadyOccupied' components: examples: @@ -1067,6 +1065,7 @@ components: value: status: false errorCode: 6 + errorMessage: "Username already occupied. Please provide another username." NullEditParameters: value: status: false From 15b667024061bcfa22737d677a4c4880d59e14e0 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Wed, 12 Jul 2023 01:09:39 +0300 Subject: [PATCH 10/42] feat(#68): validate username was added --- .../app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index 4d1e19c7..ece170c1 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -94,7 +94,7 @@ internal class UsersEngine( @OptIn(UnsafeConstructor::class) suspend fun validateUsername(request: ValidateUsernameRequest): ValidateUsernameRequest.Response { - val response = base.validatePost( + val response = base.usersValidatePost( validateUsernameRequest = GeneratedValidateUsernameRequest( username = request.username.string ), From 6ff5f2033fd542dad5c9930da048570bd3e1ed22 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Wed, 12 Jul 2023 10:01:35 +0300 Subject: [PATCH 11/42] fix(#68): edit user api documentation was fixed --- api/api-ktor/meetacy-api.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index 9429f9d1..d70898d7 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -996,8 +996,12 @@ paths: $ref: '#/components/examples/InvalidToken' InvalidAvatarIdentity: $ref: '#/components/examples/InvalidFileId' - InvalidNickname: - $ref: '#/components/examples/InvalidNickname' + InvalidUtf8String: + $ref: '#/components/examples/InvalidUtf8String' + UsernameAlreadyOccupied: + $ref: '#/components/examples/UsernameAlreadyOccupied' + NullEditParameters: + $ref: '#/components/examples/NullEditParameters' /users/validate: parameters: - name: Api-Version From 70a9ce06076d5d55400bbce58c02244b5abddbda Mon Sep 17 00:00:00 2001 From: y9Kap Date: Wed, 12 Jul 2023 14:40:39 +0300 Subject: [PATCH 12/42] fix(#68): api documentation was fixed --- api/api-ktor/meetacy-api.yml | 2 +- .../app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index d70898d7..58468863 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -1002,7 +1002,7 @@ paths: $ref: '#/components/examples/UsernameAlreadyOccupied' NullEditParameters: $ref: '#/components/examples/NullEditParameters' - /users/validate: + /users/username/validate: parameters: - name: Api-Version in: header diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index ece170c1..d6ca597c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -94,7 +94,7 @@ internal class UsersEngine( @OptIn(UnsafeConstructor::class) suspend fun validateUsername(request: ValidateUsernameRequest): ValidateUsernameRequest.Response { - val response = base.usersValidatePost( + val response = base.usersUsernameValidatePost( validateUsernameRequest = GeneratedValidateUsernameRequest( username = request.username.string ), From f3f4141e44bbb7aad6034a0bf628f2bafa447d89 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Wed, 12 Jul 2023 16:07:47 +0300 Subject: [PATCH 13/42] fix(#68): redundant username check removed --- api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt index 7ce5b2e9..df69b3fa 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/auth/AuthApi.kt @@ -5,20 +5,15 @@ import app.meetacy.sdk.MeetacyApi import app.meetacy.sdk.auth.email.EmailApi import app.meetacy.sdk.engine.requests.GenerateAuthRequest import app.meetacy.sdk.types.auth.Token -import app.meetacy.sdk.types.user.Username public class AuthApi(private val api: MeetacyApi) { public val email: EmailApi = EmailApi(api) public suspend fun generate(nickname: String): Token { - validateUsername(nickname) return api.engine.execute(GenerateAuthRequest(nickname)).token } public suspend fun generateAuthorizedApi(nickname: String): AuthorizedMeetacyApi { return api.authorized(generate(nickname)) } - - public suspend fun validateUsername(username: String): Username = - api.users.validateUsername(username) } From ece04f558ee31acbb8eb9a4cf1171d2c3742040c Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 7 Oct 2023 15:59:29 +0300 Subject: [PATCH 14/42] feat(#76): auth support was added --- api/api-ktor/meetacy-api.yml | 291 +++++++++++------- .../engine/ktor/requests/files/FilesEngine.kt | 12 +- .../ktor/requests/friends/FriendsEngine.kt | 15 +- .../requests/invitations/InvitationsEngine.kt | 24 +- .../ktor/requests/meetings/MeetingsEngine.kt | 35 +-- .../notifications/NotificationsEngine.kt | 12 +- .../engine/ktor/requests/users/UsersEngine.kt | 12 +- 7 files changed, 234 insertions(+), 167 deletions(-) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index 58468863..ebe5cf99 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -70,6 +70,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: tags: - auth @@ -174,6 +180,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Uploading a file to the server tags: @@ -185,8 +197,6 @@ paths: schema: type: object properties: # Request parts - token: - type: string file: type: string format: binary @@ -222,6 +232,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: tags: - friends @@ -261,6 +277,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Delete friend tags: @@ -298,6 +320,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Get list of friends tags: @@ -330,6 +358,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Create an invitation tags: @@ -366,6 +400,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Accept an invitation tags: @@ -403,6 +443,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Cancel an invitation tags: @@ -440,6 +486,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Deny an invitation tags: @@ -476,6 +528,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Edit parameters in meeting tags: @@ -518,6 +576,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Creating a meeting tags: @@ -555,6 +619,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Deleting a meeting tags: @@ -592,6 +662,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Getting meeting information tags: @@ -629,6 +705,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Getting a list of meetings tags: @@ -664,6 +746,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string get: summary: Getting a list of active meetings tags: @@ -699,6 +787,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string get: summary: Getting a list of active meetings tags: @@ -734,6 +828,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: "Meetings on Map" tags: @@ -768,6 +868,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Participate meeting tags: @@ -805,6 +911,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Participate meeting tags: @@ -844,6 +956,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: "List past notifications" requestBody: @@ -878,6 +996,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: tags: - notifications @@ -913,6 +1037,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Getting user object tags: @@ -951,8 +1081,8 @@ paths: schema: $ref: '#/components/schemas/InvalidResponse' examples: - InvalidUtf8String: - $ref: '#/components/examples/InvalidUtf8String' + InvalidAccessIdentity: + $ref: '#/components/examples/InvalidToken' UserNotFound: $ref: '#/components/examples/UserNotFound' /users/edit: @@ -963,6 +1093,12 @@ paths: required: true schema: type: string + - name: Token + in: header + description: Token auth + required: true + schema: + type: string post: summary: Editing user object tags: @@ -996,13 +1132,9 @@ paths: $ref: '#/components/examples/InvalidToken' InvalidAvatarIdentity: $ref: '#/components/examples/InvalidFileId' - InvalidUtf8String: - $ref: '#/components/examples/InvalidUtf8String' - UsernameAlreadyOccupied: - $ref: '#/components/examples/UsernameAlreadyOccupied' - NullEditParameters: - $ref: '#/components/examples/NullEditParameters' - /users/username/validate: + InvalidNickname: + $ref: '#/components/examples/InvalidNickname' + /users/validate: parameters: - name: Api-Version in: header @@ -1011,33 +1143,36 @@ paths: schema: type: string post: - summary: Validating a username + summary: Validate username tags: - user requestBody: content: application/json: schema: - $ref: "#/components/schemas/ValidateUsernameRequest" + $ref: '#/components/schemas/ValidateUsernameRequest' responses: "200": - description: An example of a passed validation + description: An example of a successful generated response with an token content: application/json: schema: - $ref: "#/components/schemas/ValidateUsernameResponse" + $ref: '#/components/schemas/ValidateUsernameRequest' + example: + value: + status: true + username: fiveletterwordormore "400": - description: Failed verification example + description: An example of a successful generated response with an token content: application/json: schema: $ref: '#/components/schemas/InvalidResponse' examples: + AlreadyOccupiedUsername: + $ref: '#/components/examples/AlreadyOccupiedUsername' InvalidUtf8String: $ref: '#/components/examples/InvalidUtf8String' - UsernameAlreadyOccupied: - $ref: '#/components/examples/UsernameAlreadyOccupied' - components: examples: ExpiredLink: @@ -1061,20 +1196,20 @@ components: errorCode: 1 errorMessage: "Please provide a valid token" InvalidNickname: - value: - status: false - errorCode: 16 - errorMessage: "Please provide a valid nickname" - UsernameAlreadyOccupied: value: status: false errorCode: 6 - errorMessage: "Username already occupied. Please provide another username." + errorMessage: "Please provide a valid nickname" NullEditParameters: value: status: false - errorCode: 10 + errorCode: 14 errorMessage: "Specify at least one meeting edit parameter" + InvalidTitleOrDescription: + value: + status: false + errorCode: 7 + errorMessage: "Please provide a valid title or description" InvalidFileId: value: status: false @@ -1088,7 +1223,7 @@ components: FriendNotFound: value: status: false - errorCode: 7 + errorCode: 8 errorMessage: "Friend was not found" FriendAlreadyAdded: value: @@ -1103,7 +1238,7 @@ components: MeetingAlreadyParticipate: value: status: false - errorCode: 9 + errorCode: 10 errorMessage: "You are already participating in this meeting" LastNotificationIdInvalid: value: @@ -1113,13 +1248,18 @@ components: UserNotFound: value: status: false - errorCode: 8 + errorCode: 9 errorMessage: "FullUser not found" InvalidUtf8String: value: status: false - errorCode: 16 + errorCode: 9 errorMessage: "Please provide a valid string" + AlreadyOccupiedUsername: + value: + status: false + errorCode: 6 + errorMessage: "This username is not a unique username" schemas: GenerateIdentityRequest: type: "object" @@ -1146,9 +1286,6 @@ components: AccessMeetingIdRequest: type: "object" properties: - token: - type: string - example: "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" meetingId: type: string example: "8:wtzbOPJqX8SVCDQj4UMavNoKJId5UylyL4GRZAkacc2PcGnyu8TCqZCLYvFnG4kb75HOVz6TIeRxXbarsdQZBdrB1rDbHSGD7yCW0EOTbRhxs5qRGncOjG5DmTrAULbWlWMiUkt2RiDRNTkoGJunQgtP63FEZ1MrYJPPdyX1Qn3xpIW6joZZ5p2XahuGGAE13UceQYz6bWO5ZWSJiWjwrA0xOvqf6ad0FHuEXcQaWbJBbBfEA9oGm4KsDHfnkvCT" @@ -1159,8 +1296,6 @@ components: ListMeetingParticipantsRequest: type: "object" properties: - token: - type: string meetingId: type: string amount: @@ -1197,10 +1332,6 @@ components: ListMapMeetingsRequest: type: object properties: - token: - type: string - example: - - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" location: $ref: '#/components/schemas/Location' required: @@ -1237,28 +1368,20 @@ components: example: - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" required: - - "token" - "id" additionalProperties: false AccessFriendRequest: type: "object" properties: - token: - type: string - example: "4:Nf7knMA3Oj3cAgrFjLSZEm7iIkyJbHxalO3c224qKsm8Sod01jnWPGlV7zGokTAgMpvhzOKSpZYx8WFE0ABlgf9DGxE8cqqvvovonRpfnl3TXQXmPNMemIfgGuvhvQsLKLEpTpflOT7be3VyeQWzLHjZQtlVgB6eeEaL4OlI1etzBY4z2jMyQKr89BFo9ztcXEVycDUVvI2m62sWS1NIQyKZXOWXYsxocJ4O1L2WB3y0EW8r7uTmosK4lCXTlka6" friendId: type: string example: "5:PjvgzvEu2YsHIm5OP4L0apfqtQV9Ck9I02ZuhJxDqJ4VeS9SwQJGpBRV0QhvbaDJjsTaMZRVRzsM3yn9uSvBffdY1ul9k3J7IDgWqgbQXHlI0quTL0ORJAUONHzzRfLHs6sOmTAf7AlRP4AmGu9aqwN6hALE9MeDITcY3LlNJR6HPE5z3SK1aE5OC2YKpjhX0xQLBQd6wlkdeoCPhyJRevx60u1T1kVIhpnjBLyXQZwbHYGPCIVJ5ryeVByQCQI8" required: - - "token" - "friendId" additionalProperties: false ListFriendsRequest: type: "object" properties: - token: - type: string - example: "6:47ioG3IwdRg9PmEAVsG8B54Ka742J5KDpVl1T8NZ5RkAskxhfpCmeRG1USNswsors49wcpR5Iw5YFxKmLghKddzQSDGKM6KanFa1pzETfmxMHN5EqHZACkeHvvytOxjCprZGWvJSjKRkiHLrnXxc1LAYQOhoN4iojsH4QJH0LmP295TfyZgchhTZx9kZ6O0D9x116DWbj5yO6KJrklUz0R0ND0XEvnOZi8KJcLub3snY0PMCiurQdb0CTZbJV2Dl" pagingId: type: string example: "10" @@ -1271,9 +1394,6 @@ components: ListMeetingsRequest: type: "object" properties: - token: - type: string - example: "7:jiNM2w0xhtIxfmBsHiQ8Ai3tkexOA9715hxlmahXLxvnrSJGybv9oMDvJ8PvxHOMJNqgtAVFU7C4VHiDFDyvIPxUux1R1MLJxRF1xK5cJp0B7U0hEHChtkhc1nuIhcIDRt4fFFwcYCGc1ugmd6m8cYeaGev5ZbnffAQua4Bkz3Clu2hjqNWA5Z5tnEoBlvGYrpbYD3YW1KwemrZPqDo58dQh5DDDBrXGXvFo0vkRsgERiW8rUVxl5eEszb2iIgnH" pagingId: type: string example: "8" @@ -1301,15 +1421,10 @@ components: properties: email: type: string - example: - - "gerald123@gmail.com" - token: - type: string - example: - - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" + example: "gerald123@meetacy.com" required: - "email" - - "accessIdentity" + - "token" additionalProperties: false AccessAvatarRequest: type: "object" @@ -1329,10 +1444,6 @@ components: CreateMeetingRequest: type: "object" properties: - "token": - type: string - example: - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" "avatarId": type: string example: "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" @@ -1376,10 +1487,6 @@ components: EditMeetingRequest: type: "object" properties: - "token": - type: string - example: - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" "meetingId": type: string example: @@ -1642,18 +1749,12 @@ components: id: type: string example: "8:bqLhYy1hjNTL0wXcN0dnmSeyZDMt2akkGYMDdaa81oc8fPhOHBWTuFWzMdWNqu7gTHHrfhvC64RE2ZEtngYD5YVpOAGz8Nx1ii7l6BxpBCfHgaL6hHzkEqsmuGlea2gijOEZFkDEhebZ9lwkav13DMTdWJUm4GMm0VQgXzX8s3B528XsMxkXiu5ps9JrRB4m2m4vnZHEaskq9SXEGfhxzeuVft4d2eHWlp5V06NPmfhuyehq9J3GwWxYSkN3Doun" - token: - type: string - example: "8:PmP14Ai8NFskTUwjOw0mXjhWIAPECsoYenhp8ECesY1DikwjPXrfk5ZGM8Bue0MGgMF0tWD3iI9TijFAGeDRXltuwREAyGW7AVe4gXfrrIBeVBIuY9lYH3WiO65kzKCmeg5wLEICWzFjjO7j2fQL5OUwQPVm5futMEcJmYo4EGTyDSYEcaVjx5lqMkMWPLN52N9jwTVXAowIvGPqxSJubwrobhz4tQCYi2Gzj4YzLFeSdnTorqdaRGPAs3z10Lge" required: - token additionalProperties: false EditUserRequest: type: object properties: - token: - type: string - example: "9:UjXlL2TeJLWtAoKM1qX6Lv2GjMOvumOzn7Pi9j0q9n28LCCN1WDkFsW7OUi7n2osONPQegFXq9iK3painNnQZeU4J34bBD4DVC5jp4vTK4rdIU28IMEcC0FQdeu3CTbMKXCJWcZXMNIiihJqYOlki5WmjtsWAL84XN0ym1rWFMPrP8yok4jkYAUvPS6APaDU8gHhj5YMARAKdWN4wvTzQ5BbTNrKmmO5d3QdDWNcIH6lGWHPtHXCPjkyFA62iNC5" nickname: type: string example: "Alexander" @@ -1665,6 +1766,14 @@ components: example: "1:rXfskQTJuGm7U0UvDNpojpDhvrwhfkOfPqRlHRwg2R6EMA9aMtp5iZB2t6JLRTxAJp2LhZIIVrmj3uYpjKzji46krsK4GgtG3Uw3TRudeslGdtL4ye2N6LTWRy8WYN1giGOBgRFZLjwQ4hoEdVIJqmmHCRQZNhHpMAsdWUYdoWStgMumTkCTKbXcraZYMpGESqFcaFfstyjCMVZtuXcl23IusOkEzGPcmWy6ykbiHa4D7lhcq4szdSmpksBo2mov" required: - token + ValidateUsernameRequest: + type: object + properties: + username: + type: string + example: fiveletterwordormore + required: + - username Invitation: type: object properties: @@ -1687,8 +1796,6 @@ components: CreateInvitationRequest: type: object properties: - token: - type: string meetingId: type: string example: "6:EBnp2woyRmY4snRvZaiEtuOIfk4eEXgWdzy8psVPL60Mz92Ts8qIdaoAHVTpvl9hTygMpfUYjNHJpjwpK0txBKRWl7EqCgmnZjm57pIWnlRIo2WoH856AibK8xmCdgOlENPUsmBGLPa7EVOtd43rnGVdeC3wUfHSNV9PT3S0Q3mXCpHF0tOfssQTnKKbBSy9V19Euo7VzpjS4WXI82ILzPVfLqTaRGEUabXw9issiVZhK97zZhBXrV3CFO26pAZa" @@ -1712,8 +1819,6 @@ components: AcceptInvitationRequest: type: object properties: - token: - type: string id: type: string required: @@ -1724,8 +1829,6 @@ components: properties: id: type: string - token: - type: string required: - "id" - "token" @@ -1734,29 +1837,21 @@ components: properties: id: type: string - token: - type: string required: - "id" - "token" ReadNotificationRequest: type: "object" properties: - token: - type: string - example: "7:jiNM2w0xhtIxfmBsHiQ8Ai3tkexOA9715hxlmahXLxvnrSJGybv9oMDvJ8PvxHOMJNqgtAVFU7C4VHiDFDyvIPxUux1R1MLJxRF1xK5cJp0B7U0hEHChtkhc1nuIhcIDRt4fFFwcYCGc1ugmd6m8cYeaGev5ZbnffAQua4Bkz3Clu2hjqNWA5Z5tnEoBlvGYrpbYD3YW1KwemrZPqDo58dQh5DDDBrXGXvFo0vkRsgERiW8rUVxl5eEszb2iIgnH" lastNotificationId: type: string example: "8" required: - "token" - - "amount" + - "lastNotificationId" ListNotificationsRequest: type: "object" properties: - token: - type: string - example: "7:jiNM2w0xhtIxfmBsHiQ8Ai3tkexOA9715hxlmahXLxvnrSJGybv9oMDvJ8PvxHOMJNqgtAVFU7C4VHiDFDyvIPxUux1R1MLJxRF1xK5cJp0B7U0hEHChtkhc1nuIhcIDRt4fFFwcYCGc1ugmd6m8cYeaGev5ZbnffAQua4Bkz3Clu2hjqNWA5Z5tnEoBlvGYrpbYD3YW1KwemrZPqDo58dQh5DDDBrXGXvFo0vkRsgERiW8rUVxl5eEszb2iIgnH" pagingId: type: string example: "8" @@ -1812,27 +1907,3 @@ components: - "id" - "isNew" - "date" - ValidateUsernameRequest: - type: object - properties: - username: - type: string - required: - - username - ValidateUsernameResponse: - type: object - properties: - status: - type: boolean - example: true - result: - type: object - properties: - username: - type: string - example: bpavuk - required: - - username - required: - - result - - status diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt index 63cca121..9fe74aa0 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt @@ -3,23 +3,21 @@ package app.meetacy.sdk.engine.ktor.requests.files import app.meetacy.sdk.engine.requests.GetFileRequest import app.meetacy.sdk.engine.requests.UploadFileRequest import app.meetacy.sdk.files.DownloadableFile -import app.meetacy.sdk.io.* +import app.meetacy.sdk.io.Input +import app.meetacy.sdk.io.InputSource +import app.meetacy.sdk.io.asKtorChannelProvider +import app.meetacy.sdk.io.asMeetacyInput import app.meetacy.sdk.types.file.FileId import app.meetacy.sdk.types.url.Url import app.meetacy.sdk.types.url.parametersOf import dev.icerock.moko.network.generated.models.GenerateIdentityResponse import io.ktor.client.* -import io.ktor.client.call.* -import io.ktor.client.plugins.* import io.ktor.client.request.* import io.ktor.client.request.forms.* import io.ktor.client.statement.* import io.ktor.http.* -import io.ktor.utils.io.* import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.coroutineScope -import kotlinx.coroutines.delay -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json internal class FilesEngine( @@ -62,7 +60,6 @@ internal class FilesEngine( val string = httpClient.submitFormWithBinaryData( url = url.string, formData = formData { - append("token", request.token.string) append( key = "file", value = request.file.input.asKtorChannelProvider( @@ -77,6 +74,7 @@ internal class FilesEngine( } ) { header("Api-Version", request.apiVersion.int) + header("Token", request.token.string) }.bodyAsText() val response = Json.decodeFromString(string) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index bd715a9b..c18f9833 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -3,9 +3,9 @@ package app.meetacy.sdk.engine.ktor.requests.friends import app.meetacy.sdk.engine.ktor.handleRSocketExceptions +import app.meetacy.sdk.engine.ktor.mapToLocation import app.meetacy.sdk.engine.ktor.mapToRegularUser import app.meetacy.sdk.engine.ktor.mapToUser -import app.meetacy.sdk.engine.ktor.mapToLocation import app.meetacy.sdk.engine.requests.AddFriendRequest import app.meetacy.sdk.engine.requests.DeleteFriendRequest import app.meetacy.sdk.engine.requests.EmitFriendsLocationRequest @@ -29,7 +29,6 @@ import io.rsocket.kotlin.payload.data import kotlinx.coroutines.flow.emitAll import kotlinx.coroutines.flow.map import kotlinx.serialization.Serializable -import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject @@ -48,31 +47,31 @@ internal class FriendsEngine( suspend fun add(request: AddFriendRequest) { base.friendsAddPost( accessFriendRequest = AccessFriendRequest( - token = request.token.string, friendId = request.friendId.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) } suspend fun delete(request: DeleteFriendRequest) { base.friendsDeletePost( accessFriendRequest = AccessFriendRequest( - token = request.token.string, friendId = request.friendId.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) } suspend fun list(request: ListFriendsRequest): ListFriendsRequest.Response { val response = base.friendsListPost( listFriendsRequest = GeneratedListFriendsRequest( - token = request.token.string, amount = request.amount.int, pagingId = request.pagingId?.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) val paging = PagingResponse( diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt index baf0e2b7..3c906a97 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt @@ -24,11 +24,11 @@ internal class InvitationsEngine( ): CreateInvitationRequest.Response { val response = base.invitationsCreatePost( createInvitationRequest = GeneratedCreateInvitationRequest( - token = request.token.string, meetingId = request.meetingId.string, userId = request.userId.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ).result return CreateInvitationRequest.Response(response.toInvitation()) @@ -38,11 +38,11 @@ internal class InvitationsEngine( request: AcceptInvitationRequest ) { base.invitationsAcceptPost( - apiVersion = request.apiVersion.int.toString(), acceptInvitationRequest = GeneratedAcceptInvitationRequest( - token = request.token.string, id = request.invitationId.string - ) + ), + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) } @@ -50,11 +50,11 @@ internal class InvitationsEngine( request: DenyInvitationRequest ) { base.invitationsDenyPost( - apiVersion = request.apiVersion.int.toString(), denyInvitationRequest = GeneratedDenyInvitationRequest( - token = request.token.string, id = request.invitationId.string - ) + ), + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) } @@ -62,11 +62,11 @@ internal class InvitationsEngine( request: CancelInvitationRequest ) { base.invitationsCancelPost( - apiVersion = request.apiVersion.int.toString(), cancelInvitationRequest = GeneratedCancelInvitationRequest( - id = request.invitationId.string, - token = request.token.string - ) + id = request.invitationId.string + ), + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index c24a65fb..d87a3ba8 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -17,7 +17,6 @@ import io.ktor.client.call.* import io.ktor.client.request.* import io.ktor.content.* import io.ktor.http.* -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put @@ -38,11 +37,11 @@ internal class MeetingsEngine( ): ListMeetingsHistoryRequest.Response = with(request) { val response = base.meetingsHistoryListPost( listMeetingsRequest = ListMeetingsRequest( - token = token.string, amount = amount.int, pagingId = pagingId?.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) val paging = PagingResponse( @@ -58,11 +57,11 @@ internal class MeetingsEngine( ): ListActiveMeetingsRequest.Response = with(request) { val response = base.meetingsHistoryActiveGet( listMeetingsRequest = ListMeetingsRequest( - token = token.string, amount = amount.int, pagingId = pagingId?.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) val paging = PagingResponse( @@ -78,11 +77,11 @@ internal class MeetingsEngine( ): ListPastMeetingsRequest.Response = with(request) { val response = base.meetingsHistoryPastGet( listMeetingsRequest = ListMeetingsRequest( - token = token.string, amount = amount.int, pagingId = pagingId?.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) val paging = PagingResponse( @@ -98,13 +97,13 @@ internal class MeetingsEngine( ): ListMeetingsMapRequest.Response = with (request) { val response = base.meetingsMapListPost( listMapMeetingsRequest = ListMapMeetingsRequest( - token = token.string, location = Location( latitude = location.latitude, longitude = location.longitude ) ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) val data = response.result.map(GeneratedMeeting::mapToMeeting) @@ -117,7 +116,6 @@ internal class MeetingsEngine( ): CreateMeetingRequest.Response { val response = base.meetingsCreatePost( createMeetingRequest = GeneratedCreateMeetingRequest( - token = request.token.string, title = request.title, date = request.date.iso8601, location = Location( @@ -131,7 +129,8 @@ internal class MeetingsEngine( }, avatarId = request.fileId?.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ).result val meeting = response.mapToMeeting() @@ -187,12 +186,12 @@ internal class MeetingsEngine( request: ListMeetingParticipantsRequest ): ListMeetingParticipantsRequest.Response { val response = base.meetingsParticipantsListPost( - apiVersion = request.apiVersion.int.toString(), listMeetingParticipantsRequest = GeneratedListMeetingParticipantsRequest( amount = request.amount.int, - token = request.token.string, meetingId = request.meetingId.string - ) + ), + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) val paging = PagingResponse( @@ -206,20 +205,20 @@ internal class MeetingsEngine( suspend fun participateMeeting(request: ParticipateMeetingRequest) { base.meetingsParticipatePost( accessMeetingIdRequest = AccessMeetingIdRequest( - token = request.token.string, meetingId = request.meetingId.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) } suspend fun getMeeting(request: GetMeetingRequest): GetMeetingRequest.Response { val response = base.meetingsGetPost( accessMeetingIdRequest = AccessMeetingIdRequest( - token = request.token.string, meetingId = request.meetingId.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) val meeting = response.result.mapToMeeting() diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt index 16c94187..9f8172be 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt @@ -23,12 +23,12 @@ internal class NotificationsEngine( request: ListNotificationsRequest ): ListNotificationsRequest.Response = with (request) { val response = base.notificationsListPost( - apiVersion = apiVersion.int.toString(), listNotificationsRequest = GeneratedListNotificationsRequest( - token = token.string, amount = amount.int, pagingId = pagingId?.string - ) + ), + apiVersion = apiVersion.int.toString(), + token = request.token.string ).result val paging = PagingResponse( @@ -41,11 +41,11 @@ internal class NotificationsEngine( suspend fun read(request: ReadNotificationRequest) = with (request) { base.notificationsReadPost( - apiVersion = apiVersion.int.toString(), readNotificationRequest = GeneratedReadNotificationRequest( - token = token.string, lastNotificationId = lastNotificationId.string - ) + ), + apiVersion = apiVersion.int.toString(), + token = request.token.string ) } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index d6ca597c..417ab324 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -36,9 +36,9 @@ internal class UsersEngine( suspend fun getMe(request: GetMeRequest): GetMeRequest.Response { val response = base.usersGetPost( getUserRequest = GeneratedGetUserRequest( - token = request.token.string ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) return GetMeRequest.Response( @@ -50,10 +50,10 @@ internal class UsersEngine( suspend fun getUser(request: GetUserRequest): GetUserRequest.Response { val response = base.usersGetPost( getUserRequest = GeneratedGetUserRequest( - token = request.token.string, id = request.userId.string, ), - apiVersion = request.apiVersion.int.toString() + apiVersion = request.apiVersion.int.toString(), + token = request.token.string ) return GetUserRequest.Response( @@ -94,13 +94,13 @@ internal class UsersEngine( @OptIn(UnsafeConstructor::class) suspend fun validateUsername(request: ValidateUsernameRequest): ValidateUsernameRequest.Response { - val response = base.usersUsernameValidatePost( + val response = base.usersValidatePost( validateUsernameRequest = GeneratedValidateUsernameRequest( username = request.username.string ), apiVersion = request.apiVersion.int.toString() ) - return ValidateUsernameRequest.Response(username = Username(response.result.username)) + return ValidateUsernameRequest.Response(username = Username(response.username)) } } From 1902a3e72a2454118065f9f996b94ae010f9f42a Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 7 Oct 2023 22:38:59 +0300 Subject: [PATCH 15/42] fix(#76#76-support-auth-header): killmepls --- api/api-ktor/meetacy-api.yml | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index ebe5cf99..23c97a98 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -70,7 +70,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -180,7 +180,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -232,7 +232,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -277,7 +277,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -320,7 +320,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -358,7 +358,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -400,7 +400,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -443,7 +443,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -486,7 +486,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -528,7 +528,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -576,7 +576,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -619,7 +619,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -662,7 +662,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -705,7 +705,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -746,7 +746,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -787,7 +787,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -828,7 +828,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -868,7 +868,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -911,7 +911,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -956,7 +956,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -996,7 +996,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -1037,7 +1037,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -1093,7 +1093,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true From 295a37911b7edb9d754575e86a0f923fabc5ff04 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 7 Oct 2023 22:38:59 +0300 Subject: [PATCH 16/42] fix(#76#76-support-auth-header): killmepls --- api/api-ktor/meetacy-api.yml | 46 +++++++++---------- .../ktor/requests/friends/FriendsEngine.kt | 6 +-- .../requests/invitations/InvitationsEngine.kt | 8 ++-- .../ktor/requests/meetings/MeetingsEngine.kt | 16 +++---- .../notifications/NotificationsEngine.kt | 4 +- .../engine/ktor/requests/users/UsersEngine.kt | 4 +- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml index ebe5cf99..23c97a98 100644 --- a/api/api-ktor/meetacy-api.yml +++ b/api/api-ktor/meetacy-api.yml @@ -70,7 +70,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -180,7 +180,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -232,7 +232,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -277,7 +277,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -320,7 +320,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -358,7 +358,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -400,7 +400,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -443,7 +443,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -486,7 +486,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -528,7 +528,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -576,7 +576,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -619,7 +619,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -662,7 +662,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -705,7 +705,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -746,7 +746,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -787,7 +787,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -828,7 +828,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -868,7 +868,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -911,7 +911,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -956,7 +956,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -996,7 +996,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -1037,7 +1037,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true @@ -1093,7 +1093,7 @@ paths: required: true schema: type: string - - name: Token + - name: Authorization in: header description: Token auth required: true diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index c18f9833..688927a1 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -50,7 +50,7 @@ internal class FriendsEngine( friendId = request.friendId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) } @@ -60,7 +60,7 @@ internal class FriendsEngine( friendId = request.friendId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) } @@ -71,7 +71,7 @@ internal class FriendsEngine( pagingId = request.pagingId?.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) val paging = PagingResponse( diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt index 3c906a97..0e4cb690 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt @@ -28,7 +28,7 @@ internal class InvitationsEngine( userId = request.userId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ).result return CreateInvitationRequest.Response(response.toInvitation()) @@ -42,7 +42,7 @@ internal class InvitationsEngine( id = request.invitationId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) } @@ -54,7 +54,7 @@ internal class InvitationsEngine( id = request.invitationId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) } @@ -66,7 +66,7 @@ internal class InvitationsEngine( id = request.invitationId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index d87a3ba8..e29b47a6 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -41,7 +41,7 @@ internal class MeetingsEngine( pagingId = pagingId?.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) val paging = PagingResponse( @@ -61,7 +61,7 @@ internal class MeetingsEngine( pagingId = pagingId?.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) val paging = PagingResponse( @@ -81,7 +81,7 @@ internal class MeetingsEngine( pagingId = pagingId?.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) val paging = PagingResponse( @@ -103,7 +103,7 @@ internal class MeetingsEngine( ) ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) val data = response.result.map(GeneratedMeeting::mapToMeeting) @@ -130,7 +130,7 @@ internal class MeetingsEngine( avatarId = request.fileId?.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ).result val meeting = response.mapToMeeting() @@ -191,7 +191,7 @@ internal class MeetingsEngine( meetingId = request.meetingId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) val paging = PagingResponse( @@ -208,7 +208,7 @@ internal class MeetingsEngine( meetingId = request.meetingId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) } @@ -218,7 +218,7 @@ internal class MeetingsEngine( meetingId = request.meetingId.string ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) val meeting = response.result.mapToMeeting() diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt index 9f8172be..0189d0b8 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt @@ -28,7 +28,7 @@ internal class NotificationsEngine( pagingId = pagingId?.string ), apiVersion = apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ).result val paging = PagingResponse( @@ -45,7 +45,7 @@ internal class NotificationsEngine( lastNotificationId = lastNotificationId.string ), apiVersion = apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index 417ab324..542da360 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -38,7 +38,7 @@ internal class UsersEngine( getUserRequest = GeneratedGetUserRequest( ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) return GetMeRequest.Response( @@ -53,7 +53,7 @@ internal class UsersEngine( id = request.userId.string, ), apiVersion = request.apiVersion.int.toString(), - token = request.token.string + authorization = request.token.string ) return GetUserRequest.Response( From d9f209742e8afd27edd84f9f6ccd908a958ab62e Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 7 Oct 2023 23:28:50 +0300 Subject: [PATCH 17/42] fix(#76-support-auth-header): killmeplsagain --- .../app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt | 2 +- .../meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt | 1 - .../sdk/engine/ktor/requests/meetings/MeetingsEngine.kt | 2 +- .../app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt | 3 +-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt index 9fe74aa0..8cce8109 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt @@ -74,7 +74,7 @@ internal class FilesEngine( } ) { header("Api-Version", request.apiVersion.int) - header("Token", request.token.string) + header("Authorization", request.token.string) }.bodyAsText() val response = Json.decodeFromString(string) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index 688927a1..1e38a80b 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -105,7 +105,6 @@ internal class FriendsEngine( private fun EmitFriendsLocationRequest.encodeToPayload(json: Json): Payload = buildPayload { val initObject = buildJsonObject { - put("token", token.string) put("apiVersion", apiVersion.int) } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index e29b47a6..d3d91872 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -142,7 +142,6 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "edit" val jsonObject = buildJsonObject { - put("token", token.string) put("meetingId", meetingId.string) title.ifPresent { title -> @@ -175,6 +174,7 @@ internal class MeetingsEngine( contentType = ContentType.Application.Json ) ) + header("Authorization", token) }.body() val meeting = Json.decodeFromString(string).result diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index 542da360..d3842622 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -65,8 +65,6 @@ internal class UsersEngine( val url = baseUrl / "users" / "edit" val jsonObject = buildJsonObject { - put("token", token.string) - nickname.ifPresent { nickname -> put("nickname", nickname) } @@ -85,6 +83,7 @@ internal class UsersEngine( contentType = ContentType.Application.Json ) ) + header("Authorization", token) }.body() val user = Json.decodeFromString(string).result From 2bdf3a1a15e25407343524e01c2e715280efe07d Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sun, 8 Oct 2023 18:08:23 +0300 Subject: [PATCH 18/42] fix(#76-support-auth-header): killmeplsagainandagain --- .../sdk/engine/ktor/requests/meetings/MeetingsEngine.kt | 4 +++- .../meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index d3d91872..2e64ac2d 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -168,13 +168,15 @@ internal class MeetingsEngine( } val string = httpClient.post(url.string) { + headers { + append("Authorization", token.string) + } setBody( TextContent( text = jsonObject.toString(), contentType = ContentType.Application.Json ) ) - header("Authorization", token) }.body() val meeting = Json.decodeFromString(string).result diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index d3842622..436b71d6 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -77,13 +77,17 @@ internal class UsersEngine( } val string = httpClient.post(url.string) { + headers { + append("Authorization", token.string) + } setBody( TextContent( text = jsonObject.toString(), contentType = ContentType.Application.Json ) + ) - header("Authorization", token) + }.body() val user = Json.decodeFromString(string).result From ccd66aff57f1e5ed245ef3f4c2f1dace98247dd0 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sun, 8 Oct 2023 21:40:52 +0300 Subject: [PATCH 19/42] WIP(#76-support-auth-header): fix sdk for passed test --- .../ktor/requests/friends/FriendsEngine.kt | 1 + .../ktor/requests/meetings/MeetingsEngine.kt | 20 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index 1e38a80b..c18994c7 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -106,6 +106,7 @@ internal class FriendsEngine( private fun EmitFriendsLocationRequest.encodeToPayload(json: Json): Payload = buildPayload { val initObject = buildJsonObject { put("apiVersion", apiVersion.int) + put("token", this@encodeToPayload.token.string) } data(json.encodeToString(initObject)) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index 2e64ac2d..ce32bd88 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -113,24 +113,24 @@ internal class MeetingsEngine( suspend fun createMeeting( request: CreateMeetingRequest - ): CreateMeetingRequest.Response { + ): CreateMeetingRequest.Response = with(request){ val response = base.meetingsCreatePost( createMeetingRequest = GeneratedCreateMeetingRequest( - title = request.title, - date = request.date.iso8601, + title = title, + date = date.iso8601, location = Location( - latitude = request.location.latitude, - longitude = request.location.longitude + latitude = location.latitude, + longitude = location.longitude ), - description = request.description, - visibility = when (request.visibility) { + description = description, + visibility = when (visibility) { Meeting.Visibility.Public -> GeneratedCreateMeetingRequest.Visibility.PUBLIC Meeting.Visibility.Private -> GeneratedCreateMeetingRequest.Visibility.PRIVATE }, - avatarId = request.fileId?.string + avatarId = fileId?.string ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string + apiVersion = apiVersion.int.toString(), + authorization = token.string ).result val meeting = response.mapToMeeting() From b4eade670de6e0a84b168a8c36a96b2734746c5c Mon Sep 17 00:00:00 2001 From: y9Kap Date: Mon, 9 Oct 2023 01:58:00 +0300 Subject: [PATCH 20/42] WIP(#76-support-auth-header): fix sdk for passed test 2 --- .../meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index c18994c7..61ee3a2f 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -106,7 +106,7 @@ internal class FriendsEngine( private fun EmitFriendsLocationRequest.encodeToPayload(json: Json): Payload = buildPayload { val initObject = buildJsonObject { put("apiVersion", apiVersion.int) - put("token", this@encodeToPayload.token.string) + put("authorization", this@encodeToPayload.token.string) } data(json.encodeToString(initObject)) From 21b5334a6340d2bb7cf79c5bfcdba9373a877164 Mon Sep 17 00:00:00 2001 From: Alex Sokol / y9san9 Date: Thu, 19 Oct 2023 16:58:04 +0300 Subject: [PATCH 21/42] fix: friends fix --- .../meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index 61ee3a2f..5efcc941 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -106,7 +106,7 @@ internal class FriendsEngine( private fun EmitFriendsLocationRequest.encodeToPayload(json: Json): Payload = buildPayload { val initObject = buildJsonObject { put("apiVersion", apiVersion.int) - put("authorization", this@encodeToPayload.token.string) + put("token", token.string) } data(json.encodeToString(initObject)) From 3c47b57fe65c76748e18a1e4f96dc144a89d4d0c Mon Sep 17 00:00:00 2001 From: Alex Sokol / y9san9 Date: Thu, 19 Oct 2023 17:22:52 +0300 Subject: [PATCH 22/42] fix: rename validate username to username available --- .../app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt | 2 +- .../sdk/engine/ktor/requests/users/UsersEngine.kt | 7 +++---- ...UsernameRequest.kt => UsernameAvailableRequest.kt} | 4 ++-- .../app/meetacy/sdk/users/AuthorizedUsersApi.kt | 6 ++---- .../app/meetacy/sdk/users/RegularUserRepository.kt | 6 ++---- .../app/meetacy/sdk/users/SelfUserRepository.kt | 6 ++---- .../kotlin/app/meetacy/sdk/users/UsersApi.kt | 11 +++-------- 7 files changed, 15 insertions(+), 27 deletions(-) rename api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/{ValidateUsernameRequest.kt => UsernameAvailableRequest.kt} (62%) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt index 89c62b8f..62e89fa8 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt @@ -71,7 +71,7 @@ public class KtorMeetacyEngine( is GetMeRequest -> users.getMe(request) as T is GetUserRequest -> users.getUser(request) as T is EditUserRequest -> users.editUser(request) as T - is ValidateUsernameRequest -> users.validateUsername(request) as T + is UsernameAvailableRequest -> users.usernameAvailable(request) as T // meetings is ListMeetingsHistoryRequest -> meetings.listMeetingsHistory(request) as T is ListActiveMeetingsRequest -> meetings.listActiveMeetings(request) as T diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index 436b71d6..aa47c2d4 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -5,7 +5,7 @@ import app.meetacy.sdk.engine.ktor.mapToUser import app.meetacy.sdk.engine.requests.EditUserRequest import app.meetacy.sdk.engine.requests.GetMeRequest import app.meetacy.sdk.engine.requests.GetUserRequest -import app.meetacy.sdk.engine.requests.ValidateUsernameRequest +import app.meetacy.sdk.engine.requests.UsernameAvailableRequest import app.meetacy.sdk.exception.meetacyApiError import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.optional.ifPresent @@ -85,7 +85,6 @@ internal class UsersEngine( text = jsonObject.toString(), contentType = ContentType.Application.Json ) - ) }.body() @@ -96,7 +95,7 @@ internal class UsersEngine( } @OptIn(UnsafeConstructor::class) - suspend fun validateUsername(request: ValidateUsernameRequest): ValidateUsernameRequest.Response { + suspend fun usernameAvailable(request: UsernameAvailableRequest): UsernameAvailableRequest.Response { val response = base.usersValidatePost( validateUsernameRequest = GeneratedValidateUsernameRequest( username = request.username.string @@ -104,6 +103,6 @@ internal class UsersEngine( apiVersion = request.apiVersion.int.toString() ) - return ValidateUsernameRequest.Response(username = Username(response.username)) + return UsernameAvailableRequest.Response(username = Username(response.username)) } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ValidateUsernameRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/UsernameAvailableRequest.kt similarity index 62% rename from api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ValidateUsernameRequest.kt rename to api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/UsernameAvailableRequest.kt index 067bba70..a54626f4 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ValidateUsernameRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/UsernameAvailableRequest.kt @@ -2,8 +2,8 @@ package app.meetacy.sdk.engine.requests import app.meetacy.sdk.types.user.Username -public data class ValidateUsernameRequest( +public data class UsernameAvailableRequest( val username: Username -) : MeetacyRequest { +) : MeetacyRequest { public data class Response(val username: Username) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt index 1350b67d..20087ceb 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/AuthorizedUsersApi.kt @@ -41,9 +41,7 @@ public class AuthorizedUsersApi(private val api: AuthorizedMeetacyApi) { ) } - public suspend fun validateUsername( - username: String - ): Username { - return base.validateUsername(username) + public suspend fun usernameAvailable(username: Username): Username { + return base.usernameAvailable(username) } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt index d9399f28..464aef29 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/RegularUserRepository.kt @@ -26,9 +26,7 @@ public class RegularUserRepository( api.friends.delete(token, data.id) } - public suspend fun validateUsername( - username: String - ): Username { - return api.users.validateUsername(username) + public suspend fun usernameAvailable(username: Username): Username { + return api.users.usernameAvailable(username) } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt index 5e660102..e1958d69 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/SelfUserRepository.kt @@ -51,9 +51,7 @@ public class SelfUserRepository( avatarId: Optional = Optional.Undefined ): SelfUserRepository = api.users.edit(token, nickname, username, avatarId) - public suspend fun validateUsername( - username: String - ): Username { - return api.users.validateUsername(username) + public suspend fun usernameAvailable(username: Username): Username { + return api.users.usernameAvailable(username) } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt index b1bb356b..8bccc2af 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/users/UsersApi.kt @@ -3,8 +3,7 @@ package app.meetacy.sdk.users import app.meetacy.sdk.MeetacyApi import app.meetacy.sdk.engine.requests.EditUserRequest import app.meetacy.sdk.engine.requests.GetUserRequest -import app.meetacy.sdk.engine.requests.ValidateUsernameRequest -import app.meetacy.sdk.types.annotation.UnsafeConstructor +import app.meetacy.sdk.engine.requests.UsernameAvailableRequest import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.file.FileId import app.meetacy.sdk.types.optional.Optional @@ -49,12 +48,8 @@ public class UsersApi(private val api: MeetacyApi) { ) } - @OptIn(UnsafeConstructor::class) - public suspend fun validateUsername( - username: String - ): Username { - val result = api.engine.execute(ValidateUsernameRequest(username = Username(username))) - + public suspend fun usernameAvailable(username: Username): Username { + val result = api.engine.execute(UsernameAvailableRequest(username)) return result.username } } From 4b852503f7e99766a86ce02341893dfd731675f3 Mon Sep 17 00:00:00 2001 From: y9kap Date: Fri, 20 Oct 2023 17:06:42 +0300 Subject: [PATCH 23/42] WIP(#76-support-auth-header): remove moko network library in progress --- .../ktor/requests/meetings/MeetingsEngine.kt | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index ce32bd88..12d89d62 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -3,9 +3,9 @@ package app.meetacy.sdk.engine.ktor.requests.meetings import app.meetacy.sdk.engine.ktor.mapToMeeting import app.meetacy.sdk.engine.ktor.mapToUser import app.meetacy.sdk.engine.requests.* +import app.meetacy.sdk.engine.requests.CreateMeetingRequest import app.meetacy.sdk.engine.requests.EditMeetingRequest import app.meetacy.sdk.engine.requests.ListMeetingParticipantsRequest -import app.meetacy.sdk.types.meeting.Meeting import app.meetacy.sdk.types.optional.ifPresent import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse @@ -21,7 +21,6 @@ import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import kotlinx.serialization.json.putJsonObject -import dev.icerock.moko.network.generated.models.CreateMeetingRequest as GeneratedCreateMeetingRequest import dev.icerock.moko.network.generated.models.ListMeetingParticipantsRequest as GeneratedListMeetingParticipantsRequest import dev.icerock.moko.network.generated.models.Meeting as GeneratedMeeting @@ -114,28 +113,35 @@ internal class MeetingsEngine( suspend fun createMeeting( request: CreateMeetingRequest ): CreateMeetingRequest.Response = with(request){ - val response = base.meetingsCreatePost( - createMeetingRequest = GeneratedCreateMeetingRequest( - title = title, - date = date.iso8601, - location = Location( - latitude = location.latitude, - longitude = location.longitude - ), - description = description, - visibility = when (visibility) { - Meeting.Visibility.Public -> GeneratedCreateMeetingRequest.Visibility.PUBLIC - Meeting.Visibility.Private -> GeneratedCreateMeetingRequest.Visibility.PRIVATE - }, - avatarId = fileId?.string - ), - apiVersion = apiVersion.int.toString(), - authorization = token.string - ).result + val url = baseUrl / "meetings" / "create" + + val jsonObject = buildJsonObject { + put("title", title) + put("date", date.iso8601) + putJsonObject("location") { + put("latitude", location.latitude) + put("longitude", location.longitude) + } + put("description", description) + put("visibility", visibility.name.lowercase()) + put("fileId", fileId?.string) + } + + val string = httpClient.post(url.string) { + headers { + append("Authorization", token.string) + } + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + }.body() - val meeting = response.mapToMeeting() + val meeting = Json.decodeFromString(string).result - return CreateMeetingRequest.Response(meeting) + return CreateMeetingRequest.Response(meeting.mapToMeeting()) } suspend fun editMeeting(request: EditMeetingRequest): EditMeetingRequest.Response = with(request) { From fee6809cab06044c931480a27ee6baf80f540e3b Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 21 Oct 2023 00:24:05 +0300 Subject: [PATCH 24/42] WIP(#76-support-auth-header): list meetings history is independence --- .../app/meetacy/sdk/engine/ktor/Mappers.kt | 42 +++++++++ .../ktor/requests/meetings/MeetingsEngine.kt | 39 +++++---- .../engine/ktor/requests/users/UsersEngine.kt | 5 +- .../models/AcceptInvitationRequest.kt | 35 ++++++++ .../response/models/AccessAvatarRequest.kt | 39 +++++++++ .../response/models/AccessFriendRequest.kt | 35 ++++++++ .../response/models/AccessIdentityRequest.kt | 35 ++++++++ .../response/models/AccessMeetingIdRequest.kt | 35 ++++++++ .../models/CancelInvitationRequest.kt | 35 ++++++++ .../models/CreateInvitationRequest.kt | 39 +++++++++ .../models/CreateInvitationResponse.kt | 40 +++++++++ .../response/models/CreateMeetingRequest.kt | 73 ++++++++++++++++ .../response/models/CreateMeetingResponse.kt | 40 +++++++++ .../response/models/CreatorMeetingResponse.kt | 47 ++++++++++ .../response/models/DenyInvitationRequest.kt | 35 ++++++++ .../models/DownloadFileSuccessfulResponse.kt | 34 ++++++++ .../response/models/EditMeetingRequest.kt | 77 ++++++++++++++++ .../response/models/EditMeetingResponse.kt | 40 +++++++++ .../ktor/response/models/EditUserRequest.kt | 43 +++++++++ .../ktor/response/models/EditUserResponse.kt | 40 +++++++++ .../response/models/EmailConfirmRequest.kt | 39 +++++++++ .../ktor/response/models/EmailLinkRequest.kt | 35 ++++++++ .../models/GenerateIdentityRequest.kt | 35 ++++++++ .../models/GenerateIdentityResponse.kt | 39 +++++++++ .../ktor/response/models/GetUserRequest.kt | 35 ++++++++ .../ktor/response/models/GetUserResponse.kt | 40 +++++++++ .../ktor/response/models/IdentityRequest.kt | 39 +++++++++ .../ktor/response/models/InlineObject.kt | 35 ++++++++ .../ktor/response/models/InvalidResponse.kt | 69 +++++++++++++++ .../engine/ktor/response/models/Invitation.kt | 53 +++++++++++ .../response/models/ListFriendsRequest.kt | 39 +++++++++ .../response/models/ListFriendsResponse.kt | 40 +++++++++ .../models/ListFriendsResponseResult.kt | 40 +++++++++ .../response/models/ListMapMeetingsRequest.kt | 36 ++++++++ .../models/ListMapMeetingsResponse.kt | 40 +++++++++ .../models/ListMeetingParticipantsRequest.kt | 43 +++++++++ .../models/ListMeetingParticipantsResponse.kt | 40 +++++++++ .../ListMeetingParticipantsResponseResult.kt | 40 +++++++++ .../response/models/ListMeetingsRequest.kt | 39 +++++++++ .../response/models/ListMeetingsResponse.kt | 39 +++++++++ .../models/ListMeetingsResponseResult.kt | 40 +++++++++ .../models/ListNotificationsRequest.kt | 39 +++++++++ .../models/ListNotificationsResponse.kt | 40 +++++++++ .../models/ListNotificationsResponseResult.kt | 40 +++++++++ .../engine/ktor/response/models/Location.kt | 39 +++++++++ .../engine/ktor/response/models/Meeting.kt | 87 +++++++++++++++++++ .../ktor/response/models/Notification.kt | 78 +++++++++++++++++ .../models/ReadNotificationRequest.kt | 35 ++++++++ .../response/models/StatusTrueResponse.kt | 35 ++++++++ .../ktor/response/models/TokenRequest.kt | 35 ++++++++ .../sdk/engine/ktor/response/models/User.kt | 64 ++++++++++++++ .../models/ValidateUsernameRequest.kt | 35 ++++++++ 52 files changed, 2171 insertions(+), 19 deletions(-) create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt index a01e0cd4..f931f6f9 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt @@ -22,6 +22,8 @@ import dev.icerock.moko.network.generated.models.Location as GeneratedLocation import dev.icerock.moko.network.generated.models.Meeting as GeneratedMeeting import dev.icerock.moko.network.generated.models.Notification as GeneratedNotification import dev.icerock.moko.network.generated.models.User as GeneratedUser +import app.meetacy.sdk.engine.ktor.response.models.Meeting as LolMeeting +import app.meetacy.sdk.engine.ktor.response.models.User as LolUser internal fun GeneratedUser.mapToSelfUser(): SelfUser = mapToUser() as SelfUser internal fun GeneratedUser.mapToRegularUser(): RegularUser = mapToUser() as RegularUser @@ -46,6 +48,26 @@ internal fun GeneratedUser.mapToUser(): User = if (isSelf) { ) } +@OptIn(UnsafeConstructor::class) +internal fun LolUser.mapToUser(): User = if (isSelf) { + SelfUser( + id = UserId(id), + nickname = nickname, + email = email?.let(::Email), + emailVerified = emailVerified ?: error("Self user must always return emailVerified parameter"), + username = username?.let(::Username), + avatarId = avatarId?.let(::FileId) + ) +} else { + RegularUser( + id = UserId(id), + nickname = nickname, + avatarId = avatarId?.let(::FileId), + username = username?.let(::Username), + relationship = relationship?.mapToRelationship() ?: error("Regular user should always return relationship parameter") + ) +} + internal fun GeneratedInvitation.toInvitation(): Invitation = Invitation( id = identity.let(::InvitationId), meeting = meeting.mapToMeeting(), @@ -66,6 +88,26 @@ internal fun String.mapToRelationship(): Relationship? = when(this) { else -> null } +internal fun LolMeeting.mapToMeeting(): Meeting = Meeting( + id = MeetingId(id), + creator = creator.mapToUser(), + date = Date(date), + location = Location( + location.latitude, + location.longitude + ), + title = title, + description = description, + participantsCount = participantsCount, + isParticipating = isParticipating, + previewParticipants = previewParticipants.map(LolUser::mapToUser), + avatarId = avatarId?.let(::FileId), + visibility = when (visibility) { + LolMeeting.Visibility.PUBLIC -> Meeting.Visibility.Public + LolMeeting.Visibility.PRIVATE -> Meeting.Visibility.Private + } +) + internal fun GeneratedMeeting.mapToMeeting(): Meeting = Meeting( id = MeetingId(id), creator = creator.mapToUser(), diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index 12d89d62..b879370f 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -2,6 +2,8 @@ package app.meetacy.sdk.engine.ktor.requests.meetings import app.meetacy.sdk.engine.ktor.mapToMeeting import app.meetacy.sdk.engine.ktor.mapToUser +import app.meetacy.sdk.engine.ktor.response.models.CreateMeetingResponse +import app.meetacy.sdk.engine.ktor.response.models.ListMeetingsResponse import app.meetacy.sdk.engine.requests.* import app.meetacy.sdk.engine.requests.CreateMeetingRequest import app.meetacy.sdk.engine.requests.EditMeetingRequest @@ -23,6 +25,7 @@ import kotlinx.serialization.json.put import kotlinx.serialization.json.putJsonObject import dev.icerock.moko.network.generated.models.ListMeetingParticipantsRequest as GeneratedListMeetingParticipantsRequest import dev.icerock.moko.network.generated.models.Meeting as GeneratedMeeting +import app.meetacy.sdk.engine.ktor.response.models.Meeting as LolMeeting internal class MeetingsEngine( private val baseUrl: Url, @@ -34,18 +37,28 @@ internal class MeetingsEngine( suspend fun listMeetingsHistory( request: ListMeetingsHistoryRequest ): ListMeetingsHistoryRequest.Response = with(request) { - val response = base.meetingsHistoryListPost( - listMeetingsRequest = ListMeetingsRequest( - amount = amount.int, - pagingId = pagingId?.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "meetings" / "history" / "list" + + val jsonObject = buildJsonObject { + put("amount", amount.int) + put("pagingId", pagingId?.string) + } + + val string = httpClient.post(url.string) { + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + header("Authorization", token.string) + }.body() + + val response = Json.decodeFromString(string) val paging = PagingResponse( nextPagingId = response.result.nextPagingId?.let(::PagingId), - data = response.result.data.map(GeneratedMeeting::mapToMeeting) + data = response.result.data.map(LolMeeting::mapToMeeting) ) return ListMeetingsHistoryRequest.Response(paging) @@ -128,15 +141,13 @@ internal class MeetingsEngine( } val string = httpClient.post(url.string) { - headers { - append("Authorization", token.string) - } setBody( TextContent( text = jsonObject.toString(), contentType = ContentType.Application.Json ) ) + header("Authorization", token.string) }.body() val meeting = Json.decodeFromString(string).result @@ -174,15 +185,13 @@ internal class MeetingsEngine( } val string = httpClient.post(url.string) { - headers { - append("Authorization", token.string) - } setBody( TextContent( text = jsonObject.toString(), contentType = ContentType.Application.Json ) ) + header("Authorization", token.string) }.body() val meeting = Json.decodeFromString(string).result diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index aa47c2d4..b973db9e 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -77,16 +77,13 @@ internal class UsersEngine( } val string = httpClient.post(url.string) { - headers { - append("Authorization", token.string) - } setBody( TextContent( text = jsonObject.toString(), contentType = ContentType.Application.Json ) ) - + header("Authorization", token.string) }.body() val user = Json.decodeFromString(string).result diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt new file mode 100644 index 00000000..2190cbf7 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param id + */ +@Serializable +internal data class AcceptInvitationRequest ( + + @SerialName("id") + val id: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt new file mode 100644 index 00000000..524653be --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param accessIdentity + * @param fileIdentity + */ +@Serializable +internal data class AccessAvatarRequest ( + + @SerialName("accessIdentity") + val accessIdentity: String, + + @SerialName("fileIdentity") + val fileIdentity: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt new file mode 100644 index 00000000..c073743d --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param friendId + */ +@Serializable +internal data class AccessFriendRequest ( + + @SerialName("friendId") + val friendId: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt new file mode 100644 index 00000000..469c697a --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param accessIdentity + */ +@Serializable +internal data class AccessIdentityRequest ( + + @SerialName("accessIdentity") + val accessIdentity: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt new file mode 100644 index 00000000..ea381d78 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param meetingId + */ +@Serializable +internal data class AccessMeetingIdRequest ( + + @SerialName("meetingId") + val meetingId: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt new file mode 100644 index 00000000..4275fe8b --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param id + */ +@Serializable +internal data class CancelInvitationRequest ( + + @SerialName("id") + val id: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt new file mode 100644 index 00000000..344b728d --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param meetingId + * @param userId + */ +@Serializable +internal data class CreateInvitationRequest ( + + @SerialName("meetingId") + val meetingId: String, + + @SerialName("userId") + val userId: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt new file mode 100644 index 00000000..092eb4c9 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Invitation +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class CreateInvitationResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("result") + val result: Invitation + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt new file mode 100644 index 00000000..a14da2c7 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt @@ -0,0 +1,73 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Location +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param title + * @param date + * @param location + * @param visibility + * @param avatarId + * @param description + */ +@Serializable +internal data class CreateMeetingRequest ( + + @SerialName("title") + val title: String, + + @SerialName("date") + val date: String, + + @SerialName("location") + val location: Location, + + @SerialName("visibility") + val visibility: Visibility, + + @SerialName("avatarId") + val avatarId: String? = null, + + @SerialName("description") + val description: String? = null + +) { + + /** + * + * Values: "public","private" + */ + @Serializable + enum class Visibility { + + @SerialName("public") + PUBLIC, + + @SerialName("private") + PRIVATE; + + } + +} + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt new file mode 100644 index 00000000..ff9588bc --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Meeting +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class CreateMeetingResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("result") + val result: Meeting + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt new file mode 100644 index 00000000..2a47893e --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt @@ -0,0 +1,47 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param id + * @param nickname + * @param email + * @param emailVerified + */ +@Serializable +internal data class CreatorMeetingResponse ( + + @SerialName("id") + val id: String? = null, + + @SerialName("nickname") + val nickname: String? = null, + + @SerialName("email") + val email: String? = null, + + @SerialName("emailVerified") + val emailVerified: Boolean? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt new file mode 100644 index 00000000..3763c5f8 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param id + */ +@Serializable +internal data class DenyInvitationRequest ( + + @SerialName("id") + val id: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt new file mode 100644 index 00000000..5589c351 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt @@ -0,0 +1,34 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + +import kotlinx.serialization.SerialName + +/** +* +* Values: "*image_file*" +*/ +@Serializable +internal enum class DownloadFileSuccessfulResponse { + + @SerialName("*image_file*") + STAR_IMAGE_FILE_STAR; + +} + + + + + + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt new file mode 100644 index 00000000..cebc97f0 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt @@ -0,0 +1,77 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Location +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param meetingId + * @param avatarId + * @param title + * @param description + * @param date + * @param location + * @param visibility + */ +@Serializable +internal data class EditMeetingRequest ( + + @SerialName("meetingId") + val meetingId: String, + + @SerialName("avatarId") + val avatarId: String? = null, + + @SerialName("title") + val title: String? = null, + + @SerialName("description") + val description: String? = null, + + @SerialName("date") + val date: String? = null, + + @SerialName("location") + val location: Location? = null, + + @SerialName("visibility") + val visibility: Visibility? = null + +) { + + /** + * + * Values: "public","private" + */ + @Serializable + enum class Visibility { + + @SerialName("public") + PUBLIC, + + @SerialName("private") + PRIVATE; + + } + +} + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt new file mode 100644 index 00000000..1160ed63 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Meeting +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class EditMeetingResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("result") + val result: Meeting + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt new file mode 100644 index 00000000..2d76bff8 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt @@ -0,0 +1,43 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param nickname + * @param username + * @param avatarId + */ +@Serializable +internal data class EditUserRequest ( + + @SerialName("nickname") + val nickname: String? = null, + + @SerialName("username") + val username: String? = null, + + @SerialName("avatarId") + val avatarId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt new file mode 100644 index 00000000..104db759 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.User +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class EditUserResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("result") + val result: User + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt new file mode 100644 index 00000000..d2ff1015 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param email + * @param confirmHash + */ +@Serializable +internal data class EmailConfirmRequest ( + + @SerialName("email") + val email: String, + + @SerialName("confirmHash") + val confirmHash: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt new file mode 100644 index 00000000..8dd255b9 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param email + */ +@Serializable +internal data class EmailLinkRequest ( + + @SerialName("email") + val email: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt new file mode 100644 index 00000000..f699ecf3 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param nickname + */ +@Serializable +internal data class GenerateIdentityRequest ( + + @SerialName("nickname") + val nickname: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt new file mode 100644 index 00000000..56abb7a4 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class GenerateIdentityResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("result") + val result: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt new file mode 100644 index 00000000..1237af57 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * response with an token + * @param id + */ +@Serializable +internal data class GetUserRequest ( + + @SerialName("id") + val id: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt new file mode 100644 index 00000000..321d25bd --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.User +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class GetUserResponse ( + + @SerialName("status") + val status: Boolean? = null, + + @SerialName("result") + val result: User? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt new file mode 100644 index 00000000..0ffa771a --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param id + * @param token + */ +@Serializable +internal data class IdentityRequest ( + + @SerialName("id") + val id: String, + + @SerialName("token") + val token: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt new file mode 100644 index 00000000..4770e1b6 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param file + */ +@Serializable +internal data class InlineObject ( + + @SerialName("file") + val file: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt new file mode 100644 index 00000000..a520935f --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt @@ -0,0 +1,69 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param errorCode + * @param errorMessage + */ +@Serializable +internal data class InvalidResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("errorCode") + val errorCode: ErrorCode, + + @SerialName("errorMessage") + val errorMessage: ErrorMessage + +) { + + /** + * + * Values: 1 + */ + @Serializable + enum class ErrorCode { + + @SerialName("1") + _1; + + } + + /** + * + * Values: "Please provide a valid token" + */ + @Serializable + enum class ErrorMessage { + + @SerialName("Please provide a valid token") + PLEASE_PROVIDE_A_VALID_TOKEN; + + } + +} + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt new file mode 100644 index 00000000..5d94b552 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt @@ -0,0 +1,53 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Meeting +import dev.icerock.moko.network.generated.models.User +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param identity + * @param invitedUser + * @param inviterUser + * @param meeting + * @param isAccepted + */ +@Serializable +internal data class Invitation ( + + @SerialName("identity") + val identity: String, + + @SerialName("invitedUser") + val invitedUser: User, + + @SerialName("inviterUser") + val inviterUser: User, + + @SerialName("meeting") + val meeting: Meeting, + + @SerialName("isAccepted") + val isAccepted: Boolean? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt new file mode 100644 index 00000000..f6b5ba5b --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param amount + * @param pagingId + */ +@Serializable +internal data class ListFriendsRequest ( + + @SerialName("amount") + val amount: Int, + + @SerialName("pagingId") + val pagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt new file mode 100644 index 00000000..3e425fe9 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.ListFriendsResponseResult +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class ListFriendsResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("result") + val result: ListFriendsResponseResult + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt new file mode 100644 index 00000000..5c36345e --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.User +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param data + * @param nextPagingId + */ +@Serializable +internal data class ListFriendsResponseResult ( + + @SerialName("data") + val data: List, + + @SerialName("nextPagingId") + val nextPagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt new file mode 100644 index 00000000..896d0ecc --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt @@ -0,0 +1,36 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Location +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param location + */ +@Serializable +internal data class ListMapMeetingsRequest ( + + @SerialName("location") + val location: Location + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt new file mode 100644 index 00000000..0d8d9f1c --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Meeting +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param result + * @param status + */ +@Serializable +internal data class ListMapMeetingsResponse ( + + @SerialName("result") + val result: List, + + @SerialName("status") + val status: Boolean? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt new file mode 100644 index 00000000..dcb70fc0 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt @@ -0,0 +1,43 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param meetingId + * @param amount + * @param pagingId + */ +@Serializable +internal data class ListMeetingParticipantsRequest ( + + @SerialName("meetingId") + val meetingId: String, + + @SerialName("amount") + val amount: Int, + + @SerialName("pagingId") + val pagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt new file mode 100644 index 00000000..5d692e05 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.ListMeetingParticipantsResponseResult +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + * @param result + */ +@Serializable +internal data class ListMeetingParticipantsResponse ( + + @SerialName("status") + val status: Boolean, + + @SerialName("result") + val result: ListMeetingParticipantsResponseResult + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt new file mode 100644 index 00000000..d6914632 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.User +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param data + * @param nextPagingId + */ +@Serializable +internal data class ListMeetingParticipantsResponseResult ( + + @SerialName("data") + val data: List, + + @SerialName("nextPagingId") + val nextPagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt new file mode 100644 index 00000000..beb40c5d --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param amount + * @param pagingId + */ +@Serializable +internal data class ListMeetingsRequest ( + + @SerialName("amount") + val amount: Int, + + @SerialName("pagingId") + val pagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt new file mode 100644 index 00000000..9a311d23 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param result + * @param status + */ +@Serializable +internal data class ListMeetingsResponse ( + + @SerialName("result") + val result: ListMeetingsResponseResult, + + @SerialName("status") + val status: Boolean? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt new file mode 100644 index 00000000..83720ab0 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param data + * @param nextPagingId + */ +@Serializable +internal data class ListMeetingsResponseResult ( + + @SerialName("data") + val data: List, + + @SerialName("nextPagingId") + val nextPagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt new file mode 100644 index 00000000..a3578f8a --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param amount + * @param pagingId + */ +@Serializable +internal data class ListNotificationsRequest ( + + @SerialName("amount") + val amount: Int, + + @SerialName("pagingId") + val pagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt new file mode 100644 index 00000000..eedcbae4 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.ListNotificationsResponseResult +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param result + * @param status + */ +@Serializable +internal data class ListNotificationsResponse ( + + @SerialName("result") + val result: ListNotificationsResponseResult, + + @SerialName("status") + val status: Boolean? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt new file mode 100644 index 00000000..75257e29 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt @@ -0,0 +1,40 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Notification +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param data + * @param nextPagingId + */ +@Serializable +internal data class ListNotificationsResponseResult ( + + @SerialName("data") + val data: List, + + @SerialName("nextPagingId") + val nextPagingId: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt new file mode 100644 index 00000000..87c646bc --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt @@ -0,0 +1,39 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param latitude + * @param longitude + */ +@Serializable +internal data class Location ( + + @SerialName("latitude") + val latitude: Double, + + @SerialName("longitude") + val longitude: Double + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt new file mode 100644 index 00000000..c44b6288 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt @@ -0,0 +1,87 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName + + +/** + * + * @param id + * @param creator + * @param date + * @param location + * @param title + * @param participantsCount + * @param previewParticipants + * @param isParticipating + * @param visibility + * @param description + * @param avatarId + */ +@Serializable +internal data class Meeting ( + + @SerialName("id") + val id: String, + + @SerialName("creator") + val creator: User, + + @SerialName("date") + val date: String, + + @SerialName("location") + val location: Location, + + @SerialName("title") + val title: String, + + @SerialName("participantsCount") + val participantsCount: Int, + + @SerialName("previewParticipants") + val previewParticipants: List, + + @SerialName("isParticipating") + val isParticipating: Boolean, + + @SerialName("visibility") + val visibility: Visibility, + + @SerialName("description") + val description: String? = null, + + @SerialName("avatarId") + val avatarId: String? = null + +) { + + /** + * + * Values: "public","private" + */ + @Serializable + enum class Visibility { + + @SerialName("public") + PUBLIC, + + @SerialName("private") + PRIVATE; + + } + +} + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt new file mode 100644 index 00000000..055c9ddd --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt @@ -0,0 +1,78 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import dev.icerock.moko.network.generated.models.Meeting +import dev.icerock.moko.network.generated.models.User +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param type + * @param id + * @param isNew + * @param date + * @param subscriber + * @param meeting + * @param inviter + */ +@Serializable +internal data class Notification ( + + @SerialName("type") + val type: Type, + + @SerialName("id") + val id: String, + + @SerialName("isNew") + val isNew: Boolean, + + @SerialName("date") + val date: String, + + @SerialName("subscriber") + val subscriber: User? = null, + + @SerialName("meeting") + val meeting: Meeting? = null, + + @SerialName("inviter") + val inviter: User? = null + +) { + + /** + * + * Values: "subscription","meeting_invitation" + */ + @Serializable + enum class Type { + + @SerialName("subscription") + SUBSCRIPTION, + + @SerialName("meeting_invitation") + MEETING_INVITATION; + + } + +} + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt new file mode 100644 index 00000000..cff5b1a6 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param lastNotificationId + */ +@Serializable +internal data class ReadNotificationRequest ( + + @SerialName("lastNotificationId") + val lastNotificationId: String + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt new file mode 100644 index 00000000..0276911c --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param status + */ +@Serializable +internal data class StatusTrueResponse ( + + @SerialName("status") + val status: Boolean + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt new file mode 100644 index 00000000..c84286f2 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param token + */ +@Serializable +internal data class TokenRequest ( + + @SerialName("token") + val token: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt new file mode 100644 index 00000000..4895d44a --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt @@ -0,0 +1,64 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param isSelf + * @param id + * @param nickname + * @param username + * @param email + * @param emailVerified + * @param avatarId + * @param relationship Relationship field can be one of four types - subscription, subscriber, friend and none. In case if isSelf == true, relationship field is null + */ +@Serializable +internal data class User ( + + @SerialName("isSelf") + val isSelf: Boolean, + + @SerialName("id") + val id: String, + + @SerialName("nickname") + val nickname: String, + + @SerialName("username") + val username: String? = null, + + @SerialName("email") + val email: String? = null, + + @SerialName("emailVerified") + val emailVerified: Boolean? = null, + + @SerialName("avatarId") + val avatarId: String? = null, + /* Relationship field can be one of four types - subscription, subscriber, friend and none. In case if isSelf == true, relationship field is null */ + + @SerialName("relationship") + val relationship: String? = null + +) + diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt new file mode 100644 index 00000000..d0ba5f1d --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt @@ -0,0 +1,35 @@ +/** +* Meetacy Backend API +* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. +* +* OpenAPI spec version: 1.0.2 +* +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +*/ +package app.meetacy.sdk.engine.ktor.response.models + +import kotlinx.serialization.Serializable + + + + + + +import kotlinx.serialization.SerialName + + +/** + * + * @param username + */ +@Serializable +internal data class ValidateUsernameRequest ( + + @SerialName("username") + val username: String + +) + From 69e1a4dffe42d077d115c28059cb8d96f8cdebef Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 21 Oct 2023 11:17:33 +0300 Subject: [PATCH 25/42] WIP(#76-support-auth-header): test generate --- .../app/meetacy/sdk/engine/ktor/Mappers.kt | 34 +++++++++++++++++++ .../engine/ktor/requests/auth/AuthEngine.kt | 34 ++++++++++++++++--- .../engine/ktor/requests/users/UsersEngine.kt | 4 +-- 3 files changed, 66 insertions(+), 6 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt index f931f6f9..a161d6cc 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt @@ -24,6 +24,9 @@ import dev.icerock.moko.network.generated.models.Notification as GeneratedNotifi import dev.icerock.moko.network.generated.models.User as GeneratedUser import app.meetacy.sdk.engine.ktor.response.models.Meeting as LolMeeting import app.meetacy.sdk.engine.ktor.response.models.User as LolUser +import app.meetacy.sdk.engine.ktor.response.models.Notification as LolNotification +import app.meetacy.sdk.engine.ktor.response.models.Invitation as LolInvitation +import app.meetacy.sdk.engine.ktor.response.models.Location as LolLocation internal fun GeneratedUser.mapToSelfUser(): SelfUser = mapToUser() as SelfUser internal fun GeneratedUser.mapToRegularUser(): RegularUser = mapToUser() as RegularUser @@ -80,6 +83,18 @@ internal fun GeneratedInvitation.toInvitation(): Invitation = Invitation( } ) +internal fun LolInvitation.toInvitation(): Invitation = Invitation( + id = identity.let(::InvitationId), + meeting = meeting.mapToMeeting(), + invitedUser = invitedUser.mapToUser(), + inviterUser = inviterUser.mapToUser(), + isAccepted = when (isAccepted) { + null -> AcceptationState.Waiting + true -> AcceptationState.Accepted + false -> AcceptationState.Declined + } +) + internal fun String.mapToRelationship(): Relationship? = when(this) { "none" -> Relationship.None "subscription" -> Relationship.Subscription @@ -146,3 +161,22 @@ internal fun GeneratedNotification.mapToNotification(): Notification = when (thi inviter = inviter!!.mapToRegularUser() ) } + +internal fun LolLocation.mapToLocation(): Location = + Location(latitude, longitude) + +internal fun LolNotification.mapToNotification(): Notification = when (this.type) { + app.meetacy.sdk.engine.ktor.response.models.Notification.Type.SUBSCRIPTION -> Notification.Subscription( + id = NotificationId(id), + isNew = isNew, + date = Date(date), + subscriber = subscriber!!.mapToRegularUser() + ) + app.meetacy.sdk.engine.ktor.response.models.Notification.Type.MEETING_INVITATION -> Notification.Invitation( + id = NotificationId(id), + isNew = isNew, + date = Date(date), + meeting = meeting!!.mapToMeeting(), + inviter = inviter!!.mapToRegularUser() + ) +} \ No newline at end of file diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt index 9307cf40..5d959bde 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt @@ -2,20 +2,28 @@ package app.meetacy.sdk.engine.ktor.requests.auth +import app.meetacy.sdk.engine.ktor.response.models.GenerateIdentityResponse import app.meetacy.sdk.engine.requests.GenerateAuthRequest import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.url.Url import dev.icerock.moko.network.generated.apis.AuthApi import dev.icerock.moko.network.generated.apis.AuthApiImpl +import dev.icerock.moko.network.generated.models.EditUserResponse import dev.icerock.moko.network.generated.models.GenerateIdentityRequest import io.ktor.client.* +import io.ktor.client.call.* +import io.ktor.client.request.* +import io.ktor.http.* +import io.ktor.http.content.* import kotlinx.serialization.json.Json +import kotlinx.serialization.json.buildJsonObject +import kotlinx.serialization.json.put internal class AuthEngine( - baseUrl: Url, - httpClient: HttpClient, - json: Json + private val baseUrl: Url, + private val httpClient: HttpClient, + private val json: Json ) { private val base: AuthApi = AuthApiImpl(baseUrl.string, httpClient, json) @@ -27,6 +35,24 @@ internal class AuthEngine( apiVersion = request.apiVersion.int.toString() ) - return GenerateAuthRequest.Response(token = Token(response.result)) + val url = baseUrl / "auth" / "generate" + + val jsonObject = buildJsonObject { + put("nickname", request.nickname) + } + + val string = httpClient.post(url.string) { + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + header("Api-Version", request.apiVersion.int.toString()) + }.body() + + val token = Json.decodeFromString(string).result + + return GenerateAuthRequest.Response(token = Token(token)) } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index b973db9e..8daa6fad 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -35,8 +35,7 @@ internal class UsersEngine( suspend fun getMe(request: GetMeRequest): GetMeRequest.Response { val response = base.usersGetPost( - getUserRequest = GeneratedGetUserRequest( - ), + getUserRequest = GeneratedGetUserRequest(), apiVersion = request.apiVersion.int.toString(), authorization = request.token.string ) @@ -84,6 +83,7 @@ internal class UsersEngine( ) ) header("Authorization", token.string) + header("Api-Version", apiVersion.int) }.body() val user = Json.decodeFromString(string).result From 01bb7df6ba7615347567f6913cde96ec1293f7ee Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 21 Oct 2023 11:56:03 +0300 Subject: [PATCH 26/42] fix(#76-support-auth-header): add api-version header --- .../sdk/engine/ktor/requests/auth/AuthEngine.kt | 15 +-------------- .../ktor/requests/meetings/MeetingsEngine.kt | 3 +++ .../sdk/engine/ktor/requests/users/UsersEngine.kt | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt index 5d959bde..bed5f824 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt @@ -7,10 +7,6 @@ import app.meetacy.sdk.engine.requests.GenerateAuthRequest import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.url.Url -import dev.icerock.moko.network.generated.apis.AuthApi -import dev.icerock.moko.network.generated.apis.AuthApiImpl -import dev.icerock.moko.network.generated.models.EditUserResponse -import dev.icerock.moko.network.generated.models.GenerateIdentityRequest import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.request.* @@ -25,16 +21,7 @@ internal class AuthEngine( private val httpClient: HttpClient, private val json: Json ) { - private val base: AuthApi = AuthApiImpl(baseUrl.string, httpClient, json) - suspend fun generate(request: GenerateAuthRequest): GenerateAuthRequest.Response { - val response = base.authGeneratePost( - generateIdentityRequest = GenerateIdentityRequest( - nickname = request.nickname - ), - apiVersion = request.apiVersion.int.toString() - ) - val url = baseUrl / "auth" / "generate" val jsonObject = buildJsonObject { @@ -51,7 +38,7 @@ internal class AuthEngine( header("Api-Version", request.apiVersion.int.toString()) }.body() - val token = Json.decodeFromString(string).result + val token = json.decodeFromString(string).result return GenerateAuthRequest.Response(token = Token(token)) } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index b879370f..17323cff 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -52,6 +52,7 @@ internal class MeetingsEngine( ) ) header("Authorization", token.string) + header("Api-Version", apiVersion.int.toString()) }.body() val response = Json.decodeFromString(string) @@ -148,6 +149,7 @@ internal class MeetingsEngine( ) ) header("Authorization", token.string) + header("Api-Version", request.apiVersion.int.toString()) }.body() val meeting = Json.decodeFromString(string).result @@ -192,6 +194,7 @@ internal class MeetingsEngine( ) ) header("Authorization", token.string) + header("Api-Version", request.apiVersion.int.toString()) }.body() val meeting = Json.decodeFromString(string).result diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index 8daa6fad..24c2bc8a 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -83,7 +83,7 @@ internal class UsersEngine( ) ) header("Authorization", token.string) - header("Api-Version", apiVersion.int) + header("Api-Version", apiVersion.int.toString()) }.body() val user = Json.decodeFromString(string).result From 88580cf8fd7382ecf0d2c05835b65026eaa8c7e9 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 21 Oct 2023 23:06:02 +0300 Subject: [PATCH 27/42] fix(#76-support-auth-header): added interface and new extension fun --- .../engine/ktor/requests/auth/AuthEngine.kt | 15 +----- .../requests/extencion/RequestBodyPost.kt | 46 +++++++++++++++++++ .../ktor/requests/meetings/MeetingsEngine.kt | 13 ++---- .../models/CreateInvitationResponse.kt | 1 - .../response/models/CreateMeetingRequest.kt | 1 - .../response/models/CreateMeetingResponse.kt | 1 - .../response/models/EditMeetingRequest.kt | 7 --- .../response/models/EditMeetingResponse.kt | 7 --- .../ktor/response/models/EditUserResponse.kt | 1 - .../ktor/response/models/GetUserResponse.kt | 7 --- .../ktor/response/models/InvalidResponse.kt | 6 --- .../engine/ktor/response/models/Invitation.kt | 2 - .../response/models/ListFriendsResponse.kt | 1 - .../models/ListFriendsResponseResult.kt | 1 - .../response/models/ListMapMeetingsRequest.kt | 1 - .../models/ListMapMeetingsResponse.kt | 1 - .../models/ListMeetingParticipantsResponse.kt | 1 - .../ListMeetingParticipantsResponseResult.kt | 1 - .../models/ListNotificationsResponse.kt | 1 - .../models/ListNotificationsResponseResult.kt | 1 - .../ktor/response/models/Notification.kt | 2 - .../sdk/engine/ktor/response/models/User.kt | 6 --- .../engine/requests/CreateMeetingRequest.kt | 4 +- .../engine/requests/DeleteFriendRequest.kt | 2 +- .../engine/requests/GenerateAuthRequest.kt | 2 +- .../requests/ListMeetingsHistoryRequest.kt | 4 +- .../sdk/engine/requests/RequestRepository.kt | 11 +++++ 27 files changed, 68 insertions(+), 78 deletions(-) create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt create mode 100644 api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt index bed5f824..81c973aa 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt @@ -2,16 +2,13 @@ package app.meetacy.sdk.engine.ktor.requests.auth +import app.meetacy.sdk.engine.ktor.requests.extencion.postWithoutToken import app.meetacy.sdk.engine.ktor.response.models.GenerateIdentityResponse import app.meetacy.sdk.engine.requests.GenerateAuthRequest import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.url.Url import io.ktor.client.* -import io.ktor.client.call.* -import io.ktor.client.request.* -import io.ktor.http.* -import io.ktor.http.content.* import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put @@ -28,15 +25,7 @@ internal class AuthEngine( put("nickname", request.nickname) } - val string = httpClient.post(url.string) { - setBody( - TextContent( - text = jsonObject.toString(), - contentType = ContentType.Application.Json - ) - ) - header("Api-Version", request.apiVersion.int.toString()) - }.body() + val string = postWithoutToken(url.string, jsonObject, httpClient, request) val token = json.decodeFromString(string).result diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt new file mode 100644 index 00000000..6d077244 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt @@ -0,0 +1,46 @@ +package app.meetacy.sdk.engine.ktor.requests.extencion + +import app.meetacy.sdk.engine.requests.MeRequestWithToken +import app.meetacy.sdk.engine.requests.MeetacyRequest +import app.meetacy.sdk.engine.requests.TokenProviderEmpty +import io.ktor.client.* +import io.ktor.client.call.* +import io.ktor.client.request.* +import io.ktor.http.* +import io.ktor.http.content.* +import kotlinx.serialization.json.JsonObject + +public suspend inline fun > post( + urlString: String, + jsonObject: JsonObject, + httpClient: HttpClient, + request: R +): String { + return httpClient.post(urlString) { + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + header("Token", request.token) + header("Api-Version", request.apiVersion.toString()) + }.body() +} + +public suspend inline fun > postWithoutToken( + url: String, + jsonObject: JsonObject, + httpClient: HttpClient, + request: R +): String { + return httpClient.post(url) { + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + header("Api-Version", request.apiVersion.toString()) + }.body() +} diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index 17323cff..9ccc9a73 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -2,7 +2,9 @@ package app.meetacy.sdk.engine.ktor.requests.meetings import app.meetacy.sdk.engine.ktor.mapToMeeting import app.meetacy.sdk.engine.ktor.mapToUser +import app.meetacy.sdk.engine.ktor.requests.extencion.post import app.meetacy.sdk.engine.ktor.response.models.CreateMeetingResponse +import app.meetacy.sdk.engine.ktor.response.models.EditMeetingResponse import app.meetacy.sdk.engine.ktor.response.models.ListMeetingsResponse import app.meetacy.sdk.engine.requests.* import app.meetacy.sdk.engine.requests.CreateMeetingRequest @@ -44,16 +46,7 @@ internal class MeetingsEngine( put("pagingId", pagingId?.string) } - val string = httpClient.post(url.string) { - setBody( - TextContent( - text = jsonObject.toString(), - contentType = ContentType.Application.Json - ) - ) - header("Authorization", token.string) - header("Api-Version", apiVersion.int.toString()) - }.body() + val string = post(url.string, jsonObject, httpClient, request) val response = Json.decodeFromString(string) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt index 092eb4c9..677dfc61 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Invitation import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt index a14da2c7..88ae0540 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Location import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt index ff9588bc..3fe8df24 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt index cebc97f0..b07688d2 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt @@ -11,14 +11,7 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Location import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt index 1160ed63..dc588cd8 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt @@ -11,14 +11,7 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt index 104db759..89853ef1 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt index 321d25bd..e8fd276d 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt @@ -11,14 +11,7 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt index a520935f..8b4b8664 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt @@ -12,12 +12,6 @@ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt index 5d94b552..8ac19f9c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt @@ -11,8 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt index 3e425fe9..221db563 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.ListFriendsResponseResult import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt index 5c36345e..3f4a8e1e 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt index 896d0ecc..a4220ca5 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Location import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt index 0d8d9f1c..2807e7f4 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt index 5d692e05..81e014a1 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.ListMeetingParticipantsResponseResult import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt index d6914632..5062e4a2 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt index eedcbae4..8a05156c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.ListNotificationsResponseResult import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt index 75257e29..803b4d48 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Notification import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt index 055c9ddd..e756ba51 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt @@ -11,8 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt index 4895d44a..f10be27a 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt @@ -12,12 +12,6 @@ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt index 2e199b24..34061388 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt @@ -7,13 +7,13 @@ import app.meetacy.sdk.types.location.Location import app.meetacy.sdk.types.meeting.Meeting public class CreateMeetingRequest( - public val token: Token, + public override val token: Token, public val title: String, public val date: Date, public val location: Location, public val description: String?, public val visibility: Meeting.Visibility, public val fileId: FileId? = null -) : MeetacyRequest { +) : MeetacyRequest, MeRequestWithToken { public data class Response(val meeting: Meeting) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt index 1f415659..8d75b320 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt @@ -6,4 +6,4 @@ import app.meetacy.sdk.types.user.UserId public data class DeleteFriendRequest( val token: Token, val friendId: UserId -) : SimpleMeetacyRequest +) : SimpleMeetacyRequest \ No newline at end of file diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt index 1376fd9b..85794d28 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token public data class GenerateAuthRequest( val nickname: String -) : MeetacyRequest { +) : MeetacyRequest, TokenProviderEmpty { public data class Response(val token: Token) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt index 85ac33fb..1847d5a6 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt @@ -7,9 +7,9 @@ import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse public data class ListMeetingsHistoryRequest( - val token: Token, + override val token: Token, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest { +) : MeetacyRequest, MeRequestWithToken { public data class Response(val paging: PagingResponse) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt new file mode 100644 index 00000000..9ba34161 --- /dev/null +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt @@ -0,0 +1,11 @@ +package app.meetacy.sdk.engine.requests + +import app.meetacy.sdk.types.auth.Token + +public sealed interface MeRequestWithToken : MeetacyRequest { + public val token: Token +} + +public interface TokenProviderEmpty : MeetacyRequest + + From a91e2a99264ece5e10275d348bf4d94e80734b9b Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 21 Oct 2023 23:06:02 +0300 Subject: [PATCH 28/42] fix(#76-support-auth-header): added interface and new extension fun --- .../app/meetacy/sdk/engine/ktor/Mappers.kt | 3 ++ .../engine/ktor/requests/auth/AuthEngine.kt | 15 +----- .../requests/extencion/RequestBodyPost.kt | 46 +++++++++++++++++++ .../ktor/requests/meetings/MeetingsEngine.kt | 13 ++---- .../models/CreateInvitationResponse.kt | 1 - .../response/models/CreateMeetingRequest.kt | 1 - .../response/models/CreateMeetingResponse.kt | 1 - .../response/models/EditMeetingRequest.kt | 7 --- .../response/models/EditMeetingResponse.kt | 7 --- .../ktor/response/models/EditUserResponse.kt | 1 - .../ktor/response/models/GetUserResponse.kt | 7 --- .../ktor/response/models/InvalidResponse.kt | 6 --- .../engine/ktor/response/models/Invitation.kt | 2 - .../response/models/ListFriendsResponse.kt | 1 - .../models/ListFriendsResponseResult.kt | 1 - .../response/models/ListMapMeetingsRequest.kt | 1 - .../models/ListMapMeetingsResponse.kt | 1 - .../models/ListMeetingParticipantsResponse.kt | 1 - .../ListMeetingParticipantsResponseResult.kt | 1 - .../models/ListNotificationsResponse.kt | 1 - .../models/ListNotificationsResponseResult.kt | 1 - .../ktor/response/models/Notification.kt | 2 - .../sdk/engine/ktor/response/models/User.kt | 6 --- .../engine/requests/CreateMeetingRequest.kt | 4 +- .../engine/requests/DeleteFriendRequest.kt | 2 +- .../engine/requests/GenerateAuthRequest.kt | 2 +- .../requests/ListMeetingsHistoryRequest.kt | 4 +- .../sdk/engine/requests/RequestRepository.kt | 11 +++++ 28 files changed, 71 insertions(+), 78 deletions(-) create mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt create mode 100644 api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt index a161d6cc..35019d0e 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt @@ -31,6 +31,9 @@ import app.meetacy.sdk.engine.ktor.response.models.Location as LolLocation internal fun GeneratedUser.mapToSelfUser(): SelfUser = mapToUser() as SelfUser internal fun GeneratedUser.mapToRegularUser(): RegularUser = mapToUser() as RegularUser +internal fun LolUser.mapToSelfUser(): SelfUser = mapToUser() as SelfUser +internal fun LolUser.mapToRegularUser(): RegularUser = mapToUser() as RegularUser + @OptIn(UnsafeConstructor::class) internal fun GeneratedUser.mapToUser(): User = if (isSelf) { SelfUser( diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt index bed5f824..81c973aa 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/auth/AuthEngine.kt @@ -2,16 +2,13 @@ package app.meetacy.sdk.engine.ktor.requests.auth +import app.meetacy.sdk.engine.ktor.requests.extencion.postWithoutToken import app.meetacy.sdk.engine.ktor.response.models.GenerateIdentityResponse import app.meetacy.sdk.engine.requests.GenerateAuthRequest import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.url.Url import io.ktor.client.* -import io.ktor.client.call.* -import io.ktor.client.request.* -import io.ktor.http.* -import io.ktor.http.content.* import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put @@ -28,15 +25,7 @@ internal class AuthEngine( put("nickname", request.nickname) } - val string = httpClient.post(url.string) { - setBody( - TextContent( - text = jsonObject.toString(), - contentType = ContentType.Application.Json - ) - ) - header("Api-Version", request.apiVersion.int.toString()) - }.body() + val string = postWithoutToken(url.string, jsonObject, httpClient, request) val token = json.decodeFromString(string).result diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt new file mode 100644 index 00000000..6d077244 --- /dev/null +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt @@ -0,0 +1,46 @@ +package app.meetacy.sdk.engine.ktor.requests.extencion + +import app.meetacy.sdk.engine.requests.MeRequestWithToken +import app.meetacy.sdk.engine.requests.MeetacyRequest +import app.meetacy.sdk.engine.requests.TokenProviderEmpty +import io.ktor.client.* +import io.ktor.client.call.* +import io.ktor.client.request.* +import io.ktor.http.* +import io.ktor.http.content.* +import kotlinx.serialization.json.JsonObject + +public suspend inline fun > post( + urlString: String, + jsonObject: JsonObject, + httpClient: HttpClient, + request: R +): String { + return httpClient.post(urlString) { + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + header("Token", request.token) + header("Api-Version", request.apiVersion.toString()) + }.body() +} + +public suspend inline fun > postWithoutToken( + url: String, + jsonObject: JsonObject, + httpClient: HttpClient, + request: R +): String { + return httpClient.post(url) { + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + header("Api-Version", request.apiVersion.toString()) + }.body() +} diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index 17323cff..9ccc9a73 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -2,7 +2,9 @@ package app.meetacy.sdk.engine.ktor.requests.meetings import app.meetacy.sdk.engine.ktor.mapToMeeting import app.meetacy.sdk.engine.ktor.mapToUser +import app.meetacy.sdk.engine.ktor.requests.extencion.post import app.meetacy.sdk.engine.ktor.response.models.CreateMeetingResponse +import app.meetacy.sdk.engine.ktor.response.models.EditMeetingResponse import app.meetacy.sdk.engine.ktor.response.models.ListMeetingsResponse import app.meetacy.sdk.engine.requests.* import app.meetacy.sdk.engine.requests.CreateMeetingRequest @@ -44,16 +46,7 @@ internal class MeetingsEngine( put("pagingId", pagingId?.string) } - val string = httpClient.post(url.string) { - setBody( - TextContent( - text = jsonObject.toString(), - contentType = ContentType.Application.Json - ) - ) - header("Authorization", token.string) - header("Api-Version", apiVersion.int.toString()) - }.body() + val string = post(url.string, jsonObject, httpClient, request) val response = Json.decodeFromString(string) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt index 092eb4c9..677dfc61 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Invitation import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt index a14da2c7..88ae0540 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Location import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt index ff9588bc..3fe8df24 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt index cebc97f0..b07688d2 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt @@ -11,14 +11,7 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Location import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt index 1160ed63..dc588cd8 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt @@ -11,14 +11,7 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt index 104db759..89853ef1 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt index 321d25bd..e8fd276d 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt @@ -11,14 +11,7 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt index a520935f..8b4b8664 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt @@ -12,12 +12,6 @@ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt index 5d94b552..8ac19f9c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt @@ -11,8 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt index 3e425fe9..221db563 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.ListFriendsResponseResult import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt index 5c36345e..3f4a8e1e 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt index 896d0ecc..a4220ca5 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Location import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt index 0d8d9f1c..2807e7f4 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt index 5d692e05..81e014a1 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.ListMeetingParticipantsResponseResult import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt index d6914632..5062e4a2 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt index eedcbae4..8a05156c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.ListNotificationsResponseResult import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt index 75257e29..803b4d48 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt @@ -11,7 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Notification import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt index 055c9ddd..e756ba51 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt @@ -11,8 +11,6 @@ */ package app.meetacy.sdk.engine.ktor.response.models -import dev.icerock.moko.network.generated.models.Meeting -import dev.icerock.moko.network.generated.models.User import kotlinx.serialization.Serializable diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt index 4895d44a..f10be27a 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt @@ -12,12 +12,6 @@ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt index 2e199b24..34061388 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt @@ -7,13 +7,13 @@ import app.meetacy.sdk.types.location.Location import app.meetacy.sdk.types.meeting.Meeting public class CreateMeetingRequest( - public val token: Token, + public override val token: Token, public val title: String, public val date: Date, public val location: Location, public val description: String?, public val visibility: Meeting.Visibility, public val fileId: FileId? = null -) : MeetacyRequest { +) : MeetacyRequest, MeRequestWithToken { public data class Response(val meeting: Meeting) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt index 1f415659..8d75b320 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt @@ -6,4 +6,4 @@ import app.meetacy.sdk.types.user.UserId public data class DeleteFriendRequest( val token: Token, val friendId: UserId -) : SimpleMeetacyRequest +) : SimpleMeetacyRequest \ No newline at end of file diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt index 1376fd9b..85794d28 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GenerateAuthRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token public data class GenerateAuthRequest( val nickname: String -) : MeetacyRequest { +) : MeetacyRequest, TokenProviderEmpty { public data class Response(val token: Token) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt index 85ac33fb..1847d5a6 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt @@ -7,9 +7,9 @@ import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse public data class ListMeetingsHistoryRequest( - val token: Token, + override val token: Token, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest { +) : MeetacyRequest, MeRequestWithToken { public data class Response(val paging: PagingResponse) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt new file mode 100644 index 00000000..9ba34161 --- /dev/null +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt @@ -0,0 +1,11 @@ +package app.meetacy.sdk.engine.requests + +import app.meetacy.sdk.types.auth.Token + +public sealed interface MeRequestWithToken : MeetacyRequest { + public val token: Token +} + +public interface TokenProviderEmpty : MeetacyRequest + + From 5f4fe8d6eedaf413bbe3e8572889350036f8aefa Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sat, 21 Oct 2023 23:38:12 +0300 Subject: [PATCH 29/42] fix(#76-support-auth-header): fix build --- .../kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt | 1 + .../app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt index 62e89fa8..c831e2c0 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt @@ -98,6 +98,7 @@ public class KtorMeetacyEngine( // not yet supported is LinkEmailRequest -> notSupported() is ConfirmEmailRequest -> notSupported() + is TokenProviderEmpty -> notSupported() } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index 24c2bc8a..cf0fb02a 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -86,7 +86,7 @@ internal class UsersEngine( header("Api-Version", apiVersion.int.toString()) }.body() - val user = Json.decodeFromString(string).result + val user = Json.decodeFromString(string).result return EditUserRequest.Response(user = user.mapToSelfUser()) } From 22ac94b8a710a6d50dde375413174316f54c646f Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sun, 22 Oct 2023 21:58:43 +0300 Subject: [PATCH 30/42] WIP(#76-support-auth-header): meeting independence was added --- .../requests/extencion/RequestBodyPost.kt | 5 +- .../ktor/requests/meetings/MeetingsEngine.kt | 133 +++++++++--------- .../notifications/NotificationsEngine.kt | 2 +- .../engine/requests/CreateMeetingRequest.kt | 2 +- .../sdk/engine/requests/EditMeetingRequest.kt | 4 +- .../sdk/engine/requests/GetMeetingRequest.kt | 4 +- .../requests/ListActiveMeetingsRequest.kt | 5 +- .../ListMeetingParticipantsRequest.kt | 5 +- .../requests/ListMeetingsHistoryRequest.kt | 2 +- .../engine/requests/ListMeetingsMapRequest.kt | 4 +- .../requests/ListPastMeetingsRequest.kt | 5 +- .../sdk/engine/requests/MeetacyRequest.kt | 1 + .../requests/ParticipateMeetingRequest.kt | 4 +- .../sdk/engine/requests/RequestRepository.kt | 2 +- 14 files changed, 94 insertions(+), 84 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt index 6d077244..e2fde7e6 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt @@ -1,7 +1,6 @@ package app.meetacy.sdk.engine.ktor.requests.extencion -import app.meetacy.sdk.engine.requests.MeRequestWithToken -import app.meetacy.sdk.engine.requests.MeetacyRequest +import app.meetacy.sdk.engine.requests.MeetacyRequestWithToken import app.meetacy.sdk.engine.requests.TokenProviderEmpty import io.ktor.client.* import io.ktor.client.call.* @@ -10,7 +9,7 @@ import io.ktor.http.* import io.ktor.http.content.* import kotlinx.serialization.json.JsonObject -public suspend inline fun > post( +public suspend inline fun > post( urlString: String, jsonObject: JsonObject, httpClient: HttpClient, diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index 9ccc9a73..dc2aa091 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -7,15 +7,14 @@ import app.meetacy.sdk.engine.ktor.response.models.CreateMeetingResponse import app.meetacy.sdk.engine.ktor.response.models.EditMeetingResponse import app.meetacy.sdk.engine.ktor.response.models.ListMeetingsResponse import app.meetacy.sdk.engine.requests.* -import app.meetacy.sdk.engine.requests.CreateMeetingRequest -import app.meetacy.sdk.engine.requests.EditMeetingRequest -import app.meetacy.sdk.engine.requests.ListMeetingParticipantsRequest import app.meetacy.sdk.types.optional.ifPresent import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.url.Url import dev.icerock.moko.network.generated.apis.MeetingsApiImpl -import dev.icerock.moko.network.generated.models.* +import dev.icerock.moko.network.generated.models.ListMapMeetingsResponse +import dev.icerock.moko.network.generated.models.ListMeetingParticipantsResponse +import dev.icerock.moko.network.generated.models.User import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.request.* @@ -25,9 +24,8 @@ import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import kotlinx.serialization.json.putJsonObject -import dev.icerock.moko.network.generated.models.ListMeetingParticipantsRequest as GeneratedListMeetingParticipantsRequest -import dev.icerock.moko.network.generated.models.Meeting as GeneratedMeeting import app.meetacy.sdk.engine.ktor.response.models.Meeting as LolMeeting +import dev.icerock.moko.network.generated.models.Meeting as GeneratedMeeting internal class MeetingsEngine( private val baseUrl: Url, @@ -61,18 +59,20 @@ internal class MeetingsEngine( suspend fun listActiveMeetings( request: ListActiveMeetingsRequest ): ListActiveMeetingsRequest.Response = with(request) { - val response = base.meetingsHistoryActiveGet( - listMeetingsRequest = ListMeetingsRequest( - amount = amount.int, - pagingId = pagingId?.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "meetings" / "history" / "active" + + val jsonObject = buildJsonObject { + put("amount", amount.int) + put("pagingId", pagingId?.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = Json.decodeFromString(string).result val paging = PagingResponse( - nextPagingId = response.result.nextPagingId?.let(::PagingId), - data = response.result.data.map(GeneratedMeeting::mapToMeeting) + nextPagingId = response.nextPagingId?.let(::PagingId), + data = response.data.map(LolMeeting::mapToMeeting) ) return ListActiveMeetingsRequest.Response(paging) @@ -81,18 +81,20 @@ internal class MeetingsEngine( suspend fun listPastMeetings( request: ListPastMeetingsRequest ): ListPastMeetingsRequest.Response = with(request) { - val response = base.meetingsHistoryPastGet( - listMeetingsRequest = ListMeetingsRequest( - amount = amount.int, - pagingId = pagingId?.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "meetings" / "history" / "past" + + val jsonObject = buildJsonObject { + put("amount", amount.int) + put("pagingId", pagingId?.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = Json.decodeFromString(string).result val paging = PagingResponse( - nextPagingId = response.result.nextPagingId?.let(::PagingId), - data = response.result.data.map(GeneratedMeeting::mapToMeeting) + nextPagingId = response.nextPagingId?.let(::PagingId), + data = response.data.map(LolMeeting::mapToMeeting) ) return ListPastMeetingsRequest.Response(paging) @@ -101,18 +103,19 @@ internal class MeetingsEngine( suspend fun listMeetingsMap( request: ListMeetingsMapRequest ): ListMeetingsMapRequest.Response = with (request) { - val response = base.meetingsMapListPost( - listMapMeetingsRequest = ListMapMeetingsRequest( - location = Location( - latitude = location.latitude, - longitude = location.longitude - ) - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "meetings" / "map" / "list" - val data = response.result.map(GeneratedMeeting::mapToMeeting) + val jsonObject = buildJsonObject { + putJsonObject("location") { + put("latitude", location.latitude) + put("longitude", location.longitude) + } + } + val string = post(url.string, jsonObject, httpClient, request) + + val response = Json.decodeFromString(string).result + + val data = response.map(GeneratedMeeting::mapToMeeting) return ListMeetingsMapRequest.Response(data) } @@ -187,7 +190,7 @@ internal class MeetingsEngine( ) ) header("Authorization", token.string) - header("Api-Version", request.apiVersion.int.toString()) + header("Api-Version", apiVersion.int.toString()) }.body() val meeting = Json.decodeFromString(string).result @@ -198,43 +201,47 @@ internal class MeetingsEngine( suspend fun listMeetingParticipants( request: ListMeetingParticipantsRequest ): ListMeetingParticipantsRequest.Response { - val response = base.meetingsParticipantsListPost( - listMeetingParticipantsRequest = GeneratedListMeetingParticipantsRequest( - amount = request.amount.int, - meetingId = request.meetingId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "meetings" / "participants" / "list" + + val jsonObject = buildJsonObject { + put("amount", request.amount.int) + put("pagingId", request.pagingId?.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = Json.decodeFromString(string).result val paging = PagingResponse( - data = response.result.data.map(User::mapToUser), - nextPagingId = response.result.nextPagingId?.let(::PagingId) + data = response.data.map(User::mapToUser), + nextPagingId = response.nextPagingId?.let(::PagingId) ) return ListMeetingParticipantsRequest.Response(paging) } suspend fun participateMeeting(request: ParticipateMeetingRequest) { - base.meetingsParticipatePost( - accessMeetingIdRequest = AccessMeetingIdRequest( - meetingId = request.meetingId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "meetings" / "participate" + + val jsonObject = buildJsonObject { + put("meetingId", request.meetingId.string) + } + + post(url.string, jsonObject, httpClient, request) } suspend fun getMeeting(request: GetMeetingRequest): GetMeetingRequest.Response { - val response = base.meetingsGetPost( - accessMeetingIdRequest = AccessMeetingIdRequest( - meetingId = request.meetingId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "meetings" / "get" + + val jsonObject = buildJsonObject { + put("meetingId", request.meetingId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = Json.decodeFromString(string).result - val meeting = response.result.mapToMeeting() + val meeting = response.mapToMeeting() return GetMeetingRequest.Response(meeting) } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt index 0189d0b8..f7c9c627 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt @@ -45,7 +45,7 @@ internal class NotificationsEngine( lastNotificationId = lastNotificationId.string ), apiVersion = apiVersion.int.toString(), - authorization = request.token.string + authorization = token.string ) } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt index 34061388..ca8130ec 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateMeetingRequest.kt @@ -14,6 +14,6 @@ public class CreateMeetingRequest( public val description: String?, public val visibility: Meeting.Visibility, public val fileId: FileId? = null -) : MeetacyRequest, MeRequestWithToken { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val meeting: Meeting) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditMeetingRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditMeetingRequest.kt index 7bf66f50..28cef4bc 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditMeetingRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditMeetingRequest.kt @@ -9,7 +9,7 @@ import app.meetacy.sdk.types.meeting.MeetingId import app.meetacy.sdk.types.optional.Optional public data class EditMeetingRequest( - public val token: Token, + public override val token: Token, public val meetingId: MeetingId, public val title: Optional, public val description: Optional, @@ -17,6 +17,6 @@ public data class EditMeetingRequest( public val date: Optional, public val avatarId: Optional, public val visibility: Optional -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val meeting: Meeting) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeetingRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeetingRequest.kt index 1d329e2d..57175ea5 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeetingRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeetingRequest.kt @@ -5,8 +5,8 @@ import app.meetacy.sdk.types.meeting.Meeting import app.meetacy.sdk.types.meeting.MeetingId public data class GetMeetingRequest( - val token: Token, + override val token: Token, val meetingId: MeetingId -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val meeting: Meeting) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListActiveMeetingsRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListActiveMeetingsRequest.kt index d8010f1d..2b3725c1 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListActiveMeetingsRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListActiveMeetingsRequest.kt @@ -7,9 +7,10 @@ import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse public data class ListActiveMeetingsRequest( - val token: Token, + override val token: Token, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest { +) : MeetacyRequest, + MeetacyRequestWithToken { public data class Response(val paging: PagingResponse) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingParticipantsRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingParticipantsRequest.kt index dcb7c284..c8e062da 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingParticipantsRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingParticipantsRequest.kt @@ -8,10 +8,11 @@ import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.user.User public data class ListMeetingParticipantsRequest( - val token: Token, + override val token: Token, val meetingId: MeetingId, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest { +) : MeetacyRequest, + MeetacyRequestWithToken { public data class Response(val paging: PagingResponse) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt index 1847d5a6..ab4b3f22 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsHistoryRequest.kt @@ -10,6 +10,6 @@ public data class ListMeetingsHistoryRequest( override val token: Token, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest, MeRequestWithToken { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val paging: PagingResponse) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsMapRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsMapRequest.kt index 35449a8e..b0c82a38 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsMapRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListMeetingsMapRequest.kt @@ -5,8 +5,8 @@ import app.meetacy.sdk.types.location.Location import app.meetacy.sdk.types.meeting.Meeting public data class ListMeetingsMapRequest( - val token: Token, + override val token: Token, val location: Location -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val meetings: List) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListPastMeetingsRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListPastMeetingsRequest.kt index 8ec527b3..9d25cbe0 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListPastMeetingsRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListPastMeetingsRequest.kt @@ -7,9 +7,10 @@ import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse public data class ListPastMeetingsRequest( - val token: Token, + override val token: Token, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest { +) : MeetacyRequest, + MeetacyRequestWithToken { public data class Response(val paging: PagingResponse) } \ No newline at end of file diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/MeetacyRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/MeetacyRequest.kt index c5d7340c..337c94ef 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/MeetacyRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/MeetacyRequest.kt @@ -7,3 +7,4 @@ public sealed interface MeetacyRequest { } public typealias SimpleMeetacyRequest = MeetacyRequest +public typealias SimpleMeetacyRequestWithToken = MeetacyRequestWithToken diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ParticipateMeetingRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ParticipateMeetingRequest.kt index cf1f0fb8..2ae95354 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ParticipateMeetingRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ParticipateMeetingRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.meeting.MeetingId public data class ParticipateMeetingRequest( - val token: Token, + override val token: Token, val meetingId: MeetingId -) : SimpleMeetacyRequest +) : SimpleMeetacyRequest, SimpleMeetacyRequestWithToken diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt index 9ba34161..fc5c032d 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/RequestRepository.kt @@ -2,7 +2,7 @@ package app.meetacy.sdk.engine.requests import app.meetacy.sdk.types.auth.Token -public sealed interface MeRequestWithToken : MeetacyRequest { +public sealed interface MeetacyRequestWithToken : MeetacyRequest { public val token: Token } From bd98784603924be766226d16e6eb628625c354a1 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sun, 22 Oct 2023 22:17:23 +0300 Subject: [PATCH 31/42] fix(#76-support-auth-header): change name header auth --- .../sdk/engine/ktor/requests/extencion/RequestBodyPost.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt index e2fde7e6..5d1ce93a 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt @@ -22,7 +22,7 @@ public suspend inline fun > post( contentType = ContentType.Application.Json ) ) - header("Token", request.token) + header("Authorization", request.token) header("Api-Version", request.apiVersion.toString()) }.body() } From ae91e9034098a0f68efe3c039570865a15fa37c5 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sun, 22 Oct 2023 22:40:51 +0300 Subject: [PATCH 32/42] fix(#76-support-auth-header): change type of token --- .../sdk/engine/ktor/requests/extencion/RequestBodyPost.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt index 5d1ce93a..c2370ef6 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt @@ -22,8 +22,8 @@ public suspend inline fun > post( contentType = ContentType.Application.Json ) ) - header("Authorization", request.token) - header("Api-Version", request.apiVersion.toString()) + header("Authorization", request.token.string) + header("Api-Version", request.apiVersion.int.toString()) }.body() } @@ -40,6 +40,6 @@ public suspend inline fun > postWithoutToken( contentType = ContentType.Application.Json ) ) - header("Api-Version", request.apiVersion.toString()) + header("Api-Version", request.apiVersion.int.toString()) }.body() } From 3c4ca81293421a7ba9468166c8d94f0ffa5e8983 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sun, 22 Oct 2023 23:14:55 +0300 Subject: [PATCH 33/42] fix(#76-support-auth-header): change name of field avatarId --- .../engine/ktor/requests/extencion/RequestBodyPost.kt | 6 +++--- .../engine/ktor/requests/meetings/MeetingsEngine.kt | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt index c2370ef6..e4a449c9 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt @@ -14,8 +14,8 @@ public suspend inline fun > post( jsonObject: JsonObject, httpClient: HttpClient, request: R -): String { - return httpClient.post(urlString) { +): String = + httpClient.post(urlString) { setBody( TextContent( text = jsonObject.toString(), @@ -25,7 +25,7 @@ public suspend inline fun > post( header("Authorization", request.token.string) header("Api-Version", request.apiVersion.int.toString()) }.body() -} + public suspend inline fun > postWithoutToken( url: String, diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index dc2aa091..a8a43984 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -40,7 +40,7 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "history" / "list" val jsonObject = buildJsonObject { - put("amount", amount.int) + put("amount", amount.int.toString()) put("pagingId", pagingId?.string) } @@ -62,7 +62,7 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "history" / "active" val jsonObject = buildJsonObject { - put("amount", amount.int) + put("amount", amount.int.toString()) put("pagingId", pagingId?.string) } @@ -84,7 +84,7 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "history" / "past" val jsonObject = buildJsonObject { - put("amount", amount.int) + put("amount", amount.int.toString()) put("pagingId", pagingId?.string) } @@ -127,14 +127,14 @@ internal class MeetingsEngine( val jsonObject = buildJsonObject { put("title", title) + put("description", description) put("date", date.iso8601) putJsonObject("location") { put("latitude", location.latitude) put("longitude", location.longitude) } - put("description", description) put("visibility", visibility.name.lowercase()) - put("fileId", fileId?.string) + put("avatarId", fileId?.string) } val string = httpClient.post(url.string) { From 38105a4b1be7df56feabdce0174aa4b2e3c9704b Mon Sep 17 00:00:00 2001 From: y9Kap Date: Mon, 23 Oct 2023 00:00:48 +0300 Subject: [PATCH 34/42] fix(#76-support-auth-header): add meetingId field to request --- .../engine/ktor/requests/meetings/MeetingsEngine.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index a8a43984..a3a55de9 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -66,7 +66,15 @@ internal class MeetingsEngine( put("pagingId", pagingId?.string) } - val string = post(url.string, jsonObject, httpClient, request) + val string = httpClient.get(url.string) { + setBody( + TextContent( + text = jsonObject.toString(), + contentType = ContentType.Application.Json + ) + ) + header("Api-Version", request.apiVersion.int.toString()) + }.body() val response = Json.decodeFromString(string).result @@ -204,6 +212,7 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "participants" / "list" val jsonObject = buildJsonObject { + put("meetingId", request.meetingId.string) put("amount", request.amount.int) put("pagingId", request.pagingId?.string) } From 3dd5904cbeab8592841c3aba6153e1d11e91a3e5 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Mon, 23 Oct 2023 00:25:10 +0300 Subject: [PATCH 35/42] fix(#76-support-auth-header): add auth header to request --- .../meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index a3a55de9..b75b885c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -73,6 +73,7 @@ internal class MeetingsEngine( contentType = ContentType.Application.Json ) ) + header("Authorization", request.token.string) header("Api-Version", request.apiVersion.int.toString()) }.body() From cb6e4469f9476c62938d51e11dab13f3fac08b86 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Mon, 23 Oct 2023 01:46:36 +0300 Subject: [PATCH 36/42] WIP(#76-support-auth-header): friends engine is independence --- .../ktor/requests/friends/FriendsEngine.kt | 83 ++++++++++--------- .../ktor/requests/meetings/MeetingsEngine.kt | 37 +++------ .../sdk/engine/requests/AddFriendRequest.kt | 4 +- .../engine/requests/DeleteFriendRequest.kt | 4 +- .../sdk/engine/requests/ListFriendsRequest.kt | 4 +- 5 files changed, 59 insertions(+), 73 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index 5efcc941..80e19a93 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -6,21 +6,22 @@ import app.meetacy.sdk.engine.ktor.handleRSocketExceptions import app.meetacy.sdk.engine.ktor.mapToLocation import app.meetacy.sdk.engine.ktor.mapToRegularUser import app.meetacy.sdk.engine.ktor.mapToUser +import app.meetacy.sdk.engine.ktor.requests.extencion.post +import app.meetacy.sdk.engine.ktor.response.models.ListFriendsResponse +import app.meetacy.sdk.engine.ktor.response.models.Location +import app.meetacy.sdk.engine.ktor.response.models.StatusTrueResponse +import app.meetacy.sdk.engine.ktor.response.models.User import app.meetacy.sdk.engine.requests.AddFriendRequest import app.meetacy.sdk.engine.requests.DeleteFriendRequest import app.meetacy.sdk.engine.requests.EmitFriendsLocationRequest import app.meetacy.sdk.engine.requests.ListFriendsRequest import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.datetime.DateTime -import app.meetacy.sdk.types.location.Location import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.url.Url import app.meetacy.sdk.types.user.RegularUser import app.meetacy.sdk.types.user.UserLocationSnapshot -import dev.icerock.moko.network.generated.apis.FriendsApi -import dev.icerock.moko.network.generated.apis.FriendsApiImpl -import dev.icerock.moko.network.generated.models.AccessFriendRequest import io.ktor.client.* import io.rsocket.kotlin.ktor.client.rSocket import io.rsocket.kotlin.payload.Payload @@ -33,50 +34,52 @@ import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put -import dev.icerock.moko.network.generated.models.ListFriendsRequest as GeneratedListFriendsRequest -import dev.icerock.moko.network.generated.models.Location as GeneratedLocation -import dev.icerock.moko.network.generated.models.User as GeneratedUser internal class FriendsEngine( private val baseUrl: Url, private val httpClient: HttpClient, private val json: Json ) { - private val base: FriendsApi = FriendsApiImpl(baseUrl.string, httpClient, json) - - suspend fun add(request: AddFriendRequest) { - base.friendsAddPost( - accessFriendRequest = AccessFriendRequest( - friendId = request.friendId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + + suspend fun add(request: AddFriendRequest): StatusTrueResponse { + val url = baseUrl / "friends" / "add" + + val jsonObject = buildJsonObject { + put("friendId", request.friendId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + return json.decodeFromString(string) } - suspend fun delete(request: DeleteFriendRequest) { - base.friendsDeletePost( - accessFriendRequest = AccessFriendRequest( - friendId = request.friendId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + suspend fun delete(request: DeleteFriendRequest): StatusTrueResponse { + val url = baseUrl / "friends" / "delete" + + val jsonObject = buildJsonObject { + put("friendId", request.friendId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + return json.decodeFromString(string) } suspend fun list(request: ListFriendsRequest): ListFriendsRequest.Response { - val response = base.friendsListPost( - listFriendsRequest = GeneratedListFriendsRequest( - amount = request.amount.int, - pagingId = request.pagingId?.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "friends" / "list" + + val jsonObject = buildJsonObject { + put("amount", request.amount.int.toString()) + put("pagingId", request.pagingId?.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = Json.decodeFromString(string).result val paging = PagingResponse( - nextPagingId = response.result.nextPagingId?.let(::PagingId), - data = response.result.data.map { user -> user.mapToRegularUser() } + nextPagingId = response.nextPagingId?.let(::PagingId), + data = response.data.map { user -> user.mapToRegularUser() } ) return ListFriendsRequest.Response(paging) @@ -112,7 +115,7 @@ private fun EmitFriendsLocationRequest.encodeToPayload(json: Json): Payload = bu data(json.encodeToString(initObject)) } -private fun Location.encodeToPayload(): Payload = buildPayload { +private fun app.meetacy.sdk.types.location.Location.encodeToPayload(): Payload = buildPayload { val locationString = buildJsonObject { val `object` = buildJsonObject { put("latitude", latitude) @@ -125,14 +128,14 @@ private fun Location.encodeToPayload(): Payload = buildPayload { } @Serializable -private data class UserLocationSnapshotSerializable( - val user: GeneratedUser, - val location: GeneratedLocation, +private data class LolUserLocationSnapshotSerializable( + val user: User, + val location: Location, // TODO: изменить название класса после удаления зависимостей val capturedAt: String ) private fun Payload.decodeToUserLocationSnapshot(json: Json): UserLocationSnapshot { - val deserialized = json.decodeFromString(data.readText()) + val deserialized = json.decodeFromString(data.readText()) return UserLocationSnapshot( user = deserialized.user.mapToUser() as RegularUser, diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index b75b885c..fe6eab26 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -6,12 +6,12 @@ import app.meetacy.sdk.engine.ktor.requests.extencion.post import app.meetacy.sdk.engine.ktor.response.models.CreateMeetingResponse import app.meetacy.sdk.engine.ktor.response.models.EditMeetingResponse import app.meetacy.sdk.engine.ktor.response.models.ListMeetingsResponse +import app.meetacy.sdk.engine.ktor.response.models.StatusTrueResponse import app.meetacy.sdk.engine.requests.* import app.meetacy.sdk.types.optional.ifPresent import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.url.Url -import dev.icerock.moko.network.generated.apis.MeetingsApiImpl import dev.icerock.moko.network.generated.models.ListMapMeetingsResponse import dev.icerock.moko.network.generated.models.ListMeetingParticipantsResponse import dev.icerock.moko.network.generated.models.User @@ -32,7 +32,6 @@ internal class MeetingsEngine( private val httpClient: HttpClient, json: Json ) { - private val base = MeetingsApiImpl(baseUrl.string, httpClient, json) suspend fun listMeetingsHistory( request: ListMeetingsHistoryRequest @@ -46,11 +45,11 @@ internal class MeetingsEngine( val string = post(url.string, jsonObject, httpClient, request) - val response = Json.decodeFromString(string) + val response = Json.decodeFromString(string).result val paging = PagingResponse( - nextPagingId = response.result.nextPagingId?.let(::PagingId), - data = response.result.data.map(LolMeeting::mapToMeeting) + nextPagingId = response.nextPagingId?.let(::PagingId), + data = response.data.map(LolMeeting::mapToMeeting) ) return ListMeetingsHistoryRequest.Response(paging) @@ -146,16 +145,7 @@ internal class MeetingsEngine( put("avatarId", fileId?.string) } - val string = httpClient.post(url.string) { - setBody( - TextContent( - text = jsonObject.toString(), - contentType = ContentType.Application.Json - ) - ) - header("Authorization", token.string) - header("Api-Version", request.apiVersion.int.toString()) - }.body() + val string = post(url.string, jsonObject, httpClient, request) val meeting = Json.decodeFromString(string).result @@ -191,16 +181,7 @@ internal class MeetingsEngine( } } - val string = httpClient.post(url.string) { - setBody( - TextContent( - text = jsonObject.toString(), - contentType = ContentType.Application.Json - ) - ) - header("Authorization", token.string) - header("Api-Version", apiVersion.int.toString()) - }.body() + val string = post(url.string, jsonObject, httpClient, request) val meeting = Json.decodeFromString(string).result @@ -230,14 +211,16 @@ internal class MeetingsEngine( return ListMeetingParticipantsRequest.Response(paging) } - suspend fun participateMeeting(request: ParticipateMeetingRequest) { + suspend fun participateMeeting(request: ParticipateMeetingRequest): StatusTrueResponse { val url = baseUrl / "meetings" / "participate" val jsonObject = buildJsonObject { put("meetingId", request.meetingId.string) } - post(url.string, jsonObject, httpClient, request) + val string = post(url.string, jsonObject, httpClient, request) + + return Json.decodeFromString(string) } suspend fun getMeeting(request: GetMeetingRequest): GetMeetingRequest.Response { diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AddFriendRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AddFriendRequest.kt index 69703126..e2e78de4 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AddFriendRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AddFriendRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.user.UserId public data class AddFriendRequest( - val token: Token, + override val token: Token, val friendId: UserId -) : SimpleMeetacyRequest +) : SimpleMeetacyRequest, SimpleMeetacyRequestWithToken diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt index 8d75b320..29e12636 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DeleteFriendRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.user.UserId public data class DeleteFriendRequest( - val token: Token, + override val token: Token, val friendId: UserId -) : SimpleMeetacyRequest \ No newline at end of file +) : SimpleMeetacyRequest, SimpleMeetacyRequestWithToken \ No newline at end of file diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListFriendsRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListFriendsRequest.kt index 15c3b383..fd640302 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListFriendsRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListFriendsRequest.kt @@ -7,9 +7,9 @@ import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.user.RegularUser public data class ListFriendsRequest( - val token: Token, + override val token: Token, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val paging: PagingResponse) } From 414977e793e6543e8dcd85011ba85048b16da5c3 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Mon, 23 Oct 2023 09:37:32 +0300 Subject: [PATCH 37/42] WIP(#76-support-auth-header): invitations independence in progress --- .../sdk/engine/ktor/requests/invitations/InvitationsEngine.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt index 0e4cb690..79c17e15 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt @@ -69,4 +69,5 @@ internal class InvitationsEngine( authorization = request.token.string ) } + } From c315e3d35972746d8c726128325d6e9913cf6b11 Mon Sep 17 00:00:00 2001 From: y9kap Date: Mon, 23 Oct 2023 12:14:39 +0300 Subject: [PATCH 38/42] feat(#76-support-auth-header): remove moko network dependency --- .../app/meetacy/sdk/engine/ktor/Mappers.kt | 111 +++--------------- .../engine/ktor/requests/files/FilesEngine.kt | 2 +- .../ktor/requests/friends/FriendsEngine.kt | 26 ++-- .../requests/invitations/InvitationsEngine.kt | 94 ++++++++------- .../ktor/requests/meetings/MeetingsEngine.kt | 66 ++++++----- .../notifications/NotificationsEngine.kt | 50 ++++---- .../ktor/requests/updates/UpdatesEngine.kt | 9 +- .../engine/ktor/requests/users/UsersEngine.kt | 63 ++++++---- .../requests/AcceptInvitationRequest.kt | 4 +- .../requests/CancelInvitationRequest.kt | 4 +- .../requests/CreateInvitationRequest.kt | 6 +- .../engine/requests/DenyInvitationRequest.kt | 4 +- .../sdk/engine/requests/GetMeRequest.kt | 4 +- .../sdk/engine/requests/GetUserRequest.kt | 4 +- .../requests/ListNotificationsRequest.kt | 4 +- .../requests/ReadNotificationRequest.kt | 4 +- .../requests/UsernameAvailableRequest.kt | 2 +- 17 files changed, 200 insertions(+), 257 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt index 35019d0e..27958966 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/Mappers.kt @@ -15,27 +15,17 @@ import app.meetacy.sdk.types.meeting.MeetingId import app.meetacy.sdk.types.notification.Notification import app.meetacy.sdk.types.notification.NotificationId import app.meetacy.sdk.types.user.* -import dev.icerock.moko.network.generated.models.Notification.Type.MEETING_INVITATION -import dev.icerock.moko.network.generated.models.Notification.Type.SUBSCRIPTION -import dev.icerock.moko.network.generated.models.Invitation as GeneratedInvitation -import dev.icerock.moko.network.generated.models.Location as GeneratedLocation -import dev.icerock.moko.network.generated.models.Meeting as GeneratedMeeting -import dev.icerock.moko.network.generated.models.Notification as GeneratedNotification -import dev.icerock.moko.network.generated.models.User as GeneratedUser -import app.meetacy.sdk.engine.ktor.response.models.Meeting as LolMeeting -import app.meetacy.sdk.engine.ktor.response.models.User as LolUser -import app.meetacy.sdk.engine.ktor.response.models.Notification as LolNotification -import app.meetacy.sdk.engine.ktor.response.models.Invitation as LolInvitation -import app.meetacy.sdk.engine.ktor.response.models.Location as LolLocation +import app.meetacy.sdk.engine.ktor.response.models.Invitation as ModelInvitation +import app.meetacy.sdk.engine.ktor.response.models.Location as ModelLocation +import app.meetacy.sdk.engine.ktor.response.models.Meeting as ModelMeeting +import app.meetacy.sdk.engine.ktor.response.models.Notification as ModelNotification +import app.meetacy.sdk.engine.ktor.response.models.User as ModelUser -internal fun GeneratedUser.mapToSelfUser(): SelfUser = mapToUser() as SelfUser -internal fun GeneratedUser.mapToRegularUser(): RegularUser = mapToUser() as RegularUser - -internal fun LolUser.mapToSelfUser(): SelfUser = mapToUser() as SelfUser -internal fun LolUser.mapToRegularUser(): RegularUser = mapToUser() as RegularUser +internal fun ModelUser.mapToSelfUser(): SelfUser = mapToUser() as SelfUser +internal fun ModelUser.mapToRegularUser(): RegularUser = mapToUser() as RegularUser @OptIn(UnsafeConstructor::class) -internal fun GeneratedUser.mapToUser(): User = if (isSelf) { +internal fun ModelUser.mapToUser(): User = if (isSelf) { SelfUser( id = UserId(id), nickname = nickname, @@ -54,39 +44,7 @@ internal fun GeneratedUser.mapToUser(): User = if (isSelf) { ) } -@OptIn(UnsafeConstructor::class) -internal fun LolUser.mapToUser(): User = if (isSelf) { - SelfUser( - id = UserId(id), - nickname = nickname, - email = email?.let(::Email), - emailVerified = emailVerified ?: error("Self user must always return emailVerified parameter"), - username = username?.let(::Username), - avatarId = avatarId?.let(::FileId) - ) -} else { - RegularUser( - id = UserId(id), - nickname = nickname, - avatarId = avatarId?.let(::FileId), - username = username?.let(::Username), - relationship = relationship?.mapToRelationship() ?: error("Regular user should always return relationship parameter") - ) -} - -internal fun GeneratedInvitation.toInvitation(): Invitation = Invitation( - id = identity.let(::InvitationId), - meeting = meeting.mapToMeeting(), - invitedUser = invitedUser.mapToUser(), - inviterUser = inviterUser.mapToUser(), - isAccepted = when (isAccepted) { - null -> AcceptationState.Waiting - true -> AcceptationState.Accepted - false -> AcceptationState.Declined - } -) - -internal fun LolInvitation.toInvitation(): Invitation = Invitation( +internal fun ModelInvitation.toInvitation(): Invitation = Invitation( id = identity.let(::InvitationId), meeting = meeting.mapToMeeting(), invitedUser = invitedUser.mapToUser(), @@ -106,7 +64,7 @@ internal fun String.mapToRelationship(): Relationship? = when(this) { else -> null } -internal fun LolMeeting.mapToMeeting(): Meeting = Meeting( +internal fun ModelMeeting.mapToMeeting(): Meeting = Meeting( id = MeetingId(id), creator = creator.mapToUser(), date = Date(date), @@ -118,57 +76,18 @@ internal fun LolMeeting.mapToMeeting(): Meeting = Meeting( description = description, participantsCount = participantsCount, isParticipating = isParticipating, - previewParticipants = previewParticipants.map(LolUser::mapToUser), + previewParticipants = previewParticipants.map(ModelUser::mapToUser), avatarId = avatarId?.let(::FileId), visibility = when (visibility) { - LolMeeting.Visibility.PUBLIC -> Meeting.Visibility.Public - LolMeeting.Visibility.PRIVATE -> Meeting.Visibility.Private + ModelMeeting.Visibility.PUBLIC -> Meeting.Visibility.Public + ModelMeeting.Visibility.PRIVATE -> Meeting.Visibility.Private } ) -internal fun GeneratedMeeting.mapToMeeting(): Meeting = Meeting( - id = MeetingId(id), - creator = creator.mapToUser(), - date = Date(date), - location = Location( - location.latitude, - location.longitude - ), - title = title, - description = description, - participantsCount = participantsCount, - isParticipating = isParticipating, - previewParticipants = previewParticipants.map(GeneratedUser::mapToUser), - avatarId = avatarId?.let(::FileId), - visibility = when (visibility) { - GeneratedMeeting.Visibility.PUBLIC -> Meeting.Visibility.Public - GeneratedMeeting.Visibility.PRIVATE -> Meeting.Visibility.Private - } -) - -internal fun GeneratedLocation.mapToLocation(): Location = - Location(latitude, longitude) - -internal fun GeneratedNotification.mapToNotification(): Notification = when (this.type) { - SUBSCRIPTION -> Notification.Subscription( - id = NotificationId(id), - isNew = isNew, - date = Date(date), - subscriber = subscriber!!.mapToRegularUser() - ) - MEETING_INVITATION -> Notification.Invitation( - id = NotificationId(id), - isNew = isNew, - date = Date(date), - meeting = meeting!!.mapToMeeting(), - inviter = inviter!!.mapToRegularUser() - ) -} - -internal fun LolLocation.mapToLocation(): Location = +internal fun ModelLocation.mapToLocation(): Location = Location(latitude, longitude) -internal fun LolNotification.mapToNotification(): Notification = when (this.type) { +internal fun ModelNotification.mapToNotification(): Notification = when (this.type) { app.meetacy.sdk.engine.ktor.response.models.Notification.Type.SUBSCRIPTION -> Notification.Subscription( id = NotificationId(id), isNew = isNew, diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt index 8cce8109..16b72061 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/files/FilesEngine.kt @@ -1,5 +1,6 @@ package app.meetacy.sdk.engine.ktor.requests.files +import app.meetacy.sdk.engine.ktor.response.models.GenerateIdentityResponse import app.meetacy.sdk.engine.requests.GetFileRequest import app.meetacy.sdk.engine.requests.UploadFileRequest import app.meetacy.sdk.files.DownloadableFile @@ -10,7 +11,6 @@ import app.meetacy.sdk.io.asMeetacyInput import app.meetacy.sdk.types.file.FileId import app.meetacy.sdk.types.url.Url import app.meetacy.sdk.types.url.parametersOf -import dev.icerock.moko.network.generated.models.GenerateIdentityResponse import io.ktor.client.* import io.ktor.client.request.* import io.ktor.client.request.forms.* diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt index 80e19a93..e6d72351 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/friends/FriendsEngine.kt @@ -8,15 +8,16 @@ import app.meetacy.sdk.engine.ktor.mapToRegularUser import app.meetacy.sdk.engine.ktor.mapToUser import app.meetacy.sdk.engine.ktor.requests.extencion.post import app.meetacy.sdk.engine.ktor.response.models.ListFriendsResponse -import app.meetacy.sdk.engine.ktor.response.models.Location +import app.meetacy.sdk.engine.ktor.response.models.Location as ModelLocation import app.meetacy.sdk.engine.ktor.response.models.StatusTrueResponse -import app.meetacy.sdk.engine.ktor.response.models.User +import app.meetacy.sdk.engine.ktor.response.models.User as ModelUser import app.meetacy.sdk.engine.requests.AddFriendRequest import app.meetacy.sdk.engine.requests.DeleteFriendRequest import app.meetacy.sdk.engine.requests.EmitFriendsLocationRequest import app.meetacy.sdk.engine.requests.ListFriendsRequest import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.datetime.DateTime +import app.meetacy.sdk.types.location.Location import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.url.Url @@ -36,13 +37,14 @@ import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put internal class FriendsEngine( - private val baseUrl: Url, + baseUrl: Url, private val httpClient: HttpClient, private val json: Json ) { + private val baseUrl = baseUrl / "friends" suspend fun add(request: AddFriendRequest): StatusTrueResponse { - val url = baseUrl / "friends" / "add" + val url = baseUrl / "add" val jsonObject = buildJsonObject { put("friendId", request.friendId.string) @@ -54,7 +56,7 @@ internal class FriendsEngine( } suspend fun delete(request: DeleteFriendRequest): StatusTrueResponse { - val url = baseUrl / "friends" / "delete" + val url = baseUrl / "delete" val jsonObject = buildJsonObject { put("friendId", request.friendId.string) @@ -66,7 +68,7 @@ internal class FriendsEngine( } suspend fun list(request: ListFriendsRequest): ListFriendsRequest.Response { - val url = baseUrl / "friends" / "list" + val url = baseUrl / "list" val jsonObject = buildJsonObject { put("amount", request.amount.int.toString()) @@ -86,7 +88,7 @@ internal class FriendsEngine( } suspend fun streamFriendsLocation(request: EmitFriendsLocationRequest) = handleRSocketExceptions(json) { - val url = baseUrl.replaceProtocolWithWebsocket() / "friends" / "location" / "stream" + val url = baseUrl.replaceProtocolWithWebsocket() / "location" / "stream" val socket = httpClient.rSocket( urlString = url.string, @@ -115,7 +117,7 @@ private fun EmitFriendsLocationRequest.encodeToPayload(json: Json): Payload = bu data(json.encodeToString(initObject)) } -private fun app.meetacy.sdk.types.location.Location.encodeToPayload(): Payload = buildPayload { +private fun Location.encodeToPayload(): Payload = buildPayload { val locationString = buildJsonObject { val `object` = buildJsonObject { put("latitude", latitude) @@ -128,14 +130,14 @@ private fun app.meetacy.sdk.types.location.Location.encodeToPayload(): Payload = } @Serializable -private data class LolUserLocationSnapshotSerializable( - val user: User, - val location: Location, // TODO: изменить название класса после удаления зависимостей +private data class ModelUserLocationSnapshotSerializable( + val user: ModelUser, + val location: ModelLocation, val capturedAt: String ) private fun Payload.decodeToUserLocationSnapshot(json: Json): UserLocationSnapshot { - val deserialized = json.decodeFromString(data.readText()) + val deserialized = json.decodeFromString(data.readText()) return UserLocationSnapshot( user = deserialized.user.mapToUser() as RegularUser, diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt index 79c17e15..2c818f4c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt @@ -1,73 +1,81 @@ package app.meetacy.sdk.engine.ktor.requests.invitations +import app.meetacy.sdk.engine.ktor.requests.extencion.post +import app.meetacy.sdk.engine.ktor.response.models.StatusTrueResponse import app.meetacy.sdk.engine.ktor.toInvitation -import app.meetacy.sdk.engine.requests.* +import app.meetacy.sdk.engine.requests.AcceptInvitationRequest +import app.meetacy.sdk.engine.requests.CancelInvitationRequest +import app.meetacy.sdk.engine.requests.CreateInvitationRequest +import app.meetacy.sdk.engine.requests.DenyInvitationRequest import app.meetacy.sdk.types.url.Url -import dev.icerock.moko.network.generated.apis.InvitationsApi -import dev.icerock.moko.network.generated.apis.InvitationsApiImpl import io.ktor.client.* import kotlinx.serialization.json.Json -import dev.icerock.moko.network.generated.models.AcceptInvitationRequest as GeneratedAcceptInvitationRequest -import dev.icerock.moko.network.generated.models.CancelInvitationRequest as GeneratedCancelInvitationRequest -import dev.icerock.moko.network.generated.models.CreateInvitationRequest as GeneratedCreateInvitationRequest -import dev.icerock.moko.network.generated.models.DenyInvitationRequest as GeneratedDenyInvitationRequest +import kotlinx.serialization.json.buildJsonObject +import kotlinx.serialization.json.put internal class InvitationsEngine( - private val baseUrl: Url, + baseUrl: Url, private val httpClient: HttpClient, - json: Json + private val json: Json ) { - private val base: InvitationsApi = InvitationsApiImpl(baseUrl.string, httpClient, json) - + private val baseUrl = baseUrl / "invitations" suspend fun create( request: CreateInvitationRequest ): CreateInvitationRequest.Response { - val response = base.invitationsCreatePost( - createInvitationRequest = GeneratedCreateInvitationRequest( - meetingId = request.meetingId.string, - userId = request.userId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ).result + val url = baseUrl / "create" + + val jsonObject = buildJsonObject { + put("meetingId", request.meetingId.string) + put("userId", request.userId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = json.decodeFromString(string).result return CreateInvitationRequest.Response(response.toInvitation()) } suspend fun accept( request: AcceptInvitationRequest - ) { - base.invitationsAcceptPost( - acceptInvitationRequest = GeneratedAcceptInvitationRequest( - id = request.invitationId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + ): StatusTrueResponse { + val url = baseUrl / "accept" + + val jsonObject = buildJsonObject { + put("invitationId", request.invitationId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + return json.decodeFromString(string) } suspend fun deny( request: DenyInvitationRequest - ) { - base.invitationsDenyPost( - denyInvitationRequest = GeneratedDenyInvitationRequest( - id = request.invitationId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + ): StatusTrueResponse { + val url = baseUrl / "deny" + + val jsonObject = buildJsonObject { + put("invitationId", request.invitationId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + return json.decodeFromString(string) } suspend fun cancel( request: CancelInvitationRequest - ) { - base.invitationsCancelPost( - cancelInvitationRequest = GeneratedCancelInvitationRequest( - id = request.invitationId.string - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + ): StatusTrueResponse { + val url = baseUrl / "cancel" + + val jsonObject = buildJsonObject { + put("invitationId", request.invitationId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + return json.decodeFromString(string) } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index fe6eab26..2152b7f0 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -3,18 +3,21 @@ package app.meetacy.sdk.engine.ktor.requests.meetings import app.meetacy.sdk.engine.ktor.mapToMeeting import app.meetacy.sdk.engine.ktor.mapToUser import app.meetacy.sdk.engine.ktor.requests.extencion.post +import app.meetacy.sdk.engine.ktor.response.models.* import app.meetacy.sdk.engine.ktor.response.models.CreateMeetingResponse import app.meetacy.sdk.engine.ktor.response.models.EditMeetingResponse +import app.meetacy.sdk.engine.ktor.response.models.ListMapMeetingsResponse +import app.meetacy.sdk.engine.ktor.response.models.ListMeetingParticipantsResponse import app.meetacy.sdk.engine.ktor.response.models.ListMeetingsResponse -import app.meetacy.sdk.engine.ktor.response.models.StatusTrueResponse +import app.meetacy.sdk.engine.ktor.response.models.User as ModelUser import app.meetacy.sdk.engine.requests.* +import app.meetacy.sdk.engine.requests.CreateMeetingRequest +import app.meetacy.sdk.engine.requests.EditMeetingRequest +import app.meetacy.sdk.engine.requests.ListMeetingParticipantsRequest import app.meetacy.sdk.types.optional.ifPresent import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.url.Url -import dev.icerock.moko.network.generated.models.ListMapMeetingsResponse -import dev.icerock.moko.network.generated.models.ListMeetingParticipantsResponse -import dev.icerock.moko.network.generated.models.User import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.request.* @@ -24,19 +27,18 @@ import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import kotlinx.serialization.json.putJsonObject -import app.meetacy.sdk.engine.ktor.response.models.Meeting as LolMeeting -import dev.icerock.moko.network.generated.models.Meeting as GeneratedMeeting +import app.meetacy.sdk.engine.ktor.response.models.Meeting as ModelMeeting internal class MeetingsEngine( - private val baseUrl: Url, + baseUrl: Url, private val httpClient: HttpClient, - json: Json + private val json: Json ) { - + private val baseUrl = baseUrl / "meetings" suspend fun listMeetingsHistory( request: ListMeetingsHistoryRequest ): ListMeetingsHistoryRequest.Response = with(request) { - val url = baseUrl / "meetings" / "history" / "list" + val url = baseUrl / "history" / "list" val jsonObject = buildJsonObject { put("amount", amount.int.toString()) @@ -45,11 +47,11 @@ internal class MeetingsEngine( val string = post(url.string, jsonObject, httpClient, request) - val response = Json.decodeFromString(string).result + val response = json.decodeFromString(string).result val paging = PagingResponse( nextPagingId = response.nextPagingId?.let(::PagingId), - data = response.data.map(LolMeeting::mapToMeeting) + data = response.data.map(ModelMeeting::mapToMeeting) ) return ListMeetingsHistoryRequest.Response(paging) @@ -58,7 +60,7 @@ internal class MeetingsEngine( suspend fun listActiveMeetings( request: ListActiveMeetingsRequest ): ListActiveMeetingsRequest.Response = with(request) { - val url = baseUrl / "meetings" / "history" / "active" + val url = baseUrl / "history" / "active" val jsonObject = buildJsonObject { put("amount", amount.int.toString()) @@ -76,11 +78,11 @@ internal class MeetingsEngine( header("Api-Version", request.apiVersion.int.toString()) }.body() - val response = Json.decodeFromString(string).result + val response = json.decodeFromString(string).result val paging = PagingResponse( nextPagingId = response.nextPagingId?.let(::PagingId), - data = response.data.map(LolMeeting::mapToMeeting) + data = response.data.map(ModelMeeting::mapToMeeting) ) return ListActiveMeetingsRequest.Response(paging) @@ -89,7 +91,7 @@ internal class MeetingsEngine( suspend fun listPastMeetings( request: ListPastMeetingsRequest ): ListPastMeetingsRequest.Response = with(request) { - val url = baseUrl / "meetings" / "history" / "past" + val url = baseUrl / "history" / "past" val jsonObject = buildJsonObject { put("amount", amount.int.toString()) @@ -98,11 +100,11 @@ internal class MeetingsEngine( val string = post(url.string, jsonObject, httpClient, request) - val response = Json.decodeFromString(string).result + val response = json.decodeFromString(string).result val paging = PagingResponse( nextPagingId = response.nextPagingId?.let(::PagingId), - data = response.data.map(LolMeeting::mapToMeeting) + data = response.data.map(ModelMeeting::mapToMeeting) ) return ListPastMeetingsRequest.Response(paging) @@ -111,7 +113,7 @@ internal class MeetingsEngine( suspend fun listMeetingsMap( request: ListMeetingsMapRequest ): ListMeetingsMapRequest.Response = with (request) { - val url = baseUrl / "meetings" / "map" / "list" + val url = baseUrl / "map" / "list" val jsonObject = buildJsonObject { putJsonObject("location") { @@ -121,17 +123,17 @@ internal class MeetingsEngine( } val string = post(url.string, jsonObject, httpClient, request) - val response = Json.decodeFromString(string).result + val response = json.decodeFromString(string).result - val data = response.map(GeneratedMeeting::mapToMeeting) + val data = response.map(ModelMeeting::mapToMeeting) return ListMeetingsMapRequest.Response(data) } suspend fun createMeeting( request: CreateMeetingRequest - ): CreateMeetingRequest.Response = with(request){ - val url = baseUrl / "meetings" / "create" + ): CreateMeetingRequest.Response = with(request) { + val url = baseUrl / "create" val jsonObject = buildJsonObject { put("title", title) @@ -147,13 +149,13 @@ internal class MeetingsEngine( val string = post(url.string, jsonObject, httpClient, request) - val meeting = Json.decodeFromString(string).result + val meeting = json.decodeFromString(string).result return CreateMeetingRequest.Response(meeting.mapToMeeting()) } suspend fun editMeeting(request: EditMeetingRequest): EditMeetingRequest.Response = with(request) { - val url = baseUrl / "meetings" / "edit" + val url = baseUrl / "edit" val jsonObject = buildJsonObject { put("meetingId", meetingId.string) @@ -183,7 +185,7 @@ internal class MeetingsEngine( val string = post(url.string, jsonObject, httpClient, request) - val meeting = Json.decodeFromString(string).result + val meeting = json.decodeFromString(string).result return EditMeetingRequest.Response(meeting.mapToMeeting()) } @@ -191,7 +193,7 @@ internal class MeetingsEngine( suspend fun listMeetingParticipants( request: ListMeetingParticipantsRequest ): ListMeetingParticipantsRequest.Response { - val url = baseUrl / "meetings" / "participants" / "list" + val url = baseUrl / "participants" / "list" val jsonObject = buildJsonObject { put("meetingId", request.meetingId.string) @@ -201,10 +203,10 @@ internal class MeetingsEngine( val string = post(url.string, jsonObject, httpClient, request) - val response = Json.decodeFromString(string).result + val response = json.decodeFromString(string).result val paging = PagingResponse( - data = response.data.map(User::mapToUser), + data = response.data.map(ModelUser::mapToUser), nextPagingId = response.nextPagingId?.let(::PagingId) ) @@ -212,7 +214,7 @@ internal class MeetingsEngine( } suspend fun participateMeeting(request: ParticipateMeetingRequest): StatusTrueResponse { - val url = baseUrl / "meetings" / "participate" + val url = baseUrl / "participate" val jsonObject = buildJsonObject { put("meetingId", request.meetingId.string) @@ -224,7 +226,7 @@ internal class MeetingsEngine( } suspend fun getMeeting(request: GetMeetingRequest): GetMeetingRequest.Response { - val url = baseUrl / "meetings" / "get" + val url = baseUrl / "get" val jsonObject = buildJsonObject { put("meetingId", request.meetingId.string) @@ -232,7 +234,7 @@ internal class MeetingsEngine( val string = post(url.string, jsonObject, httpClient, request) - val response = Json.decodeFromString(string).result + val response = json.decodeFromString(string).result val meeting = response.mapToMeeting() diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt index f7c9c627..c1364e64 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/notifications/NotificationsEngine.kt @@ -1,35 +1,39 @@ package app.meetacy.sdk.engine.ktor.requests.notifications import app.meetacy.sdk.engine.ktor.mapToNotification +import app.meetacy.sdk.engine.ktor.requests.extencion.post +import app.meetacy.sdk.engine.ktor.response.models.ListNotificationsResponse +import app.meetacy.sdk.engine.ktor.response.models.StatusTrueResponse import app.meetacy.sdk.engine.requests.ListNotificationsRequest import app.meetacy.sdk.engine.requests.ReadNotificationRequest import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse import app.meetacy.sdk.types.url.Url -import dev.icerock.moko.network.generated.apis.NotificationsApiImpl import io.ktor.client.* import kotlinx.serialization.json.Json -import dev.icerock.moko.network.generated.models.ListNotificationsRequest as GeneratedListNotificationsRequest -import dev.icerock.moko.network.generated.models.ReadNotificationRequest as GeneratedReadNotificationRequest +import kotlinx.serialization.json.buildJsonObject +import kotlinx.serialization.json.put internal class NotificationsEngine( baseUrl: Url, - httpClient: HttpClient, - json: Json + private val httpClient: HttpClient, + private val json: Json ) { - private val base = NotificationsApiImpl(baseUrl.string, httpClient, json) + private val baseUrl = baseUrl / "notifications" suspend fun list( request: ListNotificationsRequest ): ListNotificationsRequest.Response = with (request) { - val response = base.notificationsListPost( - listNotificationsRequest = GeneratedListNotificationsRequest( - amount = amount.int, - pagingId = pagingId?.string - ), - apiVersion = apiVersion.int.toString(), - authorization = request.token.string - ).result + val url = baseUrl / "list" + + val jsonObject = buildJsonObject { + put("amount", amount.int.toString()) + put("pagingId", pagingId?.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = json.decodeFromString(string).result val paging = PagingResponse( data = response.data.map { it.mapToNotification() }, @@ -39,13 +43,15 @@ internal class NotificationsEngine( ListNotificationsRequest.Response(paging) } - suspend fun read(request: ReadNotificationRequest) = with (request) { - base.notificationsReadPost( - readNotificationRequest = GeneratedReadNotificationRequest( - lastNotificationId = lastNotificationId.string - ), - apiVersion = apiVersion.int.toString(), - authorization = token.string - ) + suspend fun read(request: ReadNotificationRequest): StatusTrueResponse = with (request) { + val url = baseUrl / "read" + + val jsonObject = buildJsonObject { + put("lastNotificationId", request.lastNotificationId.string) + } + + val string = post(url.string, jsonObject, httpClient, request) + + return json.decodeFromString(string) } } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/updates/UpdatesEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/updates/UpdatesEngine.kt index 5e4a86ab..8b7eb3fe 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/updates/UpdatesEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/updates/UpdatesEngine.kt @@ -1,11 +1,9 @@ package app.meetacy.sdk.engine.ktor.requests.updates -import app.meetacy.sdk.engine.ktor.exception.getException import app.meetacy.sdk.engine.ktor.handleRSocketExceptions import app.meetacy.sdk.engine.ktor.mapToNotification -import app.meetacy.sdk.engine.ktor.response.ServerResponse -import app.meetacy.sdk.engine.ktor.response.decodeToEmptyServerResponse import app.meetacy.sdk.engine.requests.EmitUpdatesRequest +import app.meetacy.sdk.engine.ktor.response.models.Notification as ModelNotification import app.meetacy.sdk.types.update.Update import app.meetacy.sdk.types.update.UpdateId import app.meetacy.sdk.types.url.Url @@ -15,16 +13,13 @@ import io.rsocket.kotlin.payload.Payload import io.rsocket.kotlin.payload.buildPayload import io.rsocket.kotlin.payload.data import kotlinx.coroutines.flow.emitAll -import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map -import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put -import dev.icerock.moko.network.generated.models.Notification as GeneratedNotification internal class UpdatesEngine( private val baseUrl: Url, @@ -69,7 +64,7 @@ private sealed interface UpdateSerializable { @Serializable data class Notification( override val id: String, - val notification: GeneratedNotification + val notification: ModelNotification ) : UpdateSerializable } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index cf0fb02a..d0b5d063 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -2,6 +2,10 @@ package app.meetacy.sdk.engine.ktor.requests.users import app.meetacy.sdk.engine.ktor.mapToSelfUser import app.meetacy.sdk.engine.ktor.mapToUser +import app.meetacy.sdk.engine.ktor.requests.extencion.post +import app.meetacy.sdk.engine.ktor.requests.extencion.postWithoutToken +import app.meetacy.sdk.engine.ktor.response.models.GetUserResponse +import app.meetacy.sdk.engine.ktor.response.models.ValidateUsernameRequest import app.meetacy.sdk.engine.requests.EditUserRequest import app.meetacy.sdk.engine.requests.GetMeRequest import app.meetacy.sdk.engine.requests.GetUserRequest @@ -12,9 +16,6 @@ import app.meetacy.sdk.types.optional.ifPresent import app.meetacy.sdk.types.url.Url import app.meetacy.sdk.types.user.SelfUser import app.meetacy.sdk.types.user.Username -import dev.icerock.moko.network.generated.apis.UserApi -import dev.icerock.moko.network.generated.apis.UserApiImpl -import dev.icerock.moko.network.generated.models.EditUserResponse import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.request.* @@ -23,22 +24,25 @@ import io.ktor.http.* import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put -import dev.icerock.moko.network.generated.models.GetUserRequest as GeneratedGetUserRequest -import dev.icerock.moko.network.generated.models.ValidateUsernameRequest as GeneratedValidateUsernameRequest +import app.meetacy.sdk.engine.ktor.response.models.GetUserRequest as ModelGetUserRequest internal class UsersEngine( - private val baseUrl: Url, + baseUrl: Url, private val httpClient: HttpClient, - json: Json + private val json: Json ) { - private val base: UserApi = UserApiImpl(baseUrl.string, httpClient, json) + private val baseUrl = baseUrl / "users" suspend fun getMe(request: GetMeRequest): GetMeRequest.Response { - val response = base.usersGetPost( - getUserRequest = GeneratedGetUserRequest(), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "get" + + val jsonObject = buildJsonObject { + put("id", ModelGetUserRequest().id) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = json.decodeFromString(string) return GetMeRequest.Response( (response.result?.mapToUser() ?: meetacyApiError("'result' should present")) @@ -47,13 +51,17 @@ internal class UsersEngine( } suspend fun getUser(request: GetUserRequest): GetUserRequest.Response { - val response = base.usersGetPost( - getUserRequest = GeneratedGetUserRequest( - id = request.userId.string, - ), - apiVersion = request.apiVersion.int.toString(), - authorization = request.token.string - ) + val url = baseUrl / "get" + + val jsonObject = buildJsonObject { + put("id", ModelGetUserRequest( + request.userId.string + ).id) + } + + val string = post(url.string, jsonObject, httpClient, request) + + val response = json.decodeFromString(string) return GetUserRequest.Response( response.result?.mapToUser() ?: meetacyApiError("'result' should present") @@ -93,12 +101,15 @@ internal class UsersEngine( @OptIn(UnsafeConstructor::class) suspend fun usernameAvailable(request: UsernameAvailableRequest): UsernameAvailableRequest.Response { - val response = base.usersValidatePost( - validateUsernameRequest = GeneratedValidateUsernameRequest( - username = request.username.string - ), - apiVersion = request.apiVersion.int.toString() - ) + val url = baseUrl / "username" / "validate" + + val jsonObject = buildJsonObject { + put("username", request.username.string) + } + + val string = postWithoutToken(url.string, jsonObject, httpClient, request) + + val response = json.decodeFromString(string) return UsernameAvailableRequest.Response(username = Username(response.username)) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AcceptInvitationRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AcceptInvitationRequest.kt index 8b436028..59933cf6 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AcceptInvitationRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/AcceptInvitationRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.invitation.InvitationId public class AcceptInvitationRequest( - public val token: Token, + public override val token: Token, public val invitationId: InvitationId -): SimpleMeetacyRequest +): SimpleMeetacyRequest, SimpleMeetacyRequestWithToken diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CancelInvitationRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CancelInvitationRequest.kt index 49a0ab05..064f9c3e 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CancelInvitationRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CancelInvitationRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.invitation.InvitationId public class CancelInvitationRequest( - public val token: Token, + public override val token: Token, public val invitationId: InvitationId -): SimpleMeetacyRequest +): SimpleMeetacyRequest, SimpleMeetacyRequestWithToken diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateInvitationRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateInvitationRequest.kt index 32a96d00..d78f6b6c 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateInvitationRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/CreateInvitationRequest.kt @@ -1,16 +1,14 @@ package app.meetacy.sdk.engine.requests import app.meetacy.sdk.types.auth.Token -import app.meetacy.sdk.types.datetime.DateTime import app.meetacy.sdk.types.invitation.Invitation import app.meetacy.sdk.types.meeting.MeetingId -import app.meetacy.sdk.types.user.User import app.meetacy.sdk.types.user.UserId public data class CreateInvitationRequest( - val token: Token, + override val token: Token, val userId: UserId, val meetingId: MeetingId -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val invitation: Invitation) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DenyInvitationRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DenyInvitationRequest.kt index eb48c074..edc0897c 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DenyInvitationRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/DenyInvitationRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.invitation.InvitationId public class DenyInvitationRequest( - public val token: Token, + public override val token: Token, public val invitationId: InvitationId -): SimpleMeetacyRequest +): SimpleMeetacyRequest, SimpleMeetacyRequestWithToken diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeRequest.kt index 1eb709cc..cc11c405 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetMeRequest.kt @@ -3,6 +3,8 @@ package app.meetacy.sdk.engine.requests import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.user.SelfUser -public data class GetMeRequest(val token: Token): MeetacyRequest { +public data class GetMeRequest( + override val token: Token +): MeetacyRequest, MeetacyRequestWithToken { public data class Response(val me: SelfUser) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetUserRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetUserRequest.kt index 5aec5da4..9ab53e3a 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetUserRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/GetUserRequest.kt @@ -5,9 +5,9 @@ import app.meetacy.sdk.types.user.User import app.meetacy.sdk.types.user.UserId public data class GetUserRequest( - val token: Token, + override val token: Token, val userId: UserId -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response( val user: User ) diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListNotificationsRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListNotificationsRequest.kt index b04163fb..cb8f8026 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListNotificationsRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ListNotificationsRequest.kt @@ -7,9 +7,9 @@ import app.meetacy.sdk.types.paging.PagingId import app.meetacy.sdk.types.paging.PagingResponse public data class ListNotificationsRequest( - val token: Token, + override val token: Token, val amount: Amount, val pagingId: PagingId? -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val paging: PagingResponse) } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ReadNotificationRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ReadNotificationRequest.kt index b7d677d8..6115b412 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ReadNotificationRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/ReadNotificationRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.notification.NotificationId public data class ReadNotificationRequest( - val token: Token, + override val token: Token, val lastNotificationId: NotificationId -) : SimpleMeetacyRequest +) : SimpleMeetacyRequest, SimpleMeetacyRequestWithToken diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/UsernameAvailableRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/UsernameAvailableRequest.kt index a54626f4..e62d01b9 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/UsernameAvailableRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/UsernameAvailableRequest.kt @@ -4,6 +4,6 @@ import app.meetacy.sdk.types.user.Username public data class UsernameAvailableRequest( val username: Username -) : MeetacyRequest { +) : MeetacyRequest, TokenProviderEmpty { public data class Response(val username: Username) } From 56aa0918aec12e41b7dabb6786656af4c428e285 Mon Sep 17 00:00:00 2001 From: y9kap Date: Mon, 23 Oct 2023 14:12:29 +0300 Subject: [PATCH 39/42] fix(#76-support-auth-header)change path to username/available --- .../requests/invitations/InvitationsEngine.kt | 3 ++- .../engine/ktor/requests/users/UsersEngine.kt | 26 +++++-------------- .../sdk/engine/requests/EditUserRequest.kt | 4 +-- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt index 2c818f4c..6da14d01 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/invitations/InvitationsEngine.kt @@ -1,6 +1,7 @@ package app.meetacy.sdk.engine.ktor.requests.invitations import app.meetacy.sdk.engine.ktor.requests.extencion.post +import app.meetacy.sdk.engine.ktor.response.models.CreateInvitationResponse import app.meetacy.sdk.engine.ktor.response.models.StatusTrueResponse import app.meetacy.sdk.engine.ktor.toInvitation import app.meetacy.sdk.engine.requests.AcceptInvitationRequest @@ -31,7 +32,7 @@ internal class InvitationsEngine( val string = post(url.string, jsonObject, httpClient, request) - val response = json.decodeFromString(string).result + val response = json.decodeFromString(string).result return CreateInvitationRequest.Response(response.toInvitation()) } diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index d0b5d063..51369c84 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -4,6 +4,7 @@ import app.meetacy.sdk.engine.ktor.mapToSelfUser import app.meetacy.sdk.engine.ktor.mapToUser import app.meetacy.sdk.engine.ktor.requests.extencion.post import app.meetacy.sdk.engine.ktor.requests.extencion.postWithoutToken +import app.meetacy.sdk.engine.ktor.response.models.EditUserResponse import app.meetacy.sdk.engine.ktor.response.models.GetUserResponse import app.meetacy.sdk.engine.ktor.response.models.ValidateUsernameRequest import app.meetacy.sdk.engine.requests.EditUserRequest @@ -17,10 +18,6 @@ import app.meetacy.sdk.types.url.Url import app.meetacy.sdk.types.user.SelfUser import app.meetacy.sdk.types.user.Username import io.ktor.client.* -import io.ktor.client.call.* -import io.ktor.client.request.* -import io.ktor.content.* -import io.ktor.http.* import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put @@ -69,7 +66,7 @@ internal class UsersEngine( } suspend fun editUser(request: EditUserRequest): EditUserRequest.Response = with(request) { - val url = baseUrl / "users" / "edit" + val url = baseUrl / "edit" val jsonObject = buildJsonObject { nickname.ifPresent { nickname -> @@ -83,25 +80,16 @@ internal class UsersEngine( } } - val string = httpClient.post(url.string) { - setBody( - TextContent( - text = jsonObject.toString(), - contentType = ContentType.Application.Json - ) - ) - header("Authorization", token.string) - header("Api-Version", apiVersion.int.toString()) - }.body() + val string = post(url.string, jsonObject, httpClient, request) - val user = Json.decodeFromString(string).result + val user = Json.decodeFromString(string).result return EditUserRequest.Response(user = user.mapToSelfUser()) } @OptIn(UnsafeConstructor::class) suspend fun usernameAvailable(request: UsernameAvailableRequest): UsernameAvailableRequest.Response { - val url = baseUrl / "username" / "validate" + val url = baseUrl / "username" / "available" val jsonObject = buildJsonObject { put("username", request.username.string) @@ -109,8 +97,8 @@ internal class UsersEngine( val string = postWithoutToken(url.string, jsonObject, httpClient, request) - val response = json.decodeFromString(string) + val response = json.decodeFromString(string).username - return UsernameAvailableRequest.Response(username = Username(response.username)) + return UsernameAvailableRequest.Response(username = Username(response)) } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditUserRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditUserRequest.kt index c0e4ec88..7d4401ba 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditUserRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/EditUserRequest.kt @@ -7,10 +7,10 @@ import app.meetacy.sdk.types.user.SelfUser import app.meetacy.sdk.types.user.Username public data class EditUserRequest( - val token: Token, + override val token: Token, val nickname: Optional, val username: Optional, val avatarId: Optional -) : MeetacyRequest { +) : MeetacyRequest, MeetacyRequestWithToken { public data class Response(val user: SelfUser) } From 6a0a4e8e72dc00d480102ed54a5b6ac7a115d304 Mon Sep 17 00:00:00 2001 From: y9kap Date: Mon, 23 Oct 2023 14:19:33 +0300 Subject: [PATCH 40/42] feat(#76-support-auth-header): delete moko network at sdk --- api/api-ktor/build.gradle.kts | 36 - api/api-ktor/meetacy-api.yml | 1909 ----------------- build-logic/build.gradle.kts | 1 - .../network-generator-convention.gradle.kts | 3 - gradle/libs.versions.toml | 5 - 5 files changed, 1954 deletions(-) delete mode 100644 api/api-ktor/meetacy-api.yml delete mode 100644 build-logic/src/main/kotlin/network-generator-convention.gradle.kts diff --git a/api/api-ktor/build.gradle.kts b/api/api-ktor/build.gradle.kts index d5b23949..3fc21dd5 100644 --- a/api/api-ktor/build.gradle.kts +++ b/api/api-ktor/build.gradle.kts @@ -1,7 +1,4 @@ -import org.gradle.jvm.tasks.Jar - plugins { - id("network-generator-convention") id("kmp-library-convention") } @@ -25,36 +22,3 @@ kotlin.sourceSets.all { optIn("app.meetacy.sdk.types.annotation.UnstableApi") } } - -mokoNetwork { - spec("meetacyApi") { - inputSpec = file("meetacy-api.yml") - - configureTask { - val macosTasks = if (System.getProperty("os.name") == "Mac OS X") { - listOf( - tasks.named("iosX64SourcesJar"), - tasks.named("iosArm64SourcesJar"), - tasks.named("iosSimulatorArm64SourcesJar") - ) - } else { - emptyList() - } - val jarTasks = with(tasks) { - listOf( - sourcesJar, - jsSourcesJar, - jvmSourcesJar - ) - } - - val outputDir = this.outputDir.get() - (jarTasks + macosTasks).forEach { task -> - task { - dependsOn(this@configureTask) - inputs.dir(outputDir) - } - } - } - } -} diff --git a/api/api-ktor/meetacy-api.yml b/api/api-ktor/meetacy-api.yml deleted file mode 100644 index 23c97a98..00000000 --- a/api/api-ktor/meetacy-api.yml +++ /dev/null @@ -1,1909 +0,0 @@ -openapi: "3.0.3" -info: - title: "Meetacy Backend API" - description: "_Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. " - version: "1.0.2" -servers: - - url: "https://api.meetacy.app" - - url: "http://localhost:8080" -tags: - - name: auth - description: Authorization and confirmation of mail - - name: files - description: Operations about files - - name: friends - description: Operations about friends - - name: meetings - description: Operations about meetings - - name: notifications - description: THIS PART IS NOT CONFIGURED YET - - name: user - description: Operations about user - - name: invitations - description: Operations about invitations - -paths: - /auth/email/confirm: - post: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - tags: - - auth - summary: Email confirmation - description: "Email confirmation [via gmail, not implemented yet]" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/EmailConfirmRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - ExpiredLink: - $ref: '#/components/examples/ExpiredLink' - InvalidLink: - $ref: '#/components/examples/InvalidLink' - LinkMaxAttemptsReached: - $ref: '#/components/examples/LinkMaxAttemptsReached' - /auth/email/link: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - tags: - - auth - summary: Email linking - description: "Linking email to account" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/EmailLinkRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - /auth/generate: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - post: - tags: - - auth - summary: token creation - description: Created token for user - requestBody: - description: Creation token based on nickname - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateIdentityRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateIdentityResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - example: - status: false - errorCode: 1 - errorMessage: "Please provide a valid nickname" - /files/download: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - get: - summary: Download file from server - tags: - - files - description: "Getting streaming data from the server by fileId" - parameters: - - name: "fileId" - in: "query" - required: true - schema: - type: string - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/DownloadFileSuccessfulResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - example: - status: false - errorCode: 1 - errorMessage: "Please provide a valid fileId" - /files/upload: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Uploading a file to the server - tags: - - files - description: "Uploading streaming data to the server. Load Type--MultiPart Data" - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: # Request parts - file: - type: string - format: binary - required: - - "token" - - "file" - encoding: # The same level as schema - profileImage: # Property name (see above) - contentType: image/png, image/jpeg - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateIdentityResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidIdentity: - $ref: '#/components/examples/InvalidToken' - LimitSize: - $ref: '#/components/examples/FileSizeLimit' - /friends/add: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - tags: - - friends - summary: "Add friend" - description: "User subscription. With a mutual subscription, he becomes a friend" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/AccessFriendRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidIdentity: - $ref: '#/components/examples/InvalidToken' - FriendNotFound: - $ref: '#/components/examples/FriendNotFound' - FriendAlreadyAdded: - $ref: '#/components/examples/FriendAlreadyAdded' - /friends/delete: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Delete friend - tags: - - friends - description: "Unsubscribing from a user, as a result of which he ceases to be your friend" - requestBody: - description: Creation token based on nickname - content: - application/json: - schema: - $ref: '#/components/schemas/AccessFriendRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidIdentity: - $ref: '#/components/examples/InvalidToken' - FriendNotFound: - $ref: '#/components/examples/FriendNotFound' - /friends/list: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Get list of friends - tags: - - friends - description: "Getting a list of friends and those you follow" - requestBody: - description: Creation token based on nickname - content: - application/json: - schema: - $ref: '#/components/schemas/ListFriendsRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListFriendsResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - /invitations/create: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Create an invitation - tags: - - invitations - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/CreateInvitationRequest" - responses: - "200": - description: Example of a successful created invitation - content: - application/json: - schema: - $ref: '#/components/schemas/CreateInvitationResponse' - "400": - description: Example of failed invitation creation - content: - application/json: - schema: - $ref: "#/components/schemas/InvalidResponse" - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - FriendNotFound: - $ref: '#/components/examples/FriendNotFound' - /invitations/accept: - description: Accept an invitation - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Accept an invitation - tags: - - invitations - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AcceptInvitationRequest' - responses: - "200": - description: Example of a successful invitation acceptation - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - examples: - Success: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: Example of failed invitation acceptation - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /invitations/cancel: - description: Cancel an invitation - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Cancel an invitation - tags: - - invitations - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CancelInvitationRequest' - responses: - "200": - description: Example of a successful invitation cancellation - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - examples: - Success: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: Example of failed invitation cancellation - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /invitations/deny: - description: Deny an invitation - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Deny an invitation - tags: - - invitations - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DenyInvitationRequest' - responses: - "200": - description: Example of a successful invitation denying - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - examples: - Success: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: Example of failed invitation denying - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /meetings/edit: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Edit parameters in meeting - tags: - - meetings - description: "Edit avatar, title, description etc" - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EditMeetingRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/EditMeetingResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - InvalidUtf8String: - $ref: '#/components/examples/InvalidNickname' - InvalidAvatarIdentity: - $ref: '#/components/examples/InvalidFileId' - InvalidMeetingId: - $ref: '#/components/examples/InvalidMeetingId' - NullEditParameters: - $ref: '#/components/examples/NullEditParameters' - /meetings/create: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Creating a meeting - tags: - - meetings - description: "Creating a meeting with an token, name, description, date and location" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/CreateMeetingRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/CreateMeetingResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - InvalidUtf8String: - $ref: '#/components/examples/InvalidNickname' - /meetings/delete: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Deleting a meeting - tags: - - meetings - description: "Removing a meeting from the database" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/AccessMeetingIdRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - MeetingNotFound: - $ref: '#/components/examples/InvalidMeetingId' - /meetings/get: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Getting meeting information - tags: - - meetings - description: "Getting information about a meeting object" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/AccessMeetingIdRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/CreateMeetingResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - MeetingNotFound: - $ref: '#/components/examples/InvalidMeetingId' - /meetings/history/list: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Getting a list of meetings - tags: - - meetings - description: "Getting a list of meetings by token" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingsRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingsResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /meetings/history/active: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - get: - summary: Getting a list of active meetings - tags: - - meetings - description: "Getting a list of meetings by token" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingsRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingsResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /meetings/history/past: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - get: - summary: Getting a list of active meetings - tags: - - meetings - description: "Getting a list of meetings by token" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingsRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingsResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /meetings/map/list: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: "Meetings on Map" - tags: - - meetings - description: "Get a list of meetings that should be displayed on the map" - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ListMapMeetingsRequest' - responses: - "200": - description: "An example of successful returned meetings for map" - content: - application/json: - schema: - $ref: '#/components/schemas/ListMapMeetingsResponse' - "400": - description: "An example of failed authorization" - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /meetings/participants/list: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Participate meeting - tags: - - meetings - description: "Taking part in a meeting" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingParticipantsRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ListMeetingParticipantsResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - MeetingNotFound: - $ref: '#/components/examples/InvalidMeetingId' - /meetings/participate: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Participate meeting - tags: - - meetings - description: "Taking part in a meeting" - requestBody: - description: response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/AccessMeetingIdRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/StatusTrueResponse' - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - MeetingNotFound: - $ref: '#/components/examples/InvalidMeetingId' - MeetingAlreadyParticipate: - $ref: '#/components/examples/MeetingAlreadyParticipate' - /notifications/list: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: "List past notifications" - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ListNotificationsRequest' - tags: - - notifications - description: "" - responses: - "200": - description: "OK" - content: - application/json: - schema: - $ref: "#/components/schemas/ListNotificationsResponse" - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - /notifications/read: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - tags: - - notifications - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ReadNotificationRequest" - description: "" - responses: - "200": - description: "OK" - content: - application/json: - schema: - $ref: "#/components/schemas/StatusTrueResponse" - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - LastNotificationIdInvalid: - $ref: '#/components/examples/LastNotificationIdInvalid' - /users/get: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Getting user object - tags: - - user - description: "Getting user data. Nickname, Id [not to be confused with token] and email verification status" - requestBody: - description: Body for get user or me - content: - application/json: - schema: - $ref: '#/components/schemas/GetUserRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/GetUserResponse' - examples: - id: - value: - id: "15:fzK6CgXqQihDqeXpVYqVpOIgH0s5HvBAaR2BN2PkCxsLe63fAwMrV4uDInfYgoKFXY5C18Rnu9I2x5d46qmGNPLTM9uDepdKPKo7ss1tPsMk5AbslGwQCjlBrscOJmxUFSt7iwsmbZdLdjgYecKoXrJBVGwkZC3HYBUCLtgkexYsOk1mmDRxk482k3fCuo2Nxnjy82INdkOTjVsnew6vGhtOOrOWdpR1Ci6v1d06SQ6aFqs5QasWiTEPXNyCjGGd" - nickname: Dmytro Koriukivka - email: null - emailVerified: null - token: - value: - token: "15:fzK6CgXqQihDqeXpVYqVpOIgH0s5HvBAaR2BN2PkCxsLe63fAwMrV4uDInfYgoKFXY5C18Rnu9I2x5d46qmGNPLTM9uDepdKPKo7ss1tPsMk5AbslGwQCjlBrscOJmxUFSt7iwsmbZdLdjgYecKoXrJBVGwkZC3HYBUCLtgkexYsOk1mmDRxk482k3fCuo2Nxnjy82INdkOTjVsnew6vGhtOOrOWdpR1Ci6v1d06SQ6aFqs5QasWiTEPXNyCjGGd" - nickname: Dmytro Koriukivka - email: DmytroKoriukivka@meetacy.app - emailVerified: true - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - UserNotFound: - $ref: '#/components/examples/UserNotFound' - /users/edit: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - - name: Authorization - in: header - description: Token auth - required: true - schema: - type: string - post: - summary: Editing user object - tags: - - user - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EditUserRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/EditUserRequest' - example: - value: - token: "15:fzK6CgXqQihDqeXpVYqVpOIgH0s5HvBAaR2BN2PkCxsLe63fAwMrV4uDInfYgoKFXY5C18Rnu9I2x5d46qmGNPLTM9uDepdKPKo7ss1tPsMk5AbslGwQCjlBrscOJmxUFSt7iwsmbZdLdjgYecKoXrJBVGwkZC3HYBUCLtgkexYsOk1mmDRxk482k3fCuo2Nxnjy82INdkOTjVsnew6vGhtOOrOWdpR1Ci6v1d06SQ6aFqs5QasWiTEPXNyCjGGd" - nickname: Dmytro Koriukivka - email: DmytroKoriukivka@meetacy.app - emailVerified: true - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - InvalidAccessIdentity: - $ref: '#/components/examples/InvalidToken' - InvalidAvatarIdentity: - $ref: '#/components/examples/InvalidFileId' - InvalidNickname: - $ref: '#/components/examples/InvalidNickname' - /users/validate: - parameters: - - name: Api-Version - in: header - description: The version of API to invoke request with - required: true - schema: - type: string - post: - summary: Validate username - tags: - - user - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ValidateUsernameRequest' - responses: - "200": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/ValidateUsernameRequest' - example: - value: - status: true - username: fiveletterwordormore - "400": - description: An example of a successful generated response with an token - content: - application/json: - schema: - $ref: '#/components/schemas/InvalidResponse' - examples: - AlreadyOccupiedUsername: - $ref: '#/components/examples/AlreadyOccupiedUsername' - InvalidUtf8String: - $ref: '#/components/examples/InvalidUtf8String' -components: - examples: - ExpiredLink: - value: - status: false - errorCode: 12 - errorMessage: "This link was expired. Please consider to create a new one" - InvalidLink: - value: - status: false - errorCode: 4 - errorMessage: "This link is invalid. Please consider to create a new one" - LinkMaxAttemptsReached: - value: - status: false - errorCode: 13 - errorMessage: "You have reached max attempts for today. Please try again later" - InvalidToken: - value: - status: false - errorCode: 1 - errorMessage: "Please provide a valid token" - InvalidNickname: - value: - status: false - errorCode: 6 - errorMessage: "Please provide a valid nickname" - NullEditParameters: - value: - status: false - errorCode: 14 - errorMessage: "Specify at least one meeting edit parameter" - InvalidTitleOrDescription: - value: - status: false - errorCode: 7 - errorMessage: "Please provide a valid title or description" - InvalidFileId: - value: - status: false - errorCode: 3 - errorMessage: "Please provide a valid fileId" - FileSizeLimit: - value: - status: false - errorCode: 14 - errorMessage: "You have exceed your storage limit (max: 1857660, now: 117857600)" - FriendNotFound: - value: - status: false - errorCode: 8 - errorMessage: "Friend was not found" - FriendAlreadyAdded: - value: - status: false - errorCode: 11 - errorMessage: "Friend already added" - InvalidMeetingId: - value: - status: false - errorCode: 2 - errorMessage: "Please provide a valid meetingId" - MeetingAlreadyParticipate: - value: - status: false - errorCode: 10 - errorMessage: "You are already participating in this meeting" - LastNotificationIdInvalid: - value: - status: false - errorCode: 5 - errorMessage: "Please provide a valid notification id" - UserNotFound: - value: - status: false - errorCode: 9 - errorMessage: "FullUser not found" - InvalidUtf8String: - value: - status: false - errorCode: 9 - errorMessage: "Please provide a valid string" - AlreadyOccupiedUsername: - value: - status: false - errorCode: 6 - errorMessage: "This username is not a unique username" - schemas: - GenerateIdentityRequest: - type: "object" - properties: - nickname: - type: "string" - example: "John" - required: - - "nickname" - additionalProperties: false - GenerateIdentityResponse: - type: "object" - properties: - status: - type: "boolean" - example: true - result: - type: "string" - example: "1:Nf7knMA3Oj3cAgrFjLSZEm7iIkyJbHxalO3c224qKsm8Sod01jnWPGlV7zGokTAgMpvhzOKSpZYx8WFE0ABlgf9DGxE8cqqvvovonRpfnl3TXQXmPNMemIfgGuvhvQsLKLEpTpflOT7be3VyeQWzLHjZQtlVgB6eeEaL4OlI1etzBY4z2jMyQKr89BFo9ztcXEVycDUVvI2m62sWS1NIQyKZXOWXYsxocJ4O1L2WB3y0EW8r7uTmosK4lCXTlka6" - required: - - "status" - - "result" - additionalProperties: false - AccessMeetingIdRequest: - type: "object" - properties: - meetingId: - type: string - example: "8:wtzbOPJqX8SVCDQj4UMavNoKJId5UylyL4GRZAkacc2PcGnyu8TCqZCLYvFnG4kb75HOVz6TIeRxXbarsdQZBdrB1rDbHSGD7yCW0EOTbRhxs5qRGncOjG5DmTrAULbWlWMiUkt2RiDRNTkoGJunQgtP63FEZ1MrYJPPdyX1Qn3xpIW6joZZ5p2XahuGGAE13UceQYz6bWO5ZWSJiWjwrA0xOvqf6ad0FHuEXcQaWbJBbBfEA9oGm4KsDHfnkvCT" - required: - - "token" - - "meetingId" - additionalProperties: false - ListMeetingParticipantsRequest: - type: "object" - properties: - meetingId: - type: string - amount: - type: integer - example: 10 - pagingId: - type: string - required: - - "token" - - "meetingId" - - "amount" - additionalProperties: false - ListMeetingParticipantsResponse: - type: "object" - properties: - status: - type: boolean - example: true - result: - type: object - properties: - nextPagingId: - type: string - data: - type: array - items: - $ref: '#/components/schemas/User' - required: - - "data" - required: - - "result" - - "status" - additionalProperties: false - ListMapMeetingsRequest: - type: object - properties: - location: - $ref: '#/components/schemas/Location' - required: - - "token" - - "location" - TokenRequest: - type: object - properties: - token: - type: string - example: - - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" - required: - - "properties" - AccessIdentityRequest: - type: "object" - properties: - accessIdentity: - type: string - example: - - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" - required: - - "accessIdentity" - additionalProperties: false - IdentityRequest: - type: object - properties: - id: - type: string - example: - - "46:QTZepulLdiPsDLNNjinSQ8HJeyidzrdMrYATwD5fmb080VGxzQCUXRubsbxx8DqhojU2y80LiXXBT1N0FQhZZ3rYNTqQZoaDJDYRM31Qd3ugkzBV7QWwtCdAjQ2AxZAAukUCgvwiy2wGmuxSlXhME224gPXRq53WqlFVjMDsAZiIo9HGr0qmclO2EZUPRVlyd5plu83UApbIrOVHeXksq1NbSXxloAhDq6iK9C2Ck8BNoZS8wQWsXdCXBqnPVb85" - token: - type: string - example: - - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" - required: - - "id" - additionalProperties: false - AccessFriendRequest: - type: "object" - properties: - friendId: - type: string - example: "5:PjvgzvEu2YsHIm5OP4L0apfqtQV9Ck9I02ZuhJxDqJ4VeS9SwQJGpBRV0QhvbaDJjsTaMZRVRzsM3yn9uSvBffdY1ul9k3J7IDgWqgbQXHlI0quTL0ORJAUONHzzRfLHs6sOmTAf7AlRP4AmGu9aqwN6hALE9MeDITcY3LlNJR6HPE5z3SK1aE5OC2YKpjhX0xQLBQd6wlkdeoCPhyJRevx60u1T1kVIhpnjBLyXQZwbHYGPCIVJ5ryeVByQCQI8" - required: - - "friendId" - additionalProperties: false - ListFriendsRequest: - type: "object" - properties: - pagingId: - type: string - example: "10" - amount: - type: integer - example: 3 - required: - - "token" - - "amount" - ListMeetingsRequest: - type: "object" - properties: - pagingId: - type: string - example: "8" - amount: - type: integer - example: 3 - required: - - "token" - - "amount" - EmailConfirmRequest: - type: "object" - properties: - email: - type: string - example: swagger@meetacy.com - confirmHash: - type: string - example: "67tRo8LLHhCNjmcMLXEmVIj49CYlDjJ39LERann2uzz6qlPa059uqHQ2i8wpJADHcHaLR5orUpIRPSBJyAC7BmspAU9Rzny1V8Z8uYJlzPTnjRPORPgzJzBySAOB2F85hwyEMjD0xZtIuoXbVnZ19lTBbsnq3HInZ47jHZccqWcApByvEkZs3EH4Q6YQSzx4QbMNFtGUScGABgKCAV6uOSNXXzcVve4atPd0HVzlrM2jqfmHt0McNapRExjKpWXx" - required: - - "email" - - "confirmHash" - additionalProperties: false - EmailLinkRequest: - type: "object" - properties: - email: - type: string - example: "gerald123@meetacy.com" - required: - - "email" - - "token" - additionalProperties: false - AccessAvatarRequest: - type: "object" - properties: - accessIdentity: - type: string - example: - - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" - fileIdentity: - type: string - example: - - "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" - required: - - "accessIdentity" - - "fileIdentityIdentity" - additionalProperties: false - CreateMeetingRequest: - type: "object" - properties: - "avatarId": - type: string - example: "14:BtEpi2o77Uia9NvwQqbumtNggJzjlEVS5gTS1Z8SDs9BmXk7E8lGxji5MBHxcor0j9X1tMgTjiYwbVvuqjdhkdDTr4XtZY6lFhURbKYG17LlfgqPVi6xJpoAdwQyxLz6wILAaiJdBy3wK1PZ3t0Zg3oBGeyeKJtfestgJylmEMCBjH7eXkBP9Bi93xkV4u68kB4OBKPesxJrTpUHlQjwuP8bCpj8Q591BUdUm9t9dXR4xSksMKWWWe4t4Y4ZrAfA" - "title": - type: string - example: - "Meet on the Elbe" - "description": - type: string - example: - "Thematic meeting of like-minded people on the Elbe" - "date": - type: string - example: - 20232402T100000+0300 - "location": - $ref: '#/components/schemas/Location' - "visibility": - type: string - enum: - - "public" - - "private" - required: - - "token" - - "title" - - "date" - - "location" - - "visibility" - additionalProperties: false - EditMeetingResponse: - type: object - properties: - status: - type: boolean - example: true - result: - $ref: '#/components/schemas/Meeting' - required: - - "status" - - "result" - EditMeetingRequest: - type: "object" - properties: - "meetingId": - type: string - example: - "8:wtzbOPJqX8SVCDQj4UMavNoKJId5UylyL4GRZAkacc2PcGnyu8TCqZCLYvFnG4kb75HOVz6TIeRxXbarsdQZBdrB1rDbHSGD7yCW0EOTbRhxs5qRGncOjG5DmTrAULbWlWMiUkt2RiDRNTkoGJunQgtP63FEZ1MrYJPPdyX1Qn3xpIW6joZZ5p2XahuGGAE13UceQYz6bWO5ZWSJiWjwrA0xOvqf6ad0FHuEXcQaWbJBbBfEA9oGm4KsDHfnkvCT" - "avatarId": - type: string - example: - "6:27nUexdZbK0BEn9M48Db9SFP6XTd2O6sjQeX5wsfECftnkVDZ0pP0jYGev23GBGHlQu7RsNk9t8SrO3jOZaiQXbVN22IU5o3TeChCZ2qjgZlOT9owypOBbusAJu16TN0YzIsMtzlgspjOyd5lZzV4LL47QLwcc6b7Z6Uuw0Pkz8IMaCCNdlBBvDaRwsQLqQBLkomRjFOye5owLalAguUHxnjJVSquzDjsljqLwprTPfFGSCGQuqh4JUtWtjUsaWi" - "title": - type: string - example: - "Meet on the Elbe" - "description": - type: string - example: - "Thematic meeting of like-minded people on the Elbe" - "date": - type: string - example: - 20232402T100000+0300 - "location": - $ref: '#/components/schemas/Location' - "visibility": - type: string - enum: - - "public" - - "private" - required: - - "token" - - "meetingId" - additionalProperties: false - InvalidResponse: - type: object - properties: - status: - type: boolean - example: false - errorCode: - type: integer - enum: - - 1 - errorMessage: - type: string - enum: - - Please provide a valid token - required: - - "status" - - "errorCode" - - "errorMessage" - additionalProperties: false - StatusTrueResponse: - type: object - properties: - status: - type: boolean - example: true - required: - - "status" - additionalProperties: false - DownloadFileSuccessfulResponse: - type: string - enum: - - "*image_file*" - ListFriendsResponse: - type: object - properties: - status: - type: boolean - example: - - true - result: - type: object - properties: - nextPagingId: - type: string - example: "11" - data: - type: array - items: - $ref: '#/components/schemas/RegularUserResponse' - required: - - "data" - required: - - "status" - - "result" - additionalProperties: true - RegularUserResponse: - allOf: - - $ref: '#/components/schemas/User' - CreatorMeetingResponse: - type: object - properties: - id: - type: string - example: "12:eKAouJLbWqDmtwQOWuAhi9MYiBYHxKw4LTZBD39nAhtMDiV73QBPDVjE3HRNYm4xwtRJta3FdNdua90evNSgvuvqfyUjdwhXlSlDiEpPE1DJGTzuuAdm5WDowDNJOTdHDpYAGzztJMaKwXiFlguVwO88AZhoByf4SaP9HLXftFs5XVIwNWf4mntyJ48GLaWchngpjvgJW5vABjwwRJiCkCYvMiFpCvwSrzdjwzuvDxM3egDzg15U63yTBSJv0dSo" - nickname: - type: string - example: David Lepaski - email: - type: string - example: "*depending on the privacy settings of the meeting creator, his mail will be displayed*" - emailVerified: - type: boolean - example: false - Location: - type: object - properties: - latitude: - type: number - example: 46.87365231658636 - longitude: - type: number - example: 8.256473253864916 - required: - - "latitude" - - "longitude" - Meeting: - type: object - properties: - id: - type: string - example: "6:EBnp2woyRmY4snRvZaiEtuOIfk4eEXgWdzy8psVPL60Mz92Ts8qIdaoAHVTpvl9hTygMpfUYjNHJpjwpK0txBKRWl7EqCgmnZjm57pIWnlRIo2WoH856AibK8xmCdgOlENPUsmBGLPa7EVOtd43rnGVdeC3wUfHSNV9PT3S0Q3mXCpHF0tOfssQTnKKbBSy9V19Euo7VzpjS4WXI82ILzPVfLqTaRGEUabXw9issiVZhK97zZhBXrV3CFO26pAZa" - creator: - $ref: '#/components/schemas/User' - date: - type: string - example: "20230705T100000+0300" - location: - $ref: '#/components/schemas/Location' - title: - type: string - example: Meet on the Elbe - description: - type: string - example: Thematic meeting of like-minded people on the Elbe - participantsCount: - type: integer - example: 13 - previewParticipants: - type: array - items: - $ref: "#/components/schemas/User" - isParticipating: - type: boolean - example: true - avatarId: - type: string - visibility: - type: string - enum: - - "public" - - "private" - required: - - "id" - - "title" - - "creator" - - "date" - - "location" - - "participantsCount" - - "isParticipating" - - "previewParticipants" - - "visibility" - CreateMeetingResponse: - type: object - properties: - status: - type: boolean - example: true - result: - $ref: '#/components/schemas/Meeting' - required: - - "status" - - "result" - ListMapMeetingsResponse: - type: object - properties: - status: - type: boolean - example: true - result: - type: array - items: - $ref: '#/components/schemas/Meeting' - required: - - "result" - ListMeetingsResponse: - type: object - properties: - status: - type: boolean - example: true - result: - type: object - properties: - nextPagingId: - type: string - data: - type: array - items: - $ref: '#/components/schemas/Meeting' - required: - - "data" - required: - - "result" - GetUserResponse: - type: object - properties: - status: - type: boolean - example: true - result: - $ref: '#/components/schemas/User' - EditUserResponse: - type: object - properties: - status: - type: boolean - example: true - result: - $ref: '#/components/schemas/User' - required: - - "status" - - "result" - User: - type: object - properties: - isSelf: - type: boolean - example: false - id: - type: string - example: "15:fzK6CgXqQihDqeXpVYqVpOIgH0s5HvBAaR2BN2PkCxsLe63fAwMrV4uDInfYgoKFXY5C18Rnu9I2x5d46qmGNPLTM9uDepdKPKo7ss1tPsMk5AbslGwQCjlBrscOJmxUFSt7iwsmbZdLdjgYecKoXrJBVGwkZC3HYBUCLtgkexYsOk1mmDRxk482k3fCuo2Nxnjy82INdkOTjVsnew6vGhtOOrOWdpR1Ci6v1d06SQ6aFqs5QasWiTEPXNyCjGGd" - nickname: - type: string - example: Dmytro Koriukivka - username: - type: string - example: username - email: - type: string - example: "*depending on the privacy settings of the user, his mail will be displayed*" - emailVerified: - type: boolean - example: true - avatarId: - type: string - example: "1:rXfskQTJuGm7U0UvDNpojpDhvrwhfkOfPqRlHRwg2R6EMA9aMtp5iZB2t6JLRTxAJp2LhZIIVrmj3uYpjKzji46krsK4GgtG3Uw3TRudeslGdtL4ye2N6LTWRy8WYN1giGOBgRFZLjwQ4hoEdVIJqmmHCRQZNhHpMAsdWUYdoWStgMumTkCTKbXcraZYMpGESqFcaFfstyjCMVZtuXcl23IusOkEzGPcmWy6ykbiHa4D7lhcq4szdSmpksBo2mov" - relationship: - type: string - description: "Relationship field can be one of four types - subscription, subscriber, friend and none. In case if isSelf == true, relationship field is null" - example: "subscription" - required: - - id - - nickname - - isSelf - GetUserRequest: - description: response with an token - type: object - properties: - id: - type: string - example: "8:bqLhYy1hjNTL0wXcN0dnmSeyZDMt2akkGYMDdaa81oc8fPhOHBWTuFWzMdWNqu7gTHHrfhvC64RE2ZEtngYD5YVpOAGz8Nx1ii7l6BxpBCfHgaL6hHzkEqsmuGlea2gijOEZFkDEhebZ9lwkav13DMTdWJUm4GMm0VQgXzX8s3B528XsMxkXiu5ps9JrRB4m2m4vnZHEaskq9SXEGfhxzeuVft4d2eHWlp5V06NPmfhuyehq9J3GwWxYSkN3Doun" - required: - - token - additionalProperties: false - EditUserRequest: - type: object - properties: - nickname: - type: string - example: "Alexander" - username: - type: string - example: "alexSokol" - avatarId: - type: string - example: "1:rXfskQTJuGm7U0UvDNpojpDhvrwhfkOfPqRlHRwg2R6EMA9aMtp5iZB2t6JLRTxAJp2LhZIIVrmj3uYpjKzji46krsK4GgtG3Uw3TRudeslGdtL4ye2N6LTWRy8WYN1giGOBgRFZLjwQ4hoEdVIJqmmHCRQZNhHpMAsdWUYdoWStgMumTkCTKbXcraZYMpGESqFcaFfstyjCMVZtuXcl23IusOkEzGPcmWy6ykbiHa4D7lhcq4szdSmpksBo2mov" - required: - - token - ValidateUsernameRequest: - type: object - properties: - username: - type: string - example: fiveletterwordormore - required: - - username - Invitation: - type: object - properties: - identity: - type: string - invitedUser: - $ref: "#/components/schemas/User" - inviterUser: - $ref: "#/components/schemas/User" - meeting: - $ref: "#/components/schemas/Meeting" - isAccepted: - type: boolean - required: - - identity - - expiryDate - - invitedUser - - inviterUser - - meeting - CreateInvitationRequest: - type: object - properties: - meetingId: - type: string - example: "6:EBnp2woyRmY4snRvZaiEtuOIfk4eEXgWdzy8psVPL60Mz92Ts8qIdaoAHVTpvl9hTygMpfUYjNHJpjwpK0txBKRWl7EqCgmnZjm57pIWnlRIo2WoH856AibK8xmCdgOlENPUsmBGLPa7EVOtd43rnGVdeC3wUfHSNV9PT3S0Q3mXCpHF0tOfssQTnKKbBSy9V19Euo7VzpjS4WXI82ILzPVfLqTaRGEUabXw9issiVZhK97zZhBXrV3CFO26pAZa" - userId: - type: string - required: - - token - - meetingId - - userId - CreateInvitationResponse: - type: object - properties: - status: - type: boolean - example: true - result: - $ref: '#/components/schemas/Invitation' - required: - - "status" - - "result" - AcceptInvitationRequest: - type: object - properties: - id: - type: string - required: - - token - - invitationIdentity - DenyInvitationRequest: - type: object - properties: - id: - type: string - required: - - "id" - - "token" - CancelInvitationRequest: - type: object - properties: - id: - type: string - required: - - "id" - - "token" - ReadNotificationRequest: - type: "object" - properties: - lastNotificationId: - type: string - example: "8" - required: - - "token" - - "lastNotificationId" - ListNotificationsRequest: - type: "object" - properties: - pagingId: - type: string - example: "8" - amount: - type: integer - example: 3 - required: - - "token" - - "amount" - ListNotificationsResponse: - type: object - properties: - status: - type: boolean - example: true - result: - type: object - properties: - nextPagingId: - type: string - data: - type: array - items: - $ref: '#/components/schemas/Notification' - required: - - "data" - required: - - "result" - Notification: - type: object - properties: - type: - type: string - enum: - - "subscription" - - "meeting_invitation" - id: - type: string - isNew: - type: boolean - date: - type: string - # Subscription - subscriber: - $ref: "#/components/schemas/User" - # Invitation - meeting: - $ref: "#/components/schemas/Meeting" - inviter: - $ref: "#/components/schemas/User" - required: - - "type" - - "id" - - "isNew" - - "date" diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index c662945f..06c1075a 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -12,5 +12,4 @@ repositories { dependencies { api(libs.kotlinxSerializationPlugin) api(libs.kotlinPlugin) - api(libs.mokoNetworkPlugin) } diff --git a/build-logic/src/main/kotlin/network-generator-convention.gradle.kts b/build-logic/src/main/kotlin/network-generator-convention.gradle.kts deleted file mode 100644 index 84a3e88e..00000000 --- a/build-logic/src/main/kotlin/network-generator-convention.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id("dev.icerock.mobile.multiplatform-network-generator") -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 58c853a8..5e4697aa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,6 @@ meetacySdk = "0.0.53" kotlinxCoroutines = "1.6.4" kotlinxSerialization = "1.5.1" kotlinxDateTime = "0.4.0" -mokoNetwork = "0.20.1" rsocket = "0.15.4" [libraries] @@ -25,9 +24,6 @@ ktorClientWebSockets = { module = "io.ktor:ktor-client-websockets", version.ref rsocketKtorClient = { module = "io.rsocket.kotlin:rsocket-ktor-client", version.ref = "rsocket" } -# moko -mokoNetwork = { module = "dev.icerock.moko:network", version.ref="mokoNetwork" } - # kotlinx kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" } kotlinxCoroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } @@ -37,4 +33,3 @@ kotlinxDateTime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.r # gradle plugins kotlinxSerializationPlugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } kotlinPlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } -mokoNetworkPlugin = { module = "dev.icerock.moko:network-generator", version.ref = "mokoNetwork" } From 14eb5bcb31fd2323a3e83fa7cf1305658edfe08f Mon Sep 17 00:00:00 2001 From: y9Kap Date: Mon, 23 Oct 2023 20:09:35 +0300 Subject: [PATCH 41/42] feat(#76-support-auth-header): version bump to 0.0.59 --- .../models/AcceptInvitationRequest.kt | 35 --------- .../response/models/AccessAvatarRequest.kt | 39 ---------- .../response/models/AccessFriendRequest.kt | 35 --------- .../response/models/AccessIdentityRequest.kt | 35 --------- .../response/models/AccessMeetingIdRequest.kt | 35 --------- .../models/CancelInvitationRequest.kt | 35 --------- .../models/CreateInvitationRequest.kt | 39 ---------- .../models/CreateInvitationResponse.kt | 24 ------- .../response/models/CreateMeetingRequest.kt | 72 ------------------- .../response/models/CreateMeetingResponse.kt | 24 ------- .../response/models/CreatorMeetingResponse.kt | 47 ------------ .../response/models/DenyInvitationRequest.kt | 35 --------- .../models/DownloadFileSuccessfulResponse.kt | 34 --------- .../response/models/EditMeetingRequest.kt | 70 ------------------ .../response/models/EditMeetingResponse.kt | 18 ----- .../ktor/response/models/EditUserRequest.kt | 43 ----------- .../ktor/response/models/EditUserResponse.kt | 18 ----- .../response/models/EmailConfirmRequest.kt | 39 ---------- .../ktor/response/models/EmailLinkRequest.kt | 35 --------- .../models/GenerateIdentityRequest.kt | 35 --------- .../models/GenerateIdentityResponse.kt | 18 ----- .../ktor/response/models/GetUserRequest.kt | 17 ----- .../ktor/response/models/GetUserResponse.kt | 18 ----- .../ktor/response/models/IdentityRequest.kt | 39 ---------- .../ktor/response/models/InlineObject.kt | 35 --------- .../ktor/response/models/InvalidResponse.kt | 63 ---------------- .../engine/ktor/response/models/Invitation.kt | 21 ------ .../response/models/ListFriendsRequest.kt | 39 ---------- .../response/models/ListFriendsResponse.kt | 18 ----- .../models/ListFriendsResponseResult.kt | 18 ----- .../models/ListMapMeetingsResponse.kt | 18 ----- .../models/ListMeetingParticipantsResponse.kt | 24 ------- .../ListMeetingParticipantsResponseResult.kt | 18 ----- .../response/models/ListMeetingsRequest.kt | 39 ---------- .../response/models/ListMeetingsResponse.kt | 18 ----- .../models/ListMeetingsResponseResult.kt | 18 ----- .../models/ListNotificationsRequest.kt | 39 ---------- .../models/ListNotificationsResponse.kt | 18 ----- .../models/ListNotificationsResponseResult.kt | 18 ----- .../engine/ktor/response/models/Location.kt | 18 ----- .../engine/ktor/response/models/Meeting.kt | 32 --------- .../ktor/response/models/Notification.kt | 28 -------- .../models/ReadNotificationRequest.kt | 35 --------- .../response/models/StatusTrueResponse.kt | 17 ----- .../sdk/engine/ktor/response/models/User.kt | 24 ------- .../models/ValidateUsernameRequest.kt | 17 ----- 46 files changed, 1414 deletions(-) delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt deleted file mode 100644 index 2190cbf7..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AcceptInvitationRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param id - */ -@Serializable -internal data class AcceptInvitationRequest ( - - @SerialName("id") - val id: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt deleted file mode 100644 index 524653be..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessAvatarRequest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param accessIdentity - * @param fileIdentity - */ -@Serializable -internal data class AccessAvatarRequest ( - - @SerialName("accessIdentity") - val accessIdentity: String, - - @SerialName("fileIdentity") - val fileIdentity: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt deleted file mode 100644 index c073743d..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessFriendRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param friendId - */ -@Serializable -internal data class AccessFriendRequest ( - - @SerialName("friendId") - val friendId: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt deleted file mode 100644 index 469c697a..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessIdentityRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param accessIdentity - */ -@Serializable -internal data class AccessIdentityRequest ( - - @SerialName("accessIdentity") - val accessIdentity: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt deleted file mode 100644 index ea381d78..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/AccessMeetingIdRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param meetingId - */ -@Serializable -internal data class AccessMeetingIdRequest ( - - @SerialName("meetingId") - val meetingId: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt deleted file mode 100644 index 4275fe8b..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CancelInvitationRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param id - */ -@Serializable -internal data class CancelInvitationRequest ( - - @SerialName("id") - val id: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt deleted file mode 100644 index 344b728d..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationRequest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param meetingId - * @param userId - */ -@Serializable -internal data class CreateInvitationRequest ( - - @SerialName("meetingId") - val meetingId: String, - - @SerialName("userId") - val userId: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt index 677dfc61..3933e69b 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateInvitationResponse.kt @@ -1,31 +1,8 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class CreateInvitationResponse ( @@ -36,4 +13,3 @@ internal data class CreateInvitationResponse ( val result: Invitation ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt deleted file mode 100644 index 88ae0540..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingRequest.kt +++ /dev/null @@ -1,72 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param title - * @param date - * @param location - * @param visibility - * @param avatarId - * @param description - */ -@Serializable -internal data class CreateMeetingRequest ( - - @SerialName("title") - val title: String, - - @SerialName("date") - val date: String, - - @SerialName("location") - val location: Location, - - @SerialName("visibility") - val visibility: Visibility, - - @SerialName("avatarId") - val avatarId: String? = null, - - @SerialName("description") - val description: String? = null - -) { - - /** - * - * Values: "public","private" - */ - @Serializable - enum class Visibility { - - @SerialName("public") - PUBLIC, - - @SerialName("private") - PRIVATE; - - } - -} - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt index 3fe8df24..fcd83743 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreateMeetingResponse.kt @@ -1,31 +1,8 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class CreateMeetingResponse ( @@ -36,4 +13,3 @@ internal data class CreateMeetingResponse ( val result: Meeting ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt deleted file mode 100644 index 2a47893e..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/CreatorMeetingResponse.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param id - * @param nickname - * @param email - * @param emailVerified - */ -@Serializable -internal data class CreatorMeetingResponse ( - - @SerialName("id") - val id: String? = null, - - @SerialName("nickname") - val nickname: String? = null, - - @SerialName("email") - val email: String? = null, - - @SerialName("emailVerified") - val emailVerified: Boolean? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt deleted file mode 100644 index 3763c5f8..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DenyInvitationRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param id - */ -@Serializable -internal data class DenyInvitationRequest ( - - @SerialName("id") - val id: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt deleted file mode 100644 index 5589c351..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/DownloadFileSuccessfulResponse.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - -import kotlinx.serialization.SerialName - -/** -* -* Values: "*image_file*" -*/ -@Serializable -internal enum class DownloadFileSuccessfulResponse { - - @SerialName("*image_file*") - STAR_IMAGE_FILE_STAR; - -} - - - - - - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt deleted file mode 100644 index b07688d2..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingRequest.kt +++ /dev/null @@ -1,70 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerialName - - -/** - * - * @param meetingId - * @param avatarId - * @param title - * @param description - * @param date - * @param location - * @param visibility - */ -@Serializable -internal data class EditMeetingRequest ( - - @SerialName("meetingId") - val meetingId: String, - - @SerialName("avatarId") - val avatarId: String? = null, - - @SerialName("title") - val title: String? = null, - - @SerialName("description") - val description: String? = null, - - @SerialName("date") - val date: String? = null, - - @SerialName("location") - val location: Location? = null, - - @SerialName("visibility") - val visibility: Visibility? = null - -) { - - /** - * - * Values: "public","private" - */ - @Serializable - enum class Visibility { - - @SerialName("public") - PUBLIC, - - @SerialName("private") - PRIVATE; - - } - -} - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt index dc588cd8..34bb868a 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditMeetingResponse.kt @@ -1,25 +1,8 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class EditMeetingResponse ( @@ -30,4 +13,3 @@ internal data class EditMeetingResponse ( val result: Meeting ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt deleted file mode 100644 index 2d76bff8..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserRequest.kt +++ /dev/null @@ -1,43 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param nickname - * @param username - * @param avatarId - */ -@Serializable -internal data class EditUserRequest ( - - @SerialName("nickname") - val nickname: String? = null, - - @SerialName("username") - val username: String? = null, - - @SerialName("avatarId") - val avatarId: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt index 89853ef1..360df1d2 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EditUserResponse.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class EditUserResponse ( @@ -36,4 +19,3 @@ internal data class EditUserResponse ( val result: User ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt deleted file mode 100644 index d2ff1015..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailConfirmRequest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param email - * @param confirmHash - */ -@Serializable -internal data class EmailConfirmRequest ( - - @SerialName("email") - val email: String, - - @SerialName("confirmHash") - val confirmHash: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt deleted file mode 100644 index 8dd255b9..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/EmailLinkRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param email - */ -@Serializable -internal data class EmailLinkRequest ( - - @SerialName("email") - val email: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt deleted file mode 100644 index f699ecf3..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param nickname - */ -@Serializable -internal data class GenerateIdentityRequest ( - - @SerialName("nickname") - val nickname: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt index 56abb7a4..7de593fa 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GenerateIdentityResponse.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class GenerateIdentityResponse ( @@ -36,4 +19,3 @@ internal data class GenerateIdentityResponse ( val result: String ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt index 1237af57..7c267280 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserRequest.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,11 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * response with an token - * @param id - */ @Serializable internal data class GetUserRequest ( @@ -32,4 +16,3 @@ internal data class GetUserRequest ( val id: String? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt index e8fd276d..68bdb005 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/GetUserResponse.kt @@ -1,25 +1,8 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class GetUserResponse ( @@ -30,4 +13,3 @@ internal data class GetUserResponse ( val result: User? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt deleted file mode 100644 index 0ffa771a..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/IdentityRequest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param id - * @param token - */ -@Serializable -internal data class IdentityRequest ( - - @SerialName("id") - val id: String, - - @SerialName("token") - val token: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt deleted file mode 100644 index 4770e1b6..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InlineObject.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param file - */ -@Serializable -internal data class InlineObject ( - - @SerialName("file") - val file: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt deleted file mode 100644 index 8b4b8664..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/InvalidResponse.kt +++ /dev/null @@ -1,63 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerialName - - -/** - * - * @param status - * @param errorCode - * @param errorMessage - */ -@Serializable -internal data class InvalidResponse ( - - @SerialName("status") - val status: Boolean, - - @SerialName("errorCode") - val errorCode: ErrorCode, - - @SerialName("errorMessage") - val errorMessage: ErrorMessage - -) { - - /** - * - * Values: 1 - */ - @Serializable - enum class ErrorCode { - - @SerialName("1") - _1; - - } - - /** - * - * Values: "Please provide a valid token" - */ - @Serializable - enum class ErrorMessage { - - @SerialName("Please provide a valid token") - PLEASE_PROVIDE_A_VALID_TOKEN; - - } - -} - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt index 8ac19f9c..68a2a8ba 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Invitation.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,15 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param identity - * @param invitedUser - * @param inviterUser - * @param meeting - * @param isAccepted - */ @Serializable internal data class Invitation ( @@ -48,4 +28,3 @@ internal data class Invitation ( val isAccepted: Boolean? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt deleted file mode 100644 index f6b5ba5b..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsRequest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param amount - * @param pagingId - */ -@Serializable -internal data class ListFriendsRequest ( - - @SerialName("amount") - val amount: Int, - - @SerialName("pagingId") - val pagingId: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt index 221db563..9e429afa 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponse.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class ListFriendsResponse ( @@ -36,4 +19,3 @@ internal data class ListFriendsResponse ( val result: ListFriendsResponseResult ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt index 3f4a8e1e..2550beb9 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListFriendsResponseResult.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param data - * @param nextPagingId - */ @Serializable internal data class ListFriendsResponseResult ( @@ -36,4 +19,3 @@ internal data class ListFriendsResponseResult ( val nextPagingId: String? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt index 2807e7f4..ee5d150d 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsResponse.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param result - * @param status - */ @Serializable internal data class ListMapMeetingsResponse ( @@ -36,4 +19,3 @@ internal data class ListMapMeetingsResponse ( val status: Boolean? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt index 81e014a1..ae8bd289 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponse.kt @@ -1,31 +1,8 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable - - - - - - import kotlinx.serialization.SerialName - -/** - * - * @param status - * @param result - */ @Serializable internal data class ListMeetingParticipantsResponse ( @@ -36,4 +13,3 @@ internal data class ListMeetingParticipantsResponse ( val result: ListMeetingParticipantsResponseResult ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt index 5062e4a2..8d4cb62c 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsResponseResult.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param data - * @param nextPagingId - */ @Serializable internal data class ListMeetingParticipantsResponseResult ( @@ -36,4 +19,3 @@ internal data class ListMeetingParticipantsResponseResult ( val nextPagingId: String? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt deleted file mode 100644 index beb40c5d..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsRequest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param amount - * @param pagingId - */ -@Serializable -internal data class ListMeetingsRequest ( - - @SerialName("amount") - val amount: Int, - - @SerialName("pagingId") - val pagingId: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt index 9a311d23..90fd0cda 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponse.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param result - * @param status - */ @Serializable internal data class ListMeetingsResponse ( @@ -36,4 +19,3 @@ internal data class ListMeetingsResponse ( val status: Boolean? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt index 83720ab0..5520069d 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingsResponseResult.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models @@ -21,12 +10,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param data - * @param nextPagingId - */ @Serializable internal data class ListMeetingsResponseResult ( @@ -37,4 +20,3 @@ internal data class ListMeetingsResponseResult ( val nextPagingId: String? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt deleted file mode 100644 index a3578f8a..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsRequest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param amount - * @param pagingId - */ -@Serializable -internal data class ListNotificationsRequest ( - - @SerialName("amount") - val amount: Int, - - @SerialName("pagingId") - val pagingId: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt index 8a05156c..5565b2f3 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponse.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param result - * @param status - */ @Serializable internal data class ListNotificationsResponse ( @@ -36,4 +19,3 @@ internal data class ListNotificationsResponse ( val status: Boolean? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt index 803b4d48..aa24236f 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListNotificationsResponseResult.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param data - * @param nextPagingId - */ @Serializable internal data class ListNotificationsResponseResult ( @@ -36,4 +19,3 @@ internal data class ListNotificationsResponseResult ( val nextPagingId: String? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt index 87c646bc..9bdc4350 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Location.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,12 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param latitude - * @param longitude - */ @Serializable internal data class Location ( @@ -36,4 +19,3 @@ internal data class Location ( val longitude: Double ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt index c44b6288..734a2098 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Meeting.kt @@ -1,35 +1,9 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param id - * @param creator - * @param date - * @param location - * @param title - * @param participantsCount - * @param previewParticipants - * @param isParticipating - * @param visibility - * @param description - * @param avatarId - */ @Serializable internal data class Meeting ( @@ -67,11 +41,6 @@ internal data class Meeting ( val avatarId: String? = null ) { - - /** - * - * Values: "public","private" - */ @Serializable enum class Visibility { @@ -84,4 +53,3 @@ internal data class Meeting ( } } - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt index e756ba51..f52228e3 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/Notification.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,17 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param type - * @param id - * @param isNew - * @param date - * @param subscriber - * @param meeting - * @param inviter - */ @Serializable internal data class Notification ( @@ -56,11 +34,6 @@ internal data class Notification ( val inviter: User? = null ) { - - /** - * - * Values: "subscription","meeting_invitation" - */ @Serializable enum class Type { @@ -73,4 +46,3 @@ internal data class Notification ( } } - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt deleted file mode 100644 index cff5b1a6..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ReadNotificationRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param lastNotificationId - */ -@Serializable -internal data class ReadNotificationRequest ( - - @SerialName("lastNotificationId") - val lastNotificationId: String - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt index 0276911c..13ae1396 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/StatusTrueResponse.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,11 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param status - */ @Serializable internal data class StatusTrueResponse ( @@ -32,4 +16,3 @@ internal data class StatusTrueResponse ( val status: Boolean ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt index f10be27a..b5cd823e 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/User.kt @@ -1,31 +1,8 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param isSelf - * @param id - * @param nickname - * @param username - * @param email - * @param emailVerified - * @param avatarId - * @param relationship Relationship field can be one of four types - subscription, subscriber, friend and none. In case if isSelf == true, relationship field is null - */ @Serializable internal data class User ( @@ -55,4 +32,3 @@ internal data class User ( val relationship: String? = null ) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt index d0ba5f1d..da1d9d0b 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ValidateUsernameRequest.kt @@ -1,14 +1,3 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ package app.meetacy.sdk.engine.ktor.response.models import kotlinx.serialization.Serializable @@ -20,11 +9,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName - -/** - * - * @param username - */ @Serializable internal data class ValidateUsernameRequest ( @@ -32,4 +16,3 @@ internal data class ValidateUsernameRequest ( val username: String ) - From 9034194780c7f190a7de5f1c51c417d45147da81 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Mon, 23 Oct 2023 20:19:55 +0300 Subject: [PATCH 42/42] feat(#76-support-auth-header): version bump to 0.0.59 --- .../response/models/ListMapMeetingsRequest.kt | 35 --------------- .../models/ListMeetingParticipantsRequest.kt | 43 ------------------- .../ktor/response/models/TokenRequest.kt | 35 --------------- gradle/libs.versions.toml | 2 +- 4 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt delete mode 100644 api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt deleted file mode 100644 index a4220ca5..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMapMeetingsRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param location - */ -@Serializable -internal data class ListMapMeetingsRequest ( - - @SerialName("location") - val location: Location - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt deleted file mode 100644 index dcb70fc0..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/ListMeetingParticipantsRequest.kt +++ /dev/null @@ -1,43 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param meetingId - * @param amount - * @param pagingId - */ -@Serializable -internal data class ListMeetingParticipantsRequest ( - - @SerialName("meetingId") - val meetingId: String, - - @SerialName("amount") - val amount: Int, - - @SerialName("pagingId") - val pagingId: String? = null - -) - diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt deleted file mode 100644 index c84286f2..00000000 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/response/models/TokenRequest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Meetacy Backend API -* _Version 1.0.2 of the `Meetacy` API documentation_. It is recommended to fill in the request body on your own according to the sample provided below. The `Notifications` section is under development. -* -* OpenAPI spec version: 1.0.2 -* -* -* NOTE: This class is auto generated by the swagger code generator program. -* https://github.com/swagger-api/swagger-codegen.git -* Do not edit the class manually. -*/ -package app.meetacy.sdk.engine.ktor.response.models - -import kotlinx.serialization.Serializable - - - - - - -import kotlinx.serialization.SerialName - - -/** - * - * @param token - */ -@Serializable -internal data class TokenRequest ( - - @SerialName("token") - val token: String? = null - -) - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5e4697aa..0d156f76 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin = "1.8.10" ktor = "2.2.4" -meetacySdk = "0.0.53" +meetacySdk = "0.0.59" # kotlinx kotlinxCoroutines = "1.6.4"