aboutsummaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt6
18 files changed, 21 insertions, 19 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt
index 1c9b663..2a67fd0 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Attribute
import mx.trackermap.TrackerMap.client.infrastructure.*
-class AttributesApi : ApiClient() {
+class AttributesApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Attributes
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt
index 56ee7b5..8dd2da8 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Calendar
import mx.trackermap.TrackerMap.client.infrastructure.*
-class CalendarsApi : ApiClient() {
+class CalendarsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Calendars
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt
index f00bc93..8ee7436 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt
@@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.CommandType
import mx.trackermap.TrackerMap.client.infrastructure.*
-class CommandsApi : ApiClient() {
+class CommandsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Saved Commands
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt
index 22903d1..74d105f 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt
@@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.DeviceAccumulators
import mx.trackermap.TrackerMap.client.infrastructure.*
-class DevicesApi : ApiClient() {
+class DevicesApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Devices
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt
index 7cf26d0..a9f47b8 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Driver
import mx.trackermap.TrackerMap.client.infrastructure.*
-class DriversApi : ApiClient() {
+class DriversApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Drivers
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt
index 5e5b8e6..360d6e1 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Event
import mx.trackermap.TrackerMap.client.infrastructure.*
-class EventsApi : ApiClient() {
+class EventsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
*
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt
index 23ac8c8..d7174e5 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Geofence
import mx.trackermap.TrackerMap.client.infrastructure.*
-class GeofencesApi : ApiClient() {
+class GeofencesApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Geofences
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt
index 3b0dfa1..620a25e 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Group
import mx.trackermap.TrackerMap.client.infrastructure.*
-class GroupsApi : ApiClient() {
+class GroupsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Groups
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt
index 92480fe..5b10e9e 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Maintenance
import mx.trackermap.TrackerMap.client.infrastructure.*
-class MaintenanceApi : ApiClient() {
+class MaintenanceApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Maintenance
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt
index 1f0d744..290a14d 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt
@@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.NotificationType
import mx.trackermap.TrackerMap.client.infrastructure.*
-class NotificationsApi : ApiClient() {
+class NotificationsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Notifications
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt
index 02c9348..33aab48 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Permission
import mx.trackermap.TrackerMap.client.infrastructure.*
-class PermissionsApi : ApiClient() {
+class PermissionsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Unlink an Object from another Object
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt
index ecbf649..61285e9 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Position
import mx.trackermap.TrackerMap.client.infrastructure.*
-class PositionsApi : ApiClient() {
+class PositionsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetches a list of Positions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt
index 3dbee22..569a036 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt
@@ -20,7 +20,7 @@ import mx.trackermap.TrackerMap.client.models.ReportTrips
import mx.trackermap.TrackerMap.client.infrastructure.*
-class ReportsApi : ApiClient() {
+class ReportsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Events within the time period for the Devices or Groups
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt
index 3c7787d..bf65dfe 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Server
import mx.trackermap.TrackerMap.client.infrastructure.*
-class ServerApi : ApiClient() {
+class ServerApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch Server information
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt
index ad9e450..3f90c4c 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt
@@ -18,7 +18,7 @@ import mx.trackermap.TrackerMap.client.infrastructure.*
const val SERVER_URL_KEY = "server_url"
const val ACCESS_TOKEN_KEY = "access_token"
-class SessionApi : ApiClient() {
+class SessionApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Close the Session
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt
index 1857cc5..d121f81 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Statistics
import mx.trackermap.TrackerMap.client.infrastructure.*
-class StatisticsApi : ApiClient() {
+class StatisticsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch server Statistics
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt
index 7b8d837..51f2138 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt
@@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.User
import mx.trackermap.TrackerMap.client.infrastructure.*
-class UsersApi : ApiClient() {
+class UsersApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
/**
* Fetch a list of Users
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt
index 88aaa26..e5413e5 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt
@@ -20,7 +20,9 @@ import mx.trackermap.TrackerMap.client.apis.ACCESS_TOKEN_KEY
import mx.trackermap.TrackerMap.client.apis.SERVER_URL_KEY
import kotlinx.serialization.json.Json as KotlinJson
-open class ApiClient() {
+open class ApiClient(
+ defaultBaseUrl: String = "",
+) {
companion object {
protected const val ApiContentType = "Content-Type"
protected const val ApiAccept = "Accept"
@@ -64,7 +66,7 @@ open class ApiClient() {
init {
val settings = Settings()
- baseUrl = settings.getString(SERVER_URL_KEY, "")
+ baseUrl = settings.getString(SERVER_URL_KEY, defaultBaseUrl)
token = settings.getString(ACCESS_TOKEN_KEY, "")
}