1
0
Fork 0
mirror of synced 2024-06-03 11:24:48 +12:00

Swift demo

This commit is contained in:
Eldad Fux 2020-08-30 19:23:15 +03:00
parent e629bbe0ec
commit 8ccd94d1ec
74 changed files with 3512 additions and 8 deletions

View file

@ -0,0 +1 @@
# Change Log

View file

@ -0,0 +1,12 @@
Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1,35 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
//
// Created by Armino <devel@boioiong.com>
// GitHub: https://github.com/armino-dev/sdk-generator
//
import PackageDescription
let package = Package(
name: "Appwrite",
products: [
// Products define the executables and libraries produced by a package,
// and make them visible to other packages.
.library(
name: "Appwrite",
targets: ["Appwrite"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package.
// A target can define a module or a test suite.
// Targets can depend on other targets in this package,
// and on products in packages which this package depends on.
.target(
name: "Appwrite",
dependencies: []),
.testTarget(
name: "AppwriteTests",
dependencies: [Appwrite]),
]
)

View file

@ -0,0 +1,24 @@
# Appwrite Swift SDK
![License](https://img.shields.io/github/license/appwrite/sdk-for-swift.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1)
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 Swift 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)
![Appwrite](https://appwrite.io/images/github.png)
## Installation
```
git clone appwrite/sdk-for-swift
cd sdk-for-swift
swift run
```
## License
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.

View file

@ -0,0 +1,231 @@
//
// Client.swift
//
// Created by Armino <devel@boioiong.com>
// GitHub: https://github.com/armino-dev/sdk-generator
//
import Foundation
open class Client {
// MARK: Properties
open var selfSigned = false
open var endpoint = "https://appwrite.io/v1"
open var headers: [String: String] = [
"content-type": "",
"x-sdk-version": "appwrite:swift:"
]
// MARK: Methods
// default constructor
public init() {
}
///
/// Set Project
///
/// Your project ID
///
/// @param String value
///
/// @return Client
///
open func setProject(value: String) -> Client {
self.addHeader(key: "X-Appwrite-Project", value: value)
return self
}
///
/// Set Locale
///
/// @param String value
///
/// @return Client
///
open func setLocale(value: String) -> Client {
self.addHeader(key: "X-Appwrite-Locale", value: value)
return self
}
///
/// @param Bool status
/// @return Client
///
open func setSelfSigned(status: Bool = true) -> Client {
self.selfSigned = status
return self
}
///
/// @param String endpoint
/// @return Client
///
open func setEndpoint(endpoint: String) -> Client {
self.endpoint = endpoint
return self
}
///
/// @param String key
/// @param String value
///
open func addHeader(key: String, value: String) -> Client {
self.headers[key.lowercased()] = value.lowercased()
return self
}
///
open func httpBuildQuery(params: [String: Any], prefix: String = "") -> String {
var output: String = ""
for (key, value) in params {
let finalKey: String = prefix.isEmpty ? key : (prefix + "[" + key + "]")
if (value is AnyCollection<Any>) {
output += self.httpBuildQuery(params: value as! [String : Any], prefix: finalKey)
} else {
output += "\(value)"
}
output += "&"
}
return output
}
///
/// Make an API call
///
/// @param String method
/// @param String path
/// @param Array params
/// @param Array headers
/// @return Array|String
/// @throws Exception
///
func call(method:String, path:String = "", headers:[String: String] = [:], params:[String: Any] = [:]) -> Any {
self.headers.merge(headers){(_, new) in new}
let targetURL:URL = URL(string: self.endpoint + path + (( method == HTTPMethod.get.rawValue && !params.isEmpty ) ? "?" + httpBuildQuery(params: params) : ""))!
var query: String = ""
var responseStatus: Int = HTTPStatus.unknown.rawValue
var responseType: String = ""
var responseBody: Any = ""
switch (self.headers["content-type"]) {
case "application/json":
do {
let json = try JSONSerialization.data(withJSONObject:params, options: [])
query = String( data: json, encoding: String.Encoding.utf8)!
} catch {
print("Failed to parse json: \(error.localizedDescription)")
}
break
default:
query = self.httpBuildQuery(params: params)
break
}
var request = URLRequest(url: targetURL)
let session = URLSession.shared
for (key, value) in self.headers {
request.setValue(value, forHTTPHeaderField: key)
}
request.httpMethod = method
if (method.uppercased() == "POST") {
request.httpBody = query.data(using: .utf8)
}
let semaphore = DispatchSemaphore(value: 0)
session.dataTask(with: request) { data, response, error in
if (error != nil) {
print(error!)
return
}
do {
let httpResponse = response as! HTTPURLResponse
responseStatus = httpResponse.statusCode
if (responseStatus == HTTPStatus.internalServerError.rawValue) {
print(responseStatus)
return
}
responseType = httpResponse.mimeType ?? ""
if (responseType == "application/json") {
let json = try JSONSerialization.jsonObject(with: data!, options: [])
responseBody = json
} else {
responseBody = String(data: data!, encoding: String.Encoding.utf8)!
}
} catch {
print(error)
}
semaphore.signal()
}.resume()
_ = semaphore.wait(wallTimeout: .distantFuture)
return responseBody
}
}
extension Client {
public enum HTTPStatus: Int {
case unknown = -1
case ok = 200
case created = 201
case accepted = 202
case movedPermanently = 301
case found = 302
case badRequest = 400
case notAuthorized = 401
case paymentRequired = 402
case forbidden = 403
case notFound = 404
case methodNotAllowed = 405
case notAcceptable = 406
case internalServerError = 500
case notImplemented = 501
}
public enum HTTPMethod: String {
case get
case post
case put
case patch
case delete
case head
case options
case connect
case trace
}
}

View file

@ -0,0 +1,16 @@
//
// Service.swift
//
// Created by Armino <devel@boioiong.com>
// GitHub: https://github.com/armino-dev/sdk-generator
//
open class Service {
open var client: Client;
public init(client: Client)
{
self.client = client
}
}

View file

@ -0,0 +1,491 @@
class Account: Service
{
/**
* Get Account
*
* Get currently logged in user data as JSON object.
*
* @throws Exception
* @return array
*/
func get() -> Array<Any> {
let path: String = "/account"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Account
*
* Use this endpoint to allow a new user to register a new account in your
* project. After the user registration completes successfully, you can use
* the [/account/verfication](/docs/client/account#createVerification) route
* to start verifying the user email address. To allow your new user to login
* to his new account, you need to create a new [account
* session](/docs/client/account#createSession).
*
* @param String _email
* @param String _password
* @param String _name
* @throws Exception
* @return array
*/
func create(_email: String, _password: String, _name: String = "") -> Array<Any> {
let path: String = "/account"
var params: [String: Any] = [:]
params["email"] = _email
params["password"] = _password
params["name"] = _name
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Delete Account
*
* Delete a currently logged in user account. Behind the scene, the user
* record is not deleted but permanently blocked from any access. This is done
* to avoid deleted accounts being overtaken by new users with the same email
* address. Any user-related resources like documents or storage files should
* be deleted separately.
*
* @throws Exception
* @return array
*/
func delete() -> Array<Any> {
let path: String = "/account"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update Account Email
*
* Update currently logged in user account email address. After changing user
* address, user confirmation status is being reset and a new confirmation
* mail is sent. For security measures, user password is required to complete
* this request.
*
* @param String _email
* @param String _password
* @throws Exception
* @return array
*/
func updateEmail(_email: String, _password: String) -> Array<Any> {
let path: String = "/account/email"
var params: [String: Any] = [:]
params["email"] = _email
params["password"] = _password
return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Account Logs
*
* Get currently logged in user list of latest security activity logs. Each
* log returns user IP address, location and date and time of log.
*
* @throws Exception
* @return array
*/
func getLogs() -> Array<Any> {
let path: String = "/account/logs"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update Account Name
*
* Update currently logged in user account name.
*
* @param String _name
* @throws Exception
* @return array
*/
func updateName(_name: String) -> Array<Any> {
let path: String = "/account/name"
var params: [String: Any] = [:]
params["name"] = _name
return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update Account Password
*
* Update currently logged in user password. For validation, user is required
* to pass the password twice.
*
* @param String _password
* @param String _oldPassword
* @throws Exception
* @return array
*/
func updatePassword(_password: String, _oldPassword: String) -> Array<Any> {
let path: String = "/account/password"
var params: [String: Any] = [:]
params["password"] = _password
params["oldPassword"] = _oldPassword
return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Account Preferences
*
* Get currently logged in user preferences as a key-value object.
*
* @throws Exception
* @return array
*/
func getPrefs() -> Array<Any> {
let path: String = "/account/prefs"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update Account Preferences
*
* Update currently logged in user account preferences. You can pass only the
* specific settings you wish to update.
*
* @param object _prefs
* @throws Exception
* @return array
*/
func updatePrefs(_prefs: object) -> Array<Any> {
let path: String = "/account/prefs"
var params: [String: Any] = [:]
params["prefs"] = _prefs
return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Password Recovery
*
* Sends the user an email with a temporary secret key for password reset.
* When the user clicks the confirmation link he is redirected back to your
* app password reset URL with the secret key and email address values
* attached to the URL query string. Use the query string params to submit a
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
* endpoint to complete the process.
*
* @param String _email
* @param String _url
* @throws Exception
* @return array
*/
func createRecovery(_email: String, _url: String) -> Array<Any> {
let path: String = "/account/recovery"
var params: [String: Any] = [:]
params["email"] = _email
params["url"] = _url
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Complete Password Recovery
*
* Use this endpoint to complete the user account password reset. Both the
* **userId** and **secret** arguments will be passed as query parameters to
* the redirect URL you have provided when sending your request to the [POST
* /account/recovery](/docs/client/account#createRecovery) endpoint.
*
* Please note that in order to avoid a [Redirect
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
* the only valid redirect URLs are the ones from domains you have set when
* adding your platforms in the console interface.
*
* @param String _userId
* @param String _secret
* @param String _password
* @param String _passwordAgain
* @throws Exception
* @return array
*/
func updateRecovery(_userId: String, _secret: String, _password: String, _passwordAgain: String) -> Array<Any> {
let path: String = "/account/recovery"
var params: [String: Any] = [:]
params["userId"] = _userId
params["secret"] = _secret
params["password"] = _password
params["passwordAgain"] = _passwordAgain
return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Account Sessions
*
* Get currently logged in user list of active sessions across different
* devices.
*
* @throws Exception
* @return array
*/
func getSessions() -> Array<Any> {
let path: String = "/account/sessions"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Account Session
*
* Allow the user to login into his account by providing a valid email and
* password combination. This route will create a new session for the user.
*
* @param String _email
* @param String _password
* @throws Exception
* @return array
*/
func createSession(_email: String, _password: String) -> Array<Any> {
let path: String = "/account/sessions"
var params: [String: Any] = [:]
params["email"] = _email
params["password"] = _password
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Delete All Account Sessions
*
* Delete all sessions from the user account and remove any sessions cookies
* from the end client.
*
* @throws Exception
* @return array
*/
func deleteSessions() -> Array<Any> {
let path: String = "/account/sessions"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Account Session with OAuth2
*
* Allow the user to login to his account using the OAuth2 provider of his
* choice. Each OAuth2 provider should be enabled from the Appwrite console
* first. Use the success and failure arguments to provide a redirect URL's
* back to your app when login is completed.
*
* @param String _provider
* @param String _success
* @param String _failure
* @param Array<Any> _scopes
* @throws Exception
* @return array
*/
func createOAuth2Session(_provider: String, _success: String = "https://appwrite.io/auth/oauth2/success", _failure: String = "https://appwrite.io/auth/oauth2/failure", _scopes: Array<Any> = []) -> Array<Any> {
var path: String = "/account/sessions/oauth2/{provider}"
path = path.replacingOccurrences(
of: "{provider}",
with: _provider
)
var params: [String: Any] = [:]
params["success"] = _success
params["failure"] = _failure
params["scopes"] = _scopes
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Delete Account Session
*
* Use this endpoint to log out the currently logged in user from all his
* account sessions across all his different devices. When using the option id
* argument, only the session unique ID provider will be deleted.
*
* @param String _sessionId
* @throws Exception
* @return array
*/
func deleteSession(_sessionId: String) -> Array<Any> {
var path: String = "/account/sessions/{sessionId}"
path = path.replacingOccurrences(
of: "{sessionId}",
with: _sessionId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Email Verification
*
* Use this endpoint to send a verification message to your user email address
* to confirm they are the valid owners of that address. Both the **userId**
* and **secret** arguments will be passed as query parameters to the URL you
* have provided to be attached to the verification email. The provided URL
* should redirect the user back to your app and allow you to complete the
* verification process by verifying both the **userId** and **secret**
* parameters. Learn more about how to [complete the verification
* process](/docs/client/account#updateAccountVerification).
*
* Please note that in order to avoid a [Redirect
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
* the only valid redirect URLs are the ones from domains you have set when
* adding your platforms in the console interface.
*
*
* @param String _url
* @throws Exception
* @return array
*/
func createVerification(_url: String) -> Array<Any> {
let path: String = "/account/verification"
var params: [String: Any] = [:]
params["url"] = _url
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Complete Email Verification
*
* Use this endpoint to complete the user email verification process. Use both
* the **userId** and **secret** parameters that were attached to your app URL
* to verify the user email ownership. If confirmed this route will return a
* 200 status code.
*
* @param String _userId
* @param String _secret
* @throws Exception
* @return array
*/
func updateVerification(_userId: String, _secret: String) -> Array<Any> {
let path: String = "/account/verification"
var params: [String: Any] = [:]
params["userId"] = _userId
params["secret"] = _secret
return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
}

View file

@ -0,0 +1,233 @@
class Avatars: Service
{
/**
* Get Browser Icon
*
* You can use this endpoint to show different browser icons to your users.
* The code argument receives the browser code as it appears in your user
* /account/sessions endpoint. Use width, height and quality arguments to
* change the output settings.
*
* @param String _code
* @param Int _width
* @param Int _height
* @param Int _quality
* @throws Exception
* @return array
*/
func getBrowser(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array<Any> {
var path: String = "/avatars/browsers/{code}"
path = path.replacingOccurrences(
of: "{code}",
with: _code
)
var params: [String: Any] = [:]
params["width"] = _width
params["height"] = _height
params["quality"] = _quality
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Credit Card Icon
*
* Need to display your users with your billing method or their payment
* methods? The credit card endpoint will return you the icon of the credit
* card provider you need. Use width, height and quality arguments to change
* the output settings.
*
* @param String _code
* @param Int _width
* @param Int _height
* @param Int _quality
* @throws Exception
* @return array
*/
func getCreditCard(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array<Any> {
var path: String = "/avatars/credit-cards/{code}"
path = path.replacingOccurrences(
of: "{code}",
with: _code
)
var params: [String: Any] = [:]
params["width"] = _width
params["height"] = _height
params["quality"] = _quality
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Favicon
*
* Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote
* website URL.
*
* @param String _url
* @throws Exception
* @return array
*/
func getFavicon(_url: String) -> Array<Any> {
let path: String = "/avatars/favicon"
var params: [String: Any] = [:]
params["url"] = _url
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Country Flag
*
* You can use this endpoint to show different country flags icons to your
* users. The code argument receives the 2 letter country code. Use width,
* height and quality arguments to change the output settings.
*
* @param String _code
* @param Int _width
* @param Int _height
* @param Int _quality
* @throws Exception
* @return array
*/
func getFlag(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array<Any> {
var path: String = "/avatars/flags/{code}"
path = path.replacingOccurrences(
of: "{code}",
with: _code
)
var params: [String: Any] = [:]
params["width"] = _width
params["height"] = _height
params["quality"] = _quality
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Image from URL
*
* Use this endpoint to fetch a remote image URL and crop it to any image size
* you want. This endpoint is very useful if you need to crop and display
* remote images in your app or in case you want to make sure a 3rd party
* image is properly served using a TLS protocol.
*
* @param String _url
* @param Int _width
* @param Int _height
* @throws Exception
* @return array
*/
func getImage(_url: String, _width: Int = 400, _height: Int = 400) -> Array<Any> {
let path: String = "/avatars/image"
var params: [String: Any] = [:]
params["url"] = _url
params["width"] = _width
params["height"] = _height
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get User Initials
*
* Use this endpoint to show your user initials avatar icon on your website or
* app. By default, this route will try to print your logged-in user name or
* email initials. You can also overwrite the user name if you pass the 'name'
* parameter. If no name is given and no user is logged, an empty avatar will
* be returned.
*
* You can use the color and background params to change the avatar colors. By
* default, a random theme will be selected. The random theme will persist for
* the user's initials when reloading the same theme will always return for
* the same initials.
*
* @param String _name
* @param Int _width
* @param Int _height
* @param String _color
* @param String _background
* @throws Exception
* @return array
*/
func getInitials(_name: String = "", _width: Int = 500, _height: Int = 500, _color: String = "", _background: String = "") -> Array<Any> {
let path: String = "/avatars/initials"
var params: [String: Any] = [:]
params["name"] = _name
params["width"] = _width
params["height"] = _height
params["color"] = _color
params["background"] = _background
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get QR Code
*
* Converts a given plain text to a QR code image. You can use the query
* parameters to change the size and style of the resulting image.
*
* @param String _text
* @param Int _size
* @param Int _margin
* @param Bool _download
* @throws Exception
* @return array
*/
func getQR(_text: String, _size: Int = 400, _margin: Int = 1, _download: Bool = false) -> Array<Any> {
let path: String = "/avatars/qr"
var params: [String: Any] = [:]
params["text"] = _text
params["size"] = _size
params["margin"] = _margin
params["download"] = _download
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
}

View file

@ -0,0 +1,183 @@
class Database: Service
{
/**
* List Documents
*
* Get a list of all the user documents. You can use the query params to
* filter your results. On admin mode, this endpoint will return a list of all
* of the project documents. [Learn more about different API
* modes](/docs/admin).
*
* @param String _collectionId
* @param Array<Any> _filters
* @param Int _limit
* @param Int _offset
* @param String _orderField
* @param String _orderType
* @param String _orderCast
* @param String _search
* @throws Exception
* @return array
*/
func listDocuments(_collectionId: String, _filters: Array<Any> = [], _limit: Int = 25, _offset: Int = 0, _orderField: String = "$id", _orderType: String = "ASC", _orderCast: String = "string", _search: String = "") -> Array<Any> {
var path: String = "/database/collections/{collectionId}/documents"
path = path.replacingOccurrences(
of: "{collectionId}",
with: _collectionId
)
var params: [String: Any] = [:]
params["filters"] = _filters
params["limit"] = _limit
params["offset"] = _offset
params["orderField"] = _orderField
params["orderType"] = _orderType
params["orderCast"] = _orderCast
params["search"] = _search
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Document
*
* Create a new Document. Before using this route, you should create a new
* collection resource using either a [server
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
* directly from your database console.
*
* @param String _collectionId
* @param object _data
* @param Array<Any> _read
* @param Array<Any> _write
* @throws Exception
* @return array
*/
func createDocument(_collectionId: String, _data: object, _read: Array<Any>, _write: Array<Any>) -> Array<Any> {
var path: String = "/database/collections/{collectionId}/documents"
path = path.replacingOccurrences(
of: "{collectionId}",
with: _collectionId
)
var params: [String: Any] = [:]
params["data"] = _data
params["read"] = _read
params["write"] = _write
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Document
*
* Get document by its unique ID. This endpoint response returns a JSON object
* with the document data.
*
* @param String _collectionId
* @param String _documentId
* @throws Exception
* @return array
*/
func getDocument(_collectionId: String, _documentId: String) -> Array<Any> {
var path: String = "/database/collections/{collectionId}/documents/{documentId}"
path = path.replacingOccurrences(
of: "{collectionId}",
with: _collectionId
)
path = path.replacingOccurrences(
of: "{documentId}",
with: _documentId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update Document
*
* @param String _collectionId
* @param String _documentId
* @param object _data
* @param Array<Any> _read
* @param Array<Any> _write
* @throws Exception
* @return array
*/
func updateDocument(_collectionId: String, _documentId: String, _data: object, _read: Array<Any>, _write: Array<Any>) -> Array<Any> {
var path: String = "/database/collections/{collectionId}/documents/{documentId}"
path = path.replacingOccurrences(
of: "{collectionId}",
with: _collectionId
)
path = path.replacingOccurrences(
of: "{documentId}",
with: _documentId
)
var params: [String: Any] = [:]
params["data"] = _data
params["read"] = _read
params["write"] = _write
return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Delete Document
*
* Delete document by its unique ID. This endpoint deletes only the parent
* documents, his attributes and relations to other documents. Child documents
* **will not** be deleted.
*
* @param String _collectionId
* @param String _documentId
* @throws Exception
* @return array
*/
func deleteDocument(_collectionId: String, _documentId: String) -> Array<Any> {
var path: String = "/database/collections/{collectionId}/documents/{documentId}"
path = path.replacingOccurrences(
of: "{collectionId}",
with: _collectionId
)
path = path.replacingOccurrences(
of: "{documentId}",
with: _documentId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
}

View file

@ -0,0 +1,164 @@
class Locale: Service
{
/**
* Get User Locale
*
* Get the current user location based on IP. Returns an object with user
* country code, country name, continent name, continent code, ip address and
* suggested currency. You can use the locale header to get the data in a
* supported language.
*
* ([IP Geolocation by DB-IP](https://db-ip.com))
*
* @throws Exception
* @return array
*/
func get() -> Array<Any> {
let path: String = "/locale"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* List Continents
*
* List of all continents. You can use the locale header to get the data in a
* supported language.
*
* @throws Exception
* @return array
*/
func getContinents() -> Array<Any> {
let path: String = "/locale/continents"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* List Countries
*
* List of all countries. You can use the locale header to get the data in a
* supported language.
*
* @throws Exception
* @return array
*/
func getCountries() -> Array<Any> {
let path: String = "/locale/countries"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* List EU Countries
*
* List of all countries that are currently members of the EU. You can use the
* locale header to get the data in a supported language.
*
* @throws Exception
* @return array
*/
func getCountriesEU() -> Array<Any> {
let path: String = "/locale/countries/eu"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* List Countries Phone Codes
*
* List of all countries phone codes. You can use the locale header to get the
* data in a supported language.
*
* @throws Exception
* @return array
*/
func getCountriesPhones() -> Array<Any> {
let path: String = "/locale/countries/phones"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* List Currencies
*
* List of all currencies, including currency symbol, name, plural, and
* decimal digits for all major and minor currencies. You can use the locale
* header to get the data in a supported language.
*
* @throws Exception
* @return array
*/
func getCurrencies() -> Array<Any> {
let path: String = "/locale/currencies"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* List Languages
*
* List of all languages classified by ISO 639-1 including 2-letter code, name
* in English, and name in the respective language.
*
* @throws Exception
* @return array
*/
func getLanguages() -> Array<Any> {
let path: String = "/locale/languages"
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
}

View file

@ -0,0 +1,246 @@
class Storage: Service
{
/**
* List Files
*
* Get a list of all the user files. You can use the query params to filter
* your results. On admin mode, this endpoint will return a list of all of the
* project files. [Learn more about different API modes](/docs/admin).
*
* @param String _search
* @param Int _limit
* @param Int _offset
* @param String _orderType
* @throws Exception
* @return array
*/
func listFiles(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array<Any> {
let path: String = "/storage/files"
var params: [String: Any] = [:]
params["search"] = _search
params["limit"] = _limit
params["offset"] = _offset
params["orderType"] = _orderType
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create File
*
* Create a new file. The user who creates the file will automatically be
* assigned to read and write access unless he has passed custom values for
* read and write arguments.
*
* @param Array<Any> _file
* @param Array<Any> _read
* @param Array<Any> _write
* @throws Exception
* @return array
*/
func createFile(_file: Array<Any>, _read: Array<Any>, _write: Array<Any>) -> Array<Any> {
let path: String = "/storage/files"
var params: [String: Any] = [:]
params["file"] = _file
params["read"] = _read
params["write"] = _write
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "multipart/form-data",
], params: params)];
}
/**
* Get File
*
* Get file by its unique ID. This endpoint response returns a JSON object
* with the file metadata.
*
* @param String _fileId
* @throws Exception
* @return array
*/
func getFile(_fileId: String) -> Array<Any> {
var path: String = "/storage/files/{fileId}"
path = path.replacingOccurrences(
of: "{fileId}",
with: _fileId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update File
*
* Update file by its unique ID. Only users with write permissions have access
* to update this resource.
*
* @param String _fileId
* @param Array<Any> _read
* @param Array<Any> _write
* @throws Exception
* @return array
*/
func updateFile(_fileId: String, _read: Array<Any>, _write: Array<Any>) -> Array<Any> {
var path: String = "/storage/files/{fileId}"
path = path.replacingOccurrences(
of: "{fileId}",
with: _fileId
)
var params: [String: Any] = [:]
params["read"] = _read
params["write"] = _write
return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Delete File
*
* Delete a file by its unique ID. Only users with write permissions have
* access to delete this resource.
*
* @param String _fileId
* @throws Exception
* @return array
*/
func deleteFile(_fileId: String) -> Array<Any> {
var path: String = "/storage/files/{fileId}"
path = path.replacingOccurrences(
of: "{fileId}",
with: _fileId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get File for Download
*
* Get file content by its unique ID. The endpoint response return with a
* 'Content-Disposition: attachment' header that tells the browser to start
* downloading the file to user downloads directory.
*
* @param String _fileId
* @throws Exception
* @return array
*/
func getFileDownload(_fileId: String) -> Array<Any> {
var path: String = "/storage/files/{fileId}/download"
path = path.replacingOccurrences(
of: "{fileId}",
with: _fileId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get File Preview
*
* Get a file preview image. Currently, this method supports preview for image
* files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
* and spreadsheets, will return the file icon image. You can also pass query
* string arguments for cutting and resizing your preview image.
*
* @param String _fileId
* @param Int _width
* @param Int _height
* @param Int _quality
* @param String _background
* @param String _output
* @throws Exception
* @return array
*/
func getFilePreview(_fileId: String, _width: Int = 0, _height: Int = 0, _quality: Int = 100, _background: String = "", _output: String = "") -> Array<Any> {
var path: String = "/storage/files/{fileId}/preview"
path = path.replacingOccurrences(
of: "{fileId}",
with: _fileId
)
var params: [String: Any] = [:]
params["width"] = _width
params["height"] = _height
params["quality"] = _quality
params["background"] = _background
params["output"] = _output
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get File for View
*
* Get file content by its unique ID. This endpoint is similar to the download
* method but returns with no 'Content-Disposition: attachment' header.
*
* @param String _fileId
* @param String _as
* @throws Exception
* @return array
*/
func getFileView(_fileId: String, _as: String = "") -> Array<Any> {
var path: String = "/storage/files/{fileId}/view"
path = path.replacingOccurrences(
of: "{fileId}",
with: _fileId
)
var params: [String: Any] = [:]
params["as"] = _as
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
}

View file

@ -0,0 +1,298 @@
class Teams: Service
{
/**
* List Teams
*
* Get a list of all the current user teams. You can use the query params to
* filter your results. On admin mode, this endpoint will return a list of all
* of the project teams. [Learn more about different API modes](/docs/admin).
*
* @param String _search
* @param Int _limit
* @param Int _offset
* @param String _orderType
* @throws Exception
* @return array
*/
func list(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array<Any> {
let path: String = "/teams"
var params: [String: Any] = [:]
params["search"] = _search
params["limit"] = _limit
params["offset"] = _offset
params["orderType"] = _orderType
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Team
*
* Create a new team. The user who creates the team will automatically be
* assigned as the owner of the team. The team owner can invite new members,
* who will be able add new owners and update or delete the team from your
* project.
*
* @param String _name
* @param Array<Any> _roles
* @throws Exception
* @return array
*/
func create(_name: String, _roles: Array<Any> = ["owner"]) -> Array<Any> {
let path: String = "/teams"
var params: [String: Any] = [:]
params["name"] = _name
params["roles"] = _roles
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Team
*
* Get team by its unique ID. All team members have read access for this
* resource.
*
* @param String _teamId
* @throws Exception
* @return array
*/
func get(_teamId: String) -> Array<Any> {
var path: String = "/teams/{teamId}"
path = path.replacingOccurrences(
of: "{teamId}",
with: _teamId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update Team
*
* Update team by its unique ID. Only team owners have write access for this
* resource.
*
* @param String _teamId
* @param String _name
* @throws Exception
* @return array
*/
func update(_teamId: String, _name: String) -> Array<Any> {
var path: String = "/teams/{teamId}"
path = path.replacingOccurrences(
of: "{teamId}",
with: _teamId
)
var params: [String: Any] = [:]
params["name"] = _name
return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Delete Team
*
* Delete team by its unique ID. Only team owners have write access for this
* resource.
*
* @param String _teamId
* @throws Exception
* @return array
*/
func delete(_teamId: String) -> Array<Any> {
var path: String = "/teams/{teamId}"
path = path.replacingOccurrences(
of: "{teamId}",
with: _teamId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Get Team Memberships
*
* Get team members by the team unique ID. All team members have read access
* for this list of resources.
*
* @param String _teamId
* @param String _search
* @param Int _limit
* @param Int _offset
* @param String _orderType
* @throws Exception
* @return array
*/
func getMemberships(_teamId: String, _search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array<Any> {
var path: String = "/teams/{teamId}/memberships"
path = path.replacingOccurrences(
of: "{teamId}",
with: _teamId
)
var params: [String: Any] = [:]
params["search"] = _search
params["limit"] = _limit
params["offset"] = _offset
params["orderType"] = _orderType
return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Create Team Membership
*
* Use this endpoint to invite a new member to join your team. An email with a
* link to join the team will be sent to the new member email address if the
* member doesn't exist in the project it will be created automatically.
*
* Use the 'URL' parameter to redirect the user from the invitation email back
* to your app. When the user is redirected, use the [Update Team Membership
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
* user to accept the invitation to the team.
*
* Please note that in order to avoid a [Redirect
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
* @param String _teamId
* @param String _email
* @param Array<Any> _roles
* @param String _url
* @param String _name
* @throws Exception
* @return array
*/
func createMembership(_teamId: String, _email: String, _roles: Array<Any>, _url: String, _name: String = "") -> Array<Any> {
var path: String = "/teams/{teamId}/memberships"
path = path.replacingOccurrences(
of: "{teamId}",
with: _teamId
)
var params: [String: Any] = [:]
params["email"] = _email
params["name"] = _name
params["roles"] = _roles
params["url"] = _url
return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Delete Team Membership
*
* This endpoint allows a user to leave a team or for a team owner to delete
* the membership of any other team member. You can also use this endpoint to
* delete a user membership even if he didn't accept it.
*
* @param String _teamId
* @param String _inviteId
* @throws Exception
* @return array
*/
func deleteMembership(_teamId: String, _inviteId: String) -> Array<Any> {
var path: String = "/teams/{teamId}/memberships/{inviteId}"
path = path.replacingOccurrences(
of: "{teamId}",
with: _teamId
)
path = path.replacingOccurrences(
of: "{inviteId}",
with: _inviteId
)
let params: [String: Any] = [:]
return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
/**
* Update Team Membership Status
*
* Use this endpoint to allow a user to accept an invitation to join a team
* after he is being redirected back to your app from the invitation email he
* was sent.
*
* @param String _teamId
* @param String _inviteId
* @param String _userId
* @param String _secret
* @throws Exception
* @return array
*/
func updateMembershipStatus(_teamId: String, _inviteId: String, _userId: String, _secret: String) -> Array<Any> {
var path: String = "/teams/{teamId}/memberships/{inviteId}/status"
path = path.replacingOccurrences(
of: "{teamId}",
with: _teamId
)
path = path.replacingOccurrences(
of: "{inviteId}",
with: _inviteId
)
var params: [String: Any] = [:]
params["userId"] = _userId
params["secret"] = _secret
return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
"content-type": "application/json",
], params: params)];
}
}

View file

@ -0,0 +1,240 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
# Account Service
## Get Account
```http request
GET https://appwrite.io/v1/account
```
** Get currently logged in user data as JSON object. **
## Create Account
```http request
POST https://appwrite.io/v1/account
```
** Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](/docs/client/account#createSession). **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| email | string | User email. | |
| password | string | User password. Must be between 6 to 32 chars. | |
| name | string | User name. | |
## Delete Account
```http request
DELETE https://appwrite.io/v1/account
```
** Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately. **
## Update Account Email
```http request
PATCH https://appwrite.io/v1/account/email
```
** Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| email | string | User email. | |
| password | string | User password. Must be between 6 to 32 chars. | |
## Get Account Logs
```http request
GET https://appwrite.io/v1/account/logs
```
** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. **
## Update Account Name
```http request
PATCH https://appwrite.io/v1/account/name
```
** Update currently logged in user account name. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| name | string | User name. | |
## Update Account Password
```http request
PATCH https://appwrite.io/v1/account/password
```
** Update currently logged in user password. For validation, user is required to pass the password twice. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| password | string | New user password. Must be between 6 to 32 chars. | |
| oldPassword | string | Old user password. Must be between 6 to 32 chars. | |
## Get Account Preferences
```http request
GET https://appwrite.io/v1/account/prefs
```
** Get currently logged in user preferences as a key-value object. **
## Update Account Preferences
```http request
PATCH https://appwrite.io/v1/account/prefs
```
** Update currently logged in user account preferences. You can pass only the specific settings you wish to update. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| prefs | object | Prefs key-value JSON object. | |
## Create Password Recovery
```http request
POST https://appwrite.io/v1/account/recovery
```
** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](/docs/client/account#updateRecovery) endpoint to complete the process. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| email | string | User email. | |
| url | string | URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
## Complete Password Recovery
```http request
PUT https://appwrite.io/v1/account/recovery
```
** Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/client/account#createRecovery) endpoint.
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | User account UID address. | |
| secret | string | Valid reset token. | |
| password | string | New password. Must be between 6 to 32 chars. | |
| passwordAgain | string | New password again. Must be between 6 to 32 chars. | |
## Get Account Sessions
```http request
GET https://appwrite.io/v1/account/sessions
```
** Get currently logged in user list of active sessions across different devices. **
## Create Account Session
```http request
POST https://appwrite.io/v1/account/sessions
```
** Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| email | string | User email. | |
| password | string | User password. Must be between 6 to 32 chars. | |
## Delete All Account Sessions
```http request
DELETE https://appwrite.io/v1/account/sessions
```
** Delete all sessions from the user account and remove any sessions cookies from the end client. **
## Create Account Session with OAuth2
```http request
GET https://appwrite.io/v1/account/sessions/oauth2/{provider}
```
** Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL&#039;s back to your app when login is completed. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex. | |
| success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | https://appwrite.io/auth/oauth2/success |
| failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | https://appwrite.io/auth/oauth2/failure |
| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. | [] |
## Delete Account Session
```http request
DELETE https://appwrite.io/v1/account/sessions/{sessionId}
```
** Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| sessionId | string | **Required** Session unique ID. Use the string &#039;current&#039; to delete the current device session. | |
## Create Email Verification
```http request
POST https://appwrite.io/v1/account/verification
```
** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#updateAccountVerification).
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
**
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| url | string | URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
## Complete Email Verification
```http request
PUT https://appwrite.io/v1/account/verification
```
** Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | User unique ID. | |
| secret | string | Valid verification token. | |

View file

@ -0,0 +1,124 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
# Avatars Service
## Get Browser Icon
```http request
GET https://appwrite.io/v1/avatars/browsers/{code}
```
** You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| code | string | **Required** Browser Code. | |
| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
## Get Credit Card Icon
```http request
GET https://appwrite.io/v1/avatars/credit-cards/{code}
```
** Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| code | string | **Required** Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa. | |
| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
## Get Favicon
```http request
GET https://appwrite.io/v1/avatars/favicon
```
** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| url | string | **Required** Website URL which you want to fetch the favicon from. | |
## Get Country Flag
```http request
GET https://appwrite.io/v1/avatars/flags/{code}
```
** You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| code | string | **Required** Country Code. ISO Alpha-2 country code format. | |
| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
## Get Image from URL
```http request
GET https://appwrite.io/v1/avatars/image
```
** Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| url | string | **Required** Image URL which you want to crop. | |
| width | integer | Resize preview image width, Pass an integer between 0 to 2000. | 400 |
| height | integer | Resize preview image height, Pass an integer between 0 to 2000. | 400 |
## Get User Initials
```http request
GET https://appwrite.io/v1/avatars/initials
```
** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the &#039;name&#039; parameter. If no name is given and no user is logged, an empty avatar will be returned.
You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user&#039;s initials when reloading the same theme will always return for the same initials. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| name | string | Full Name. When empty, current user name or email will be used. | |
| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 500 |
| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 500 |
| color | string | Changes text color. By default a random color will be picked and stay will persistent to the given name. | |
| background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. | |
## Get QR Code
```http request
GET https://appwrite.io/v1/avatars/qr
```
** Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| text | string | **Required** Plain text to be converted to QR code image. | |
| size | integer | QR code size. Pass an integer between 0 to 1000. Defaults to 400. | 400 |
| margin | integer | Margin from edge. Pass an integer between 0 to 10. Defaults to 1. | 1 |
| download | boolean | Return resulting image with &#039;Content-Disposition: attachment &#039; headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. | |

View file

@ -0,0 +1,90 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
# Database Service
## List Documents
```http request
GET https://appwrite.io/v1/database/collections/{collectionId}/documents
```
** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, &gt;, &lt;, &lt;=, &gt;=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: &#039;name=John Doe&#039; or &#039;category.$id&gt;=5bed2d152c362&#039;. | [] |
| limit | integer | Maximum number of documents to return in response. Use this value to manage pagination. | 25 |
| offset | integer | Offset value. Use this value to manage pagination. | 0 |
| orderField | string | Document field that results will be sorted by. | $id |
| orderType | string | Order direction. Possible values are DESC for descending order, or ASC for ascending order. | ASC |
| orderCast | string | Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string. | string |
| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. | |
## Create Document
```http request
POST https://appwrite.io/v1/database/collections/{collectionId}/documents
```
** Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](/docs/server/database?sdk=nodejs#createCollection) API or directly from your database console. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
| data | object | Document data as JSON object. | |
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
## Get Document
```http request
GET https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId}
```
** Get document by its unique ID. This endpoint response returns a JSON object with the document data. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
| documentId | string | **Required** Document unique ID. | |
## Update Document
```http request
PATCH https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId}
```
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
| documentId | string | **Required** Document unique ID. | |
| data | object | Document data as JSON object. | |
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
## Delete Document
```http request
DELETE https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId}
```
** Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
| documentId | string | **Required** Document unique ID. | |

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.createOAuth2Session(_provider: "amazon");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.createRecovery(_email: "email@example.com", _url: "https://example.com");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.createSession(_email: "email@example.com", _password: "password");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.createVerification(_url: "https://example.com");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.create(_email: "email@example.com", _password: "password");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.deleteSession(_sessionId: "[SESSION_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.deleteSessions();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.delete();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.getLogs();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.getPrefs();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.getSessions();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.get();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.updateEmail(_email: "email@example.com", _password: "password");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.updateName(_name: "[NAME]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.updatePassword(_password: "password", _oldPassword: "password");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.updatePrefs(_prefs: );

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.updateRecovery(_userId: "[USER_ID]", _secret: "[SECRET]", _password: "password", _passwordAgain: "password");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var account: Account = Account(client: client);
var result = account.updateVerification(_userId: "[USER_ID]", _secret: "[SECRET]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var avatars: Avatars = Avatars(client: client);
var result = avatars.getBrowser(_code: "aa");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var avatars: Avatars = Avatars(client: client);
var result = avatars.getCreditCard(_code: "amex");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var avatars: Avatars = Avatars(client: client);
var result = avatars.getFavicon(_url: "https://example.com");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var avatars: Avatars = Avatars(client: client);
var result = avatars.getFlag(_code: "af");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var avatars: Avatars = Avatars(client: client);
var result = avatars.getImage(_url: "https://example.com");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var avatars: Avatars = Avatars(client: client);
var result = avatars.getInitials();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var avatars: Avatars = Avatars(client: client);
var result = avatars.getQR(_text: "[TEXT]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var database: Database = Database(client: client);
var result = database.createDocument(_collectionId: "[COLLECTION_ID]", _data: , _read: [], _write: []);

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var database: Database = Database(client: client);
var result = database.deleteDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var database: Database = Database(client: client);
var result = database.getDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var database: Database = Database(client: client);
var result = database.listDocuments(_collectionId: "[COLLECTION_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var database: Database = Database(client: client);
var result = database.updateDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]", _data: , _read: [], _write: []);

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var locale: Locale = Locale(client: client);
var result = locale.getContinents();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var locale: Locale = Locale(client: client);
var result = locale.getCountriesEU();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var locale: Locale = Locale(client: client);
var result = locale.getCountriesPhones();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var locale: Locale = Locale(client: client);
var result = locale.getCountries();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var locale: Locale = Locale(client: client);
var result = locale.getCurrencies();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var locale: Locale = Locale(client: client);
var result = locale.getLanguages();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var locale: Locale = Locale(client: client);
var result = locale.get();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.createFile(_file: nil, _read: [], _write: []);

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.deleteFile(_fileId: "[FILE_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.getFileDownload(_fileId: "[FILE_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.getFilePreview(_fileId: "[FILE_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.getFileView(_fileId: "[FILE_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.getFile(_fileId: "[FILE_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.listFiles();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var storage: Storage = Storage(client: client);
var result = storage.updateFile(_fileId: "[FILE_ID]", _read: [], _write: []);

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.createMembership(_teamId: "[TEAM_ID]", _email: "email@example.com", _roles: [], _url: "https://example.com");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.create(_name: "[NAME]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.deleteMembership(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.delete(_teamId: "[TEAM_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.getMemberships(_teamId: "[TEAM_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.get(_teamId: "[TEAM_ID]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.list();

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.updateMembershipStatus(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]", _userId: "[USER_ID]", _secret: "[SECRET]");

View file

@ -0,0 +1,14 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
var client: Client = Client()
client
.setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject(value: "5df5acd0d48c2") // Your project ID
var teams: Teams = Teams(client: client);
var result = teams.update(_teamId: "[TEAM_ID]", _name: "[NAME]");

View file

@ -0,0 +1,64 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
# Locale Service
## Get User Locale
```http request
GET https://appwrite.io/v1/locale
```
** Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
([IP Geolocation by DB-IP](https://db-ip.com)) **
## List Continents
```http request
GET https://appwrite.io/v1/locale/continents
```
** List of all continents. You can use the locale header to get the data in a supported language. **
## List Countries
```http request
GET https://appwrite.io/v1/locale/countries
```
** List of all countries. You can use the locale header to get the data in a supported language. **
## List EU Countries
```http request
GET https://appwrite.io/v1/locale/countries/eu
```
** List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language. **
## List Countries Phone Codes
```http request
GET https://appwrite.io/v1/locale/countries/phones
```
** List of all countries phone codes. You can use the locale header to get the data in a supported language. **
## List Currencies
```http request
GET https://appwrite.io/v1/locale/currencies
```
** List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language. **
## List Languages
```http request
GET https://appwrite.io/v1/locale/languages
```
** List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. **

View file

@ -0,0 +1,131 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
# Storage Service
## List Files
```http request
GET https://appwrite.io/v1/storage/files
```
** Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin). **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| search | string | Search term to filter your list results. | |
| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
| orderType | string | Order result by ASC or DESC order. | ASC |
## Create File
```http request
POST https://appwrite.io/v1/storage/files
```
** Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| file | file | Binary file. | |
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
## Get File
```http request
GET https://appwrite.io/v1/storage/files/{fileId}
```
** Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
## Update File
```http request
PUT https://appwrite.io/v1/storage/files/{fileId}
```
** Update file by its unique ID. Only users with write permissions have access to update this resource. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
## Delete File
```http request
DELETE https://appwrite.io/v1/storage/files/{fileId}
```
** Delete a file by its unique ID. Only users with write permissions have access to delete this resource. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
## Get File for Download
```http request
GET https://appwrite.io/v1/storage/files/{fileId}/download
```
** Get file content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
## Get File Preview
```http request
GET https://appwrite.io/v1/storage/files/{fileId}/preview
```
** Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID | |
| width | integer | Resize preview image width, Pass an integer between 0 to 4000. | 0 |
| height | integer | Resize preview image height, Pass an integer between 0 to 4000. | 0 |
| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
| background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | |
| output | string | Output format type (jpeg, jpg, png, gif and webp). | |
## Get File for View
```http request
GET https://appwrite.io/v1/storage/files/{fileId}/view
```
** Get file content by its unique ID. This endpoint is similar to the download method but returns with no &#039;Content-Disposition: attachment&#039; header. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
| as | string | Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk. | |

View file

@ -0,0 +1,153 @@
/// Swift Appwrite SDK
/// Produced by Appwrite SDK Generator
///
# Teams Service
## List Teams
```http request
GET https://appwrite.io/v1/teams
```
** Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin). **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| search | string | Search term to filter your list results. | |
| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
| orderType | string | Order result by ASC or DESC order. | ASC |
## Create Team
```http request
POST https://appwrite.io/v1/teams
```
** Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| name | string | Team name. | |
| roles | array | Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | [&quot;owner&quot;] |
## Get Team
```http request
GET https://appwrite.io/v1/teams/{teamId}
```
** Get team by its unique ID. All team members have read access for this resource. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
## Update Team
```http request
PUT https://appwrite.io/v1/teams/{teamId}
```
** Update team by its unique ID. Only team owners have write access for this resource. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
| name | string | Team name. | |
## Delete Team
```http request
DELETE https://appwrite.io/v1/teams/{teamId}
```
** Delete team by its unique ID. Only team owners have write access for this resource. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
## Get Team Memberships
```http request
GET https://appwrite.io/v1/teams/{teamId}/memberships
```
** Get team members by the team unique ID. All team members have read access for this list of resources. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
| search | string | Search term to filter your list results. | |
| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
| orderType | string | Order result by ASC or DESC order. | ASC |
## Create Team Membership
```http request
POST https://appwrite.io/v1/teams/{teamId}/memberships
```
** Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn&#039;t exist in the project it will be created automatically.
Use the &#039;URL&#039; parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL&#039;s are the once from domains you have set when added your platforms in the console interface. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
| email | string | New team member email. | |
| name | string | New team member name. | |
| roles | array | Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | |
| url | string | URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
## Delete Team Membership
```http request
DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
```
** This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn&#039;t accept it. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
| inviteId | string | **Required** Invite unique ID. | |
## Update Team Membership Status
```http request
PATCH https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status
```
** Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
| inviteId | string | **Required** Invite unique ID. | |
| userId | string | User unique ID. | |
| secret | string | Secret key. | |

View file

@ -1,6 +1,10 @@
<?php
global $cli;
use Utopia\App;
use Utopia\CLI\CLI;
use Utopia\Config\Config;
use Utopia\CLI\Console;
@ -16,7 +20,10 @@ use Appwrite\SDK\Language\Deno;
use Appwrite\SDK\Language\Flutter;
use Appwrite\SDK\Language\Go;
use Appwrite\SDK\Language\Java;
use Appwrite\SDK\Language\Swift;
require_once __DIR__.'/../init.php';
$cli = new CLI();
$version = APP_VERSION_STABLE; // Server version
$warning = '**This SDK is compatible with Appwrite server version ' . $version . '. For older versions, please check previous releases.**';
@ -127,6 +134,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
case 'java':
$config = new Java();
break;
case 'swift':
$config = new Swift();
break;
default:
throw new Exception('Language "'.$language['key'].'" not supported');
break;
@ -201,4 +211,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
}
exit();
});
});
$cli->run();

12
composer.lock generated
View file

@ -1952,7 +1952,7 @@
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
"reference": "95e29472f8416eb8ce6a83f6b5af9c139ec73ea2"
"reference": "506b82a20a004724d88c3c95a090de30a2479a93"
},
"require": {
"ext-curl": "*",
@ -1982,7 +1982,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2020-08-17T18:12:07+00:00"
"time": "2020-08-30T05:15:19+00:00"
},
{
"name": "doctrine/instantiator",
@ -2169,12 +2169,12 @@
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5"
"reference": "a3409d10079990eeb489c3fead0ac070b5b38895"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a3409d10079990eeb489c3fead0ac070b5b38895",
"reference": "a3409d10079990eeb489c3fead0ac070b5b38895",
"shasum": ""
},
"require": {
@ -2215,7 +2215,7 @@
"type": "tidelift"
}
],
"time": "2020-06-29T13:22:24+00:00"
"time": "2020-08-28T16:31:07+00:00"
},
{
"name": "phar-io/manifest",