82 lines
2.9 KiB
C#
82 lines
2.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.IO;
|
|
using RestSharp;
|
|
namespace BodyshopPartner.Utils
|
|
{
|
|
public static class AppMetaData
|
|
{
|
|
//TODO: Change firebase API Key to be dependent on what environment monitor has been set for.
|
|
public static string ActiveShopId = Properties.Settings.Default.LastSelectedShop;
|
|
public static string ActiveShopName = "";
|
|
public static string user = "";
|
|
public static string ShopRegion = "";
|
|
public static dynamic CiecaOpCodes;
|
|
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
public static string graphQlEndpoint;
|
|
public static string FirebaseAPIKey;
|
|
public static Boolean IsTest = false;
|
|
private static string workingDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
|
|
|
public static string globalScriptsPath = @"C:\ImEX\PartnerScripts";
|
|
public static RestClient RestClient;
|
|
|
|
|
|
public static void CreateEndpoints()
|
|
{
|
|
logger.Debug("Creating endpoints for graphql.");
|
|
string[] args = Environment.GetCommandLineArgs();
|
|
if (args.Length == 1)
|
|
{
|
|
#if DEBUG
|
|
graphQlEndpoint = "https://db.dev.imex.online/v1/graphql";
|
|
RestClient = new RestClient("http://localhost:4000");
|
|
FirebaseAPIKey = "AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc";
|
|
|
|
#elif TEST
|
|
graphQlEndpoint = "https://db.test.bodyshop.app/v1/graphql";
|
|
RestClient = new RestClient("https://api.test.imex.online");
|
|
|
|
FirebaseAPIKey = "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c";
|
|
|
|
#else
|
|
graphQlEndpoint = "https://db.imex.online/v1/graphql";
|
|
RestClient = new RestClient("https://api.imex.online");
|
|
FirebaseAPIKey = "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU";
|
|
#endif
|
|
}
|
|
else
|
|
{
|
|
if (args[1] == "test")
|
|
{
|
|
IsTest = true;
|
|
|
|
graphQlEndpoint = "https://db.test.bodyshop.app/v1/graphql";
|
|
RestClient = new RestClient("https://api.test.imex.online");
|
|
FirebaseAPIKey = "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c";
|
|
}
|
|
else
|
|
{
|
|
#if DEBUG
|
|
graphQlEndpoint = "https://bodyshop-dev-db.herokuapp.com/v1/graphql";
|
|
RestClient = new RestClient("http://localhost:4000");
|
|
FirebaseAPIKey = "AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc";
|
|
#else
|
|
graphQlEndpoint = "https://db.imex.online/v1/graphql";
|
|
RestClient = new RestClient("https://api.imex.online");
|
|
FirebaseAPIKey = "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU";
|
|
|
|
#endif
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|