From 57020c6b246d32cf75c231b54cf7452ca3db0b46 Mon Sep 17 00:00:00 2001 From: IBims2CooleTim <116311836+IBims2CooleTim@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:26:23 +0200 Subject: [PATCH] Update MarcSyncv1.0.lua --- src/MarcSync/MarcSyncv1.0.lua | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/MarcSync/MarcSyncv1.0.lua b/src/MarcSync/MarcSyncv1.0.lua index ef8a2b5..5b3f06a 100644 --- a/src/MarcSync/MarcSyncv1.0.lua +++ b/src/MarcSync/MarcSyncv1.0.lua @@ -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 @@ -62,4 +62,4 @@ return { return self end -} \ No newline at end of file +}