diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 7346a72269..44c9955298 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -379,3 +379,17 @@ const val fileHashField = "file_hash" const val fileHashesField = "file_hashes" const val messageField = "message" const val unspecifiedField = "unspecified" + +const val secureDataField = "secure_data" +const val nonceField = "nonce" + +const val personalDetailsField = "personal_details" +const val passportField = "passport" +const val internalPassportField = "internal_passport" +const val driverLicenseField = "driver_license" +const val identityCardField = "identity_card" +const val utilityBillField = "utility_bill" +const val bankStatementField = "bank_statement" +const val rentalAgreementField = "rental_agreement" +const val passportRegistrationField = "passport_registration" +const val temporaryRegistrationField = "temporary_registration" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportData.kt index 9bf4884791..9a55da08ab 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportData.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportData.kt @@ -2,7 +2,8 @@ package dev.inmo.tgbotapi.types.passport import dev.inmo.tgbotapi.types.credentialsField import dev.inmo.tgbotapi.types.dataField -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.credentials.EncryptedCredentials +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt index 35df08b4ab..9db2e83596 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt @@ -6,8 +6,8 @@ import dev.inmo.micro_utils.crypto.MD5 import dev.inmo.micro_utils.crypto.md5 import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.* -import dev.inmo.tgbotapi.types.passport.encrypted_data.type +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* +import dev.inmo.tgbotapi.types.passport.encrypted.type import dev.inmo.tgbotapi.utils.nonstrictJsonFormat import kotlinx.serialization.* import kotlinx.serialization.descriptors.SerialDescriptor diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/DataCredentials.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/DataCredentials.kt new file mode 100644 index 0000000000..4db61a1f7e --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/DataCredentials.kt @@ -0,0 +1,14 @@ +package dev.inmo.tgbotapi.types.passport.credentials + +import dev.inmo.tgbotapi.types.dataHashField +import dev.inmo.tgbotapi.types.secretField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class DataCredentials( + @SerialName(dataHashField) + val dataHash: String, + @SerialName(secretField) + val secret: String +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/DecryptedCredentials.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/DecryptedCredentials.kt new file mode 100644 index 0000000000..b732b38281 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/DecryptedCredentials.kt @@ -0,0 +1,15 @@ +package dev.inmo.tgbotapi.types.passport.credentials + +import dev.inmo.tgbotapi.types.nonceField +import dev.inmo.tgbotapi.types.passport.decrypted.SecureData +import dev.inmo.tgbotapi.types.secureDataField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class DecryptedCredentials( + @SerialName(secureDataField) + val secureData: List, + @SerialName(nonceField) + val nonce: String +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/EncryptedData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/EncryptedCredentials.kt similarity index 93% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/EncryptedData.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/EncryptedCredentials.kt index 11eca0828e..4cd8231c3f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/EncryptedData.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/EncryptedCredentials.kt @@ -1,4 +1,4 @@ -package dev.inmo.tgbotapi.types.passport +package dev.inmo.tgbotapi.types.passport.credentials import dev.inmo.micro_utils.crypto.SourceBytes import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/FileCredentials.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/FileCredentials.kt new file mode 100644 index 0000000000..f73784af17 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/credentials/FileCredentials.kt @@ -0,0 +1,13 @@ +package dev.inmo.tgbotapi.types.passport.credentials + +import dev.inmo.tgbotapi.types.* +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class FileCredentials( + @SerialName(fileHashField) + val fileHash: String, + @SerialName(secretField) + val secret: String +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue.kt new file mode 100644 index 0000000000..b47fe28fdc --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue.kt @@ -0,0 +1,13 @@ +package dev.inmo.tgbotapi.types.passport.decrypted + +import dev.inmo.tgbotapi.types.dataField +import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class AddressSecureValue( + @SerialName(dataField) + override val data: DataCredentials +) : SecureValueWithData \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/IdentityWithReverseSideSecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/IdentityWithReverseSideSecureValue.kt new file mode 100644 index 0000000000..ff65ae0c5d --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/IdentityWithReverseSideSecureValue.kt @@ -0,0 +1,39 @@ +package dev.inmo.tgbotapi.types.passport.decrypted + +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials +import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.* +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +sealed class IdentityWithReverseSideSecureValue : SecureValueIdentity, SecureValueWithData, SecureValueWithTranslations, SecureValueWithReverseSide + +@Serializable +data class DriverLicenseSecureValue( + @SerialName(dataField) + override val data: DataCredentials, + @SerialName(frontSideField) + override val frontSide: FileCredentials, + @SerialName(reverseSideField) + override val reverseSide: FileCredentials, + @SerialName(selfieField) + override val selfie: FileCredentials, + @SerialName(translationField) + override val translation: List +) : IdentityWithReverseSideSecureValue() + +@Serializable +data class IdentityCardSecureValue( + @SerialName(dataField) + override val data: DataCredentials, + @SerialName(frontSideField) + override val frontSide: FileCredentials, + @SerialName(reverseSideField) + override val reverseSide: FileCredentials, + @SerialName(selfieField) + override val selfie: FileCredentials, + @SerialName(translationField) + override val translation: List +) : IdentityWithReverseSideSecureValue() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/OtherDocumentsSecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/OtherDocumentsSecureValue.kt new file mode 100644 index 0000000000..8c304ed8af --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/OtherDocumentsSecureValue.kt @@ -0,0 +1,52 @@ +package dev.inmo.tgbotapi.types.passport.decrypted + +import dev.inmo.tgbotapi.types.filesField +import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations +import dev.inmo.tgbotapi.types.translationField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +sealed class OtherDocumentsSecureValue : SecureValueWithTranslations, SecureValueWithFiles + +@Serializable +data class UtilityBillSecureValue( + @SerialName(translationField) + override val translation: List, + @SerialName(filesField) + override val files: List +) : OtherDocumentsSecureValue() + +@Serializable +data class BankStatementSecureValue( + @SerialName(translationField) + override val translation: List, + @SerialName(filesField) + override val files: List +) : OtherDocumentsSecureValue() + +@Serializable +data class RentalAgreementSecureValue( + @SerialName(translationField) + override val translation: List, + @SerialName(filesField) + override val files: List +) : OtherDocumentsSecureValue() + +@Serializable +data class PassportRegistrationSecureValue( + @SerialName(translationField) + override val translation: List, + @SerialName(filesField) + override val files: List +) : OtherDocumentsSecureValue() + +@Serializable +data class TemporalRegistrationSecureValue( + @SerialName(translationField) + override val translation: List, + @SerialName(filesField) + override val files: List +) : OtherDocumentsSecureValue() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PassportSecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PassportSecureValue.kt new file mode 100644 index 0000000000..9037c02f6b --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PassportSecureValue.kt @@ -0,0 +1,36 @@ +package dev.inmo.tgbotapi.types.passport.decrypted + +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials +import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.* +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +sealed class PassportSecureValue : SecureValueIdentity, SecureValueWithData, SecureValueWithTranslations + +@Serializable +data class CommonPassportSecureValue( + @SerialName(dataField) + override val data: DataCredentials, + @SerialName(frontSideField) + override val frontSide: FileCredentials, + @SerialName(selfieField) + override val selfie: FileCredentials, + @SerialName(translationField) + override val translation: List +) : PassportSecureValue() + +@Serializable +data class InternalPassportSecureValue( + @SerialName(dataField) + override val data: DataCredentials, + @SerialName(frontSideField) + override val frontSide: FileCredentials, + @SerialName(selfieField) + override val selfie: FileCredentials, + @SerialName(translationField) + override val translation: List +) : PassportSecureValue() + diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PersonalDetailsSecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PersonalDetailsSecureValue.kt new file mode 100644 index 0000000000..185c710fc9 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PersonalDetailsSecureValue.kt @@ -0,0 +1,13 @@ +package dev.inmo.tgbotapi.types.passport.decrypted + +import dev.inmo.tgbotapi.types.dataField +import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class PersonalDetailsSecureValue( + @SerialName(dataField) + override val data: DataCredentials +) : SecureValueWithData \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/SecureData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/SecureData.kt new file mode 100644 index 0000000000..dd2fb40eed --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/SecureData.kt @@ -0,0 +1,29 @@ +package dev.inmo.tgbotapi.types.passport.decrypted + +import dev.inmo.tgbotapi.types.* +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class SecureData( + @SerialName(personalDetailsField) + val personalDetails: PersonalDetailsSecureValue? = null, + @SerialName(passportField) + val passport: PassportSecureValue? = null, + @SerialName(internalPassportField) + val internalPassport: InternalPassportSecureValue? = null, + @SerialName(driverLicenseField) + val driverLicense: DriverLicenseSecureValue? = null, + @SerialName(identityCardField) + val identityCard: IdentityCardSecureValue? = null, + @SerialName(utilityBillField) + val utilityBill: UtilityBillSecureValue? = null, + @SerialName(bankStatementField) + val bankStatement: BankStatementSecureValue? = null, + @SerialName(rentalAgreementField) + val rentalAgreement: RentalAgreementSecureValue? = null, + @SerialName(passportRegistrationField) + val passportRegistration: PassportRegistrationSecureValue? = null, + @SerialName(temporaryRegistrationField) + val temporaryRegistration: TemporalRegistrationSecureValue? = null, +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue.kt new file mode 100644 index 0000000000..9db0d7c823 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue.kt @@ -0,0 +1,3 @@ +package dev.inmo.tgbotapi.types.passport.decrypted.abstracts + +interface SecureValue diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueIdentity.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueIdentity.kt new file mode 100644 index 0000000000..1c4847a181 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueIdentity.kt @@ -0,0 +1,8 @@ +package dev.inmo.tgbotapi.types.passport.decrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials + +interface SecureValueIdentity : SecureValue { + val frontSide: FileCredentials + val selfie: FileCredentials +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithData.kt new file mode 100644 index 0000000000..c3eb5a8b35 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithData.kt @@ -0,0 +1,7 @@ +package dev.inmo.tgbotapi.types.passport.decrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials + +interface SecureValueWithData : SecureValue { + val data: DataCredentials +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithFiles.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithFiles.kt new file mode 100644 index 0000000000..ea201f1ee8 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithFiles.kt @@ -0,0 +1,7 @@ +package dev.inmo.tgbotapi.types.passport.decrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials + +interface SecureValueWithFiles : SecureValue { + val files: List +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithReverseSide.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithReverseSide.kt new file mode 100644 index 0000000000..b833b9284d --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithReverseSide.kt @@ -0,0 +1,7 @@ +package dev.inmo.tgbotapi.types.passport.decrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials + +interface SecureValueWithReverseSide : SecureValue { + val reverseSide: FileCredentials +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithTranslations.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithTranslations.kt new file mode 100644 index 0000000000..f540a2ad7f --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithTranslations.kt @@ -0,0 +1,7 @@ +package dev.inmo.tgbotapi.types.passport.decrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials + +interface SecureValueWithTranslations : SecureValue { + val translation: List +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Email.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/Email.kt similarity index 69% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Email.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/Email.kt index baadbdb726..ca3f3f7f92 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Email.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/Email.kt @@ -1,10 +1,10 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.emailField import dev.inmo.tgbotapi.types.hashField -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithEmail +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithEmail import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedAddress.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedAddress.kt similarity index 64% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedAddress.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedAddress.kt index abff88fed8..6bb91ac32d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedAddress.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedAddress.kt @@ -1,10 +1,10 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.dataField -import dev.inmo.tgbotapi.types.passport.EncryptedData -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData +import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithData import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedElementSerializer.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedElementSerializer.kt similarity index 93% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedElementSerializer.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedElementSerializer.kt index 97e48e4e1b..52cb81f1af 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedElementSerializer.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedElementSerializer.kt @@ -1,10 +1,10 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.crypto.decodeBase64 import dev.inmo.micro_utils.serialization.encapsulator.Encapsulator import dev.inmo.tgbotapi.types.hashField -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.UnknownEncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement import dev.inmo.tgbotapi.types.typeField import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.nonstrictJsonFormat diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedPersonalDetails.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedPersonalDetails.kt similarity index 65% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedPersonalDetails.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedPersonalDetails.kt index e3f25ec6df..3e79d2370d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedPersonalDetails.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/EncryptedPersonalDetails.kt @@ -1,10 +1,10 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.dataField -import dev.inmo.tgbotapi.types.passport.EncryptedData -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData +import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithData import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Passport.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/Passport.kt similarity index 89% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Passport.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/Passport.kt index 9cf858b00e..c23fb1857f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Passport.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/Passport.kt @@ -1,9 +1,9 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.passport.EncryptedData -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.* +import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PassportFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/PassportFile.kt similarity index 92% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PassportFile.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/PassportFile.kt index cf00e2fc2a..675105120b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PassportFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/PassportFile.kt @@ -1,4 +1,4 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.types.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PhoneNumber.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/PhoneNumber.kt similarity index 70% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PhoneNumber.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/PhoneNumber.kt index 48c74f2350..3d70962190 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PhoneNumber.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/PhoneNumber.kt @@ -1,9 +1,9 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.hashField -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithPhoneNumber +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithPhoneNumber import dev.inmo.tgbotapi.types.phoneNumberField import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableFilesCollection.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/TranslatableFilesCollection.kt similarity index 94% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableFilesCollection.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/TranslatableFilesCollection.kt index 1ad210ca6b..377aad5ce2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableFilesCollection.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/TranslatableFilesCollection.kt @@ -1,8 +1,8 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.* +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableIDDocument.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/TranslatableIDDocument.kt similarity index 90% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableIDDocument.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/TranslatableIDDocument.kt index dc7eb6caed..e20de95245 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableIDDocument.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/TranslatableIDDocument.kt @@ -1,9 +1,9 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data +package dev.inmo.tgbotapi.types.passport.encrypted import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.passport.EncryptedData -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.* +import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/EncryptedPassportElement.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement.kt similarity index 81% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/EncryptedPassportElement.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement.kt index d2389194de..6bf1d843df 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/EncryptedPassportElement.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement.kt @@ -1,8 +1,8 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts import dev.inmo.micro_utils.crypto.SourceBytes import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonObject diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/FilesCollection.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/FilesCollection.kt new file mode 100644 index 0000000000..bf50a864b2 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/FilesCollection.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile +import kotlinx.serialization.Serializable + +@Serializable(EncryptedElementSerializer::class) +interface FilesCollection : EncryptedPassportElement { + val files: List +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/Translatable.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/Translatable.kt new file mode 100644 index 0000000000..c538e91d17 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/Translatable.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile +import kotlinx.serialization.Serializable + +@Serializable(EncryptedElementSerializer::class) +interface Translatable : EncryptedPassportElement { + val translations: List +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithData.kt new file mode 100644 index 0000000000..9e464fec51 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithData.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer +import kotlinx.serialization.Serializable + +@Serializable(EncryptedElementSerializer::class) +interface WithData : EncryptedPassportElement { + val data: EncryptedData +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithEmail.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithEmail.kt similarity index 52% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithEmail.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithEmail.kt index 57b069a55f..0442d15771 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithEmail.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithEmail.kt @@ -1,6 +1,6 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer import kotlinx.serialization.Serializable @Serializable(EncryptedElementSerializer::class) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithFrontSide.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithFrontSide.kt new file mode 100644 index 0000000000..396ef60aea --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithFrontSide.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile +import kotlinx.serialization.Serializable + +@Serializable(EncryptedElementSerializer::class) +interface WithFrontSide : EncryptedPassportElement { + val frontSide: PassportFile? +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithPhoneNumber.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithPhoneNumber.kt similarity index 54% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithPhoneNumber.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithPhoneNumber.kt index 47e1ecdf30..9181eba0e4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithPhoneNumber.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithPhoneNumber.kt @@ -1,6 +1,6 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer import kotlinx.serialization.Serializable @Serializable(EncryptedElementSerializer::class) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithReverseSide.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithReverseSide.kt new file mode 100644 index 0000000000..47d443c3ec --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithReverseSide.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile +import kotlinx.serialization.Serializable + +@Serializable(EncryptedElementSerializer::class) +interface WithReverseSide : EncryptedPassportElement { + val reverseSide: PassportFile? +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithSelfie.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithSelfie.kt new file mode 100644 index 0000000000..6928c2c311 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/WithSelfie.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.passport.encrypted.abstracts + +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer +import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile +import kotlinx.serialization.Serializable + +@Serializable(EncryptedElementSerializer::class) +interface WithSelfie : EncryptedPassportElement { + val selfie: PassportFile? +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/FilesCollection.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/FilesCollection.kt deleted file mode 100644 index aa58eb3ecc..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/FilesCollection.kt +++ /dev/null @@ -1,10 +0,0 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts - -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer -import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile -import kotlinx.serialization.Serializable - -@Serializable(EncryptedElementSerializer::class) -interface FilesCollection : EncryptedPassportElement { - val files: List -} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/Translatable.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/Translatable.kt deleted file mode 100644 index 0e7d7f0af9..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/Translatable.kt +++ /dev/null @@ -1,10 +0,0 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts - -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer -import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile -import kotlinx.serialization.Serializable - -@Serializable(EncryptedElementSerializer::class) -interface Translatable : EncryptedPassportElement { - val translations: List -} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithData.kt deleted file mode 100644 index 163b9d43b6..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithData.kt +++ /dev/null @@ -1,10 +0,0 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts - -import dev.inmo.tgbotapi.types.passport.EncryptedData -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer -import kotlinx.serialization.Serializable - -@Serializable(EncryptedElementSerializer::class) -interface WithData : EncryptedPassportElement { - val data: EncryptedData -} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithFrontSide.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithFrontSide.kt deleted file mode 100644 index 400ffae9cd..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithFrontSide.kt +++ /dev/null @@ -1,10 +0,0 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts - -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer -import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile -import kotlinx.serialization.Serializable - -@Serializable(EncryptedElementSerializer::class) -interface WithFrontSide : EncryptedPassportElement { - val frontSide: PassportFile? -} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithReverseSide.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithReverseSide.kt deleted file mode 100644 index 059b517955..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithReverseSide.kt +++ /dev/null @@ -1,10 +0,0 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts - -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer -import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile -import kotlinx.serialization.Serializable - -@Serializable(EncryptedElementSerializer::class) -interface WithReverseSide : EncryptedPassportElement { - val reverseSide: PassportFile? -} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithSelfie.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithSelfie.kt deleted file mode 100644 index fed2706bab..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/abstracts/WithSelfie.kt +++ /dev/null @@ -1,10 +0,0 @@ -package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts - -import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer -import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile -import kotlinx.serialization.Serializable - -@Serializable(EncryptedElementSerializer::class) -interface WithSelfie : EncryptedPassportElement { - val selfie: PassportFile? -} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/passport/DecryptionContext.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/passport/DecryptionContext.kt index eb5367fe1e..cf0e4e7624 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/passport/DecryptionContext.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/passport/DecryptionContext.kt @@ -3,9 +3,8 @@ package dev.inmo.tgbotapi.utils.passport import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.DownloadFile import dev.inmo.tgbotapi.requests.get.GetFile -import dev.inmo.tgbotapi.types.passport.EncryptedCredentials -import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData +import dev.inmo.tgbotapi.types.passport.credentials.EncryptedCredentials +import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile import dev.inmo.tgbotapi.utils.nonstrictJsonFormat import kotlinx.serialization.json.JsonObject diff --git a/tgbotapi.core/src/jsTest/kotlin/dev/inmo/tgbotapi/passport/DecryptionTestKeys.kt b/tgbotapi.core/src/jsTest/kotlin/dev/inmo/tgbotapi/passport/DecryptionTestKeys.kt deleted file mode 100644 index e82a07397c..0000000000 --- a/tgbotapi.core/src/jsTest/kotlin/dev/inmo/tgbotapi/passport/DecryptionTestKeys.kt +++ /dev/null @@ -1,32 +0,0 @@ -package dev.inmo.tgbotapi.passport - -import dev.inmo.tgbotapi.types.passport.EncryptedAndBase64EncodedData - -//actual val privateKey = """-----BEGIN RSA PRIVATE KEY----- -//MIIEowIBAAKCAQEAt0hdC7xyjrRAXxqrd5i06haPfKLdAvRWsPy2yWtYTFom5dBj -//atMUnFKekTwsmhKbRPBoqF7Da0RF+/Y9q9zmZv05+tNz2FEYGJ6o7r/gdAEX+pKs -//Hd84avm9RahGOwbZgcE8r8Md/tg/ZJCSMsVElzM/Gw02+U1uJQE4n/E2AATbRl0M -//oWdyXjh6Zk6HMiTCvhtQOHoMa9yI00wmHVAlZonovZSRQ2mqfwPlbkDhjsDUQMZp -//WcSPQblAd8FLcWsR1Mh86rQl1GxZVWYONaNwoeATe4p6Ng438HCL7jO7nc4jXJwp -//xqwGI9eUYlHolApBeMQK7oEYDTQ+e0iTvFryPQIDAQABAoIBAAnV81BW65rm53Fz -//H/KKGmNZlJeuscefzysuVKzYeuOWDvJUTZGFBF0jPekzXn1iNDzt3d/zPe96uXq9 -//CzA26ZJrUno4cMYSDAX+NbiiSWxQRrYmut/bg86R2mtrjWFLi86fzR7tjKWJe1Vt -//QLtCxNyMXn2YJvQYCKopt501t50mjkgR3xM375cfVmpomcZXh1K+z4ZxFVzivjvK -//ZAga3BPQ/hd6dhnwUdB/yFZFao1dDmsvJVjsnjpnWD3uqtciTeg2iqtXVLpaLfbJ -//gWOt5P94uIP5r1+qvyrrPXzUGONm4l+43zgvleEgAXWGxnutsYaFfazVQ6qOVyE7 -//fGMQfcECgYEA5Zt1fwTVoYIohq4Do/y5TnNcoj4AajXZU1OutFcPM3aNex16UPBW -//hP7Gakq3TwTKxEILDqOwo86IJuG+lX18kUwaj1f/3T0kDFvE6iLimiPYRNByog4c -//Z5Kwqn+vrnl4ciRDoz7jJsURms2PE7mYV7bndA24Gb0FZJRWiB1xI+0CgYEAzFm7 -//uTSyzacTsqorkyUFIwoGgMIE5NDBQNCVhflJcrmuHRYNwxkH9HRCXqyeHKLiNPRa -//zAoBo3WynjActoy0tFJ90qZI1203iT9BMRbPDiZEXnMH4MrWmk7e7poAUsPVKaRr -//hxvHjr2gTOLY0ClolMvnyNxZcZ/jBxAG0WwK3ZECgYEAwSkdmbQZfPwg19zBF05f -//Ho6SmbMLak7O+/jkerbbBPJxZ+eOpVTrlIs5pOYifImNg7oDz1cKHWR8yikTynN9 -//PkcF+R2RFTCAiR0S9d5PQFlzccDjD05Lux5/HZC53VA3cd7sQAOB2XXkr5TLD08N -//yI0I/mskPBL23Hymp3ANZKkCgYAO2fqttCnGjnz9ACcYk5ky+biNRQyMAKv65O3p -//BbwTzXDdBkxLwJb2ajikntEC7ceY56VtrNB/q78mhgKgNcuwS0p/s7wZhAOEQwee -//5LR5p8hSQPPyn2tHXbIQDzs0yKzGUP/LmvY+5oMu81Gkl03VephG3dTWUDN0wPJt -//5/dGMQKBgE++3BNLLV8siedqwjhSrRB/KmpbLPtoOUlRJYBfG+oITgl/d/W2NKOg -//C5GztdiZUKlHsvvcYoAAWrgEE3bKg+D7GI15yzAjQQZH6AOgL+CEnunIHBaxEEgG -//RS39yB/kPcn9ZtvcJd9v8myQnQjhco8Z2RUwb6IUIoOBvZlSGhGe -//-----END RSA PRIVATE KEY-----""" -//actual val encryptedLoremIpsum: EncryptedAndBase64EncodedData = "KeuPVezTbMW4MvOGJFTAt34PRaL9iepGb1g4QEi5EQYjKXeXo7RytFOCVx6pW9O/uoMWhl+cX32kNqJVWyK7a22kuhnNT2+aiXqEpuh+madx+LK1zUvGDR1A1Mrf3fFOugcnadCQKICiqvl9cFdqsBkJQOFEs9qj5wiu1F57kekuHLWI7ZnHOojkRNq7l1aCHL0DxcLCfZW5CtWAi8g/zUE5WnGd+vUZ+hqc1vnehDul8JE8YUQbAiIxetzba9XoWouTHYZRZcNCztDbrRBYnq2UCcI5adEwQ3VNcES0lIjRuwn1BBWpvk7VOjqh+4c2tSebDX5AkqrO8XwQYwo8OwvZF+hUXFRK6QLHd4B1JQIdygCaEODG0X353upiEKJXDBqv/ZMXR9KqYZBZEfu48ZM/J6heNjVSOP4TSDrXywJgIOieu8mrQ4d7Or7Twnsu/B+bqS37PvVlfU4wHLl7ehXFj4Kusat6cIrb0R4F/Y3fL4+FcfEsk4ioEAndYBFrc1S11vo/TkcuFnXtqrr181gC5JD5LtsUH6sst36vE/JdL/UwTGqhu+rDUcgvr7FiunkasWBnzCtFs58JJrRycUKPzyKINS16GkY8yYtp7xJXBGPYOFM+J7npcKW7P41j1KceDaUArjph2yIELEXCr8qUZzWXZdrw96Te8gLi99c=" diff --git a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/passport/CredentialsDecryptor.kt b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/passport/CredentialsDecryptor.kt new file mode 100644 index 0000000000..d2bffb492e --- /dev/null +++ b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/passport/CredentialsDecryptor.kt @@ -0,0 +1,2 @@ +package dev.inmo.tgbotapi.utils.passport + diff --git a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/passport/DecryptionContextRealization.kt b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/passport/PKCS8Decryptor.kt similarity index 100% rename from tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/passport/DecryptionContextRealization.kt rename to tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/passport/PKCS8Decryptor.kt diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt index 341f786dd8..5e19524a04 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.PassportMessage import dev.inmo.tgbotapi.types.passport.PassportData import dev.inmo.tgbotapi.types.passport.PassportElementError -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement import dev.inmo.tgbotapi.utils.passport.Decryptor suspend fun TelegramBot.setPassportDataErrors( diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt index 1e043d5901..309a4705d0 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt @@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.PassportMessage import dev.inmo.tgbotapi.types.passport.PassportData -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement import dev.inmo.tgbotapi.utils.RiskFeature import kotlinx.coroutines.flow.toList diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt index 5b2520fc11..971a55419f 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat import dev.inmo.tgbotapi.types.message.PassportMessage -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement suspend inline fun BehaviourContext.onPassportMessageWith( includeFilterByChatInBehaviourSubContext: Boolean = true, diff --git a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt index 95b212fe0d..9f25cd2f6f 100644 --- a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt +++ b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt @@ -38,8 +38,8 @@ import dev.inmo.tgbotapi.types.message.content.abstracts.* import dev.inmo.tgbotapi.types.message.content.media.* import dev.inmo.tgbotapi.types.message.payments.InvoiceContent import dev.inmo.tgbotapi.types.passport.* -import dev.inmo.tgbotapi.types.passport.encrypted_data.* -import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.* +import dev.inmo.tgbotapi.types.passport.encrypted.* +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* import dev.inmo.tgbotapi.types.polls.* import dev.inmo.tgbotapi.types.update.* import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.*