diff --git a/.gitignore b/.gitignore index 33024ac..3a3e088 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ build -CMakeUserPresets.json \ No newline at end of file +CMakeUserPresets.json +.vscode +*.zip \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index b75a973..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "files.associations": { - "*.rmd": "markdown", - "array": "cpp", - "atomic": "cpp", - "bit": "cpp", - "*.tcc": "cpp", - "cctype": "cpp", - "chrono": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "compare": "cpp", - "concepts": "cpp", - "condition_variable": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "deque": "cpp", - "list": "cpp", - "string": "cpp", - "unordered_map": "cpp", - "vector": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "iterator": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "numeric": "cpp", - "random": "cpp", - "ratio": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "initializer_list": "cpp", - "iosfwd": "cpp", - "limits": "cpp", - "mutex": "cpp", - "new": "cpp", - "numbers": "cpp", - "ostream": "cpp", - "semaphore": "cpp", - "stdexcept": "cpp", - "stop_token": "cpp", - "streambuf": "cpp", - "thread": "cpp", - "cinttypes": "cpp", - "typeinfo": "cpp", - "iostream": "cpp", - "istream": "cpp", - "optional": "cpp", - "fstream": "cpp", - "sstream": "cpp", - "bitset": "cpp", - "cstring": "cpp", - "map": "cpp", - "regex": "cpp", - "shared_mutex": "cpp", - "any": "cpp", - "codecvt": "cpp", - "forward_list": "cpp", - "iomanip": "cpp", - "ranges": "cpp", - "valarray": "cpp" - }, - "makefile.configureOnOpen": true -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 05054c5..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "tasks": [ - { - "type": "cppbuild", - "label": "C/C++: g++ build active file", - "command": "/usr/bin/g++", - "args": [ - "-fdiagnostics-color=always", - "-g", - "${file}", - "-o", - "${fileDirname}/${fileBasenameNoExtension}" - ], - "options": { - "cwd": "${fileDirname}" - }, - "problemMatcher": [ - "$gcc" - ], - "group": { - "kind": "build", - "isDefault": true - }, - "detail": "Task generated by Debugger." - } - ], - "version": "2.0.0" -} \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f596771 --- /dev/null +++ b/Makefile @@ -0,0 +1,237 @@ +CXX = g++ +CXXFLAGS = -std=c++11 -Iinclude +LDFLAGS = -lcurl + +SRC_DIR = src +INCLUDE_DIR = include +EXAMPLES_DIR = examples + +SRCS = \ + $(SRC_DIR)/Appwrite.cpp \ + $(SRC_DIR)/services/Account.cpp \ + $(SRC_DIR)/services/Databases.cpp \ + $(SRC_DIR)/services/Storage.cpp \ + $(SRC_DIR)/services/Health.cpp \ + $(SRC_DIR)/Utils.cpp \ + $(SRC_DIR)/Validator.cpp \ + +BINS = \ + createAccount \ + createSession \ + createDatabase \ + updateDatabase \ + getDatabase \ + listDatabase \ + getDatabaseUsage \ + getCollectionUsage \ + listCollection \ + createCollection \ + getCollection \ + updateCollection \ + deleteCollection \ + createDocument \ + listDocument \ + getDocument \ + deleteDocument \ + listAttributes \ + createBooleanAttribute \ + createEmailAttribute \ + createEnumAttribute \ + createFloatAttribute \ + createIntegerAttribute \ + createIPaddressAttribute \ + createStringAttribute \ + updateBooleanAttribute \ + updateEmailAttribute \ + updateEnumAttribute \ + updateFloatAttribute \ + updateIntegerAttribute \ + updateIPaddressAttribute \ + updateStringAttribute \ + listIndexes \ + createIndex \ + deleteIndex \ + getIndex \ + createBucket \ + updateBucket \ + listBuckets \ + getBucket \ + deleteBucket \ + getFile \ + getFileView \ + updateFile \ + deleteFile \ + getFileDownload \ + getHealth \ + getAntivirus \ + getCache \ + getDB \ + getPubSub \ + getStorage \ + getStorageLocal \ + getTime \ + getQueue \ + getCertificate \ + getQueueBuilds \ + getQueueCertificates \ + getQueueUsageWebhooks \ + getQueueUsageDump \ + getQueueFunctions \ + getQueueMails \ + getQueueMessaging \ + getQueueMigrations \ + +# build all binaries +all: $(BINS) + +# Account +createAccount: $(SRCS) $(EXAMPLES_DIR)/account/createAccount.cpp + $(CXX) $(CXXFLAGS) -o ./tests/account/createAccount $(SRCS) $(EXAMPLES_DIR)/account/createAccount.cpp $(LDFLAGS) +createSession: $(SRCS) $(EXAMPLES_DIR)/account/createSession.cpp + $(CXX) $(CXXFLAGS) -o ./tests/account/createSession $(SRCS) $(EXAMPLES_DIR)/account/createSession.cpp $(LDFLAGS) + +# Database +createDatabase: $(SRCS) $(EXAMPLES_DIR)/database/createDatabase.cpp + $(CXX) $(CXXFLAGS) -o ./tests/database/createDatabase $(SRCS) $(EXAMPLES_DIR)/database/createDatabase.cpp $(LDFLAGS) +updateDatabase: $(SRCS) $(EXAMPLES_DIR)/database/updateDatabase.cpp + $(CXX) $(CXXFLAGS) -o ./tests/database/updateDatabase $(SRCS) $(EXAMPLES_DIR)/database/updateDatabase.cpp $(LDFLAGS) +getDatabase: $(SRCS) $(EXAMPLES_DIR)/database/getDatabase.cpp + $(CXX) $(CXXFLAGS) -o ./tests/database/getDatabase $(SRCS) $(EXAMPLES_DIR)/database/getDatabase.cpp $(LDFLAGS) +listDatabase: $(SRCS) $(EXAMPLES_DIR)/database/listDatabase.cpp + $(CXX) $(CXXFLAGS) -o ./tests/database/listDatabase $(SRCS) $(EXAMPLES_DIR)/database/listDatabase.cpp $(LDFLAGS) +getDatabaseUsage: $(SRCS) $(EXAMPLES_DIR)/database/getDatabaseUsage.cpp + $(CXX) $(CXXFLAGS) -o ./tests/database/getDatabaseUsage $(SRCS) $(EXAMPLES_DIR)/database/getDatabaseUsage.cpp $(LDFLAGS) +getCollectionUsage: $(SRCS) $(EXAMPLES_DIR)/database/getCollectionUsage.cpp + $(CXX) $(CXXFLAGS) -o ./tests/database/getCollectionUsage $(SRCS) $(EXAMPLES_DIR)/database/getCollectionUsage.cpp $(LDFLAGS) + +# Database - Collection +listCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/listCollection.cpp + $(CXX) $(CXXFLAGS) -o ./tests/collection/listCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/listCollection.cpp $(LDFLAGS) +createCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/createCollection.cpp + $(CXX) $(CXXFLAGS) -o ./tests/collection/createCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/createCollection.cpp $(LDFLAGS) +getCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/getCollection.cpp + $(CXX) $(CXXFLAGS) -o ./tests/collection/getCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/getCollection.cpp $(LDFLAGS) +updateCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/updateCollection.cpp + $(CXX) $(CXXFLAGS) -o ./tests/collection/updateCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/updateCollection.cpp $(LDFLAGS) +deleteCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/deleteCollection.cpp + $(CXX) $(CXXFLAGS) -o ./tests/collection/deleteCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/deleteCollection.cpp $(LDFLAGS) + +# Database-Collection-Document +createDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/createDocument.cpp + $(CXX) $(CXXFLAGS) -o ./tests/document/createDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/createDocument.cpp $(LDFLAGS) +listDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/listDocument.cpp + $(CXX) $(CXXFLAGS) -o ./tests/document/listDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/listDocument.cpp $(LDFLAGS) +deleteDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/deleteDocument.cpp + $(CXX) $(CXXFLAGS) -o ./tests/document/deleteDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/deleteDocument.cpp $(LDFLAGS) +getDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/getDocument.cpp + $(CXX) $(CXXFLAGS) -o ./tests/document/getDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/getDocument.cpp $(LDFLAGS) + +#Collection-Attribute +listAttributes: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/listAttributes.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/listAttributes $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/listAttributes.cpp $(LDFLAGS) +createBooleanAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createBooleanAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/createBooleanAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createBooleanAttribute.cpp $(LDFLAGS) +createEmailAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEmailAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/createEmailAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEmailAttribute.cpp $(LDFLAGS) +createEnumAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEnumAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/createEnumAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEnumAttribute.cpp $(LDFLAGS) +createFloatAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createFloatAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/createFloatAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createFloatAttribute.cpp $(LDFLAGS) +createIntegerAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIntegerAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/createIntegerAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIntegerAttribute.cpp $(LDFLAGS) +createIPaddressAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIPaddressAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/createIPaddressAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIPaddressAttribute.cpp $(LDFLAGS) +createStringAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createStringAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/createStringAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createStringAttribute.cpp $(LDFLAGS) + +updateBooleanAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateBooleanAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/updateBooleanAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateBooleanAttribute.cpp $(LDFLAGS) +updateEmailAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEmailAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/updateEmailAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEmailAttribute.cpp $(LDFLAGS) +updateEnumAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEnumAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/updateEnumAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEnumAttribute.cpp $(LDFLAGS) +updateFloatAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateFloatAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/updateFloatAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateFloatAttribute.cpp $(LDFLAGS) +updateIntegerAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIntegerAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/updateIntegerAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIntegerAttribute.cpp $(LDFLAGS) +updateIPaddressAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIPaddressAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/updateIPaddressAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIPaddressAttribute.cpp $(LDFLAGS) +updateStringAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateStringAttribute.cpp + $(CXX) $(CXXFLAGS) -o ./tests/attribute/updateStringAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateStringAttribute.cpp $(LDFLAGS) + +# Collection-Indexes +listIndexes: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/listIndexes.cpp + $(CXX) $(CXXFLAGS) -o ./tests/indexes/listIndexes $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/listIndexes.cpp $(LDFLAGS) +createIndex: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/createIndex.cpp + $(CXX) $(CXXFLAGS) -o ./tests/indexes/createIndex $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/createIndex.cpp $(LDFLAGS) +deleteIndex: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/deleteIndex.cpp + $(CXX) $(CXXFLAGS) -o ./tests/indexes/deleteIndex $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/deleteIndex.cpp $(LDFLAGS) +getIndex: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/getIndex.cpp + $(CXX) $(CXXFLAGS) -o ./tests/indexes/getIndex $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/getIndex.cpp $(LDFLAGS) + +# Storage +createBucket: $(SRCS) $(EXAMPLES_DIR)/storage/createBucket.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/createBucket $(SRCS) $(EXAMPLES_DIR)/storage/createBucket.cpp $(LDFLAGS) +updateBucket: $(SRCS) $(EXAMPLES_DIR)/storage/updateBucket.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/updateBucket $(SRCS) $(EXAMPLES_DIR)/storage/updateBucket.cpp $(LDFLAGS) +listBuckets: $(SRCS) $(EXAMPLES_DIR)/storage/listBuckets.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/listBuckets $(SRCS) $(EXAMPLES_DIR)/storage/listBuckets.cpp $(LDFLAGS) +getBucket: $(SRCS) $(EXAMPLES_DIR)/storage/getBucket.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/getBucket $(SRCS) $(EXAMPLES_DIR)/storage/getBucket.cpp $(LDFLAGS) +deleteBucket: $(SRCS) $(EXAMPLES_DIR)/storage/deleteBucket.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/deleteBucket $(SRCS) $(EXAMPLES_DIR)/storage/deleteBucket.cpp $(LDFLAGS) + +# Storage - Files +getFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/getFile.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/files/getFile $(SRCS) $(EXAMPLES_DIR)/storage/files/getFile.cpp $(LDFLAGS) +updateFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/updateFile.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/files/updateFile $(SRCS) $(EXAMPLES_DIR)/storage/files/updateFile.cpp $(LDFLAGS) +deleteFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/deleteFile.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/files/deleteFile $(SRCS) $(EXAMPLES_DIR)/storage/files/deleteFile.cpp $(LDFLAGS) +getFileDownload: $(SRCS) $(EXAMPLES_DIR)/storage/files/getFileDownload.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/files/getFileDownload $(SRCS) $(EXAMPLES_DIR)/storage/files/getFileDownload.cpp $(LDFLAGS) +getFileView: $(SRCS) $(EXAMPLES_DIR)/storage/files/getFileView.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/files/getFileView $(SRCS) $(EXAMPLES_DIR)/storage/files/getFileView.cpp $(LDFLAGS) +createFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/createFile.cpp + $(CXX) $(CXXFLAGS) -o ./tests/storage/files/createFile $(SRCS) $(EXAMPLES_DIR)/storage/files/createFile.cpp $(LDFLAGS) + + +# Health +getHealth: $(SRCS) $(EXAMPLES_DIR)/health/getHealth.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getHealth $(SRCS) $(EXAMPLES_DIR)/health/getHealth.cpp $(LDFLAGS) +getAntivirus: $(SRCS) $(EXAMPLES_DIR)/health/getAntivirus.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getAntivirus $(SRCS) $(EXAMPLES_DIR)/health/getAntivirus.cpp $(LDFLAGS) +getCache: $(SRCS) $(EXAMPLES_DIR)/health/getCache.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getCache $(SRCS) $(EXAMPLES_DIR)/health/getCache.cpp $(LDFLAGS) +getDB: $(SRCS) $(EXAMPLES_DIR)/health/getDB.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getDB $(SRCS) $(EXAMPLES_DIR)/health/getDB.cpp $(LDFLAGS) +getPubSub: $(SRCS) $(EXAMPLES_DIR)/health/getPubSub.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getPubSub $(SRCS) $(EXAMPLES_DIR)/health/getPubSub.cpp $(LDFLAGS) +getStorage: $(SRCS) $(EXAMPLES_DIR)/health/getStorage.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getStorage $(SRCS) $(EXAMPLES_DIR)/health/getStorage.cpp $(LDFLAGS) +getStorageLocal: $(SRCS) $(EXAMPLES_DIR)/health/getStorageLocal.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getStorageLocal $(SRCS) $(EXAMPLES_DIR)/health/getStorageLocal.cpp $(LDFLAGS) +getTime: $(SRCS) $(EXAMPLES_DIR)/health/getTime.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getTime $(SRCS) $(EXAMPLES_DIR)/health/getTime.cpp $(LDFLAGS) +getQueue: $(SRCS) $(EXAMPLES_DIR)/health/getQueue.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/getQueue $(SRCS) $(EXAMPLES_DIR)/health/getQueue.cpp $(LDFLAGS) +getCertificate: $(SRCS) $(EXAMPLES_DIR)/health/params/getCertificate.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getCertificate $(SRCS) $(EXAMPLES_DIR)/health/params/getCertificate.cpp $(LDFLAGS) +getQueueBuilds: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueBuilds.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueBuilds $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueBuilds.cpp $(LDFLAGS) +getQueueCertificates: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueCertificates.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueCertificates $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueCertificates.cpp $(LDFLAGS) +getQueueUsageWebhooks: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageWebhooks.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueUsageWebhooks $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageWebhooks.cpp $(LDFLAGS) +getQueueUsageDump: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageDump.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueUsageDump $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageDump.cpp $(LDFLAGS) +getQueueFunctions: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueFunctions.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueFunctions $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueFunctions.cpp $(LDFLAGS) +getQueueMails: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMails.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueMails $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMails.cpp $(LDFLAGS) +getQueueMessaging: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMessaging.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueMessaging $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMessaging.cpp $(LDFLAGS) +getQueueMigrations: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMigrations.cpp + $(CXX) $(CXXFLAGS) -o ./tests/health/params/getQueueMigrations $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMigrations.cpp $(LDFLAGS) +full_flow_test: $(SRCS) $(EXAMPLES_DIR)/full_flow_test.cpp + $(CXX) $(CXXFLAGS) -o ./tests/full_flow_test $(SRCS) $(EXAMPLES_DIR)/full_flow_test.cpp $(LDFLAGS) \ No newline at end of file diff --git a/README.md b/README.md index 5d10944..f90af11 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=flat-square&logo=c%2B%2B&logoColor=white) ![Appwrite](https://img.shields.io/badge/Appwrite-%23FD366E.svg?style=flat-square&logo=appwrite&logoColor=white) ![GitHub License](https://img.shields.io/github/license/pooranjoyb/cpp-sdk-appwrite?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-0.0.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.0.0-blue.svg?style=flat-square) ![banner-appwrite](https://github.com/user-attachments/assets/63e7dbad-6a49-4b80-bee2-8e0a46601eec) @@ -62,7 +62,6 @@ Once your SDK header is set, create the Appwrite service objects and choose the // for the Databases instance Databases& databases = appwrite.getDatabases(); - databases.setup(apiKey, projectId); ``` ### Full Example @@ -77,11 +76,9 @@ int main() { std::string name = ""; bool enabled = true; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); + Appwrite appwrite(projectId, apiKey); - databases.setup(apiKey, projectId); - std::string response = databases.create(databaseId, name, enabled); + std::string response = appwrite.getDatabases().create(databaseId, name, enabled); return 0; } diff --git a/examples/account/createAccount.cpp b/examples/account/createAccount.cpp index 8974110..5a66492 100644 --- a/examples/account/createAccount.cpp +++ b/examples/account/createAccount.cpp @@ -3,16 +3,15 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string email = "cbeow@main.com"; + std::string email = "cbeocscw@main.com"; std::string password = "pasvsdvsefefword"; - std::string userId = "13ferf2421wefew52"; - std::string name = "pooranjoy bhattacharya"; + std::string userId = "13ferf2csc421wefew52"; + std::string name = "pooranjoy cdcdscd"; Appwrite appwrite(projectId); - Account& auth = appwrite.getAccount(); try { - if (auth.createAccount(email, password, userId, name)) { + if (appwrite.getAccount().createAccount(email, password, userId, name)) { std::cout << "\nAccount created successfully!" << std::endl; diff --git a/examples/account/createSession.cpp b/examples/account/createSession.cpp index 15caaf3..2d6acc2 100644 --- a/examples/account/createSession.cpp +++ b/examples/account/createSession.cpp @@ -7,12 +7,11 @@ int main() { std::string password = "pasvsdvsefefword"; Appwrite appwrite(projectId); - Account& auth = appwrite.getAccount(); try { - std::string response = auth.createSession(email, password); + std::string response = appwrite.getAccount().createSession(email, password); std::cout << "\nSession created." << std::endl; - std::cout<< "\n\nResponse : " << response; + std::cout<< "\nResponse : " << response; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/createBooleanAttribute.cpp b/examples/database/collection/attribute/createBooleanAttribute.cpp index ee40e2d..ecd5baf 100644 --- a/examples/database/collection/attribute/createBooleanAttribute.cpp +++ b/examples/database/collection/attribute/createBooleanAttribute.cpp @@ -10,13 +10,10 @@ int main() { bool defaultValue = true; bool required = true; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createBooleanAttribute(databaseId, collectionId, attributeId, defaultValue, required); + std::string response = appwrite.getDatabases().createBooleanAttribute(databaseId, collectionId, attributeId, defaultValue, required); std::cout << "Boolean attribute created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/createEmailAttribute.cpp b/examples/database/collection/attribute/createEmailAttribute.cpp index 759a316..49299d4 100644 --- a/examples/database/collection/attribute/createEmailAttribute.cpp +++ b/examples/database/collection/attribute/createEmailAttribute.cpp @@ -10,13 +10,10 @@ int main() { bool required = true; std::string defaultValue = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createEmailAttribute(databaseId, collectionId, attributeId, required, defaultValue); + std::string response = appwrite.getDatabases().createEmailAttribute(databaseId, collectionId, attributeId, required, defaultValue); std::cout << "Email attribute created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/createEnumAttribute.cpp b/examples/database/collection/attribute/createEnumAttribute.cpp index 96d9db8..2c4f0d9 100644 --- a/examples/database/collection/attribute/createEnumAttribute.cpp +++ b/examples/database/collection/attribute/createEnumAttribute.cpp @@ -11,13 +11,10 @@ int main() { std::string defaultValue = ""; std::vector elements = {"element123"}; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createEnumAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements); + std::string response = appwrite.getDatabases().createEnumAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements); std::cout << "Enum attribute created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/createFloatAttribute.cpp b/examples/database/collection/attribute/createFloatAttribute.cpp index f8b80a5..cdbf57d 100644 --- a/examples/database/collection/attribute/createFloatAttribute.cpp +++ b/examples/database/collection/attribute/createFloatAttribute.cpp @@ -12,13 +12,10 @@ int main() { double max = 100.0; std::string defaultValue = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createFloatAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue); + std::string response = appwrite.getDatabases().createFloatAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue); std::cout << "Float attribute created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/createIPaddressAttribute.cpp b/examples/database/collection/attribute/createIPaddressAttribute.cpp index 4374e51..b5e67cc 100644 --- a/examples/database/collection/attribute/createIPaddressAttribute.cpp +++ b/examples/database/collection/attribute/createIPaddressAttribute.cpp @@ -10,13 +10,10 @@ int main() { bool required = true; std::string defaultValue = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createIPaddressAttribute(databaseId, collectionId, attributeId, required, defaultValue); + std::string response = appwrite.getDatabases().createIPaddressAttribute(databaseId, collectionId, attributeId, required, defaultValue); std::cout << "IP Addresss attribute created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/createIntegerAttribute.cpp b/examples/database/collection/attribute/createIntegerAttribute.cpp index 14887e2..60d63f0 100644 --- a/examples/database/collection/attribute/createIntegerAttribute.cpp +++ b/examples/database/collection/attribute/createIntegerAttribute.cpp @@ -12,13 +12,10 @@ int main() { int max = 100; std::string defaultValue = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createIntegerAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue); + std::string response = appwrite.getDatabases().createIntegerAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue); std::cout << "Integer attribute created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/createStringAttribute.cpp b/examples/database/collection/attribute/createStringAttribute.cpp index 46f5e1e..f57430d 100644 --- a/examples/database/collection/attribute/createStringAttribute.cpp +++ b/examples/database/collection/attribute/createStringAttribute.cpp @@ -12,13 +12,10 @@ int main() { std::vector elements = {"element123"}; int size = 255; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createStringAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements, size); + std::string response = appwrite.getDatabases().createStringAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements, size); std::cout << "String attribute created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/listAttributes.cpp b/examples/database/collection/attribute/listAttributes.cpp index 0e79656..758cf13 100644 --- a/examples/database/collection/attribute/listAttributes.cpp +++ b/examples/database/collection/attribute/listAttributes.cpp @@ -7,13 +7,10 @@ int main() { std::string databaseId = "database123"; std::string collectionId = "test1234"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.listAttributes(databaseId, collectionId); + std::string response = appwrite.getDatabases().listAttributes(databaseId, collectionId); std::cout << "Attributes listed successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/updateBooleanAttribute.cpp b/examples/database/collection/attribute/updateBooleanAttribute.cpp index 5cd3f1c..a459dfb 100644 --- a/examples/database/collection/attribute/updateBooleanAttribute.cpp +++ b/examples/database/collection/attribute/updateBooleanAttribute.cpp @@ -11,13 +11,10 @@ int main() { bool defaultValue = false; bool required = false; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateBooleanAttribute(databaseId, collectionId, attributeId, defaultValue, required, new_key); + std::string response = appwrite.getDatabases().updateBooleanAttribute(databaseId, collectionId, attributeId, defaultValue, required, new_key); std::cout << "Boolean attribute updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/updateEmailAttribute.cpp b/examples/database/collection/attribute/updateEmailAttribute.cpp index bdc31a4..bca88d2 100644 --- a/examples/database/collection/attribute/updateEmailAttribute.cpp +++ b/examples/database/collection/attribute/updateEmailAttribute.cpp @@ -11,13 +11,10 @@ int main() { std::string new_key = "new_email_attribute"; std::string defaultValue = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateEmailAttribute(databaseId, collectionId, attributeId, required, defaultValue, new_key); + std::string response = appwrite.getDatabases().updateEmailAttribute(databaseId, collectionId, attributeId, required, defaultValue, new_key); std::cout << "Email attribute updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/updateEnumAttribute.cpp b/examples/database/collection/attribute/updateEnumAttribute.cpp index 67c1102..19f202f 100644 --- a/examples/database/collection/attribute/updateEnumAttribute.cpp +++ b/examples/database/collection/attribute/updateEnumAttribute.cpp @@ -12,13 +12,10 @@ int main() { std::vector elements = {"element1234"}; std::string new_key = "new_enum_attribute"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateEnumAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements, new_key); + std::string response = appwrite.getDatabases().updateEnumAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements, new_key); std::cout << "Enum attribute updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/updateFloatAttribute.cpp b/examples/database/collection/attribute/updateFloatAttribute.cpp index 573496b..964a9c4 100644 --- a/examples/database/collection/attribute/updateFloatAttribute.cpp +++ b/examples/database/collection/attribute/updateFloatAttribute.cpp @@ -13,13 +13,10 @@ int main() { std::string defaultValue = ""; std::string new_key = "UpdatedFloat123"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateFloatAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue, new_key); + std::string response = appwrite.getDatabases().updateFloatAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue, new_key); std::cout << "Float attribute updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/updateIPaddressAttribute.cpp b/examples/database/collection/attribute/updateIPaddressAttribute.cpp index 24fe45c..e582559 100644 --- a/examples/database/collection/attribute/updateIPaddressAttribute.cpp +++ b/examples/database/collection/attribute/updateIPaddressAttribute.cpp @@ -11,13 +11,10 @@ int main() { std::string new_key = "UpdatedIPaddress123"; std::string defaultValue = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateIPaddressAttribute(databaseId, collectionId, attributeId, required, defaultValue, new_key); + std::string response = appwrite.getDatabases().updateIPaddressAttribute(databaseId, collectionId, attributeId, required, defaultValue, new_key); std::cout << "IP Address attribute updated successfully!\nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Appwrite exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/updateIntegerAttribute.cpp b/examples/database/collection/attribute/updateIntegerAttribute.cpp index 9dde9e9..4ecdf0b 100644 --- a/examples/database/collection/attribute/updateIntegerAttribute.cpp +++ b/examples/database/collection/attribute/updateIntegerAttribute.cpp @@ -13,13 +13,10 @@ int main() { std::string defaultValue = ""; std::string new_key = "UpdatedInteger123"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateIntegerAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue, new_key); + std::string response = appwrite.getDatabases().updateIntegerAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue, new_key); std::cout << "Integer attribute updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/attribute/updateStringAttribute.cpp b/examples/database/collection/attribute/updateStringAttribute.cpp index 916e6fc..66dd5b4 100644 --- a/examples/database/collection/attribute/updateStringAttribute.cpp +++ b/examples/database/collection/attribute/updateStringAttribute.cpp @@ -14,13 +14,10 @@ int main() { int size = 5; std::string new_key = "UpdatedString123"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateStringAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements, size, new_key); + std::string response = appwrite.getDatabases().updateStringAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements, size, new_key); std::cout << "String attribute updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/createCollection.cpp b/examples/database/collection/createCollection.cpp index eca46d6..b3b7c1e 100644 --- a/examples/database/collection/createCollection.cpp +++ b/examples/database/collection/createCollection.cpp @@ -9,13 +9,10 @@ int main() { std::string name = "samplecollection"; bool enabled = true; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createCollection(databaseId, collectionId, name, enabled); + std::string response = appwrite.getDatabases().createCollection(databaseId, collectionId, name, enabled); std::cout << "Collection created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/deleteCollection.cpp b/examples/database/collection/deleteCollection.cpp index ef7e23f..a583e1d 100644 --- a/examples/database/collection/deleteCollection.cpp +++ b/examples/database/collection/deleteCollection.cpp @@ -7,13 +7,10 @@ int main() { std::string databaseId = "database123"; std::string collectionId = "test123"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.deleteCollection(databaseId, collectionId); + std::string response = appwrite.getDatabases().deleteCollection(databaseId, collectionId); std::cout << "collection deleted successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/document/createDocument.cpp b/examples/database/collection/document/createDocument.cpp index 34101a4..0decda9 100644 --- a/examples/database/collection/document/createDocument.cpp +++ b/examples/database/collection/document/createDocument.cpp @@ -18,14 +18,11 @@ int main() {"UpdatedString123", {"abc", "def"}} }; - Appwrite appwrite(projectId); - Databases &databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.createDocument(databaseId, collectionId, documentId, data); + std::string response = appwrite.getDatabases().createDocument(databaseId, collectionId, documentId, data); std::cout << "Document created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException &ex) diff --git a/examples/database/collection/document/deleteDocument.cpp b/examples/database/collection/document/deleteDocument.cpp index 719b22a..fe48e45 100644 --- a/examples/database/collection/document/deleteDocument.cpp +++ b/examples/database/collection/document/deleteDocument.cpp @@ -8,13 +8,10 @@ int main() { std::string collectionId = "test1234"; std::string documentId = "document1234"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.deleteDocument(databaseId, collectionId, documentId); + std::string response = appwrite.getDatabases().deleteDocument(databaseId, collectionId, documentId); std::cout << "document deleted successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/document/getDocument.cpp b/examples/database/collection/document/getDocument.cpp index 395631b..8cd3149 100644 --- a/examples/database/collection/document/getDocument.cpp +++ b/examples/database/collection/document/getDocument.cpp @@ -8,13 +8,10 @@ int main() { std::string collectionId = "test1234"; std::string documentId = "document123"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.getDocument(databaseId, collectionId, documentId); + std::string response = appwrite.getDatabases().getDocument(databaseId, collectionId, documentId); std::cout << "Document fetched successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/document/listDocument.cpp b/examples/database/collection/document/listDocument.cpp index 5d6e759..39a8553 100644 --- a/examples/database/collection/document/listDocument.cpp +++ b/examples/database/collection/document/listDocument.cpp @@ -7,13 +7,10 @@ int main() { std::string databaseId = "database123"; std::string collectionId = "test1234"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.listDocument(databaseId, collectionId); + std::string response = appwrite.getDatabases().listDocument(databaseId, collectionId); std::cout << "Documents listed successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/getCollection.cpp b/examples/database/collection/getCollection.cpp index a616d87..fb4833c 100644 --- a/examples/database/collection/getCollection.cpp +++ b/examples/database/collection/getCollection.cpp @@ -7,13 +7,10 @@ int main() { std::string databaseId = "database123"; std::string collectionId = "test1234"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.getCollection(databaseId, collectionId); + std::string response = appwrite.getDatabases().getCollection(databaseId, collectionId); std::cout << "Collection fetched successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/indexes/createIndex.cpp b/examples/database/collection/indexes/createIndex.cpp index ef97bb6..a185681 100644 --- a/examples/database/collection/indexes/createIndex.cpp +++ b/examples/database/collection/indexes/createIndex.cpp @@ -5,8 +5,7 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - Appwrite appwrite(projectId); - Databases& database = appwrite.getDatabases(); + Appwrite appwrite(projectId, apiKey); std::string databaseId = "database123"; std::string collectionId = "test1234"; @@ -15,11 +14,9 @@ int main() { // we need to use type as "key" for arrayed attributes std::string type = "key"; std::vector attributes = {"new_enum_attribute"}; - - database.setup(apiKey, projectId); try { - std::string response = database.createIndexes( + std::string response = appwrite.getDatabases().createIndexes( databaseId, collectionId,key, type, attributes ); std::cout << "Index created successfully! \nResponse: " << response << std::endl; diff --git a/examples/database/collection/indexes/deleteIndex.cpp b/examples/database/collection/indexes/deleteIndex.cpp index f31acd2..0687bcd 100644 --- a/examples/database/collection/indexes/deleteIndex.cpp +++ b/examples/database/collection/indexes/deleteIndex.cpp @@ -8,13 +8,10 @@ int main() { std::string collectionId = "test1234"; std::string indexKey = "index_from_cpp"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.deleteIndexes(databaseId, collectionId, indexKey); + std::string response = appwrite.getDatabases().deleteIndexes(databaseId, collectionId, indexKey); std::cout << "Index deleted successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/indexes/getIndex.cpp b/examples/database/collection/indexes/getIndex.cpp index c323576..845e2f9 100644 --- a/examples/database/collection/indexes/getIndex.cpp +++ b/examples/database/collection/indexes/getIndex.cpp @@ -8,13 +8,10 @@ int main() { std::string collectionId = "test1234"; std::string indexKey = "index_1"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.getCollection(databaseId, collectionId); + std::string response = appwrite.getDatabases().getIndexes(databaseId, collectionId, indexKey); std::cout << "Index fetched successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/indexes/listIndexes.cpp b/examples/database/collection/indexes/listIndexes.cpp index 733db18..74ef24b 100644 --- a/examples/database/collection/indexes/listIndexes.cpp +++ b/examples/database/collection/indexes/listIndexes.cpp @@ -7,13 +7,10 @@ int main() { std::string databaseId = "database123"; std::string collectionId = "test1234"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.listIndexes(databaseId, collectionId); + std::string response = appwrite.getDatabases().listIndexes(databaseId, collectionId); std::cout << "Indexes listed successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/listCollection.cpp b/examples/database/collection/listCollection.cpp index 28ed57a..3c0985b 100644 --- a/examples/database/collection/listCollection.cpp +++ b/examples/database/collection/listCollection.cpp @@ -6,13 +6,10 @@ int main() { std::string apiKey = ""; std::string databaseId = "database123"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.listCollection(databaseId); + std::string response = appwrite.getDatabases().listCollection(databaseId); std::cout << "Collections listed successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/collection/updateCollection.cpp b/examples/database/collection/updateCollection.cpp index e0cdd62..9f45fec 100644 --- a/examples/database/collection/updateCollection.cpp +++ b/examples/database/collection/updateCollection.cpp @@ -9,13 +9,10 @@ int main() { std::string name = "schanged_collection_name_112"; bool enabled = true; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.updateCollection(databaseId, collectionId, name, enabled); + std::string response = appwrite.getDatabases().updateCollection(databaseId, collectionId, name, enabled); std::cout << "collection updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/createDatabase.cpp b/examples/database/createDatabase.cpp index fe28c78..f492786 100644 --- a/examples/database/createDatabase.cpp +++ b/examples/database/createDatabase.cpp @@ -8,13 +8,10 @@ int main() { std::string name = "sampledb"; bool enabled = true; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.create(databaseId, name, enabled); + std::string response = appwrite.getDatabases().create(databaseId, name, enabled); std::cout << "Database created successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/getCollectionUsage.cpp b/examples/database/getCollectionUsage.cpp index 36e577c..6e2f573 100644 --- a/examples/database/getCollectionUsage.cpp +++ b/examples/database/getCollectionUsage.cpp @@ -5,21 +5,14 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string databaseId; - std::string databasesResponse = databases.list(); - databaseId = "database123"; - - std::string collectionId; - collectionId = "test1234"; + std::string databaseId = "database123"; + std::string collectionId = "test1234"; std::string usageRange = "24h"; - std::string response = databases.getDatabaseUsage(databaseId, usageRange); + std::string response = appwrite.getDatabases().getDatabaseUsage(databaseId, usageRange); std::cout << "Collection usage fetched successfully! \nResponse: " << response << std::endl; diff --git a/examples/database/getDatabase.cpp b/examples/database/getDatabase.cpp index fb44e53..2bb8f92 100644 --- a/examples/database/getDatabase.cpp +++ b/examples/database/getDatabase.cpp @@ -6,13 +6,10 @@ int main() { std::string apiKey = ""; std::string databaseId = "database123"; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.get(databaseId); + std::string response = appwrite.getDatabases().get(databaseId); std::cout << "Database fetched successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/getDatabaseUsage.cpp b/examples/database/getDatabaseUsage.cpp index 69183c8..316de3b 100644 --- a/examples/database/getDatabaseUsage.cpp +++ b/examples/database/getDatabaseUsage.cpp @@ -5,18 +5,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string databaseId; - std::string databasesResponse = databases.list(); - databaseId = "database123"; - + std::string databaseId = "database123"; std::string usageRange = "24h"; - std::string response = databases.getDatabaseUsage(databaseId, usageRange); + std::string response = appwrite.getDatabases().getDatabaseUsage(databaseId, usageRange); std::cout << "Database usage fetched successfully! \nResponse: " << response << std::endl; diff --git a/examples/database/listDatabase.cpp b/examples/database/listDatabase.cpp index 5aaec4a..292f847 100644 --- a/examples/database/listDatabase.cpp +++ b/examples/database/listDatabase.cpp @@ -5,13 +5,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.list(); + std::string response = appwrite.getDatabases().list(); std::cout << "Databases listed successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/database/updateDatabase.cpp b/examples/database/updateDatabase.cpp index 7c3a84d..ba218aa 100644 --- a/examples/database/updateDatabase.cpp +++ b/examples/database/updateDatabase.cpp @@ -8,13 +8,10 @@ int main() { std::string name = "sampledb112"; bool enabled = true; - Appwrite appwrite(projectId); - Databases& databases = appwrite.getDatabases(); - - databases.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = databases.update(databaseId, name, enabled); + std::string response = appwrite.getDatabases().update(databaseId, name, enabled); std::cout << "Database updated successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getAntivirus.cpp b/examples/health/getAntivirus.cpp index 0876307..01394a0 100644 --- a/examples/health/getAntivirus.cpp +++ b/examples/health/getAntivirus.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); - - health.setup(apiKey, projectId); - + Appwrite appwrite(projectId, apiKey); + try { - std::string response = health.getAntivirus(); + std::string response = appwrite.getHealth().getAntivirus(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getCache.cpp b/examples/health/getCache.cpp index 7e62eeb..d7963c9 100644 --- a/examples/health/getCache.cpp +++ b/examples/health/getCache.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getCache(); + std::string response = appwrite.getHealth().getCache(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getDB.cpp b/examples/health/getDB.cpp index 71efab5..cb46d5f 100644 --- a/examples/health/getDB.cpp +++ b/examples/health/getDB.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getDB(); + std::string response = appwrite.getHealth().getDB(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getHealth.cpp b/examples/health/getHealth.cpp index fc8e319..ecbb00b 100644 --- a/examples/health/getHealth.cpp +++ b/examples/health/getHealth.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getHealth(); + std::string response = appwrite.getHealth().getHealthStatus(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getPubSub.cpp b/examples/health/getPubSub.cpp index 511a0ef..1c97787 100644 --- a/examples/health/getPubSub.cpp +++ b/examples/health/getPubSub.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getPubSub(); + std::string response = appwrite.getHealth().getPubSub(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getQueue.cpp b/examples/health/getQueue.cpp index 7ad2fd8..2ab76ad 100644 --- a/examples/health/getQueue.cpp +++ b/examples/health/getQueue.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueue(); + std::string response = appwrite.getHealth().getQueue(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getStorage.cpp b/examples/health/getStorage.cpp index f6c5bd4..26ac98d 100644 --- a/examples/health/getStorage.cpp +++ b/examples/health/getStorage.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getStorage(); + std::string response = appwrite.getHealth().getStorage(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getStorageLocal.cpp b/examples/health/getStorageLocal.cpp index 38d8ae1..18026d1 100644 --- a/examples/health/getStorageLocal.cpp +++ b/examples/health/getStorageLocal.cpp @@ -4,14 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getStorageLocal(); + std::string response = appwrite.getHealth().getStorageLocal(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/getTime.cpp b/examples/health/getTime.cpp index 81402f9..cb445ec 100644 --- a/examples/health/getTime.cpp +++ b/examples/health/getTime.cpp @@ -3,15 +3,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); - - health.setup(apiKey, projectId); - + try { - std::string response = health.getTime(); + std::string response = appwrite.getHealth().getTime(); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getCertificate.cpp b/examples/health/params/getCertificate.cpp index 85fa4b9..565195a 100644 --- a/examples/health/params/getCertificate.cpp +++ b/examples/health/params/getCertificate.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string domain = "pooranjoyb.tech"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); - - health.setup(apiKey, projectId); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); try { - std::string response = health.getCertificate(domain); + std::string response = appwrite.getHealth().getCertificate(domain); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueBuilds.cpp b/examples/health/params/getQueueBuilds.cpp index 9a5602c..1a305a7 100644 --- a/examples/health/params/getQueueBuilds.cpp +++ b/examples/health/params/getQueueBuilds.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueueBuilds(threshold); + std::string response = appwrite.getHealth().getQueueBuilds(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueCertificates.cpp b/examples/health/params/getQueueCertificates.cpp index 895fad5..2889d63 100644 --- a/examples/health/params/getQueueCertificates.cpp +++ b/examples/health/params/getQueueCertificates.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueueCertificates(threshold); + std::string response = appwrite.getHealth().getQueueCertificates(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueFunctions.cpp b/examples/health/params/getQueueFunctions.cpp index b0af4ab..eaa45cc 100644 --- a/examples/health/params/getQueueFunctions.cpp +++ b/examples/health/params/getQueueFunctions.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueueFunctions(threshold); + std::string response = appwrite.getHealth().getQueueFunctions(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueMails.cpp b/examples/health/params/getQueueMails.cpp index dc0fee7..02978b4 100644 --- a/examples/health/params/getQueueMails.cpp +++ b/examples/health/params/getQueueMails.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueueMails(threshold); + std::string response = appwrite.getHealth().getQueueMails(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueMessaging.cpp b/examples/health/params/getQueueMessaging.cpp index 434a58a..a19e9f9 100644 --- a/examples/health/params/getQueueMessaging.cpp +++ b/examples/health/params/getQueueMessaging.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueueMessaging(threshold); + std::string response = appwrite.getHealth().getQueueMessaging(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueMigrations.cpp b/examples/health/params/getQueueMigrations.cpp index e1a3c1d..9822554 100644 --- a/examples/health/params/getQueueMigrations.cpp +++ b/examples/health/params/getQueueMigrations.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); - - health.setup(apiKey, projectId); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); try { - std::string response = health.getQueueMigrations(threshold); + std::string response = appwrite.getHealth().getQueueMigrations(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueUsageDump.cpp b/examples/health/params/getQueueUsageDump.cpp index c9fade1..fc1155b 100644 --- a/examples/health/params/getQueueUsageDump.cpp +++ b/examples/health/params/getQueueUsageDump.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueueUsageDump(threshold); + std::string response = appwrite.getHealth().getQueueUsageDump(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/health/params/getQueueUsageWebhooks.cpp b/examples/health/params/getQueueUsageWebhooks.cpp index b0bba31..faab10d 100644 --- a/examples/health/params/getQueueUsageWebhooks.cpp +++ b/examples/health/params/getQueueUsageWebhooks.cpp @@ -3,16 +3,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; - std::string apiKey = ""; std::string threshold = "5"; - - Appwrite appwrite(projectId); - Health& health = appwrite.getHealth(); + std::string apiKey = ""; + Appwrite appwrite(projectId, apiKey); - health.setup(apiKey, projectId); - try { - std::string response = health.getQueueUsageWebhooks(threshold); + std::string response = appwrite.getHealth().getQueueUsageWebhooks(threshold); std::cout << "Health Check Done! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/storage/createBucket.cpp b/examples/storage/createBucket.cpp index b27f508..263c012 100644 --- a/examples/storage/createBucket.cpp +++ b/examples/storage/createBucket.cpp @@ -4,13 +4,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string bucketId = "bucket12322"; - std::string name = "testBucketnew"; + std::string bucketId = "bucketnew"; + std::string name = "PEWPEWPEW"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); std::vector permissions = {"read(\"any\")", "write(\"any\")"}; bool fileSecurity = true; @@ -22,7 +19,7 @@ int main() { bool encryption = true; try { - std::string response = storage.createBucket( + std::string response = appwrite.getStorage().createBucket( bucketId, name, permissions, diff --git a/examples/storage/deleteBucket.cpp b/examples/storage/deleteBucket.cpp index eccc69a..4ae6d9c 100644 --- a/examples/storage/deleteBucket.cpp +++ b/examples/storage/deleteBucket.cpp @@ -4,15 +4,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string bucketId = "bucket123"; + std::string bucketId = "bucket12322"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); + Appwrite appwrite(projectId, apiKey); - storage.setup(apiKey, projectId); - try { - std::string response = storage.deleteBucket(bucketId); + std::string response = appwrite.getStorage().deleteBucket(bucketId); std::cout << "Bucket deleted successfully!" < permissions = {"role:all"}; - std::string response = storage.createFile(bucketId, fileName, fileContent, permissions); + std::string response = appwrite.getStorage().createFile(bucketId, fileName, fileContent, permissions); std::cout << "File created successfully!\n\nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { diff --git a/examples/storage/files/deleteFile.cpp b/examples/storage/files/deleteFile.cpp index e1bba29..b2cc066 100644 --- a/examples/storage/files/deleteFile.cpp +++ b/examples/storage/files/deleteFile.cpp @@ -4,20 +4,17 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string fileId = "6711ee630008e3491a68"; - std::string bucketId = "bucket12322"; + std::string fileId = "example.txt"; + std::string bucketId = "bucketnew"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = storage.deleteFile(bucketId, fileId); + std::string response = appwrite.getStorage().deleteFile(bucketId, fileId); std::cout << "File deleted successfully! \n " << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; } return 0; -} +} \ No newline at end of file diff --git a/examples/storage/files/getFile.cpp b/examples/storage/files/getFile.cpp index f773aa2..849f8d0 100644 --- a/examples/storage/files/getFile.cpp +++ b/examples/storage/files/getFile.cpp @@ -4,16 +4,13 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string fileId = "6711ea1100320ad524a6"; - std::string bucketId = "bucket12322"; + std::string fileId = "example.txt"; + std::string bucketId = "bucketnew"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = storage.getFile(bucketId, fileId); + std::string response = appwrite.getStorage().getFile(bucketId, fileId); std::cout << "File fetched successfully! \n\nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/storage/files/getFileDownload.cpp b/examples/storage/files/getFileDownload.cpp index 1f4ab55..fdfe353 100644 --- a/examples/storage/files/getFileDownload.cpp +++ b/examples/storage/files/getFileDownload.cpp @@ -4,16 +4,13 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string fileId = "6711ea1100320ad524a6"; - std::string bucketId = "bucket12322"; + std::string fileId = "example.txt"; + std::string bucketId = "bucketnew"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = storage.getFileDownload(bucketId, fileId); + std::string response = appwrite.getStorage().getFileDownload(bucketId, fileId); std::cout << "File fetched successfully! \n\nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/storage/files/getFileView.cpp b/examples/storage/files/getFileView.cpp index a7dc367..4cc4094 100644 --- a/examples/storage/files/getFileView.cpp +++ b/examples/storage/files/getFileView.cpp @@ -4,16 +4,13 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string fileId = "6711ea1100320ad524a6"; - std::string bucketId = "bucket12322"; + std::string fileId = "example.txt"; + std::string bucketId = "bucketnew"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); + Appwrite appwrite(projectId, apiKey); - storage.setup(apiKey, projectId); - try { - std::string response = storage.getFileView(bucketId, fileId); + std::string response = appwrite.getStorage().getFileView(bucketId, fileId); std::cout << "File fetched successfully! \n\nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/storage/files/updateFile.cpp b/examples/storage/files/updateFile.cpp index a315f4b..c70d369 100644 --- a/examples/storage/files/updateFile.cpp +++ b/examples/storage/files/updateFile.cpp @@ -4,20 +4,15 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string bucketId = "bucket12322"; - std::string fileId = "6711ea1100320ad524a6"; + std::string bucketId = "bucketnew"; + std::string fileId = "example.txt"; std::string name = "pingu123updated"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); - + Appwrite appwrite(projectId, apiKey); std::vector permissions = {"read(\"any\")", "write(\"any\")"}; - try { - std::string response = storage.updateFile( + std::string response = appwrite.getStorage().updateFile( bucketId, fileId, name, diff --git a/examples/storage/getBucket.cpp b/examples/storage/getBucket.cpp index 950326d..6682ebc 100644 --- a/examples/storage/getBucket.cpp +++ b/examples/storage/getBucket.cpp @@ -4,15 +4,12 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - std::string bucketId = "bucket123"; + std::string bucketId = "bucket12322"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = storage.getBucket(bucketId); + std::string response = appwrite.getStorage().getBucket(bucketId); std::cout << "Bucket fetched successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/storage/listBuckets.cpp b/examples/storage/listBuckets.cpp index c9f790a..b0bb272 100644 --- a/examples/storage/listBuckets.cpp +++ b/examples/storage/listBuckets.cpp @@ -5,13 +5,10 @@ int main() { std::string projectId = "66fbb5a100070a3a1d19"; std::string apiKey = ""; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); try { - std::string response = storage.listBuckets(); + std::string response = appwrite.getStorage().listBuckets(); std::cout << "Bucket fetched successfully! \nResponse: " << response << std::endl; } catch (const AppwriteException& ex) { std::cerr << "Exception: " << ex.what() << std::endl; diff --git a/examples/storage/updateBucket.cpp b/examples/storage/updateBucket.cpp index ca07cc4..62ed068 100644 --- a/examples/storage/updateBucket.cpp +++ b/examples/storage/updateBucket.cpp @@ -7,10 +7,7 @@ int main() { std::string bucketId = "bucket12322"; std::string name = "testBucketupdated"; - Appwrite appwrite(projectId); - Storage& storage = appwrite.getStorage(); - - storage.setup(apiKey, projectId); + Appwrite appwrite(projectId, apiKey); std::vector permissions = {"read(\"any\")", "write(\"any\")"}; bool fileSecurity = false; @@ -18,11 +15,11 @@ int main() { int maximumFileSize = 30000000; std::vector allowedFileExtensions = {"jpg", "png"}; std::string compression = "gzip"; - bool antivirus = false; + bool antivirus = true; bool encryption = false; try { - std::string response = storage.updateBucket( + std::string response = appwrite.getStorage().updateBucket( bucketId, name, permissions, diff --git a/include/Appwrite.hpp b/include/Appwrite.hpp index dc66125..092865e 100644 --- a/include/Appwrite.hpp +++ b/include/Appwrite.hpp @@ -8,7 +8,7 @@ class Appwrite { public: - Appwrite(const std::string& projectId); + Appwrite(const std::string& projectId, const std::string& apiKey = ""); Account& getAccount(); Databases& getDatabases(); Storage& getStorage(); @@ -16,6 +16,7 @@ class Appwrite { private: std::string projectId; + std::string apiKey; Account account; Databases databases; Storage storage; diff --git a/include/classes/Account.hpp b/include/classes/Account.hpp index e967530..117947c 100644 --- a/include/classes/Account.hpp +++ b/include/classes/Account.hpp @@ -8,7 +8,8 @@ class Account { public: - void setup(const std::string& projectId); + explicit Account(const std::string& projectId); + bool createAccount(const std::string& email, const std::string& password, const std::string& userId, const std::string& name); std::string createSession(const std::string& email, const std::string& password); diff --git a/include/classes/Databases.hpp b/include/classes/Databases.hpp index 470f569..0148e58 100644 --- a/include/classes/Databases.hpp +++ b/include/classes/Databases.hpp @@ -11,7 +11,7 @@ using json = nlohmann::json; class Databases { public: - void setup(const std::string& apiKey, const std::string& projectId); + Databases(const std::string& projectId, const std::string& apiKey); // Database std::string list(); diff --git a/include/classes/Health.hpp b/include/classes/Health.hpp index 6b3a85d..af8d7dd 100644 --- a/include/classes/Health.hpp +++ b/include/classes/Health.hpp @@ -8,10 +8,10 @@ class Health { public: - void setup(const std::string& apiKey, const std::string& projectId); + Health(const std::string& projectId, const std::string& apiKey); // core - std::string getHealth(); + std::string getHealthStatus(); std::string getAntivirus(); std::string getCache(); std::string getDB(); diff --git a/include/classes/Storage.hpp b/include/classes/Storage.hpp index 8e7ea19..ece22b9 100644 --- a/include/classes/Storage.hpp +++ b/include/classes/Storage.hpp @@ -12,7 +12,7 @@ using json = nlohmann::json; class Storage { public: - void setup(const std::string &apiKey, const std::string &projectId); + Storage(const std::string& projectId, const std::string& apiKey); //core std::string listBuckets(); diff --git a/src/Appwrite.cpp b/src/Appwrite.cpp index 9e264d6..3f74c6b 100644 --- a/src/Appwrite.cpp +++ b/src/Appwrite.cpp @@ -1,8 +1,9 @@ #include "Appwrite.hpp" -Appwrite::Appwrite(const std::string& projectId) : account() , databases() { - account.setup(projectId); -} +Appwrite::Appwrite(const std::string& projectId, const std::string& apiKey) + : projectId(projectId), apiKey(apiKey), account(projectId), + databases(projectId, apiKey), storage(projectId, apiKey), health(projectId, apiKey) {} + Account& Appwrite::getAccount() { return account; diff --git a/src/services/Account.cpp b/src/services/Account.cpp index 8b7b696..9563c6e 100644 --- a/src/services/Account.cpp +++ b/src/services/Account.cpp @@ -6,9 +6,7 @@ #include "enums/HttpStatus.hpp" #include "exceptions/AppwriteException.hpp" -void Account::setup(const std::string& projectId) { - this->projectId = projectId; -} +Account::Account(const std::string& projectId) : projectId(projectId) {} bool Account::createAccount(const std::string& email, const std::string& password, const std::string& userId, const std::string& name = "") { diff --git a/src/services/Databases.cpp b/src/services/Databases.cpp index 31039f8..9691c16 100644 --- a/src/services/Databases.cpp +++ b/src/services/Databases.cpp @@ -7,10 +7,8 @@ #include "enums/HttpStatus.hpp" #include "exceptions/AppwriteException.hpp" -void Databases::setup(const std::string &apiKey, const std::string &projectId) { - this->apiKey = apiKey; - this->projectId = projectId; -} +Databases::Databases(const std::string& projectId, const std::string& apiKey) + : projectId(projectId), apiKey(apiKey) {} //database std::string Databases::create(const std::string &databaseId, const std::string &name, bool enabled = false) { diff --git a/src/services/Health.cpp b/src/services/Health.cpp index ea905aa..eff5dd2 100644 --- a/src/services/Health.cpp +++ b/src/services/Health.cpp @@ -7,12 +7,10 @@ #include "enums/HttpStatus.hpp" #include "exceptions/AppwriteException.hpp" -void Health::setup(const std::string &apiKey, const std::string &projectId) { - this->apiKey = apiKey; - this->projectId = projectId; -} +Health::Health(const std::string& projectId, const std::string& apiKey) + : projectId(projectId), apiKey(apiKey) {} -std::string Health::getHealth(){ +std::string Health::getHealthStatus(){ std::string url = Config::API_BASE_URL + "/health"; diff --git a/src/services/Storage.cpp b/src/services/Storage.cpp index fd22f0b..0be7fb3 100644 --- a/src/services/Storage.cpp +++ b/src/services/Storage.cpp @@ -7,10 +7,8 @@ #include "enums/HttpStatus.hpp" #include "exceptions/AppwriteException.hpp" -void Storage::setup(const std::string &apiKey, const std::string &projectId) { - this->apiKey = apiKey; - this->projectId = projectId; -} +Storage::Storage(const std::string& projectId, const std::string& apiKey) + : projectId(projectId), apiKey(apiKey) {} std::string Storage::createBucket(const std::string& bucketId, const std::string& name, const std::vector& permissions, diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 5b4c271..0000000 --- a/tests/Makefile +++ /dev/null @@ -1,234 +0,0 @@ -CXX = g++ -CXXFLAGS = -std=c++11 -Iinclude -LDFLAGS = -lcurl - -SRC_DIR = src -INCLUDE_DIR = include -EXAMPLES_DIR = examples - -SRCS = \ - $(SRC_DIR)/Appwrite.cpp \ - $(SRC_DIR)/services/Account.cpp \ - $(SRC_DIR)/services/Databases.cpp \ - $(SRC_DIR)/services/Storage.cpp \ - $(SRC_DIR)/services/Health.cpp \ - $(SRC_DIR)/Utils.cpp \ - $(SRC_DIR)/Validator.cpp \ - -BINS = \ - createAccount \ - createSession \ - createDatabase \ - updateDatabase \ - getDatabase \ - listDatabase \ - getDatabaseUsage \ - getCollectionUsage \ - listCollection \ - createCollection \ - getCollection \ - updateCollection \ - deleteCollection \ - createDocument \ - listDocument \ - getDocument \ - deleteDocument \ - listAttributes \ - createBooleanAttribute \ - createEmailAttribute \ - createEnumAttribute \ - createFloatAttribute \ - createIntegerAttribute \ - createIPaddressAttribute \ - createStringAttribute \ - updateBooleanAttribute \ - updateEmailAttribute \ - updateEnumAttribute \ - updateFloatAttribute \ - updateIntegerAttribute \ - updateIPaddressAttribute \ - updateStringAttribute \ - listIndexes \ - createIndex \ - deleteIndex \ - getIndex \ - createBucket \ - updateBucket \ - listBuckets \ - getBucket \ - deleteBucket \ - getFile \ - updateFile \ - deleteFile \ - getFileDownload \ - getHealth \ - getAntivirus \ - getCache \ - getDB \ - getPubSub \ - getStorage \ - getStorageLocal \ - getTime \ - getQueue \ - getCertificate \ - getQueueBuilds \ - getQueueCertificates \ - getQueueUsageWebhooks \ - getQueueUsageDump \ - getQueueFunctions \ - getQueueMails \ - getQueueMessaging \ - getQueueMigrations \ - -# build all binaries -all: $(BINS) - -# Account -createAccount: $(SRCS) $(EXAMPLES_DIR)/account/createAccount.cpp - $(CXX) $(CXXFLAGS) -o ./createAccount $(SRCS) $(EXAMPLES_DIR)/account/createAccount.cpp $(LDFLAGS) -createSession: $(SRCS) $(EXAMPLES_DIR)/account/createSession.cpp - $(CXX) $(CXXFLAGS) -o ./createSession $(SRCS) $(EXAMPLES_DIR)/account/createSession.cpp $(LDFLAGS) - -# Database -createDatabase: $(SRCS) $(EXAMPLES_DIR)/database/createDatabase.cpp - $(CXX) $(CXXFLAGS) -o ./database/createDatabase $(SRCS) $(EXAMPLES_DIR)/database/createDatabase.cpp $(LDFLAGS) -updateDatabase: $(SRCS) $(EXAMPLES_DIR)/database/updateDatabase.cpp - $(CXX) $(CXXFLAGS) -o ./database/updateDatabase $(SRCS) $(EXAMPLES_DIR)/database/updateDatabase.cpp $(LDFLAGS) -getDatabase: $(SRCS) $(EXAMPLES_DIR)/database/getDatabase.cpp - $(CXX) $(CXXFLAGS) -o ./database/getDatabase $(SRCS) $(EXAMPLES_DIR)/database/getDatabase.cpp $(LDFLAGS) -listDatabase: $(SRCS) $(EXAMPLES_DIR)/database/listDatabase.cpp - $(CXX) $(CXXFLAGS) -o ./database/listDatabase $(SRCS) $(EXAMPLES_DIR)/database/listDatabase.cpp $(LDFLAGS) -getDatabaseUsage: $(SRCS) $(EXAMPLES_DIR)/database/getDatabaseUsage.cpp - $(CXX) $(CXXFLAGS) -o ./database/getDatabaseUsage $(SRCS) $(EXAMPLES_DIR)/database/getDatabaseUsage.cpp $(LDFLAGS) -getCollectionUsage: $(SRCS) $(EXAMPLES_DIR)/database/getCollectionUsage.cpp - $(CXX) $(CXXFLAGS) -o ./database/getCollectionUsage $(SRCS) $(EXAMPLES_DIR)/database/getCollectionUsage.cpp $(LDFLAGS) - -# Database - Collection -listCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/listCollection.cpp - $(CXX) $(CXXFLAGS) -o ./collection/listCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/listCollection.cpp $(LDFLAGS) -createCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/createCollection.cpp - $(CXX) $(CXXFLAGS) -o ./collection/createCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/createCollection.cpp $(LDFLAGS) -getCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/getCollection.cpp - $(CXX) $(CXXFLAGS) -o ./collection/getCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/getCollection.cpp $(LDFLAGS) -updateCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/updateCollection.cpp - $(CXX) $(CXXFLAGS) -o ./collection/updateCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/updateCollection.cpp $(LDFLAGS) -deleteCollection: $(SRCS) $(EXAMPLES_DIR)/database/collection/deleteCollection.cpp - $(CXX) $(CXXFLAGS) -o ./collection/deleteCollection $(SRCS) $(EXAMPLES_DIR)/database/collection/deleteCollection.cpp $(LDFLAGS) - -# Database-Collection-Document -createDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/createDocument.cpp - $(CXX) $(CXXFLAGS) -o ./document/createDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/createDocument.cpp $(LDFLAGS) -listDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/listDocument.cpp - $(CXX) $(CXXFLAGS) -o ./document/listDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/listDocument.cpp $(LDFLAGS) -deleteDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/deleteDocument.cpp - $(CXX) $(CXXFLAGS) -o ./document/deleteDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/deleteDocument.cpp $(LDFLAGS) -getDocument: $(SRCS) $(EXAMPLES_DIR)/database/collection/document/getDocument.cpp - $(CXX) $(CXXFLAGS) -o ./document/getDocument $(SRCS) $(EXAMPLES_DIR)/database/collection/document/getDocument.cpp $(LDFLAGS) - -#Collection-Attribute -listAttributes: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/listAttributes.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/listAttributes $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/listAttributes.cpp $(LDFLAGS) -createBooleanAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createBooleanAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/createBooleanAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createBooleanAttribute.cpp $(LDFLAGS) -createEmailAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEmailAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/createEmailAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEmailAttribute.cpp $(LDFLAGS) -createEnumAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEnumAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/createEnumAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createEnumAttribute.cpp $(LDFLAGS) -createFloatAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createFloatAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/createFloatAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createFloatAttribute.cpp $(LDFLAGS) -createIntegerAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIntegerAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/createIntegerAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIntegerAttribute.cpp $(LDFLAGS) -createIPaddressAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIPaddressAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/createIPaddressAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createIPaddressAttribute.cpp $(LDFLAGS) -createStringAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createStringAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/createStringAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/createStringAttribute.cpp $(LDFLAGS) - -updateBooleanAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateBooleanAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/updateBooleanAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateBooleanAttribute.cpp $(LDFLAGS) -updateEmailAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEmailAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/updateEmailAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEmailAttribute.cpp $(LDFLAGS) -updateEnumAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEnumAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/updateEnumAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateEnumAttribute.cpp $(LDFLAGS) -updateFloatAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateFloatAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/updateFloatAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateFloatAttribute.cpp $(LDFLAGS) -updateIntegerAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIntegerAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/updateIntegerAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIntegerAttribute.cpp $(LDFLAGS) -updateIPaddressAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIPaddressAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/updateIPaddressAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateIPaddressAttribute.cpp $(LDFLAGS) -updateStringAttribute: $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateStringAttribute.cpp - $(CXX) $(CXXFLAGS) -o ./attribute/updateStringAttribute $(SRCS) $(EXAMPLES_DIR)/database/collection/attribute/updateStringAttribute.cpp $(LDFLAGS) - -# Collection-Indexes -listIndexes: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/listIndexes.cpp - $(CXX) $(CXXFLAGS) -o ./indexes/listIndexes $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/listIndexes.cpp $(LDFLAGS) -createIndex: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/createIndex.cpp - $(CXX) $(CXXFLAGS) -o ./indexes/createIndex $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/createIndex.cpp $(LDFLAGS) -deleteIndex: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/deleteIndex.cpp - $(CXX) $(CXXFLAGS) -o ./indexes/deleteIndex $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/deleteIndex.cpp $(LDFLAGS) -getIndex: $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/getIndex.cpp - $(CXX) $(CXXFLAGS) -o ./indexes/getIndex $(SRCS) $(EXAMPLES_DIR)/database/collection/indexes/getIndex.cpp $(LDFLAGS) - -# Storage -createBucket: $(SRCS) $(EXAMPLES_DIR)/storage/createBucket.cpp - $(CXX) $(CXXFLAGS) -o ./storage/createBucket $(SRCS) $(EXAMPLES_DIR)/storage/createBucket.cpp $(LDFLAGS) -updateBucket: $(SRCS) $(EXAMPLES_DIR)/storage/updateBucket.cpp - $(CXX) $(CXXFLAGS) -o ./storage/updateBucket $(SRCS) $(EXAMPLES_DIR)/storage/updateBucket.cpp $(LDFLAGS) -listBuckets: $(SRCS) $(EXAMPLES_DIR)/storage/listBuckets.cpp - $(CXX) $(CXXFLAGS) -o ./storage/listBuckets $(SRCS) $(EXAMPLES_DIR)/storage/listBuckets.cpp $(LDFLAGS) -getBucket: $(SRCS) $(EXAMPLES_DIR)/storage/getBucket.cpp - $(CXX) $(CXXFLAGS) -o ./storage/getBucket $(SRCS) $(EXAMPLES_DIR)/storage/getBucket.cpp $(LDFLAGS) -deleteBucket: $(SRCS) $(EXAMPLES_DIR)/storage/deleteBucket.cpp - $(CXX) $(CXXFLAGS) -o ./storage/deleteBucket $(SRCS) $(EXAMPLES_DIR)/storage/deleteBucket.cpp $(LDFLAGS) - -# Storage - Files -getFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/getFile.cpp - $(CXX) $(CXXFLAGS) -o ./storage/files/getFile $(SRCS) $(EXAMPLES_DIR)/storage/files/getFile.cpp $(LDFLAGS) -updateFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/updateFile.cpp - $(CXX) $(CXXFLAGS) -o ./storage/files/updateFile $(SRCS) $(EXAMPLES_DIR)/storage/files/updateFile.cpp $(LDFLAGS) -deleteFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/deleteFile.cpp - $(CXX) $(CXXFLAGS) -o ./storage/files/deleteFile $(SRCS) $(EXAMPLES_DIR)/storage/files/deleteFile.cpp $(LDFLAGS) -getFileDownload: $(SRCS) $(EXAMPLES_DIR)/storage/files/getFileDownload.cpp - $(CXX) $(CXXFLAGS) -o ./storage/files/getFileDownload $(SRCS) $(EXAMPLES_DIR)/storage/files/getFileDownload.cpp $(LDFLAGS) -createFile: $(SRCS) $(EXAMPLES_DIR)/storage/files/createFile.cpp - $(CXX) $(CXXFLAGS) -o ./storage/files/createFile $(SRCS) $(EXAMPLES_DIR)/storage/files/createFile.cpp $(LDFLAGS) - - -# Health -getHealth: $(SRCS) $(EXAMPLES_DIR)/health/getHealth.cpp - $(CXX) $(CXXFLAGS) -o ./health/getHealth $(SRCS) $(EXAMPLES_DIR)/health/getHealth.cpp $(LDFLAGS) -getAntivirus: $(SRCS) $(EXAMPLES_DIR)/health/getAntivirus.cpp - $(CXX) $(CXXFLAGS) -o ./health/getAntivirus $(SRCS) $(EXAMPLES_DIR)/health/getAntivirus.cpp $(LDFLAGS) -getCache: $(SRCS) $(EXAMPLES_DIR)/health/getCache.cpp - $(CXX) $(CXXFLAGS) -o ./health/getCache $(SRCS) $(EXAMPLES_DIR)/health/getCache.cpp $(LDFLAGS) -getDB: $(SRCS) $(EXAMPLES_DIR)/health/getDB.cpp - $(CXX) $(CXXFLAGS) -o ./health/getDB $(SRCS) $(EXAMPLES_DIR)/health/getDB.cpp $(LDFLAGS) -getPubSub: $(SRCS) $(EXAMPLES_DIR)/health/getPubSub.cpp - $(CXX) $(CXXFLAGS) -o ./health/getPubSub $(SRCS) $(EXAMPLES_DIR)/health/getPubSub.cpp $(LDFLAGS) -getStorage: $(SRCS) $(EXAMPLES_DIR)/health/getStorage.cpp - $(CXX) $(CXXFLAGS) -o ./health/getStorage $(SRCS) $(EXAMPLES_DIR)/health/getStorage.cpp $(LDFLAGS) -getStorageLocal: $(SRCS) $(EXAMPLES_DIR)/health/getStorageLocal.cpp - $(CXX) $(CXXFLAGS) -o ./health/getStorageLocal $(SRCS) $(EXAMPLES_DIR)/health/getStorageLocal.cpp $(LDFLAGS) -getTime: $(SRCS) $(EXAMPLES_DIR)/health/getTime.cpp - $(CXX) $(CXXFLAGS) -o ./health/getTime $(SRCS) $(EXAMPLES_DIR)/health/getTime.cpp $(LDFLAGS) -getQueue: $(SRCS) $(EXAMPLES_DIR)/health/getQueue.cpp - $(CXX) $(CXXFLAGS) -o ./health/getQueue $(SRCS) $(EXAMPLES_DIR)/health/getQueue.cpp $(LDFLAGS) -getCertificate: $(SRCS) $(EXAMPLES_DIR)/health/params/getCertificate.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getCertificate $(SRCS) $(EXAMPLES_DIR)/health/params/getCertificate.cpp $(LDFLAGS) -getQueueBuilds: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueBuilds.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueBuilds $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueBuilds.cpp $(LDFLAGS) -getQueueCertificates: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueCertificates.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueCertificates $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueCertificates.cpp $(LDFLAGS) -getQueueUsageWebhooks: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageWebhooks.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueUsageWebhooks $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageWebhooks.cpp $(LDFLAGS) -getQueueUsageDump: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageDump.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueUsageDump $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueUsageDump.cpp $(LDFLAGS) -getQueueFunctions: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueFunctions.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueFunctions $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueFunctions.cpp $(LDFLAGS) -getQueueMails: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMails.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueMails $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMails.cpp $(LDFLAGS) -getQueueMessaging: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMessaging.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueMessaging $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMessaging.cpp $(LDFLAGS) -getQueueMigrations: $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMigrations.cpp - $(CXX) $(CXXFLAGS) -o ./health/params/getQueueMigrations $(SRCS) $(EXAMPLES_DIR)/health/params/getQueueMigrations.cpp $(LDFLAGS) -full_flow_test: $(SRCS) $(EXAMPLES_DIR)/full_flow_test.cpp - $(CXX) $(CXXFLAGS) -o ./full_flow_test $(SRCS) $(EXAMPLES_DIR)/full_flow_test.cpp $(LDFLAGS) \ No newline at end of file diff --git a/tests/account/createAccount b/tests/account/createAccount index 4390a39..afdbe1a 100755 Binary files a/tests/account/createAccount and b/tests/account/createAccount differ diff --git a/tests/account/createSession b/tests/account/createSession index 655aab1..c51c4c2 100755 Binary files a/tests/account/createSession and b/tests/account/createSession differ diff --git a/tests/health/getDB b/tests/health/getDB index 41e21f1..4ee6fc9 100755 Binary files a/tests/health/getDB and b/tests/health/getDB differ diff --git a/tests/health/getHealth b/tests/health/getHealth index ccfc42a..2748aef 100755 Binary files a/tests/health/getHealth and b/tests/health/getHealth differ diff --git a/tests/health/getPubSub b/tests/health/getPubSub index fd37368..b0e096c 100755 Binary files a/tests/health/getPubSub and b/tests/health/getPubSub differ diff --git a/tests/storage/createBucket b/tests/storage/createBucket index 357b998..cc2abe4 100755 Binary files a/tests/storage/createBucket and b/tests/storage/createBucket differ diff --git a/tests/storage/deleteBucket b/tests/storage/deleteBucket index 8fe5575..b9e3a42 100755 Binary files a/tests/storage/deleteBucket and b/tests/storage/deleteBucket differ diff --git a/tests/storage/files/createFile b/tests/storage/files/createFile index 967f798..c583e27 100755 Binary files a/tests/storage/files/createFile and b/tests/storage/files/createFile differ diff --git a/tests/storage/files/deleteFile b/tests/storage/files/deleteFile index d2eb78e..c43a4d5 100755 Binary files a/tests/storage/files/deleteFile and b/tests/storage/files/deleteFile differ diff --git a/tests/storage/files/getFile b/tests/storage/files/getFile index cd25675..726f823 100755 Binary files a/tests/storage/files/getFile and b/tests/storage/files/getFile differ diff --git a/tests/storage/files/getFileDownload b/tests/storage/files/getFileDownload index 7b5f6bc..ec2a22b 100755 Binary files a/tests/storage/files/getFileDownload and b/tests/storage/files/getFileDownload differ diff --git a/tests/storage/files/getFileView b/tests/storage/files/getFileView index 37e1f8b..fc63906 100755 Binary files a/tests/storage/files/getFileView and b/tests/storage/files/getFileView differ diff --git a/tests/storage/files/updateFile b/tests/storage/files/updateFile index 4bebd6d..e2b1a6b 100755 Binary files a/tests/storage/files/updateFile and b/tests/storage/files/updateFile differ diff --git a/tests/storage/getBucket b/tests/storage/getBucket index 5c1aeef..eeb3ab9 100755 Binary files a/tests/storage/getBucket and b/tests/storage/getBucket differ diff --git a/tests/storage/listBuckets b/tests/storage/listBuckets index fd1e0b1..3ceece0 100755 Binary files a/tests/storage/listBuckets and b/tests/storage/listBuckets differ diff --git a/tests/storage/updateBucket b/tests/storage/updateBucket index 4eb4d39..8b68e82 100755 Binary files a/tests/storage/updateBucket and b/tests/storage/updateBucket differ