commonMain.com.caesarealabs.loggy.shared.LoggyService.kt Maven / Gradle / Ivy
The newest version!
package com.caesarealabs.loggy.shared
import com.caesarealabs.rpc4k.runtime.user.Api
import com.caesarealabs.rpc4k.runtime.user.Dispatch
import com.caesarealabs.rpc4k.runtime.user.RpcEvent
@Api
interface LoggyService {
companion object;
suspend fun getEndpoints(): List
// suspend fun getCompletions()
// /**
// * Returns a list of all possible keys in the data table of all logs of the specified [endpoint].
// * This keys correspond to the key in [Logging.logData]
// * Any of these keys may then be passed to [getKeyValues] to get a list of all values logged with that key
// * @param endpoint If null will return keys of all endpoints
// */
// suspend fun getDataKeys(endpoint: String?): List
//
// /**
// * Returns a list of all values logged with the specified [key], in the specified [endpoint].
// * For example, if the [key] is `message_type`, the values could be `event_sub`, `event_unsub`, etc.
// * @param endpoint If null will return values from all endpoints.
// */
// suspend fun getKeyValues(endpoint: String?, key: String): List
// suspend fun getCompletions()
/**
* Given a [key], will return all valid values for a [key]:value expression.
* This will adjust to only shows results from the [query], and will return null if the query is invalid.
*/
public suspend fun getDataValuesForKeyInQuery(query: String, key: String, userTimeZone: String): List?
/**
* Get invocations matching the [query].
* The results will be sorted from most recent to least recent.
* @param userTimeZone The user's timezone, to interpret the dates he specifies. "Start of day" and such varies based on your timezone.
*
*/
suspend fun getInvocations(query: Query, userTimeZone: String): SearchResult
@RpcEvent
fun onInvocationAdded(
@Dispatch invocation: Invocation,
/*@EventTarget */endpoint: String?,
query: Query
): Invocation
}