Skip to content

Commit 5679456

Browse files
authored
Merge pull request #43 from appwrite/dev
Add 1.8.x support
2 parents c438b38 + 01270b2 commit 5679456

File tree

111 files changed

+7388
-134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+7388
-134
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Appwrite PHP SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1)
4-
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square&v=1)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
9+
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
1010

1111
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 PHP 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)
1212

docs/account.md

Lines changed: 101 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,33 @@ POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
112112
| type | string | **Required** Type of authenticator. Must be `totp` | |
113113

114114

115+
```http request
116+
POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
117+
```
118+
119+
** Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. **
120+
121+
### Parameters
122+
123+
| Field Name | Type | Description | Default |
124+
| --- | --- | --- | --- |
125+
| type | string | **Required** Type of authenticator. Must be `totp` | |
126+
127+
128+
```http request
129+
PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
130+
```
131+
132+
** Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. **
133+
134+
### Parameters
135+
136+
| Field Name | Type | Description | Default |
137+
| --- | --- | --- | --- |
138+
| type | string | **Required** Type of authenticator. | |
139+
| otp | string | Valid verification token. | |
140+
141+
115142
```http request
116143
PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
117144
```
@@ -139,6 +166,32 @@ DELETE https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
139166
| type | string | **Required** Type of authenticator. | |
140167

141168

169+
```http request
170+
DELETE https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
171+
```
172+
173+
** Delete an authenticator for a user by ID. **
174+
175+
### Parameters
176+
177+
| Field Name | Type | Description | Default |
178+
| --- | --- | --- | --- |
179+
| type | string | **Required** Type of authenticator. | |
180+
181+
182+
```http request
183+
POST https://cloud.appwrite.io/v1/account/mfa/challenge
184+
```
185+
186+
** Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. **
187+
188+
### Parameters
189+
190+
| Field Name | Type | Description | Default |
191+
| --- | --- | --- | --- |
192+
| factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. | |
193+
194+
142195
```http request
143196
POST https://cloud.appwrite.io/v1/account/mfa/challenge
144197
```
@@ -166,6 +219,27 @@ PUT https://cloud.appwrite.io/v1/account/mfa/challenge
166219
| otp | string | Valid verification token. | |
167220

168221

222+
```http request
223+
PUT https://cloud.appwrite.io/v1/account/mfa/challenge
224+
```
225+
226+
** Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. **
227+
228+
### Parameters
229+
230+
| Field Name | Type | Description | Default |
231+
| --- | --- | --- | --- |
232+
| challengeId | string | ID of the challenge. | |
233+
| otp | string | Valid verification token. | |
234+
235+
236+
```http request
237+
GET https://cloud.appwrite.io/v1/account/mfa/factors
238+
```
239+
240+
** List the factors available on the account to be used as a MFA challange. **
241+
242+
169243
```http request
170244
GET https://cloud.appwrite.io/v1/account/mfa/factors
171245
```
@@ -180,6 +254,20 @@ GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes
180254
** Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. **
181255

182256

257+
```http request
258+
GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes
259+
```
260+
261+
** Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. **
262+
263+
264+
```http request
265+
POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes
266+
```
267+
268+
** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. **
269+
270+
183271
```http request
184272
POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes
185273
```
@@ -194,6 +282,13 @@ PATCH https://cloud.appwrite.io/v1/account/mfa/recovery-codes
194282
** Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. **
195283

196284

285+
```http request
286+
PATCH https://cloud.appwrite.io/v1/account/mfa/recovery-codes
287+
```
288+
289+
** Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. **
290+
291+
197292
```http request
198293
PATCH https://cloud.appwrite.io/v1/account/name
199294
```
@@ -415,15 +510,16 @@ PATCH https://cloud.appwrite.io/v1/account/status
415510
POST https://cloud.appwrite.io/v1/account/tokens/email
416511
```
417512

418-
** Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
513+
** Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
419514

420-
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). **
515+
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
516+
**
421517

422518
### Parameters
423519

424520
| Field Name | Type | Description | Default |
425521
| --- | --- | --- | --- |
426-
| userId | string | User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
522+
| userId | string | User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. | |
427523
| email | string | User email. | |
428524
| phrase | boolean | Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. | |
429525

@@ -441,7 +537,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
441537

442538
| Field Name | Type | Description | Default |
443539
| --- | --- | --- | --- |
444-
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
540+
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. | |
445541
| email | string | User email. | |
446542
| url | string | URL to redirect the user back to your app from the magic URL login. 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. | |
447543
| phrase | boolean | Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. | |
@@ -479,7 +575,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
479575

480576
| Field Name | Type | Description | Default |
481577
| --- | --- | --- | --- |
482-
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
578+
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. | |
483579
| phone | string | Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. | |
484580

485581

0 commit comments

Comments
 (0)