diff --git a/Skyflow/build.gradle b/Skyflow/build.gradle index 15f0581..024f113 100644 --- a/Skyflow/build.gradle +++ b/Skyflow/build.gradle @@ -4,6 +4,7 @@ plugins { id 'maven-publish' } apply plugin: 'kotlin-android' +apply plugin: 'kotlinx-serialization' //group='com.github.skyflowapi' //version = rootProject.ext.versionName ext { @@ -143,6 +144,9 @@ dependencies { testImplementation "org.robolectric:robolectric:4.6.1" testImplementation 'io.mockk:mockk:1.8.5' androidTestImplementation "org.robolectric:robolectric:4.6.1" + implementation "org.jetbrains.kotlin:kotlin-reflect:1.6.21" + implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3' + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1") } publish.dependsOn assemble diff --git a/Skyflow/src/main/kotlin/Skyflow/Callback.kt b/Skyflow/src/main/kotlin/Skyflow/Callback.kt index 64243cc..a014604 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Callback.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Callback.kt @@ -1,9 +1,17 @@ package Skyflow - +@Description("Contains the results of the implementation of callback.") interface Callback { - fun onSuccess(responseBody: Any) + @Description("Implementation when callback results in success.") + fun onSuccess( + @Description("The success response.") + responseBody: Any + ) - fun onFailure(exception: Any) + @Description("Implementation when callback results in failure.") + fun onFailure( + @Description("The failure response.") + exception: Any + ) } \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/Client.kt b/Skyflow/src/main/kotlin/Skyflow/Client.kt index 8965239..f53856f 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Client.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Client.kt @@ -14,7 +14,9 @@ import javax.xml.parsers.DocumentBuilderFactory import kotlin.Exception import kotlin.reflect.KClass +@Description("Contains an instance of the Skyflow client.") class Client internal constructor( + @Description("Skyflow client initialization includes configuration options.") val configuration: Configuration, ){ internal val tag = Client::class.qualifiedName @@ -23,7 +25,16 @@ class Client internal constructor( configuration.tokenProvider,configuration.options.logLevel) internal val elementMap = HashMap() - fun insert(records: JSONObject, options: InsertOptions? = InsertOptions(), callback: Callback){ + + @Description("Inserts data into the vault.") + fun insert( + @Description("Records to insert.") + records: JSONObject, + @Description("Options for the insertion.") + options: InsertOptions? = InsertOptions(), + @Description("Implementation of Skyflow.Callback.") + callback: Callback + ){ try { Utils.checkVaultDetails(configuration) Logger.info(tag, Messages.INSERTING_RECORDS.getMessage(configuration.vaultID), configuration.options.logLevel) @@ -34,7 +45,14 @@ class Client internal constructor( callback.onFailure(e) } } - fun detokenize(records: JSONObject, callback: Callback) { + + @Description("Retrieves record the data using tokens.") + fun detokenize( + @Description("Tokens to return values for.") + records: JSONObject, + @Description("Implementation of Skyflow.Callback.") + callback: Callback + ) { try { Utils.checkVaultDetails(configuration) this.apiClient.get(records,loggingCallback(callback, Messages.DETOKENIZE_SUCCESS.getMessage())) @@ -45,8 +63,13 @@ class Client internal constructor( } } - fun getById(records: JSONObject, callback: Callback) - { + @Description("Reveal records by Skyflow ID.") + fun getById( + @Description("Records to fetch.") + records: JSONObject, + @Description("Implementation of Skyflow.Callback.") + callback: Callback + ){ Logger.info(tag, Messages.GET_BY_ID_CALLED.getMessage(), configuration.options.logLevel) try { Utils.checkVaultDetails(configuration) @@ -173,8 +196,11 @@ class Client internal constructor( return result } - - fun container(type: KClass) : Container{ + @Description("Creates a container.") + fun container( + @Description("Type of the container.") + type: KClass + ) : Container{ if(type == ContainerType.COLLECT){ Logger.info(tag, Messages.COLLECT_CONTAINER_CREATED.getMessage(), configuration.options.logLevel) } @@ -199,4 +225,3 @@ class Client internal constructor( } - diff --git a/Skyflow/src/main/kotlin/Skyflow/CollectContainer.kt b/Skyflow/src/main/kotlin/Skyflow/CollectContainer.kt index 14457f6..449a1d4 100644 --- a/Skyflow/src/main/kotlin/Skyflow/CollectContainer.kt +++ b/Skyflow/src/main/kotlin/Skyflow/CollectContainer.kt @@ -10,7 +10,7 @@ import com.Skyflow.core.container.ContainerProtocol import org.json.JSONObject import java.util.* - +@Description("Contains all the Collect Elements.") open class CollectContainer : ContainerProtocol { } @@ -18,7 +18,15 @@ open class CollectContainer : ContainerProtocol { private val tag = CollectContainer::class.qualifiedName -fun Container.create(context: Context, input : CollectElementInput, options : CollectElementOptions = CollectElementOptions()) : TextField +@Description("Creates a Collect Element.") +fun Container.create( + @Description("Takes an Android Context object.") + context: Context, + @Description("Configuration for a Collect Element.") + input : CollectElementInput, + @Description("Additional options for a Collect Element.") + options : CollectElementOptions = CollectElementOptions() +) : TextField { Logger.info(tag, Messages.CREATED_COLLECT_ELEMENT.getMessage(input.label), configuration.options.logLevel) val collectElement = TextField(context, configuration.options) @@ -30,7 +38,13 @@ fun Container.create(context: Context, input : CollectElementI return collectElement } -fun Container.collect(callback: Callback, options: CollectOptions? = CollectOptions()){ +@Description("Collects data and inserts it into a vault.") +fun Container.collect( + @Description("Implementation of Skyflow.Callback.") + callback: Callback, + @Description("Additional collect options.") + options: CollectOptions? = CollectOptions() +){ try { Utils.checkVaultDetails(client.configuration) Logger.info(tag, Messages.VALIDATE_COLLECT_RECORDS.getMessage(), configuration.options.logLevel) diff --git a/Skyflow/src/main/kotlin/Skyflow/CollectElementInput.kt b/Skyflow/src/main/kotlin/Skyflow/CollectElementInput.kt index 79fd79f..40093d7 100644 --- a/Skyflow/src/main/kotlin/Skyflow/CollectElementInput.kt +++ b/Skyflow/src/main/kotlin/Skyflow/CollectElementInput.kt @@ -2,11 +2,28 @@ package Skyflow import com.Skyflow.collect.elements.validations.ValidationSet -class CollectElementInput(internal var table: String? = null, internal var column: String? = null, internal var type: SkyflowElementType, - internal var inputStyles: Styles = Styles(), internal var labelStyles:Styles=Styles(), internal var errorTextStyles:Styles=Styles(), - internal var label: String = "", - internal var placeholder: String = "", - @Deprecated("altText parameter is deprecated" , level = DeprecationLevel.WARNING) internal var altText: String = "", - internal var validations : ValidationSet = ValidationSet() +@Description("Configuration for a Collect Element.") +class CollectElementInput( + @Description("Table that the data belongs to.") + internal var table: String? = null, + @Description("Column that the data belongs to.") + internal var column: String? = null, + @Description("Type of the element.") + internal var type: SkyflowElementType, + @Description("Styles for the element.") + internal var inputStyles: Styles = Styles(), + @Description("Styles for the element's label.") + internal var labelStyles:Styles=Styles(), + @Description("Styles for the element's error text.") + internal var errorTextStyles:Styles=Styles(), + @Description("Label for the element.") + internal var label: String = "", + @Description("Placeholder text for the element.") + internal var placeholder: String = "", + @Description("Alt text for the element.") + @Deprecated("altText parameter is deprecated" , level = DeprecationLevel.WARNING) + internal var altText: String = "", + @Description("Input validation rules for the element.") + internal var validations : ValidationSet = ValidationSet() ) { } \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/CollectElementOptions.kt b/Skyflow/src/main/kotlin/Skyflow/CollectElementOptions.kt index 9e4253f..420b2fe 100644 --- a/Skyflow/src/main/kotlin/Skyflow/CollectElementOptions.kt +++ b/Skyflow/src/main/kotlin/Skyflow/CollectElementOptions.kt @@ -1,8 +1,12 @@ package Skyflow +@Description("Contains the additional options for Collect Element.") class CollectElementOptions( + @Description("If `true`, the field is required. Defaults to `false`.") var required:Boolean = false, + @Description("If `true`, enables the card icon. Defaults to `true`.") var enableCardIcon : Boolean = true, + @Description("Format of the Collect element.") var format: String = "" ) { } \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/CollectOptions.kt b/Skyflow/src/main/kotlin/Skyflow/CollectOptions.kt index a07417c..e9321f0 100644 --- a/Skyflow/src/main/kotlin/Skyflow/CollectOptions.kt +++ b/Skyflow/src/main/kotlin/Skyflow/CollectOptions.kt @@ -3,5 +3,13 @@ package Skyflow import org.json.JSONArray import org.json.JSONObject -class CollectOptions(val token:Boolean = true, val additionalFields: JSONObject? = null, val upsert : JSONArray? = null) { +@Description("Options for a Collect Element.") +class CollectOptions( + @Description("If `true`, returns tokens for the collected data. Defaults to `true`.") + val token:Boolean = true, + @Description("Additional, non-sensitive data to insert into the vault. Uses the format of a [`records`](https://docs.skyflow.com/record/#RecordService_InsertRecord) object.") + val additionalFields: JSONObject? = null, + @Description("Upsert configuration for the element.") + val upsert : JSONArray? = null +) { } \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/Configuration.kt b/Skyflow/src/main/kotlin/Skyflow/Configuration.kt index 9fb525a..aec0a11 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Configuration.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Configuration.kt @@ -1,11 +1,15 @@ package Skyflow - +@Description("Parameters to initialize a Skyflow client.") class Configuration( + @Description("ID of the vault to connect to.") val vaultID: String = "", + @Description("URL of the vault to connect to.") var vaultURL: String = "", + @Description("An implementation of the token provider interface.") val tokenProvider: TokenProvider, + @Description("Additional options for configuration.") val options: Options = Options(), ){ init { diff --git a/Skyflow/src/main/kotlin/Skyflow/ContainerType.kt b/Skyflow/src/main/kotlin/Skyflow/ContainerType.kt index 3bebb81..d5f464f 100644 --- a/Skyflow/src/main/kotlin/Skyflow/ContainerType.kt +++ b/Skyflow/src/main/kotlin/Skyflow/ContainerType.kt @@ -1,5 +1,6 @@ package Skyflow +@Description("Skyflow container types.") class ContainerType { companion object{ val COLLECT = CollectContainer::class; diff --git a/Skyflow/src/main/kotlin/Skyflow/Description.kt b/Skyflow/src/main/kotlin/Skyflow/Description.kt new file mode 100644 index 0000000..038bf44 --- /dev/null +++ b/Skyflow/src/main/kotlin/Skyflow/Description.kt @@ -0,0 +1,3 @@ +package Skyflow + +annotation class Description(val text: String) \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/ElementType.kt b/Skyflow/src/main/kotlin/Skyflow/ElementType.kt index 5625038..45168d3 100644 --- a/Skyflow/src/main/kotlin/Skyflow/ElementType.kt +++ b/Skyflow/src/main/kotlin/Skyflow/ElementType.kt @@ -15,6 +15,7 @@ class Type(var formatPattern:String, var regex: String, } +@Description("Skyflow Element types.") enum class SkyflowElementType { diff --git a/Skyflow/src/main/kotlin/Skyflow/Env.kt b/Skyflow/src/main/kotlin/Skyflow/Env.kt index 787aec4..69b0afa 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Env.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Env.kt @@ -1,5 +1,6 @@ package Skyflow +@Description("Supported environments.") enum class Env { DEV, PROD diff --git a/Skyflow/src/main/kotlin/Skyflow/GenJson.kt b/Skyflow/src/main/kotlin/Skyflow/GenJson.kt new file mode 100644 index 0000000..4446589 --- /dev/null +++ b/Skyflow/src/main/kotlin/Skyflow/GenJson.kt @@ -0,0 +1,313 @@ +package com.Skyflow + +import Skyflow.Description +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import kotlin.reflect.KParameter +import com.fasterxml.jackson.databind.SerializationFeature +import kotlinx.serialization.Serializable +import java.io.File +import kotlin.reflect.* +//import java.lang.reflect.Modifier +import kotlin.reflect.KVisibility +import kotlin.reflect.full.* +import kotlin.reflect.jvm.* + +@Serializable +data class Arg(val name: String, val type: String, val description: String?) +@Serializable +data class Method(val name: String, val args: List, val description: String?, val returnType: String) +@Serializable +data class CompanionObject(val properties:List, val methods: List) +@Serializable +data class ClassInfo( + val name: String, + val type: String, + val args: List, + var methods: List, + val enumValues: List, + val companionObject: CompanionObject?, + val description: String? +) + +/** + * Student Class with name and age + * @property name name of student + * @property age age of student + */ +class Student(val name: String, val age: Int) { + + /** + * Description for display + */ + @Description("Random method in Student class") + fun display() { + println("$name is $age years old") + } + + /** + * Random method in Student class + * @param arg1 argument 1 + * @param arg2 argument 2 + */ + @Description("Random method in Student class") + @Deprecated("Support for this method will be removed soon. Please contact admin", level = DeprecationLevel.WARNING) + fun method(arg1: String, arg2: String) { + println(arg1) + println(arg2) + } +} +class GenJson {} + +fun getReturnType(returnType: String): String { + if(returnType == "void") { + return "Unit" + } + else return returnType +} +fun getMethodDetails(method: KFunction<*>): Method { + return if (method.parameters.isNotEmpty()) { + Method( + method.name, + method.parameters + .filterNot { it.kind == KParameter.Kind.INSTANCE } + .map { + val type = it.type + + val typeName = if (type.classifier == null) { + "null" + } else if (type.arguments.isNotEmpty() && type.classifier is KClass<*>) { + val containerTypeName = (type.classifier as KClass<*>).simpleName + var typeArgs = type.arguments.map { arg -> arg.type?.classifier }.joinToString(", ") + "$containerTypeName<$typeArgs>" + } else { + (type.classifier as KClass<*>).simpleName ?: "null" + } + Arg( + it.name.toString(), + typeName, + it.findAnnotation()?.text ?: "" + ) + }, + method.findAnnotation()?.text ?: "", + getReturnType(method.javaMethod?.returnType?.simpleName.toString()) + ) + } else { + Method( + method.name, + emptyList(), + method.findAnnotation()?.text ?: "", + getReturnType(method.javaMethod?.returnType?.simpleName.toString()) + ) + } +} + +fun getCompanionObjectDetails(module: KClass): CompanionObject { + // get properties and methods defined inside companion object + val properties = module.companionObject?.declaredMemberProperties + ?.map { + val type = it.returnType + + val typeName = if (type.classifier == null) { + "null" + } else if (type.arguments.isNotEmpty() && type.classifier is KClass<*>) { + val containerTypeName = (type.classifier as KClass<*>).simpleName + var typeArgs = type.arguments.map { arg -> (arg.type?.classifier as KClass<*>).simpleName }.joinToString(", ") + "$containerTypeName<$typeArgs>" + } else { + (type.classifier as KClass<*>).simpleName ?: "null" + } + Arg( + it.name, + typeName, + it.findAnnotation()?.text ?: "" + )}!! + val methods = module.companionObject?.declaredFunctions + ?.filterNot { method -> method.hasAnnotation() } + ?.filterNot { method -> method.visibility == KVisibility.INTERNAL } + ?.map { method -> getMethodDetails(method) }!! + return CompanionObject(properties, methods) +} + +fun main() { + // This list is for classes + val packages = listOf("Client", "Configuration", "TokenProvider", "LogLevel", "Env", "utils.EventName", "ContainerType", "Callback", "Options", + "CollectElementInput", "CollectElementOptions", "CollectOptions", "RevealElementInput", "RevealElementOptions", "RevealOptions", + "InsertOptions", "SkyflowElementType", "RedactionType", "Styles", "Style", "Padding", "CollectContainer", "RevealContainer") + + // If a file has class and methods outside class. Provide it in both lists to get class details from above list and methods details outside class from below + + // This list is for files that have methods outside the class or with no class. Provide whole filename along with Kt extension. + val ktPackages = listOf("CollectContainerKt", "RevealContainerKt", "InitKt") + var list = listOf() + var args: List + var methods: List + var enumValues: List + var companionObject: CompanionObject? + var classInfo: ClassInfo + + for( packageName in packages) { + val module = Class.forName("Skyflow."+packageName).kotlin + + // check for enum Class + if(module.java.isEnum) { + + // get enum values + enumValues = module.java.enumConstants.map { it.toString() } + + // get methods in the class + methods = module.declaredFunctions + .filterNot { method -> method.hasAnnotation() } + .filterNot { method -> method.visibility == KVisibility.INTERNAL } + .filterNot { method -> method.name == "valueOf" || method.name == "values"} + .map { method -> getMethodDetails(method) } + + // get companion object details + companionObject = if(module.companionObject?.isCompanion == true) { + getCompanionObjectDetails(module) + } else { + null + } + + // class details + classInfo = ClassInfo( + module.simpleName ?: "", + "enum", + emptyList(), + methods, + enumValues, + companionObject, + module.findAnnotation()?.text ?: "" + ) + + list += classInfo + } + else { + // get constructor arguments + args = when (module.java.isInterface) { + true -> emptyList() + false -> module.constructors?.first() + ?.parameters.map { + val type = it.type + + val typeName = if (type.classifier == null) { + "null" + } else if (type.arguments.isNotEmpty() && type.classifier is KClass<*>) { + val containerTypeName = (type.classifier as KClass<*>).simpleName + var typeArgs = type.arguments.map { arg -> (arg.type?.classifier as KClass<*>).simpleName }.joinToString(", ") +// if(module.simpleName == "ContainerType") println("$containerTypeName<$typeArgs>") + "$containerTypeName<$typeArgs>" + } else { + (type.classifier as KClass<*>).simpleName ?: "null" + } +// if(module.simpleName == "CollectElementInput") { +// println(it.name + " " + it.annotations.toString() + " " + it.hasAnnotation()) +// } + Arg( + it.name!!, + typeName, + it.findAnnotation()?.message ?: it.findAnnotation()?.text ?: "" + ) + } + } + + methods = module.declaredFunctions +// .filterNot { method -> method.hasAnnotation() } + .filterNot { method -> method.visibility == KVisibility.INTERNAL } + .map { method -> getMethodDetails(method) } + + companionObject = if(module.companionObject?.isCompanion == true) { + getCompanionObjectDetails(module) + } else { + null + } + + classInfo = ClassInfo( + module.simpleName ?: "", + if (module.java.isInterface) "interface" else "class", + args, + methods, + emptyList(), + companionObject, + module.findAnnotation()?.text ?: "" + ) + list += classInfo + } + } + + for( ktPackage in ktPackages) { + val module = Class.forName("Skyflow."+ktPackage) + + // to get methods outside class or from a file with no class + methods = module.declaredMethods +// .filterNot { method -> method.getAnnotation()() } + .filterNot { method -> method.kotlinFunction?.visibility == KVisibility.INTERNAL } + .filterNot { method -> method.name.contains("\$default")} + .map { method -> + if (method.kotlinFunction?.parameters?.isNotEmpty() == true) { + Method( + method.name, + method.kotlinFunction?.parameters!! + .filterNot { it.name.toString() == "null" } + .filterNot { it.kind == KParameter.Kind.INSTANCE } + .map { + val type = it.type + + val typeName = if (type.classifier == null) { + "null" + } else if (type.arguments.isNotEmpty() && type.classifier is KClass<*>) { + val containerTypeName = (type.classifier as KClass<*>).simpleName + var typeArgs = type.arguments.map { arg -> arg.type?.classifier }.joinToString(", ") + "$containerTypeName<$typeArgs>" + } else { + (type.classifier as KClass<*>).simpleName ?: "null" + } + Arg( + it.name.toString(), + typeName, + it.findAnnotation()?.text ?: "" + ) + }, + method.kotlinFunction?.findAnnotation()?.text ?: "", + getReturnType(method.returnType.simpleName.toString()) + ) + } else { + Method( + method.name, + emptyList(), + method.kotlinFunction?.findAnnotation()?.text ?: "", + getReturnType(method.returnType.simpleName.toString()) + ) + } + } + + // find class details in list + val obj = list.find { it.name == module.simpleName.replace("Kt", "") } + + // if class details present add methods to that object or create new class info + if(obj == null) { + classInfo = ClassInfo( + module.simpleName.replace("Kt", "") ?: "", + "", + emptyList(), + methods, + emptyList(), + null, + "" + ) + list += classInfo + } + else { + obj.methods += methods + } + } + + val mapper = jacksonObjectMapper().configure(SerializationFeature.INDENT_OUTPUT, true) + val json = mapper.writeValueAsString(list) + + // code to write JSON to file + val filename = "output.json" // replace with desired filename + val path = "docs/json/" // replace with desired path + val file = File("$path$filename") + file.writeText(json) + +} diff --git a/Skyflow/src/main/kotlin/Skyflow/GenMarkdown.kt b/Skyflow/src/main/kotlin/Skyflow/GenMarkdown.kt new file mode 100644 index 0000000..7dc2956 --- /dev/null +++ b/Skyflow/src/main/kotlin/Skyflow/GenMarkdown.kt @@ -0,0 +1,194 @@ +package Skyflow + +import com.Skyflow.* +import kotlinx.serialization.* +import kotlinx.serialization.json.* +import java.io.File + +fun generateArgList(args: List): StringBuilder { + val sb = StringBuilder() + for ((i, arg) in args.withIndex()) { + sb.append("\n ${arg.name}: ${arg.type}") + if (i != args.lastIndex) { + sb.append(",") + } + } + sb.append("\n ") + return sb +} + +fun generateTableForArgs(args: List): StringBuilder { + val sb = StringBuilder() + for ((i, arg) in args.withIndex()) { + sb.append("| ${arg.name} | ${arg.type} | ${arg.description} |\n") + } + return sb +} + +fun extractItemName(line: String): String { + val start = line.indexOf("[") + 1 + val end = line.indexOf("]") + return line.substring(start, end) +} + +fun sortValues(sb: StringBuilder): StringBuilder { + // Store lines in a list + val lines = sb.toString().split("\n").filter { it.isNotEmpty() } + + // Sort the lines based on item.name + val sortedLines = lines.sortedBy { extractItemName(it) } + + // Clear the StringBuilder + sb.setLength(0) + + // Append the sorted lines back to the StringBuilder + sortedLines.forEach { sb.append("$it\n") } + + // Print the sorted StringBuilder + return sb +} + +fun main() { + val jsonString = File("docs/json/output.json").readText() + val list = Json.decodeFromString>(jsonString) +// println(list) + +// .filter { item -> item.companionObject != null } + val overviewSb = StringBuilder() + val classSb = StringBuilder() + val staticMethodSb = StringBuilder().append("## Static Method\n\n") + val interfaceSb = StringBuilder() + val enumSb = StringBuilder() + list.forEach { item -> + val sb = StringBuilder() + var itemType = "" + sb.append("{% env enable=\"androidSdkRef\" %}\n\n") + sb.append("# Skyflow.${item.name}") + + if(item.type == "class" || item.type == "enum") { + itemType = "classes" + sb.append("\n\n## Class ${item.name}\n") + if(item.description?.isNotEmpty() == true) { + sb.append("${item.description}\n") + } + sb.append("\n```kotlin\n") + if(item.type == "enum") { + sb.append("enum ") + itemType = "enums" + } + sb.append("class ${item.name}") + if(item.args.isNotEmpty()) { + sb.append("(${generateArgList(item.args)})") + } + sb.append(" {") + + // Constructor +// if (item.args.isNotEmpty()) { +// sb.append("\n### Constructor\n\n") +// sb.append("```kotlin\n") +// sb.append(" constructor(") +// for ((i, arg) in item.args.withIndex()) { +// sb.append("${arg.name}: ${arg.type}") +// if (i != item.args.lastIndex) { +// sb.append(", ") +// } +// } +// sb.append(")\n") +// sb.append("```\n\n") +// } + if (item.companionObject != null) { + sb.append("\n\n### Companion object\n\n") + sb.append(" companion object {\n") + for (property in item.companionObject.properties) { + sb.append(" ${property.name}: ${property.type}\n") + } + sb.append(" }\n") + } + sb.append("}\n```") + + if(item.enumValues.isNotEmpty()) { + sb.append("\n\n### Enum Values\n\n") + sb.append("| Value |\n| --- |\n") + item.enumValues?.forEach { + sb.append("| ${it} |\n") + } +// sb.append("\n") + } + + if(item.args.isNotEmpty()) { + sb.append("\n\n### Parameters\n\n") + sb.append("| Name | Type | Description |\n| --- | --- | --- |\n") + sb.append("${generateTableForArgs(item.args)}") + } + } + else if (item.type == "interface") { + itemType = "interfaces" + sb.append("\n\n## Interface ${item.name}\n") + if(item.description?.isNotEmpty() == true) { + sb.append("${item.description}\n") + } + sb.append("\n```kotlin\n") + sb.append("interface ${item.name}") + + sb.append(" {}\n```") + + } + if(item.methods.isNotEmpty()) { + sb.append("\n\n## Functions\n") + for (method in item.methods) { + sb.append("\n### ${method.name}\n") + if(method.description?.isNotEmpty() == true) { + sb.append("${method.description}\n") + } + sb.append("\n```kotlin\n") + sb.append("fun ${method.name}(${generateArgList(method.args)}) : ${method.returnType} {}") + sb.append("\n```") + if(method.args.isNotEmpty()) { + sb.append("\n\n#### Parameters\n\n") + sb.append("| Name | Type | Description |\n| --- | --- | --- |\n") + sb.append("${generateTableForArgs(method.args)}") + } + } + } + sb.append("\n{% /env %}") + when (itemType) { + "classes" -> { + classSb.append("- [${item.name}](/sdks/skyflow-android/${itemType}/${item.name})\n") + } + "interfaces" -> { + interfaceSb.append("- [${item.name}](/sdks/skyflow-android/${itemType}/${item.name})\n") + } + "enums" -> { + enumSb.append("- [${item.name}](/sdks/skyflow-android/${itemType}/${item.name})\n") + } + "" -> { + staticMethodSb.append("[${item.name}](/sdks/skyflow-android/${item.name})\n") + } + } + val filename = "${item.name}.md" // replace with desired filename + var path = "docs/markdown/" // replace with desired path + if(itemType != "") + { + path = "docs/markdown/${itemType}/" + } + val directory = File(path) + if (!directory.exists()) { + directory.mkdirs() + } + val file = File("$path$filename") + file.writeText(sb.toString()) + } + overviewSb.append("{% env enable=\"androidSdkRef\" %}\n\n") + overviewSb.append("# Android\n\n") + overviewSb.append("Some documentation for overview page\n\n") + overviewSb.append("${staticMethodSb}\n") + overviewSb.append("## Classes\n\n") + overviewSb.append("${sortValues(classSb)}\n") + overviewSb.append("## Interfaces\n\n") + overviewSb.append("${sortValues(interfaceSb)}\n") + overviewSb.append("## Enums\n\n") + overviewSb.append("${sortValues(enumSb)}\n") + overviewSb.append("{% /env %}") + val overviewFile = File("docs/markdown/Overview.md") + overviewFile.writeText(overviewSb.toString()) +} \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/Init.kt b/Skyflow/src/main/kotlin/Skyflow/Init.kt index 04ed7b3..14b9347 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Init.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Init.kt @@ -4,8 +4,11 @@ import Skyflow.core.Logger import Skyflow.core.Messages import Skyflow.core.getMessage - -fun init(configuration: Configuration) : Client{ +@Description("Initializes the Skyflow client.") +fun init( + @Description("Configuration for the Skyflow client.") + configuration: Configuration +) : Client{ val tag = Client::class.qualifiedName Logger.info(tag, Messages.CLIENT_INITIALIZED.getMessage(), configuration.options.logLevel) return Client(configuration) diff --git a/Skyflow/src/main/kotlin/Skyflow/InsertOptions.kt b/Skyflow/src/main/kotlin/Skyflow/InsertOptions.kt index 328af6a..ea09540 100644 --- a/Skyflow/src/main/kotlin/Skyflow/InsertOptions.kt +++ b/Skyflow/src/main/kotlin/Skyflow/InsertOptions.kt @@ -2,7 +2,10 @@ package Skyflow import org.json.JSONArray +@Description("Additional parameters for the insert method.") class InsertOptions( + @Description("If `true`, returns tokens for the collected data. Defaults to `true`.") val tokens : Boolean = true, + @Description("Upsert configuration for the element.") val upsert : JSONArray? = null ){} \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/LogLevel.kt b/Skyflow/src/main/kotlin/Skyflow/LogLevel.kt index c39c93f..92d230e 100644 --- a/Skyflow/src/main/kotlin/Skyflow/LogLevel.kt +++ b/Skyflow/src/main/kotlin/Skyflow/LogLevel.kt @@ -1,5 +1,6 @@ package Skyflow +@Description("Supported log levels.") enum class LogLevel { DEBUG, INFO, diff --git a/Skyflow/src/main/kotlin/Skyflow/Options.kt b/Skyflow/src/main/kotlin/Skyflow/Options.kt index dfaab5e..9c50cec 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Options.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Options.kt @@ -1,4 +1,10 @@ package Skyflow -class Options(val logLevel: LogLevel = LogLevel.ERROR, val env: Env = Env.PROD) { +@Description("Additional configuration for the Skyflow client.") +class Options( + @Description("Log level for the client.") + val logLevel: LogLevel = LogLevel.ERROR, + @Description("Working environment.") + val env: Env = Env.PROD +) { } \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/Padding.kt b/Skyflow/src/main/kotlin/Skyflow/Padding.kt index d1c2582..fb1685e 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Padding.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Padding.kt @@ -1,3 +1,13 @@ package Skyflow -public class Padding(val left:Int=10,val top:Int=10,val right:Int=10,val bottom:Int=10) {} \ No newline at end of file +@Description("Padding for Collect Elements. Accepts left, top, right, and bottom padding values.") +public class Padding( + @Description("Value for left padding.") + val left:Int=10, + @Description("Value for top padding.") + val top:Int=10, + @Description("Value for right padding.") + val right:Int=10, + @Description("Value for bottom padding.") + val bottom:Int=10 +) {} \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/RedactionType.kt b/Skyflow/src/main/kotlin/Skyflow/RedactionType.kt index 702cf0b..ca61cd1 100644 --- a/Skyflow/src/main/kotlin/Skyflow/RedactionType.kt +++ b/Skyflow/src/main/kotlin/Skyflow/RedactionType.kt @@ -1,5 +1,6 @@ package Skyflow +@Description("Supported redaction types.") enum class RedactionType { DEFAULT, PLAIN_TEXT, diff --git a/Skyflow/src/main/kotlin/Skyflow/RevealContainer.kt b/Skyflow/src/main/kotlin/Skyflow/RevealContainer.kt index bc9cd62..c31bb68 100644 --- a/Skyflow/src/main/kotlin/Skyflow/RevealContainer.kt +++ b/Skyflow/src/main/kotlin/Skyflow/RevealContainer.kt @@ -12,15 +12,20 @@ import Skyflow.utils.Utils.Companion.checkIfElementsMounted import java.lang.Exception import java.util.* +@Description("Contains Reveal Elements.") class RevealContainer : ContainerProtocol { private val tag = RevealContainer::class.qualifiedName } private val tag = RevealContainer::class.qualifiedName +@Description("Creates a Skyflow Reveal Element.") fun Container.create( + @Description("An Android context element.") context: Context, + @Description("A Skyflow.RevealElementInput object.") input: RevealElementInput, + @Description("A Skyflow.RevealElementOptions object.") options: RevealElementOptions = RevealElementOptions() ): Label { Logger.info( @@ -40,8 +45,11 @@ fun Container.create( return revealElement } +@Description("Reveals data in the container.") fun Container.reveal( + @Description("Implementation of Skyflow.Callback.") callback: Callback, + @Description("Additional options for the reveal method.") options: RevealOptions? = RevealOptions() ) { try { diff --git a/Skyflow/src/main/kotlin/Skyflow/RevealElementInput.kt b/Skyflow/src/main/kotlin/Skyflow/RevealElementInput.kt index 1e132a1..bf0fa3a 100644 --- a/Skyflow/src/main/kotlin/Skyflow/RevealElementInput.kt +++ b/Skyflow/src/main/kotlin/Skyflow/RevealElementInput.kt @@ -1,11 +1,19 @@ package Skyflow +@Description("Configuration for Reveal Elements.") class RevealElementInput( + @Description("A token to retrieve the value of.") internal var token: String? = null, + @Description("Redaction type applied to the data. Defaults to `RedactionType.PLAIN_TEXT`.") internal var redaction: RedactionType? = RedactionType.PLAIN_TEXT, + @Description("Input styles for the Reveal Element.") internal var inputStyles: Styles = Styles(), + @Description("Styles for the Reveal Element's label.") internal var labelStyles: Styles = Styles(), + @Description("Styles for the Reveal Element's error text.") internal var errorTextStyles: Styles = Styles(), + @Description("Label for the Reveal Element.") internal var label: String = "", + @Description("Alternative text for the Reveal Element.") internal var altText: String = "" ) {} \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/RevealElementOptions.kt b/Skyflow/src/main/kotlin/Skyflow/RevealElementOptions.kt index 835d525..5157934 100644 --- a/Skyflow/src/main/kotlin/Skyflow/RevealElementOptions.kt +++ b/Skyflow/src/main/kotlin/Skyflow/RevealElementOptions.kt @@ -1,3 +1,9 @@ package Skyflow -class RevealElementOptions(var formatRegex : String = "",var replaceText:String? = null) {} \ No newline at end of file +@Description("Configuration options for a Reveal Element.") +class RevealElementOptions( + @Description("Format of the Reveal element.") + var formatRegex : String = "", + @Description("Text to replace with, when the format matches.") + var replaceText:String? = null +) {} \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/RevealOptions.kt b/Skyflow/src/main/kotlin/Skyflow/RevealOptions.kt index 9ae3cdb..74b347b 100644 --- a/Skyflow/src/main/kotlin/Skyflow/RevealOptions.kt +++ b/Skyflow/src/main/kotlin/Skyflow/RevealOptions.kt @@ -1,4 +1,5 @@ package Skyflow +@Description("Additional options for Reveal Elements.") class RevealOptions { } \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/Style.kt b/Skyflow/src/main/kotlin/Skyflow/Style.kt index 774a1be..e7f8a75 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Style.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Style.kt @@ -4,14 +4,21 @@ import android.graphics.Color import android.graphics.Typeface import android.view.Gravity - +@Description("Style options for elements.") class Style( + @Description("Color of the border.") borderColor: Int? = Color.BLACK, + @Description("Radius applied to the corners.") cornerRadius: Float? = 20f, + @Description("Padding for the element.") padding: Padding? = Padding(10,10,10,10), + @Description("Width of the border.") borderWidth: Int? = 2, + @Description("Type of font used.") font: Int? = Typeface.NORMAL, + @Description("Alignment of the text.") textAlignment: Int? = Gravity.LEFT, + @Description("Color of the text.") textColor: Int? = Color.BLACK) { var borderColor = borderColor ?: Color.BLACK diff --git a/Skyflow/src/main/kotlin/Skyflow/Styles.kt b/Skyflow/src/main/kotlin/Skyflow/Styles.kt index 4ae58cc..0fb174c 100644 --- a/Skyflow/src/main/kotlin/Skyflow/Styles.kt +++ b/Skyflow/src/main/kotlin/Skyflow/Styles.kt @@ -1,10 +1,17 @@ package Skyflow -public class Styles( base: Style? = Style(), - complete: Style? = Style(), - empty: Style? = Style(), - focus: Style? = Style(), - invalid: Style? = Style() +@Description("Styles to apply to elements.") +public class Styles( + @Description("Styles applied on skyflow elements in its base form.") + base: Style? = Style(), + @Description("Styles applied when value is valid.") + complete: Style? = Style(), + @Description("Styles applied when skyflow element is empty.") + empty: Style? = Style(), + @Description("Styles applied when skyflow element is focused.") + focus: Style? = Style(), + @Description("Styles applied when value is invalid.") + invalid: Style? = Style() ) { var base = base ?: Style() var complete = complete ?: Style() diff --git a/Skyflow/src/main/kotlin/Skyflow/TokenProvider.kt b/Skyflow/src/main/kotlin/Skyflow/TokenProvider.kt index 769142f..026a52d 100644 --- a/Skyflow/src/main/kotlin/Skyflow/TokenProvider.kt +++ b/Skyflow/src/main/kotlin/Skyflow/TokenProvider.kt @@ -1,6 +1,10 @@ package Skyflow - +@Description("Defines the behavior of a class that can provide a bearer token.") interface TokenProvider { - fun getBearerToken(callback: Callback) + @Description("Function that retrieves a Skyflow bearer token from your backend.") + fun getBearerToken( + @Description("Called when the bearer token is available.") + callback: Callback + ) } \ No newline at end of file diff --git a/Skyflow/src/main/kotlin/Skyflow/utils/EventName.kt b/Skyflow/src/main/kotlin/Skyflow/utils/EventName.kt index 99009e9..8328ff6 100644 --- a/Skyflow/src/main/kotlin/Skyflow/utils/EventName.kt +++ b/Skyflow/src/main/kotlin/Skyflow/utils/EventName.kt @@ -1,5 +1,8 @@ package Skyflow.utils +import Skyflow.Description + +@Description("Supported event names.") enum class EventName { CHANGE, READY, diff --git a/build.gradle b/build.gradle index 47fd402..edebf9e 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,7 @@ buildscript { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0' classpath "com.github.dcendents:android-maven-gradle-plugin:2.0" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/docs/json/output.json b/docs/json/output.json new file mode 100644 index 0000000..89e875e --- /dev/null +++ b/docs/json/output.json @@ -0,0 +1,557 @@ +[ { + "name" : "Client", + "type" : "class", + "args" : [ { + "name" : "configuration", + "type" : "Skyflow.Configuration", + "description" : "" + } ], + "methods" : [ { + "name" : "container", + "args" : [ { + "name" : "type", + "type" : "kotlin.reflect.KClass", + "description" : "" + } ], + "description" : "", + "returnType" : "Skyflow.Container" + }, { + "name" : "detokenize", + "args" : [ { + "name" : "records", + "type" : "org.json.JSONObject", + "description" : "" + }, { + "name" : "callback", + "type" : "Skyflow.Callback", + "description" : "" + } ], + "description" : "", + "returnType" : "kotlin.Unit" + }, { + "name" : "getById", + "args" : [ { + "name" : "records", + "type" : "org.json.JSONObject", + "description" : "This is getById records param" + }, { + "name" : "callback", + "type" : "Skyflow.Callback", + "description" : "This is getById callback param" + } ], + "description" : "This is getById function", + "returnType" : "kotlin.Unit" + }, { + "name" : "insert", + "args" : [ { + "name" : "records", + "type" : "org.json.JSONObject", + "description" : "" + }, { + "name" : "options", + "type" : "Skyflow.InsertOptions?", + "description" : "" + }, { + "name" : "callback", + "type" : "Skyflow.Callback", + "description" : "" + } ], + "description" : "", + "returnType" : "kotlin.Unit" + } ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "This is Client class" +}, { + "name" : "Configuration", + "type" : "class", + "args" : [ { + "name" : "vaultID", + "type" : "kotlin.String", + "description" : "" + }, { + "name" : "vaultURL", + "type" : "kotlin.String", + "description" : "" + }, { + "name" : "tokenProvider", + "type" : "Skyflow.TokenProvider", + "description" : "" + }, { + "name" : "options", + "type" : "Skyflow.Options", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "TokenProvider", + "type" : "interface", + "args" : [ ], + "methods" : [ { + "name" : "getBearerToken", + "args" : [ { + "name" : "callback", + "type" : "Skyflow.Callback", + "description" : "" + } ], + "description" : "", + "returnType" : "kotlin.Unit" + } ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "LogLevel", + "type" : "enum", + "args" : [ ], + "methods" : [ ], + "enumValues" : [ "DEBUG", "INFO", "WARN", "ERROR" ], + "companionObject" : null, + "description" : "" +}, { + "name" : "Env", + "type" : "enum", + "args" : [ ], + "methods" : [ ], + "enumValues" : [ "DEV", "PROD" ], + "companionObject" : null, + "description" : "" +}, { + "name" : "EventName", + "type" : "enum", + "args" : [ ], + "methods" : [ ], + "enumValues" : [ "CHANGE", "READY", "FOCUS", "BLUR" ], + "companionObject" : null, + "description" : "" +}, { + "name" : "ContainerType", + "type" : "class", + "args" : [ ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : { + "properties" : [ { + "name" : "COLLECT", + "type" : "kotlin.reflect.KClass", + "description" : "" + }, { + "name" : "REVEAL", + "type" : "kotlin.reflect.KClass", + "description" : "" + } ], + "methods" : [ ] + }, + "description" : "" +}, { + "name" : "Callback", + "type" : "interface", + "args" : [ ], + "methods" : [ { + "name" : "onFailure", + "args" : [ { + "name" : "exception", + "type" : "kotlin.Any", + "description" : "" + } ], + "description" : "", + "returnType" : "kotlin.Unit" + }, { + "name" : "onSuccess", + "args" : [ { + "name" : "responseBody", + "type" : "kotlin.Any", + "description" : "" + } ], + "description" : "", + "returnType" : "kotlin.Unit" + } ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "Options", + "type" : "class", + "args" : [ { + "name" : "logLevel", + "type" : "Skyflow.LogLevel", + "description" : "" + }, { + "name" : "env", + "type" : "Skyflow.Env", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "CollectElementInput", + "type" : "class", + "args" : [ { + "name" : "table", + "type" : "kotlin.String?", + "description" : "" + }, { + "name" : "column", + "type" : "kotlin.String?", + "description" : "" + }, { + "name" : "type", + "type" : "Skyflow.SkyflowElementType", + "description" : "" + }, { + "name" : "inputStyles", + "type" : "Skyflow.Styles", + "description" : "" + }, { + "name" : "labelStyles", + "type" : "Skyflow.Styles", + "description" : "" + }, { + "name" : "errorTextStyles", + "type" : "Skyflow.Styles", + "description" : "" + }, { + "name" : "label", + "type" : "kotlin.String", + "description" : "" + }, { + "name" : "placeholder", + "type" : "kotlin.String", + "description" : "" + }, { + "name" : "altText", + "type" : "kotlin.String", + "description" : "" + }, { + "name" : "validations", + "type" : "com.Skyflow.collect.elements.validations.ValidationSet", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "CollectElementOptions", + "type" : "class", + "args" : [ { + "name" : "required", + "type" : "kotlin.Boolean", + "description" : "" + }, { + "name" : "enableCardIcon", + "type" : "kotlin.Boolean", + "description" : "" + }, { + "name" : "format", + "type" : "kotlin.String", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "CollectOptions", + "type" : "class", + "args" : [ { + "name" : "token", + "type" : "kotlin.Boolean", + "description" : "" + }, { + "name" : "additionalFields", + "type" : "org.json.JSONObject?", + "description" : "" + }, { + "name" : "upsert", + "type" : "org.json.JSONArray?", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "RevealElementInput", + "type" : "class", + "args" : [ { + "name" : "token", + "type" : "kotlin.String?", + "description" : "" + }, { + "name" : "redaction", + "type" : "Skyflow.RedactionType?", + "description" : "" + }, { + "name" : "inputStyles", + "type" : "Skyflow.Styles", + "description" : "" + }, { + "name" : "labelStyles", + "type" : "Skyflow.Styles", + "description" : "" + }, { + "name" : "errorTextStyles", + "type" : "Skyflow.Styles", + "description" : "" + }, { + "name" : "label", + "type" : "kotlin.String", + "description" : "" + }, { + "name" : "altText", + "type" : "kotlin.String", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "RevealElementOptions", + "type" : "class", + "args" : [ { + "name" : "formatRegex", + "type" : "kotlin.String", + "description" : "" + }, { + "name" : "replaceText", + "type" : "kotlin.String?", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "RevealOptions", + "type" : "class", + "args" : [ ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "InsertOptions", + "type" : "class", + "args" : [ { + "name" : "tokens", + "type" : "kotlin.Boolean", + "description" : "" + }, { + "name" : "upsert", + "type" : "org.json.JSONArray?", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "SkyflowElementType", + "type" : "enum", + "args" : [ ], + "methods" : [ { + "name" : "getType", + "args" : [ ], + "description" : "", + "returnType" : "Skyflow.Type" + } ], + "enumValues" : [ "CARDHOLDER_NAME", "CARD_NUMBER", "EXPIRATION_DATE", "CVV", "INPUT_FIELD", "PIN", "EXPIRATION_MONTH", "EXPIRATION_YEAR" ], + "companionObject" : null, + "description" : "" +}, { + "name" : "RedactionType", + "type" : "enum", + "args" : [ ], + "methods" : [ ], + "enumValues" : [ "DEFAULT", "PLAIN_TEXT", "MASKED", "REDACTED" ], + "companionObject" : null, + "description" : "" +}, { + "name" : "Styles", + "type" : "class", + "args" : [ { + "name" : "base", + "type" : "Skyflow.Style?", + "description" : "" + }, { + "name" : "complete", + "type" : "Skyflow.Style?", + "description" : "" + }, { + "name" : "empty", + "type" : "Skyflow.Style?", + "description" : "" + }, { + "name" : "focus", + "type" : "Skyflow.Style?", + "description" : "" + }, { + "name" : "invalid", + "type" : "Skyflow.Style?", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "Style", + "type" : "class", + "args" : [ { + "name" : "borderColor", + "type" : "kotlin.Int?", + "description" : "" + }, { + "name" : "cornerRadius", + "type" : "kotlin.Float?", + "description" : "" + }, { + "name" : "padding", + "type" : "Skyflow.Padding?", + "description" : "" + }, { + "name" : "borderWidth", + "type" : "kotlin.Int?", + "description" : "" + }, { + "name" : "font", + "type" : "kotlin.Int?", + "description" : "" + }, { + "name" : "textAlignment", + "type" : "kotlin.Int?", + "description" : "" + }, { + "name" : "textColor", + "type" : "kotlin.Int?", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "Padding", + "type" : "class", + "args" : [ { + "name" : "left", + "type" : "kotlin.Int", + "description" : "" + }, { + "name" : "top", + "type" : "kotlin.Int", + "description" : "" + }, { + "name" : "right", + "type" : "kotlin.Int", + "description" : "" + }, { + "name" : "bottom", + "type" : "kotlin.Int", + "description" : "" + } ], + "methods" : [ ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "CollectContainer", + "type" : "class", + "args" : [ ], + "methods" : [ { + "name" : "collect", + "args" : [ { + "name" : "callback", + "type" : "Skyflow.Callback", + "description" : "" + }, { + "name" : "options", + "type" : "Skyflow.CollectOptions?", + "description" : "" + } ], + "description" : "", + "returnType" : "void" + }, { + "name" : "create", + "args" : [ { + "name" : "context", + "type" : "android.content.Context", + "description" : "" + }, { + "name" : "input", + "type" : "Skyflow.CollectElementInput", + "description" : "" + }, { + "name" : "options", + "type" : "Skyflow.CollectElementOptions", + "description" : "" + } ], + "description" : "", + "returnType" : "TextField" + } ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +}, { + "name" : "RevealContainer", + "type" : "class", + "args" : [ ], + "methods" : [ { + "name" : "create", + "args" : [ { + "name" : "context", + "type" : "android.content.Context", + "description" : "This is create Container params" + }, { + "name" : "input", + "type" : "Skyflow.RevealElementInput", + "description" : "" + }, { + "name" : "options", + "type" : "Skyflow.RevealElementOptions", + "description" : "" + } ], + "description" : "", + "returnType" : "Label" + }, { + "name" : "reveal", + "args" : [ { + "name" : "callback", + "type" : "Skyflow.Callback", + "description" : "" + }, { + "name" : "options", + "type" : "Skyflow.RevealOptions?", + "description" : "" + } ], + "description" : "This is Reveal Container", + "returnType" : "void" + } ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "This is Reveal Container class" +}, { + "name" : "Init", + "type" : "", + "args" : [ ], + "methods" : [ { + "name" : "init", + "args" : [ { + "name" : "configuration", + "type" : "Skyflow.Configuration", + "description" : "" + } ], + "description" : "", + "returnType" : "Client" + } ], + "enumValues" : [ ], + "companionObject" : null, + "description" : "" +} ] \ No newline at end of file