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..1300b04 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) 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/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..d789a98 100644 --- a/include/classes/Health.hpp +++ b/include/classes/Health.hpp @@ -8,7 +8,7 @@ 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(); 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..91847bd 100644 --- a/src/services/Health.cpp +++ b/src/services/Health.cpp @@ -7,10 +7,8 @@ #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(){ 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/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