//  APIConfig.mm
#import "APIConfig.h"

@implementation APIConfig

+ (NSString *)baseURL {
    return @"https://kitadev.commudesk.com/api";
}

+ (NSString *)authToken {
  return @"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImF0aGlyYWh6YWlkaUBjb252ZXAuY29tIiwicGFzc3dvcmQiOiIkMnkkMTAkNU9xYklqMnZ6UHJwckJrcVd5c3I2LmJCc1hVYS9Hd014eUhnL3RhUUhPUkNQcGdmTG8yakciLCJzdWIiOjIxNzAsImlzcyI6Imh0dHBzOi8va2l0YWRldi5jb21tdWRlc2suY29tL2FwaS9vd25lci9hdXRoL3Bhc3N3b3JkbGVzc19sb2dpbiIsImlhdCI6MTc2MDMxNTM1MiwiZXhwIjoyMDc1ODg0ODcyLCJuYmYiOjE3NjAzMTUzNTIsImp0aSI6IktoQmNyQnJEdDVNdDZlWmMifQ.JnxGbZ7hTeoOr6oibIzZMphgyKtTo2Aq9Efx6mrGfFA";
}

+ (NSURL *)urlWithPath:(NSString *)path {
    NSString *urlString =
        [NSString stringWithFormat:@"%@%@?token=%@",
         [self baseURL],
         path,
         [self authToken]];
    return [NSURL URLWithString:urlString];
}

+ (NSDictionary<NSString *, NSString *> *)deviceInfo {
    return @{
        @"OS": @"AND",
        @"IMEI": @"AND:2a2f13ff17b1cbb5",
        @"OS_VERSION": @"35",
        @"MODEL": @"2306EPN60G",
        @"APP_VERSION": @"1.22.26"
    };
}

+ (NSString *)deviceInfoJSONString {
    NSData *data =
        [NSJSONSerialization dataWithJSONObject:[self deviceInfo]
                                        options:0
                                          error:nil];

    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}

@end
