Fixed a few small spelling errors #14
@ -8,50 +8,50 @@ local tokens = {
|
|||||||
local Utils = require(script.Parent.Utils)
|
local Utils = require(script.Parent.Utils)
|
||||||
local MarcSyncClient = {}
|
local MarcSyncClient = {}
|
||||||
|
|
||||||
MarcSyncClient.getVersion = function(self:typeof(MarcSyncClient), clientId: number?):string
|
MarcSyncClient.bekommeVersion = function(self:typeof(MarcSyncClient), clientId: number?):string
|
||||||
self:_checkInstallation()
|
self:_checkInstallation()
|
||||||
local url = ""
|
local url = ""
|
||||||
if clientId then url = "/"..clientId end
|
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"]
|
return result["version"]
|
||||||
end
|
end
|
||||||
|
|
||||||
MarcSyncClient.createCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
MarcSyncClient.erzeugeKollektion = 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 self._accessToken then error("[MarkSynchronisation] Bitte legen Sie ein Token fest, bevor Sie MarcSync verwenden.") end
|
||||||
if not collectionName then error("No CollectionName Provided") end
|
if not collectionName then error("Kein CollectionName angegeben") end
|
||||||
local result = Utils.makeHTTPRequest("collection", "POST", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
local result = Utils.macheHypertexttransferprotokollAnfrage("collection", "POST", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
||||||
|
|
||||||
if not result["success"] then error(result["errorMessage"]) end
|
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
|
return result
|
||||||
end
|
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()
|
self:_checkInstallation()
|
||||||
if not collectionName then error("No CollectionName Provided") end
|
if not collectionName then error("Kein CollectionName angegeben") end
|
||||||
local result = Utils.makeHTTPRequest("collection", "GET", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
local result = Utils.macheHypertexttransferprotokollAnfrage("collection", "GET", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken);
|
||||||
|
|
||||||
if not result["success"] then error(result["errorMessage"]) end
|
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
|
return result
|
||||||
end
|
end
|
||||||
MarcSyncClient.getCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
MarcSyncClient.bekommeKollektion = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new())
|
||||||
if typeof(self) ~= "table" then error("Please use : instead of .") end
|
if typeof(self) ~= "table" then error("Bitte verwenden Sie : anstelle von .") end
|
||||||
self:_checkInstallation()
|
self:_checkInstallation()
|
||||||
if not collectionName then error("No CollectionName Provided") end
|
if not collectionName then error("Kein CollectionName angegeben") end
|
||||||
return require(script.Parent.Objects.Collection).new(collectionName, self._accessToken)
|
return require(script.Parent.Objects.Collection).neu(collectionName, self._accessToken)
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
new = function(accessToken: string):typeof(MarcSyncClient)
|
neu = function(accessToken: string):typeof(MarcSyncClient)
|
||||||
if not accessToken then warn("Token not provided while creating a new MarcSync Object.") end
|
if not accessToken then warn("Beim Erstellen eines neuen MarcSync-Objekts wurde kein Token bereitgestellt.") 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
|
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 = {}
|
local self = {}
|
||||||
self._accessToken = accessToken
|
self._accessToken = accessToken
|
||||||
self._checkInstallation = function()
|
self._checkInstallation = function()
|
||||||
if not self then error("Please Setup MarcSync 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("[MarcSync] Please set a Token before using MarcSync.") end
|
if not self._accessToken then error("[MarkSynchronisation] Bitte legen Sie ein Token fest, bevor Sie MarcSync verwenden.") end
|
||||||
--print(HttpService.HttpEnabled)
|
--print(HttpService.HttpEnabled)
|
||||||
--if not HttpService.HttpEnabled then error("Please Enable HTTPService in order to use MarcSync.") end
|
--if not HttpService.HttpEnabled then error("Please Enable HTTPService in order to use MarcSync.") end
|
||||||
end
|
end
|
||||||
@ -62,4 +62,4 @@ return {
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user