-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Console SDK update for version 13.2.0 #98
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
Changes from all commits
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 |
|---|---|---|
| @@ -1,5 +1,27 @@ | ||
| # Change Log | ||
|
|
||
| ## 13.2.0 | ||
|
|
||
| * Added: `Apps` service for managing OAuth2 apps, secrets, and tokens | ||
| * Added: `Compute` service for dedicated database management (backups, branches, connections, replicas, restorations) | ||
| * Added: `Advisor` service with `listInsights`, `getInsight`, `listReports`, `getReport`, and `deleteReport` | ||
| * Added: `getAuditsDB` method on `Health` service | ||
| * Added: `createSesProvider` and `updateSesProvider` methods on `Messaging` service | ||
| * Added: `updateOAuth2Server` method on `Project` service | ||
| * Added: `updatePasswordStrengthPolicy` method on `Project` service | ||
| * Added: Models for dedicated databases, apps, advisor insights/reports, and new password policies | ||
| * Updated: `getPolicy` now also returns password-strength and email-deny policy types | ||
| * Updated: Renamed enums to match server naming (`FunctionRuntime` to `Runtime`, `SiteFramework` to `Framework`, `SiteBuildRuntime` to `BuildRuntime`, `SiteAdapter` to `Adapter`, `MigrationOnDuplicate` to `OnDuplicate`, `RedirectStatusCode` to `StatusCode`, `OrganizationAddon` to `Addon`, `ProjectStatus` to `Status`) | ||
| * Updated: `X-Appwrite-Project` is now sent per request instead of set globally on `setProject` | ||
|
|
||
| ## 13.1.0 | ||
|
|
||
| * Added: `Organization` service with organization-scoped key methods (`listKeys`, `createKey`, `getKey`, `updateKey`, `deleteKey`) | ||
| * Added: `Presences` service with `list`, `get`, and `getUsage` methods | ||
|
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.
The changelog claims the Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| * Added: `Usage` service with `listEvents` and `listGauges` methods | ||
| * Added: `listOrganizationScopes` and `getEmailTemplate` methods on `Console` service | ||
| * Updated: Renamed enums for clearer namespacing (e.g. `Scopes` to `AccountKeyScopes`, `Theme` to `BrowserTheme`, `Runtime` to `FunctionRuntime`) | ||
|
|
||
| ## 13.0.0 | ||
|
|
||
| * Breaking: Renamed `updateCanonicalEmails` to `updateDenyCanonicalEmailPolicy` on `Project` service | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ```javascript | ||
| import { Client, Advisor } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const advisor = new Advisor(client); | ||
|
|
||
| const result = await advisor.deleteReport({ | ||
| reportId: '<REPORT_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```javascript | ||
| import { Client, Advisor } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const advisor = new Advisor(client); | ||
|
|
||
| const result = await advisor.getInsight({ | ||
| reportId: '<REPORT_ID>', | ||
| insightId: '<INSIGHT_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ```javascript | ||
| import { Client, Advisor } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const advisor = new Advisor(client); | ||
|
|
||
| const result = await advisor.getReport({ | ||
| reportId: '<REPORT_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ```javascript | ||
| import { Client, Advisor } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const advisor = new Advisor(client); | ||
|
|
||
| const result = await advisor.listInsights({ | ||
| reportId: '<REPORT_ID>', | ||
| queries: [], // optional | ||
| total: false // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```javascript | ||
| import { Client, Advisor } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const advisor = new Advisor(client); | ||
|
|
||
| const result = await advisor.listReports({ | ||
| queries: [], // optional | ||
| total: false // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.createSecret({ | ||
| appId: '<APP_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.create({ | ||
| appId: '<APP_ID>', | ||
| name: '<NAME>', | ||
| redirectUris: [], | ||
| enabled: false, // optional | ||
| internal: false, // optional | ||
| type: 'public', // optional | ||
| teamId: '<TEAM_ID>' // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.deleteSecret({ | ||
| appId: '<APP_ID>', | ||
| secretId: '<SECRET_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.deleteTokens({ | ||
| appId: '<APP_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.delete({ | ||
| appId: '<APP_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.getSecret({ | ||
| appId: '<APP_ID>', | ||
| secretId: '<SECRET_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.get({ | ||
| appId: '<APP_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.listSecrets({ | ||
| appId: '<APP_ID>', | ||
| queries: [], // optional | ||
| total: false // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.list({ | ||
| queries: [], // optional | ||
| total: false // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.updateTeam({ | ||
| appId: '<APP_ID>', | ||
| teamId: '<TEAM_ID>' | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ```javascript | ||
| import { Client, Apps } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const apps = new Apps(client); | ||
|
|
||
| const result = await apps.update({ | ||
| appId: '<APP_ID>', | ||
| name: '<NAME>', | ||
| enabled: false, // optional | ||
| internal: false, // optional | ||
| redirectUris: [], // optional | ||
| type: 'public' // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ```javascript | ||
| import { Client, Compute } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const compute = new Compute(client); | ||
|
|
||
| const result = await compute.createDatabaseBackupPolicy({ | ||
| databaseId: '<DATABASE_ID>', | ||
| policyId: '<POLICY_ID>', | ||
| name: '<NAME>', | ||
| schedule: '', | ||
| retention: 1, | ||
| type: 'full', // optional | ||
| enabled: false // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```javascript | ||
| import { Client, Compute } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const compute = new Compute(client); | ||
|
|
||
| const result = await compute.createDatabaseBackup({ | ||
| databaseId: '<DATABASE_ID>', | ||
| type: 'full' // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ```javascript | ||
| import { Client, Compute } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const compute = new Compute(client); | ||
|
|
||
| const result = await compute.createDatabaseBranch({ | ||
| databaseId: '<DATABASE_ID>', | ||
| branchId: '<BRANCH_ID>', // optional | ||
| ttl: 300 // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ```javascript | ||
| import { Client, Compute } from "@appwrite.io/console"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| const compute = new Compute(client); | ||
|
|
||
| const result = await compute.createDatabaseConnection({ | ||
| databaseId: '<DATABASE_ID>', | ||
| username: '<USERNAME>', | ||
| role: '<ROLE>' // optional | ||
| }); | ||
|
|
||
| console.log(result); | ||
| ``` |
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.
The changelog mentions only the five key-management methods on
Organization, butsrc/services/organization.tsalso exposes a full set of project CRUD operations:listProjects,createProject,getProject,updateProject, anddeleteProject. None of these appeared in any prior changelog version, so they are also new in 13.1.0 and should be documented here.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!