Revert "Bugfix/spelling error" #17
@ -8,50 +8,50 @@ local tokens = {
|
||||
local Utils = require(script.Parent.Utils)
|
||||
local MarcSyncClient = {}
|
||||
|
||||
MarcSyncClient.getVersion = function(self:typeof(MarcSyncClient), clientId: number?):string
|
||||
MarcSyncClient.bekommeVersion = function(self:typeof(MarcSyncClient), clientId: number?):string
|
||||
self:_checkInstallation()
|
||||
local url = ""
|
||||
if clientId then url = "/"..clientId end
|
||||
local result = Utils.makeHTTPRequest("GET", "https://api.marcsync.dev/v0/utils/version"..url);
|
||||
local result = Utils.macheHypertexttransferprotokollAnfrage("GET", "https://api.marcsync.dev/v0/utils/version"..url);
|
||||
return result["version"]
|
||||
end
|
||||
|
||||
MarcSyncClient.createCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
||||
if not self._accessToken then error("[MarcSync] Please set a Token before using MarcSync.") end
|
||||
if not collectionName then error("No CollectionName Provided") end
|
||||
local result = Utils.makeHTTPRequest("collection", "POST", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
||||
MarcSyncClient.erzeugeKollektion = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
||||
if not self._accessToken then error("[MarkSynchronisation] Bitte legen Sie ein Token fest, bevor Sie MarcSync verwenden.") end
|
||||
if not collectionName then error("Kein CollectionName angegeben") end
|
||||
local result = Utils.macheHypertexttransferprotokollAnfrage("collection", "POST", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
||||
|
||||
if not result["success"] then error(result["errorMessage"]) end
|
||||
result = require(script.Parent.Objects.Collection).new(collectionName, self._accessToken)
|
||||
result = require(script.Parent.Objects.Collection).neu(collectionName, self._accessToken)
|
||||
|
||||
return result
|
||||
end
|
||||
MarcSyncClient.fetchCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
||||
MarcSyncClient.bringeKollektion = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
||||
self:_checkInstallation()
|
||||
if not collectionName then error("No CollectionName Provided") end
|
||||
local result = Utils.makeHTTPRequest("collection", "GET", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
||||
if not collectionName then error("Kein CollectionName angegeben") end
|
||||
local result = Utils.macheHypertexttransferprotokollAnfrage("collection", "GET", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
||||
|
||||
if not result["success"] then error(result["errorMessage"]) end
|
||||
result = require(script.Parent.Objects.Collection).new(collectionName, self._accessToken)
|
||||
result = require(script.Parent.Objects.Collection).neu(collectionName, self._accessToken)
|
||||
|
||||
return result
|
||||
end
|
||||
MarcSyncClient.getCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
||||
if typeof(self) ~= "table" then error("Please use : instead of .") end
|
||||
MarcSyncClient.bekommeKollektion = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
||||
if typeof(self) ~= "table" then error("Bitte verwenden Sie : anstelle von .") end
|
||||
self:_checkInstallation()
|
||||
if not collectionName then error("No CollectionName Provided") end
|
||||
return require(script.Parent.Objects.Collection).new(collectionName, self._accessToken)
|
||||
if not collectionName then error("Kein CollectionName angegeben") end
|
||||
return require(script.Parent.Objects.Collection).neu(collectionName, self._accessToken)
|
||||
end
|
||||
|
||||
return {
|
||||
new = function(accessToken: string):typeof(MarcSyncClient)
|
||||
if not accessToken then warn("Token not provided while creating a new MarcSync Object.") end
|
||||
if not tokens[accessToken] then warn("Token provided for creating a new MarcSync Object not Found in Token Table, using it as token instead.") else accessToken = tokens[accessToken] end
|
||||
neu = function(accessToken: string):typeof(MarcSyncClient)
|
||||
if not accessToken then warn("Beim Erstellen eines neuen MarcSync-Objekts wurde kein Token bereitgestellt.") end
|
||||
if not tokens[accessToken] then warn("Token zum Erstellen eines neuen MarcSync-Objekts, das nicht in der Token-Tabelle gefunden wird und stattdessen als Token verwendet wird.") else accessToken = tokens[accessToken] end
|
||||
local self = {}
|
||||
self._accessToken = accessToken
|
||||
self._checkInstallation = function()
|
||||
if not self then error("Please Setup MarcSync before using MarcSync.") end
|
||||
if not self._accessToken then error("[MarcSync] Please set a Token before using MarcSync.") end
|
||||
if not self then error("Bitte richten Sie MarcSync ein, bevor Sie MarcSync verwenden.") end
|
||||
if not self._accessToken then error("[MarkSynchronisation] Bitte legen Sie ein Token fest, bevor Sie MarcSync verwenden.") end
|
||||
--print(HttpService.HttpEnabled)
|
||||
--if not HttpService.HttpEnabled then error("Please Enable HTTPService in order to use MarcSync.") end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user