mirror of
https://github.com/tribufu/sdk-cpp
synced 2025-06-15 20:24:19 +00:00
Remove mintaka submodule
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "vendor/Mintaka"]
|
||||
path = vendor/Mintaka
|
||||
url = https://github.com/Tribufu/Mintaka
|
||||
|
@ -14,4 +14,3 @@ crate-type = ["staticlib"]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
mintaka-native = { path = "./vendor/Mintaka/src/native" }
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
||||
#include <tribufu/options.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
@ -15,19 +15,13 @@ namespace tribufu
|
||||
private:
|
||||
std::string base_url;
|
||||
TribufuApiOptions options;
|
||||
HttpClient http;
|
||||
|
||||
public:
|
||||
TribufuApi();
|
||||
|
||||
TribufuApi(std::string api_key);
|
||||
|
||||
TribufuApi(TribufuApiOptions options);
|
||||
|
||||
~TribufuApi();
|
||||
|
||||
static TribufuApi from_env();
|
||||
|
||||
static TribufuApi from_env(std::string prefix);
|
||||
};
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
||||
#include <tribufu/api.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
@ -15,9 +15,7 @@ namespace tribufu
|
||||
|
||||
public:
|
||||
TribufuClient(uint64_t id, const std::string &secret);
|
||||
|
||||
~TribufuClient();
|
||||
|
||||
uint64_t &get_client_id();
|
||||
};
|
||||
}
|
||||
|
11
include/tribufu/json.h
Normal file
11
include/tribufu/json.h
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/native.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
#ifdef TRIBUFU_CPP
|
||||
#include <nlohmann/json.hpp>
|
||||
using json = nlohmann::json;
|
||||
#endif
|
@ -61,7 +61,8 @@ namespace tribufu
|
||||
|
||||
public:
|
||||
OAuth2AuthorizeRequest();
|
||||
OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &scope, const std::string &state);
|
||||
OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, const std::string &client_secret,
|
||||
const std::string &redirect_uri, const std::string &scope, const std::string &state);
|
||||
~OAuth2AuthorizeRequest();
|
||||
};
|
||||
|
||||
@ -87,7 +88,8 @@ namespace tribufu
|
||||
|
||||
public:
|
||||
OAuth2ErrorResponse();
|
||||
OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description, const std::string &error_uri, const std::string &state);
|
||||
OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description,
|
||||
const std::string &error_uri, const std::string &state);
|
||||
~OAuth2ErrorResponse();
|
||||
};
|
||||
|
||||
@ -105,7 +107,9 @@ namespace tribufu
|
||||
|
||||
public:
|
||||
OAuth2TokenRequest();
|
||||
OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &code, const std::string &refresh_token, const std::string &username, const std::string &password);
|
||||
OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, const std::string &client_secret,
|
||||
const std::string &redirect_uri, const std::string &code, const std::string &refresh_token,
|
||||
const std::string &username, const std::string &password);
|
||||
~OAuth2TokenRequest();
|
||||
};
|
||||
|
||||
@ -121,7 +125,9 @@ namespace tribufu
|
||||
|
||||
public:
|
||||
OAuth2TokenResponse();
|
||||
OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token, const std::string &refresh_token, const std::string &scope, const std::string &state, uint64_t expires_in);
|
||||
OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token,
|
||||
const std::string &refresh_token, const std::string &scope, const std::string &state,
|
||||
uint64_t expires_in);
|
||||
~OAuth2TokenResponse();
|
||||
};
|
||||
}
|
||||
|
21
include/tribufu/platform.h
Normal file
21
include/tribufu/platform.h
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef DLLEXPORT
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#endif
|
||||
#ifndef DLLIMPORT
|
||||
#define DLLIMPORT __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __MACH__ || __APPLE__ || __linux__ || __FreeBSD__ || __ANDROID__
|
||||
#ifndef DLLEXPORT
|
||||
#define DLLEXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#ifndef DLLIMPORT
|
||||
#define DLLIMPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#endif
|
@ -2,12 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mintaka/framework.h>
|
||||
#include <tribufu/json.h>
|
||||
#include <tribufu/macros.h>
|
||||
#include <tribufu/native.h>
|
||||
|
||||
#ifdef TRIBUFU_CPP
|
||||
|
||||
using namespace mintaka;
|
||||
|
||||
#endif
|
||||
#include <tribufu/platform.h>
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
||||
#include <tribufu/client.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
@ -14,9 +14,7 @@ namespace tribufu
|
||||
|
||||
public:
|
||||
TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret);
|
||||
|
||||
~TribufuServer();
|
||||
|
||||
uint64_t &get_server_id();
|
||||
};
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
|
||||
call .\vendor\Mintaka\vendor\premake-core\windows\premake5.exe vs2022
|
||||
call .\vendor\premake-core\windows\premake5.exe vs2022
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
if [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]
|
||||
then
|
||||
./vendor/Mintaka/vendor/premake-core/linux/premake5 gmake2
|
||||
./vendor/premake-core/linux/premake5 gmake2
|
||||
|
||||
elif [ "$(uname)" = "Darwin" ]
|
||||
then
|
||||
./vendor/Mintaka/vendor/premake-core/mac/premake5 xcode4
|
||||
./vendor/premake-core/mac/premake5 xcode4
|
||||
fi
|
||||
|
@ -8,7 +8,9 @@ namespace tribufu
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2AuthorizeRequest::OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &scope, const std::string &state)
|
||||
OAuth2AuthorizeRequest::OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id,
|
||||
const std::string &client_secret, const std::string &redirect_uri,
|
||||
const std::string &scope, const std::string &state)
|
||||
{
|
||||
this->response_type = response_type;
|
||||
this->client_id = client_id;
|
||||
@ -40,7 +42,8 @@ namespace tribufu
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2ErrorResponse::OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description, const std::string &error_uri, const std::string &state)
|
||||
OAuth2ErrorResponse::OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description,
|
||||
const std::string &error_uri, const std::string &state)
|
||||
{
|
||||
this->error = error;
|
||||
this->error_description = error_description;
|
||||
@ -56,7 +59,10 @@ namespace tribufu
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2TokenRequest::OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &code, const std::string &refresh_token, const std::string &username, const std::string &password)
|
||||
OAuth2TokenRequest::OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id,
|
||||
const std::string &client_secret, const std::string &redirect_uri,
|
||||
const std::string &code, const std::string &refresh_token,
|
||||
const std::string &username, const std::string &password)
|
||||
{
|
||||
this->grant_type = grant_type;
|
||||
this->client_id = client_id;
|
||||
@ -76,7 +82,9 @@ namespace tribufu
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2TokenResponse::OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token, const std::string &refresh_token, const std::string &scope, const std::string &state, uint64_t expires_in)
|
||||
OAuth2TokenResponse::OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token,
|
||||
const std::string &refresh_token, const std::string &scope,
|
||||
const std::string &state, uint64_t expires_in)
|
||||
{
|
||||
this->token_type = token_type;
|
||||
this->access_token = access_token;
|
||||
|
@ -12,11 +12,13 @@ namespace tribufu
|
||||
{
|
||||
}
|
||||
|
||||
TribufuApiOptions::TribufuApiOptions(std::string access_token, std::string refresh_token, float expires_in) : TribufuApiOptions(nullptr, access_token, refresh_token, expires_in)
|
||||
TribufuApiOptions::TribufuApiOptions(std::string access_token, std::string refresh_token, float expires_in)
|
||||
: TribufuApiOptions(nullptr, access_token, refresh_token, expires_in)
|
||||
{
|
||||
}
|
||||
|
||||
TribufuApiOptions::TribufuApiOptions(std::string api_key, std::string access_token, std::string refresh_token, float expires_in)
|
||||
TribufuApiOptions::TribufuApiOptions(std::string api_key, std::string access_token, std::string refresh_token,
|
||||
float expires_in)
|
||||
{
|
||||
this->api_key = api_key;
|
||||
this->access_token = access_token;
|
||||
|
@ -4,7 +4,8 @@
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
TribufuServer::TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret) : TribufuClient(client_id, client_secret)
|
||||
TribufuServer::TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret)
|
||||
: TribufuClient(client_id, client_secret)
|
||||
{
|
||||
this->server_id = server_id;
|
||||
}
|
||||
|
1
vendor/Mintaka
vendored
1
vendor/Mintaka
vendored
Submodule vendor/Mintaka deleted from 6733b056f6
Reference in New Issue
Block a user