-
Notifications
You must be signed in to change notification settings - Fork 23
Updates: sync as per latest cloud specs #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6e231a6
5a44d75
e406b88
62e6f1f
91f96ea
a90c24a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| vendor/ | ||
| composer.lock |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,172 @@ | ||||||
| # Backups Service | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| GET https://cloud.appwrite.io/v1/backups/archives | ||||||
| ``` | ||||||
|
|
||||||
| ** List all archives for a project. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| POST https://cloud.appwrite.io/v1/backups/archives | ||||||
| ``` | ||||||
|
|
||||||
| ** Create a new archive asynchronously for a project. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | services | array | Array of services to backup | | | ||||||
| | resourceId | string | Resource ID. When set, only this single resource will be backed up. | | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| GET https://cloud.appwrite.io/v1/backups/archives/{archiveId} | ||||||
| ``` | ||||||
|
|
||||||
| ** Get a backup archive using it's ID. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | archiveId | string | **Required** Archive ID. Choose a custom ID`. 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. | | | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix unmatched backtick in description. The description has an unmatched backtick: "Choose a custom ID`." This should be either "Choose a custom ID." or properly paired backticks if code formatting is intended. 📝 Proposed fix-| archiveId | string | **Required** Archive ID. Choose a custom ID`. 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. | |
+| archiveId | string | **Required** Archive ID. Choose a custom ID. 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. | |📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| DELETE https://cloud.appwrite.io/v1/backups/archives/{archiveId} | ||||||
| ``` | ||||||
|
|
||||||
| ** Delete an existing archive for a project. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | archiveId | string | **Required** Policy 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. | | | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect parameter description - copy-paste error. The description for the 📝 Proposed fix-| archiveId | string | **Required** Policy 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. | |
+| archiveId | string | **Required** Archive 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. | |📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| GET https://cloud.appwrite.io/v1/backups/policies | ||||||
| ``` | ||||||
|
|
||||||
| ** List all policies for a project. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| POST https://cloud.appwrite.io/v1/backups/policies | ||||||
| ``` | ||||||
|
|
||||||
| ** Create a new backup policy. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | policyId | string | Policy 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. | | | ||||||
| | name | string | Policy name. Max length: 128 chars. | | | ||||||
| | services | array | Array of services to backup | | | ||||||
| | resourceId | string | Resource ID. When set, only this single resource will be backed up. | | | ||||||
| | enabled | boolean | Is policy enabled? When set to 'disabled', no backups will be taken | 1 | | ||||||
| | retention | integer | Days to keep backups before deletion | | | ||||||
| | schedule | string | Schedule CRON syntax. | | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| GET https://cloud.appwrite.io/v1/backups/policies/{policyId} | ||||||
| ``` | ||||||
|
|
||||||
| ** Get a backup policy using it's ID. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | policyId | string | **Required** Policy ID. Choose a custom ID`. 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. | | | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix unmatched backtick in description. Same issue as line 41: "Choose a custom ID`." has an unmatched backtick. 📝 Proposed fix-| policyId | string | **Required** Policy ID. Choose a custom ID`. 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. | |
+| policyId | string | **Required** Policy ID. Choose a custom ID. 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. | |📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId} | ||||||
| ``` | ||||||
|
|
||||||
| ** Update an existing policy using it's ID. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | policyId | string | **Required** Policy ID. Choose a custom ID`. 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. | | | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix unmatched backtick in description. Same issue as lines 41 and 99: "Choose a custom ID`." has an unmatched backtick. 📝 Proposed fix-| policyId | string | **Required** Policy ID. Choose a custom ID`. 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. | |
+| policyId | string | **Required** Policy ID. Choose a custom ID. 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. | |📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| | name | string | Policy name. Max length: 128 chars. | | | ||||||
| | retention | integer | Days to keep backups before deletion | | | ||||||
| | schedule | string | Cron expression | | | ||||||
| | enabled | boolean | Is Backup enabled? When set to 'disabled', No backup will be taken | | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId} | ||||||
| ``` | ||||||
|
|
||||||
| ** Delete a policy using it's ID. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | policyId | string | **Required** Policy 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. | | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| POST https://cloud.appwrite.io/v1/backups/restoration | ||||||
| ``` | ||||||
|
|
||||||
| ** Create and trigger a new restoration for a backup on a project. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | archiveId | string | Backup archive ID to restore | | | ||||||
| | services | array | Array of services to restore | | | ||||||
| | newResourceId | 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. | | | ||||||
| | newResourceName | string | Database name. Max length: 128 chars. | | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| GET https://cloud.appwrite.io/v1/backups/restorations | ||||||
| ``` | ||||||
|
|
||||||
| ** List all backup restorations for a project. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | | ||||||
|
|
||||||
|
|
||||||
| ```http request | ||||||
| GET https://cloud.appwrite.io/v1/backups/restorations/{restorationId} | ||||||
| ``` | ||||||
|
|
||||||
| ** Get the current status of a backup restoration. ** | ||||||
|
|
||||||
| ### Parameters | ||||||
|
|
||||||
| | Field Name | Type | Description | Default | | ||||||
| | --- | --- | --- | --- | | ||||||
| | restorationId | string | **Required** Restoration ID. Choose a custom ID`. 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. | | | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,4 +10,6 @@ $client = (new Client()) | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| $account = new Account($client); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| $result = $account->createJWT(); | ||||||||||||||||||||||
| $result = $account->createJWT( | ||||||||||||||||||||||
| duration: 0 // optional | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
|
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reconsider using A duration of 0 would create a JWT that expires immediately, which isn't a practical use case. Consider either:
📝 Suggested fix $result = $account->createJWT(
- duration: 0 // optional
+ duration: 1800 // optional, defaults to 900 seconds (15 minutes)
);Or simply: -$result = $account->createJWT(
- duration: 0 // optional
-);
+$result = $account->createJWT();📝 Committable suggestion
Suggested change
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?php | ||
|
|
||
| use Appwrite\Client; | ||
| use Appwrite\Services\Backups; | ||
|
|
||
| $client = (new Client()) | ||
| ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| ->setProject('<YOUR_PROJECT_ID>') // Your project ID | ||
| ->setKey('<YOUR_API_KEY>'); // Your secret API key | ||
|
|
||
| $backups = new Backups($client); | ||
|
|
||
| $result = $backups->createArchive( | ||
| services: [], | ||
| resourceId: '<RESOURCE_ID>' // optional | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?php | ||
|
|
||
| use Appwrite\Client; | ||
| use Appwrite\Services\Backups; | ||
|
|
||
| $client = (new Client()) | ||
| ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| ->setProject('<YOUR_PROJECT_ID>') // Your project ID | ||
| ->setKey('<YOUR_API_KEY>'); // Your secret API key | ||
|
|
||
| $backups = new Backups($client); | ||
|
|
||
| $result = $backups->createPolicy( | ||
| policyId: '<POLICY_ID>', | ||
| services: [], | ||
| retention: 1, | ||
| schedule: '', | ||
| name: '<NAME>', // optional | ||
| resourceId: '<RESOURCE_ID>', // optional | ||
| enabled: false // optional | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?php | ||
|
|
||
| use Appwrite\Client; | ||
| use Appwrite\Services\Backups; | ||
|
|
||
| $client = (new Client()) | ||
| ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| ->setProject('<YOUR_PROJECT_ID>') // Your project ID | ||
| ->setKey('<YOUR_API_KEY>'); // Your secret API key | ||
|
|
||
| $backups = new Backups($client); | ||
|
|
||
| $result = $backups->createRestoration( | ||
| archiveId: '<ARCHIVE_ID>', | ||
| services: [], | ||
| newResourceId: '<NEW_RESOURCE_ID>', // optional | ||
| newResourceName: '<NEW_RESOURCE_NAME>' // optional | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php | ||
|
|
||
| use Appwrite\Client; | ||
| use Appwrite\Services\Backups; | ||
|
|
||
| $client = (new Client()) | ||
| ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| ->setProject('<YOUR_PROJECT_ID>') // Your project ID | ||
| ->setKey('<YOUR_API_KEY>'); // Your secret API key | ||
|
|
||
| $backups = new Backups($client); | ||
|
|
||
| $result = $backups->deleteArchive( | ||
| archiveId: '<ARCHIVE_ID>' | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php | ||
|
|
||
| use Appwrite\Client; | ||
| use Appwrite\Services\Backups; | ||
|
|
||
| $client = (new Client()) | ||
| ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| ->setProject('<YOUR_PROJECT_ID>') // Your project ID | ||
| ->setKey('<YOUR_API_KEY>'); // Your secret API key | ||
|
|
||
| $backups = new Backups($client); | ||
|
|
||
| $result = $backups->deletePolicy( | ||
| policyId: '<POLICY_ID>' | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php | ||
|
|
||
| use Appwrite\Client; | ||
| use Appwrite\Services\Backups; | ||
|
|
||
| $client = (new Client()) | ||
| ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| ->setProject('<YOUR_PROJECT_ID>') // Your project ID | ||
| ->setKey('<YOUR_API_KEY>'); // Your secret API key | ||
|
|
||
| $backups = new Backups($client); | ||
|
|
||
| $result = $backups->getArchive( | ||
| archiveId: '<ARCHIVE_ID>' | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the description to reflect configurable JWT duration.
The description states the JWT is valid for "15 minutes" as a fixed value, but the new
durationparameter (lines 76-81) allows customization up to 3600 seconds (1 hour). Consider revising to indicate that the duration is configurable with a default of 15 minutes.📝 Suggested revision
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
74-74: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
74-74: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
🤖 Prompt for AI Agents