From 38ef94c648fbec36669b0f9b303a68fc902c1794 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 9 Sep 2024 20:06:02 +1200 Subject: [PATCH 1/2] Fix double optional build --- Package.swift | 4 +-- README.md | 6 ++-- Sources/Appwrite/Client.swift | 10 ++++-- Sources/Appwrite/OAuth/WebAuthComponent.swift | 24 ++++++++------ Sources/Appwrite/Services/Account.swift | 20 +++++------- Sources/Appwrite/Services/Avatars.swift | 2 ++ Sources/Appwrite/Services/Functions.swift | 7 +++-- Sources/AppwriteModels/AlgoArgon2.swift | 4 +++ Sources/AppwriteModels/AlgoBcrypt.swift | 1 + Sources/AppwriteModels/AlgoMd5.swift | 1 + Sources/AppwriteModels/AlgoPhpass.swift | 1 + Sources/AppwriteModels/AlgoScrypt.swift | 5 +++ .../AppwriteModels/AlgoScryptModified.swift | 4 +++ Sources/AppwriteModels/AlgoSha.swift | 1 + Sources/AppwriteModels/Continent.swift | 2 ++ Sources/AppwriteModels/ContinentList.swift | 2 ++ Sources/AppwriteModels/Country.swift | 2 ++ Sources/AppwriteModels/CountryList.swift | 2 ++ Sources/AppwriteModels/Currency.swift | 7 +++++ Sources/AppwriteModels/CurrencyList.swift | 2 ++ Sources/AppwriteModels/Document.swift | 6 ++++ Sources/AppwriteModels/DocumentList.swift | 2 ++ Sources/AppwriteModels/Execution.swift | 30 ++++++++++++++++-- Sources/AppwriteModels/ExecutionList.swift | 2 ++ Sources/AppwriteModels/File.swift | 11 +++++++ Sources/AppwriteModels/FileList.swift | 2 ++ Sources/AppwriteModels/Headers.swift | 2 ++ Sources/AppwriteModels/Identity.swift | 10 ++++++ Sources/AppwriteModels/IdentityList.swift | 2 ++ Sources/AppwriteModels/Jwt.swift | 1 + Sources/AppwriteModels/Language.swift | 3 ++ Sources/AppwriteModels/LanguageList.swift | 2 ++ Sources/AppwriteModels/Locale.swift | 7 +++++ Sources/AppwriteModels/LocaleCode.swift | 2 ++ Sources/AppwriteModels/LocaleCodeList.swift | 2 ++ Sources/AppwriteModels/Log.swift | 21 +++++++++++++ Sources/AppwriteModels/LogList.swift | 2 ++ Sources/AppwriteModels/Membership.swift | 13 ++++++++ Sources/AppwriteModels/MembershipList.swift | 2 ++ Sources/AppwriteModels/MfaChallenge.swift | 4 +++ Sources/AppwriteModels/MfaFactors.swift | 4 +++ Sources/AppwriteModels/MfaRecoveryCodes.swift | 1 + Sources/AppwriteModels/MfaType.swift | 2 ++ Sources/AppwriteModels/Phone.swift | 3 ++ Sources/AppwriteModels/PhoneList.swift | 2 ++ Sources/AppwriteModels/Session.swift | 29 +++++++++++++++++ Sources/AppwriteModels/SessionList.swift | 2 ++ Sources/AppwriteModels/Subscriber.swift | 9 ++++++ Sources/AppwriteModels/Target.swift | 12 +++++-- Sources/AppwriteModels/Team.swift | 6 ++++ Sources/AppwriteModels/TeamList.swift | 2 ++ Sources/AppwriteModels/Token.swift | 6 ++++ Sources/AppwriteModels/User.swift | 31 +++++++++++++++---- .../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 +- .../examples/account/create-o-auth2session.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-push-target.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 | 5 ++- docs/examples/account/delete-push-target.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-push-target.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 +- docs/examples/databases/create-document.md | 2 +- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/update-document.md | 2 +- docs/examples/functions/create-execution.md | 5 +-- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/list-executions.md | 2 +- docs/examples/graphql/mutation.md | 2 +- docs/examples/graphql/query.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 +- docs/examples/messaging/create-subscriber.md | 2 +- docs/examples/messaging/delete-subscriber.md | 2 +- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-file.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-files.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 +- 148 files changed, 398 insertions(+), 140 deletions(-) diff --git a/Package.swift b/Package.swift index c7ba17d..3e916e1 100644 --- a/Package.swift +++ b/Package.swift @@ -22,8 +22,8 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.17.0"), - .package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"), + .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.19.0"), + .package(url: "https://github.com/apple/swift-nio.git", from: "2.58.0"), ], targets: [ .target( diff --git a/README.md b/README.md index 53dcbcb..b0310bc 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ ![Swift Package Manager](https://img.shields.io/github/v/release/appwrite/sdk-for-apple.svg?color=green&style=flat-square) ![License](https://img.shields.io/github/license/appwrite/sdk-for-apple.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.6-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.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.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-apple/releases).** +**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-apple/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Apple SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) @@ -31,7 +31,7 @@ Add the package to your `Package.swift` dependencies: ```swift dependencies: [ - .package(url: "git@github.com:appwrite/sdk-for-apple.git", from: "6.0.0"), + .package(url: "git@github.com:appwrite/sdk-for-apple.git", from: "7.0.0"), ], ``` diff --git a/Sources/Appwrite/Client.swift b/Sources/Appwrite/Client.swift index ea34ded..13754d1 100644 --- a/Sources/Appwrite/Client.swift +++ b/Sources/Appwrite/Client.swift @@ -23,8 +23,8 @@ open class Client { "x-sdk-name": "Apple", "x-sdk-platform": "client", "x-sdk-language": "apple", - "x-sdk-version": "6.0.0", - "x-appwrite-response-format": "1.5.0" + "x-sdk-version": "7.0.0", + "x-appwrite-response-format": "1.6.0" ] internal var config: [String: String] = [:] @@ -313,6 +313,12 @@ open class Client { timeout: .seconds(30) ) + if let warning = response.headers["x-appwrite-warning"].first { + warning.split(separator: ";").forEach { warning in + print("Warning: \(warning)") + } + } + switch response.status.code { case 0..<400: if response.headers["Set-Cookie"].count > 0 { diff --git a/Sources/Appwrite/OAuth/WebAuthComponent.swift b/Sources/Appwrite/OAuth/WebAuthComponent.swift index 9cb5da4..e8cdbd3 100644 --- a/Sources/Appwrite/OAuth/WebAuthComponent.swift +++ b/Sources/Appwrite/OAuth/WebAuthComponent.swift @@ -53,17 +53,24 @@ public class WebAuthComponent { /// - url: The URL containing the cookie /// public static func handleIncomingCookie(from url: URL) { - let components = URLComponents(string: url.absoluteString)! - let cookieParts = [String: String](uniqueKeysWithValues: components.queryItems!.map { - ($0.name, $0.value!) + guard let components = URLComponents(string: url.absoluteString), + let queryItems = components.queryItems else { + return + } + + let cookieParts = [String: String](uniqueKeysWithValues: queryItems.compactMap { item in + item.value.map { (item.name, $0) } }) - var domain = cookieParts["domain"]! + guard var domain = cookieParts["domain"], + let key = cookieParts["key"], + let secret = cookieParts["secret"] else { + return + } + domain.remove(at: domain.startIndex) - let key: String = cookieParts["key"]! - let secret: String = cookieParts["secret"]! let path: String? = cookieParts["path"] let expires: String? = cookieParts["expires"] let maxAge: String? = cookieParts["maxAge"] @@ -92,10 +99,7 @@ public class WebAuthComponent { cookie += "; secure" } - let existing = UserDefaults.standard.stringArray(forKey: domain) - let new = [cookie] - - UserDefaults.standard.set(new, forKey: domain) + UserDefaults.standard.set([cookie], forKey: domain) WebAuthComponent.onCallback( scheme: components.scheme!, diff --git a/Sources/Appwrite/Services/Account.swift b/Sources/Appwrite/Services/Account.swift index dff4046..87e1b98 100644 --- a/Sources/Appwrite/Services/Account.swift +++ b/Sources/Appwrite/Services/Account.swift @@ -290,7 +290,7 @@ open class Account: Service { /// open func createJWT( ) async throws -> AppwriteModels.Jwt { - let apiPath: String = "/account/jwt" + let apiPath: String = "/account/jwts" let apiParams: [String: Any] = [:] @@ -402,7 +402,7 @@ open class Account: Service { } /// - /// Add Authenticator + /// Create Authenticator /// /// Add an authenticator app to be used as an MFA factor. Verify the /// authenticator using the [verify @@ -443,7 +443,7 @@ open class Account: Service { /// /// Verify an authenticator app after adding it using the [add /// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) - /// method. add + /// method. /// /// @param AppwriteEnums.AuthenticatorType type /// @param String otp @@ -484,7 +484,7 @@ open class Account: Service { /// /// Verify an authenticator app after adding it using the [add /// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) - /// method. add + /// method. /// /// @param AppwriteEnums.AuthenticatorType type /// @param String otp @@ -508,20 +508,16 @@ open class Account: Service { /// Delete an authenticator for a user by ID. /// /// @param AppwriteEnums.AuthenticatorType type - /// @param String otp /// @throws Exception /// @return array /// open func deleteMfaAuthenticator( - type: AppwriteEnums.AuthenticatorType, - otp: String + type: AppwriteEnums.AuthenticatorType ) async throws -> Any { let apiPath: String = "/account/mfa/authenticators/{type}" .replacingOccurrences(of: "{type}", with: type.rawValue) - let apiParams: [String: Any?] = [ - "otp": otp - ] + let apiParams: [String: Any] = [:] let apiHeaders: [String: String] = [ "content-type": "application/json" @@ -535,7 +531,7 @@ open class Account: Service { } /// - /// Create 2FA Challenge + /// Create MFA Challenge /// /// Begin the process of MFA verification after sign-in. Finish the flow with /// [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) @@ -2037,7 +2033,7 @@ open class Account: Service { } /// - /// Create phone verification (confirmation) + /// Update phone verification (confirmation) /// /// Use this endpoint to complete the user phone verification process. Use the /// **userId** and **secret** that were sent to your user's phone number to diff --git a/Sources/Appwrite/Services/Avatars.swift b/Sources/Appwrite/Services/Avatars.swift index ffd0768..2a1d2fa 100644 --- a/Sources/Appwrite/Services/Avatars.swift +++ b/Sources/Appwrite/Services/Avatars.swift @@ -101,6 +101,7 @@ open class Avatars: Service { /// Use this endpoint to fetch the favorite icon (AKA favicon) of any remote /// website URL. /// + /// This endpoint does not follow HTTP redirects. /// /// @param String url /// @throws Exception @@ -180,6 +181,7 @@ open class Avatars: Service { /// image at source quality. If dimensions are not specified, the default size /// of image returned is 400x400px. /// + /// This endpoint does not follow HTTP redirects. /// /// @param String url /// @param Int width diff --git a/Sources/Appwrite/Services/Functions.swift b/Sources/Appwrite/Services/Functions.swift index e4e64f8..ea1b37d 100644 --- a/Sources/Appwrite/Services/Functions.swift +++ b/Sources/Appwrite/Services/Functions.swift @@ -64,6 +64,7 @@ open class Functions: Service { /// @param String path /// @param AppwriteEnums.ExecutionMethod method /// @param Any headers + /// @param String scheduledAt /// @throws Exception /// @return array /// @@ -73,7 +74,8 @@ open class Functions: Service { async: Bool? = nil, path: String? = nil, method: AppwriteEnums.ExecutionMethod? = nil, - headers: Any? = nil + headers: Any? = nil, + scheduledAt: String? = nil ) async throws -> AppwriteModels.Execution { let apiPath: String = "/functions/{functionId}/executions" .replacingOccurrences(of: "{functionId}", with: functionId) @@ -83,7 +85,8 @@ open class Functions: Service { "async": async, "path": path, "method": method, - "headers": headers + "headers": headers, + "scheduledAt": scheduledAt ] let apiHeaders: [String: String] = [ diff --git a/Sources/AppwriteModels/AlgoArgon2.swift b/Sources/AppwriteModels/AlgoArgon2.swift index c93c034..b473771 100644 --- a/Sources/AppwriteModels/AlgoArgon2.swift +++ b/Sources/AppwriteModels/AlgoArgon2.swift @@ -7,16 +7,20 @@ public class AlgoArgon2 { /// Algo type. public let type: String + /// Memory used to compute hash. public let memoryCost: Int + /// Amount of time consumed to compute hash public let timeCost: Int + /// Number of threads used to compute hash. public let threads: Int + init( type: String, memoryCost: Int, diff --git a/Sources/AppwriteModels/AlgoBcrypt.swift b/Sources/AppwriteModels/AlgoBcrypt.swift index 8d59f2d..3635cec 100644 --- a/Sources/AppwriteModels/AlgoBcrypt.swift +++ b/Sources/AppwriteModels/AlgoBcrypt.swift @@ -8,6 +8,7 @@ public class AlgoBcrypt { public let type: String + init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoMd5.swift b/Sources/AppwriteModels/AlgoMd5.swift index 050fe5c..db970a6 100644 --- a/Sources/AppwriteModels/AlgoMd5.swift +++ b/Sources/AppwriteModels/AlgoMd5.swift @@ -8,6 +8,7 @@ public class AlgoMd5 { public let type: String + init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoPhpass.swift b/Sources/AppwriteModels/AlgoPhpass.swift index 493463d..fe960fb 100644 --- a/Sources/AppwriteModels/AlgoPhpass.swift +++ b/Sources/AppwriteModels/AlgoPhpass.swift @@ -8,6 +8,7 @@ public class AlgoPhpass { public let type: String + init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoScrypt.swift b/Sources/AppwriteModels/AlgoScrypt.swift index 73254f2..8821bfb 100644 --- a/Sources/AppwriteModels/AlgoScrypt.swift +++ b/Sources/AppwriteModels/AlgoScrypt.swift @@ -7,19 +7,24 @@ public class AlgoScrypt { /// Algo type. public let type: String + /// CPU complexity of computed hash. public let costCpu: Int + /// Memory complexity of computed hash. public let costMemory: Int + /// Parallelization of computed hash. public let costParallel: Int + /// Length used to compute hash. public let length: Int + init( type: String, costCpu: Int, diff --git a/Sources/AppwriteModels/AlgoScryptModified.swift b/Sources/AppwriteModels/AlgoScryptModified.swift index bc1fde5..0adf147 100644 --- a/Sources/AppwriteModels/AlgoScryptModified.swift +++ b/Sources/AppwriteModels/AlgoScryptModified.swift @@ -7,16 +7,20 @@ public class AlgoScryptModified { /// Algo type. public let type: String + /// Salt used to compute hash. public let salt: String + /// Separator used to compute hash. public let saltSeparator: String + /// Key used to compute hash. public let signerKey: String + init( type: String, salt: String, diff --git a/Sources/AppwriteModels/AlgoSha.swift b/Sources/AppwriteModels/AlgoSha.swift index c0a0532..88d6bfc 100644 --- a/Sources/AppwriteModels/AlgoSha.swift +++ b/Sources/AppwriteModels/AlgoSha.swift @@ -8,6 +8,7 @@ public class AlgoSha { public let type: String + init( type: String ) { diff --git a/Sources/AppwriteModels/Continent.swift b/Sources/AppwriteModels/Continent.swift index f181353..7eb40b9 100644 --- a/Sources/AppwriteModels/Continent.swift +++ b/Sources/AppwriteModels/Continent.swift @@ -7,10 +7,12 @@ public class Continent { /// Continent name. public let name: String + /// Continent two letter code. public let code: String + init( name: String, code: String diff --git a/Sources/AppwriteModels/ContinentList.swift b/Sources/AppwriteModels/ContinentList.swift index 3cd7620..0b60954 100644 --- a/Sources/AppwriteModels/ContinentList.swift +++ b/Sources/AppwriteModels/ContinentList.swift @@ -7,10 +7,12 @@ public class ContinentList { /// Total number of continents documents that matched your query. public let total: Int + /// List of continents. public let continents: [Continent] + init( total: Int, continents: [Continent] diff --git a/Sources/AppwriteModels/Country.swift b/Sources/AppwriteModels/Country.swift index 3ce533b..5a79308 100644 --- a/Sources/AppwriteModels/Country.swift +++ b/Sources/AppwriteModels/Country.swift @@ -7,10 +7,12 @@ public class Country { /// Country name. public let name: String + /// Country two-character ISO 3166-1 alpha code. public let code: String + init( name: String, code: String diff --git a/Sources/AppwriteModels/CountryList.swift b/Sources/AppwriteModels/CountryList.swift index 8d120bd..622ebf0 100644 --- a/Sources/AppwriteModels/CountryList.swift +++ b/Sources/AppwriteModels/CountryList.swift @@ -7,10 +7,12 @@ public class CountryList { /// Total number of countries documents that matched your query. public let total: Int + /// List of countries. public let countries: [Country] + init( total: Int, countries: [Country] diff --git a/Sources/AppwriteModels/Currency.swift b/Sources/AppwriteModels/Currency.swift index d93ce0c..7ec64d2 100644 --- a/Sources/AppwriteModels/Currency.swift +++ b/Sources/AppwriteModels/Currency.swift @@ -7,25 +7,32 @@ public class Currency { /// Currency symbol. public let symbol: String + /// Currency name. public let name: String + /// Currency native symbol. public let symbolNative: String + /// Number of decimal digits. public let decimalDigits: Int + /// Currency digit rounding. public let rounding: Double + /// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. public let code: String + /// Currency plural name public let namePlural: String + init( symbol: String, name: String, diff --git a/Sources/AppwriteModels/CurrencyList.swift b/Sources/AppwriteModels/CurrencyList.swift index a2e9f00..e42d9ad 100644 --- a/Sources/AppwriteModels/CurrencyList.swift +++ b/Sources/AppwriteModels/CurrencyList.swift @@ -7,10 +7,12 @@ public class CurrencyList { /// Total number of currencies documents that matched your query. public let total: Int + /// List of currencies. public let currencies: [Currency] + init( total: Int, currencies: [Currency] diff --git a/Sources/AppwriteModels/Document.swift b/Sources/AppwriteModels/Document.swift index 94069f9..20a4f86 100644 --- a/Sources/AppwriteModels/Document.swift +++ b/Sources/AppwriteModels/Document.swift @@ -7,21 +7,27 @@ public class Document { /// Document ID. public let id: String + /// Collection ID. public let collectionId: String + /// Database ID. public let databaseId: String + /// Document creation date in ISO 8601 format. public let createdAt: String + /// Document update date in ISO 8601 format. public let updatedAt: String + /// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). public let permissions: [Any] + /// Additional properties public let data: T diff --git a/Sources/AppwriteModels/DocumentList.swift b/Sources/AppwriteModels/DocumentList.swift index 4a573fe..e71c5ad 100644 --- a/Sources/AppwriteModels/DocumentList.swift +++ b/Sources/AppwriteModels/DocumentList.swift @@ -7,10 +7,12 @@ public class DocumentList { /// Total number of documents documents that matched your query. public let total: Int + /// List of documents. public let documents: [Document] + init( total: Int, documents: [Document] diff --git a/Sources/AppwriteModels/Execution.swift b/Sources/AppwriteModels/Execution.swift index 2cb6d9a..9301a8b 100644 --- a/Sources/AppwriteModels/Execution.swift +++ b/Sources/AppwriteModels/Execution.swift @@ -7,52 +7,72 @@ public class Execution { /// Execution ID. public let id: String + /// Execution creation date in ISO 8601 format. public let createdAt: String + /// Execution upate date in ISO 8601 format. public let updatedAt: String + /// Execution roles. public let permissions: [Any] + /// Function ID. public let functionId: String + /// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. public let trigger: String + /// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`. public let status: String + /// HTTP request method type. public let requestMethod: String + /// HTTP request path and query. public let requestPath: String + /// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. public let requestHeaders: [Headers] + /// HTTP response status code. public let responseStatusCode: Int + /// HTTP response body. This will return empty unless execution is created as synchronous. public let responseBody: String + /// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. public let responseHeaders: [Headers] + /// Function logs. 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 logs: String + /// 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. public let duration: Double + /// The scheduled time for execution. If left empty, execution will be queued immediately. + public let scheduledAt: String? + + + init( id: String, createdAt: String, @@ -69,7 +89,8 @@ public class Execution { responseHeaders: [Headers], logs: String, errors: String, - duration: Double + duration: Double, + scheduledAt: String? ) { self.id = id self.createdAt = createdAt @@ -87,6 +108,7 @@ public class Execution { self.logs = logs self.errors = errors self.duration = duration + self.scheduledAt = scheduledAt } public func toMap() -> [String: Any] { @@ -106,7 +128,8 @@ public class Execution { "responseHeaders": responseHeaders.map { $0.toMap() } as Any, "logs": logs as Any, "errors": errors as Any, - "duration": duration as Any + "duration": duration as Any, + "scheduledAt": scheduledAt as Any ] } @@ -127,7 +150,8 @@ public class Execution { responseHeaders: (map["responseHeaders"] as! [[String: Any]]).map { Headers.from(map: $0) }, logs: map["logs"] as! String, errors: map["errors"] as! String, - duration: map["duration"] as! Double + duration: map["duration"] as! Double, + scheduledAt: map["scheduledAt"] as? String? ) } } diff --git a/Sources/AppwriteModels/ExecutionList.swift b/Sources/AppwriteModels/ExecutionList.swift index 8a502d9..ae92f73 100644 --- a/Sources/AppwriteModels/ExecutionList.swift +++ b/Sources/AppwriteModels/ExecutionList.swift @@ -7,10 +7,12 @@ public class ExecutionList { /// Total number of executions documents that matched your query. public let total: Int + /// List of executions. public let executions: [Execution] + init( total: Int, executions: [Execution] diff --git a/Sources/AppwriteModels/File.swift b/Sources/AppwriteModels/File.swift index 04a5b89..e1669ec 100644 --- a/Sources/AppwriteModels/File.swift +++ b/Sources/AppwriteModels/File.swift @@ -7,37 +7,48 @@ public class File { /// File ID. public let id: String + /// Bucket ID. public let bucketId: String + /// File creation date in ISO 8601 format. public let createdAt: String + /// File update date in ISO 8601 format. public let updatedAt: String + /// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). public let permissions: [Any] + /// File name. public let name: String + /// File MD5 signature. public let signature: String + /// File mime type. public let mimeType: String + /// File original size in bytes. public let sizeOriginal: Int + /// Total number of chunks available public let chunksTotal: Int + /// Total number of chunks uploaded public let chunksUploaded: Int + init( id: String, bucketId: String, diff --git a/Sources/AppwriteModels/FileList.swift b/Sources/AppwriteModels/FileList.swift index 0d6ad88..51dbd44 100644 --- a/Sources/AppwriteModels/FileList.swift +++ b/Sources/AppwriteModels/FileList.swift @@ -7,10 +7,12 @@ public class FileList { /// Total number of files documents that matched your query. public let total: Int + /// List of files. public let files: [File] + init( total: Int, files: [File] diff --git a/Sources/AppwriteModels/Headers.swift b/Sources/AppwriteModels/Headers.swift index 6f554ac..aa1a95f 100644 --- a/Sources/AppwriteModels/Headers.swift +++ b/Sources/AppwriteModels/Headers.swift @@ -7,10 +7,12 @@ public class Headers { /// Header name. public let name: String + /// Header value. public let value: String + init( name: String, value: String diff --git a/Sources/AppwriteModels/Identity.swift b/Sources/AppwriteModels/Identity.swift index fb54237..0c7d09e 100644 --- a/Sources/AppwriteModels/Identity.swift +++ b/Sources/AppwriteModels/Identity.swift @@ -7,34 +7,44 @@ public class Identity { /// Identity ID. public let id: String + /// Identity creation date in ISO 8601 format. public let createdAt: String + /// Identity update date in ISO 8601 format. public let updatedAt: String + /// User ID. public let userId: String + /// Identity Provider. public let provider: String + /// ID of the User in the Identity Provider. public let providerUid: String + /// Email of the User in the Identity Provider. public let providerEmail: String + /// Identity Provider Access Token. public let providerAccessToken: String + /// The date of when the access token expires in ISO 8601 format. public let providerAccessTokenExpiry: String + /// Identity Provider Refresh Token. public let providerRefreshToken: String + init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/IdentityList.swift b/Sources/AppwriteModels/IdentityList.swift index b068f4c..a6c3477 100644 --- a/Sources/AppwriteModels/IdentityList.swift +++ b/Sources/AppwriteModels/IdentityList.swift @@ -7,10 +7,12 @@ public class IdentityList { /// Total number of identities documents that matched your query. public let total: Int + /// List of identities. public let identities: [Identity] + init( total: Int, identities: [Identity] diff --git a/Sources/AppwriteModels/Jwt.swift b/Sources/AppwriteModels/Jwt.swift index 5778435..902f5b2 100644 --- a/Sources/AppwriteModels/Jwt.swift +++ b/Sources/AppwriteModels/Jwt.swift @@ -8,6 +8,7 @@ public class Jwt { public let jwt: String + init( jwt: String ) { diff --git a/Sources/AppwriteModels/Language.swift b/Sources/AppwriteModels/Language.swift index f385d5a..3111149 100644 --- a/Sources/AppwriteModels/Language.swift +++ b/Sources/AppwriteModels/Language.swift @@ -7,13 +7,16 @@ public class Language { /// Language name. public let name: String + /// Language two-character ISO 639-1 codes. public let code: String + /// Language native name. public let nativeName: String + init( name: String, code: String, diff --git a/Sources/AppwriteModels/LanguageList.swift b/Sources/AppwriteModels/LanguageList.swift index b4515e3..acba750 100644 --- a/Sources/AppwriteModels/LanguageList.swift +++ b/Sources/AppwriteModels/LanguageList.swift @@ -7,10 +7,12 @@ public class LanguageList { /// Total number of languages documents that matched your query. public let total: Int + /// List of languages. public let languages: [Language] + init( total: Int, languages: [Language] diff --git a/Sources/AppwriteModels/Locale.swift b/Sources/AppwriteModels/Locale.swift index 7445776..2f4d046 100644 --- a/Sources/AppwriteModels/Locale.swift +++ b/Sources/AppwriteModels/Locale.swift @@ -7,25 +7,32 @@ public class Locale { /// User IP address. public let ip: String + /// Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format public let countryCode: String + /// Country name. This field support localization. public let country: String + /// Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. public let continentCode: String + /// Continent name. This field support localization. public let continent: String + /// True if country is part of the European Union. public let eu: Bool + /// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format public let currency: String + init( ip: String, countryCode: String, diff --git a/Sources/AppwriteModels/LocaleCode.swift b/Sources/AppwriteModels/LocaleCode.swift index 8e561c7..2d6185e 100644 --- a/Sources/AppwriteModels/LocaleCode.swift +++ b/Sources/AppwriteModels/LocaleCode.swift @@ -7,10 +7,12 @@ public class LocaleCode { /// Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) public let code: String + /// Locale name public let name: String + init( code: String, name: String diff --git a/Sources/AppwriteModels/LocaleCodeList.swift b/Sources/AppwriteModels/LocaleCodeList.swift index 895ef7d..dca47d8 100644 --- a/Sources/AppwriteModels/LocaleCodeList.swift +++ b/Sources/AppwriteModels/LocaleCodeList.swift @@ -7,10 +7,12 @@ public class LocaleCodeList { /// Total number of localeCodes documents that matched your query. public let total: Int + /// List of localeCodes. public let localeCodes: [LocaleCode] + init( total: Int, localeCodes: [LocaleCode] diff --git a/Sources/AppwriteModels/Log.swift b/Sources/AppwriteModels/Log.swift index df5464d..bf0135e 100644 --- a/Sources/AppwriteModels/Log.swift +++ b/Sources/AppwriteModels/Log.swift @@ -7,67 +7,88 @@ public class Log { /// Event name. public let event: String + /// User ID. public let userId: String + /// User Email. public let userEmail: String + /// User Name. public let userName: String + /// API mode when event triggered. public let mode: String + /// IP session in use when the session was created. public let ip: String + /// Log creation date in ISO 8601 format. public let time: String + /// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). public let osCode: String + /// Operating system name. public let osName: String + /// Operating system version. public let osVersion: String + /// Client type. public let clientType: String + /// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). public let clientCode: String + /// Client name. public let clientName: String + /// Client version. public let clientVersion: String + /// Client engine name. public let clientEngine: String + /// Client engine name. public let clientEngineVersion: String + /// Device name. public let deviceName: String + /// Device brand name. public let deviceBrand: String + /// Device model name. public let deviceModel: String + /// Country two-character ISO 3166-1 alpha code. public let countryCode: String + /// Country name. public let countryName: String + init( event: String, userId: String, diff --git a/Sources/AppwriteModels/LogList.swift b/Sources/AppwriteModels/LogList.swift index 2f99674..241f775 100644 --- a/Sources/AppwriteModels/LogList.swift +++ b/Sources/AppwriteModels/LogList.swift @@ -7,10 +7,12 @@ public class LogList { /// Total number of logs documents that matched your query. public let total: Int + /// List of logs. public let logs: [Log] + init( total: Int, logs: [Log] diff --git a/Sources/AppwriteModels/Membership.swift b/Sources/AppwriteModels/Membership.swift index 55fb199..176b746 100644 --- a/Sources/AppwriteModels/Membership.swift +++ b/Sources/AppwriteModels/Membership.swift @@ -7,43 +7,56 @@ public class Membership { /// Membership ID. public let id: String + /// Membership creation date in ISO 8601 format. public let createdAt: String + /// Membership update date in ISO 8601 format. public let updatedAt: String + /// User ID. public let userId: String + /// User name. public let userName: String + /// User email address. public let userEmail: String + /// Team ID. public let teamId: String + /// Team name. public let teamName: String + /// Date, the user has been invited to join the team in ISO 8601 format. public let invited: String + /// Date, the user has accepted the invitation to join the team in ISO 8601 format. public let joined: String + /// User confirmation status, true if the user has joined the team or false otherwise. public let confirm: Bool + /// Multi factor authentication status, true if the user has MFA enabled or false otherwise. public let mfa: Bool + /// User list of roles public let roles: [Any] + init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/MembershipList.swift b/Sources/AppwriteModels/MembershipList.swift index f27cc99..5218b20 100644 --- a/Sources/AppwriteModels/MembershipList.swift +++ b/Sources/AppwriteModels/MembershipList.swift @@ -7,10 +7,12 @@ public class MembershipList { /// Total number of memberships documents that matched your query. public let total: Int + /// List of memberships. public let memberships: [Membership] + init( total: Int, memberships: [Membership] diff --git a/Sources/AppwriteModels/MfaChallenge.swift b/Sources/AppwriteModels/MfaChallenge.swift index 5a1e874..6d7481b 100644 --- a/Sources/AppwriteModels/MfaChallenge.swift +++ b/Sources/AppwriteModels/MfaChallenge.swift @@ -7,16 +7,20 @@ public class MfaChallenge { /// Token ID. public let id: String + /// Token creation date in ISO 8601 format. public let createdAt: String + /// User ID. public let userId: String + /// Token expiration date in ISO 8601 format. public let expire: String + init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/MfaFactors.swift b/Sources/AppwriteModels/MfaFactors.swift index 716c055..88adf5e 100644 --- a/Sources/AppwriteModels/MfaFactors.swift +++ b/Sources/AppwriteModels/MfaFactors.swift @@ -7,16 +7,20 @@ public class MfaFactors { /// Can TOTP be used for MFA challenge for this account. public let totp: Bool + /// Can phone (SMS) be used for MFA challenge for this account. public let phone: Bool + /// Can email be used for MFA challenge for this account. public let email: Bool + /// Can recovery code be used for MFA challenge for this account. public let recoveryCode: Bool + init( totp: Bool, phone: Bool, diff --git a/Sources/AppwriteModels/MfaRecoveryCodes.swift b/Sources/AppwriteModels/MfaRecoveryCodes.swift index 8dd063b..8b57721 100644 --- a/Sources/AppwriteModels/MfaRecoveryCodes.swift +++ b/Sources/AppwriteModels/MfaRecoveryCodes.swift @@ -8,6 +8,7 @@ public class MfaRecoveryCodes { public let recoveryCodes: [Any] + init( recoveryCodes: [Any] ) { diff --git a/Sources/AppwriteModels/MfaType.swift b/Sources/AppwriteModels/MfaType.swift index 503134f..80c3526 100644 --- a/Sources/AppwriteModels/MfaType.swift +++ b/Sources/AppwriteModels/MfaType.swift @@ -7,10 +7,12 @@ public class MfaType { /// Secret token used for TOTP factor. public let secret: String + /// URI for authenticator apps. public let uri: String + init( secret: String, uri: String diff --git a/Sources/AppwriteModels/Phone.swift b/Sources/AppwriteModels/Phone.swift index 2e113b4..a1bb096 100644 --- a/Sources/AppwriteModels/Phone.swift +++ b/Sources/AppwriteModels/Phone.swift @@ -7,13 +7,16 @@ public class Phone { /// Phone code. public let code: String + /// Country two-character ISO 3166-1 alpha code. public let countryCode: String + /// Country name. public let countryName: String + init( code: String, countryCode: String, diff --git a/Sources/AppwriteModels/PhoneList.swift b/Sources/AppwriteModels/PhoneList.swift index 38a5a6f..6918afa 100644 --- a/Sources/AppwriteModels/PhoneList.swift +++ b/Sources/AppwriteModels/PhoneList.swift @@ -7,10 +7,12 @@ public class PhoneList { /// Total number of phones documents that matched your query. public let total: Int + /// List of phones. public let phones: [Phone] + init( total: Int, phones: [Phone] diff --git a/Sources/AppwriteModels/Session.swift b/Sources/AppwriteModels/Session.swift index 7214468..c6aca5b 100644 --- a/Sources/AppwriteModels/Session.swift +++ b/Sources/AppwriteModels/Session.swift @@ -7,91 +7,120 @@ public class Session { /// Session ID. public let id: String + /// Session creation date in ISO 8601 format. public let createdAt: String + /// Session update date in ISO 8601 format. public let updatedAt: String + /// User ID. public let userId: String + /// Session expiration date in ISO 8601 format. public let expire: String + /// Session Provider. public let provider: String + /// Session Provider User ID. public let providerUid: String + /// Session Provider Access Token. public let providerAccessToken: String + /// The date of when the access token expires in ISO 8601 format. public let providerAccessTokenExpiry: String + /// Session Provider Refresh Token. public let providerRefreshToken: String + /// IP in use when the session was created. public let ip: String + /// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). public let osCode: String + /// Operating system name. public let osName: String + /// Operating system version. public let osVersion: String + /// Client type. public let clientType: String + /// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). public let clientCode: String + /// Client name. public let clientName: String + /// Client version. public let clientVersion: String + /// Client engine name. public let clientEngine: String + /// Client engine name. public let clientEngineVersion: String + /// Device name. public let deviceName: String + /// Device brand name. public let deviceBrand: String + /// Device model name. public let deviceModel: String + /// Country two-character ISO 3166-1 alpha code. public let countryCode: String + /// Country name. public let countryName: String + /// Returns true if this the current user session. public let current: Bool + /// Returns a list of active session factors. public let factors: [Any] + /// Secret used to authenticate the user. Only included if the request was made with an API key public let secret: String + /// Most recent date in ISO 8601 format when the session successfully passed MFA challenge. public let mfaUpdatedAt: String + init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/SessionList.swift b/Sources/AppwriteModels/SessionList.swift index 409f72a..c526af9 100644 --- a/Sources/AppwriteModels/SessionList.swift +++ b/Sources/AppwriteModels/SessionList.swift @@ -7,10 +7,12 @@ public class SessionList { /// Total number of sessions documents that matched your query. public let total: Int + /// List of sessions. public let sessions: [Session] + init( total: Int, sessions: [Session] diff --git a/Sources/AppwriteModels/Subscriber.swift b/Sources/AppwriteModels/Subscriber.swift index 5ab202d..f990bb4 100644 --- a/Sources/AppwriteModels/Subscriber.swift +++ b/Sources/AppwriteModels/Subscriber.swift @@ -7,31 +7,40 @@ public class Subscriber { /// Subscriber ID. public let id: String + /// Subscriber creation time in ISO 8601 format. public let createdAt: String + /// Subscriber update date in ISO 8601 format. public let updatedAt: String + /// Target ID. public let targetId: String + /// Target. public let target: Target + /// Topic ID. public let userId: String + /// User Name. public let userName: String + /// Topic ID. public let topicId: String + /// The target provider type. Can be one of the following: `email`, `sms` or `push`. public let providerType: String + init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/Target.swift b/Sources/AppwriteModels/Target.swift index 5974e3d..eaaf267 100644 --- a/Sources/AppwriteModels/Target.swift +++ b/Sources/AppwriteModels/Target.swift @@ -7,35 +7,43 @@ public class Target { /// Target ID. public let id: String + /// Target creation time in ISO 8601 format. public let createdAt: String + /// Target update date in ISO 8601 format. public let updatedAt: String + /// Target Name. public let name: String + /// User ID. public let userId: String + /// Provider ID. - public let providerId: String?? + public let providerId: String? + /// The target provider type. Can be one of the following: `email`, `sms` or `push`. public let providerType: String + /// The target identifier. public let identifier: String + init( id: String, createdAt: String, updatedAt: String, name: String, userId: String, - providerId: String??, + providerId: String?, providerType: String, identifier: String ) { diff --git a/Sources/AppwriteModels/Team.swift b/Sources/AppwriteModels/Team.swift index a44c305..9830c39 100644 --- a/Sources/AppwriteModels/Team.swift +++ b/Sources/AppwriteModels/Team.swift @@ -7,22 +7,28 @@ public class Team { /// Team ID. public let id: String + /// Team creation date in ISO 8601 format. public let createdAt: String + /// Team update date in ISO 8601 format. public let updatedAt: String + /// Team name. public let name: String + /// Total number of team members. public let total: Int + /// Team preferences as a key-value object public let prefs: Preferences + init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/TeamList.swift b/Sources/AppwriteModels/TeamList.swift index ec7e0bd..2934a13 100644 --- a/Sources/AppwriteModels/TeamList.swift +++ b/Sources/AppwriteModels/TeamList.swift @@ -7,10 +7,12 @@ public class TeamList { /// Total number of teams documents that matched your query. public let total: Int + /// List of teams. public let teams: [Team] + init( total: Int, teams: [Team] diff --git a/Sources/AppwriteModels/Token.swift b/Sources/AppwriteModels/Token.swift index 31d4b4a..5facdef 100644 --- a/Sources/AppwriteModels/Token.swift +++ b/Sources/AppwriteModels/Token.swift @@ -7,22 +7,28 @@ public class Token { /// Token ID. public let id: String + /// Token creation date in ISO 8601 format. public let createdAt: String + /// User ID. public let userId: String + /// Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. public let secret: String + /// Token expiration date in ISO 8601 format. public let expire: String + /// Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. public let phrase: String + init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/User.swift b/Sources/AppwriteModels/User.swift index a6d44be..a087357 100644 --- a/Sources/AppwriteModels/User.swift +++ b/Sources/AppwriteModels/User.swift @@ -7,69 +7,88 @@ public class User { /// User ID. public let id: String + /// User creation date in ISO 8601 format. public let createdAt: String + /// User update date in ISO 8601 format. public let updatedAt: String + /// User name. public let name: String + /// Hashed user password. - public let password: String?? + public let password: String? + /// Password hashing algorithm. - public let hash: String?? + public let hash: String? + /// Password hashing algorithm configuration. - public let hashOptions: Any?? + public let hashOptions: Any? + /// User registration date in ISO 8601 format. public let registration: String + /// User status. Pass `true` for enabled and `false` for disabled. public let status: Bool + /// Labels for the user. public let labels: [Any] + /// Password update time in ISO 8601 format. public let passwordUpdate: String + /// User email address. public let email: String + /// User phone number in E.164 format. public let phone: String + /// Email verification status. public let emailVerification: Bool + /// Phone verification status. public let phoneVerification: Bool + /// Multi factor authentication status. public let mfa: Bool + /// User preferences as a key-value object public let prefs: Preferences + /// A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. public let targets: [Target] + /// 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, updatedAt: String, name: String, - password: String??, - hash: String??, - hashOptions: Any??, + password: String?, + hash: String?, + hashOptions: Any?, registration: String, status: Bool, labels: [Any], diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 9904f6f..f676bac 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 8740f0c..1505182 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 40535d5..b9d39ff 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 c18c3c9..c1c0f22 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 1fd7360..83eb681 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 2146831..7b103e0 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 4045203..6d262d9 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 c49dca5..1390b9d 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md index e7d6a53..32da4a2 100644 --- a/docs/examples/account/create-o-auth2session.md +++ b/docs/examples/account/create-o-auth2session.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 677450e..7bbfe98 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 a0c3a8c..acb7a69 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 b628897..e0c4a21 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md index 3613526..75d694b 100644 --- a/docs/examples/account/create-push-target.md +++ b/docs/examples/account/create-push-target.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 8d48938..65536ee 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 4ed985d..3ea5119 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 2c96d20..702c3c5 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index e7caef4..cad7e44 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 335f4f7..37ca520 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 8fef773..d9fe0ad 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -3,12 +3,11 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) let result = try await account.deleteMfaAuthenticator( - type: .totp, - otp: "" + type: .totp ) diff --git a/docs/examples/account/delete-push-target.md b/docs/examples/account/delete-push-target.md index 9090710..660a9c0 100644 --- a/docs/examples/account/delete-push-target.md +++ b/docs/examples/account/delete-push-target.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index d7f13e3..59f89a9 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index efb8c7c..bfce736 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 80b9550..79e3a2c 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 5a9fb2e..0e7909b 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 63cb9e2..3ed89fc 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index f29f83f..2a0c2a5 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index da9592c..4d8c580 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index a90e2cb..ecb5617 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index df34b64..3af3427 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index b160c89..8b9e165 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index a8c37af..4dbd335 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 82fded7..eefcd79 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) 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 6950792..8e0a26a 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 de64595..8ef2b24 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 109c7ba..a237537 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 76b3835..fb5ea5a 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 7a493db..893d96c 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index cf27be3..60737dc 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 71d404e..50a88cb 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .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 13dcb2f..045ba8d 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 306e8f5..b43b975 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index cc76548..ea49c34 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md index 3457646..351801e 100644 --- a/docs/examples/account/update-push-target.md +++ b/docs/examples/account/update-push-target.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index aec1291..1e50a14 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index b879ab7..5fe7116 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 3f2d823..a7f99c3 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 57441c9..c17a787 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let account = Account(client) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 0c4a194..e18a2b2 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let avatars = Avatars(client) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 08a8930..94a7bf6 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let avatars = Avatars(client) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 0e72f0b..95af5f5 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let avatars = Avatars(client) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 22d77fd..b79cf57 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let avatars = Avatars(client) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 13e756a..f01e21b 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let avatars = Avatars(client) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 482be2c..8593288 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let avatars = Avatars(client) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index d03d79a..370209a 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let avatars = Avatars(client) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 5631b7a..1dff362 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let databases = Databases(client) diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 4926bd6..80ca2eb 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let databases = Databases(client) diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index bd5c446..fa7aeb9 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let databases = Databases(client) diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index c2377bd..6b2cbbc 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let databases = Databases(client) diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 9de18fd..2260272 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let databases = Databases(client) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index f74bd53..6d585ea 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let functions = Functions(client) @@ -13,6 +13,7 @@ let execution = try await functions.createExecution( async: false, // optional path: "", // optional method: .gET, // optional - headers: [:] // optional + headers: [:], // optional + scheduledAt: "" // optional ) diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index e478988..dbf12e1 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let functions = Functions(client) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 618fea3..4eb2694 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let functions = Functions(client) diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index d58b881..8e54971 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let graphql = Graphql(client) diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 0aba98a..db93660 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let graphql = Graphql(client) diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index d12470d..ec071cd 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 5832aa4..adb3539 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 4853f77..934b264 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 6e0a4d3..393e523 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index b4752eb..840e904 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 75369d0..e6adb9e 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 92eea81..b34a971 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 2184812..db41d39 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let locale = Locale(client) diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 9c25454..0e3793b 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 1f5baab..3a8b7c4 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let messaging = Messaging(client) diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 6f467aa..2e5b945 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 30d6721..caeb173 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index bc7521a..3d8bf6b 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 4d16f20..17e42f9 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -3,7 +3,7 @@ import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 9edf46b..e62afb7 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index f077988..367fd39 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index bc1129e..3996ba7 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index eaeb5da..37a3001 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let storage = Storage(client) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 0325790..e911b2a 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index e530702..b355a63 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 8cd8a9a..8252272 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 34edd05..1caee83 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 9365dcd..62e3a51 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 08e9063..04ece54 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index d5e956a..c5673bd 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index bde4f9b..e85b11c 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index c7ed8d4..c5e7175 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index b76670b..c50ef0e 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 85a7cb5..c4500a3 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index a7e117a..64e2cab 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 469ba86..a69d485 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -2,7 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setProject("") // Your project ID let teams = Teams(client) From 82c6832b8c968077162324f57ac0606ef9f94787 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 9 Sep 2024 20:27:58 +1200 Subject: [PATCH 2/2] Fix double optional --- CHANGELOG.md | 2 +- Sources/AppwriteModels/AlgoArgon2.swift | 4 --- Sources/AppwriteModels/AlgoBcrypt.swift | 1 - Sources/AppwriteModels/AlgoMd5.swift | 1 - Sources/AppwriteModels/AlgoPhpass.swift | 1 - Sources/AppwriteModels/AlgoScrypt.swift | 5 ---- .../AppwriteModels/AlgoScryptModified.swift | 4 --- Sources/AppwriteModels/AlgoSha.swift | 1 - Sources/AppwriteModels/Continent.swift | 2 -- Sources/AppwriteModels/ContinentList.swift | 2 -- Sources/AppwriteModels/Country.swift | 2 -- Sources/AppwriteModels/CountryList.swift | 2 -- Sources/AppwriteModels/Currency.swift | 7 ----- Sources/AppwriteModels/CurrencyList.swift | 2 -- Sources/AppwriteModels/Document.swift | 6 ---- Sources/AppwriteModels/DocumentList.swift | 2 -- Sources/AppwriteModels/Execution.swift | 19 +----------- Sources/AppwriteModels/ExecutionList.swift | 2 -- Sources/AppwriteModels/File.swift | 11 ------- Sources/AppwriteModels/FileList.swift | 2 -- Sources/AppwriteModels/Headers.swift | 2 -- Sources/AppwriteModels/Identity.swift | 10 ------- Sources/AppwriteModels/IdentityList.swift | 2 -- Sources/AppwriteModels/Jwt.swift | 1 - Sources/AppwriteModels/Language.swift | 3 -- Sources/AppwriteModels/LanguageList.swift | 2 -- Sources/AppwriteModels/Locale.swift | 7 ----- Sources/AppwriteModels/LocaleCode.swift | 2 -- Sources/AppwriteModels/LocaleCodeList.swift | 2 -- Sources/AppwriteModels/Log.swift | 21 -------------- Sources/AppwriteModels/LogList.swift | 2 -- Sources/AppwriteModels/Membership.swift | 13 --------- Sources/AppwriteModels/MembershipList.swift | 2 -- Sources/AppwriteModels/MfaChallenge.swift | 4 --- Sources/AppwriteModels/MfaFactors.swift | 4 --- Sources/AppwriteModels/MfaRecoveryCodes.swift | 1 - Sources/AppwriteModels/MfaType.swift | 2 -- Sources/AppwriteModels/Phone.swift | 3 -- Sources/AppwriteModels/PhoneList.swift | 2 -- Sources/AppwriteModels/Session.swift | 29 ------------------- Sources/AppwriteModels/SessionList.swift | 2 -- Sources/AppwriteModels/Subscriber.swift | 9 ------ Sources/AppwriteModels/Target.swift | 10 +------ Sources/AppwriteModels/Team.swift | 6 ---- Sources/AppwriteModels/TeamList.swift | 2 -- Sources/AppwriteModels/Token.swift | 6 ---- Sources/AppwriteModels/User.swift | 25 ++-------------- 47 files changed, 6 insertions(+), 246 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb2619f..fa4d35e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -# Change Log +# Change Log \ No newline at end of file diff --git a/Sources/AppwriteModels/AlgoArgon2.swift b/Sources/AppwriteModels/AlgoArgon2.swift index b473771..c93c034 100644 --- a/Sources/AppwriteModels/AlgoArgon2.swift +++ b/Sources/AppwriteModels/AlgoArgon2.swift @@ -7,20 +7,16 @@ public class AlgoArgon2 { /// Algo type. public let type: String - /// Memory used to compute hash. public let memoryCost: Int - /// Amount of time consumed to compute hash public let timeCost: Int - /// Number of threads used to compute hash. public let threads: Int - init( type: String, memoryCost: Int, diff --git a/Sources/AppwriteModels/AlgoBcrypt.swift b/Sources/AppwriteModels/AlgoBcrypt.swift index 3635cec..8d59f2d 100644 --- a/Sources/AppwriteModels/AlgoBcrypt.swift +++ b/Sources/AppwriteModels/AlgoBcrypt.swift @@ -8,7 +8,6 @@ public class AlgoBcrypt { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoMd5.swift b/Sources/AppwriteModels/AlgoMd5.swift index db970a6..050fe5c 100644 --- a/Sources/AppwriteModels/AlgoMd5.swift +++ b/Sources/AppwriteModels/AlgoMd5.swift @@ -8,7 +8,6 @@ public class AlgoMd5 { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoPhpass.swift b/Sources/AppwriteModels/AlgoPhpass.swift index fe960fb..493463d 100644 --- a/Sources/AppwriteModels/AlgoPhpass.swift +++ b/Sources/AppwriteModels/AlgoPhpass.swift @@ -8,7 +8,6 @@ public class AlgoPhpass { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoScrypt.swift b/Sources/AppwriteModels/AlgoScrypt.swift index 8821bfb..73254f2 100644 --- a/Sources/AppwriteModels/AlgoScrypt.swift +++ b/Sources/AppwriteModels/AlgoScrypt.swift @@ -7,24 +7,19 @@ public class AlgoScrypt { /// Algo type. public let type: String - /// CPU complexity of computed hash. public let costCpu: Int - /// Memory complexity of computed hash. public let costMemory: Int - /// Parallelization of computed hash. public let costParallel: Int - /// Length used to compute hash. public let length: Int - init( type: String, costCpu: Int, diff --git a/Sources/AppwriteModels/AlgoScryptModified.swift b/Sources/AppwriteModels/AlgoScryptModified.swift index 0adf147..bc1fde5 100644 --- a/Sources/AppwriteModels/AlgoScryptModified.swift +++ b/Sources/AppwriteModels/AlgoScryptModified.swift @@ -7,20 +7,16 @@ public class AlgoScryptModified { /// Algo type. public let type: String - /// Salt used to compute hash. public let salt: String - /// Separator used to compute hash. public let saltSeparator: String - /// Key used to compute hash. public let signerKey: String - init( type: String, salt: String, diff --git a/Sources/AppwriteModels/AlgoSha.swift b/Sources/AppwriteModels/AlgoSha.swift index 88d6bfc..c0a0532 100644 --- a/Sources/AppwriteModels/AlgoSha.swift +++ b/Sources/AppwriteModels/AlgoSha.swift @@ -8,7 +8,6 @@ public class AlgoSha { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/Continent.swift b/Sources/AppwriteModels/Continent.swift index 7eb40b9..f181353 100644 --- a/Sources/AppwriteModels/Continent.swift +++ b/Sources/AppwriteModels/Continent.swift @@ -7,12 +7,10 @@ public class Continent { /// Continent name. public let name: String - /// Continent two letter code. public let code: String - init( name: String, code: String diff --git a/Sources/AppwriteModels/ContinentList.swift b/Sources/AppwriteModels/ContinentList.swift index 0b60954..3cd7620 100644 --- a/Sources/AppwriteModels/ContinentList.swift +++ b/Sources/AppwriteModels/ContinentList.swift @@ -7,12 +7,10 @@ public class ContinentList { /// Total number of continents documents that matched your query. public let total: Int - /// List of continents. public let continents: [Continent] - init( total: Int, continents: [Continent] diff --git a/Sources/AppwriteModels/Country.swift b/Sources/AppwriteModels/Country.swift index 5a79308..3ce533b 100644 --- a/Sources/AppwriteModels/Country.swift +++ b/Sources/AppwriteModels/Country.swift @@ -7,12 +7,10 @@ public class Country { /// Country name. public let name: String - /// Country two-character ISO 3166-1 alpha code. public let code: String - init( name: String, code: String diff --git a/Sources/AppwriteModels/CountryList.swift b/Sources/AppwriteModels/CountryList.swift index 622ebf0..8d120bd 100644 --- a/Sources/AppwriteModels/CountryList.swift +++ b/Sources/AppwriteModels/CountryList.swift @@ -7,12 +7,10 @@ public class CountryList { /// Total number of countries documents that matched your query. public let total: Int - /// List of countries. public let countries: [Country] - init( total: Int, countries: [Country] diff --git a/Sources/AppwriteModels/Currency.swift b/Sources/AppwriteModels/Currency.swift index 7ec64d2..d93ce0c 100644 --- a/Sources/AppwriteModels/Currency.swift +++ b/Sources/AppwriteModels/Currency.swift @@ -7,32 +7,25 @@ public class Currency { /// Currency symbol. public let symbol: String - /// Currency name. public let name: String - /// Currency native symbol. public let symbolNative: String - /// Number of decimal digits. public let decimalDigits: Int - /// Currency digit rounding. public let rounding: Double - /// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. public let code: String - /// Currency plural name public let namePlural: String - init( symbol: String, name: String, diff --git a/Sources/AppwriteModels/CurrencyList.swift b/Sources/AppwriteModels/CurrencyList.swift index e42d9ad..a2e9f00 100644 --- a/Sources/AppwriteModels/CurrencyList.swift +++ b/Sources/AppwriteModels/CurrencyList.swift @@ -7,12 +7,10 @@ public class CurrencyList { /// Total number of currencies documents that matched your query. public let total: Int - /// List of currencies. public let currencies: [Currency] - init( total: Int, currencies: [Currency] diff --git a/Sources/AppwriteModels/Document.swift b/Sources/AppwriteModels/Document.swift index 20a4f86..94069f9 100644 --- a/Sources/AppwriteModels/Document.swift +++ b/Sources/AppwriteModels/Document.swift @@ -7,27 +7,21 @@ public class Document { /// Document ID. public let id: String - /// Collection ID. public let collectionId: String - /// Database ID. public let databaseId: String - /// Document creation date in ISO 8601 format. public let createdAt: String - /// Document update date in ISO 8601 format. public let updatedAt: String - /// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). public let permissions: [Any] - /// Additional properties public let data: T diff --git a/Sources/AppwriteModels/DocumentList.swift b/Sources/AppwriteModels/DocumentList.swift index e71c5ad..4a573fe 100644 --- a/Sources/AppwriteModels/DocumentList.swift +++ b/Sources/AppwriteModels/DocumentList.swift @@ -7,12 +7,10 @@ public class DocumentList { /// Total number of documents documents that matched your query. public let total: Int - /// List of documents. public let documents: [Document] - init( total: Int, documents: [Document] diff --git a/Sources/AppwriteModels/Execution.swift b/Sources/AppwriteModels/Execution.swift index 9301a8b..0f04430 100644 --- a/Sources/AppwriteModels/Execution.swift +++ b/Sources/AppwriteModels/Execution.swift @@ -7,72 +7,55 @@ public class Execution { /// Execution ID. public let id: String - /// Execution creation date in ISO 8601 format. public let createdAt: String - /// Execution upate date in ISO 8601 format. public let updatedAt: String - /// Execution roles. public let permissions: [Any] - /// Function ID. public let functionId: String - /// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. public let trigger: String - /// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`. public let status: String - /// HTTP request method type. public let requestMethod: String - /// HTTP request path and query. public let requestPath: String - /// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. public let requestHeaders: [Headers] - /// HTTP response status code. public let responseStatusCode: Int - /// HTTP response body. This will return empty unless execution is created as synchronous. public let responseBody: String - /// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. public let responseHeaders: [Headers] - /// Function logs. 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 logs: String - /// 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. public let duration: Double - /// The scheduled time for execution. If left empty, execution will be queued immediately. public let scheduledAt: String? - init( id: String, createdAt: String, @@ -151,7 +134,7 @@ public class Execution { logs: map["logs"] as! String, errors: map["errors"] as! String, duration: map["duration"] as! Double, - scheduledAt: map["scheduledAt"] as? String? + scheduledAt: map["scheduledAt"] as? String ) } } diff --git a/Sources/AppwriteModels/ExecutionList.swift b/Sources/AppwriteModels/ExecutionList.swift index ae92f73..8a502d9 100644 --- a/Sources/AppwriteModels/ExecutionList.swift +++ b/Sources/AppwriteModels/ExecutionList.swift @@ -7,12 +7,10 @@ public class ExecutionList { /// Total number of executions documents that matched your query. public let total: Int - /// List of executions. public let executions: [Execution] - init( total: Int, executions: [Execution] diff --git a/Sources/AppwriteModels/File.swift b/Sources/AppwriteModels/File.swift index e1669ec..04a5b89 100644 --- a/Sources/AppwriteModels/File.swift +++ b/Sources/AppwriteModels/File.swift @@ -7,48 +7,37 @@ public class File { /// File ID. public let id: String - /// Bucket ID. public let bucketId: String - /// File creation date in ISO 8601 format. public let createdAt: String - /// File update date in ISO 8601 format. public let updatedAt: String - /// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). public let permissions: [Any] - /// File name. public let name: String - /// File MD5 signature. public let signature: String - /// File mime type. public let mimeType: String - /// File original size in bytes. public let sizeOriginal: Int - /// Total number of chunks available public let chunksTotal: Int - /// Total number of chunks uploaded public let chunksUploaded: Int - init( id: String, bucketId: String, diff --git a/Sources/AppwriteModels/FileList.swift b/Sources/AppwriteModels/FileList.swift index 51dbd44..0d6ad88 100644 --- a/Sources/AppwriteModels/FileList.swift +++ b/Sources/AppwriteModels/FileList.swift @@ -7,12 +7,10 @@ public class FileList { /// Total number of files documents that matched your query. public let total: Int - /// List of files. public let files: [File] - init( total: Int, files: [File] diff --git a/Sources/AppwriteModels/Headers.swift b/Sources/AppwriteModels/Headers.swift index aa1a95f..6f554ac 100644 --- a/Sources/AppwriteModels/Headers.swift +++ b/Sources/AppwriteModels/Headers.swift @@ -7,12 +7,10 @@ public class Headers { /// Header name. public let name: String - /// Header value. public let value: String - init( name: String, value: String diff --git a/Sources/AppwriteModels/Identity.swift b/Sources/AppwriteModels/Identity.swift index 0c7d09e..fb54237 100644 --- a/Sources/AppwriteModels/Identity.swift +++ b/Sources/AppwriteModels/Identity.swift @@ -7,44 +7,34 @@ public class Identity { /// Identity ID. public let id: String - /// Identity creation date in ISO 8601 format. public let createdAt: String - /// Identity update date in ISO 8601 format. public let updatedAt: String - /// User ID. public let userId: String - /// Identity Provider. public let provider: String - /// ID of the User in the Identity Provider. public let providerUid: String - /// Email of the User in the Identity Provider. public let providerEmail: String - /// Identity Provider Access Token. public let providerAccessToken: String - /// The date of when the access token expires in ISO 8601 format. public let providerAccessTokenExpiry: String - /// Identity Provider Refresh Token. public let providerRefreshToken: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/IdentityList.swift b/Sources/AppwriteModels/IdentityList.swift index a6c3477..b068f4c 100644 --- a/Sources/AppwriteModels/IdentityList.swift +++ b/Sources/AppwriteModels/IdentityList.swift @@ -7,12 +7,10 @@ public class IdentityList { /// Total number of identities documents that matched your query. public let total: Int - /// List of identities. public let identities: [Identity] - init( total: Int, identities: [Identity] diff --git a/Sources/AppwriteModels/Jwt.swift b/Sources/AppwriteModels/Jwt.swift index 902f5b2..5778435 100644 --- a/Sources/AppwriteModels/Jwt.swift +++ b/Sources/AppwriteModels/Jwt.swift @@ -8,7 +8,6 @@ public class Jwt { public let jwt: String - init( jwt: String ) { diff --git a/Sources/AppwriteModels/Language.swift b/Sources/AppwriteModels/Language.swift index 3111149..f385d5a 100644 --- a/Sources/AppwriteModels/Language.swift +++ b/Sources/AppwriteModels/Language.swift @@ -7,16 +7,13 @@ public class Language { /// Language name. public let name: String - /// Language two-character ISO 639-1 codes. public let code: String - /// Language native name. public let nativeName: String - init( name: String, code: String, diff --git a/Sources/AppwriteModels/LanguageList.swift b/Sources/AppwriteModels/LanguageList.swift index acba750..b4515e3 100644 --- a/Sources/AppwriteModels/LanguageList.swift +++ b/Sources/AppwriteModels/LanguageList.swift @@ -7,12 +7,10 @@ public class LanguageList { /// Total number of languages documents that matched your query. public let total: Int - /// List of languages. public let languages: [Language] - init( total: Int, languages: [Language] diff --git a/Sources/AppwriteModels/Locale.swift b/Sources/AppwriteModels/Locale.swift index 2f4d046..7445776 100644 --- a/Sources/AppwriteModels/Locale.swift +++ b/Sources/AppwriteModels/Locale.swift @@ -7,32 +7,25 @@ public class Locale { /// User IP address. public let ip: String - /// Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format public let countryCode: String - /// Country name. This field support localization. public let country: String - /// Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. public let continentCode: String - /// Continent name. This field support localization. public let continent: String - /// True if country is part of the European Union. public let eu: Bool - /// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format public let currency: String - init( ip: String, countryCode: String, diff --git a/Sources/AppwriteModels/LocaleCode.swift b/Sources/AppwriteModels/LocaleCode.swift index 2d6185e..8e561c7 100644 --- a/Sources/AppwriteModels/LocaleCode.swift +++ b/Sources/AppwriteModels/LocaleCode.swift @@ -7,12 +7,10 @@ public class LocaleCode { /// Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) public let code: String - /// Locale name public let name: String - init( code: String, name: String diff --git a/Sources/AppwriteModels/LocaleCodeList.swift b/Sources/AppwriteModels/LocaleCodeList.swift index dca47d8..895ef7d 100644 --- a/Sources/AppwriteModels/LocaleCodeList.swift +++ b/Sources/AppwriteModels/LocaleCodeList.swift @@ -7,12 +7,10 @@ public class LocaleCodeList { /// Total number of localeCodes documents that matched your query. public let total: Int - /// List of localeCodes. public let localeCodes: [LocaleCode] - init( total: Int, localeCodes: [LocaleCode] diff --git a/Sources/AppwriteModels/Log.swift b/Sources/AppwriteModels/Log.swift index bf0135e..df5464d 100644 --- a/Sources/AppwriteModels/Log.swift +++ b/Sources/AppwriteModels/Log.swift @@ -7,88 +7,67 @@ public class Log { /// Event name. public let event: String - /// User ID. public let userId: String - /// User Email. public let userEmail: String - /// User Name. public let userName: String - /// API mode when event triggered. public let mode: String - /// IP session in use when the session was created. public let ip: String - /// Log creation date in ISO 8601 format. public let time: String - /// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). public let osCode: String - /// Operating system name. public let osName: String - /// Operating system version. public let osVersion: String - /// Client type. public let clientType: String - /// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). public let clientCode: String - /// Client name. public let clientName: String - /// Client version. public let clientVersion: String - /// Client engine name. public let clientEngine: String - /// Client engine name. public let clientEngineVersion: String - /// Device name. public let deviceName: String - /// Device brand name. public let deviceBrand: String - /// Device model name. public let deviceModel: String - /// Country two-character ISO 3166-1 alpha code. public let countryCode: String - /// Country name. public let countryName: String - init( event: String, userId: String, diff --git a/Sources/AppwriteModels/LogList.swift b/Sources/AppwriteModels/LogList.swift index 241f775..2f99674 100644 --- a/Sources/AppwriteModels/LogList.swift +++ b/Sources/AppwriteModels/LogList.swift @@ -7,12 +7,10 @@ public class LogList { /// Total number of logs documents that matched your query. public let total: Int - /// List of logs. public let logs: [Log] - init( total: Int, logs: [Log] diff --git a/Sources/AppwriteModels/Membership.swift b/Sources/AppwriteModels/Membership.swift index 176b746..55fb199 100644 --- a/Sources/AppwriteModels/Membership.swift +++ b/Sources/AppwriteModels/Membership.swift @@ -7,56 +7,43 @@ public class Membership { /// Membership ID. public let id: String - /// Membership creation date in ISO 8601 format. public let createdAt: String - /// Membership update date in ISO 8601 format. public let updatedAt: String - /// User ID. public let userId: String - /// User name. public let userName: String - /// User email address. public let userEmail: String - /// Team ID. public let teamId: String - /// Team name. public let teamName: String - /// Date, the user has been invited to join the team in ISO 8601 format. public let invited: String - /// Date, the user has accepted the invitation to join the team in ISO 8601 format. public let joined: String - /// User confirmation status, true if the user has joined the team or false otherwise. public let confirm: Bool - /// Multi factor authentication status, true if the user has MFA enabled or false otherwise. public let mfa: Bool - /// User list of roles public let roles: [Any] - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/MembershipList.swift b/Sources/AppwriteModels/MembershipList.swift index 5218b20..f27cc99 100644 --- a/Sources/AppwriteModels/MembershipList.swift +++ b/Sources/AppwriteModels/MembershipList.swift @@ -7,12 +7,10 @@ public class MembershipList { /// Total number of memberships documents that matched your query. public let total: Int - /// List of memberships. public let memberships: [Membership] - init( total: Int, memberships: [Membership] diff --git a/Sources/AppwriteModels/MfaChallenge.swift b/Sources/AppwriteModels/MfaChallenge.swift index 6d7481b..5a1e874 100644 --- a/Sources/AppwriteModels/MfaChallenge.swift +++ b/Sources/AppwriteModels/MfaChallenge.swift @@ -7,20 +7,16 @@ public class MfaChallenge { /// Token ID. public let id: String - /// Token creation date in ISO 8601 format. public let createdAt: String - /// User ID. public let userId: String - /// Token expiration date in ISO 8601 format. public let expire: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/MfaFactors.swift b/Sources/AppwriteModels/MfaFactors.swift index 88adf5e..716c055 100644 --- a/Sources/AppwriteModels/MfaFactors.swift +++ b/Sources/AppwriteModels/MfaFactors.swift @@ -7,20 +7,16 @@ public class MfaFactors { /// Can TOTP be used for MFA challenge for this account. public let totp: Bool - /// Can phone (SMS) be used for MFA challenge for this account. public let phone: Bool - /// Can email be used for MFA challenge for this account. public let email: Bool - /// Can recovery code be used for MFA challenge for this account. public let recoveryCode: Bool - init( totp: Bool, phone: Bool, diff --git a/Sources/AppwriteModels/MfaRecoveryCodes.swift b/Sources/AppwriteModels/MfaRecoveryCodes.swift index 8b57721..8dd063b 100644 --- a/Sources/AppwriteModels/MfaRecoveryCodes.swift +++ b/Sources/AppwriteModels/MfaRecoveryCodes.swift @@ -8,7 +8,6 @@ public class MfaRecoveryCodes { public let recoveryCodes: [Any] - init( recoveryCodes: [Any] ) { diff --git a/Sources/AppwriteModels/MfaType.swift b/Sources/AppwriteModels/MfaType.swift index 80c3526..503134f 100644 --- a/Sources/AppwriteModels/MfaType.swift +++ b/Sources/AppwriteModels/MfaType.swift @@ -7,12 +7,10 @@ public class MfaType { /// Secret token used for TOTP factor. public let secret: String - /// URI for authenticator apps. public let uri: String - init( secret: String, uri: String diff --git a/Sources/AppwriteModels/Phone.swift b/Sources/AppwriteModels/Phone.swift index a1bb096..2e113b4 100644 --- a/Sources/AppwriteModels/Phone.swift +++ b/Sources/AppwriteModels/Phone.swift @@ -7,16 +7,13 @@ public class Phone { /// Phone code. public let code: String - /// Country two-character ISO 3166-1 alpha code. public let countryCode: String - /// Country name. public let countryName: String - init( code: String, countryCode: String, diff --git a/Sources/AppwriteModels/PhoneList.swift b/Sources/AppwriteModels/PhoneList.swift index 6918afa..38a5a6f 100644 --- a/Sources/AppwriteModels/PhoneList.swift +++ b/Sources/AppwriteModels/PhoneList.swift @@ -7,12 +7,10 @@ public class PhoneList { /// Total number of phones documents that matched your query. public let total: Int - /// List of phones. public let phones: [Phone] - init( total: Int, phones: [Phone] diff --git a/Sources/AppwriteModels/Session.swift b/Sources/AppwriteModels/Session.swift index c6aca5b..7214468 100644 --- a/Sources/AppwriteModels/Session.swift +++ b/Sources/AppwriteModels/Session.swift @@ -7,120 +7,91 @@ public class Session { /// Session ID. public let id: String - /// Session creation date in ISO 8601 format. public let createdAt: String - /// Session update date in ISO 8601 format. public let updatedAt: String - /// User ID. public let userId: String - /// Session expiration date in ISO 8601 format. public let expire: String - /// Session Provider. public let provider: String - /// Session Provider User ID. public let providerUid: String - /// Session Provider Access Token. public let providerAccessToken: String - /// The date of when the access token expires in ISO 8601 format. public let providerAccessTokenExpiry: String - /// Session Provider Refresh Token. public let providerRefreshToken: String - /// IP in use when the session was created. public let ip: String - /// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). public let osCode: String - /// Operating system name. public let osName: String - /// Operating system version. public let osVersion: String - /// Client type. public let clientType: String - /// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). public let clientCode: String - /// Client name. public let clientName: String - /// Client version. public let clientVersion: String - /// Client engine name. public let clientEngine: String - /// Client engine name. public let clientEngineVersion: String - /// Device name. public let deviceName: String - /// Device brand name. public let deviceBrand: String - /// Device model name. public let deviceModel: String - /// Country two-character ISO 3166-1 alpha code. public let countryCode: String - /// Country name. public let countryName: String - /// Returns true if this the current user session. public let current: Bool - /// Returns a list of active session factors. public let factors: [Any] - /// Secret used to authenticate the user. Only included if the request was made with an API key public let secret: String - /// Most recent date in ISO 8601 format when the session successfully passed MFA challenge. public let mfaUpdatedAt: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/SessionList.swift b/Sources/AppwriteModels/SessionList.swift index c526af9..409f72a 100644 --- a/Sources/AppwriteModels/SessionList.swift +++ b/Sources/AppwriteModels/SessionList.swift @@ -7,12 +7,10 @@ public class SessionList { /// Total number of sessions documents that matched your query. public let total: Int - /// List of sessions. public let sessions: [Session] - init( total: Int, sessions: [Session] diff --git a/Sources/AppwriteModels/Subscriber.swift b/Sources/AppwriteModels/Subscriber.swift index f990bb4..5ab202d 100644 --- a/Sources/AppwriteModels/Subscriber.swift +++ b/Sources/AppwriteModels/Subscriber.swift @@ -7,40 +7,31 @@ public class Subscriber { /// Subscriber ID. public let id: String - /// Subscriber creation time in ISO 8601 format. public let createdAt: String - /// Subscriber update date in ISO 8601 format. public let updatedAt: String - /// Target ID. public let targetId: String - /// Target. public let target: Target - /// Topic ID. public let userId: String - /// User Name. public let userName: String - /// Topic ID. public let topicId: String - /// The target provider type. Can be one of the following: `email`, `sms` or `push`. public let providerType: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/Target.swift b/Sources/AppwriteModels/Target.swift index eaaf267..087eca6 100644 --- a/Sources/AppwriteModels/Target.swift +++ b/Sources/AppwriteModels/Target.swift @@ -7,36 +7,28 @@ public class Target { /// Target ID. public let id: String - /// Target creation time in ISO 8601 format. public let createdAt: String - /// Target update date in ISO 8601 format. public let updatedAt: String - /// Target Name. public let name: String - /// User ID. public let userId: String - /// Provider ID. public let providerId: String? - /// The target provider type. Can be one of the following: `email`, `sms` or `push`. public let providerType: String - /// The target identifier. public let identifier: String - init( id: String, createdAt: String, @@ -77,7 +69,7 @@ public class Target { updatedAt: map["$updatedAt"] as! String, name: map["name"] as! String, userId: map["userId"] as! String, - providerId: map["providerId"] as? String?, + providerId: map["providerId"] as? String, providerType: map["providerType"] as! String, identifier: map["identifier"] as! String ) diff --git a/Sources/AppwriteModels/Team.swift b/Sources/AppwriteModels/Team.swift index 9830c39..a44c305 100644 --- a/Sources/AppwriteModels/Team.swift +++ b/Sources/AppwriteModels/Team.swift @@ -7,28 +7,22 @@ public class Team { /// Team ID. public let id: String - /// Team creation date in ISO 8601 format. public let createdAt: String - /// Team update date in ISO 8601 format. public let updatedAt: String - /// Team name. public let name: String - /// Total number of team members. public let total: Int - /// Team preferences as a key-value object public let prefs: Preferences - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/TeamList.swift b/Sources/AppwriteModels/TeamList.swift index 2934a13..ec7e0bd 100644 --- a/Sources/AppwriteModels/TeamList.swift +++ b/Sources/AppwriteModels/TeamList.swift @@ -7,12 +7,10 @@ public class TeamList { /// Total number of teams documents that matched your query. public let total: Int - /// List of teams. public let teams: [Team] - init( total: Int, teams: [Team] diff --git a/Sources/AppwriteModels/Token.swift b/Sources/AppwriteModels/Token.swift index 5facdef..31d4b4a 100644 --- a/Sources/AppwriteModels/Token.swift +++ b/Sources/AppwriteModels/Token.swift @@ -7,28 +7,22 @@ public class Token { /// Token ID. public let id: String - /// Token creation date in ISO 8601 format. public let createdAt: String - /// User ID. public let userId: String - /// Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. public let secret: String - /// Token expiration date in ISO 8601 format. public let expire: String - /// Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. public let phrase: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/User.swift b/Sources/AppwriteModels/User.swift index a087357..d12c343 100644 --- a/Sources/AppwriteModels/User.swift +++ b/Sources/AppwriteModels/User.swift @@ -7,80 +7,61 @@ public class User { /// User ID. public let id: String - /// User creation date in ISO 8601 format. public let createdAt: String - /// User update date in ISO 8601 format. public let updatedAt: String - /// User name. public let name: String - /// Hashed user password. public let password: String? - /// Password hashing algorithm. public let hash: String? - /// Password hashing algorithm configuration. public let hashOptions: Any? - /// User registration date in ISO 8601 format. public let registration: String - /// User status. Pass `true` for enabled and `false` for disabled. public let status: Bool - /// Labels for the user. public let labels: [Any] - /// Password update time in ISO 8601 format. public let passwordUpdate: String - /// User email address. public let email: String - /// User phone number in E.164 format. public let phone: String - /// Email verification status. public let emailVerification: Bool - /// Phone verification status. public let phoneVerification: Bool - /// Multi factor authentication status. public let mfa: Bool - /// User preferences as a key-value object public let prefs: Preferences - /// A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. public let targets: [Target] - /// 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, @@ -153,9 +134,9 @@ public class User { createdAt: map["$createdAt"] as! String, updatedAt: map["$updatedAt"] as! String, name: map["name"] as! String, - password: map["password"] as? String?, - hash: map["hash"] as? String?, - hashOptions: map["hashOptions"] as? Any?, + password: map["password"] as? String, + hash: map["hash"] as? String, + hashOptions: map["hashOptions"] as? Any, registration: map["registration"] as! String, status: map["status"] as! Bool, labels: map["labels"] as! [Any],