aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authorLibravatar Aditya Mangalampalli <aditya.mangalampalli@gmail.com>2022-04-15 02:00:25 -0700
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-04-16 21:57:57 +0530
commit210131ca184c3aa043371857c022aa1aa149efbf (patch)
tree6bc4e10a1540e55a66146c099bc468a12287425e /src/api
parentUpdate submodule url to ferdium-recipes (#1) (diff)
downloadferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.tar.gz
ferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.tar.zst
ferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.zip
Matched casing for almost all replacements
Diffstat (limited to 'src/api')
-rw-r--r--src/api/apiBase.ts20
-rw-r--r--src/api/server/LocalApi.ts2
-rw-r--r--src/api/server/ServerApi.ts2
-rw-r--r--src/api/utils/auth.ts6
4 files changed, 15 insertions, 15 deletions
diff --git a/src/api/apiBase.ts b/src/api/apiBase.ts
index a30793848..c41fbe8ba 100644
--- a/src/api/apiBase.ts
+++ b/src/api/apiBase.ts
@@ -13,20 +13,20 @@ import {
13// Note: This cannot be used from the internal-server since we are not running within the context of a browser window 13// Note: This cannot be used from the internal-server since we are not running within the context of a browser window
14const apiBase = (withVersion = true) => { 14const apiBase = (withVersion = true) => {
15 if ( 15 if (
16 !(window as any).ferdi || 16 !(window as any).ferdium ||
17 !(window as any).ferdi.stores.settings || 17 !(window as any).ferdium.stores.settings ||
18 !(window as any).ferdi.stores.settings.all || 18 !(window as any).ferdium.stores.settings.all ||
19 !(window as any).ferdi.stores.settings.all.app.server 19 !(window as any).ferdium.stores.settings.all.app.server
20 ) { 20 ) {
21 // Stores have not yet been loaded - return SERVER_NOT_LOADED to force a retry when stores are loaded 21 // Stores have not yet been loaded - return SERVER_NOT_LOADED to force a retry when stores are loaded
22 return SERVER_NOT_LOADED; 22 return SERVER_NOT_LOADED;
23 } 23 }
24 const url = 24 const url =
25 (window as any).ferdi.stores.settings.all.app.server === LOCAL_SERVER 25 (window as any).ferdium.stores.settings.all.app.server === LOCAL_SERVER
26 ? `http://${LOCAL_HOSTNAME}:${ 26 ? `http://${LOCAL_HOSTNAME}:${
27 (window as any).ferdi.stores.requests.localServerPort 27 (window as any).ferdium.stores.requests.localServerPort
28 }` 28 }`
29 : (window as any).ferdi.stores.settings.all.app.server; 29 : (window as any).ferdium.stores.settings.all.app.server;
30 30
31 return withVersion ? `${url}/${API_VERSION}` : url; 31 return withVersion ? `${url}/${API_VERSION}` : url;
32}; 32};
@@ -34,8 +34,8 @@ const apiBase = (withVersion = true) => {
34export default apiBase; 34export default apiBase;
35 35
36export function termsBase() { 36export function termsBase() {
37 // TODO: This needs to handle local vs ferdi vs franz servers 37 // TODO: This needs to handle local vs ferdium vs franz servers
38 return (window as any).ferdi.stores.settings.all.app.server !== LIVE_FRANZ_API 38 return (window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API
39 ? (window as any).ferdi.stores.settings.all.app.server 39 ? (window as any).ferdium.stores.settings.all.app.server
40 : DEV_API_FRANZ_WEBSITE; 40 : DEV_API_FRANZ_WEBSITE;
41} 41}
diff --git a/src/api/server/LocalApi.ts b/src/api/server/LocalApi.ts
index 1a46aaefe..5e205cbe4 100644
--- a/src/api/server/LocalApi.ts
+++ b/src/api/server/LocalApi.ts
@@ -4,7 +4,7 @@ import fastFolderSize from 'fast-folder-size';
4 4
5import { getServicePartitionsDirectory } from '../../helpers/service-helpers'; 5import { getServicePartitionsDirectory } from '../../helpers/service-helpers';
6 6
7const debug = require('debug')('Ferdi:LocalApi'); 7const debug = require('debug')('Ferdium:LocalApi');
8 8
9export default class LocalApi { 9export default class LocalApi {
10 // Settings 10 // Settings
diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts
index 706520cb3..9dc3a9a0e 100644
--- a/src/api/server/ServerApi.ts
+++ b/src/api/server/ServerApi.ts
@@ -35,7 +35,7 @@ import {
35 35
36import { removeServicePartitionDirectory } from '../../helpers/service-helpers'; 36import { removeServicePartitionDirectory } from '../../helpers/service-helpers';
37 37
38const debug = require('debug')('Ferdi:ServerApi'); 38const debug = require('debug')('Ferdium:ServerApi');
39 39
40module.paths.unshift(getDevRecipeDirectory(), getRecipeDirectory()); 40module.paths.unshift(getDevRecipeDirectory(), getRecipeDirectory());
41 41
diff --git a/src/api/utils/auth.ts b/src/api/utils/auth.ts
index 899881e88..a7a73309d 100644
--- a/src/api/utils/auth.ts
+++ b/src/api/utils/auth.ts
@@ -1,5 +1,5 @@
1import localStorage from 'mobx-localstorage'; 1import localStorage from 'mobx-localstorage';
2import { ferdiLocale, ferdiVersion } from '../../environment-remote'; 2import { ferdiumLocale, ferdiumVersion } from '../../environment-remote';
3 3
4export const prepareAuthRequest = ( 4export const prepareAuthRequest = (
5 // eslint-disable-next-line unicorn/no-object-as-default-parameter 5 // eslint-disable-next-line unicorn/no-object-as-default-parameter
@@ -11,10 +11,10 @@ export const prepareAuthRequest = (
11 headers: { 11 headers: {
12 'Content-Type': 'application/json', 12 'Content-Type': 'application/json',
13 'X-Franz-Source': 'desktop', 13 'X-Franz-Source': 'desktop',
14 'X-Franz-Version': ferdiVersion, 14 'X-Franz-Version': ferdiumVersion,
15 'X-Franz-platform': process.platform, 15 'X-Franz-platform': process.platform,
16 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), 16 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(),
17 'X-Franz-System-Locale': ferdiLocale, 17 'X-Franz-System-Locale': ferdiumLocale,
18 // @ts-expect-error Property 'headers' does not exist on type '{ method: string; }'. 18 // @ts-expect-error Property 'headers' does not exist on type '{ method: string; }'.
19 ...options.headers, 19 ...options.headers,
20 }, 20 },