Remove mintaka submodule

This commit is contained in:
2024-03-06 18:48:14 -03:00
parent ecf9119639
commit 5dd90202be
15 changed files with 68 additions and 39 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "vendor/Mintaka"]
path = vendor/Mintaka
url = https://github.com/Tribufu/Mintaka

View File

@ -14,4 +14,3 @@ crate-type = ["staticlib"]
path = "src/lib.rs" path = "src/lib.rs"
[dependencies] [dependencies]
mintaka-native = { path = "./vendor/Mintaka/src/native" }

View File

@ -2,8 +2,8 @@
#pragma once #pragma once
#include <tribufu/prelude.h>
#include <tribufu/options.h> #include <tribufu/options.h>
#include <tribufu/prelude.h>
namespace tribufu namespace tribufu
{ {
@ -15,19 +15,13 @@ namespace tribufu
private: private:
std::string base_url; std::string base_url;
TribufuApiOptions options; TribufuApiOptions options;
HttpClient http;
public: public:
TribufuApi(); TribufuApi();
TribufuApi(std::string api_key); TribufuApi(std::string api_key);
TribufuApi(TribufuApiOptions options); TribufuApi(TribufuApiOptions options);
~TribufuApi(); ~TribufuApi();
static TribufuApi from_env(); static TribufuApi from_env();
static TribufuApi from_env(std::string prefix); static TribufuApi from_env(std::string prefix);
}; };
} }

View File

@ -2,8 +2,8 @@
#pragma once #pragma once
#include <tribufu/prelude.h>
#include <tribufu/api.h> #include <tribufu/api.h>
#include <tribufu/prelude.h>
namespace tribufu namespace tribufu
{ {
@ -15,9 +15,7 @@ namespace tribufu
public: public:
TribufuClient(uint64_t id, const std::string &secret); TribufuClient(uint64_t id, const std::string &secret);
~TribufuClient(); ~TribufuClient();
uint64_t &get_client_id(); uint64_t &get_client_id();
}; };
} }

11
include/tribufu/json.h Normal file
View 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

View File

@ -61,7 +61,8 @@ namespace tribufu
public: public:
OAuth2AuthorizeRequest(); 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(); ~OAuth2AuthorizeRequest();
}; };
@ -87,7 +88,8 @@ namespace tribufu
public: public:
OAuth2ErrorResponse(); 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(); ~OAuth2ErrorResponse();
}; };
@ -105,7 +107,9 @@ namespace tribufu
public: public:
OAuth2TokenRequest(); 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(); ~OAuth2TokenRequest();
}; };
@ -121,7 +125,9 @@ namespace tribufu
public: public:
OAuth2TokenResponse(); 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(); ~OAuth2TokenResponse();
}; };
} }

View 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

View File

@ -2,12 +2,7 @@
#pragma once #pragma once
#include <mintaka/framework.h> #include <tribufu/json.h>
#include <tribufu/macros.h> #include <tribufu/macros.h>
#include <tribufu/native.h> #include <tribufu/native.h>
#include <tribufu/platform.h>
#ifdef TRIBUFU_CPP
using namespace mintaka;
#endif

View File

@ -2,8 +2,8 @@
#pragma once #pragma once
#include <tribufu/prelude.h>
#include <tribufu/client.h> #include <tribufu/client.h>
#include <tribufu/prelude.h>
namespace tribufu namespace tribufu
{ {
@ -14,9 +14,7 @@ namespace tribufu
public: public:
TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret); TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret);
~TribufuServer(); ~TribufuServer();
uint64_t &get_server_id(); uint64_t &get_server_id();
}; };
} }

View File

@ -1,3 +1,3 @@
@echo off @echo off
call .\vendor\Mintaka\vendor\premake-core\windows\premake5.exe vs2022 call .\vendor\premake-core\windows\premake5.exe vs2022

View File

@ -2,9 +2,9 @@
if [ "$(expr substr $(uname -s) 1 5)" = "Linux" ] if [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]
then then
./vendor/Mintaka/vendor/premake-core/linux/premake5 gmake2 ./vendor/premake-core/linux/premake5 gmake2
elif [ "$(uname)" = "Darwin" ] elif [ "$(uname)" = "Darwin" ]
then then
./vendor/Mintaka/vendor/premake-core/mac/premake5 xcode4 ./vendor/premake-core/mac/premake5 xcode4
fi fi

View File

@ -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->response_type = response_type;
this->client_id = client_id; 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 = error;
this->error_description = error_description; 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->grant_type = grant_type;
this->client_id = client_id; 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->token_type = token_type;
this->access_token = access_token; this->access_token = access_token;

View File

@ -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->api_key = api_key;
this->access_token = access_token; this->access_token = access_token;

View File

@ -4,7 +4,8 @@
namespace tribufu 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; this->server_id = server_id;
} }

1
vendor/Mintaka vendored

Submodule vendor/Mintaka deleted from 6733b056f6