From d06ad64a13b1e7e9a8b002530fe5fd6f988090e2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 23:29:37 +1200 Subject: [PATCH 1/3] Add bulk API methods --- README.md | 2 +- Sources/Appwrite/Client.swift | 2 +- Sources/Appwrite/Services/Databases.swift | 278 +++++++++++++++++- .../account/create-anonymous-session.md | 2 +- .../account/create-email-password-session.md | 2 +- docs/examples/account/create-email-token.md | 2 +- docs/examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- docs/examples/account/create-o-auth2token.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- .../account/create-phone-verification.md | 2 +- docs/examples/account/create-recovery.md | 2 +- docs/examples/account/create-session.md | 2 +- docs/examples/account/create-verification.md | 2 +- docs/examples/account/create.md | 2 +- docs/examples/account/delete-identity.md | 2 +- .../account/delete-mfa-authenticator.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/delete-sessions.md | 2 +- .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- docs/examples/account/update-email.md | 2 +- docs/examples/account/update-m-f-a.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-name.md | 2 +- docs/examples/account/update-password.md | 2 +- docs/examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- docs/examples/account/update-phone.md | 2 +- docs/examples/account/update-prefs.md | 2 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 2 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-favicon.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/avatars/get-image.md | 2 +- docs/examples/avatars/get-initials.md | 2 +- docs/examples/avatars/get-q-r.md | 2 +- .../databases/create-boolean-attribute.md | 2 +- docs/examples/databases/create-collection.md | 2 +- .../databases/create-datetime-attribute.md | 2 +- docs/examples/databases/create-document.md | 2 +- docs/examples/databases/create-documents.md | 15 + .../databases/create-email-attribute.md | 2 +- .../databases/create-enum-attribute.md | 2 +- .../databases/create-float-attribute.md | 2 +- docs/examples/databases/create-index.md | 2 +- .../databases/create-integer-attribute.md | 2 +- .../examples/databases/create-ip-attribute.md | 2 +- .../create-relationship-attribute.md | 2 +- .../databases/create-string-attribute.md | 2 +- .../databases/create-url-attribute.md | 2 +- docs/examples/databases/create.md | 2 +- docs/examples/databases/delete-attribute.md | 2 +- docs/examples/databases/delete-collection.md | 2 +- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/delete-documents.md | 15 + docs/examples/databases/delete-index.md | 2 +- docs/examples/databases/delete.md | 2 +- docs/examples/databases/get-attribute.md | 2 +- docs/examples/databases/get-collection.md | 2 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 2 +- docs/examples/databases/get.md | 2 +- docs/examples/databases/list-attributes.md | 2 +- docs/examples/databases/list-collections.md | 2 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 2 +- docs/examples/databases/list.md | 2 +- .../databases/update-boolean-attribute.md | 2 +- docs/examples/databases/update-collection.md | 2 +- .../databases/update-datetime-attribute.md | 2 +- docs/examples/databases/update-document.md | 2 +- docs/examples/databases/update-documents.md | 16 + .../databases/update-email-attribute.md | 2 +- .../databases/update-enum-attribute.md | 2 +- .../databases/update-float-attribute.md | 2 +- .../databases/update-integer-attribute.md | 2 +- .../examples/databases/update-ip-attribute.md | 2 +- .../update-relationship-attribute.md | 2 +- .../databases/update-string-attribute.md | 2 +- .../databases/update-url-attribute.md | 2 +- docs/examples/databases/update.md | 2 +- docs/examples/databases/upsert-documents.md | 15 + docs/examples/functions/create-build.md | 2 +- docs/examples/functions/create-deployment.md | 2 +- docs/examples/functions/create-execution.md | 2 +- docs/examples/functions/create-variable.md | 2 +- docs/examples/functions/create.md | 2 +- docs/examples/functions/delete-deployment.md | 2 +- docs/examples/functions/delete-execution.md | 2 +- docs/examples/functions/delete-variable.md | 2 +- docs/examples/functions/delete.md | 2 +- .../functions/get-deployment-download.md | 2 +- docs/examples/functions/get-deployment.md | 2 +- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/get-variable.md | 2 +- docs/examples/functions/get.md | 2 +- docs/examples/functions/list-deployments.md | 2 +- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list-runtimes.md | 2 +- .../examples/functions/list-specifications.md | 2 +- docs/examples/functions/list-variables.md | 2 +- docs/examples/functions/list.md | 2 +- .../functions/update-deployment-build.md | 2 +- docs/examples/functions/update-deployment.md | 2 +- docs/examples/functions/update-variable.md | 2 +- docs/examples/functions/update.md | 2 +- docs/examples/graphql/mutation.md | 2 +- docs/examples/graphql/query.md | 2 +- docs/examples/health/get-antivirus.md | 2 +- docs/examples/health/get-cache.md | 2 +- docs/examples/health/get-certificate.md | 2 +- docs/examples/health/get-d-b.md | 2 +- docs/examples/health/get-failed-jobs.md | 2 +- docs/examples/health/get-pub-sub.md | 2 +- docs/examples/health/get-queue-builds.md | 2 +- .../examples/health/get-queue-certificates.md | 2 +- docs/examples/health/get-queue-databases.md | 2 +- docs/examples/health/get-queue-deletes.md | 2 +- docs/examples/health/get-queue-functions.md | 2 +- docs/examples/health/get-queue-logs.md | 2 +- docs/examples/health/get-queue-mails.md | 2 +- docs/examples/health/get-queue-messaging.md | 2 +- docs/examples/health/get-queue-migrations.md | 2 +- .../health/get-queue-stats-resources.md | 2 +- docs/examples/health/get-queue-usage.md | 2 +- docs/examples/health/get-queue-webhooks.md | 2 +- docs/examples/health/get-storage-local.md | 2 +- docs/examples/health/get-storage.md | 2 +- docs/examples/health/get-time.md | 2 +- docs/examples/health/get.md | 2 +- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-e-u.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- .../messaging/create-apns-provider.md | 2 +- docs/examples/messaging/create-email.md | 2 +- .../examples/messaging/create-fcm-provider.md | 2 +- .../messaging/create-mailgun-provider.md | 2 +- .../messaging/create-msg91provider.md | 2 +- docs/examples/messaging/create-push.md | 2 +- .../messaging/create-sendgrid-provider.md | 2 +- docs/examples/messaging/create-sms.md | 2 +- .../messaging/create-smtp-provider.md | 2 +- docs/examples/messaging/create-subscriber.md | 2 +- .../messaging/create-telesign-provider.md | 2 +- .../messaging/create-textmagic-provider.md | 2 +- docs/examples/messaging/create-topic.md | 2 +- .../messaging/create-twilio-provider.md | 2 +- .../messaging/create-vonage-provider.md | 2 +- docs/examples/messaging/delete-provider.md | 2 +- docs/examples/messaging/delete-subscriber.md | 2 +- docs/examples/messaging/delete-topic.md | 2 +- docs/examples/messaging/delete.md | 2 +- docs/examples/messaging/get-message.md | 2 +- docs/examples/messaging/get-provider.md | 2 +- docs/examples/messaging/get-subscriber.md | 2 +- docs/examples/messaging/get-topic.md | 2 +- docs/examples/messaging/list-message-logs.md | 2 +- docs/examples/messaging/list-messages.md | 2 +- docs/examples/messaging/list-provider-logs.md | 2 +- docs/examples/messaging/list-providers.md | 2 +- .../messaging/list-subscriber-logs.md | 2 +- docs/examples/messaging/list-subscribers.md | 2 +- docs/examples/messaging/list-targets.md | 2 +- docs/examples/messaging/list-topic-logs.md | 2 +- docs/examples/messaging/list-topics.md | 2 +- .../messaging/update-apns-provider.md | 2 +- docs/examples/messaging/update-email.md | 2 +- .../examples/messaging/update-fcm-provider.md | 2 +- .../messaging/update-mailgun-provider.md | 2 +- .../messaging/update-msg91provider.md | 2 +- docs/examples/messaging/update-push.md | 2 +- .../messaging/update-sendgrid-provider.md | 2 +- docs/examples/messaging/update-sms.md | 2 +- .../messaging/update-smtp-provider.md | 2 +- .../messaging/update-telesign-provider.md | 2 +- .../messaging/update-textmagic-provider.md | 2 +- docs/examples/messaging/update-topic.md | 2 +- .../messaging/update-twilio-provider.md | 2 +- .../messaging/update-vonage-provider.md | 2 +- docs/examples/storage/create-bucket.md | 2 +- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-bucket.md | 2 +- docs/examples/storage/delete-file.md | 2 +- docs/examples/storage/get-bucket.md | 2 +- docs/examples/storage/get-file-download.md | 2 +- docs/examples/storage/get-file-preview.md | 2 +- docs/examples/storage/get-file-view.md | 2 +- docs/examples/storage/get-file.md | 2 +- docs/examples/storage/list-buckets.md | 2 +- docs/examples/storage/list-files.md | 2 +- docs/examples/storage/update-bucket.md | 2 +- docs/examples/storage/update-file.md | 2 +- docs/examples/teams/create-membership.md | 2 +- docs/examples/teams/create.md | 2 +- docs/examples/teams/delete-membership.md | 2 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 2 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-memberships.md | 2 +- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 2 +- docs/examples/teams/update-membership.md | 2 +- docs/examples/teams/update-name.md | 2 +- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 2 +- docs/examples/users/create-bcrypt-user.md | 2 +- docs/examples/users/create-j-w-t.md | 2 +- docs/examples/users/create-m-d5user.md | 2 +- .../users/create-mfa-recovery-codes.md | 2 +- docs/examples/users/create-p-h-pass-user.md | 2 +- docs/examples/users/create-s-h-a-user.md | 2 +- .../users/create-scrypt-modified-user.md | 2 +- docs/examples/users/create-scrypt-user.md | 2 +- docs/examples/users/create-session.md | 2 +- docs/examples/users/create-target.md | 2 +- docs/examples/users/create-token.md | 2 +- docs/examples/users/create.md | 2 +- docs/examples/users/delete-identity.md | 2 +- .../users/delete-mfa-authenticator.md | 2 +- docs/examples/users/delete-session.md | 2 +- docs/examples/users/delete-sessions.md | 2 +- docs/examples/users/delete-target.md | 2 +- docs/examples/users/delete.md | 2 +- docs/examples/users/get-mfa-recovery-codes.md | 2 +- docs/examples/users/get-prefs.md | 2 +- docs/examples/users/get-target.md | 2 +- docs/examples/users/get.md | 2 +- docs/examples/users/list-identities.md | 2 +- docs/examples/users/list-logs.md | 2 +- docs/examples/users/list-memberships.md | 2 +- docs/examples/users/list-mfa-factors.md | 2 +- docs/examples/users/list-sessions.md | 2 +- docs/examples/users/list-targets.md | 2 +- docs/examples/users/list.md | 2 +- .../users/update-email-verification.md | 2 +- docs/examples/users/update-email.md | 2 +- docs/examples/users/update-labels.md | 2 +- .../users/update-mfa-recovery-codes.md | 2 +- docs/examples/users/update-mfa.md | 2 +- docs/examples/users/update-name.md | 2 +- docs/examples/users/update-password.md | 2 +- .../users/update-phone-verification.md | 2 +- docs/examples/users/update-phone.md | 2 +- docs/examples/users/update-prefs.md | 2 +- docs/examples/users/update-status.md | 2 +- docs/examples/users/update-target.md | 2 +- 269 files changed, 601 insertions(+), 266 deletions(-) create mode 100644 docs/examples/databases/create-documents.md create mode 100644 docs/examples/databases/delete-documents.md create mode 100644 docs/examples/databases/update-documents.md create mode 100644 docs/examples/databases/upsert-documents.md diff --git a/README.md b/README.md index 2cebae4..bf15774 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies: ```swift dependencies: [ - .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "9.0.0"), + .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "9.1.0-rc.1"), ], ``` diff --git a/Sources/Appwrite/Client.swift b/Sources/Appwrite/Client.swift index 5486170..00ea5a3 100644 --- a/Sources/Appwrite/Client.swift +++ b/Sources/Appwrite/Client.swift @@ -21,7 +21,7 @@ open class Client { "x-sdk-name": "Swift", "x-sdk-platform": "server", "x-sdk-language": "swift", - "x-sdk-version": "9.0.0", + "x-sdk-version": "9.1.0-rc.1", "x-appwrite-response-format": "1.6.0" ] diff --git a/Sources/Appwrite/Services/Databases.swift b/Sources/Appwrite/Services/Databases.swift index 58f88b0..9831ec2 100644 --- a/Sources/Appwrite/Services/Databases.swift +++ b/Sources/Appwrite/Services/Databases.swift @@ -1580,7 +1580,6 @@ open class Databases: Service { /// collection resource using either a [server /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) /// API or directly from your database console. - /// /// /// @param String databaseId /// @param String collectionId @@ -1630,7 +1629,6 @@ open class Databases: Service { /// collection resource using either a [server /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) /// API or directly from your database console. - /// /// /// @param String databaseId /// @param String collectionId @@ -1657,6 +1655,282 @@ open class Databases: Service { ) } + /// + /// Create new Documents. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// API or directly from your database console. + /// + /// + /// @param String databaseId + /// @param String collectionId + /// @param [Any] documents + /// @throws Exception + /// @return array + /// + open func createDocuments( + databaseId: String, + collectionId: String, + documents: [Any], + nestedType: T.Type + ) async throws -> AppwriteModels.DocumentList { + let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/documents" + .replacingOccurrences(of: "{databaseId}", with: databaseId) + .replacingOccurrences(of: "{collectionId}", with: collectionId) + + let apiParams: [String: Any?] = [ + "documents": documents + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.DocumentList = { response in + return AppwriteModels.DocumentList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create new Documents. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// API or directly from your database console. + /// + /// + /// @param String databaseId + /// @param String collectionId + /// @param [Any] documents + /// @throws Exception + /// @return array + /// + open func createDocuments( + databaseId: String, + collectionId: String, + documents: [Any] + ) async throws -> AppwriteModels.DocumentList<[String: AnyCodable]> { + return try await createDocuments( + databaseId: databaseId, + collectionId: collectionId, + documents: documents, + nestedType: [String: AnyCodable].self + ) + } + + /// + /// Create or update Documents. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// API or directly from your database console. + /// + /// + /// @param String databaseId + /// @param String collectionId + /// @param [Any] documents + /// @throws Exception + /// @return array + /// + open func upsertDocuments( + databaseId: String, + collectionId: String, + documents: [Any]? = nil, + nestedType: T.Type + ) async throws -> AppwriteModels.DocumentList { + let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/documents" + .replacingOccurrences(of: "{databaseId}", with: databaseId) + .replacingOccurrences(of: "{collectionId}", with: collectionId) + + let apiParams: [String: Any?] = [ + "documents": documents + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.DocumentList = { response in + return AppwriteModels.DocumentList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create or update Documents. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// API or directly from your database console. + /// + /// + /// @param String databaseId + /// @param String collectionId + /// @param [Any] documents + /// @throws Exception + /// @return array + /// + open func upsertDocuments( + databaseId: String, + collectionId: String, + documents: [Any]? = nil + ) async throws -> AppwriteModels.DocumentList<[String: AnyCodable]> { + return try await upsertDocuments( + databaseId: databaseId, + collectionId: collectionId, + documents: documents, + nestedType: [String: AnyCodable].self + ) + } + + /// + /// Update all documents that match your queries, if no queries are submitted + /// then all documents are updated. You can pass only specific fields to be + /// updated. + /// + /// @param String databaseId + /// @param String collectionId + /// @param Any data + /// @param [String] queries + /// @throws Exception + /// @return array + /// + open func updateDocuments( + databaseId: String, + collectionId: String, + data: Any? = nil, + queries: [String]? = nil, + nestedType: T.Type + ) async throws -> AppwriteModels.DocumentList { + let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/documents" + .replacingOccurrences(of: "{databaseId}", with: databaseId) + .replacingOccurrences(of: "{collectionId}", with: collectionId) + + let apiParams: [String: Any?] = [ + "data": data, + "queries": queries + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.DocumentList = { response in + return AppwriteModels.DocumentList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Update all documents that match your queries, if no queries are submitted + /// then all documents are updated. You can pass only specific fields to be + /// updated. + /// + /// @param String databaseId + /// @param String collectionId + /// @param Any data + /// @param [String] queries + /// @throws Exception + /// @return array + /// + open func updateDocuments( + databaseId: String, + collectionId: String, + data: Any? = nil, + queries: [String]? = nil + ) async throws -> AppwriteModels.DocumentList<[String: AnyCodable]> { + return try await updateDocuments( + databaseId: databaseId, + collectionId: collectionId, + data: data, + queries: queries, + nestedType: [String: AnyCodable].self + ) + } + + /// + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + /// + /// @param String databaseId + /// @param String collectionId + /// @param [String] queries + /// @throws Exception + /// @return array + /// + open func deleteDocuments( + databaseId: String, + collectionId: String, + queries: [String]? = nil, + nestedType: T.Type + ) async throws -> AppwriteModels.DocumentList { + let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/documents" + .replacingOccurrences(of: "{databaseId}", with: databaseId) + .replacingOccurrences(of: "{collectionId}", with: collectionId) + + let apiParams: [String: Any?] = [ + "queries": queries + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.DocumentList = { response in + return AppwriteModels.DocumentList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + /// + /// @param String databaseId + /// @param String collectionId + /// @param [String] queries + /// @throws Exception + /// @return array + /// + open func deleteDocuments( + databaseId: String, + collectionId: String, + queries: [String]? = nil + ) async throws -> AppwriteModels.DocumentList<[String: AnyCodable]> { + return try await deleteDocuments( + databaseId: databaseId, + collectionId: collectionId, + queries: queries, + nestedType: [String: AnyCodable].self + ) + } + /// /// Get a document by its unique ID. This endpoint response returns a JSON /// object with the document data. diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index f676bac..22020a1 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 1505182..5f541a8 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index b9d39ff..cf82afd 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index c1c0f22..fbcd504 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 83eb681..27bbe41 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 70294e9..4dd91d8 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 6d262d9..0b5d385 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 8480f41..a73e4f6 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 7bbfe98..21b54e8 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index acb7a69..12b2d4b 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 8bab0b7..cba0637 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index f110d5b..d89f679 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 3ea5119..2065692 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 305adca..71e9bdd 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index cad7e44..79b4db6 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index e032250..f0f14b3 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 9aa02ff..e4209a2 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 9c685bc..2469620 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 59710f1..da8ac6d 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 34743be..69455f4 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 08d9ab5..6551df9 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 37747ad..63efb3f 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 91ed56a..833901b 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 96c6fd9..c7ecff9 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 1a93da0..84c3327 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 72c2f5a..a63d4d0 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 67bb107..49691b3 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index d8126b5..48cce50 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 4a471a4..ac486fc 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index 8e0a26a..507006b 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 30e2705..fedbc95 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index fee76bf..4edb1fb 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 2be8f6f..d0a2b8c 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 419b30a..2c676d8 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 8358ede..62fe48e 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 50a88cb..f6776d1 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 13b0bac..a983e79 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 496ddd9..6dd87a0 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 846764b..53bf623 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 82e8683..d655edf 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 866ea03..f2f4f7b 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index d63ceed..88e30cf 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 5bae677..61bc18c 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index e2a79f9..7db84f1 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 741d341..aa9bafd 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 0ee7ba1..73f54fe 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 2bdd957..c276572 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index fecadf7..5455ad1 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index d5e0905..63dfa5e 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 56f4b9c..ae4cc91 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 0776be6..4530c38 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 79c2d59..c3335b4 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index b4f51d8..d14d0b5 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 5f480a5..daeaf14 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md new file mode 100644 index 0000000..f7c076e --- /dev/null +++ b/docs/examples/databases/create-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let documentList = try await databases.createDocuments( + databaseId: "", + collectionId: "", + documents: [] +) + diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 7c44f4d..9bd30b3 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index b1d6808..08023f6 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 780e53b..b5126c6 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index bd1d26d..11cbc17 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 03fea65..20c29cd 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 4e601a3..09605ba 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index c85b477..8e6c3eb 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 6a7ae27..80c321e 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 6d59fed..efd2acb 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 82689d1..b0362bb 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 7fb7c3a..9948555 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 781e97c..d61f0e6 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index f934d5b..1db5970 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md new file mode 100644 index 0000000..d5321f2 --- /dev/null +++ b/docs/examples/databases/delete-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.deleteDocuments( + databaseId: "", + collectionId: "", + queries: [] // optional +) + diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index f819d92..ecd09f7 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 8cb3f88..40567e4 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index f22fd92..30cd0c8 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 81b0bf2..96c1fa0 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 206fddd..c92856a 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index b2c1b30..cd59074 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 37c1598..875929b 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 356b13b..b375c87 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 03db34f..10481d9 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 11dc91d..2cac933 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 2f37a0b..691f74b 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index e273676..f8a2313 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index e40da1a..0d92505 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 741d3c6..9109990 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index a7728d2..906b374 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 67cfb96..7d452db 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md new file mode 100644 index 0000000..0e934b1 --- /dev/null +++ b/docs/examples/databases/update-documents.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.updateDocuments( + databaseId: "", + collectionId: "", + data: [:], // optional + queries: [] // optional +) + diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 137ca78..b485712 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index bf7df6f..997b940 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 7e246a7..5f3e8da 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index d502b8c..edc0a12 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 2b41096..e088357 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 8faa5ae..0fb06d7 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index d3129dc..1eb3315 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index b442a6a..cd18f96 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index a03a74b..07f5062 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md new file mode 100644 index 0000000..353cc5c --- /dev/null +++ b/docs/examples/databases/upsert-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.upsertDocuments( + databaseId: "", + collectionId: "", + documents: [] // optional +) + diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index f67ac99..22d3c43 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index bcd10ae..de3d14d 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 560f1a9..aae7a0f 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 3af3220..83ec4db 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index fb614b5..aa77cc4 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index cf9315e..dec7b1d 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index f6e13cd..e51b7dc 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 7d09f11..ea0ebab 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index ff1d049..76bb48c 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 6d08d9b..383a187 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 438b667..56ed2e8 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 0aa9d66..6d24ee9 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 0832b41..da20d68 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index aa434c0..98babdb 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 5f005f0..599f301 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 2c28d54..512c890 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index bad50b1..c4a3f31 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 0c9da2d..1f5914b 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 67030b9..0343e54 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index f6ed013..370b6bd 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md index 9003a02..8f48cac 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-build.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 9ae6ec4..313ccc4 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 6716985..86eaf58 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index dcc4ed6..ebb2828 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 6d4f747..ad33858 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 4a10f57..f087c88 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index d45b719..5fc335f 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 4d493c4..a1c514b 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 1d2d453..6adf4d6 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index c7b5127..a6aeb12 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 5120c07..c508106 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 561fc6b..9a7766c 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 81b4fb2..8db346c 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index cecb88a..4814f29 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index b3fefc8..3acda3d 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 0d90387..8be397f 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 961cc62..aa42040 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 34d26ef..dc989a5 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index f48a96d..2106b2f 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 7a171bd..11cb16c 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index f36eb12..a0a4588 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index 3c34966..4eb6ba7 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index b3bc88e..bfaeab0 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 25ed30f..c315406 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 4e85183..9e23c09 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index fbe116f..513ebac 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 02cca3f..6624b40 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index 140b304..ef1ffaa 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 94121fd..e22f315 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 1f41799..b31448a 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index f46f3c0..c75abf8 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index ee57e01..e09f3db 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 9263de6..de360c4 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index d793492..b214f98 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index eb0ddf7..a47cae6 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 19a70b2..40db7e5 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 9bbb4da..5e20018 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 655daea..a1b4774 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index b127946..0071e47 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 63fd5a1..aca295d 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 57cd54b..01503c1 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 42f48dd..498eccb 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index e8b70b6..5275f6c 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 22ca198..4f57931 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 5eff641..18d25df 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 087ec0e..cb23162 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setJWT("") // Your secret JSON Web Token diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b9beb15..a787134 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index f1802d9..9b12a7d 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 14f2229..9429c45 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index f0f0d6e..7421290 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 4e683df..b6a3014 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 3652609..94da565 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index b083fc4..b0aa966 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setJWT("") // Your secret JSON Web Token diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 1de4126..6676adf 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 2e40780..fca66c7 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 5db5f7d..b1bbf9d 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index b5a8156..6ff8545 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index ac4d289..55538e0 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 3d88371..0d2035b 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index c58ef45..b7efe6f 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index bfa9222..73832f7 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 55f0d1f..0633e15 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index fbb5803..c24af42 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index a83cb60..eab170d 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index ded4fdf..a29bcef 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 00219f1..974ae4f 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 68f121c..e6f32ad 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 617b13c..13106e9 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 012e91e..03afe55 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index e925164..1404fb8 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 60a0ce4..c4548f6 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index bc38526..8ed28aa 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 3818b7a..e4a441c 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 02893a1..e443161 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index af950c7..d363342 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 8f44767..46b225f 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 95db505..7ef8f2e 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 0d3279c..4475128 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 738d27d..e412faa 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index ad5edd1..796f581 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 6320665..7b4592b 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index ffdbe95..ba10ce2 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 4ebbdf8..a664e14 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 0716cf7..540c869 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 56c7d3e..2f4916d 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 35dca5e..7ac1b19 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index e33af5c..296a27b 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 40607d0..5893cef 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index e337209..874e567 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 0c88e15..4cf7e7d 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index a0c997c..033a643 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 2329b15..957d266 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 546bd1c..103d3c3 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 4122d1f..de3b5bf 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index ca3fc2c..d4d7484 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 5c86f2d..9010372 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 2533c27..71f3d70 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index e260b01..dbdbc96 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index b9fbcbe..ee9daaa 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index cce480c..ab7b29e 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 9ec230d..ae3e9f2 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 8dce2c1..cd4b755 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 08b3235..0670d91 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 8b6d0a1..b5130cb 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 1ae6d6e..69fca1d 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 92b7474..47f28e7 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index bc9731b..56f5ab6 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index b86e937..b8bb200 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 6f584e4..9b74770 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index cd0960f..ad5a81f 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index 77ef4da..d61adfb 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index a305f6a..ffe7180 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index cb25d43..577a533 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 5a95af7..e1d8d3f 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 70d6f28..ac42f2f 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 6270913..d6c67f6 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 41a0865..16452c4 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 764d4d8..cf6f67b 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index f6bc443..e736afc 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 0d8c363..ca1767e 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 8c07a78..98b8860 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index c5bf2b3..bb3d812 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 5f1d6a0..da2b8e0 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -2,7 +2,7 @@ import Appwrite import AppwriteEnums let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 3f191a2..c664e4f 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 6c4e8bf..92ab9d7 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 274bb60..1cce566 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 2b28a98..8dfe648 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index dc7f471..1ae2851 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index aec033a..c4ae61d 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index d675381..100c563 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 095c84c..563042b 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index b318902..8cbe8a7 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 5e80043..80d9199 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 5ca0152..6f9999e 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 4cf7d7c..a5b5e38 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 035716e..e027827 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 3ab651c..b069781 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index aaa619e..45ccf23 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index cd4b51b..e0de947 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 3a80ae5..4d3c1c2 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 5b3000d..8916996 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 528319c..a6169a7 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 3fd2571..ad010f3 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index bf697be..3735b70 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 0f35cef..3a5b804 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 7f99390..fffd768 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 2097c45..8411ad2 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index d4818db..c71b712 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 2408d05..43ecea4 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index bd3cc7c..579f0d2 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,7 +1,7 @@ import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key From 0221ed59b856702b6f32f094f878e88ddf1fdc4f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 18 May 2025 00:06:44 +1200 Subject: [PATCH 2/3] Add support for 1.7 --- README.md | 6 +- Sources/Appwrite/Client.swift | 4 +- Sources/Appwrite/Services/Databases.swift | 9 +- Sources/Appwrite/Services/Functions.swift | 284 +++-- Sources/Appwrite/Services/Sites.swift | 1005 +++++++++++++++++ Sources/Appwrite/Services/Storage.swift | 25 +- Sources/Appwrite/Services/Tokens.swift | 183 +++ Sources/Appwrite/Services/Users.swift | 11 +- Sources/AppwriteEnums/Adapter.swift | 10 + Sources/AppwriteEnums/BuildRuntime.swift | 71 ++ .../DeploymentDownloadType.swift | 10 + Sources/AppwriteEnums/Framework.swift | 22 + Sources/AppwriteEnums/ImageFormat.swift | 1 - Sources/AppwriteEnums/Runtime.swift | 4 + Sources/AppwriteEnums/VCSDeploymentType.swift | 11 + Sources/AppwriteModels/Build.swift | 124 -- Sources/AppwriteModels/Deployment.swift | 64 +- Sources/AppwriteModels/Execution.swift | 2 +- Sources/AppwriteModels/Framework.swift | 84 ++ Sources/AppwriteModels/FrameworkAdapter.swift | 84 ++ Sources/AppwriteModels/FrameworkList.swift | 54 + Sources/AppwriteModels/Function.swift | 60 +- Sources/AppwriteModels/Index.swift | 10 + Sources/AppwriteModels/ResourceToken.swift | 104 ++ .../AppwriteModels/ResourceTokenList.swift | 54 + Sources/AppwriteModels/Site.swift | 324 ++++++ Sources/AppwriteModels/SiteList.swift | 54 + Sources/AppwriteModels/Variable.swift | 10 + docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/databases/create-document.md | 3 +- docs/examples/databases/create-documents.md | 3 +- docs/examples/databases/create-index.md | 3 +- ...uild.md => create-duplicate-deployment.md} | 2 +- .../functions/create-template-deployment.md | 18 + docs/examples/functions/create-variable.md | 3 +- .../functions/create-vcs-deployment.md | 17 + docs/examples/functions/create.md | 4 - .../functions/get-deployment-download.md | 4 +- docs/examples/functions/list-executions.md | 3 +- ...t-build.md => update-deployment-status.md} | 2 +- ...yment.md => update-function-deployment.md} | 2 +- docs/examples/functions/update-variable.md | 3 +- docs/examples/sites/create-deployment.md | 18 + .../sites/create-duplicate-deployment.md | 14 + .../sites/create-template-deployment.md | 18 + docs/examples/sites/create-variable.md | 16 + docs/examples/sites/create-vcs-deployment.md | 17 + docs/examples/sites/create.md | 31 + docs/examples/sites/delete-deployment.md | 14 + docs/examples/sites/delete-log.md | 14 + docs/examples/sites/delete-variable.md | 14 + docs/examples/sites/delete.md | 13 + .../examples/sites/get-deployment-download.md | 16 + docs/examples/sites/get-deployment.md | 14 + docs/examples/sites/get-log.md | 14 + docs/examples/sites/get-variable.md | 14 + docs/examples/sites/get.md | 13 + docs/examples/sites/list-deployments.md | 15 + docs/examples/sites/list-frameworks.md | 11 + docs/examples/sites/list-logs.md | 14 + docs/examples/sites/list-specifications.md | 11 + docs/examples/sites/list-variables.md | 13 + docs/examples/sites/list.md | 14 + .../sites/update-deployment-status.md | 14 + docs/examples/sites/update-site-deployment.md | 14 + docs/examples/sites/update-variable.md | 17 + docs/examples/sites/update.md | 31 + docs/examples/storage/get-file-download.md | 3 +- docs/examples/storage/get-file-preview.md | 5 +- docs/examples/storage/get-file-view.md | 3 +- docs/examples/tokens/create-file-token.md | 15 + docs/examples/tokens/delete.md | 13 + docs/examples/tokens/get.md | 13 + docs/examples/tokens/list.md | 15 + docs/examples/tokens/update.md | 14 + docs/examples/users/list-memberships.md | 4 +- 78 files changed, 2950 insertions(+), 286 deletions(-) create mode 100644 Sources/Appwrite/Services/Sites.swift create mode 100644 Sources/Appwrite/Services/Tokens.swift create mode 100644 Sources/AppwriteEnums/Adapter.swift create mode 100644 Sources/AppwriteEnums/BuildRuntime.swift create mode 100644 Sources/AppwriteEnums/DeploymentDownloadType.swift create mode 100644 Sources/AppwriteEnums/Framework.swift create mode 100644 Sources/AppwriteEnums/VCSDeploymentType.swift delete mode 100644 Sources/AppwriteModels/Build.swift create mode 100644 Sources/AppwriteModels/Framework.swift create mode 100644 Sources/AppwriteModels/FrameworkAdapter.swift create mode 100644 Sources/AppwriteModels/FrameworkList.swift create mode 100644 Sources/AppwriteModels/ResourceToken.swift create mode 100644 Sources/AppwriteModels/ResourceTokenList.swift create mode 100644 Sources/AppwriteModels/Site.swift create mode 100644 Sources/AppwriteModels/SiteList.swift rename docs/examples/functions/{create-build.md => create-duplicate-deployment.md} (85%) create mode 100644 docs/examples/functions/create-template-deployment.md create mode 100644 docs/examples/functions/create-vcs-deployment.md rename docs/examples/functions/{update-deployment-build.md => update-deployment-status.md} (84%) rename docs/examples/functions/{update-deployment.md => update-function-deployment.md} (84%) create mode 100644 docs/examples/sites/create-deployment.md create mode 100644 docs/examples/sites/create-duplicate-deployment.md create mode 100644 docs/examples/sites/create-template-deployment.md create mode 100644 docs/examples/sites/create-variable.md create mode 100644 docs/examples/sites/create-vcs-deployment.md create mode 100644 docs/examples/sites/create.md create mode 100644 docs/examples/sites/delete-deployment.md create mode 100644 docs/examples/sites/delete-log.md create mode 100644 docs/examples/sites/delete-variable.md create mode 100644 docs/examples/sites/delete.md create mode 100644 docs/examples/sites/get-deployment-download.md create mode 100644 docs/examples/sites/get-deployment.md create mode 100644 docs/examples/sites/get-log.md create mode 100644 docs/examples/sites/get-variable.md create mode 100644 docs/examples/sites/get.md create mode 100644 docs/examples/sites/list-deployments.md create mode 100644 docs/examples/sites/list-frameworks.md create mode 100644 docs/examples/sites/list-logs.md create mode 100644 docs/examples/sites/list-specifications.md create mode 100644 docs/examples/sites/list-variables.md create mode 100644 docs/examples/sites/list.md create mode 100644 docs/examples/sites/update-deployment-status.md create mode 100644 docs/examples/sites/update-site-deployment.md create mode 100644 docs/examples/sites/update-variable.md create mode 100644 docs/examples/sites/update.md create mode 100644 docs/examples/tokens/create-file-token.md create mode 100644 docs/examples/tokens/delete.md create mode 100644 docs/examples/tokens/get.md create mode 100644 docs/examples/tokens/list.md create mode 100644 docs/examples/tokens/update.md diff --git a/README.md b/README.md index bf15774..ccf74e8 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ ![Swift Package Manager](https://img.shields.io/github/v/release/appwrite/sdk-for-swift.svg?color=green&style=flat-square) ![License](https://img.shields.io/github/license/appwrite/sdk-for-swift.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).** +**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).** > This is the Swift SDK for integrating with Appwrite from your Swift server-side code. If you're looking for the Apple SDK you should check [appwrite/sdk-for-apple](https://github.com/appwrite/sdk-for-apple) @@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies: ```swift dependencies: [ - .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "9.1.0-rc.1"), + .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "9.2.0"), ], ``` diff --git a/Sources/Appwrite/Client.swift b/Sources/Appwrite/Client.swift index 00ea5a3..697648f 100644 --- a/Sources/Appwrite/Client.swift +++ b/Sources/Appwrite/Client.swift @@ -21,8 +21,8 @@ open class Client { "x-sdk-name": "Swift", "x-sdk-platform": "server", "x-sdk-language": "swift", - "x-sdk-version": "9.1.0-rc.1", - "x-appwrite-response-format": "1.6.0" + "x-sdk-version": "9.2.0", + "x-appwrite-response-format": "1.7.0" ] internal var config: [String: String] = [:] diff --git a/Sources/Appwrite/Services/Databases.swift b/Sources/Appwrite/Services/Databases.swift index 9831ec2..eb40d2a 100644 --- a/Sources/Appwrite/Services/Databases.swift +++ b/Sources/Appwrite/Services/Databases.swift @@ -1660,7 +1660,6 @@ open class Databases: Service { /// collection resource using either a [server /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) /// API or directly from your database console. - /// /// /// @param String databaseId /// @param String collectionId @@ -1704,7 +1703,6 @@ open class Databases: Service { /// collection resource using either a [server /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) /// API or directly from your database console. - /// /// /// @param String databaseId /// @param String collectionId @@ -2155,6 +2153,7 @@ open class Databases: Service { /// @param AppwriteEnums.IndexType type /// @param [String] attributes /// @param [String] orders + /// @param [Int] lengths /// @throws Exception /// @return array /// @@ -2164,7 +2163,8 @@ open class Databases: Service { key: String, type: AppwriteEnums.IndexType, attributes: [String], - orders: [String]? = nil + orders: [String]? = nil, + lengths: [Int]? = nil ) async throws -> AppwriteModels.Index { let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/indexes" .replacingOccurrences(of: "{databaseId}", with: databaseId) @@ -2174,7 +2174,8 @@ open class Databases: Service { "key": key, "type": type, "attributes": attributes, - "orders": orders + "orders": orders, + "lengths": lengths ] let apiHeaders: [String: String] = [ diff --git a/Sources/Appwrite/Services/Functions.swift b/Sources/Appwrite/Services/Functions.swift index 3a84d39..130e3d5 100644 --- a/Sources/Appwrite/Services/Functions.swift +++ b/Sources/Appwrite/Services/Functions.swift @@ -66,10 +66,6 @@ open class Functions: Service { /// @param String providerBranch /// @param Bool providerSilentMode /// @param String providerRootDirectory - /// @param String templateRepository - /// @param String templateOwner - /// @param String templateRootDirectory - /// @param String templateVersion /// @param String specification /// @throws Exception /// @return array @@ -92,10 +88,6 @@ open class Functions: Service { providerBranch: String? = nil, providerSilentMode: Bool? = nil, providerRootDirectory: String? = nil, - templateRepository: String? = nil, - templateOwner: String? = nil, - templateRootDirectory: String? = nil, - templateVersion: String? = nil, specification: String? = nil ) async throws -> AppwriteModels.Function { let apiPath: String = "/functions" @@ -118,10 +110,6 @@ open class Functions: Service { "providerBranch": providerBranch, "providerSilentMode": providerSilentMode, "providerRootDirectory": providerRootDirectory, - "templateRepository": templateRepository, - "templateOwner": templateOwner, - "templateRootDirectory": templateRootDirectory, - "templateVersion": templateVersion, "specification": specification ] @@ -171,7 +159,6 @@ open class Functions: Service { /// /// List allowed function specifications for this instance. - /// /// /// @throws Exception /// @return array @@ -338,7 +325,44 @@ open class Functions: Service { } /// - /// Get a list of all the project's code deployments. You can use the query + /// Update the function active deployment. Use this endpoint to switch the code + /// deployment that should be used when visitor opens your function. + /// + /// @param String functionId + /// @param String deploymentId + /// @throws Exception + /// @return array + /// + open func updateFunctionDeployment( + functionId: String, + deploymentId: String + ) async throws -> AppwriteModels.Function { + let apiPath: String = "/functions/{functionId}/deployment" + .replacingOccurrences(of: "{functionId}", with: functionId) + + let apiParams: [String: Any?] = [ + "deploymentId": deploymentId + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Function = { response in + return AppwriteModels.Function.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a list of all the function's code deployments. You can use the query /// params to filter your results. /// /// @param String functionId @@ -435,31 +459,41 @@ open class Functions: Service { } /// - /// Get a code deployment by its unique ID. + /// Create a new build for an existing function deployment. This endpoint + /// allows you to rebuild a deployment with the updated function configuration, + /// including its entrypoint and build commands if they have been modified. The + /// build process will be queued and executed asynchronously. The original + /// deployment's code will be preserved and used for the new build. /// /// @param String functionId /// @param String deploymentId + /// @param String buildId /// @throws Exception /// @return array /// - open func getDeployment( + open func createDuplicateDeployment( functionId: String, - deploymentId: String + deploymentId: String, + buildId: String? = nil ) async throws -> AppwriteModels.Deployment { - let apiPath: String = "/functions/{functionId}/deployments/{deploymentId}" + let apiPath: String = "/functions/{functionId}/deployments/duplicate" .replacingOccurrences(of: "{functionId}", with: functionId) - .replacingOccurrences(of: "{deploymentId}", with: deploymentId) - let apiParams: [String: Any] = [:] + let apiParams: [String: Any?] = [ + "deploymentId": deploymentId, + "buildId": buildId + ] - let apiHeaders: [String: String] = [:] + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] let converter: (Any) -> AppwriteModels.Deployment = { response in return AppwriteModels.Deployment.from(map: response as! [String: Any]) } return try await client.call( - method: "GET", + method: "POST", path: apiPath, headers: apiHeaders, params: apiParams, @@ -468,35 +502,127 @@ open class Functions: Service { } /// - /// Update the function code deployment ID using the unique function ID. Use - /// this endpoint to switch the code deployment that should be executed by the - /// execution endpoint. + /// Create a deployment based on a template. + /// + /// Use this endpoint with combination of + /// [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to + /// find the template details. + /// + /// @param String functionId + /// @param String repository + /// @param String owner + /// @param String rootDirectory + /// @param String version + /// @param Bool activate + /// @throws Exception + /// @return array + /// + open func createTemplateDeployment( + functionId: String, + repository: String, + owner: String, + rootDirectory: String, + version: String, + activate: Bool? = nil + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/functions/{functionId}/deployments/template" + .replacingOccurrences(of: "{functionId}", with: functionId) + + let apiParams: [String: Any?] = [ + "repository": repository, + "owner": owner, + "rootDirectory": rootDirectory, + "version": version, + "activate": activate + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create a deployment when a function is connected to VCS. + /// + /// This endpoint lets you create deployment from a branch, commit, or a tag. + /// + /// @param String functionId + /// @param AppwriteEnums.VCSDeploymentType type + /// @param String reference + /// @param Bool activate + /// @throws Exception + /// @return array + /// + open func createVcsDeployment( + functionId: String, + type: AppwriteEnums.VCSDeploymentType, + reference: String, + activate: Bool? = nil + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/functions/{functionId}/deployments/vcs" + .replacingOccurrences(of: "{functionId}", with: functionId) + + let apiParams: [String: Any?] = [ + "type": type, + "reference": reference, + "activate": activate + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a function deployment by its unique ID. /// /// @param String functionId /// @param String deploymentId /// @throws Exception /// @return array /// - open func updateDeployment( + open func getDeployment( functionId: String, deploymentId: String - ) async throws -> AppwriteModels.Function { + ) async throws -> AppwriteModels.Deployment { let apiPath: String = "/functions/{functionId}/deployments/{deploymentId}" .replacingOccurrences(of: "{functionId}", with: functionId) .replacingOccurrences(of: "{deploymentId}", with: deploymentId) let apiParams: [String: Any] = [:] - let apiHeaders: [String: String] = [ - "content-type": "application/json" - ] + let apiHeaders: [String: String] = [:] - let converter: (Any) -> AppwriteModels.Function = { response in - return AppwriteModels.Function.from(map: response as! [String: Any]) + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) } return try await client.call( - method: "PATCH", + method: "GET", path: apiPath, headers: apiHeaders, params: apiParams, @@ -534,40 +660,38 @@ open class Functions: Service { } /// - /// Create a new build for an existing function deployment. This endpoint - /// allows you to rebuild a deployment with the updated function configuration, - /// including its entrypoint and build commands if they have been modified The - /// build process will be queued and executed asynchronously. The original - /// deployment's code will be preserved and used for the new build. + /// Get a function deployment content by its unique ID. The endpoint response + /// return with a 'Content-Disposition: attachment' header that tells the + /// browser to start downloading the file to user downloads directory. /// /// @param String functionId /// @param String deploymentId - /// @param String buildId + /// @param AppwriteEnums.DeploymentDownloadType type /// @throws Exception /// @return array /// - open func createBuild( + open func getDeploymentDownload( functionId: String, deploymentId: String, - buildId: String? = nil - ) async throws -> Any { - let apiPath: String = "/functions/{functionId}/deployments/{deploymentId}/build" + type: AppwriteEnums.DeploymentDownloadType? = nil + ) async throws -> ByteBuffer { + let apiPath: String = "/functions/{functionId}/deployments/{deploymentId}/download" .replacingOccurrences(of: "{functionId}", with: functionId) .replacingOccurrences(of: "{deploymentId}", with: deploymentId) let apiParams: [String: Any?] = [ - "buildId": buildId + "type": type, + "project": client.config["project"], + "key": client.config["key"] ] - let apiHeaders: [String: String] = [ - "content-type": "application/json" - ] + let apiHeaders: [String: String] = [:] return try await client.call( - method: "POST", + method: "GET", path: apiPath, - headers: apiHeaders, - params: apiParams ) + params: apiParams + ) } /// @@ -582,11 +706,11 @@ open class Functions: Service { /// @throws Exception /// @return array /// - open func updateDeploymentBuild( + open func updateDeploymentStatus( functionId: String, deploymentId: String - ) async throws -> AppwriteModels.Build { - let apiPath: String = "/functions/{functionId}/deployments/{deploymentId}/build" + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/functions/{functionId}/deployments/{deploymentId}/status" .replacingOccurrences(of: "{functionId}", with: functionId) .replacingOccurrences(of: "{deploymentId}", with: deploymentId) @@ -596,8 +720,8 @@ open class Functions: Service { "content-type": "application/json" ] - let converter: (Any) -> AppwriteModels.Build = { response in - return AppwriteModels.Build.from(map: response as! [String: Any]) + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) } return try await client.call( @@ -609,55 +733,24 @@ open class Functions: Service { ) } - /// - /// Get a Deployment's contents by its unique ID. This endpoint supports range - /// requests for partial or streaming file download. - /// - /// @param String functionId - /// @param String deploymentId - /// @throws Exception - /// @return array - /// - open func getDeploymentDownload( - functionId: String, - deploymentId: String - ) async throws -> ByteBuffer { - let apiPath: String = "/functions/{functionId}/deployments/{deploymentId}/download" - .replacingOccurrences(of: "{functionId}", with: functionId) - .replacingOccurrences(of: "{deploymentId}", with: deploymentId) - - let apiParams: [String: Any] = [:] - - let apiHeaders: [String: String] = [:] - - return try await client.call( - method: "GET", - path: apiPath, - params: apiParams - ) - } - /// /// Get a list of all the current user function execution logs. You can use the /// query params to filter your results. /// /// @param String functionId /// @param [String] queries - /// @param String search /// @throws Exception /// @return array /// open func listExecutions( functionId: String, - queries: [String]? = nil, - search: String? = nil + queries: [String]? = nil ) async throws -> AppwriteModels.ExecutionList { let apiPath: String = "/functions/{functionId}/executions" .replacingOccurrences(of: "{functionId}", with: functionId) let apiParams: [String: Any?] = [ - "queries": queries, - "search": search + "queries": queries ] let apiHeaders: [String: String] = [:] @@ -764,7 +857,6 @@ open class Functions: Service { /// /// Delete a function execution by its unique ID. - /// /// /// @param String functionId /// @param String executionId @@ -829,20 +921,23 @@ open class Functions: Service { /// @param String functionId /// @param String key /// @param String value + /// @param Bool secret /// @throws Exception /// @return array /// open func createVariable( functionId: String, key: String, - value: String + value: String, + secret: Bool? = nil ) async throws -> AppwriteModels.Variable { let apiPath: String = "/functions/{functionId}/variables" .replacingOccurrences(of: "{functionId}", with: functionId) let apiParams: [String: Any?] = [ "key": key, - "value": value + "value": value, + "secret": secret ] let apiHeaders: [String: String] = [ @@ -902,6 +997,7 @@ open class Functions: Service { /// @param String variableId /// @param String key /// @param String value + /// @param Bool secret /// @throws Exception /// @return array /// @@ -909,7 +1005,8 @@ open class Functions: Service { functionId: String, variableId: String, key: String, - value: String? = nil + value: String? = nil, + secret: Bool? = nil ) async throws -> AppwriteModels.Variable { let apiPath: String = "/functions/{functionId}/variables/{variableId}" .replacingOccurrences(of: "{functionId}", with: functionId) @@ -917,7 +1014,8 @@ open class Functions: Service { let apiParams: [String: Any?] = [ "key": key, - "value": value + "value": value, + "secret": secret ] let apiHeaders: [String: String] = [ diff --git a/Sources/Appwrite/Services/Sites.swift b/Sources/Appwrite/Services/Sites.swift new file mode 100644 index 0000000..deae24b --- /dev/null +++ b/Sources/Appwrite/Services/Sites.swift @@ -0,0 +1,1005 @@ +import AsyncHTTPClient +import Foundation +import NIO +import JSONCodable +import AppwriteEnums +import AppwriteModels + +/// The Sites Service allows you view, create and manage your web applications. +open class Sites: Service { + + /// + /// Get a list of all the project's sites. You can use the query params to + /// filter your results. + /// + /// @param [String] queries + /// @param String search + /// @throws Exception + /// @return array + /// + open func list( + queries: [String]? = nil, + search: String? = nil + ) async throws -> AppwriteModels.SiteList { + let apiPath: String = "/sites" + + let apiParams: [String: Any?] = [ + "queries": queries, + "search": search + ] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.SiteList = { response in + return AppwriteModels.SiteList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create a new site. + /// + /// @param String siteId + /// @param String name + /// @param AppwriteEnums.Framework framework + /// @param AppwriteEnums.BuildRuntime buildRuntime + /// @param Bool enabled + /// @param Bool logging + /// @param Int timeout + /// @param String installCommand + /// @param String buildCommand + /// @param String outputDirectory + /// @param AppwriteEnums.Adapter adapter + /// @param String installationId + /// @param String fallbackFile + /// @param String providerRepositoryId + /// @param String providerBranch + /// @param Bool providerSilentMode + /// @param String providerRootDirectory + /// @param String specification + /// @throws Exception + /// @return array + /// + open func create( + siteId: String, + name: String, + framework: AppwriteEnums.Framework, + buildRuntime: AppwriteEnums.BuildRuntime, + enabled: Bool? = nil, + logging: Bool? = nil, + timeout: Int? = nil, + installCommand: String? = nil, + buildCommand: String? = nil, + outputDirectory: String? = nil, + adapter: AppwriteEnums.Adapter? = nil, + installationId: String? = nil, + fallbackFile: String? = nil, + providerRepositoryId: String? = nil, + providerBranch: String? = nil, + providerSilentMode: Bool? = nil, + providerRootDirectory: String? = nil, + specification: String? = nil + ) async throws -> AppwriteModels.Site { + let apiPath: String = "/sites" + + let apiParams: [String: Any?] = [ + "siteId": siteId, + "name": name, + "framework": framework, + "enabled": enabled, + "logging": logging, + "timeout": timeout, + "installCommand": installCommand, + "buildCommand": buildCommand, + "outputDirectory": outputDirectory, + "buildRuntime": buildRuntime, + "adapter": adapter, + "installationId": installationId, + "fallbackFile": fallbackFile, + "providerRepositoryId": providerRepositoryId, + "providerBranch": providerBranch, + "providerSilentMode": providerSilentMode, + "providerRootDirectory": providerRootDirectory, + "specification": specification + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Site = { response in + return AppwriteModels.Site.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a list of all frameworks that are currently available on the server + /// instance. + /// + /// @throws Exception + /// @return array + /// + open func listFrameworks( + ) async throws -> AppwriteModels.FrameworkList { + let apiPath: String = "/sites/frameworks" + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.FrameworkList = { response in + return AppwriteModels.FrameworkList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// List allowed site specifications for this instance. + /// + /// @throws Exception + /// @return array + /// + open func listSpecifications( + ) async throws -> AppwriteModels.SpecificationList { + let apiPath: String = "/sites/specifications" + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.SpecificationList = { response in + return AppwriteModels.SpecificationList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a site by its unique ID. + /// + /// @param String siteId + /// @throws Exception + /// @return array + /// + open func get( + siteId: String + ) async throws -> AppwriteModels.Site { + let apiPath: String = "/sites/{siteId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.Site = { response in + return AppwriteModels.Site.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Update site by its unique ID. + /// + /// @param String siteId + /// @param String name + /// @param AppwriteEnums.Framework framework + /// @param Bool enabled + /// @param Bool logging + /// @param Int timeout + /// @param String installCommand + /// @param String buildCommand + /// @param String outputDirectory + /// @param AppwriteEnums.BuildRuntime buildRuntime + /// @param AppwriteEnums.Adapter adapter + /// @param String fallbackFile + /// @param String installationId + /// @param String providerRepositoryId + /// @param String providerBranch + /// @param Bool providerSilentMode + /// @param String providerRootDirectory + /// @param String specification + /// @throws Exception + /// @return array + /// + open func update( + siteId: String, + name: String, + framework: AppwriteEnums.Framework, + enabled: Bool? = nil, + logging: Bool? = nil, + timeout: Int? = nil, + installCommand: String? = nil, + buildCommand: String? = nil, + outputDirectory: String? = nil, + buildRuntime: AppwriteEnums.BuildRuntime? = nil, + adapter: AppwriteEnums.Adapter? = nil, + fallbackFile: String? = nil, + installationId: String? = nil, + providerRepositoryId: String? = nil, + providerBranch: String? = nil, + providerSilentMode: Bool? = nil, + providerRootDirectory: String? = nil, + specification: String? = nil + ) async throws -> AppwriteModels.Site { + let apiPath: String = "/sites/{siteId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "name": name, + "framework": framework, + "enabled": enabled, + "logging": logging, + "timeout": timeout, + "installCommand": installCommand, + "buildCommand": buildCommand, + "outputDirectory": outputDirectory, + "buildRuntime": buildRuntime, + "adapter": adapter, + "fallbackFile": fallbackFile, + "installationId": installationId, + "providerRepositoryId": providerRepositoryId, + "providerBranch": providerBranch, + "providerSilentMode": providerSilentMode, + "providerRootDirectory": providerRootDirectory, + "specification": specification + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Site = { response in + return AppwriteModels.Site.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Delete a site by its unique ID. + /// + /// @param String siteId + /// @throws Exception + /// @return array + /// + open func delete( + siteId: String + ) async throws -> Any { + let apiPath: String = "/sites/{siteId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + return try await client.call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + params: apiParams ) + } + + /// + /// Update the site active deployment. Use this endpoint to switch the code + /// deployment that should be used when visitor opens your site. + /// + /// @param String siteId + /// @param String deploymentId + /// @throws Exception + /// @return array + /// + open func updateSiteDeployment( + siteId: String, + deploymentId: String + ) async throws -> AppwriteModels.Site { + let apiPath: String = "/sites/{siteId}/deployment" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "deploymentId": deploymentId + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Site = { response in + return AppwriteModels.Site.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a list of all the site's code deployments. You can use the query params + /// to filter your results. + /// + /// @param String siteId + /// @param [String] queries + /// @param String search + /// @throws Exception + /// @return array + /// + open func listDeployments( + siteId: String, + queries: [String]? = nil, + search: String? = nil + ) async throws -> AppwriteModels.DeploymentList { + let apiPath: String = "/sites/{siteId}/deployments" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "queries": queries, + "search": search + ] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.DeploymentList = { response in + return AppwriteModels.DeploymentList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create a new site code deployment. Use this endpoint to upload a new + /// version of your site code. To activate your newly uploaded code, you'll + /// need to update the function's deployment to use your new deployment ID. + /// + /// @param String siteId + /// @param InputFile code + /// @param Bool activate + /// @param String installCommand + /// @param String buildCommand + /// @param String outputDirectory + /// @throws Exception + /// @return array + /// + open func createDeployment( + siteId: String, + code: InputFile, + activate: Bool, + installCommand: String? = nil, + buildCommand: String? = nil, + outputDirectory: String? = nil, + onProgress: ((UploadProgress) -> Void)? = nil + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/sites/{siteId}/deployments" + .replacingOccurrences(of: "{siteId}", with: siteId) + + var apiParams: [String: Any?] = [ + "installCommand": installCommand, + "buildCommand": buildCommand, + "outputDirectory": outputDirectory, + "code": code, + "activate": activate + ] + + var apiHeaders: [String: String] = [ + "content-type": "multipart/form-data" + ] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + let idParamName: String? = nil + let paramName = "code" + return try await client.chunkedUpload( + path: apiPath, + headers: &apiHeaders, + params: &apiParams, + paramName: paramName, + idParamName: idParamName, + converter: converter, + onProgress: onProgress + ) + } + + /// + /// Create a new build for an existing site deployment. This endpoint allows + /// you to rebuild a deployment with the updated site configuration, including + /// its commands and output directory if they have been modified. The build + /// process will be queued and executed asynchronously. The original + /// deployment's code will be preserved and used for the new build. + /// + /// @param String siteId + /// @param String deploymentId + /// @throws Exception + /// @return array + /// + open func createDuplicateDeployment( + siteId: String, + deploymentId: String + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/sites/{siteId}/deployments/duplicate" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "deploymentId": deploymentId + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create a deployment based on a template. + /// + /// Use this endpoint with combination of + /// [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to + /// find the template details. + /// + /// @param String siteId + /// @param String repository + /// @param String owner + /// @param String rootDirectory + /// @param String version + /// @param Bool activate + /// @throws Exception + /// @return array + /// + open func createTemplateDeployment( + siteId: String, + repository: String, + owner: String, + rootDirectory: String, + version: String, + activate: Bool? = nil + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/sites/{siteId}/deployments/template" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "repository": repository, + "owner": owner, + "rootDirectory": rootDirectory, + "version": version, + "activate": activate + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create a deployment when a site is connected to VCS. + /// + /// This endpoint lets you create deployment from a branch, commit, or a tag. + /// + /// @param String siteId + /// @param AppwriteEnums.VCSDeploymentType type + /// @param String reference + /// @param Bool activate + /// @throws Exception + /// @return array + /// + open func createVcsDeployment( + siteId: String, + type: AppwriteEnums.VCSDeploymentType, + reference: String, + activate: Bool? = nil + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/sites/{siteId}/deployments/vcs" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "type": type, + "reference": reference, + "activate": activate + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a site deployment by its unique ID. + /// + /// @param String siteId + /// @param String deploymentId + /// @throws Exception + /// @return array + /// + open func getDeployment( + siteId: String, + deploymentId: String + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/sites/{siteId}/deployments/{deploymentId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{deploymentId}", with: deploymentId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Delete a site deployment by its unique ID. + /// + /// @param String siteId + /// @param String deploymentId + /// @throws Exception + /// @return array + /// + open func deleteDeployment( + siteId: String, + deploymentId: String + ) async throws -> Any { + let apiPath: String = "/sites/{siteId}/deployments/{deploymentId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{deploymentId}", with: deploymentId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + return try await client.call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + params: apiParams ) + } + + /// + /// Get a site deployment content by its unique ID. The endpoint response + /// return with a 'Content-Disposition: attachment' header that tells the + /// browser to start downloading the file to user downloads directory. + /// + /// @param String siteId + /// @param String deploymentId + /// @param AppwriteEnums.DeploymentDownloadType type + /// @throws Exception + /// @return array + /// + open func getDeploymentDownload( + siteId: String, + deploymentId: String, + type: AppwriteEnums.DeploymentDownloadType? = nil + ) async throws -> ByteBuffer { + let apiPath: String = "/sites/{siteId}/deployments/{deploymentId}/download" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{deploymentId}", with: deploymentId) + + let apiParams: [String: Any?] = [ + "type": type, + "project": client.config["project"], + "key": client.config["key"] + ] + + let apiHeaders: [String: String] = [:] + + return try await client.call( + method: "GET", + path: apiPath, + params: apiParams + ) + } + + /// + /// Cancel an ongoing site deployment build. If the build is already in + /// progress, it will be stopped and marked as canceled. If the build hasn't + /// started yet, it will be marked as canceled without executing. You cannot + /// cancel builds that have already completed (status 'ready') or failed. The + /// response includes the final build status and details. + /// + /// @param String siteId + /// @param String deploymentId + /// @throws Exception + /// @return array + /// + open func updateDeploymentStatus( + siteId: String, + deploymentId: String + ) async throws -> AppwriteModels.Deployment { + let apiPath: String = "/sites/{siteId}/deployments/{deploymentId}/status" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{deploymentId}", with: deploymentId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Deployment = { response in + return AppwriteModels.Deployment.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a list of all site logs. You can use the query params to filter your + /// results. + /// + /// @param String siteId + /// @param [String] queries + /// @throws Exception + /// @return array + /// + open func listLogs( + siteId: String, + queries: [String]? = nil + ) async throws -> AppwriteModels.ExecutionList { + let apiPath: String = "/sites/{siteId}/logs" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "queries": queries + ] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.ExecutionList = { response in + return AppwriteModels.ExecutionList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a site request log by its unique ID. + /// + /// @param String siteId + /// @param String logId + /// @throws Exception + /// @return array + /// + open func getLog( + siteId: String, + logId: String + ) async throws -> AppwriteModels.Execution { + let apiPath: String = "/sites/{siteId}/logs/{logId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{logId}", with: logId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.Execution = { response in + return AppwriteModels.Execution.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Delete a site log by its unique ID. + /// + /// @param String siteId + /// @param String logId + /// @throws Exception + /// @return array + /// + open func deleteLog( + siteId: String, + logId: String + ) async throws -> Any { + let apiPath: String = "/sites/{siteId}/logs/{logId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{logId}", with: logId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + return try await client.call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + params: apiParams ) + } + + /// + /// Get a list of all variables of a specific site. + /// + /// @param String siteId + /// @throws Exception + /// @return array + /// + open func listVariables( + siteId: String + ) async throws -> AppwriteModels.VariableList { + let apiPath: String = "/sites/{siteId}/variables" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.VariableList = { response in + return AppwriteModels.VariableList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create a new site variable. These variables can be accessed during build + /// and runtime (server-side rendering) as environment variables. + /// + /// @param String siteId + /// @param String key + /// @param String value + /// @param Bool secret + /// @throws Exception + /// @return array + /// + open func createVariable( + siteId: String, + key: String, + value: String, + secret: Bool? = nil + ) async throws -> AppwriteModels.Variable { + let apiPath: String = "/sites/{siteId}/variables" + .replacingOccurrences(of: "{siteId}", with: siteId) + + let apiParams: [String: Any?] = [ + "key": key, + "value": value, + "secret": secret + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Variable = { response in + return AppwriteModels.Variable.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a variable by its unique ID. + /// + /// @param String siteId + /// @param String variableId + /// @throws Exception + /// @return array + /// + open func getVariable( + siteId: String, + variableId: String + ) async throws -> AppwriteModels.Variable { + let apiPath: String = "/sites/{siteId}/variables/{variableId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{variableId}", with: variableId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.Variable = { response in + return AppwriteModels.Variable.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Update variable by its unique ID. + /// + /// @param String siteId + /// @param String variableId + /// @param String key + /// @param String value + /// @param Bool secret + /// @throws Exception + /// @return array + /// + open func updateVariable( + siteId: String, + variableId: String, + key: String, + value: String? = nil, + secret: Bool? = nil + ) async throws -> AppwriteModels.Variable { + let apiPath: String = "/sites/{siteId}/variables/{variableId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{variableId}", with: variableId) + + let apiParams: [String: Any?] = [ + "key": key, + "value": value, + "secret": secret + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.Variable = { response in + return AppwriteModels.Variable.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Delete a variable by its unique ID. + /// + /// @param String siteId + /// @param String variableId + /// @throws Exception + /// @return array + /// + open func deleteVariable( + siteId: String, + variableId: String + ) async throws -> Any { + let apiPath: String = "/sites/{siteId}/variables/{variableId}" + .replacingOccurrences(of: "{siteId}", with: siteId) + .replacingOccurrences(of: "{variableId}", with: variableId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + return try await client.call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + params: apiParams ) + } + + +} \ No newline at end of file diff --git a/Sources/Appwrite/Services/Storage.swift b/Sources/Appwrite/Services/Storage.swift index 8d0a7f3..29976dd 100644 --- a/Sources/Appwrite/Services/Storage.swift +++ b/Sources/Appwrite/Services/Storage.swift @@ -436,18 +436,24 @@ open class Storage: Service { /// /// @param String bucketId /// @param String fileId + /// @param String token /// @throws Exception /// @return array /// open func getFileDownload( bucketId: String, - fileId: String + fileId: String, + token: String? = nil ) async throws -> ByteBuffer { let apiPath: String = "/storage/buckets/{bucketId}/files/{fileId}/download" .replacingOccurrences(of: "{bucketId}", with: bucketId) .replacingOccurrences(of: "{fileId}", with: fileId) - let apiParams: [String: Any] = [:] + let apiParams: [String: Any?] = [ + "token": token, + "project": client.config["project"], + "session": client.config["session"] + ] let apiHeaders: [String: String] = [:] @@ -478,6 +484,7 @@ open class Storage: Service { /// @param Int rotation /// @param String background /// @param AppwriteEnums.ImageFormat output + /// @param String token /// @throws Exception /// @return array /// @@ -494,7 +501,8 @@ open class Storage: Service { opacity: Double? = nil, rotation: Int? = nil, background: String? = nil, - output: AppwriteEnums.ImageFormat? = nil + output: AppwriteEnums.ImageFormat? = nil, + token: String? = nil ) async throws -> ByteBuffer { let apiPath: String = "/storage/buckets/{bucketId}/files/{fileId}/preview" .replacingOccurrences(of: "{bucketId}", with: bucketId) @@ -512,6 +520,7 @@ open class Storage: Service { "rotation": rotation, "background": background, "output": output, + "token": token, "project": client.config["project"], "session": client.config["session"] ] @@ -532,18 +541,24 @@ open class Storage: Service { /// /// @param String bucketId /// @param String fileId + /// @param String token /// @throws Exception /// @return array /// open func getFileView( bucketId: String, - fileId: String + fileId: String, + token: String? = nil ) async throws -> ByteBuffer { let apiPath: String = "/storage/buckets/{bucketId}/files/{fileId}/view" .replacingOccurrences(of: "{bucketId}", with: bucketId) .replacingOccurrences(of: "{fileId}", with: fileId) - let apiParams: [String: Any] = [:] + let apiParams: [String: Any?] = [ + "token": token, + "project": client.config["project"], + "session": client.config["session"] + ] let apiHeaders: [String: String] = [:] diff --git a/Sources/Appwrite/Services/Tokens.swift b/Sources/Appwrite/Services/Tokens.swift new file mode 100644 index 0000000..223a2a5 --- /dev/null +++ b/Sources/Appwrite/Services/Tokens.swift @@ -0,0 +1,183 @@ +import AsyncHTTPClient +import Foundation +import NIO +import JSONCodable +import AppwriteEnums +import AppwriteModels + +/// +open class Tokens: Service { + + /// + /// List all the tokens created for a specific file or bucket. You can use the + /// query params to filter your results. + /// + /// @param String bucketId + /// @param String fileId + /// @param [String] queries + /// @throws Exception + /// @return array + /// + open func list( + bucketId: String, + fileId: String, + queries: [String]? = nil + ) async throws -> AppwriteModels.ResourceTokenList { + let apiPath: String = "/tokens/buckets/{bucketId}/files/{fileId}" + .replacingOccurrences(of: "{bucketId}", with: bucketId) + .replacingOccurrences(of: "{fileId}", with: fileId) + + let apiParams: [String: Any?] = [ + "queries": queries + ] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.ResourceTokenList = { response in + return AppwriteModels.ResourceTokenList.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Create a new token. A token is linked to a file. Token can be passed as a + /// header or request get parameter. + /// + /// @param String bucketId + /// @param String fileId + /// @param String expire + /// @throws Exception + /// @return array + /// + open func createFileToken( + bucketId: String, + fileId: String, + expire: String? = nil + ) async throws -> AppwriteModels.ResourceToken { + let apiPath: String = "/tokens/buckets/{bucketId}/files/{fileId}" + .replacingOccurrences(of: "{bucketId}", with: bucketId) + .replacingOccurrences(of: "{fileId}", with: fileId) + + let apiParams: [String: Any?] = [ + "expire": expire + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.ResourceToken = { response in + return AppwriteModels.ResourceToken.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "POST", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Get a token by its unique ID. + /// + /// @param String tokenId + /// @throws Exception + /// @return array + /// + open func get( + tokenId: String + ) async throws -> AppwriteModels.ResourceToken { + let apiPath: String = "/tokens/{tokenId}" + .replacingOccurrences(of: "{tokenId}", with: tokenId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [:] + + let converter: (Any) -> AppwriteModels.ResourceToken = { response in + return AppwriteModels.ResourceToken.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "GET", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Update a token by its unique ID. Use this endpoint to update a token's + /// expiry date. + /// + /// @param String tokenId + /// @param String expire + /// @throws Exception + /// @return array + /// + open func update( + tokenId: String, + expire: String? = nil + ) async throws -> AppwriteModels.ResourceToken { + let apiPath: String = "/tokens/{tokenId}" + .replacingOccurrences(of: "{tokenId}", with: tokenId) + + let apiParams: [String: Any?] = [ + "expire": expire + ] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + let converter: (Any) -> AppwriteModels.ResourceToken = { response in + return AppwriteModels.ResourceToken.from(map: response as! [String: Any]) + } + + return try await client.call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + params: apiParams, + converter: converter + ) + } + + /// + /// Delete a token by its unique ID. + /// + /// @param String tokenId + /// @throws Exception + /// @return array + /// + open func delete( + tokenId: String + ) async throws -> Any { + let apiPath: String = "/tokens/{tokenId}" + .replacingOccurrences(of: "{tokenId}", with: tokenId) + + let apiParams: [String: Any] = [:] + + let apiHeaders: [String: String] = [ + "content-type": "application/json" + ] + + return try await client.call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + params: apiParams ) + } + + +} \ No newline at end of file diff --git a/Sources/Appwrite/Services/Users.swift b/Sources/Appwrite/Services/Users.swift index 2dea649..02505e6 100644 --- a/Sources/Appwrite/Services/Users.swift +++ b/Sources/Appwrite/Services/Users.swift @@ -1051,16 +1051,23 @@ open class Users: Service { /// Get the user membership list by its unique ID. /// /// @param String userId + /// @param [String] queries + /// @param String search /// @throws Exception /// @return array /// open func listMemberships( - userId: String + userId: String, + queries: [String]? = nil, + search: String? = nil ) async throws -> AppwriteModels.MembershipList { let apiPath: String = "/users/{userId}/memberships" .replacingOccurrences(of: "{userId}", with: userId) - let apiParams: [String: Any] = [:] + let apiParams: [String: Any?] = [ + "queries": queries, + "search": search + ] let apiHeaders: [String: String] = [:] diff --git a/Sources/AppwriteEnums/Adapter.swift b/Sources/AppwriteEnums/Adapter.swift new file mode 100644 index 0000000..e9651f0 --- /dev/null +++ b/Sources/AppwriteEnums/Adapter.swift @@ -0,0 +1,10 @@ +import Foundation + +public enum Adapter: String, CustomStringConvertible { + case `static` = "static" + case ssr = "ssr" + + public var description: String { + return rawValue + } +} diff --git a/Sources/AppwriteEnums/BuildRuntime.swift b/Sources/AppwriteEnums/BuildRuntime.swift new file mode 100644 index 0000000..90ca969 --- /dev/null +++ b/Sources/AppwriteEnums/BuildRuntime.swift @@ -0,0 +1,71 @@ +import Foundation + +public enum BuildRuntime: String, CustomStringConvertible { + case node145 = "node-14.5" + case node160 = "node-16.0" + case node180 = "node-18.0" + case node190 = "node-19.0" + case node200 = "node-20.0" + case node210 = "node-21.0" + case node22 = "node-22" + case php80 = "php-8.0" + case php81 = "php-8.1" + case php82 = "php-8.2" + case php83 = "php-8.3" + case ruby30 = "ruby-3.0" + case ruby31 = "ruby-3.1" + case ruby32 = "ruby-3.2" + case ruby33 = "ruby-3.3" + case python38 = "python-3.8" + case python39 = "python-3.9" + case python310 = "python-3.10" + case python311 = "python-3.11" + case python312 = "python-3.12" + case pythonMl311 = "python-ml-3.11" + case pythonMl312 = "python-ml-3.12" + case deno121 = "deno-1.21" + case deno124 = "deno-1.24" + case deno135 = "deno-1.35" + case deno140 = "deno-1.40" + case deno146 = "deno-1.46" + case deno20 = "deno-2.0" + case dart215 = "dart-2.15" + case dart216 = "dart-2.16" + case dart217 = "dart-2.17" + case dart218 = "dart-2.18" + case dart219 = "dart-2.19" + case dart30 = "dart-3.0" + case dart31 = "dart-3.1" + case dart33 = "dart-3.3" + case dart35 = "dart-3.5" + case dotnet60 = "dotnet-6.0" + case dotnet70 = "dotnet-7.0" + case dotnet80 = "dotnet-8.0" + case java80 = "java-8.0" + case java110 = "java-11.0" + case java170 = "java-17.0" + case java180 = "java-18.0" + case java210 = "java-21.0" + case java22 = "java-22" + case swift55 = "swift-5.5" + case swift58 = "swift-5.8" + case swift59 = "swift-5.9" + case swift510 = "swift-5.10" + case kotlin16 = "kotlin-1.6" + case kotlin18 = "kotlin-1.8" + case kotlin19 = "kotlin-1.9" + case kotlin20 = "kotlin-2.0" + case cpp17 = "cpp-17" + case cpp20 = "cpp-20" + case bun10 = "bun-1.0" + case bun11 = "bun-1.1" + case go123 = "go-1.23" + case static1 = "static-1" + case flutter324 = "flutter-3.24" + case flutter327 = "flutter-3.27" + case flutter329 = "flutter-3.29" + + public var description: String { + return rawValue + } +} diff --git a/Sources/AppwriteEnums/DeploymentDownloadType.swift b/Sources/AppwriteEnums/DeploymentDownloadType.swift new file mode 100644 index 0000000..d4f5bf0 --- /dev/null +++ b/Sources/AppwriteEnums/DeploymentDownloadType.swift @@ -0,0 +1,10 @@ +import Foundation + +public enum DeploymentDownloadType: String, CustomStringConvertible { + case source = "source" + case output = "output" + + public var description: String { + return rawValue + } +} diff --git a/Sources/AppwriteEnums/Framework.swift b/Sources/AppwriteEnums/Framework.swift new file mode 100644 index 0000000..83b61b3 --- /dev/null +++ b/Sources/AppwriteEnums/Framework.swift @@ -0,0 +1,22 @@ +import Foundation + +public enum Framework: String, CustomStringConvertible { + case analog = "analog" + case angular = "angular" + case nextjs = "nextjs" + case react = "react" + case nuxt = "nuxt" + case vue = "vue" + case sveltekit = "sveltekit" + case astro = "astro" + case remix = "remix" + case lynx = "lynx" + case flutter = "flutter" + case reactNative = "react-native" + case vite = "vite" + case other = "other" + + public var description: String { + return rawValue + } +} diff --git a/Sources/AppwriteEnums/ImageFormat.swift b/Sources/AppwriteEnums/ImageFormat.swift index c31fb47..70110ff 100644 --- a/Sources/AppwriteEnums/ImageFormat.swift +++ b/Sources/AppwriteEnums/ImageFormat.swift @@ -3,7 +3,6 @@ import Foundation public enum ImageFormat: String, CustomStringConvertible { case jpg = "jpg" case jpeg = "jpeg" - case gif = "gif" case png = "png" case webp = "webp" case heic = "heic" diff --git a/Sources/AppwriteEnums/Runtime.swift b/Sources/AppwriteEnums/Runtime.swift index 6fbf901..5a6cccf 100644 --- a/Sources/AppwriteEnums/Runtime.swift +++ b/Sources/AppwriteEnums/Runtime.swift @@ -22,6 +22,7 @@ public enum Runtime: String, CustomStringConvertible { case python311 = "python-3.11" case python312 = "python-3.12" case pythonMl311 = "python-ml-3.11" + case pythonMl312 = "python-ml-3.12" case deno121 = "deno-1.21" case deno124 = "deno-1.24" case deno135 = "deno-1.35" @@ -32,6 +33,7 @@ public enum Runtime: String, CustomStringConvertible { case dart216 = "dart-2.16" case dart217 = "dart-2.17" case dart218 = "dart-2.18" + case dart219 = "dart-2.19" case dart30 = "dart-3.0" case dart31 = "dart-3.1" case dart33 = "dart-3.3" @@ -60,6 +62,8 @@ public enum Runtime: String, CustomStringConvertible { case go123 = "go-1.23" case static1 = "static-1" case flutter324 = "flutter-3.24" + case flutter327 = "flutter-3.27" + case flutter329 = "flutter-3.29" public var description: String { return rawValue diff --git a/Sources/AppwriteEnums/VCSDeploymentType.swift b/Sources/AppwriteEnums/VCSDeploymentType.swift new file mode 100644 index 0000000..3d40494 --- /dev/null +++ b/Sources/AppwriteEnums/VCSDeploymentType.swift @@ -0,0 +1,11 @@ +import Foundation + +public enum VCSDeploymentType: String, CustomStringConvertible { + case branch = "branch" + case commit = "commit" + case tag = "tag" + + public var description: String { + return rawValue + } +} diff --git a/Sources/AppwriteModels/Build.swift b/Sources/AppwriteModels/Build.swift deleted file mode 100644 index 454ba67..0000000 --- a/Sources/AppwriteModels/Build.swift +++ /dev/null @@ -1,124 +0,0 @@ -import Foundation -import JSONCodable - -/// Build -open class Build: Codable { - - enum CodingKeys: String, CodingKey { - case id = "$id" - case deploymentId = "deploymentId" - case status = "status" - case stdout = "stdout" - case stderr = "stderr" - case startTime = "startTime" - case endTime = "endTime" - case duration = "duration" - case size = "size" - } - - /// Build ID. - public let id: String - - /// The deployment that created this build. - public let deploymentId: String - - /// The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built - public let status: String - - /// The stdout of the build. - public let stdout: String - - /// The stderr of the build. - public let stderr: String - - /// The deployment creation date in ISO 8601 format. - public let startTime: String - - /// The time the build was finished in ISO 8601 format. - public let endTime: String - - /// The build duration in seconds. - public let duration: Int - - /// The code size in bytes. - public let size: Int - - - init( - id: String, - deploymentId: String, - status: String, - stdout: String, - stderr: String, - startTime: String, - endTime: String, - duration: Int, - size: Int - ) { - self.id = id - self.deploymentId = deploymentId - self.status = status - self.stdout = stdout - self.stderr = stderr - self.startTime = startTime - self.endTime = endTime - self.duration = duration - self.size = size - } - - public required init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - self.id = try container.decode(String.self, forKey: .id) - self.deploymentId = try container.decode(String.self, forKey: .deploymentId) - self.status = try container.decode(String.self, forKey: .status) - self.stdout = try container.decode(String.self, forKey: .stdout) - self.stderr = try container.decode(String.self, forKey: .stderr) - self.startTime = try container.decode(String.self, forKey: .startTime) - self.endTime = try container.decode(String.self, forKey: .endTime) - self.duration = try container.decode(Int.self, forKey: .duration) - self.size = try container.decode(Int.self, forKey: .size) - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - try container.encode(id, forKey: .id) - try container.encode(deploymentId, forKey: .deploymentId) - try container.encode(status, forKey: .status) - try container.encode(stdout, forKey: .stdout) - try container.encode(stderr, forKey: .stderr) - try container.encode(startTime, forKey: .startTime) - try container.encode(endTime, forKey: .endTime) - try container.encode(duration, forKey: .duration) - try container.encode(size, forKey: .size) - } - - public func toMap() -> [String: Any] { - return [ - "$id": id as Any, - "deploymentId": deploymentId as Any, - "status": status as Any, - "stdout": stdout as Any, - "stderr": stderr as Any, - "startTime": startTime as Any, - "endTime": endTime as Any, - "duration": duration as Any, - "size": size as Any - ] - } - - public static func from(map: [String: Any] ) -> Build { - return Build( - id: map["$id"] as! String, - deploymentId: map["deploymentId"] as! String, - status: map["status"] as! String, - stdout: map["stdout"] as! String, - stderr: map["stderr"] as! String, - startTime: map["startTime"] as! String, - endTime: map["endTime"] as! String, - duration: map["duration"] as! Int, - size: map["size"] as! Int - ) - } -} diff --git a/Sources/AppwriteModels/Deployment.swift b/Sources/AppwriteModels/Deployment.swift index 5af8a63..b2a183b 100644 --- a/Sources/AppwriteModels/Deployment.swift +++ b/Sources/AppwriteModels/Deployment.swift @@ -12,13 +12,16 @@ open class Deployment: Codable { case resourceId = "resourceId" case resourceType = "resourceType" case entrypoint = "entrypoint" - case size = "size" + case sourceSize = "sourceSize" case buildSize = "buildSize" + case totalSize = "totalSize" case buildId = "buildId" case activate = "activate" + case screenshotLight = "screenshotLight" + case screenshotDark = "screenshotDark" case status = "status" case buildLogs = "buildLogs" - case buildTime = "buildTime" + case buildDuration = "buildDuration" case providerRepositoryName = "providerRepositoryName" case providerRepositoryOwner = "providerRepositoryOwner" case providerRepositoryUrl = "providerRepositoryUrl" @@ -53,25 +56,34 @@ open class Deployment: Codable { public let entrypoint: String /// The code size in bytes. - public let size: Int + public let sourceSize: Int /// The build output size in bytes. public let buildSize: Int + /// The total size in bytes (source and build output). + public let totalSize: Int + /// The current build ID. public let buildId: String /// Whether the deployment should be automatically activated. public let activate: Bool - /// The deployment status. Possible values are "processing", "building", "waiting", "ready", and "failed". + /// Screenshot with light theme preference file ID. + public let screenshotLight: String + + /// Screenshot with dark theme preference file ID. + public let screenshotDark: String + + /// The deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed". public let status: String /// The build logs. public let buildLogs: String /// The current build time in seconds. - public let buildTime: Int + public let buildDuration: Int /// The name of the vcs provider repository public let providerRepositoryName: String @@ -112,13 +124,16 @@ open class Deployment: Codable { resourceId: String, resourceType: String, entrypoint: String, - size: Int, + sourceSize: Int, buildSize: Int, + totalSize: Int, buildId: String, activate: Bool, + screenshotLight: String, + screenshotDark: String, status: String, buildLogs: String, - buildTime: Int, + buildDuration: Int, providerRepositoryName: String, providerRepositoryOwner: String, providerRepositoryUrl: String, @@ -137,13 +152,16 @@ open class Deployment: Codable { self.resourceId = resourceId self.resourceType = resourceType self.entrypoint = entrypoint - self.size = size + self.sourceSize = sourceSize self.buildSize = buildSize + self.totalSize = totalSize self.buildId = buildId self.activate = activate + self.screenshotLight = screenshotLight + self.screenshotDark = screenshotDark self.status = status self.buildLogs = buildLogs - self.buildTime = buildTime + self.buildDuration = buildDuration self.providerRepositoryName = providerRepositoryName self.providerRepositoryOwner = providerRepositoryOwner self.providerRepositoryUrl = providerRepositoryUrl @@ -166,13 +184,16 @@ open class Deployment: Codable { self.resourceId = try container.decode(String.self, forKey: .resourceId) self.resourceType = try container.decode(String.self, forKey: .resourceType) self.entrypoint = try container.decode(String.self, forKey: .entrypoint) - self.size = try container.decode(Int.self, forKey: .size) + self.sourceSize = try container.decode(Int.self, forKey: .sourceSize) self.buildSize = try container.decode(Int.self, forKey: .buildSize) + self.totalSize = try container.decode(Int.self, forKey: .totalSize) self.buildId = try container.decode(String.self, forKey: .buildId) self.activate = try container.decode(Bool.self, forKey: .activate) + self.screenshotLight = try container.decode(String.self, forKey: .screenshotLight) + self.screenshotDark = try container.decode(String.self, forKey: .screenshotDark) self.status = try container.decode(String.self, forKey: .status) self.buildLogs = try container.decode(String.self, forKey: .buildLogs) - self.buildTime = try container.decode(Int.self, forKey: .buildTime) + self.buildDuration = try container.decode(Int.self, forKey: .buildDuration) self.providerRepositoryName = try container.decode(String.self, forKey: .providerRepositoryName) self.providerRepositoryOwner = try container.decode(String.self, forKey: .providerRepositoryOwner) self.providerRepositoryUrl = try container.decode(String.self, forKey: .providerRepositoryUrl) @@ -195,13 +216,16 @@ open class Deployment: Codable { try container.encode(resourceId, forKey: .resourceId) try container.encode(resourceType, forKey: .resourceType) try container.encode(entrypoint, forKey: .entrypoint) - try container.encode(size, forKey: .size) + try container.encode(sourceSize, forKey: .sourceSize) try container.encode(buildSize, forKey: .buildSize) + try container.encode(totalSize, forKey: .totalSize) try container.encode(buildId, forKey: .buildId) try container.encode(activate, forKey: .activate) + try container.encode(screenshotLight, forKey: .screenshotLight) + try container.encode(screenshotDark, forKey: .screenshotDark) try container.encode(status, forKey: .status) try container.encode(buildLogs, forKey: .buildLogs) - try container.encode(buildTime, forKey: .buildTime) + try container.encode(buildDuration, forKey: .buildDuration) try container.encode(providerRepositoryName, forKey: .providerRepositoryName) try container.encode(providerRepositoryOwner, forKey: .providerRepositoryOwner) try container.encode(providerRepositoryUrl, forKey: .providerRepositoryUrl) @@ -223,13 +247,16 @@ open class Deployment: Codable { "resourceId": resourceId as Any, "resourceType": resourceType as Any, "entrypoint": entrypoint as Any, - "size": size as Any, + "sourceSize": sourceSize as Any, "buildSize": buildSize as Any, + "totalSize": totalSize as Any, "buildId": buildId as Any, "activate": activate as Any, + "screenshotLight": screenshotLight as Any, + "screenshotDark": screenshotDark as Any, "status": status as Any, "buildLogs": buildLogs as Any, - "buildTime": buildTime as Any, + "buildDuration": buildDuration as Any, "providerRepositoryName": providerRepositoryName as Any, "providerRepositoryOwner": providerRepositoryOwner as Any, "providerRepositoryUrl": providerRepositoryUrl as Any, @@ -252,13 +279,16 @@ open class Deployment: Codable { resourceId: map["resourceId"] as! String, resourceType: map["resourceType"] as! String, entrypoint: map["entrypoint"] as! String, - size: map["size"] as! Int, + sourceSize: map["sourceSize"] as! Int, buildSize: map["buildSize"] as! Int, + totalSize: map["totalSize"] as! Int, buildId: map["buildId"] as! String, activate: map["activate"] as! Bool, + screenshotLight: map["screenshotLight"] as! String, + screenshotDark: map["screenshotDark"] as! String, status: map["status"] as! String, buildLogs: map["buildLogs"] as! String, - buildTime: map["buildTime"] as! Int, + buildDuration: map["buildDuration"] as! Int, providerRepositoryName: map["providerRepositoryName"] as! String, providerRepositoryOwner: map["providerRepositoryOwner"] as! String, providerRepositoryUrl: map["providerRepositoryUrl"] as! String, diff --git a/Sources/AppwriteModels/Execution.swift b/Sources/AppwriteModels/Execution.swift index f9a86e7..6e81532 100644 --- a/Sources/AppwriteModels/Execution.swift +++ b/Sources/AppwriteModels/Execution.swift @@ -69,7 +69,7 @@ open class Execution: Codable { /// Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. public let errors: String - /// Function execution duration in seconds. + /// Resource(function/site) execution duration in seconds. public let duration: Double /// The scheduled time for execution. If left empty, execution will be queued immediately. diff --git a/Sources/AppwriteModels/Framework.swift b/Sources/AppwriteModels/Framework.swift new file mode 100644 index 0000000..9885e94 --- /dev/null +++ b/Sources/AppwriteModels/Framework.swift @@ -0,0 +1,84 @@ +import Foundation +import JSONCodable + +/// Framework +open class Framework: Codable { + + enum CodingKeys: String, CodingKey { + case key = "key" + case name = "name" + case buildRuntime = "buildRuntime" + case runtimes = "runtimes" + case adapters = "adapters" + } + + /// Framework key. + public let key: String + + /// Framework Name. + public let name: String + + /// Default runtime version. + public let buildRuntime: String + + /// List of supported runtime versions. + public let runtimes: [String] + + /// List of supported adapters. + public let adapters: [FrameworkAdapter] + + + init( + key: String, + name: String, + buildRuntime: String, + runtimes: [String], + adapters: [FrameworkAdapter] + ) { + self.key = key + self.name = name + self.buildRuntime = buildRuntime + self.runtimes = runtimes + self.adapters = adapters + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.key = try container.decode(String.self, forKey: .key) + self.name = try container.decode(String.self, forKey: .name) + self.buildRuntime = try container.decode(String.self, forKey: .buildRuntime) + self.runtimes = try container.decode([String].self, forKey: .runtimes) + self.adapters = try container.decode([FrameworkAdapter].self, forKey: .adapters) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try container.encode(key, forKey: .key) + try container.encode(name, forKey: .name) + try container.encode(buildRuntime, forKey: .buildRuntime) + try container.encode(runtimes, forKey: .runtimes) + try container.encode(adapters, forKey: .adapters) + } + + public func toMap() -> [String: Any] { + return [ + "key": key as Any, + "name": name as Any, + "buildRuntime": buildRuntime as Any, + "runtimes": runtimes as Any, + "adapters": adapters.map { $0.toMap() } as Any + ] + } + + public static func from(map: [String: Any] ) -> Framework { + return Framework( + key: map["key"] as! String, + name: map["name"] as! String, + buildRuntime: map["buildRuntime"] as! String, + runtimes: map["runtimes"] as! [String], + adapters: (map["adapters"] as! [[String: Any]]).map { FrameworkAdapter.from(map: $0) } + ) + } +} diff --git a/Sources/AppwriteModels/FrameworkAdapter.swift b/Sources/AppwriteModels/FrameworkAdapter.swift new file mode 100644 index 0000000..59348b4 --- /dev/null +++ b/Sources/AppwriteModels/FrameworkAdapter.swift @@ -0,0 +1,84 @@ +import Foundation +import JSONCodable + +/// Framework Adapter +open class FrameworkAdapter: Codable { + + enum CodingKeys: String, CodingKey { + case key = "key" + case installCommand = "installCommand" + case buildCommand = "buildCommand" + case outputDirectory = "outputDirectory" + case fallbackFile = "fallbackFile" + } + + /// Adapter key. + public let key: String + + /// Default command to download dependencies. + public let installCommand: String + + /// Default command to build site into output directory. + public let buildCommand: String + + /// Default output directory of build. + public let outputDirectory: String + + /// Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + public let fallbackFile: String + + + init( + key: String, + installCommand: String, + buildCommand: String, + outputDirectory: String, + fallbackFile: String + ) { + self.key = key + self.installCommand = installCommand + self.buildCommand = buildCommand + self.outputDirectory = outputDirectory + self.fallbackFile = fallbackFile + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.key = try container.decode(String.self, forKey: .key) + self.installCommand = try container.decode(String.self, forKey: .installCommand) + self.buildCommand = try container.decode(String.self, forKey: .buildCommand) + self.outputDirectory = try container.decode(String.self, forKey: .outputDirectory) + self.fallbackFile = try container.decode(String.self, forKey: .fallbackFile) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try container.encode(key, forKey: .key) + try container.encode(installCommand, forKey: .installCommand) + try container.encode(buildCommand, forKey: .buildCommand) + try container.encode(outputDirectory, forKey: .outputDirectory) + try container.encode(fallbackFile, forKey: .fallbackFile) + } + + public func toMap() -> [String: Any] { + return [ + "key": key as Any, + "installCommand": installCommand as Any, + "buildCommand": buildCommand as Any, + "outputDirectory": outputDirectory as Any, + "fallbackFile": fallbackFile as Any + ] + } + + public static func from(map: [String: Any] ) -> FrameworkAdapter { + return FrameworkAdapter( + key: map["key"] as! String, + installCommand: map["installCommand"] as! String, + buildCommand: map["buildCommand"] as! String, + outputDirectory: map["outputDirectory"] as! String, + fallbackFile: map["fallbackFile"] as! String + ) + } +} diff --git a/Sources/AppwriteModels/FrameworkList.swift b/Sources/AppwriteModels/FrameworkList.swift new file mode 100644 index 0000000..7aa2ce7 --- /dev/null +++ b/Sources/AppwriteModels/FrameworkList.swift @@ -0,0 +1,54 @@ +import Foundation +import JSONCodable + +/// Frameworks List +open class FrameworkList: Codable { + + enum CodingKeys: String, CodingKey { + case total = "total" + case frameworks = "frameworks" + } + + /// Total number of frameworks documents that matched your query. + public let total: Int + + /// List of frameworks. + public let frameworks: [Framework] + + + init( + total: Int, + frameworks: [Framework] + ) { + self.total = total + self.frameworks = frameworks + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.total = try container.decode(Int.self, forKey: .total) + self.frameworks = try container.decode([Framework].self, forKey: .frameworks) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try container.encode(total, forKey: .total) + try container.encode(frameworks, forKey: .frameworks) + } + + public func toMap() -> [String: Any] { + return [ + "total": total as Any, + "frameworks": frameworks.map { $0.toMap() } as Any + ] + } + + public static func from(map: [String: Any] ) -> FrameworkList { + return FrameworkList( + total: map["total"] as! Int, + frameworks: (map["frameworks"] as! [[String: Any]]).map { Framework.from(map: $0) } + ) + } +} diff --git a/Sources/AppwriteModels/Function.swift b/Sources/AppwriteModels/Function.swift index 3199ece..8df6078 100644 --- a/Sources/AppwriteModels/Function.swift +++ b/Sources/AppwriteModels/Function.swift @@ -14,7 +14,11 @@ open class Function: Codable { case live = "live" case logging = "logging" case runtime = "runtime" - case deployment = "deployment" + case deploymentId = "deploymentId" + case deploymentCreatedAt = "deploymentCreatedAt" + case latestDeploymentId = "latestDeploymentId" + case latestDeploymentCreatedAt = "latestDeploymentCreatedAt" + case latestDeploymentStatus = "latestDeploymentStatus" case scopes = "scopes" case vars = "vars" case events = "events" @@ -52,14 +56,26 @@ open class Function: Codable { /// Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. public let live: Bool - /// Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + /// When disabled, executions will exclude logs and errors, and will be slightly faster. public let logging: Bool - /// Function execution runtime. + /// Function execution and build runtime. public let runtime: String /// Function's active deployment ID. - public let deployment: String + public let deploymentId: String + + /// Active deployment creation date in ISO 8601 format. + public let deploymentCreatedAt: String + + /// Function's latest deployment ID. + public let latestDeploymentId: String + + /// Latest deployment creation date in ISO 8601 format. + public let latestDeploymentCreatedAt: String + + /// Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + public let latestDeploymentStatus: String /// Allowed permission scopes. public let scopes: [String] @@ -114,7 +130,11 @@ open class Function: Codable { live: Bool, logging: Bool, runtime: String, - deployment: String, + deploymentId: String, + deploymentCreatedAt: String, + latestDeploymentId: String, + latestDeploymentCreatedAt: String, + latestDeploymentStatus: String, scopes: [String], vars: [Variable], events: [String], @@ -139,7 +159,11 @@ open class Function: Codable { self.live = live self.logging = logging self.runtime = runtime - self.deployment = deployment + self.deploymentId = deploymentId + self.deploymentCreatedAt = deploymentCreatedAt + self.latestDeploymentId = latestDeploymentId + self.latestDeploymentCreatedAt = latestDeploymentCreatedAt + self.latestDeploymentStatus = latestDeploymentStatus self.scopes = scopes self.vars = vars self.events = events @@ -168,7 +192,11 @@ open class Function: Codable { self.live = try container.decode(Bool.self, forKey: .live) self.logging = try container.decode(Bool.self, forKey: .logging) self.runtime = try container.decode(String.self, forKey: .runtime) - self.deployment = try container.decode(String.self, forKey: .deployment) + self.deploymentId = try container.decode(String.self, forKey: .deploymentId) + self.deploymentCreatedAt = try container.decode(String.self, forKey: .deploymentCreatedAt) + self.latestDeploymentId = try container.decode(String.self, forKey: .latestDeploymentId) + self.latestDeploymentCreatedAt = try container.decode(String.self, forKey: .latestDeploymentCreatedAt) + self.latestDeploymentStatus = try container.decode(String.self, forKey: .latestDeploymentStatus) self.scopes = try container.decode([String].self, forKey: .scopes) self.vars = try container.decode([Variable].self, forKey: .vars) self.events = try container.decode([String].self, forKey: .events) @@ -197,7 +225,11 @@ open class Function: Codable { try container.encode(live, forKey: .live) try container.encode(logging, forKey: .logging) try container.encode(runtime, forKey: .runtime) - try container.encode(deployment, forKey: .deployment) + try container.encode(deploymentId, forKey: .deploymentId) + try container.encode(deploymentCreatedAt, forKey: .deploymentCreatedAt) + try container.encode(latestDeploymentId, forKey: .latestDeploymentId) + try container.encode(latestDeploymentCreatedAt, forKey: .latestDeploymentCreatedAt) + try container.encode(latestDeploymentStatus, forKey: .latestDeploymentStatus) try container.encode(scopes, forKey: .scopes) try container.encode(vars, forKey: .vars) try container.encode(events, forKey: .events) @@ -225,7 +257,11 @@ open class Function: Codable { "live": live as Any, "logging": logging as Any, "runtime": runtime as Any, - "deployment": deployment as Any, + "deploymentId": deploymentId as Any, + "deploymentCreatedAt": deploymentCreatedAt as Any, + "latestDeploymentId": latestDeploymentId as Any, + "latestDeploymentCreatedAt": latestDeploymentCreatedAt as Any, + "latestDeploymentStatus": latestDeploymentStatus as Any, "scopes": scopes as Any, "vars": vars.map { $0.toMap() } as Any, "events": events as Any, @@ -254,7 +290,11 @@ open class Function: Codable { live: map["live"] as! Bool, logging: map["logging"] as! Bool, runtime: map["runtime"] as! String, - deployment: map["deployment"] as! String, + deploymentId: map["deploymentId"] as! String, + deploymentCreatedAt: map["deploymentCreatedAt"] as! String, + latestDeploymentId: map["latestDeploymentId"] as! String, + latestDeploymentCreatedAt: map["latestDeploymentCreatedAt"] as! String, + latestDeploymentStatus: map["latestDeploymentStatus"] as! String, scopes: map["scopes"] as! [String], vars: (map["vars"] as! [[String: Any]]).map { Variable.from(map: $0) }, events: map["events"] as! [String], diff --git a/Sources/AppwriteModels/Index.swift b/Sources/AppwriteModels/Index.swift index 6b7d9d5..7b5fb13 100644 --- a/Sources/AppwriteModels/Index.swift +++ b/Sources/AppwriteModels/Index.swift @@ -10,6 +10,7 @@ open class Index: Codable { case status = "status" case error = "error" case attributes = "attributes" + case lengths = "lengths" case orders = "orders" case createdAt = "$createdAt" case updatedAt = "$updatedAt" @@ -30,6 +31,9 @@ open class Index: Codable { /// Index attributes. public let attributes: [String] + /// Index attributes length. + public let lengths: [Int] + /// Index orders. public let orders: [String]? @@ -46,6 +50,7 @@ open class Index: Codable { status: String, error: String, attributes: [String], + lengths: [Int], orders: [String]?, createdAt: String, updatedAt: String @@ -55,6 +60,7 @@ open class Index: Codable { self.status = status self.error = error self.attributes = attributes + self.lengths = lengths self.orders = orders self.createdAt = createdAt self.updatedAt = updatedAt @@ -68,6 +74,7 @@ open class Index: Codable { self.status = try container.decode(String.self, forKey: .status) self.error = try container.decode(String.self, forKey: .error) self.attributes = try container.decode([String].self, forKey: .attributes) + self.lengths = try container.decode([Int].self, forKey: .lengths) self.orders = try container.decodeIfPresent([String].self, forKey: .orders) self.createdAt = try container.decode(String.self, forKey: .createdAt) self.updatedAt = try container.decode(String.self, forKey: .updatedAt) @@ -81,6 +88,7 @@ open class Index: Codable { try container.encode(status, forKey: .status) try container.encode(error, forKey: .error) try container.encode(attributes, forKey: .attributes) + try container.encode(lengths, forKey: .lengths) try container.encodeIfPresent(orders, forKey: .orders) try container.encode(createdAt, forKey: .createdAt) try container.encode(updatedAt, forKey: .updatedAt) @@ -93,6 +101,7 @@ open class Index: Codable { "status": status as Any, "error": error as Any, "attributes": attributes as Any, + "lengths": lengths as Any, "orders": orders as Any, "$createdAt": createdAt as Any, "$updatedAt": updatedAt as Any @@ -106,6 +115,7 @@ open class Index: Codable { status: map["status"] as! String, error: map["error"] as! String, attributes: map["attributes"] as! [String], + lengths: map["lengths"] as! [Int], orders: map["orders"] as? [String], createdAt: map["$createdAt"] as! String, updatedAt: map["$updatedAt"] as! String diff --git a/Sources/AppwriteModels/ResourceToken.swift b/Sources/AppwriteModels/ResourceToken.swift new file mode 100644 index 0000000..a3badb6 --- /dev/null +++ b/Sources/AppwriteModels/ResourceToken.swift @@ -0,0 +1,104 @@ +import Foundation +import JSONCodable + +/// ResourceToken +open class ResourceToken: Codable { + + enum CodingKeys: String, CodingKey { + case id = "$id" + case createdAt = "$createdAt" + case resourceId = "resourceId" + case resourceType = "resourceType" + case expire = "expire" + case secret = "secret" + case accessedAt = "accessedAt" + } + + /// Token ID. + public let id: String + + /// Token creation date in ISO 8601 format. + public let createdAt: String + + /// Resource ID. + public let resourceId: String + + /// Resource type. + public let resourceType: String + + /// Token expiration date in ISO 8601 format. + public let expire: String + + /// JWT encoded string. + public let secret: String + + /// Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + public let accessedAt: String + + + init( + id: String, + createdAt: String, + resourceId: String, + resourceType: String, + expire: String, + secret: String, + accessedAt: String + ) { + self.id = id + self.createdAt = createdAt + self.resourceId = resourceId + self.resourceType = resourceType + self.expire = expire + self.secret = secret + self.accessedAt = accessedAt + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.id = try container.decode(String.self, forKey: .id) + self.createdAt = try container.decode(String.self, forKey: .createdAt) + self.resourceId = try container.decode(String.self, forKey: .resourceId) + self.resourceType = try container.decode(String.self, forKey: .resourceType) + self.expire = try container.decode(String.self, forKey: .expire) + self.secret = try container.decode(String.self, forKey: .secret) + self.accessedAt = try container.decode(String.self, forKey: .accessedAt) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try container.encode(id, forKey: .id) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(resourceId, forKey: .resourceId) + try container.encode(resourceType, forKey: .resourceType) + try container.encode(expire, forKey: .expire) + try container.encode(secret, forKey: .secret) + try container.encode(accessedAt, forKey: .accessedAt) + } + + public func toMap() -> [String: Any] { + return [ + "$id": id as Any, + "$createdAt": createdAt as Any, + "resourceId": resourceId as Any, + "resourceType": resourceType as Any, + "expire": expire as Any, + "secret": secret as Any, + "accessedAt": accessedAt as Any + ] + } + + public static func from(map: [String: Any] ) -> ResourceToken { + return ResourceToken( + id: map["$id"] as! String, + createdAt: map["$createdAt"] as! String, + resourceId: map["resourceId"] as! String, + resourceType: map["resourceType"] as! String, + expire: map["expire"] as! String, + secret: map["secret"] as! String, + accessedAt: map["accessedAt"] as! String + ) + } +} diff --git a/Sources/AppwriteModels/ResourceTokenList.swift b/Sources/AppwriteModels/ResourceTokenList.swift new file mode 100644 index 0000000..6d894b6 --- /dev/null +++ b/Sources/AppwriteModels/ResourceTokenList.swift @@ -0,0 +1,54 @@ +import Foundation +import JSONCodable + +/// Resource Tokens List +open class ResourceTokenList: Codable { + + enum CodingKeys: String, CodingKey { + case total = "total" + case tokens = "tokens" + } + + /// Total number of tokens documents that matched your query. + public let total: Int + + /// List of tokens. + public let tokens: [ResourceToken] + + + init( + total: Int, + tokens: [ResourceToken] + ) { + self.total = total + self.tokens = tokens + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.total = try container.decode(Int.self, forKey: .total) + self.tokens = try container.decode([ResourceToken].self, forKey: .tokens) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try container.encode(total, forKey: .total) + try container.encode(tokens, forKey: .tokens) + } + + public func toMap() -> [String: Any] { + return [ + "total": total as Any, + "tokens": tokens.map { $0.toMap() } as Any + ] + } + + public static func from(map: [String: Any] ) -> ResourceTokenList { + return ResourceTokenList( + total: map["total"] as! Int, + tokens: (map["tokens"] as! [[String: Any]]).map { ResourceToken.from(map: $0) } + ) + } +} diff --git a/Sources/AppwriteModels/Site.swift b/Sources/AppwriteModels/Site.swift new file mode 100644 index 0000000..ef79e4a --- /dev/null +++ b/Sources/AppwriteModels/Site.swift @@ -0,0 +1,324 @@ +import Foundation +import JSONCodable + +/// Site +open class Site: Codable { + + enum CodingKeys: String, CodingKey { + case id = "$id" + case createdAt = "$createdAt" + case updatedAt = "$updatedAt" + case name = "name" + case enabled = "enabled" + case live = "live" + case logging = "logging" + case framework = "framework" + case deploymentId = "deploymentId" + case deploymentCreatedAt = "deploymentCreatedAt" + case deploymentScreenshotLight = "deploymentScreenshotLight" + case deploymentScreenshotDark = "deploymentScreenshotDark" + case latestDeploymentId = "latestDeploymentId" + case latestDeploymentCreatedAt = "latestDeploymentCreatedAt" + case latestDeploymentStatus = "latestDeploymentStatus" + case vars = "vars" + case timeout = "timeout" + case installCommand = "installCommand" + case buildCommand = "buildCommand" + case outputDirectory = "outputDirectory" + case installationId = "installationId" + case providerRepositoryId = "providerRepositoryId" + case providerBranch = "providerBranch" + case providerRootDirectory = "providerRootDirectory" + case providerSilentMode = "providerSilentMode" + case specification = "specification" + case buildRuntime = "buildRuntime" + case adapter = "adapter" + case fallbackFile = "fallbackFile" + } + + /// Site ID. + public let id: String + + /// Site creation date in ISO 8601 format. + public let createdAt: String + + /// Site update date in ISO 8601 format. + public let updatedAt: String + + /// Site name. + public let name: String + + /// Site enabled. + public let enabled: Bool + + /// Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. + public let live: Bool + + /// When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + public let logging: Bool + + /// Site framework. + public let framework: String + + /// Site's active deployment ID. + public let deploymentId: String + + /// Active deployment creation date in ISO 8601 format. + public let deploymentCreatedAt: String + + /// Screenshot of active deployment with light theme preference file ID. + public let deploymentScreenshotLight: String + + /// Screenshot of active deployment with dark theme preference file ID. + public let deploymentScreenshotDark: String + + /// Site's latest deployment ID. + public let latestDeploymentId: String + + /// Latest deployment creation date in ISO 8601 format. + public let latestDeploymentCreatedAt: String + + /// Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + public let latestDeploymentStatus: String + + /// Site variables. + public let vars: [Variable] + + /// Site request timeout in seconds. + public let timeout: Int + + /// The install command used to install the site dependencies. + public let installCommand: String + + /// The build command used to build the site. + public let buildCommand: String + + /// The directory where the site build output is located. + public let outputDirectory: String + + /// Site VCS (Version Control System) installation id. + public let installationId: String + + /// VCS (Version Control System) Repository ID + public let providerRepositoryId: String + + /// VCS (Version Control System) branch name + public let providerBranch: String + + /// Path to site in VCS (Version Control System) repository + public let providerRootDirectory: String + + /// Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests + public let providerSilentMode: Bool + + /// Machine specification for builds and executions. + public let specification: String + + /// Site build runtime. + public let buildRuntime: String + + /// Site framework adapter. + public let adapter: String + + /// Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + public let fallbackFile: String + + + init( + id: String, + createdAt: String, + updatedAt: String, + name: String, + enabled: Bool, + live: Bool, + logging: Bool, + framework: String, + deploymentId: String, + deploymentCreatedAt: String, + deploymentScreenshotLight: String, + deploymentScreenshotDark: String, + latestDeploymentId: String, + latestDeploymentCreatedAt: String, + latestDeploymentStatus: String, + vars: [Variable], + timeout: Int, + installCommand: String, + buildCommand: String, + outputDirectory: String, + installationId: String, + providerRepositoryId: String, + providerBranch: String, + providerRootDirectory: String, + providerSilentMode: Bool, + specification: String, + buildRuntime: String, + adapter: String, + fallbackFile: String + ) { + self.id = id + self.createdAt = createdAt + self.updatedAt = updatedAt + self.name = name + self.enabled = enabled + self.live = live + self.logging = logging + self.framework = framework + self.deploymentId = deploymentId + self.deploymentCreatedAt = deploymentCreatedAt + self.deploymentScreenshotLight = deploymentScreenshotLight + self.deploymentScreenshotDark = deploymentScreenshotDark + self.latestDeploymentId = latestDeploymentId + self.latestDeploymentCreatedAt = latestDeploymentCreatedAt + self.latestDeploymentStatus = latestDeploymentStatus + self.vars = vars + self.timeout = timeout + self.installCommand = installCommand + self.buildCommand = buildCommand + self.outputDirectory = outputDirectory + self.installationId = installationId + self.providerRepositoryId = providerRepositoryId + self.providerBranch = providerBranch + self.providerRootDirectory = providerRootDirectory + self.providerSilentMode = providerSilentMode + self.specification = specification + self.buildRuntime = buildRuntime + self.adapter = adapter + self.fallbackFile = fallbackFile + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.id = try container.decode(String.self, forKey: .id) + self.createdAt = try container.decode(String.self, forKey: .createdAt) + self.updatedAt = try container.decode(String.self, forKey: .updatedAt) + self.name = try container.decode(String.self, forKey: .name) + self.enabled = try container.decode(Bool.self, forKey: .enabled) + self.live = try container.decode(Bool.self, forKey: .live) + self.logging = try container.decode(Bool.self, forKey: .logging) + self.framework = try container.decode(String.self, forKey: .framework) + self.deploymentId = try container.decode(String.self, forKey: .deploymentId) + self.deploymentCreatedAt = try container.decode(String.self, forKey: .deploymentCreatedAt) + self.deploymentScreenshotLight = try container.decode(String.self, forKey: .deploymentScreenshotLight) + self.deploymentScreenshotDark = try container.decode(String.self, forKey: .deploymentScreenshotDark) + self.latestDeploymentId = try container.decode(String.self, forKey: .latestDeploymentId) + self.latestDeploymentCreatedAt = try container.decode(String.self, forKey: .latestDeploymentCreatedAt) + self.latestDeploymentStatus = try container.decode(String.self, forKey: .latestDeploymentStatus) + self.vars = try container.decode([Variable].self, forKey: .vars) + self.timeout = try container.decode(Int.self, forKey: .timeout) + self.installCommand = try container.decode(String.self, forKey: .installCommand) + self.buildCommand = try container.decode(String.self, forKey: .buildCommand) + self.outputDirectory = try container.decode(String.self, forKey: .outputDirectory) + self.installationId = try container.decode(String.self, forKey: .installationId) + self.providerRepositoryId = try container.decode(String.self, forKey: .providerRepositoryId) + self.providerBranch = try container.decode(String.self, forKey: .providerBranch) + self.providerRootDirectory = try container.decode(String.self, forKey: .providerRootDirectory) + self.providerSilentMode = try container.decode(Bool.self, forKey: .providerSilentMode) + self.specification = try container.decode(String.self, forKey: .specification) + self.buildRuntime = try container.decode(String.self, forKey: .buildRuntime) + self.adapter = try container.decode(String.self, forKey: .adapter) + self.fallbackFile = try container.decode(String.self, forKey: .fallbackFile) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try container.encode(id, forKey: .id) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(name, forKey: .name) + try container.encode(enabled, forKey: .enabled) + try container.encode(live, forKey: .live) + try container.encode(logging, forKey: .logging) + try container.encode(framework, forKey: .framework) + try container.encode(deploymentId, forKey: .deploymentId) + try container.encode(deploymentCreatedAt, forKey: .deploymentCreatedAt) + try container.encode(deploymentScreenshotLight, forKey: .deploymentScreenshotLight) + try container.encode(deploymentScreenshotDark, forKey: .deploymentScreenshotDark) + try container.encode(latestDeploymentId, forKey: .latestDeploymentId) + try container.encode(latestDeploymentCreatedAt, forKey: .latestDeploymentCreatedAt) + try container.encode(latestDeploymentStatus, forKey: .latestDeploymentStatus) + try container.encode(vars, forKey: .vars) + try container.encode(timeout, forKey: .timeout) + try container.encode(installCommand, forKey: .installCommand) + try container.encode(buildCommand, forKey: .buildCommand) + try container.encode(outputDirectory, forKey: .outputDirectory) + try container.encode(installationId, forKey: .installationId) + try container.encode(providerRepositoryId, forKey: .providerRepositoryId) + try container.encode(providerBranch, forKey: .providerBranch) + try container.encode(providerRootDirectory, forKey: .providerRootDirectory) + try container.encode(providerSilentMode, forKey: .providerSilentMode) + try container.encode(specification, forKey: .specification) + try container.encode(buildRuntime, forKey: .buildRuntime) + try container.encode(adapter, forKey: .adapter) + try container.encode(fallbackFile, forKey: .fallbackFile) + } + + public func toMap() -> [String: Any] { + return [ + "$id": id as Any, + "$createdAt": createdAt as Any, + "$updatedAt": updatedAt as Any, + "name": name as Any, + "enabled": enabled as Any, + "live": live as Any, + "logging": logging as Any, + "framework": framework as Any, + "deploymentId": deploymentId as Any, + "deploymentCreatedAt": deploymentCreatedAt as Any, + "deploymentScreenshotLight": deploymentScreenshotLight as Any, + "deploymentScreenshotDark": deploymentScreenshotDark as Any, + "latestDeploymentId": latestDeploymentId as Any, + "latestDeploymentCreatedAt": latestDeploymentCreatedAt as Any, + "latestDeploymentStatus": latestDeploymentStatus as Any, + "vars": vars.map { $0.toMap() } as Any, + "timeout": timeout as Any, + "installCommand": installCommand as Any, + "buildCommand": buildCommand as Any, + "outputDirectory": outputDirectory as Any, + "installationId": installationId as Any, + "providerRepositoryId": providerRepositoryId as Any, + "providerBranch": providerBranch as Any, + "providerRootDirectory": providerRootDirectory as Any, + "providerSilentMode": providerSilentMode as Any, + "specification": specification as Any, + "buildRuntime": buildRuntime as Any, + "adapter": adapter as Any, + "fallbackFile": fallbackFile as Any + ] + } + + public static func from(map: [String: Any] ) -> Site { + return Site( + id: map["$id"] as! String, + createdAt: map["$createdAt"] as! String, + updatedAt: map["$updatedAt"] as! String, + name: map["name"] as! String, + enabled: map["enabled"] as! Bool, + live: map["live"] as! Bool, + logging: map["logging"] as! Bool, + framework: map["framework"] as! String, + deploymentId: map["deploymentId"] as! String, + deploymentCreatedAt: map["deploymentCreatedAt"] as! String, + deploymentScreenshotLight: map["deploymentScreenshotLight"] as! String, + deploymentScreenshotDark: map["deploymentScreenshotDark"] as! String, + latestDeploymentId: map["latestDeploymentId"] as! String, + latestDeploymentCreatedAt: map["latestDeploymentCreatedAt"] as! String, + latestDeploymentStatus: map["latestDeploymentStatus"] as! String, + vars: (map["vars"] as! [[String: Any]]).map { Variable.from(map: $0) }, + timeout: map["timeout"] as! Int, + installCommand: map["installCommand"] as! String, + buildCommand: map["buildCommand"] as! String, + outputDirectory: map["outputDirectory"] as! String, + installationId: map["installationId"] as! String, + providerRepositoryId: map["providerRepositoryId"] as! String, + providerBranch: map["providerBranch"] as! String, + providerRootDirectory: map["providerRootDirectory"] as! String, + providerSilentMode: map["providerSilentMode"] as! Bool, + specification: map["specification"] as! String, + buildRuntime: map["buildRuntime"] as! String, + adapter: map["adapter"] as! String, + fallbackFile: map["fallbackFile"] as! String + ) + } +} diff --git a/Sources/AppwriteModels/SiteList.swift b/Sources/AppwriteModels/SiteList.swift new file mode 100644 index 0000000..6c37fae --- /dev/null +++ b/Sources/AppwriteModels/SiteList.swift @@ -0,0 +1,54 @@ +import Foundation +import JSONCodable + +/// Sites List +open class SiteList: Codable { + + enum CodingKeys: String, CodingKey { + case total = "total" + case sites = "sites" + } + + /// Total number of sites documents that matched your query. + public let total: Int + + /// List of sites. + public let sites: [Site] + + + init( + total: Int, + sites: [Site] + ) { + self.total = total + self.sites = sites + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.total = try container.decode(Int.self, forKey: .total) + self.sites = try container.decode([Site].self, forKey: .sites) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try container.encode(total, forKey: .total) + try container.encode(sites, forKey: .sites) + } + + public func toMap() -> [String: Any] { + return [ + "total": total as Any, + "sites": sites.map { $0.toMap() } as Any + ] + } + + public static func from(map: [String: Any] ) -> SiteList { + return SiteList( + total: map["total"] as! Int, + sites: (map["sites"] as! [[String: Any]]).map { Site.from(map: $0) } + ) + } +} diff --git a/Sources/AppwriteModels/Variable.swift b/Sources/AppwriteModels/Variable.swift index 1e35992..662e7a3 100644 --- a/Sources/AppwriteModels/Variable.swift +++ b/Sources/AppwriteModels/Variable.swift @@ -10,6 +10,7 @@ open class Variable: Codable { case updatedAt = "$updatedAt" case key = "key" case value = "value" + case secret = "secret" case resourceType = "resourceType" case resourceId = "resourceId" } @@ -29,6 +30,9 @@ open class Variable: Codable { /// Variable value. public let value: String + /// Variable secret flag. Secret variables can only be updated or deleted, but never read. + public let secret: Bool + /// Service to which the variable belongs. Possible values are "project", "function" public let resourceType: String @@ -42,6 +46,7 @@ open class Variable: Codable { updatedAt: String, key: String, value: String, + secret: Bool, resourceType: String, resourceId: String ) { @@ -50,6 +55,7 @@ open class Variable: Codable { self.updatedAt = updatedAt self.key = key self.value = value + self.secret = secret self.resourceType = resourceType self.resourceId = resourceId } @@ -62,6 +68,7 @@ open class Variable: Codable { self.updatedAt = try container.decode(String.self, forKey: .updatedAt) self.key = try container.decode(String.self, forKey: .key) self.value = try container.decode(String.self, forKey: .value) + self.secret = try container.decode(Bool.self, forKey: .secret) self.resourceType = try container.decode(String.self, forKey: .resourceType) self.resourceId = try container.decode(String.self, forKey: .resourceId) } @@ -74,6 +81,7 @@ open class Variable: Codable { try container.encode(updatedAt, forKey: .updatedAt) try container.encode(key, forKey: .key) try container.encode(value, forKey: .value) + try container.encode(secret, forKey: .secret) try container.encode(resourceType, forKey: .resourceType) try container.encode(resourceId, forKey: .resourceId) } @@ -85,6 +93,7 @@ open class Variable: Codable { "$updatedAt": updatedAt as Any, "key": key as Any, "value": value as Any, + "secret": secret as Any, "resourceType": resourceType as Any, "resourceId": resourceId as Any ] @@ -97,6 +106,7 @@ open class Variable: Codable { updatedAt: map["$updatedAt"] as! String, key: map["key"] as! String, value: map["value"] as! String, + secret: map["secret"] as! Bool, resourceType: map["resourceType"] as! String, resourceId: map["resourceId"] as! String ) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 7db84f1..1c105c2 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -12,6 +12,6 @@ let bytes = try await avatars.getBrowser( code: .avantBrowser, width: 0, // optional height: 0, // optional - quality: 0 // optional + quality: -1 // optional ) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index aa9bafd..af7c280 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -12,6 +12,6 @@ let bytes = try await avatars.getCreditCard( code: .americanExpress, width: 0, // optional height: 0, // optional - quality: 0 // optional + quality: -1 // optional ) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index c276572..e33cbb0 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -12,6 +12,6 @@ let bytes = try await avatars.getFlag( code: .afghanistan, width: 0, // optional height: 0, // optional - quality: 0 // optional + quality: -1 // optional ) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index daeaf14..4ee2104 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,8 +2,9 @@ import Appwrite let client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID .setSession("") // The user session to authenticate with + .setKey("") // Your secret API key + .setJWT("") // Your secret JSON Web Token let databases = Databases(client) diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index f7c076e..39a58ab 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -2,8 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with + .setKey("") // Your secret API key let databases = Databases(client) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 11cbc17..7e9a620 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -14,6 +14,7 @@ let index = try await databases.createIndex( key: "", type: .key, attributes: [], - orders: [] // optional + orders: [], // optional + lengths: [] // optional ) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-duplicate-deployment.md similarity index 85% rename from docs/examples/functions/create-build.md rename to docs/examples/functions/create-duplicate-deployment.md index 22d3c43..cadf67a 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -7,7 +7,7 @@ let client = Client() let functions = Functions(client) -let result = try await functions.createBuild( +let deployment = try await functions.createDuplicateDeployment( functionId: "", deploymentId: "", buildId: "" // optional diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md new file mode 100644 index 0000000..27c5311 --- /dev/null +++ b/docs/examples/functions/create-template-deployment.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createTemplateDeployment( + functionId: "", + repository: "", + owner: "", + rootDirectory: "", + version: "", + activate: false // optional +) + diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 83ec4db..d792c67 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -10,6 +10,7 @@ let functions = Functions(client) let variable = try await functions.createVariable( functionId: "", key: "", - value: "" + value: "", + secret: false // optional ) diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000..5586722 --- /dev/null +++ b/docs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,17 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createVcsDeployment( + functionId: "", + type: .branch, + reference: "", + activate: false // optional +) + diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index aa77cc4..6f17a65 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -26,10 +26,6 @@ let function = try await functions.create( providerBranch: "", // optional providerSilentMode: false, // optional providerRootDirectory: "", // optional - templateRepository: "", // optional - templateOwner: "", // optional - templateRootDirectory: "", // optional - templateVersion: "", // optional specification: "" // optional ) diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 383a187..1feab0f 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,4 +1,5 @@ import Appwrite +import AppwriteEnums let client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -9,6 +10,7 @@ let functions = Functions(client) let bytes = try await functions.getDeploymentDownload( functionId: "", - deploymentId: "" + deploymentId: "", + type: .source // optional ) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 512c890..f0aa857 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -9,7 +9,6 @@ let functions = Functions(client) let executionList = try await functions.listExecutions( functionId: "", - queries: [], // optional - search: "" // optional + queries: [] // optional ) diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-status.md similarity index 84% rename from docs/examples/functions/update-deployment-build.md rename to docs/examples/functions/update-deployment-status.md index 8f48cac..1883199 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-status.md @@ -7,7 +7,7 @@ let client = Client() let functions = Functions(client) -let build = try await functions.updateDeploymentBuild( +let deployment = try await functions.updateDeploymentStatus( functionId: "", deploymentId: "" ) diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-function-deployment.md similarity index 84% rename from docs/examples/functions/update-deployment.md rename to docs/examples/functions/update-function-deployment.md index 313ccc4..5557d82 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -7,7 +7,7 @@ let client = Client() let functions = Functions(client) -let function = try await functions.updateDeployment( +let function = try await functions.updateFunctionDeployment( functionId: "", deploymentId: "" ) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 86eaf58..974b2ed 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -11,6 +11,7 @@ let variable = try await functions.updateVariable( functionId: "", variableId: "", key: "", - value: "" // optional + value: "", // optional + secret: false // optional ) diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md new file mode 100644 index 0000000..5730e8e --- /dev/null +++ b/docs/examples/sites/create-deployment.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createDeployment( + siteId: "", + code: InputFile.fromPath("file.png"), + activate: false, + installCommand: "", // optional + buildCommand: "", // optional + outputDirectory: "" // optional +) + diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000..0ec3804 --- /dev/null +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createDuplicateDeployment( + siteId: "", + deploymentId: "" +) + diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md new file mode 100644 index 0000000..1cb3e42 --- /dev/null +++ b/docs/examples/sites/create-template-deployment.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createTemplateDeployment( + siteId: "", + repository: "", + owner: "", + rootDirectory: "", + version: "", + activate: false // optional +) + diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md new file mode 100644 index 0000000..305a683 --- /dev/null +++ b/docs/examples/sites/create-variable.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.createVariable( + siteId: "", + key: "", + value: "", + secret: false // optional +) + diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000..d72540e --- /dev/null +++ b/docs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,17 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createVcsDeployment( + siteId: "", + type: .branch, + reference: "", + activate: false // optional +) + diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md new file mode 100644 index 0000000..1f961d0 --- /dev/null +++ b/docs/examples/sites/create.md @@ -0,0 +1,31 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.create( + siteId: "", + name: "", + framework: .analog, + buildRuntime: .node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "", // optional + buildCommand: "", // optional + outputDirectory: "", // optional + adapter: .static, // optional + installationId: "", // optional + fallbackFile: "", // optional + providerRepositoryId: "", // optional + providerBranch: "", // optional + providerSilentMode: false, // optional + providerRootDirectory: "", // optional + specification: "" // optional +) + diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md new file mode 100644 index 0000000..c4f6971 --- /dev/null +++ b/docs/examples/sites/delete-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteDeployment( + siteId: "", + deploymentId: "" +) + diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md new file mode 100644 index 0000000..1066551 --- /dev/null +++ b/docs/examples/sites/delete-log.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteLog( + siteId: "", + logId: "" +) + diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md new file mode 100644 index 0000000..a33e1c5 --- /dev/null +++ b/docs/examples/sites/delete-variable.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteVariable( + siteId: "", + variableId: "" +) + diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md new file mode 100644 index 0000000..8283f70 --- /dev/null +++ b/docs/examples/sites/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.delete( + siteId: "" +) + diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md new file mode 100644 index 0000000..5ed409c --- /dev/null +++ b/docs/examples/sites/get-deployment-download.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let bytes = try await sites.getDeploymentDownload( + siteId: "", + deploymentId: "", + type: .source // optional +) + diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md new file mode 100644 index 0000000..b9f04f3 --- /dev/null +++ b/docs/examples/sites/get-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.getDeployment( + siteId: "", + deploymentId: "" +) + diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md new file mode 100644 index 0000000..1e5c812 --- /dev/null +++ b/docs/examples/sites/get-log.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let execution = try await sites.getLog( + siteId: "", + logId: "" +) + diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md new file mode 100644 index 0000000..f9258fd --- /dev/null +++ b/docs/examples/sites/get-variable.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.getVariable( + siteId: "", + variableId: "" +) + diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md new file mode 100644 index 0000000..a14a9b7 --- /dev/null +++ b/docs/examples/sites/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.get( + siteId: "" +) + diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md new file mode 100644 index 0000000..5516b74 --- /dev/null +++ b/docs/examples/sites/list-deployments.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let deploymentList = try await sites.listDeployments( + siteId: "", + queries: [], // optional + search: "" // optional +) + diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md new file mode 100644 index 0000000..13fdf9b --- /dev/null +++ b/docs/examples/sites/list-frameworks.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let frameworkList = try await sites.listFrameworks() + diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md new file mode 100644 index 0000000..3eb2a8c --- /dev/null +++ b/docs/examples/sites/list-logs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let executionList = try await sites.listLogs( + siteId: "", + queries: [] // optional +) + diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md new file mode 100644 index 0000000..302e9ea --- /dev/null +++ b/docs/examples/sites/list-specifications.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let specificationList = try await sites.listSpecifications() + diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md new file mode 100644 index 0000000..9818224 --- /dev/null +++ b/docs/examples/sites/list-variables.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let variableList = try await sites.listVariables( + siteId: "" +) + diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md new file mode 100644 index 0000000..f330c72 --- /dev/null +++ b/docs/examples/sites/list.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let siteList = try await sites.list( + queries: [], // optional + search: "" // optional +) + diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md new file mode 100644 index 0000000..1040587 --- /dev/null +++ b/docs/examples/sites/update-deployment-status.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.updateDeploymentStatus( + siteId: "", + deploymentId: "" +) + diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md new file mode 100644 index 0000000..ce330e4 --- /dev/null +++ b/docs/examples/sites/update-site-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.updateSiteDeployment( + siteId: "", + deploymentId: "" +) + diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md new file mode 100644 index 0000000..8385c20 --- /dev/null +++ b/docs/examples/sites/update-variable.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.updateVariable( + siteId: "", + variableId: "", + key: "", + value: "", // optional + secret: false // optional +) + diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md new file mode 100644 index 0000000..e7de2fb --- /dev/null +++ b/docs/examples/sites/update.md @@ -0,0 +1,31 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.update( + siteId: "", + name: "", + framework: .analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "", // optional + buildCommand: "", // optional + outputDirectory: "", // optional + buildRuntime: .node145, // optional + adapter: .static, // optional + fallbackFile: "", // optional + installationId: "", // optional + providerRepositoryId: "", // optional + providerBranch: "", // optional + providerSilentMode: false, // optional + providerRootDirectory: "", // optional + specification: "" // optional +) + diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 5893cef..b362b08 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -9,6 +9,7 @@ let storage = Storage(client) let bytes = try await storage.getFileDownload( bucketId: "", - fileId: "" + fileId: "", + token: "" // optional ) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 874e567..d8c2380 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -14,13 +14,14 @@ let bytes = try await storage.getFilePreview( width: 0, // optional height: 0, // optional gravity: .center, // optional - quality: 0, // optional + quality: -1, // optional borderWidth: 0, // optional borderColor: "", // optional borderRadius: 0, // optional opacity: 0, // optional rotation: -360, // optional background: "", // optional - output: .jpg // optional + output: .jpg, // optional + token: "" // optional ) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 4cf7e7d..a3b94ee 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -9,6 +9,7 @@ let storage = Storage(client) let bytes = try await storage.getFileView( bucketId: "", - fileId: "" + fileId: "", + token: "" // optional ) diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md new file mode 100644 index 0000000..2bdc123 --- /dev/null +++ b/docs/examples/tokens/create-file-token.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.createFileToken( + bucketId: "", + fileId: "", + expire: "" // optional +) + diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md new file mode 100644 index 0000000..8b4db14 --- /dev/null +++ b/docs/examples/tokens/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let tokens = Tokens(client) + +let result = try await tokens.delete( + tokenId: "" +) + diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md new file mode 100644 index 0000000..d6eac81 --- /dev/null +++ b/docs/examples/tokens/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.get( + tokenId: "" +) + diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md new file mode 100644 index 0000000..8438050 --- /dev/null +++ b/docs/examples/tokens/list.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let tokens = Tokens(client) + +let resourceTokenList = try await tokens.list( + bucketId: "", + fileId: "", + queries: [] // optional +) + diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md new file mode 100644 index 0000000..14bcb30 --- /dev/null +++ b/docs/examples/tokens/update.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.update( + tokenId: "", + expire: "" // optional +) + diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 6f9999e..0ae34d4 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -8,6 +8,8 @@ let client = Client() let users = Users(client) let membershipList = try await users.listMemberships( - userId: "" + userId: "", + queries: [], // optional + search: "" // optional ) From dddb2a171ebad93dd42841208cfff00226710181 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 18 May 2025 07:37:51 +0000 Subject: [PATCH 3/3] chore: bump to next major versions --- README.md | 2 +- Sources/Appwrite/Client.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ccf74e8..417f505 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies: ```swift dependencies: [ - .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "9.2.0"), + .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "10.0.0"), ], ``` diff --git a/Sources/Appwrite/Client.swift b/Sources/Appwrite/Client.swift index 697648f..3829171 100644 --- a/Sources/Appwrite/Client.swift +++ b/Sources/Appwrite/Client.swift @@ -21,7 +21,7 @@ open class Client { "x-sdk-name": "Swift", "x-sdk-platform": "server", "x-sdk-language": "swift", - "x-sdk-version": "9.2.0", + "x-sdk-version": "10.0.0", "x-appwrite-response-format": "1.7.0" ]